|
@@ -15,13 +15,13 @@
|
|
|
:show-file-list="false"
|
|
|
:http-request="uploadFile"
|
|
|
:before-upload="beforeFileUpload">
|
|
|
- <img v-if="authentication.businessLicense" :src="authentication.businessLicense" class="avatar">
|
|
|
+ <img v-if="authentication.businessLicensePhoto" :src="authentication.businessLicensePhoto" class="avatar">
|
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
</el-upload>
|
|
|
<span v-if="!isModifyMode">
|
|
|
<el-image
|
|
|
style="width: 100px;"
|
|
|
- :src="authentication.businessLicense"
|
|
|
+ :src="authentication.businessLicensePhoto"
|
|
|
fit="scale-down"></el-image>
|
|
|
</span>
|
|
|
<!--<div v-if="!isModifyMode">-->
|
|
@@ -31,20 +31,20 @@
|
|
|
<!--</div>-->
|
|
|
</el-form-item>
|
|
|
<el-form-item label="公司法人姓名" prop="name">
|
|
|
- <el-input v-if="isModifyMode" v-model="authentication.enterpriseBossName"></el-input>
|
|
|
- <span v-if="!isModifyMode">{{authentication.enterpriseBossName}}</span>
|
|
|
+ <el-input v-if="isModifyMode" v-model="authentication.legalPersonName"></el-input>
|
|
|
+ <span v-if="!isModifyMode">{{authentication.legalPersonName}}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="对公账户" prop="name">
|
|
|
<el-input v-if="isModifyMode" v-model="authentication.bankAccount"></el-input>
|
|
|
<span v-if="!isModifyMode">{{authentication.bankAccount}}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="统一社会信用代码" prop="name">
|
|
|
- <el-input v-if="isModifyMode" v-model="authentication.USCC"></el-input>
|
|
|
- <span v-if="!isModifyMode">{{authentication.USCC}}</span>
|
|
|
+ <el-input v-if="isModifyMode" v-model="authentication.unifiedSocialCreditCode"></el-input>
|
|
|
+ <span v-if="!isModifyMode">{{authentication.unifiedSocialCreditCode}}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="公司地址" prop="name">
|
|
|
- <el-input v-if="isModifyMode" v-model="authentication.enterpriseAddress"></el-input>
|
|
|
- <span v-if="!isModifyMode">{{authentication.enterpriseAddress}}</span>
|
|
|
+ <el-input v-if="isModifyMode" v-model="authentication.address"></el-input>
|
|
|
+ <span v-if="!isModifyMode">{{authentication.address}}</span>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item v-if="!isModifyMode">
|
|
@@ -63,7 +63,7 @@
|
|
|
import Http from '@/js/http'
|
|
|
import Apis from '@/js/api'
|
|
|
import {notify} from '@/constants/index'
|
|
|
-import {defaultValue, getCurrentAuthenInfo, storageGet, updateEnterpriseAuthInfo} from '@/js/index'
|
|
|
+import {defaultValue, getCurrentEnterpriseAuthInfo, storageGet, updateEnterpriseAuthInfo} from '@/js/index'
|
|
|
|
|
|
export default {
|
|
|
name: 'EnterpriseAuthentication',
|
|
@@ -75,11 +75,11 @@ export default {
|
|
|
loading: false,
|
|
|
authentication: {
|
|
|
enterpriseName: '',
|
|
|
- enterpriseBossName: '',
|
|
|
+ legalPersonName: '',
|
|
|
bankAccount: '',
|
|
|
- businessLicense: defaultValue.image,
|
|
|
- USCC: '',
|
|
|
- enterpriseAddress: ''
|
|
|
+ businessLicensePhoto: defaultValue.image,
|
|
|
+ unifiedSocialCreditCode: '',
|
|
|
+ address: ''
|
|
|
},
|
|
|
rules: {
|
|
|
// name: [
|
|
@@ -116,20 +116,21 @@ export default {
|
|
|
//加载数据
|
|
|
getAuthInfo () {
|
|
|
this.showLoading()
|
|
|
- getCurrentAuthenInfo().then((res) => {
|
|
|
- //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.USCC = res.unifiedSocialCreditCode == null ? '暂未填写' : res.unifiedSocialCreditCode
|
|
|
- this.authentication.enterpriseAddress = res.address == null ? '暂未填写' : res.address
|
|
|
- this.hideLoading()
|
|
|
- console.log(this.authentication)
|
|
|
- }).catch((error) => {
|
|
|
- this.hideLoading()
|
|
|
- notify('error', '加载认证信息失败:' + error.data)
|
|
|
- })
|
|
|
+ getCurrentEnterpriseAuthInfo(this.user.userVO.id, this.getAuthInfoSuccess, this.getAuthInfoFail)
|
|
|
+ },
|
|
|
+ getAuthInfoSuccess (res) {
|
|
|
+ this.hideLoading()
|
|
|
+ this.authentication.enterpriseName = res.enterpriseName == null ? '暂未填写' : res.enterpriseName
|
|
|
+ this.authentication.legalPersonName = res.legalPersonName == null ? '暂未填写' : res.legalPersonName
|
|
|
+ this.authentication.businessLicensePhoto = res.businessLicensePhoto == null ? defaultValue.image : res.businessLicensePhoto
|
|
|
+ this.authentication.unifiedSocialCreditCode = res.unifiedSocialCreditCode == null ? '暂未填写' : res.unifiedSocialCreditCode
|
|
|
+ this.authentication.bankAccount = res.bankAccount == null ? '暂未填写' : res.bankAccount
|
|
|
+ this.authentication.address = res.address == null ? '暂未填写' : res.address
|
|
|
+ console.log(this.authentication)
|
|
|
+ },
|
|
|
+ getAuthInfoFail (error) {
|
|
|
+ this.hideLoading()
|
|
|
+ notify('error', '加载认证信息失败:' + error.data)
|
|
|
},
|
|
|
//表单进入可编辑状态,可修改表单,不再使用
|
|
|
modifyInfo () {
|
|
@@ -140,22 +141,31 @@ export default {
|
|
|
//this.isModifyMode = false
|
|
|
this.showLoading()
|
|
|
const newAuthentication = {
|
|
|
- mobile: this.authentication.mobile,
|
|
|
- evaluationAgencyName: this.authentication.name,
|
|
|
+ userId: this.user.userVO.id,
|
|
|
+ enterpriseName: this.authentication.enterpriseName,
|
|
|
+ legalPersonName: this.authentication.legalPersonName,
|
|
|
+ businessLicensePhoto: this.authentication.businessLicensePhoto,
|
|
|
+ unifiedSocialCreditCode: this.authentication.unifiedSocialCreditCode,
|
|
|
bankAccount: this.authentication.bankAccount,
|
|
|
address: this.authentication.address,
|
|
|
- abilities: this.authentication.ability,
|
|
|
- resources: this.authentication.resource,
|
|
|
- agencyPhoto: this.authentication.photoUrl,
|
|
|
}
|
|
|
- updateEnterpriseAuthInfo.then((res) => {
|
|
|
- this.hideLoading()
|
|
|
- console.log(res)
|
|
|
- notify('success', '认证信息修改成功')
|
|
|
- }).catch(error => {
|
|
|
- this.hideLoading()
|
|
|
- notify('error', error.data)
|
|
|
- })
|
|
|
+ updateEnterpriseAuthInfo(this.user.userVO.id, newAuthentication, this.updateAuthInfoSuccess, this.updateAuthInfoFail)
|
|
|
+ },
|
|
|
+ updateAuthInfoSuccess (res) {
|
|
|
+ this.hideLoading()
|
|
|
+ this.cancelModify()
|
|
|
+ console.log(res)
|
|
|
+ this.authentication.enterpriseName = res.enterpriseName == null ? '暂未填写' : res.enterpriseName
|
|
|
+ this.authentication.legalPersonName = res.legalPersonName == null ? '暂未填写' : res.legalPersonName
|
|
|
+ this.authentication.businessLicensePhoto = res.businessLicensePhoto == null ? defaultValue.image : res.businessLicensePhoto
|
|
|
+ this.authentication.unifiedSocialCreditCode = res.unifiedSocialCreditCode == null ? '暂未填写' : res.unifiedSocialCreditCode
|
|
|
+ this.authentication.bankAccount = res.bankAccount == null ? '暂未填写' : res.bankAccount
|
|
|
+ this.authentication.address = res.address == null ? '暂未填写' : res.address
|
|
|
+ notify('success', '认证信息修改成功')
|
|
|
+ },
|
|
|
+ updateAuthInfoFail (error) {
|
|
|
+ this.hideLoading()
|
|
|
+ notify('error', error.data)
|
|
|
},
|
|
|
//取消修改表单,表单进入不可编辑状态,不再使用
|
|
|
cancelModify () {
|