|
@@ -2,7 +2,7 @@
|
|
<div class="create-container" v-loading="loading">
|
|
<div class="create-container" v-loading="loading">
|
|
<div class="create-body">
|
|
<div class="create-body">
|
|
<div class="title">企业信息认证</div>
|
|
<div class="title">企业信息认证</div>
|
|
- <el-form :model="authentication" :rules="rules" ref="authentication" label-width="12%" class="demo-report">
|
|
|
|
|
|
+ <el-form :model="authentication" :rules="rules" ref="authentication" label-width="15%" class="demo-report">
|
|
<el-form-item label="公司名" prop="enterpriseName">
|
|
<el-form-item label="公司名" prop="enterpriseName">
|
|
<el-input size="small" v-if="isModifyMode" v-model="authentication.enterpriseName"></el-input>
|
|
<el-input size="small" v-if="isModifyMode" v-model="authentication.enterpriseName"></el-input>
|
|
<!--<span v-if="!isModifyMode">{{authentication.name}}</span>-->
|
|
<!--<span v-if="!isModifyMode">{{authentication.name}}</span>-->
|
|
@@ -82,54 +82,54 @@ export default {
|
|
address: ''
|
|
address: ''
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
- enterpriseName: [
|
|
|
|
- {required: true, message: '请输入公司名称', trigger: 'blur'},
|
|
|
|
- {min: 3, max: 50, message: '机构名称长度在 3 到 50 个字符', trigger: 'blur'}
|
|
|
|
- ],
|
|
|
|
- businessLicensePhoto: [
|
|
|
|
- {
|
|
|
|
- validator: (rule, value, callback) => {
|
|
|
|
- console.log(value);
|
|
|
|
- if (value == null || value == '') {
|
|
|
|
- callback(new Error('公司营业执照不能为空'))
|
|
|
|
- } else {
|
|
|
|
- callback()
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- trigger: 'blue'
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- legalPersonName: [
|
|
|
|
- {required: true, message: '请输入公司法人姓名', trigger: 'blur'}
|
|
|
|
- ],
|
|
|
|
- bankAccount: [
|
|
|
|
- {required: true, message: '请输入对公账户', trigger: 'blur'},
|
|
|
|
- {
|
|
|
|
- validator: (rule, value, callback) => {
|
|
|
|
- if (!this.checkNumber(value)) {
|
|
|
|
- callback(new Error('对公账户输入有误'))
|
|
|
|
- } else {
|
|
|
|
- callback()
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- trigger: 'blur'
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- unifiedSocialCreditCode: [
|
|
|
|
- {required: true, message: '请输入统一社会信用代码', trigger: 'blur'},
|
|
|
|
- {
|
|
|
|
- validator: (rule, value, callback) => {
|
|
|
|
- if (!this.checkNumberAndWord(value)) {
|
|
|
|
- callback(new Error('统一社会信用代码输入有误'))
|
|
|
|
- } else {
|
|
|
|
- callback()
|
|
|
|
- }
|
|
|
|
- }, trigger: 'blur'
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- address: [
|
|
|
|
- {required: true, message: '请输入公司地址', trigger: 'blur'}
|
|
|
|
- ]
|
|
|
|
|
|
+ enterpriseName: [
|
|
|
|
+ {required: true, message: '请输入公司名称', trigger: 'blur'},
|
|
|
|
+ {min: 3, max: 50, message: '机构名称长度在 3 到 50 个字符', trigger: 'blur'}
|
|
|
|
+ ],
|
|
|
|
+ businessLicensePhoto: [
|
|
|
|
+ {
|
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
|
+ console.log(value)
|
|
|
|
+ if (value == null || value == '') {
|
|
|
|
+ callback(new Error('公司营业执照不能为空'))
|
|
|
|
+ } else {
|
|
|
|
+ callback()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ trigger: 'blue'
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ legalPersonName: [
|
|
|
|
+ {required: true, message: '请输入公司法人姓名', trigger: 'blur'}
|
|
|
|
+ ],
|
|
|
|
+ bankAccount: [
|
|
|
|
+ {required: true, message: '请输入对公账户', trigger: 'blur'},
|
|
|
|
+ {
|
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
|
+ if (!this.checkNumber(value)) {
|
|
|
|
+ callback(new Error('对公账户输入有误'))
|
|
|
|
+ } else {
|
|
|
|
+ callback()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ trigger: 'blur'
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ unifiedSocialCreditCode: [
|
|
|
|
+ {required: true, message: '请输入统一社会信用代码', trigger: 'blur'},
|
|
|
|
+ {
|
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
|
+ if (!this.checkNumberAndWord(value)) {
|
|
|
|
+ callback(new Error('统一社会信用代码输入有误'))
|
|
|
|
+ } else {
|
|
|
|
+ callback()
|
|
|
|
+ }
|
|
|
|
+ }, trigger: 'blur'
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ address: [
|
|
|
|
+ {required: true, message: '请输入公司地址', trigger: 'blur'}
|
|
|
|
+ ]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -154,22 +154,22 @@ export default {
|
|
submitInfo () {
|
|
submitInfo () {
|
|
//this.isModifyMode = false
|
|
//this.isModifyMode = false
|
|
this.$refs['authentication'].validate(valid => {
|
|
this.$refs['authentication'].validate(valid => {
|
|
- if (valid) {
|
|
|
|
- this.showLoading()
|
|
|
|
- const newAuthentication = {
|
|
|
|
- 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,
|
|
|
|
- }
|
|
|
|
- uploadEnterpriseAuthenticationInfo(this.user.userVO.id, newAuthentication, this.submitInfoSuccess, this.submitInfoFail)
|
|
|
|
- } else {
|
|
|
|
- notify('error', '表单填写错误!')
|
|
|
|
- return false
|
|
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.showLoading()
|
|
|
|
+ const newAuthentication = {
|
|
|
|
+ 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,
|
|
}
|
|
}
|
|
|
|
+ uploadEnterpriseAuthenticationInfo(this.user.userVO.id, newAuthentication, this.submitInfoSuccess, this.submitInfoFail)
|
|
|
|
+ } else {
|
|
|
|
+ notify('error', '表单填写错误!')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
submitInfoSuccess (res) {
|
|
submitInfoSuccess (res) {
|
|
@@ -183,20 +183,22 @@ export default {
|
|
storageSave('rolesPermissions', getRolesPermissions(res.roleList))
|
|
storageSave('rolesPermissions', getRolesPermissions(res.roleList))
|
|
this.hideLoading()
|
|
this.hideLoading()
|
|
//notify('success', '用户信息刷新成功')
|
|
//notify('success', '用户信息刷新成功')
|
|
- this.$confirm('认证信息提交成功,将于10个工作日内审核完成')
|
|
|
|
- .then(_ => {
|
|
|
|
- //done()
|
|
|
|
- this.$router.push({
|
|
|
|
- name: 'EnterpriseAuthentication',
|
|
|
|
- params: {userId: this.user.userVO.id}
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- .catch(_ => {
|
|
|
|
|
|
+ this.$alert('认证信息提交成功,将于3个工作日内审核完成', '提交成功', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ callback: action => {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
name: 'EnterpriseAuthentication',
|
|
name: 'EnterpriseAuthentication',
|
|
params: {userId: this.user.userVO.id}
|
|
params: {userId: this.user.userVO.id}
|
|
})
|
|
})
|
|
- })
|
|
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // .catch(_ => {
|
|
|
|
+ // this.$router.push({
|
|
|
|
+ // name: 'EnterpriseAuthentication',
|
|
|
|
+ // params: {userId: this.user.userVO.id}
|
|
|
|
+ // })
|
|
|
|
+ // })
|
|
}).catch((error) => {
|
|
}).catch((error) => {
|
|
this.hideLoading()
|
|
this.hideLoading()
|
|
notify('error', '重新获取用户信息失败:' + error.data)
|
|
notify('error', '重新获取用户信息失败:' + error.data)
|
|
@@ -232,7 +234,7 @@ export default {
|
|
},
|
|
},
|
|
//上传文件,此处为上传图片
|
|
//上传文件,此处为上传图片
|
|
uploadFile (param) {
|
|
uploadFile (param) {
|
|
- this.showLoading();
|
|
|
|
|
|
+ this.showLoading()
|
|
const formData = new FormData()
|
|
const formData = new FormData()
|
|
let config = {
|
|
let config = {
|
|
//添加请求头
|
|
//添加请求头
|
|
@@ -240,14 +242,14 @@ export default {
|
|
}
|
|
}
|
|
formData.append('file', param.file)
|
|
formData.append('file', param.file)
|
|
Http.upload(Apis.FILE.UPLOAD_IMAGE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
|
|
Http.upload(Apis.FILE.UPLOAD_IMAGE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
|
|
- this.hideLoading();
|
|
|
|
|
|
+ this.hideLoading()
|
|
console.log('上传成功')
|
|
console.log('上传成功')
|
|
this.authentication.businessLicensePhoto = res.data
|
|
this.authentication.businessLicensePhoto = res.data
|
|
console.log(res.data)
|
|
console.log(res.data)
|
|
notify('success', '上传成功')
|
|
notify('success', '上传成功')
|
|
- this.$refs['authentication'].validateField('businessLicensePhoto');
|
|
|
|
|
|
+ this.$refs['authentication'].validateField('businessLicensePhoto')
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
- this.hideLoading();
|
|
|
|
|
|
+ this.hideLoading()
|
|
notify('error', error.data)
|
|
notify('error', error.data)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -268,11 +270,11 @@ export default {
|
|
sendBusMessage () {
|
|
sendBusMessage () {
|
|
this.$root.$emit('user', this.user)
|
|
this.$root.$emit('user', this.user)
|
|
},
|
|
},
|
|
- checkNumber(value){
|
|
|
|
- return /^\d+$/.test(value);
|
|
|
|
|
|
+ checkNumber (value) {
|
|
|
|
+ return /^\d+$/.test(value)
|
|
},
|
|
},
|
|
- checkNumberAndWord(value){
|
|
|
|
- return /^[^_IOZSVa-z\W]{2}\d{6}[^_IOZSVa-z\W]{10}$/g.test(value) || /^[A-Za-z0-9]\w{14}$/g.test(value);
|
|
|
|
|
|
+ checkNumberAndWord (value) {
|
|
|
|
+ return /^[^_IOZSVa-z\W]{2}\d{6}[^_IOZSVa-z\W]{10}$/g.test(value) || /^[A-Za-z0-9]\w{14}$/g.test(value)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
}
|
|
}
|