调整业务模块
This commit is contained in:
@@ -2464,6 +2464,9 @@ export default {
|
||||
});
|
||||
},
|
||||
handleCarrierTypeChange() {
|
||||
this.dialogForm.carrierContractId = '';
|
||||
this.dialogForm.carrierName = '';
|
||||
this.dialogForm.carrierId = '';
|
||||
if (this.dialogForm.carrierType === '承运商') {
|
||||
this.dialogForm.trailerVehicleNo = '';
|
||||
this.dialogForm.escortName = '';
|
||||
@@ -2471,7 +2474,6 @@ export default {
|
||||
}
|
||||
if (this.dialogForm.carrierType === '网货平台') {
|
||||
this.dialogForm.carrierContractId = '';
|
||||
this.dialogForm.carrierName = '';
|
||||
}
|
||||
this.loadTaskCarrierOptions();
|
||||
},
|
||||
@@ -2626,19 +2628,38 @@ export default {
|
||||
const response = await loadingApi.getCarrierContracts(projectIds);
|
||||
if (requestId !== this.taskCarrierRequestId) return [];
|
||||
const contracts = response.data?.data || response.data || [];
|
||||
if (this.dialogForm.carrierType === '承运商') {
|
||||
this.taskCarrierOptions = contracts;
|
||||
if (this.dialogForm.carrierType !== '自运') {
|
||||
this.taskCarrierOptions = contracts
|
||||
.map(item => ({
|
||||
...item,
|
||||
carrierName:
|
||||
item.partyB ||
|
||||
item.partyBName ||
|
||||
item.contractPartyB ||
|
||||
item.customerContractPartyB ||
|
||||
item.carrierName ||
|
||||
'',
|
||||
carrierId:
|
||||
item.partyBId ||
|
||||
item.partyBUserId ||
|
||||
item.contractPartyBId ||
|
||||
item.customerContractPartyBId ||
|
||||
item.carrierId ||
|
||||
'',
|
||||
}))
|
||||
.filter(item => item.carrierName);
|
||||
const current =
|
||||
contracts.find(item => String(item.id) === String(this.dialogForm.carrierContractId)) ||
|
||||
contracts.find(item => item.carrierName === this.dialogForm.carrierName);
|
||||
this.taskCarrierOptions.find(item => item.carrierName === this.dialogForm.carrierName);
|
||||
if (current) {
|
||||
this.dialogForm.carrierContractId = current.id;
|
||||
this.dialogForm.carrierName = current.carrierName;
|
||||
this.dialogForm.carrierId = current.carrierId || '';
|
||||
} else {
|
||||
this.dialogForm.carrierContractId = '';
|
||||
this.dialogForm.carrierName = '';
|
||||
}
|
||||
return contracts;
|
||||
return this.taskCarrierOptions;
|
||||
}
|
||||
if (this.dialogForm.carrierType === '自运' && contracts.length) {
|
||||
this.taskCarrierOptions = contracts;
|
||||
|
||||
Reference in New Issue
Block a user