wangJJ 5 years ago
parent
commit
bb2f45d1dc

+ 11 - 11
src/components/commons/ProvinceCity.vue

@@ -96,20 +96,20 @@ export default {
   },
   watch:{
     data(){
-      console.log('city=pCode')
       this.province = this.provinceCode
       this.city = this.cityCode
     },
-    cityCode(val){
-      console.log('cityCode')
-      console.log(val)
-      this.city = val;
-    },
-    provinceCode(val){
-      console.log('proCode')
-      this.provinceChanged(this.provinceCode);
-      this.province = val;
-    },
+    // deep: true,
+    // cityCode(val){
+    //   console.log('cityCode')
+    //   console.log(val)
+    //   this.city = val;
+    // },
+    // provinceCode(val){
+    //   console.log('proCode')
+    //   this.provinceChanged(this.provinceCode);
+    //   this.province = val;
+    // },
   },
 };
 </script>

+ 57 - 8
src/pages/UserCenter/Authentication.vue

@@ -6,7 +6,7 @@
       </div>
       <el-row :gutter="20">
         <el-col :span="12">
-          <div class="authentication-card" @click="gotoPersonalAuth">
+          <div class="authentication-card" :class="selectedCardImg"  @click="gotoPersonalAuth" v-if="authType<2">
             <div class="authentication-card-title">个人认证</div>
             <el-row :gutter="10">
               <el-col :span="5">
@@ -14,15 +14,24 @@
                   <img src="../../assets/img/idcard1.png" >
                 </div>
               </el-col>
-              <el-col :span="19">
+<!--              未认证-->
+              <el-col :span="19" v-if="authType===0">
                 <div class="authentication-card-title">手持证件照上传</div>
                 <div class="authentication-card-info">需要进行人工审核,审核周期1-3个工作日</div>
               </el-col>
+<!--              已认证,个人或者企业-->
+              <el-col :span="19" v-if="authType!==0">
+                <div class="authentication-card-title">
+                  <el-tag :type="authStatus.style">{{authStatus.text}}</el-tag></div>
+                <div class="authentication-card-info" v-if="authStatus.style=='warning'">需要进行人工审核,审核周期1-3个工作日</div>
+                <div class="authentication-card-info" v-if="authStatus.style=='success'">认证成功,点击查看认证信息</div>
+                <div class="authentication-card-info" v-if="authStatus.style=='info'">认证失败,查看失败原因</div>
+              </el-col>
             </el-row>
-          </div>
+          </div >
         </el-col>
         <el-col :span="12">
-          <div class="authentication-card" @click="gotoEnterpriseAuth">
+          <div class="authentication-card" :class="selectedCardImg"  @click="gotoEnterpriseAuth" v-if="authType===2 || authType ===0">
             <div class="authentication-card-title">企业认证</div>
             <el-row :gutter="10">
               <el-col :span="5">
@@ -30,12 +39,22 @@
                   <img src="../../assets/img/idcard2.png" >
                 </div>
               </el-col>
-              <el-col :span="19">
+              <!--              未认证-->
+              <el-col :span="19" v-if="authType===0">
                 <div class="authentication-card-title">手持证件照上传</div>
                 <div class="authentication-card-info">需要进行人工审核,审核周期1-3个工作日</div>
               </el-col>
+              <!--              已认证,企业-->
+              <el-col :span="19" v-if="authType!==0">
+                <div class="authentication-card-title">
+                  <el-tag :type="authStatus.style">{{authStatus.text}}</el-tag></div>
+                <div class="authentication-card-info" v-if="authStatus.style=='warning'">需要进行人工审核,审核周期1-3个工作日</div>
+                <div class="authentication-card-info" v-if="authStatus.style=='success'">认证成功,点击查看认证信息</div>
+                <div class="authentication-card-info" v-if="authStatus.style=='info'">认证失败,查看失败原因</div>
+              </el-col>
+
             </el-row>
-          </div >
+          </div>
         </el-col>
       </el-row>
     </div>
