Tang před 2 roky
rodič
revize
e7c7851317

+ 91 - 31
src/components/dataReview/index.vue

@@ -378,51 +378,111 @@ export default {
     },
     //回填数据
     backFillData() {
-      if (this.historyData || this.historyData.id) {
+      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);
         }
         this.$nextTick(() => {
           this.$refs["infoForm"].clearValidate();
         });
-      }
-      if (!this.infoForm["name"]) {
-        if (this.$store.state.userInfo.realname) {
-          this.$set(this.infoForm, "name", this.$store.state.userInfo.realname);
+      } else {
+        if (!this.infoForm["name"]) {
+          if (this.$store.state.userInfo.realname) {
+            this.$set(
+              this.infoForm,
+              "name",
+              this.$store.state.userInfo.realname
+            );
+            this.nameDisabledStatus = true;
+          }
+        } else {
           this.nameDisabledStatus = true;
         }
-      } else {
-        this.nameDisabledStatus = true;
-      }
-      if (!this.infoForm["idcard"]) {
-        if (this.$store.state.userInfo.idCard) {
-          this.$set(this.infoForm, "idcard", this.$store.state.userInfo.idCard);
+        if (!this.infoForm["idcard"]) {
+          if (this.$store.state.userInfo.idCard) {
+            this.$set(
+              this.infoForm,
+              "idcard",
+              this.$store.state.userInfo.idCard
+            );
+            this.idcardDisabledStatus = true;
+          }
+        } else {
           this.idcardDisabledStatus = true;
         }
-      } else {
-        this.idcardDisabledStatus = true;
-      }
-      if (!this.infoForm["telphone"]) {
-        if (this.$store.state.userInfo.telphone) {
+        if (!this.infoForm["telphone"]) {
+          if (this.$store.state.userInfo.telphone) {
+            this.$set(
+              this.infoForm,
+              "telphone",
+              this.$store.state.userInfo.telphone
+            );
+            this.telphoneDisabledStatus = true;
+          }
+        } else {
+          this.telphoneDisabledStatus = true;
+        }
+        if (
+          !this.infoForm["work_unit"] &&
+          this.$store.state.userInfo.companyName
+        ) {
           this.$set(
             this.infoForm,
-            "telphone",
-            this.$store.state.userInfo.telphone
+            "work_unit",
+            this.$store.state.userInfo.companyName
+          );
+        }
+        if (!this.infoForm["sex"] && this.$store.state.userInfo.sex) {
+          this.$set(
+            this.infoForm,
+            "sex",
+            this.$store.state.userInfo.sex == 1
+              ? "男"
+              : this.$store.state.userInfo.sex == 2
+              ? "女"
+              : null
+          );
+        }
+        if (
+          !this.infoForm["education"] &&
+          this.$store.state.userInfo.eduLevel
+        ) {
+          this.$set(
+            this.infoForm,
+            "education",
+            this.$store.state.userInfo.eduLevel
+          );
+        }
+        if (
+          !this.infoForm["recent_photos"] &&
+          this.$store.state.userInfo.oneInchPhotos
+        ) {
+          this.$set(
+            this.infoForm,
+            "recent_photos",
+            this.$store.state.userInfo.oneInchPhotos
+          );
+        }
+        if (
+          !this.infoForm["idcard_face_photo"] &&
+          this.$store.state.userInfo.idCardImg1
+        ) {
+          this.$set(
+            this.infoForm,
+            "idcard_face_photo",
+            this.$store.state.userInfo.idCardImg1
+          );
+        }
+        if (
+          !this.infoForm["idcard_national_photo"] &&
+          this.$store.state.userInfo.idCardImg2
+        ) {
+          this.$set(
+            this.infoForm,
+            "idcard_national_photo",
+            this.$store.state.userInfo.idCardImg2
           );
-          this.telphoneDisabledStatus = true;
         }
-      } else {
-        this.telphoneDisabledStatus = true;
-      }
-      if (
-        !this.infoForm["work_unit"] &&
-        this.$store.state.userInfo.companyName
-      ) {
-        this.$set(
-          this.infoForm,
-          "work_unit",
-          this.$store.state.userInfo.companyName
-        );
       }
     },
     //照片处理逻辑

+ 8 - 8
src/pages/person-center/my-course/index.vue

@@ -1411,12 +1411,12 @@ export default {
                 line-height: 32px;
                 color: #fff;
 
-                &--normal {
-                  &.disabled {
+                // &--normal {
+                  // &.disabled {
                     // background: rgb(101, 164, 253);
                     // border-color: rgb(101, 164, 253);
-                  }
-                }
+                  // }
+                // }
 
                 &--warm {
                   background: #ff3b30;
@@ -1621,12 +1621,12 @@ export default {
           line-height: 32px;
           color: #fff;
 
-          &--normal {
-            &.disabled {
+          // &--normal {
+          //   &.disabled {
               // background: rgb(101, 164, 253);
               // border-color: rgb(101, 164, 253);
-            }
-          }
+          //   }
+          // }
 
           &--warm {
             background: #ff3b30;