|  | @@ -223,7 +223,17 @@
 | 
	
		
			
				|  |  |          label-width="120px"
 | 
	
		
			
				|  |  |          :inline="true"
 | 
	
		
			
				|  |  |        >
 | 
	
		
			
				|  |  | -        <el-form-item label="课程结束时间" prop="coursesExpireDate">
 | 
	
		
			
				|  |  | +        <el-form-item label="有效期开始时间" prop="coursesStartDate">
 | 
	
		
			
				|  |  | +          <el-date-picker
 | 
	
		
			
				|  |  | +            v-model.trim="expireForm.coursesStartDate"
 | 
	
		
			
				|  |  | +            style="width: 200px !important"
 | 
	
		
			
				|  |  | +            type="date"
 | 
	
		
			
				|  |  | +            :picker-options="startBigin()"
 | 
	
		
			
				|  |  | +            value-format="yyyy-MM-dd"
 | 
	
		
			
				|  |  | +            placeholder="选择日期"
 | 
	
		
			
				|  |  | +          ></el-date-picker>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item label="有效期结束时间" prop="coursesExpireDate">
 | 
	
		
			
				|  |  |            <el-date-picker
 | 
	
		
			
				|  |  |              v-model.trim="expireForm.coursesExpireDate"
 | 
	
		
			
				|  |  |              style="width: 200px !important"
 | 
	
	
		
			
				|  | @@ -234,7 +244,8 @@
 | 
	
		
			
				|  |  |            ></el-date-picker>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  |          <div style="padding-left: 15px; color: red">
 | 
	
		
			
				|  |  | -          课程结束时间不得早于,{{ expireForm.tempCoursesExpireDate }}
 | 
	
		
			
				|  |  | +          <p>有效期开始时间不得晚于课程组第一节课日期</p>
 | 
	
		
			
				|  |  | +          <p>有效期结束时间不得早于,{{ expireForm.tempCoursesExpireDate }}</p>
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  |        </el-form>
 | 
	
		
			
				|  |  |        <div slot="footer" class="dialog-footer">
 | 
	
	
		
			
				|  | @@ -647,6 +658,7 @@ import {
 | 
	
		
			
				|  |  |    batchAppendVipGroupCourses,
 | 
	
		
			
				|  |  |    bathDelete,
 | 
	
		
			
				|  |  |  } from "@/api/vipSeting";
 | 
	
		
			
				|  |  | +import merge from "webpack-merge";
 | 
	
		
			
				|  |  |  // import { start } from 'repl';
 | 
	
		
			
				|  |  |  import { diffTimerFormMinute, addTimerFormMinute } from "@/utils/date";
 | 
	
		
			
				|  |  |  import dayjs from "dayjs";
 | 
	
	
		
			
				|  | @@ -699,11 +711,15 @@ export default {
 | 
	
		
			
				|  |  |        startTime: null,
 | 
	
		
			
				|  |  |        expireForm: {
 | 
	
		
			
				|  |  |          coursesExpireDate: null,
 | 
	
		
			
				|  |  | +        coursesStartDate: null,
 | 
	
		
			
				|  |  |          tempCoursesExpireDate: null,
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        expireRules: {
 | 
	
		
			
				|  |  | +        coursesStartDate: [
 | 
	
		
			
				|  |  | +          { required: true, message: "请选择有效期开始时间", trigger: "blur" },
 | 
	
		
			
				|  |  | +        ],
 | 
	
		
			
				|  |  |          coursesExpireDate: [
 | 
	
		
			
				|  |  | -          { required: true, message: "请选择课程结束时间", trigger: "blur" },
 | 
	
		
			
				|  |  | +          { required: true, message: "请选择有效期结束时间", trigger: "blur" },
 | 
	
		
			
				|  |  |          ],
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        maskRules: {
 | 
	
	
		
			
				|  | @@ -790,6 +806,12 @@ export default {
 | 
	
		
			
				|  |  |        this.practiceId = this.$route.query.id;
 | 
	
		
			
				|  |  |        this.userId = this.$route.query.userId;
 | 
	
		
			
				|  |  |        this.courseType = this.$route.query.type;
 | 
	
		
			
				|  |  | +      this.expireForm.coursesExpireDate = this.$route.query.coursesExpireDate;
 | 
	
		
			
				|  |  | +      this.expireForm.coursesStartDate = this.$route.query.coursesStartDate;
 | 
	
		
			
				|  |  | +      this.timers =
 | 
	
		
			
				|  |  | +        this.$route.query.coursesStartDate +
 | 
	
		
			
				|  |  | +        "至" +
 | 
	
		
			
				|  |  | +        this.$route.query.coursesExpireDate;
 | 
	
		
			
				|  |  |        //  获取乐团主管
 | 
	
		
			
				|  |  |        findEducationUsers().then((res) => {
 | 
	
		
			
				|  |  |          if (res.code == 200) {
 | 
	
	
		
			
				|  | @@ -872,15 +894,6 @@ export default {
 | 
	
		
			
				|  |  |            this.courseData = res.data.rows;
 | 
	
		
			
				|  |  |            if (this.courseData.length > 0) {
 | 
	
		
			
				|  |  |              this.name = this.courseData[0].name;
 | 
	
		
			
				|  |  | -            this.expireForm.coursesExpireDate = this.courseData[0].coursesExpireDate.substring(
 | 
	
		
			
				|  |  | -              0,
 | 
	
		
			
				|  |  | -              10
 | 
	
		
			
				|  |  | -            );
 | 
	
		
			
				|  |  | -            this.timers =
 | 
	
		
			
				|  |  | -              this.courseData[0].coursesStartDate.substring(0, 10) +
 | 
	
		
			
				|  |  | -              "至" +
 | 
	
		
			
				|  |  | -              this.courseData[0].coursesExpireDate.substring(0, 10);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              let originalStartDate = this.courseData[0].coursesStartDate
 | 
	
		
			
				|  |  |                ? new Date(this.courseData[0].coursesStartDate)
 | 
	
		
			
				|  |  |                : new Date();
 | 
	
	
		
			
				|  | @@ -913,6 +926,7 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      beginDate() {
 | 
	
		
			
				|  |  |        let self = this;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        return {
 | 
	
		
			
				|  |  |          firstDayOfWeek: 1,
 | 
	
		
			
				|  |  |          disabledDate(time) {
 | 
	
	
		
			
				|  | @@ -928,15 +942,40 @@ export default {
 | 
	
		
			
				|  |  |          },
 | 
	
		
			
				|  |  |        };
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    startBigin(){
 | 
	
		
			
				|  |  | +      let timer;
 | 
	
		
			
				|  |  | +        if(this.tableList[0]?.classDate){
 | 
	
		
			
				|  |  | +           timer = this.tableList[0]?.classDate
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      return {
 | 
	
		
			
				|  |  | +        firstDayOfWeek: 1,
 | 
	
		
			
				|  |  | +        disabledDate(time) {
 | 
	
		
			
				|  |  | +          // 该时间不可调整到课程组第一节课程开始时间之后
 | 
	
		
			
				|  |  | +          if (timer) {
 | 
	
		
			
				|  |  | +            return (
 | 
	
		
			
				|  |  | +              new Date(timer).getTime() <
 | 
	
		
			
				|  |  | +              time.getTime()
 | 
	
		
			
				|  |  | +            );
 | 
	
		
			
				|  |  | +          } else {
 | 
	
		
			
				|  |  | +            return time.getTime() >= Date.now()
 | 
	
		
			
				|  |  | +            //开始时间不选时,结束时间最大值小于等于当天
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +      };
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      submitExpireDate() {
 | 
	
		
			
				|  |  |        this.$refs.expireForm.validate((some) => {
 | 
	
		
			
				|  |  |          if (some) {
 | 
	
		
			
				|  |  |            updateCoursesExpireDate({
 | 
	
		
			
				|  |  |              practiceGroupId: this.practiceId,
 | 
	
		
			
				|  |  |              coursesExpireDate: this.expireForm.coursesExpireDate,
 | 
	
		
			
				|  |  | +            coursesStartDate: this.expireForm.coursesStartDate,
 | 
	
		
			
				|  |  |            }).then((res) => {
 | 
	
		
			
				|  |  |              if (res.code == 200) {
 | 
	
		
			
				|  |  |                this.$message.success("有效期修改成功");
 | 
	
		
			
				|  |  | +              this.$router.push({
 | 
	
		
			
				|  |  | +                query: merge(this.$route.query, { coursesStartDate: this.expireForm.coursesStartDate,coursesExpireDate:this.expireForm.coursesExpireDate }),
 | 
	
		
			
				|  |  | +              });
 | 
	
		
			
				|  |  |                this.expireVisible = false;
 | 
	
		
			
				|  |  |                this.getCourseGroup();
 | 
	
		
			
				|  |  |                this.getList();
 | 
	
	
		
			
				|  | @@ -996,7 +1035,6 @@ export default {
 | 
	
		
			
				|  |  |        this.teacherVisible = false;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      handleClose() {
 | 
	
		
			
				|  |  | -      console.log(true);
 | 
	
		
			
				|  |  |        this.$refs["maskForm"].resetFields();
 | 
	
		
			
				|  |  |        this.courseVisible = false;
 | 
	
		
			
				|  |  |        // this.startTime = "";
 | 
	
	
		
			
				|  | @@ -1014,10 +1052,13 @@ export default {
 | 
	
		
			
				|  |  |      submitResetClass() {
 | 
	
		
			
				|  |  |        //   endClassTimeStr: this.maskForm.endTime,
 | 
	
		
			
				|  |  |        let maskForm = this.maskForm;
 | 
	
		
			
				|  |  | -      let diff = dayjs(maskForm.date+' '+maskForm.startTime).diff(new Date,'second')
 | 
	
		
			
				|  |  | -      if(diff<=0){
 | 
	
		
			
				|  |  | +      let diff = dayjs(maskForm.date + " " + maskForm.startTime).diff(
 | 
	
		
			
				|  |  | +        new Date(),
 | 
	
		
			
				|  |  | +        "second"
 | 
	
		
			
				|  |  | +      );
 | 
	
		
			
				|  |  | +      if (diff <= 0) {
 | 
	
		
			
				|  |  |          this.$message.error("课程开始时间必须大于当前时间");
 | 
	
		
			
				|  |  | -        return
 | 
	
		
			
				|  |  | +        return;
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        this.$refs.maskForm.validate((valid) => {
 | 
	
		
			
				|  |  |          if (valid) {
 | 
	
	
		
			
				|  | @@ -1350,8 +1391,7 @@ export default {
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  | -  computed: {
 | 
	
		
			
				|  |  | -  },
 | 
	
		
			
				|  |  | +  computed: {},
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  </script>
 | 
	
		
			
				|  |  |  <style lang="scss" scoped>
 |