mo 4 سال پیش
والد
کامیت
0be918ecc2
2فایلهای تغییر یافته به همراه121 افزوده شده و 80 حذف شده
  1. 50 22
      src/views/accompanyManager/accompanys.vue
  2. 71 58
      src/views/teamBuild/teamDraft.vue

+ 50 - 22
src/views/accompanyManager/accompanys.vue

@@ -223,17 +223,17 @@
         label-width="80px;"
         :inline="true"
       >
-         <el-form-item label="课程开始时间" prop="coursesStartDate">
+        <el-form-item label="有效期开始时间" prop="coursesStartDate">
           <el-date-picker
             v-model.trim="expireForm.coursesStartDate"
             style="width: 200px !important"
             type="date"
-            :picker-options="bigin"
+            :picker-options="startBigin()"
             value-format="yyyy-MM-dd"
             placeholder="选择日期"
           ></el-date-picker>
         </el-form-item>
-        <el-form-item label="课程结束时间" prop="coursesExpireDate">
+        <el-form-item label="有效期结束时间" prop="coursesExpireDate">
           <el-date-picker
             v-model.trim="expireForm.coursesExpireDate"
             style="width: 200px !important"
@@ -244,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">
@@ -657,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";
@@ -709,12 +711,15 @@ export default {
       startTime: null,
       expireForm: {
         coursesExpireDate: null,
-        coursesStartDate:null,
+        coursesStartDate: null,
         tempCoursesExpireDate: null,
       },
       expireRules: {
+        coursesStartDate: [
+          { required: true, message: "请选择有效期开始时间", trigger: "blur" },
+        ],
         coursesExpireDate: [
-          { required: true, message: "请选择课程结束时间", trigger: "blur" },
+          { required: true, message: "请选择有效期结束时间", trigger: "blur" },
         ],
       },
       maskRules: {
@@ -801,10 +806,12 @@ export default {
       this.practiceId = this.$route.query.id;
       this.userId = this.$route.query.userId;
       this.courseType = this.$route.query.type;
-            this.timers =
-              this.$route.query.coursesStartDate.substring(0, 10) +
-              "至" +
-             this.$route.query.coursesExpireDate.substring(0, 10);
+      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) {
@@ -887,12 +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
-            );
-
-
             let originalStartDate = this.courseData[0].coursesStartDate
               ? new Date(this.courseData[0].coursesStartDate)
               : new Date();
@@ -925,6 +926,7 @@ export default {
     },
     beginDate() {
       let self = this;
+
       return {
         firstDayOfWeek: 1,
         disabledDate(time) {
@@ -940,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();
@@ -1008,7 +1035,6 @@ export default {
       this.teacherVisible = false;
     },
     handleClose() {
-      console.log(true);
       this.$refs["maskForm"].resetFields();
       this.courseVisible = false;
       // this.startTime = "";
@@ -1026,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) {
@@ -1362,8 +1391,7 @@ export default {
       }
     },
   },
-  computed: {
-  },
+  computed: {},
 };
 </script>
 <style lang="scss" scoped>

+ 71 - 58
src/views/teamBuild/teamDraft.vue

@@ -2,32 +2,41 @@
   <div class="m-container">
     <div class="line"></div>
     <h2>
-      <el-page-header @back="goBack"
-                      :content="pageName"> </el-page-header>
+      <el-page-header @back="goBack" :content="pageName"> </el-page-header>
     </h2>
     <div class="m-core">
       <div class="stepbox">
         <!--  @click="activeIndex = 0" -->
         <span class="stepspan stepspan1">
-          <div class="step1 sptep"
-               :class="activeIndex >= 0 ? 'activestep' : ''">
+          <div
+            class="step1 sptep"
+            :class="activeIndex >= 0 ? 'activestep' : ''"
+          >
             基本信息
           </div>
-          <img :src="activeIndex  >=  0 ? stepImgs.nol : stepImgs.active"
-               alt=""
-               class="arrow" />
+          <img
+            :src="activeIndex >= 0 ? stepImgs.nol : stepImgs.active"
+            alt=""
+            class="arrow"
+          />
         </span>
         <!-- @click="activeIndex = 1" -->
-        <span class="stepspan stepspan2"
-              v-if="showFlag?activeIndex>= 1:true">
+        <span
+          class="stepspan stepspan2"
+          v-if="showFlag ? activeIndex >= 1 : true"
+        >
           <!--    -->
-          <div class="step2 sptep"
-               :class="activeIndex  >= 1 ? 'activestep' : ''">
+          <div
+            class="step2 sptep"
+            :class="activeIndex >= 1 ? 'activestep' : ''"
+          >
             声部设置
           </div>
-          <img :src="activeIndex >=  1 ? stepImgs.nol : stepImgs.active"
-               alt=""
-               class="arrow" />
+          <img
+            :src="activeIndex >= 1 ? stepImgs.nol : stepImgs.active"
+            alt=""
+            class="arrow"
+          />
         </span>
         <!--  @click="activeIndex = 2" -->
         <!-- <span class="stepspan stepspan3"
@@ -45,17 +54,21 @@
       <!-- 下面显示的内容 -->
       <div class="stepcontent">
         <div v-show="activeIndex == 0">
-          <teamBaseInfo @chiosetab="chiosetab"
-          @getName="getName"
-                        ref='teamBaseInfo'
-                        :getTeamList="getTeamList"
-                        @getBaseInfo="getBaseInfo" />
+          <teamBaseInfo
+            @chiosetab="chiosetab"
+            @getName="getName"
+            ref="teamBaseInfo"
+            :getTeamList="getTeamList"
+            @getBaseInfo="getBaseInfo"
+          />
         </div>
         <!-- v-if="showSecond" -->
-        <div v-if="activeIndex == 1"  >
-          <teamSoundMoney @chiosetab="chiosetab"
-                          :getTeamList="getTeamList"
-                          @getBaseInfo="getBaseInfo" />
+        <div v-if="activeIndex == 1">
+          <teamSoundMoney
+            @chiosetab="chiosetab"
+            :getTeamList="getTeamList"
+            @getBaseInfo="getBaseInfo"
+          />
         </div>
         <!-- <div v-if="activeIndex == 2">
           <teamPayInfo @chiosetab="chiosetab"
@@ -74,7 +87,7 @@ import merge from "webpack-merge";
 export default {
   components: { teamBaseInfo, teamSoundMoney, teamPayInfo },
   name: "teamDraft",
-  data () {
+  data() {
     return {
       activeIndex: 0,
       stepImgs: {
@@ -84,31 +97,29 @@ export default {
       pageName: "建团申请",
       getTeamList: [],
       teamStatus: "",
-       showSecond:false
+      showSecond: false,
     };
   },
-  created () {
+  created() {
     // 判断 是新建乐团还是修改乐团
     // this.activeIndex = 0;
     this.init();
   },
-  activated () {
-
-    if( this.$route.query.clear == 'true'){
-
-       this.showSecond=false
-        this.$store.dispatch("draftIndex", 0);
-                this.$router.push({
-      query: merge(this.$route.query, { clear: false }),
-    });
+  activated() {
+    if (this.$route.query.clear == "true") {
+      this.showSecond = false;
+      this.$store.dispatch("draftIndex", 0);
+      this.$router.push({
+        query: merge(this.$route.query, { clear: false }),
+      });
     }
     this.init();
   },
-    destroyed() {
-    this.showSecond=false
+  destroyed() {
+    this.showSecond = false;
   },
   methods: {
-    init () {
+    init() {
       this.teamStatus = this.$route.query.type;
       if (this.$route.query.teamList) {
         this.getTeamList = this.$route.query.teamList;
@@ -117,40 +128,42 @@ export default {
       if (this.teamStatus == "newTeam") {
         // 新建团
         this.pageName = "建团申请";
-          this.activeIndex = this.$store.getters.buildIndex || 0
+        this.activeIndex = this.$store.getters.buildIndex || 0;
       } else {
-             console.log( this.$store.getters.draftIndex,this.activeIndex)
+        console.log(this.$store.getters.draftIndex, this.activeIndex);
         this.pageName = "乐团修改";
-       this.activeIndex = this.$store.getters.draftIndex || 0
+        this.activeIndex = this.$store.getters.draftIndex || 0;
       }
-
     },
-    chiosetab (val) {
+    chiosetab(val) {
       this.activeIndex = val;
-      if (val == 0 && this.teamStatus != "newTeam" || val == 0 && this.teamStatus != "feeAudit") {
-        this.$refs.teamBaseInfo.init()
+      if (
+        (val == 0 && this.teamStatus != "newTeam") ||
+        (val == 0 && this.teamStatus != "feeAudit")
+      ) {
+        this.$refs.teamBaseInfo.init();
       }
-        this.showSecond = true;
+      this.showSecond = true;
     },
-    goBack () {
-      this.$store.dispatch('delVisitedViews', this.$route)
+    goBack() {
+      this.$store.dispatch("delVisitedViews", this.$route);
       this.$router.push({
         path: "/business/teamDetail",
       });
     },
-    getBaseInfo (baseInfo) {
-      this.baseInfo = baseInfo
-      this.pageName = baseInfo.musicGroup?.name
+    getBaseInfo(baseInfo) {
+      this.baseInfo = baseInfo;
+      this.pageName = baseInfo.musicGroup?.name;
+    },
+    getName(name) {
+      this.pageName = name;
     },
-    getName(name){
-       this.pageName = name
-    }
   },
   computed: {
-    showFlag () {
-      return (this.teamStatus == 'newTeam' || this.teamStatus == 'teamList')
-    }
-  }
+    showFlag() {
+      return this.teamStatus == "newTeam" || this.teamStatus == "teamList";
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>