|  | @@ -1,12 +1,18 @@
 | 
	
		
			
				|  |  |  <template>
 | 
	
		
			
				|  |  |    <div>
 | 
	
		
			
				|  |  | -    <div
 | 
	
		
			
				|  |  | -      class="newBand"
 | 
	
		
			
				|  |  | -      v-permission="'vipGroupManage/addVipGroupStudents'"
 | 
	
		
			
				|  |  | -      @click="addStudentList"
 | 
	
		
			
				|  |  | -    >
 | 
	
		
			
				|  |  | -      新增学员
 | 
	
		
			
				|  |  | +    <div class="btnWrap">
 | 
	
		
			
				|  |  | +      <el-button
 | 
	
		
			
				|  |  | +        v-permission="'vipGroupManage/addVipGroupStudents'"
 | 
	
		
			
				|  |  | +        @click="addStudentList"
 | 
	
		
			
				|  |  | +        type="primary"
 | 
	
		
			
				|  |  | +      >
 | 
	
		
			
				|  |  | +        新增学员
 | 
	
		
			
				|  |  | +      </el-button>
 | 
	
		
			
				|  |  | +      <el-button v-permission="'vipGroupManage/update'" @click="expireVisible = true"  type="primary">
 | 
	
		
			
				|  |  | +        有效期调整
 | 
	
		
			
				|  |  | +      </el-button>
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      <div class="tableWrap">
 | 
	
		
			
				|  |  |        <el-table
 | 
	
		
			
				|  |  |          :data="tableList"
 | 
	
	
		
			
				|  | @@ -123,7 +129,7 @@
 | 
	
		
			
				|  |  |          <el-table-column prop="courseSalary" label="课程余额"></el-table-column>
 | 
	
		
			
				|  |  |        </el-table>
 | 
	
		
			
				|  |  |        <pagination
 | 
	
		
			
				|  |  | -      save-key='vipDetail-vipStudentList'
 | 
	
		
			
				|  |  | +        save-key="vipDetail-vipStudentList"
 | 
	
		
			
				|  |  |          sync
 | 
	
		
			
				|  |  |          :total.sync="rules.total"
 | 
	
		
			
				|  |  |          :page.sync="rules.page"
 | 
	
	
		
			
				|  | @@ -172,7 +178,6 @@
 | 
	
		
			
				|  |  |          <el-form-item label="排课起始时间" prop="courseTime">
 | 
	
		
			
				|  |  |            <el-date-picker
 | 
	
		
			
				|  |  |              v-model.trim="adjustmentForm.courseTime"
 | 
	
		
			
				|  |  | -            @change="changeCourseTime"
 | 
	
		
			
				|  |  |              :picker-options="pickerOptions"
 | 
	
		
			
				|  |  |              style="width: 200px !important"
 | 
	
		
			
				|  |  |              type="date"
 | 
	
	
		
			
				|  | @@ -181,15 +186,7 @@
 | 
	
		
			
				|  |  |            >
 | 
	
		
			
				|  |  |            </el-date-picker>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  | -        <!-- vipGroupManage/recoverForStudent1 -->
 | 
	
		
			
				|  |  | -        <el-form-item label="剩余有效期" prop="days">
 | 
	
		
			
				|  |  | -          <el-input-number :controls='false'
 | 
	
		
			
				|  |  | -          class="inputNumber"
 | 
	
		
			
				|  |  | -            style="width: 200px !important;"
 | 
	
		
			
				|  |  | -            :disabled="!permission('vipGroupManage/recoverForStudent1')"
 | 
	
		
			
				|  |  | -            v-model.trim="adjustmentForm.days"
 | 
	
		
			
				|  |  | -          ></el-input-number>
 | 
	
		
			
				|  |  | -        </el-form-item>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          <el-form-item label="有效期截止" prop="expireDate">
 | 
	
		
			
				|  |  |            <el-date-picker
 | 
	
		
			
				|  |  |              :disabled="true"
 | 
	
	
		
			
				|  | @@ -265,11 +262,39 @@
 | 
	
		
			
				|  |  |          <el-button type="primary" @click="submieRecover">确 定</el-button>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |      </el-dialog>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <!-- 有效期调整 -->
 | 
	
		
			
				|  |  | +    <el-dialog title="有效期调整" width="400px" :visible.sync="expireVisible">
 | 
	
		
			
				|  |  | +      <el-form
 | 
	
		
			
				|  |  | +        :model="expireForm"
 | 
	
		
			
				|  |  | +        ref="expireForm"
 | 
	
		
			
				|  |  | +        :rules="expireRules"
 | 
	
		
			
				|  |  | +        label-position="right"
 | 
	
		
			
				|  |  | +        label-width="80px;"
 | 
	
		
			
				|  |  | +        :inline="true"
 | 
	
		
			
				|  |  | +      >
 | 
	
		
			
				|  |  | +        <el-form-item label="课程结束时间" prop="coursesExpireDate">
 | 
	
		
			
				|  |  | +          <el-date-picker
 | 
	
		
			
				|  |  | +            v-model.trim="expireForm.coursesExpireDate"
 | 
	
		
			
				|  |  | +            style="width: 200px !important"
 | 
	
		
			
				|  |  | +            type="date"
 | 
	
		
			
				|  |  | +            :picker-options="pickerOptions"
 | 
	
		
			
				|  |  | +            value-format="yyyy-MM-dd"
 | 
	
		
			
				|  |  | +            placeholder="选择日期"
 | 
	
		
			
				|  |  | +          ></el-date-picker>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <!-- <div style="padding-left: 15px; color: red;">课程结束时间不得晚于,{{ expireForm.tempCoursesExpireDate }}</div> -->
 | 
	
		
			
				|  |  | +      </el-form>
 | 
	
		
			
				|  |  | +      <div slot="footer" class="dialog-footer">
 | 
	
		
			
				|  |  | +        <el-button @click="expireVisible = false">取 消</el-button>
 | 
	
		
			
				|  |  | +        <el-button type="primary" @click="submitExpireDate">确 定</el-button>
 | 
	
		
			
				|  |  | +      </div>
 | 
	
		
			
				|  |  | +    </el-dialog>
 | 
	
		
			
				|  |  |    </div>
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  |  import pagination from "@/components/Pagination/index";
 | 
	
		
			
				|  |  | -import dayjs from 'dayjs'
 | 
	
		
			
				|  |  | +import dayjs from "dayjs";
 | 
	
		
			
				|  |  |  import {
 | 
	
		
			
				|  |  |    findVipGroupStudents,
 | 
	
		
			
				|  |  |    leaveSchool,
 | 
	
	
		
			
				|  | @@ -280,12 +305,22 @@ import {
 | 
	
		
			
				|  |  |    getStudentPauseInfo,
 | 
	
		
			
				|  |  |    recoverForStudent,
 | 
	
		
			
				|  |  |    findTeacherWithVipGroupOrganAndSubject,
 | 
	
		
			
				|  |  | +  vipGroupManageUpdate,
 | 
	
		
			
				|  |  |  } from "@/api/vipSeting";
 | 
	
		
			
				|  |  |  import { permission } from "@/utils/directivePage";
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    components: { pagination },
 | 
	
		
			
				|  |  |    data() {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  | +      expireVisible: false,
 | 
	
		
			
				|  |  | +      expireForm: {
 | 
	
		
			
				|  |  | +        coursesExpireDate: "",
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      expireRules: {
 | 
	
		
			
				|  |  | +        coursesExpireDate: [
 | 
	
		
			
				|  |  | +          { required: true, message: "请选择课程结束时间", trigger: "blur" },
 | 
	
		
			
				|  |  | +        ],
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  |        adjustmentVisible: false,
 | 
	
		
			
				|  |  |        tableList: [],
 | 
	
		
			
				|  |  |        id: "",
 | 
	
	
		
			
				|  | @@ -310,7 +345,7 @@ export default {
 | 
	
		
			
				|  |  |          courseType: "",
 | 
	
		
			
				|  |  |          fee: "",
 | 
	
		
			
				|  |  |          teacher: "",
 | 
	
		
			
				|  |  | -        days: "",
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          expireDate: "",
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        adjustmentRules: {
 | 
	
	
		
			
				|  | @@ -319,7 +354,7 @@ export default {
 | 
	
		
			
				|  |  |          courseType: [{ required: true, message: "请选择课程类型" }],
 | 
	
		
			
				|  |  |          fee: [{ required: true, message: "请输入费用" }],
 | 
	
		
			
				|  |  |          teacher: [{ required: true, message: "请选择老师" }],
 | 
	
		
			
				|  |  | -        days: [{ required: true, message: "请输入剩余有效期" }],
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          expireDate: [{ required: true, message: "请输入有效期截止" }],
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        weekDateList: [
 | 
	
	
		
			
				|  | @@ -355,8 +390,8 @@ export default {
 | 
	
		
			
				|  |  |      this.__init();
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  | -    permission (str) {
 | 
	
		
			
				|  |  | -      console.log(permission(str))
 | 
	
		
			
				|  |  | +    permission(str) {
 | 
	
		
			
				|  |  | +      console.log(permission(str));
 | 
	
		
			
				|  |  |        return permission(str);
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      __init() {
 | 
	
	
		
			
				|  | @@ -557,7 +592,7 @@ export default {
 | 
	
		
			
				|  |  |              this.adjustmentVisible = true;
 | 
	
		
			
				|  |  |              this.adjustmentForm.teacher = res.data.teacherId;
 | 
	
		
			
				|  |  |              this.adjustmentForm.count = `${res.data.totalCourseTimes}+${res.data.giveCourseTimes}`;
 | 
	
		
			
				|  |  | -            this.adjustmentForm.days = res.data.days;
 | 
	
		
			
				|  |  | +            this.adjustmentForm.expireDate = res.data.expireDate;
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        });
 | 
	
	
		
			
				|  | @@ -602,7 +637,6 @@ export default {
 | 
	
		
			
				|  |  |            obj.courseTimes = [];
 | 
	
		
			
				|  |  |            obj.courseTimes = this.weekList;
 | 
	
		
			
				|  |  |            obj.vipGroupId = this.id;
 | 
	
		
			
				|  |  | -          obj.days = this.adjustmentForm.days;
 | 
	
		
			
				|  |  |            obj.expireDate = this.adjustmentForm.expireDate;
 | 
	
		
			
				|  |  |            recoverForStudent(obj).then((res) => {
 | 
	
		
			
				|  |  |              if (res.code == 200) {
 | 
	
	
		
			
				|  | @@ -616,18 +650,25 @@ export default {
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |        this.activeStudent;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    changeCourseTime(val) {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -      if(!this.adjustmentForm.days){
 | 
	
		
			
				|  |  | -        this.$message.error('请填写剩余有效期');
 | 
	
		
			
				|  |  | -        return
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | -      if(val){
 | 
	
		
			
				|  |  | -        this.adjustmentForm.expireDate = dayjs(val).add(this.adjustmentForm.days,'day').format('YYYY-MM-DD')
 | 
	
		
			
				|  |  | -      }else{
 | 
	
		
			
				|  |  | -        this.adjustmentForm.expireDate = ''
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +    submitExpireDate() {
 | 
	
		
			
				|  |  | +      this.$refs.expireForm.validate((some) => {
 | 
	
		
			
				|  |  | +        if (some) {
 | 
	
		
			
				|  |  | +          vipGroupManageUpdate({
 | 
	
		
			
				|  |  | +            id: this.id,
 | 
	
		
			
				|  |  | +            coursesExpireDate: this.expireForm.coursesExpireDate,
 | 
	
		
			
				|  |  | +          }).then((res) => {
 | 
	
		
			
				|  |  | +            if (res.code == 200) {
 | 
	
		
			
				|  |  | +              this.$message.success("有效期修改成功");
 | 
	
		
			
				|  |  | +              this.expireVisible = false;
 | 
	
		
			
				|  |  | +              this.getList();
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +              this.$message.error(res.msg);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          });
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +          return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |  };
 | 
	
	
		
			
				|  | @@ -640,7 +681,13 @@ export default {
 | 
	
		
			
				|  |  |    margin-right: 10px;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -/deep/.el-input-number .el-input__inner{
 | 
	
		
			
				|  |  | -text-align: left!important;
 | 
	
		
			
				|  |  | +/deep/.el-input-number .el-input__inner {
 | 
	
		
			
				|  |  | +  text-align: left !important;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +.btnWrap {
 | 
	
		
			
				|  |  | +  display: flex;
 | 
	
		
			
				|  |  | +  flex-direction: row;
 | 
	
		
			
				|  |  | +  justify-content: flex-start;
 | 
	
		
			
				|  |  | +  margin-bottom: 15px;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  </style>
 |