lex-xin 4 years ago
parent
commit
1b826dbb9d

+ 9 - 9
src/components/tab-router/index.vue

@@ -62,19 +62,19 @@ export default {
     },
     async tab(item, evt) {
 
-      if(this.$attrs['before-leave']){
-        try{
+      // if(this.$attrs['before-leave']){
+      //   try{
 
-            await this.$attrs['before-leave']().then(res=>{
-              console.log(res)
-            })
+      //       await this.$attrs['before-leave']().then(res=>{
+      //         console.log(res)
+      //       })
 
-        }catch(e){
-          console.log(e)
-        }
+      //   }catch(e){
+      //     console.log(e)
+      //   }
 
 
-      }
+      // }
       let { query } = this.$route;
       const search = qs.stringify({
         ...query,

+ 1 - 1
src/views/resetTeaming/index.vue

@@ -324,9 +324,9 @@ export default {
       // }
          console.log('checkGoTo')
       var p = new Promise(async (resolve, reject) => {
+        console.log(resolve, reject)
         if (this.activeIndex == 1 && this.$refs.teamBaseInfo) {
           if (await this.$refs.teamBaseInfo.setStore('go')) {
-            console.log('进来了')
             resolve();
           }
         } else {

+ 17 - 12
src/views/teamBuild/components/teamBaseInfo.vue

@@ -507,27 +507,29 @@ export default {
   // },
 
   methods: {
-    setStore(str) {
+    async setStore(str) {
       if (this.teamid) {
         let loadash = this.$helpers.lodash;
         let sotrage = JSON.parse(localStorage.getItem(`${this.teamid}base`));
         if (!loadash.isEqual(this.topFrom, sotrage) && sotrage) {
           // 提示保存
-          return this.$confirm("已修改当前页面数据是否保存", "提示", {
+          return await this.$confirm("已修改当前页面数据是否保存", "提示", {
             confirmButtonText: "是",
             cancelButtonText: "否",
             type: "warning",
           })
-            .then(() => {
+            .then(async () => {
               localStorage.setItem(
                 `${this.teamid}base`,
                 JSON.stringify(this.topFrom)
               );
-              return this.gotoNext(str);
+              let b =  await this.gotoNext(str)
+              console.log(b)
+              return b;
             })
             .catch(() => {
               // localStorage.setItem(`${this.teamid}base`,JSON.stringify(this.topFrom));
-            });
+            })
         } else {
           return true
           // localStorage.setItem(`${this.teamid}base`,JSON.stringify(this.topFrom));
@@ -713,11 +715,12 @@ export default {
       });
     },
     chioseSchool(val) {},
-    gotoNext(str) {
-      this.$refs["topinfo"].validate(async (valid, object) => {
+    async gotoNext(str) {
+      let tempStatus
+      await this.$refs["topinfo"].validate(async (valid, object) => {
         if (!valid) {
           this.$message.error("请填写建团必要参数");
-          return false
+          tempStatus = false
         } else {
           // 判断一下是否勾选了课程类型而没有输入金额
           // 验证通过
@@ -727,14 +730,15 @@ export default {
             this.$emit("handleClick", { name: "2" });
           } else {
                this.$emit("getName", this.topFrom.name);
-           return await this.resetSubmit(str);
+               tempStatus = await this.resetSubmit(str);
 
           }
         }
       });
+      return tempStatus
     },
-    resetSubmit(str) {
-      this.$refs["topinfo"].validate((valid, object) => {
+    async resetSubmit(str) {
+      this.$refs["topinfo"].validate(async (valid, object) => {
         if (!valid) {
           this.$message.error("请填写必要参数");
         } else {
@@ -798,7 +802,7 @@ export default {
           // obj.musicGroupPaymentEntities = [];
           // createTeam
           if (this.teamStatus != "newTeam") {
-            resetTeamBaseInfo(obj).then((res) => {
+            await resetTeamBaseInfo(obj).then((res) => {
               if (res.code == 200) {
 
                 localStorage.setItem(
@@ -883,6 +887,7 @@ export default {
           // 发请求
         }
       });
+      return true
     },
     changeApplyTime(val) {
       this.$set(this.topFrom, "paymentValidStartDate", "");

+ 1 - 1
src/views/teamDetail/teamCourseList.vue

@@ -378,7 +378,7 @@
                     'courseSchedule/batchDelete?page=teamCourseList'
                   "
                   >删除</el-button
-                > -->
+                >
                 <auth auths="/teamCourseListDetail">
                   <!--    v-if="permission('teamCourseList/details')" -->
                   <el-button type="text" @click="lookDetail(scope.row)"