@@ -43,12 +62,18 @@
 </template>
 
 <script>
-
+  import Http from '@/js/http.js'
+  import {storageGet} from '@/js/index'
+  import {notify} from '@/constants/index'
   export default {
     name: "Authentication",
     data() {
       return {
-
+        selectedCardImg:'',
+        authType:-1,
+        authDetail:{},
+        authInfo:{},
+        authStatus:''
       }
     },
     methods: {
@@ -58,6 +83,30 @@
       gotoEnterpriseAuth(){
         this.$router.push({path:'/personal/authentication/enterprise'})
       },
+      //获取当前资质状态
+      getAuthStatus(){
+        let userId = storageGet('user')&&storageGet('user').userVO.id;
+        Http.get(`/api/user/${userId}`).then(res=>{
+          this.authInfo = res;
+          if(res.personalAuthVO){
+            this.authType = 1  //个人
+            this.authDetail = res.personalAuthVO
+            this.authStatus = res.personalAuthVO.authStatus
+            this.selectedCardImg = 'authentication-card-select'
+          }else if(res.agencyVO){
+            this.authType = 2  //企业
+            this.authDetail = res.agencyVO
+            this.authStatus = res.agencyVO.authStatus
+            this.selectedCardImg = 'authentication-card-select'
+          }else if((!res.enterpriseAuthVO) || (!res.agencyVO)){
+            this.authType = 0  //无
+          }
+        })
+      }
+    },
+    mounted() {
+      this.getAuthStatus();
+
     }
   }
 </script>

+ 1 - 1
src/pages/UserCenter/BindingMobile.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div style="margin-top: 20px">
     <el-form label-width="80px" style="width:400px">
       <el-form-item label="手机号码" >
         <el-input v-model="phoneBindingForm.phone"></el-input>

+ 114 - 43
src/pages/UserCenter/EnterpriseAuth.vue

@@ -2,59 +2,92 @@
   <div class="right-modifyPsw">
     <div class="right-modifyPsw-title">
       <span style="font-size: 18px;font-weight: bold">企业认证</span>
+      <el-tag :type="authStatus.style" v-if="authType===1">{{authStatus.text}}</el-tag>
+      <el-tag type="danger" v-if="authType===0">未认证</el-tag>
+      <el-button type="primary" class="pull-right" size="small" v-if="canEdit">编辑</el-button>
     </div>
     <el-steps :active="active" process-status="finish" style="margin-bottom: 20px">
       <el-step title="上传企业信息"></el-step>
       <el-step title="上传法人信息"></el-step>
-      <el-step title="确认信息"></el-step>
+<!--      <el-step title="确认信息"></el-step>-->
 <!--      <el-step title="认证结果"></el-step>-->
     </el-steps>
     <div class="upload-wrapper" v-if="active===0">
-      <div>
-        <el-upload
-          class="avatar-uploader idcard-uploader"
-          action="https://jsonplaceholder.typicode.com/posts/"
-          :before-upload="beforeFileUpload"
-          :http-request="uploadFile"
-          :data="{type:2}"
-        >
-          <img v-if="enterpriseForm.businessLicensePhoto" :src="enterpriseForm.businessLicensePhoto" class="avatar">
-        </el-upload>
+      <el-row class="agency-form-item">
+        <el-col :span="3">企业logo:</el-col>
+        <el-col :span="12">
+          <el-upload
+            class="avatar-uploader idcard-uploader"
+            action="https://jsonplaceholder.typicode.com/posts/"
+            :before-upload="beforeFileUpload"
+            :http-request="uploadFile"
+            :data="{type:3}"
+            :disabled="!canEdit"
+          >
+            <img v-if="enterpriseForm.agencyPhoto" :src="enterpriseForm.agencyPhoto" class="avatar">
+          </el-upload>
+        </el-col>
+      </el-row>
 
