Tang 1 년 전
부모
커밋
ba6515b606
1개의 변경된 파일26개의 추가작업 그리고 10개의 파일을 삭제
  1. 26 10
      src/components/dataReview/index.vue

+ 26 - 10
src/components/dataReview/index.vue

@@ -207,6 +207,8 @@ export default {
       uploading: false,
       isShow: false,
       activeData: {},
+      idcard_face_photo_old: "",
+      recent_photos_old: "",
       STATUS: false //区分个人中心入口操作
     };
   },
@@ -297,7 +299,7 @@ export default {
                 trigger: i.inputType == 1 ? "blur" : "change"
               }
             ];
-            if (i.fieldKey == "unit_tel") {
+            if (i.fieldKey == "unit_tel" && i.required) {
               Obj[i.fieldKey].push({
                 validator: (rule, value, callback) => {
                   var reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
@@ -419,6 +421,12 @@ export default {
       if (Object.keys(this.historyData).length > 0 || this.historyData.id) {
         for (let i in this.historyData) {
           this.$set(this.infoForm, i, this.historyData[i].value);
+          if (i == "recent_photos") {
+            this.recent_photos_old = this.historyData[i].value;
+          }
+          if (i == "idcard_face_photo") {
+            this.idcard_face_photo_old = this.historyData[i].value;
+          }
         }
         this.$nextTick(() => {
           this.$refs["infoForm"].clearValidate();
@@ -483,10 +491,12 @@ export default {
         }
         if (
           !this.infoForm["education"] &&
-          this.$store.state.userInfo.eduLevel
-           && !(this.activeData.educationName == "继续教育" &&
-          this.activeData.projectName == "施工现场专业人员" &&
-          this.activeData.businessName == "七大员")
+          this.$store.state.userInfo.eduLevel &&
+          !(
+            this.activeData.educationName == "继续教育" &&
+            this.activeData.projectName == "施工现场专业人员" &&
+            this.activeData.businessName == "七大员"
+          )
         ) {
           this.$set(
             this.infoForm,
@@ -503,6 +513,7 @@ export default {
             "recent_photos",
             this.$store.state.userInfo.oneInchPhotos
           );
+          this.recent_photos_old = this.$store.state.userInfo.oneInchPhotos;
         }
         if (
           !this.infoForm["idcard_face_photo"] &&
@@ -513,6 +524,7 @@ export default {
             "idcard_face_photo",
             this.$store.state.userInfo.idCardImg1
           );
+          this.idcard_face_photo_old = this.$store.state.userInfo.idCardImg1;
         }
         if (
           !this.infoForm["idcard_national_photo"] &&
@@ -542,7 +554,11 @@ export default {
             this.$set(this.infoForm, item, res.data.IdImgPath);
           }
         } else {
-          this.$set(this.infoForm, item, await this.$upload.upload(file,0,{},false));
+          this.$set(
+            this.infoForm,
+            item,
+            await this.$upload.upload(file, 0, {}, false)
+          );
         }
         this.$refs["infoForm"].validateField(item);
         e.target.value = "";
@@ -709,10 +725,10 @@ export default {
     //证件照与身份证匹配
     IdCardCompareFace() {
       return new Promise(async (resolve, reject) => {
-        if (
-          !this.infoForm["idcard_face_photo"] ||
-          !this.infoForm["recent_photos"]
-        ) {
+        if (!(
+          this.infoForm["idcard_face_photo"] &&
+          this.infoForm["recent_photos"] && (this.infoForm["idcard_face_photo"] !== this.idcard_face_photo_old || this.infoForm["recent_photos"] !== this.recent_photos_old)
+        )) {
           resolve();
           return;
         }