Parcourir la source

修复设置优先展示工作经历bug;

huan-jie il y a 4 ans
Parent
commit
28191f17a3
1 fichiers modifiés avec 22 ajouts et 6 suppressions
  1. 22 6
      components/sign/experience.vue

+ 22 - 6
components/sign/experience.vue

@@ -112,6 +112,9 @@ export default {
       if (res.status === 1) {
         this.$message.success("保存成功!");
         this.getData();
+      } else if (res.status === 2 && res.info.indexOf('管理员审核') > -1) {
+        // 保存工作经历,需要审核时,同样重新获取数据
+        this.getData();
       }
     },
     async getData() {
@@ -131,9 +134,9 @@ export default {
     },
     handleRankClose() {
       this.rankDialog = false;
-      this.rankForm = {
-        first: ""
-      };
+      // this.rankForm = {
+      //   first: ""
+      // };
     },
     handleRank() {
       let idx = 0;
@@ -143,9 +146,22 @@ export default {
         }
         return it;
       });
-      this.experience[idx].is_main = 1;
-      this.originExperience[idx].is_main = 1;
-      this.onSubmit(idx);
+      // this.experience.forEach((item, index) => {
+      //   if (idx === index) {
+      //     item.is_main = 1;
+      //   } else {
+      //     item.is_main = 0;
+      //   }
+      // })
+      this.originExperience.forEach((item, index) => {
+        if (idx === index) {
+          item.is_main = 1;
+        } else {
+          item.is_main = 0;
+        }
+      })
+      
+      this.onSubmit();
       this.rankDialog = false;
     },
     handleAdd() {