-        <div><span style="color: red">*</span>营业执照:(仅支持三证合一)</div>
-      </div>
-      <div class="authentication-detail">
-        <div class="authentication-detail-title">证件要求</div>
-        <ul class="authentication-detail-list">
-          <li>必须为清晰、完整的彩色原件扫描件或数码照</li>
-          <li>仅支持.jpg .bmp .png .gif的图片格式,图片大小不超过4M</li>
-          <li>必须在有效期内且年检章齐全(当年成立的公司可无年检章)</li>
-          <li>必须为中国大陆工商局颁发</li>
-        </ul>
-      </div>
+     <el-row class="agency-form-item">
+       <el-col :span="3">企业名称:</el-col>
+       <el-col :span="12">
+         <el-input :disabled="!canEdit" v-model="enterpriseForm.evaluationAgencyName" placeholder="企业名称"></el-input>
+       </el-col>
+      </el-row>
+
+      <el-row class="agency-form-item">
+        <div>营业执照:</div>
+        <el-col :span="8">
+          <div class="uploader-businessLicensePhoto">
+            <el-upload
+              class="avatar-uploader idcard-uploader"
+              action="https://jsonplaceholder.typicode.com/posts/"
+              :before-upload="beforeFileUpload"
+              :http-request="uploadFile"
+              :data="{type:2}"
+              :disabled="!canEdit"
+            >
+              <img v-if="enterpriseForm.businessLicensePhoto" :src="enterpriseForm.businessLicensePhoto" class="avatar">
+            </el-upload>
+            <div><span style="color: red">*</span>营业执照:(仅支持三证合一)</div>
+          </div>
+        </el-col>
+        <el-col :span="16">
+          <div class="authentication-detail">
+            <div class="authentication-detail-title">证件要求</div>
+            <ul class="authentication-detail-list">
+              <li>必须为清晰、完整的彩色原件扫描件或数码照</li>
+              <li>仅支持.jpg .bmp .png .gif的图片格式,图片大小不超过4M</li>
+              <li>必须在有效期内且年检章齐全(当年成立的公司可无年检章)</li>
+              <li>必须为中国大陆工商局颁发</li>
+            </ul>
+          </div>
+        </el-col>
+      </el-row>
     </div>
     <div class="legal-person-wrapper" v-if="active===1">
       <el-form ref="enterpriseForm" :model="enterpriseForm" label-width="120px" style="width: 70%">
         <el-form-item label="法人姓名">
-          <el-input v-model="enterpriseForm.legalPersonName" placeholder="请输入您的姓名,需与身份证保持一致"></el-input>
+          <el-input :disabled="!canEdit" v-model="enterpriseForm.legalPersonName" placeholder="请输入您的姓名,需与身份证保持一致"></el-input>
         </el-form-item>
         <el-form-item label="身份证号码">
-          <el-input v-model="enterpriseForm.idCardNum" placeholder="身份证前后不能有空格"></el-input>
+          <el-input :disabled="!canEdit" v-model="enterpriseForm.idCardNum" placeholder="身份证前后不能有空格"></el-input>
         </el-form-item>
         <el-form-item label="性别">
-          <el-radio-group v-model="enterpriseForm.sex">
+          <el-radio-group v-model="enterpriseForm.gender" :disabled="!canEdit">
             <el-radio label="男"></el-radio>
             <el-radio label="女"></el-radio>
           </el-radio-group>
         </el-form-item>
         <el-form-item label="身份证到期时间">
-          <el-input v-model="enterpriseForm.idCardDeadTime" placeholder="请按身份证背面“有效期限”如实填写"></el-input>
+          <el-input :disabled="!canEdit" v-model="enterpriseForm.idCardDeadTime" placeholder="请按身份证背面“有效期限”如实填写"></el-input>
         </el-form-item>
         <el-form-item label="家庭或单位地址">
-          <el-input v-model="enterpriseForm.address"></el-input>
+          <el-input :disabled="!canEdit" v-model="enterpriseForm.address"></el-input>
         </el-form-item>
         <el-form-item label="认证权限">
