Compare commits

...

2 Commits

View File

@@ -1,5 +1,6 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="error_bar" v-if="errorMsg">{{ errorMsg }}</div>
<div class="top_banner"> <div class="top_banner">
<img src="@/assets/supplier/topBg.png" alt=""> <img src="@/assets/supplier/topBg.png" alt="">
</div> </div>
@@ -134,6 +135,7 @@
data() { data() {
return { return {
clickFlag: true, clickFlag: true,
errorMsg: '',
phoneVerify: [{ required: true, message: '请输入联系电话' }, { validator: value => { return /^1[3456789]\d{9}$/.test(value) }, message: '联系电话格式不正确' }], phoneVerify: [{ required: true, message: '请输入联系电话' }, { validator: value => { return /^1[3456789]\d{9}$/.test(value) }, message: '联系电话格式不正确' }],
emailVerify: [{ required: true, message: '请输入邮箱' }, { validator: value => { return /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/.test(value) }, message: '邮箱格式不正确' }], emailVerify: [{ required: true, message: '请输入邮箱' }, { validator: value => { return /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/.test(value) }, message: '邮箱格式不正确' }],
id:'', //车辆Id id:'', //车辆Id
@@ -231,7 +233,11 @@
this.idBackPhoto = _data?.idCardBackUrl; this.idBackPhoto = _data?.idCardBackUrl;
this.companyPhoto = _data?.businessLicense; this.companyPhoto = _data?.businessLicense;
this.licensePhoto = _data?.accountUrl; this.licensePhoto = _data?.accountUrl;
this.wechatId = _data?.wechatId this.wechatId = _data?.wechatId;
this.form.person = _data.legalName;
if( _data.failReason ) {
this.showError(_data.failReason)
}
if(this.idFrontPhoto) { if(this.idFrontPhoto) {
this.idFrontPhotoList = [{ url : this.idFrontPhoto }]; this.idFrontPhotoList = [{ url : this.idFrontPhoto }];
} }
@@ -252,44 +258,54 @@
// this.form.serviceAreaCode = _data?.serviceAreaCode.split(',').map(item => Number(item)); // this.form.serviceAreaCode = _data?.serviceAreaCode.split(',').map(item => Number(item));
} }
}, },
showError(msg) {
this.errorMsg = msg;
},
async applyAdd() { async applyAdd() {
this.errorMsg = '';
if( !this.idFrontPhoto ) { if( !this.idFrontPhoto ) {
this.$toast('法人身份证人像页未上传') this.showError('法人身份证人像页未上传')
return return
} }
if( !this.idBackPhoto ) { if( !this.idBackPhoto ) {
this.$toast('法人身份证国徽页未上传') this.showError('法人身份证国徽页未上传')
return return
} }
if( !this.companyPhoto ) { if( !this.companyPhoto ) {
this.$toast('营业执照未上传') this.showError('营业执照未上传')
return return
} }
if(this.form.person != this.form.legalName){ if(this.form.person != this.form.legalName){
this.$toast('身份证法人姓名和营业执照法人不一致') this.showError('身份证法人姓名和营业执照法人不一致')
return return
} }
if( !this.licensePhoto ) { if( !this.licensePhoto ) {
this.$toast('开户许可证未上传') this.showError('开户许可证未上传')
return
}
if( !(this.$refs.tree.getCheckedKeys().length > 0) ) {
this.showError('服务能力不能为空')
return return
} }
if( !(this.form.serviceAreaCode.length > 0) ) { if( !(this.form.serviceAreaCode.length > 0) ) {
this.$toast('服务区域不能为空') this.showError('服务区域不能为空')
return
}
if( !this.qrCode && !this.id) {
await this.QrCodeHandler();
this.showError('请先添加下方企微再申请')
return return
} }
// this.wechatId='wmOTNXBwAABrvKkE_Fh8ZN8Xm2S9v2wQ' // this.wechatId='wmOTNXBwAABrvKkE_Fh8ZN8Xm2S9v2wQ'
if(!this.wechatId) { if(!this.wechatId) {
await this.QrCodeResult(); await this.QrCodeResult();
if( !this.wechatId ) { if( !this.wechatId ) {
this.$toast('请先添加企微再申请') this.showError('请先添加企微再申请')
return return
} }
} }
if( this.$refs.tree.getCheckedKeys().length > 0 ) { if( this.$refs.tree.getCheckedKeys().length > 0 ) {
await this.saveHandler() await this.saveHandler()
} else {
this.$toast('服务能力不能为空')
return
} }
}, },
async QrCodeResult() { //获取添加企微结果 async QrCodeResult() { //获取添加企微结果
@@ -330,6 +346,8 @@
this.clickFlag = true this.clickFlag = true
}, 1000) }, 1000)
}); });
} catch (e) {
this.showError(e)
} finally { } finally {
setTimeout(() => { setTimeout(() => {
this.clickFlag = true this.clickFlag = true
@@ -428,7 +446,7 @@
this.form.accountInfoDTO.companyType=res?.data?.type this.form.accountInfoDTO.companyType=res?.data?.type
// 营业执照法人名称 // 营业执照法人名称
this.form.person = res?.data?.person this.form.person = res?.data?.person
await this.QrCodeHandler(); // await this.QrCodeHandler();
}, },
async licensePhotoHandler(file){// 开户许可证 async licensePhotoHandler(file){// 开户许可证
const formData = new FormData(); const formData = new FormData();
@@ -442,8 +460,8 @@
ocrType: 15, ocrType: 15,
imageUrl: this.licensePhoto, imageUrl: this.licensePhoto,
}) })
this.form.accountInfoDTO.accountNumber=res?.data?.accountNumber this.form.accountInfoDTO.accountNumber=res?.data?.accountNumber || ''
this.form.accountInfoDTO.accountName = res?.data?.accountBank this.form.accountInfoDTO.accountName = res?.data?.accountBank || ''
}, },
}, },
computed: { computed: {
@@ -463,6 +481,17 @@
padding-bottom: 100px; padding-bottom: 100px;
overflow-y: auto; overflow-y: auto;
} }
.error_bar {
position: sticky;
top: 0;
z-index: 9999;
background-color: #e53935;
color: #ffffff;
font-size: 14px;
padding: 10px 16px;
text-align: center;
line-height: 1.5;
}
.top_banner { .top_banner {
width: 100%; width: 100%;
img { img {