Przeglądaj źródła

添加省市未填时的默认返回

sunjh 6 lat temu
rodzic
commit
1e68c6fe26

+ 11 - 8
src/components/authen/EnterpriseAuthentication.vue

@@ -51,7 +51,7 @@
           <div class="btn btn-medium btn-info" @click="modifyInfo()">修改</div>
         </el-form-item>
         <el-form-item v-if="isModifyMode">
-          <div class="btn btn-primary btn-info" @click="submitInfo()">提交</div>
+          <div class="btn btn-primary btn-info" @click="updateAuthInfo()">提交</div>
           <div class="btn btn-primary" @click="cancelModify()">取消</div>
         </el-form-item>
       </el-form>
@@ -63,7 +63,7 @@
 import Http from '@/js/http'
 import Apis from '@/js/api'
 import {notify} from '@/constants/index'
-import {defaultValue, getCurrentAuthenInfo, storageGet} from '@/js/index'
+import {defaultValue, getCurrentAuthenInfo, storageGet, updateEnterpriseAuthInfo} from '@/js/index'
 
 export default {
   name: 'EnterpriseAuthentication',
@@ -120,8 +120,8 @@ export default {
         //this.authentication.photo = []
         this.authentication.businessLicense = res.businessLicensePhoto == null ? defaultValue.image : res.businessLicensePhoto
         this.authentication.enterpriseName = res.companyName == null ? '暂未填写' : res.companyName
-        this.authentication.enterpriseBossName = res.legalPersonName == null ? [] : res.legalPersonName
-        this.authentication.bankAccount = res.bankAccount == null ? [] : res.bankAccount
+        this.authentication.enterpriseBossName = res.legalPersonName == null ? '暂未填写' : res.legalPersonName
+        this.authentication.bankAccount = res.bankAccount == null ? '暂未填写' : res.bankAccount
         this.authentication.USCC = res.unifiedSocialCreditCode == null ? '暂未填写' : res.unifiedSocialCreditCode
         this.authentication.enterpriseAddress = res.address == null ? '暂未填写' : res.address
         this.hideLoading()
@@ -136,8 +136,9 @@ export default {
       this.isModifyMode = true
     },
     //提交认证信息
-    submitInfo () {
+    updateAuthInfo () {
       //this.isModifyMode = false
+      this.showLoading()
       const newAuthentication = {
         mobile: this.authentication.mobile,
         evaluationAgencyName: this.authentication.name,
@@ -147,11 +148,13 @@ export default {
         resources: this.authentication.resource,
         agencyPhoto: this.authentication.photoUrl,
       }
-      Http.post(Apis.USER.SUBMIT_ENTERPRISE_AUTHENTICATION_INFO.replace('{userId}', this.user.userVO.id), newAuthentication).then((res) => {
+      updateEnterpriseAuthInfo.then((res) => {
+        this.hideLoading()
         console.log(res)
-        notify('success', '认证信息上传成功')
+        notify('success', '认证信息修改成功')
       }).catch(error => {
-        notify('error', error.data.msg)
+        this.hideLoading()
+        notify('error', error.data)
       })
     },
     //取消修改表单,表单进入不可编辑状态,不再使用

+ 4 - 1
src/js/index.js

@@ -341,7 +341,10 @@ export const getProvinceCodeByProvinceName = (provinceName, cityName) => {
       }
     }
   }
-  return null
+  return {
+    'provinceCode': '3200',
+    'cityCode': '3201'
+  }
 }
 
 //获取批量上传项目模板文件