-          <el-checkbox-group v-model="enterpriseForm.roleList">
+          <el-checkbox-group v-model="enterpriseForm.roleList" :disabled="!canEdit">
             <el-checkbox :label="0">发任务</el-checkbox>
             <el-checkbox :label="1">接任务</el-checkbox>
           </el-checkbox-group>
@@ -70,6 +103,7 @@
                 :before-upload="beforeFileUpload"
                 :http-request="uploadFile"
                 :data="{type:0}"
+                :disabled="!canEdit"
               >
                 <img v-if="enterpriseForm.idCardPositivePhoto" :src="enterpriseForm.idCardPositivePhoto" class="avatar">
               </el-upload>
@@ -82,6 +116,7 @@
                 :before-upload="beforeFileUpload"
                 :http-request="uploadFile"
                 :data="{type:1}"
+                :disabled="!canEdit"
               >
                 <img v-if="enterpriseForm.idCardBackPhoto" :src="enterpriseForm.idCardBackPhoto" class="avatar">
               </el-upload>
@@ -124,38 +159,69 @@
   import Http from '@/js/http'
   import {notify} from '@/constants/index'
   import {storageGet} from '@/js/index'
-
+  import idcardPositive from '../../assets/img/idcard-positive.png'
+  import idcardBack from '../../assets/img/idcard-back.png'
   export default {
     name: "EnterpriseAuth",
     data() {
       return {
         active: 0,
         user: {},
+        canEdit:false,
         enterpriseForm: {
-          roleList: [
-            0, 1
-          ],//0是发包 1是接包 如果两个都有那么权限都有。
-          legalPersonName: "徐璇", //法人姓名
+          roleList: [],//0是发包 1是接包 如果两个都有那么权限都有。
+          legalPersonName: "", //法人姓名
           businessLicensePhoto: require('../../assets/img/business-license.png'),//企业执照
-          idCardNum: "223025199806053322",//身份证号码
-          address: "南京市沛县徐园",//地址
-          sex: "男",
-          idCardPositivePhoto: "000001.png",//身份证正面照
-          idCardBackPhoto: "00002.png",//身份证反面照片
-          idCardDeadTime: "2022-08-09"//身份证过期时间
+          idCardNum: "",//身份证号码
+          address: "",//地址
+          gender: "",
+          idCardPositivePhoto: idcardPositive,//身份证正面照
+          idCardBackPhoto: idcardBack,//身份证反面照片
+          idCardDeadTime: "",//身份证过期时间
+          evaluationAgencyName:"", //企业名称
+          agencyPhoto:"", //企业logo
         }
 
       }
     },
     methods: {
       submitEnterpriseAuth() {
-        Http.post(`/api/user/${this.user.id}/enterpriseAuth`, this.enterpriseForm).then(res => {
+        Http.post(`/api/user/${this.user.id}/agency`, this.enterpriseForm).then(res => {
           if (res) {
             notify('success', '认证成功');
             this.$router.push('/personal/authentication')
           }
         })
       },
+      //获取当前认证状态
+      getAuthStatus() {
+        Http.get(`/api/user/${this.user.id}`).then(res => {
+          if (res.agencyVO) {
+            this.authType = 1  //个人已参与认证
+            this.authStatus = res.agencyVO.authStatus
+            //成功和审核中状态不可编辑,认证失败状态可编辑
+            this.authStatus.style === 'info' ? this.canEdit = true : null
+            this.setFormInfo(res.agencyVO);
+          } else {
+            this.authType = 0  //未参与个人认证
+            this.canEdit = true
+          }
+        })
+      },
+      setFormInfo(detail) {
+        //回显认证信息
+        this.enterpriseForm.roleList = detail.roleList,
+          this.enterpriseForm.legalPersonName = detail.legalPersonName,
+          this.enterpriseForm.gender = detail.gender,
+          this.enterpriseForm.idCardNum = detail.idCardNum,
+          this.enterpriseForm.address = detail.address,
+          this.enterpriseForm.idCardPositivePhoto = detail.idCardPositivePhoto,
+          this.enterpriseForm.idCardBackPhoto = detail.idCardBackPhoto,
+          this.enterpriseForm.idCardDeadTime = detail.idCardDeadTime
+          this.enterpriseForm.businessLicensePhoto = detail.businessLicensePhoto
+          this.enterpriseForm.evaluationAgencyName = detail.evaluationAgencyName
+          this.enterpriseForm.agencyPhoto = detail.agencyPhoto
+      },
       setUserInfo() {
         this.user = storageGet('user') && storageGet('user').userVO;
       },
@@ -194,8 +260,10 @@
             this.enterpriseForm.businessLicensePhoto = res.data;
           }else if(param.data.type == 1){
             this.enterpriseForm.IDCardBackPhoto = res.data
-          }else{
+          }else if(param.data.type == 0){
             this.enterpriseForm.IDCardPositivePhoto = res.data
+          }else if(param.data.type == 3){
+            this.enterpriseForm.agencyPhoto = res.data
 
           }
           notify('success', '上传成功')
@@ -206,7 +274,8 @@
       },
     },
     mounted() {
-      this.setUserInfo()
+      this.setUserInfo();
+      this.getAuthStatus()
     }
   }
 </script>
