mo 3 lat temu
rodzic
commit
5fd843a535

+ 27 - 22
src/views/buildVip/index.vue

@@ -895,23 +895,6 @@ export default {
     //   this.$refs["leftForm"].resetFields();
     // }, 100);
     // 判断一下有没有缓存
-    this.$router.beforeEach(async (to, from, next) => {
-      if (this.leftForm?.classOrganId && from.path == "/business/buildVip") {
-        console.log(this.leftForm?.classOrganId);
-        this.$confirm("检测到您有未提交的数据, 离开将丢失该数据!", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          closeOnClickModal: false,
-          type: "warning",
-        })
-          .then(async () => {
-            next();
-          })
-          .catch((err) => {});
-      } else {
-        next();
-      }
-    });
     this.courseType = this.$route.query.courseType;
     if (this.courseType == "PRACTICE") {
       this.title = "网管课申请";
@@ -1016,7 +999,24 @@ export default {
     // }, 100);
     // this.init();
   },
-  async beforeDestroy() {},
+  beforeDestroy() {},
+  beforeRouteLeave(to, from, next) {
+    if (this.leftForm?.classOrganId && from.path == "/business/buildVip") {
+      console.log(this.leftForm?.classOrganId);
+      this.$confirm("检测到您有未提交的数据, 离开将丢失该数据!", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        closeOnClickModal: false,
+        type: "warning",
+      })
+        .then(() => {
+          next();
+        })
+        .catch((err) => {});
+    } else {
+      next();
+    }
+  },
   methods: {
     resetFrom() {
       this.leftForm = {
@@ -1126,13 +1126,18 @@ export default {
       return {
         firstDayOfWeek: 1,
         disabledDate: (time) => {
-          if (self.leftForm.courseStart&&self.leftForm.courseEnd) {
+          if (self.leftForm.courseStart && self.leftForm.courseEnd) {
             let date = new Date(self.leftForm.courseStart.replace(/-/, "/"));
             let endDate = new Date(self.leftForm.courseEnd.replace(/-/, "/"));
             let nowDate = new Date();
-            let changeDate =date.getTime() - nowDate.getTime() > 0 ? date : nowDate;
-            let endChangeDate =  endDate.getTime() - nowDate.getTime() > 0 ? endDate : nowDate;
-            return time.getTime() < changeDate.getTime() || time.getTime() > endChangeDate.getTime();
+            let changeDate =
+              date.getTime() - nowDate.getTime() > 0 ? date : nowDate;
+            let endChangeDate =
+              endDate.getTime() - nowDate.getTime() > 0 ? endDate : nowDate;
+            return (
+              time.getTime() < changeDate.getTime() ||
+              time.getTime() > endChangeDate.getTime()
+            );
           }
           return;
         },

+ 1 - 0
src/views/categroyManager/modals/payInfo.vue

@@ -494,6 +494,7 @@ export default {
       this.$emit("changeCourseType", val);
     },
     changeGiveCourseType(val) {
+       this.$emit('chageSalary')
       this.$emit("changeGiveCourseType", val);
     },
     chageSalary(val){

+ 7 - 4
src/views/categroyManager/vipNewActive.vue

@@ -189,7 +189,7 @@ export default {
       this.formatDetail(rusult.data);
     } else {
       this.payInfo = { ...payBaseForm };
-      this.salaryForm = { ...baseSalaryForm };
+      this.salaryForm = JSON.parse(JSON.stringify({ ...baseSalaryForm }));;
     }
   },
   methods: {
@@ -271,7 +271,9 @@ export default {
       this.$set(this.payForm, "giveTeachMode", "");
     },
     chageSalary() {
-      this.salaryForm = { ...baseSalaryForm };
+      this.salaryForm = null
+      this.salaryForm = JSON.parse(JSON.stringify({ ...baseSalaryForm }));
+
       this.$forceUpdate();
     },
     async submit() {
@@ -446,15 +448,16 @@ export default {
         giveMemberTime: data.giveMemberTime ? data.giveMemberTime : null,
       };
       // 格式化缴费金额
+        console.log(data.salarySettlementJson)
       if (data.salarySettlementJson && data.salarySettlementJson != "null") {
-        this.salaryForm = { ...baseSalaryForm };
+        this.salaryForm = JSON.parse(JSON.stringify({ ...baseSalaryForm }));;
         let result = JSON.parse(data.salarySettlementJson);
 
         for (let key in result) {
           this.salaryForm[key] = result[key];
         }
       } else {
-        this.salaryForm = { ...baseSalaryForm };
+        this.salaryForm = JSON.parse(JSON.stringify({ ...baseSalaryForm }));;
       }
       this.$forceUpdate();
     },