Compare commits

...

7 Commits

3 changed files with 149 additions and 31 deletions

View File

@@ -154,7 +154,7 @@ export default {
this.isLoading = false this.isLoading = false
}, },
initShow(){ initShow(){
this.keyword= '', this.keyword= ''
this.getNormalList() this.getNormalList()
} }
} }

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 {

View File

@@ -54,6 +54,11 @@
<span <span
class="content">{{ orderInfo.carClothingToolAmount }}</span> class="content">{{ orderInfo.carClothingToolAmount }}</span>
</div> </div>
<div class="item">
<span class="titleLeft">免拖</span>
<span
class="content">{{ orderInfo.customerDistanceLimit }} {{orderInfo.hedgingMileage && orderInfo.hedgingMileage > 0 ? '(超限对冲,只结免拖)' : ''}}</span>
</div>
<div class="item"> <div class="item">
<span class="titleLeft">换电瓶费用</span> <span class="titleLeft">换电瓶费用</span>
<span <span
@@ -72,35 +77,35 @@
<div class="inpInfo"> <div class="inpInfo">
<div class="titleContent"> <div class="titleContent">
<div class="flex-between" v-show="abState"> <div class="flex-between" v-show="abState">
<div> 到事发地距离:</div> <div><span style="color: red;">*</span> 到事发地距离:</div>
<div class="halfOpcity"><input @input="validateIntegerInput" class="ipt" type="number" v-model="form.supplierSettleMileageAb"/>公里</div> <div class="halfOpcity"><input @input="validateIntegerInput" class="ipt" type="number" v-model="form.supplierSettleMileageAb"/>公里</div>
</div> </div>
<div class="flex-between" v-show="bcState"> <div class="flex-between" v-show="bcState">
<div> 拖车里程:</div> <div><span style="color: red;">*</span> 拖车里程:</div>
<div class="halfOpcity"><input class="ipt" type="number" v-model="form.supplierSettleMileageBc"/>公里</div> <div class="halfOpcity"><input class="ipt" type="number" v-model="form.supplierSettleMileageBc"/>公里</div>
</div> </div>
<div class="flex-between" v-show="caState"> <div class="flex-between" v-show="caState">
<div>返程里程:</div> <div><span style="color: red;">*</span>返程里程:</div>
<div class="halfOpcity"><input class="ipt" type="number" v-model="form.supplierSettleMileageCa"/>公里</div> <div class="halfOpcity"><input class="ipt" type="number" v-model="form.supplierSettleMileageCa"/>公里</div>
</div> </div>
<div class="flex-between" v-show="bridgeAbState"> <div class="flex-between" v-show="bridgeAbState">
<div>ab路桥费:</div> <div><span v-show="!isUnsuccessfulSettle" style="color: red;">*</span>ab路桥费:</div>
<div class="halfOpcity"><input class="ipt" @input="validateIntegerInput" :disabled="isUnsuccessfulSettle" type="number" v-model="form.supplierBridgeAmountAb"/></div> <div class="halfOpcity"><input class="ipt" @input="validateIntegerInput" :disabled="isUnsuccessfulSettle" type="number" v-model="form.supplierBridgeAmountAb"/></div>
</div> </div>
<div class="flex-between" v-show="bridgeBcState"> <div class="flex-between" v-show="bridgeBcState">
<div>bc路桥费:</div> <div><span v-show="!isUnsuccessfulSettle" style="color: red;">*</span>bc路桥费:</div>
<div class="halfOpcity"><input class="ipt" @input="validateIntegerInput" :disabled="isUnsuccessfulSettle" type="number" v-model="form.supplierBridgeAmountBc"/></div> <div class="halfOpcity"><input class="ipt" @input="validateIntegerInput" :disabled="isUnsuccessfulSettle" type="number" v-model="form.supplierBridgeAmountBc"/></div>
</div> </div>
<div class="flex-between" v-show="bridgeCaState"> <div class="flex-between" v-show="bridgeCaState">
<div>ca路桥费:</div> <div><span v-show="!isUnsuccessfulSettle" style="color: red;">*</span>ca路桥费:</div>
<div class="halfOpcity"><input class="ipt" @input="validateIntegerInput" :disabled="isUnsuccessfulSettle" type="number" v-model="form.supplierBridgeAmountCa"/></div> <div class="halfOpcity"><input class="ipt" @input="validateIntegerInput" :disabled="isUnsuccessfulSettle" type="number" v-model="form.supplierBridgeAmountCa"/></div>
</div> </div>
<div class="flex-between" v-show="waitAmountState"> <div class="flex-between" v-show="waitAmountState">
<div>等候费:</div> <div><span style="color: red;">*</span>等候费:</div>
<div class="halfOpcity inputContent"><input class="ipt" @input="validateIntegerInput" type="number" v-model="form.supplierWaitAmount"/></div> <div class="halfOpcity inputContent"><input class="ipt" @input="validateIntegerInput" type="number" v-model="form.supplierWaitAmount"/></div>
</div> </div>
<div class="flex-between" v-show="tyreAmountState"> <div class="flex-between" v-show="tyreAmountState">
<div>小轮个数:</div> <div><span v-show="!isUnsuccessfulSettle" style="color: red;">*</span>小轮个数:</div>
<div class="halfOpcity inputContent"><input class="ipt" @input="validateIntegerInput" :disabled="isUnsuccessfulSettle" type="number" v-model="form.tyreNumber"/></div> <div class="halfOpcity inputContent"><input class="ipt" @input="validateIntegerInput" :disabled="isUnsuccessfulSettle" type="number" v-model="form.tyreNumber"/></div>
</div> </div>
<div class="flex-between" v-show="tyreAmountState"> <div class="flex-between" v-show="tyreAmountState">
@@ -108,11 +113,11 @@
<div class="halfOpcity inputContent"><input @input="validateIntegerInput" disabled type="number" v-model="form.supplierTyreAmount"/></div> <div class="halfOpcity inputContent"><input @input="validateIntegerInput" disabled type="number" v-model="form.supplierTyreAmount"/></div>
</div> </div>
<div class="flex-between" v-show="dilemmaAmountState && basePriceDisabled"> <div class="flex-between" v-show="dilemmaAmountState && basePriceDisabled">
<div>困境费:</div> <div><span style="color: red;">*</span>困境费:</div>
<div class="halfOpcity inputContent"><input class="ipt" @input="validateIntegerInput" type="number" v-model="form.supplierDilemmaAmount"/></div> <div class="halfOpcity inputContent"><input class="ipt" @input="validateIntegerInput" type="number" v-model="form.supplierDilemmaAmount"/></div>
</div> </div>
<div class="flex-between" v-show="basementFeeState"> <div class="flex-between" v-show="basementFeeState">
<div>地库费:</div> <div><span v-show="isBasementSettle && !isUnsuccessfulSettle" style="color: red;">*</span>地库费:</div>
<div class="halfOpcity inputContent"><input @input="validateIntegerInput" class="ipt" type="number" v-model="form.supplierBasementFee" :disabled="!isBasementSettle || isUnsuccessfulSettle" /></div> <div class="halfOpcity inputContent"><input @input="validateIntegerInput" class="ipt" type="number" v-model="form.supplierBasementFee" :disabled="!isBasementSettle || isUnsuccessfulSettle" /></div>
</div> </div>
<div class="flex-between"> <div class="flex-between">
@@ -120,7 +125,7 @@
<div class="halfOpcity inputContent"><input type="number" class="ipt" v-model="form.supplierCustomerAmount"/></div> <div class="halfOpcity inputContent"><input type="number" class="ipt" v-model="form.supplierCustomerAmount"/></div>
</div> </div>
<div class="flex-between bgDisable" :class=" { 'flex-between': true, 'bgDisable' : basePriceDisabled } "> <div class="flex-between bgDisable" :class=" { 'flex-between': true, 'bgDisable' : basePriceDisabled } ">
<div>基本费用:</div> <div><span v-show="!basePriceDisabled && !isBasementSettle" style="color: red;">*</span>基本费用:</div>
<div class="halfOpcity inputContent "><input class="disable" type="number" :readonly="basePriceDisabled || isBasementSettle" <div class="halfOpcity inputContent "><input class="disable" type="number" :readonly="basePriceDisabled || isBasementSettle"
v-model="form.supplierBasePrice"/><span></span></div> v-model="form.supplierBasePrice"/><span></span></div>
</div> </div>
@@ -502,6 +507,7 @@ export default {
}) })
}, },
async compute() { async compute() {
alert(11111)
if(this.orderInfo.contractSettleTypeString == '车主现收'){ if(this.orderInfo.contractSettleTypeString == '车主现收'){
this.form.supplierBasePrice = 0 this.form.supplierBasePrice = 0
this.form.supplierExtraPrice = 0 this.form.supplierExtraPrice = 0
@@ -657,6 +663,49 @@ export default {
this.goback() this.goback()
}, },
async save() { async save() {
const isBlank = (v) => v === '' || v === null || v === undefined || parseFloat(v) < 0
if (this.abState && isBlank(this.form.supplierSettleMileageAb)) {
this.$toast('请填写到事发地距离'); return;
}
if (this.bcState && isBlank(this.form.supplierSettleMileageBc)) {
this.$toast('请填写拖车里程'); return;
}
if (this.caState && isBlank(this.form.supplierSettleMileageCa)) {
this.$toast('请填写返程里程'); return;
}
if (this.bridgeAbState && !this.isUnsuccessfulSettle && isBlank(this.form.supplierBridgeAmountAb)) {
this.$toast('请填写ab路桥费'); return;
}
if (this.bridgeBcState && !this.isUnsuccessfulSettle && isBlank(this.form.supplierBridgeAmountBc)) {
this.$toast('请填写bc路桥费'); return;
}
if (this.bridgeCaState && !this.isUnsuccessfulSettle && isBlank(this.form.supplierBridgeAmountCa)) {
this.$toast('请填写ca路桥费'); return;
}
if (this.waitAmountState && isBlank(this.form.supplierWaitAmount)) {
this.$toast('请填写等候费'); return;
}
if (!this.auditFormShow && this.tyreAmountState && !this.isUnsuccessfulSettle && isBlank(this.form.tyreNumber)) {
this.$toast('请填写小轮个数'); return;
}
if (this.dilemmaAmountState && this.basePriceDisabled && isBlank(this.form.supplierDilemmaAmount)) {
this.$toast('请填写困境费'); return;
}
if (this.basementFeeState && this.isBasementSettle && !this.isUnsuccessfulSettle && isBlank(this.form.supplierBasementFee)) {
this.$toast('请填写地库费'); return;
}
if (!this.basePriceDisabled && !this.isBasementSettle && isBlank(this.form.supplierBasePrice)) {
this.$toast('请填写基本费用'); return;
}
if (
this.orderInfo.customerDistanceLimit &&
parseFloat(this.form.supplierSettleMileageBc) > parseFloat(this.orderInfo.customerDistanceLimit)
) {
if (!this.form.supplierCustomerAmount || parseFloat(this.form.supplierCustomerAmount) == 0) {
this.$toast('拖车里程超出免拖范围,请填写收取客户金额');
return;
}
}
if (this.form.supplierOtherAmount > 0) { if (this.form.supplierOtherAmount > 0) {
if (this.form.supplierOtherAmountRemark == '') { if (this.form.supplierOtherAmountRemark == '') {
this.$toast('请填写其他费用说明'); this.$toast('请填写其他费用说明');
@@ -694,6 +743,7 @@ export default {
await this.compute(); await this.compute();
const formData = new FormData(); const formData = new FormData();
let obj = this.form; let obj = this.form;
console.log('obj',obj)
Object.keys(obj).forEach((key) => { Object.keys(obj).forEach((key) => {
formData.append(key, obj[key]); formData.append(key, obj[key]);
}); });
@@ -704,7 +754,7 @@ export default {
formData.append('state', 0); formData.append('state', 0);
formData.append('postfix', this.postfix); formData.append('postfix', this.postfix);
formData.append('supplierBridgeAmount', parseInt(this.form.supplierBridgeAmountAb || 0) + parseInt(this.form.supplierBridgeAmountBc || 0) + parseInt(this.form.supplierBridgeAmountCa || 0)); formData.append('supplierBridgeAmount', parseInt(this.form.supplierBridgeAmountAb || 0) + parseInt(this.form.supplierBridgeAmountBc || 0) + parseInt(this.form.supplierBridgeAmountCa || 0));
let res = await updateAccountRecordInfo(formData); /*let res = await updateAccountRecordInfo(formData);
if (res.code === 200) { if (res.code === 200) {
this.$toast('操作成功') this.$toast('操作成功')
setTimeout(() => { setTimeout(() => {
@@ -717,7 +767,7 @@ export default {
} }
}) })
}, 2000) }, 2000)
} }*/
this.loading = false; this.loading = false;
}, },
async confirmAudit() { async confirmAudit() {
@@ -725,6 +775,45 @@ export default {
this.$toast('已进入后续流程,不允许操作'); this.$toast('已进入后续流程,不允许操作');
return; return;
} }
const isBlank = (v) => v === '' || v === null || v === undefined || parseFloat(v) < 0
if (this.abState && isBlank(this.form.supplierSettleMileageAb)) {
this.$toast('请填写到事发地距离'); return;
}
if (this.bcState && isBlank(this.form.supplierSettleMileageBc)) {
this.$toast('请填写拖车里程'); return;
}
if (this.caState && isBlank(this.form.supplierSettleMileageCa)) {
this.$toast('请填写返程里程'); return;
}
if (this.bridgeAbState && !this.isUnsuccessfulSettle && isBlank(this.form.supplierBridgeAmountAb)) {
this.$toast('请填写ab路桥费'); return;
}
if (this.bridgeBcState && !this.isUnsuccessfulSettle && isBlank(this.form.supplierBridgeAmountBc)) {
this.$toast('请填写bc路桥费'); return;
}
if (this.bridgeCaState && !this.isUnsuccessfulSettle && isBlank(this.form.supplierBridgeAmountCa)) {
this.$toast('请填写ca路桥费'); return;
}
if (this.waitAmountState && isBlank(this.form.supplierWaitAmount)) {
this.$toast('请填写等候费'); return;
}
if (this.dilemmaAmountState && this.basePriceDisabled && isBlank(this.form.supplierDilemmaAmount)) {
this.$toast('请填写困境费'); return;
}
if (this.basementFeeState && this.isBasementSettle && !this.isUnsuccessfulSettle && isBlank(this.form.supplierBasementFee)) {
this.$toast('请填写地库费'); return;
}
if (!this.basePriceDisabled && !this.isBasementSettle && isBlank(this.form.supplierBasePrice)) {
this.$toast('请填写基本费用'); return;
}
if (
this.orderInfo.customerDistanceLimit &&
parseFloat(this.form.supplierSettleMileageBc) > parseFloat(this.orderInfo.customerDistanceLimit)
) {
if (!this.form.supplierCustomerAmount || parseFloat(this.form.supplierCustomerAmount) == 0) {
this.$toast('拖车里程超出免拖范围,请填写收取客户金额'); return;
}
}
this.loading1 = true; this.loading1 = true;
this.form.supplierExtraPrice = this.form.extraPrice || 0 this.form.supplierExtraPrice = this.form.extraPrice || 0
this.form.supplierBasePrice = this.form.basePrice || 0 this.form.supplierBasePrice = this.form.basePrice || 0
@@ -760,7 +849,7 @@ export default {
formData.append('state', 0); formData.append('state', 0);
formData.append('postfix', this.postfix); formData.append('postfix', this.postfix);
formData.append('supplierBridgeAmount', parseInt(this.form.supplierBridgeAmountAb || 0) + parseInt(this.form.supplierBridgeAmountBc || 0) + parseInt(this.form.supplierBridgeAmountCa || 0)); formData.append('supplierBridgeAmount', parseInt(this.form.supplierBridgeAmountAb || 0) + parseInt(this.form.supplierBridgeAmountBc || 0) + parseInt(this.form.supplierBridgeAmountCa || 0));
let res = await updateAccountRecordInfo(formData); /*let res = await updateAccountRecordInfo(formData);
if (res.code === 200) { if (res.code === 200) {
this.$toast('操作成功') this.$toast('操作成功')
setTimeout(() => { setTimeout(() => {
@@ -773,7 +862,7 @@ export default {
} }
}) })
}, 2000) }, 2000)
} }*/
this.loading1 = false; this.loading1 = false;
}, },
@@ -942,7 +1031,7 @@ img {
} }
.baseInfo { .baseInfo {
@include wh(100%, 344px); width: 100%;
} }