@@ -225,9 +294,11 @@
     }
 
     .upload-wrapper {
-      display: flex;
       padding: 0 30px;
 
+      .agency-form-item {
+        margin-bottom: 10px;
+      }
       .authentication-detail {
         padding: 0 30px;
         border-left: 1px solid rgba(220, 220, 220, 1);

+ 71 - 34
src/pages/UserCenter/IndividualAuth.vue

@@ -1,35 +1,38 @@
 <template>
   <div class="right-modifyPsw" id="individualAuth">
     <div class="right-modifyPsw-title">
-      <span style="font-size: 18px;font-weight: bold">个人认证</span>
+      <span style="font-size: 18px;font-weight: bold;margin-right: 10px">个人认证</span>
+      <el-tag :type="authStatus.style" v-if="authType===1">{{authStatus.text}}</el-tag>
+      <el-tag type="danger" v-if="authType===0">未认证</el-tag>
+      <el-button type="primary" class="pull-right" size="small" v-if="canEdit">编辑</el-button>
     </div>
-<!--    <div class="individual-steps-wrapper">-->
-<!--      <el-steps :active="active" process-status="finish" style="margin-bottom: 20px;width: 300px">-->
-<!--        <el-step title="填写认证信息"></el-step>-->
-<!--        <el-step title="认证结果"></el-step>-->
-<!--      </el-steps>-->
-<!--    </div>-->
+    <!--    <div class="individual-steps-wrapper">-->
+    <!--      <el-steps :active="active" process-status="finish" style="margin-bottom: 20px;width: 300px">-->
+    <!--        <el-step title="填写认证信息"></el-step>-->
+    <!--        <el-step title="认证结果"></el-step>-->
+    <!--      </el-steps>-->
+    <!--    </div>-->
     <el-form ref="individualForm" :model="individualForm" label-width="120px" style="width: 70%">
       <el-form-item label="真实姓名">
-        <el-input v-model="individualForm.realName" placeholder="请输入您的姓名,需与身份证保持一致"></el-input>
+        <el-input :disabled="!canEdit" v-model="individualForm.realName" placeholder="请输入您的姓名,需与身份证保持一致"></el-input>
       </el-form-item>
       <el-form-item label="身份证号码">
-        <el-input v-model="individualForm.IDCard" placeholder="身份证前后不能有空格"></el-input>
+        <el-input :disabled="!canEdit" v-model="individualForm.idCard" placeholder="身份证前后不能有空格"></el-input>
       </el-form-item>
       <el-form-item label="性别">
-        <el-radio-group v-model="individualForm.sex">
+        <el-radio-group v-model="individualForm.gender" :disabled="!canEdit">
           <el-radio label="男"></el-radio>
           <el-radio label="女"></el-radio>
         </el-radio-group>
       </el-form-item>
       <el-form-item label="身份证到期时间">
-        <el-input v-model="individualForm.IDCardDeadTime" placeholder="请按身份证背面“有效期限”如实填写"></el-input>
+        <el-input :disabled="!canEdit" v-model="individualForm.idCardDeadTime" placeholder="请按身份证背面“有效期限”如实填写"></el-input>
       </el-form-item>
       <el-form-item label="家庭或单位地址">
-        <el-input v-model="individualForm.address"></el-input>
+        <el-input :disabled="!canEdit" v-model="individualForm.address"></el-input>
       </el-form-item>
       <el-form-item label="认证权限">
-        <el-checkbox-group v-model="individualForm.roleList">
+        <el-checkbox-group v-model="individualForm.roleList" :disabled="!canEdit">
           <el-checkbox :label="0">发任务</el-checkbox>
           <el-checkbox :label="1">接任务</el-checkbox>
         </el-checkbox-group>
@@ -45,8 +48,9 @@
               :before-upload="beforeFileUpload"
               :http-request="uploadFile"
               :data="{type:0}"
+              :disabled="!canEdit"
             >
-              <img v-if="individualForm.IDCardPositivePhoto" :src="individualForm.IDCardPositivePhoto" class="avatar">
+              <img v-if="individualForm.idCardPositivePhoto" :src="individualForm.idCardPositivePhoto" class="avatar">
             </el-upload>
             <div style="text-align: center">手持身份证正面照</div>
           </div>
@@ -83,7 +87,7 @@
               :http-request="uploadFile"
               :data="{type:1}"
             >
-              <img v-if="individualForm.IDCardBackPhoto" :src="individualForm.IDCardBackPhoto" class="avatar">
+              <img v-if="individualForm.idCardBackPhoto" :src="individualForm.idCardBackPhoto" class="avatar">
             </el-upload>
 
             <div style="text-align: center">身份证反面照</div>
@@ -110,8 +114,8 @@
 
     </div>
     <div class="enterprise-brn-wrapper">
-<!--      <button class="enterprise-btn previousBtn">上一步</button>-->
-      <button class="enterprise-btn nextBtn" @click="submitIndividualAuth">提交审核</button>
+      <!--      <button class="enterprise-btn previousBtn">上一步</button>-->
+      <el-button type="primary" @click="submitIndividualAuth" v-if="canEdit">提交审核</el-button>
     </div>
 
   </div>
@@ -132,28 +136,58 @@
         active: 0,
         user: {},
         individualForm: {
-          roleList: [0],//0是发包 1是接包 如果两个都有那么权限都有。
-          realName: "徐璇",
-          sex: "男",
-          IDCard: "32032219941023007X",
-          IDCardPositivePhoto: idcardPositive,
-          IDCardBackPhoto: idcardBack,
-          IDCardDeadTime: "2020-07-20",
-          address: "北京沛县"
-        }
+          roleList: [],//0是发包 1是接包 如果两个都有那么权限都有。
+          realName: "",
+          gender: "",
+          idCard: "",
+          idCardPositivePhoto: idcardPositive,
+          idCardBackPhoto: idcardBack,
+          idCardDeadTime: "",
+          address: ""
+        },
+        authType: -1,
+        authDetail: {},
+        authStatus: '',
+        canEdit:false
       }
     },
     methods: {
-      submitIndividualAuth(){
-        Http.post(`/api/user/${this.user.id}/personalAuth`,this.individualForm).then(res=>{
-          if(res){
+      setUserInfo(){
+        this.user = storageGet('user') && storageGet('user').userVO;
+      },
+      submitIndividualAuth() {
+        Http.post(`/api/user/${this.user.id}/personalAuth`, this.individualForm).then(res => {
+          if (res) {
             notify('success', '认证成功');
             this.$router.push('/personal/authentication')
           }
         })
       },
-      setUserInfo() {
-        this.user = storageGet('user') && storageGet('user').userVO;
+      //获取当前认证状态
+      getAuthStatus() {
+        Http.get(`/api/user/${this.user.id}`).then(res => {
+          if (res.personalAuthVO) {
+            this.authType = 1  //个人已参与认证
+            this.authStatus = res.personalAuthVO.authStatus
+            //成功和审核中状态不可编辑,认证失败状态可编辑
+            this.authStatus.style === 'info' ? this.canEdit = true : null
+            this.setFormInfo(res.personalAuthVO);
+          } else {
+            this.authType = 0  //未参与个人认证
+            this.canEdit = true
+          }
+        })
+      },
+      setFormInfo(detail) {
+        //回显认证信息
+        this.individualForm.roleList = detail.roleList,
+        this.individualForm.realName = detail.realName,
+        this.individualForm.gender = detail.gender,
+        this.individualForm.idCard = detail.idCard,
+        this.individualForm.address = detail.address,
+        this.individualForm.idCardPositivePhoto = detail.idCardPositivePhoto,
+        this.individualForm.idCardBackPhoto = detail.idCardBackPhoto,
+        this.individualForm.idCardDeadTime = detail.idCardDeadTime
       },
       //文件上传前的响应函数
       beforeFileUpload(file) {
@@ -186,9 +220,9 @@
         formData.append('file', param.file)
         //console.log(JSON.parse(this.user).userVO)
         Http.upload(Apis.FILE.UPLOAD_IMAGE.replace('{userId}', this.user.id), formData, config).then((res) => {
-          if(param.data.type === 0){
+          if (param.data.type === 0) {
             this.individualForm.IDCardPositivePhoto = res.data
-          }else{
+          } else {
             this.individualForm.IDCardBackPhoto = res.data
           }
 
@@ -200,7 +234,8 @@
       },
     },
     mounted() {
-      this.setUserInfo()
+      this.setUserInfo();
+      this.getAuthStatus()
     }
   }
 </script>
@@ -313,9 +348,11 @@
   #individualAuth {
     .avatar-uploader .idcard-uploader {
       width: 100%;
+
       .avatar {
         width: 100%;
       }
+
       .el-upload .el-upload--text {
         width: 100% !important;
       }

+ 11 - 4
src/pages/UserCenter/Mine.vue

@@ -37,8 +37,8 @@
           <provincecity
             ref="addFormProvince"
             @selectChange="locationChange"
-            :provinceCode="userForm.province"
-            :cityCode="userForm.city"
+            :provinceCode="userForm.province==null?'3200':userForm.province"
+            :cityCode="userForm.city===null?'3201':userForm.city"
           ></provincecity>
         </el-form-item>
         <el-form-item label="个人能力" style="width: 160%">
@@ -136,9 +136,16 @@
       },
       loadData() {
         Http.get(`/api/personal/display/${this.user.id}`).then((res) => {
-          this.userForm = res.userVO;
+          this.userForm.gender = res.userVO.gender ? res.userVO.gender : '';
+          this.userForm.photoUrl = res.userVO.photoUrl ? res.userVO.photoUrl : '';
+          this.userForm.birthday = res.userVO.birthday ? res.userVO.birthday : new Date();
+          this.userForm.userName = res.userVO.userName ? res.userVO.userName : '';
+          this.userForm.unit = res.userVO.unit ? res.userVO.unit : '';
+          this.userForm.province = res.userVO.unit ? res.userVO.province : '';
+          this.userForm.city = res.userVO.unit ? res.userVO.city : '';
+          this.userForm.personalCompetence = res.userVO.personalCompetence ? res.userVO.personalCompetence : [];
           //获取省市code
-          // console.log(getProvinceCodeByProvinceName(this.userForm.province, this.userForm.city));;
+          console.log(getProvinceCodeByProvinceName(this.userForm.province, this.userForm.city));;
           let location = getProvinceCodeByProvinceName(this.userForm.province, this.userForm.city);
           console.log(location)
           this.userForm.province = location.provinceCode;