fix
This commit is contained in:
@@ -24,10 +24,11 @@ export const getDetail = id =>
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const getCarrierContracts = () =>
|
export const getCarrierContracts = projectIds =>
|
||||||
request({
|
request({
|
||||||
url: `${baseUrl}/carrier-contracts`,
|
url: `${baseUrl}/carrier-contracts`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
params: { projectIds: (projectIds || []).join(',') },
|
||||||
});
|
});
|
||||||
|
|
||||||
export const saveDraft = row =>
|
export const saveDraft = row =>
|
||||||
|
|||||||
@@ -666,7 +666,7 @@
|
|||||||
class="business-crud-page__task-span-1"
|
class="business-crud-page__task-span-1"
|
||||||
>
|
>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.carrierName"
|
v-model="taskCarrierValue"
|
||||||
:placeholder="`请选择${taskCarrierLabel}`"
|
:placeholder="`请选择${taskCarrierLabel}`"
|
||||||
filterable
|
filterable
|
||||||
clearable
|
clearable
|
||||||
@@ -674,7 +674,6 @@
|
|||||||
:loading="taskCarrierLoading"
|
:loading="taskCarrierLoading"
|
||||||
:disabled="dialogReadonly || (isWaybillDetailLayout && !form.projectId)"
|
:disabled="dialogReadonly || (isWaybillDetailLayout && !form.projectId)"
|
||||||
@visible-change="visible => visible && loadTaskCarrierOptions()"
|
@visible-change="visible => visible && loadTaskCarrierOptions()"
|
||||||
@change="handleTaskCarrierChange"
|
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in taskCarrierOptions"
|
v-for="item in taskCarrierOptions"
|
||||||
@@ -686,8 +685,8 @@
|
|||||||
item.name ||
|
item.name ||
|
||||||
item.customerCode
|
item.customerCode
|
||||||
"
|
"
|
||||||
:label="item.customerName || item.carrierName || item.fullName || item.name"
|
:label="item.label || item.customerName || item.carrierName || item.fullName || item.name"
|
||||||
:value="item.customerName || item.carrierName || item.fullName || item.name"
|
:value="item.value || item.customerName || item.carrierName || item.fullName || item.name"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -1206,7 +1205,7 @@
|
|||||||
<template v-if="hasTransportType">
|
<template v-if="hasTransportType">
|
||||||
<el-form-item v-if="taskCarrierRequired" :label="taskCarrierLabel" required>
|
<el-form-item v-if="taskCarrierRequired" :label="taskCarrierLabel" required>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.carrierName"
|
v-model="taskCarrierValue"
|
||||||
:placeholder="`请选择${taskCarrierLabel}`"
|
:placeholder="`请选择${taskCarrierLabel}`"
|
||||||
filterable
|
filterable
|
||||||
clearable
|
clearable
|
||||||
@@ -1217,7 +1216,6 @@
|
|||||||
!taskCarrierRequired
|
!taskCarrierRequired
|
||||||
"
|
"
|
||||||
@visible-change="visible => visible && loadTaskCarrierOptions()"
|
@visible-change="visible => visible && loadTaskCarrierOptions()"
|
||||||
@change="handleTaskCarrierChange"
|
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in taskCarrierOptions"
|
v-for="item in taskCarrierOptions"
|
||||||
@@ -1229,8 +1227,8 @@
|
|||||||
item.name ||
|
item.name ||
|
||||||
item.customerCode
|
item.customerCode
|
||||||
"
|
"
|
||||||
:label="item.customerName || item.carrierName || item.fullName || item.name"
|
:label="item.label || item.customerName || item.carrierName || item.fullName || item.name"
|
||||||
:value="item.customerName || item.carrierName || item.fullName || item.name"
|
:value="item.value || item.customerName || item.carrierName || item.fullName || item.name"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -5992,6 +5990,17 @@ export default {
|
|||||||
taskCarrierLabel() {
|
taskCarrierLabel() {
|
||||||
return this.form.carrierType === '网货平台' ? '承运方' : '承运商';
|
return this.form.carrierType === '网货平台' ? '承运方' : '承运商';
|
||||||
},
|
},
|
||||||
|
taskCarrierValue: {
|
||||||
|
get() {
|
||||||
|
if (this.isWaybillDetailLayout && this.form.carrierType === '承运商') {
|
||||||
|
return this.form.carrierContractId || '';
|
||||||
|
}
|
||||||
|
return this.form.carrierName || '';
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
this.handleTaskCarrierChange(value);
|
||||||
|
},
|
||||||
|
},
|
||||||
showRoadEscortFields() {
|
showRoadEscortFields() {
|
||||||
return this.isRoadTransport && !this.isCarrierMode;
|
return this.isRoadTransport && !this.isCarrierMode;
|
||||||
},
|
},
|
||||||
@@ -8179,6 +8188,7 @@ export default {
|
|||||||
this.taskCarrierLoading = false;
|
this.taskCarrierLoading = false;
|
||||||
this.form.carrierName = '';
|
this.form.carrierName = '';
|
||||||
this.form.carrierId = '';
|
this.form.carrierId = '';
|
||||||
|
this.form.carrierContractId = '';
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -8189,6 +8199,7 @@ export default {
|
|||||||
if (this.isWaybillDetailLayout) {
|
if (this.isWaybillDetailLayout) {
|
||||||
this.form.carrierName = '';
|
this.form.carrierName = '';
|
||||||
this.form.carrierId = '';
|
this.form.carrierId = '';
|
||||||
|
this.form.carrierContractId = '';
|
||||||
this.loadTaskCarrierOptions(project);
|
this.loadTaskCarrierOptions(project);
|
||||||
}
|
}
|
||||||
if (this.contractSelectEnabled || this.config.enableTransportPlanForm) {
|
if (this.contractSelectEnabled || this.config.enableTransportPlanForm) {
|
||||||
@@ -8414,6 +8425,11 @@ export default {
|
|||||||
carrierInfo.customerName ||
|
carrierInfo.customerName ||
|
||||||
carrierInfo.name ||
|
carrierInfo.name ||
|
||||||
'';
|
'';
|
||||||
|
this.form.carrierContractId =
|
||||||
|
this.form.carrierContractId ||
|
||||||
|
taskInfo.carrierContractId ||
|
||||||
|
carrierInfo.carrierContractId ||
|
||||||
|
'';
|
||||||
this.form.driverName =
|
this.form.driverName =
|
||||||
this.form.driverName || taskInfo.driverName || carrierInfo.driverName || '';
|
this.form.driverName || taskInfo.driverName || carrierInfo.driverName || '';
|
||||||
this.form.driverPhone =
|
this.form.driverPhone =
|
||||||
@@ -8560,7 +8576,14 @@ export default {
|
|||||||
this.form.carrierName = '';
|
this.form.carrierName = '';
|
||||||
this.form.carrierId = '';
|
this.form.carrierId = '';
|
||||||
}
|
}
|
||||||
|
if (nextValue !== '承运商') {
|
||||||
|
this.form.carrierContractId = '';
|
||||||
|
}
|
||||||
this.form.carrierType = nextValue;
|
this.form.carrierType = nextValue;
|
||||||
|
if (this.isWaybillDetailLayout) {
|
||||||
|
this.taskCarrierRequestId += 1;
|
||||||
|
this.taskCarrierOptions = [];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
isTaskCarrierRequired(carrierType) {
|
isTaskCarrierRequired(carrierType) {
|
||||||
return ['承运商', '网货平台'].includes(String(carrierType || '').trim());
|
return ['承运商', '网货平台'].includes(String(carrierType || '').trim());
|
||||||
@@ -8570,6 +8593,27 @@ export default {
|
|||||||
if (this.isWaybillDetailLayout) {
|
if (this.isWaybillDetailLayout) {
|
||||||
const projectId = project.id || project.projectId || this.form.projectId;
|
const projectId = project.id || project.projectId || this.form.projectId;
|
||||||
const requestId = ++this.taskCarrierRequestId;
|
const requestId = ++this.taskCarrierRequestId;
|
||||||
|
if (this.form.carrierType === '承运商') {
|
||||||
|
if (!projectId) {
|
||||||
|
this.taskCarrierOptions = [];
|
||||||
|
return Promise.resolve([]);
|
||||||
|
}
|
||||||
|
this.taskCarrierLoading = true;
|
||||||
|
return getContractList(1, 9999, {
|
||||||
|
projectId,
|
||||||
|
projectName: project.projectName || this.form.projectName,
|
||||||
|
contractCategory: '承运商合同',
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
if (requestId !== this.taskCarrierRequestId) return this.taskCarrierOptions;
|
||||||
|
this.taskCarrierOptions = this.getWaybillCarrierContractOptions(extractRecords(res));
|
||||||
|
return this.taskCarrierOptions;
|
||||||
|
})
|
||||||
|
.catch(() => this.taskCarrierOptions)
|
||||||
|
.finally(() => {
|
||||||
|
if (requestId === this.taskCarrierRequestId) this.taskCarrierLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
const currentProject = this.projectOptions.find(
|
const currentProject = this.projectOptions.find(
|
||||||
item => String(item.id) === String(projectId)
|
item => String(item.id) === String(projectId)
|
||||||
);
|
);
|
||||||
@@ -8607,10 +8651,16 @@ export default {
|
|||||||
},
|
},
|
||||||
handleTaskCarrierChange(value) {
|
handleTaskCarrierChange(value) {
|
||||||
const carrier = this.taskCarrierOptions.find(item =>
|
const carrier = this.taskCarrierOptions.find(item =>
|
||||||
[item.customerName, item.carrierName, item.fullName, item.name].some(
|
[item.value, item.customerName, item.carrierName, item.fullName, item.name].some(name =>
|
||||||
name => String(name || '') === value
|
String(name || '') === String(value || '')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
if (this.isWaybillDetailLayout && this.form.carrierType === '承运商') {
|
||||||
|
this.form.carrierContractId = carrier?.carrierContractId || '';
|
||||||
|
this.form.carrierId = carrier?.carrierId || '';
|
||||||
|
this.form.carrierName = carrier?.carrierName || value || '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.form.carrierId = carrier?.id || '';
|
this.form.carrierId = carrier?.id || '';
|
||||||
this.form.carrierName = value || '';
|
this.form.carrierName = value || '';
|
||||||
},
|
},
|
||||||
@@ -8959,6 +9009,9 @@ export default {
|
|||||||
if (this.isTaskCarrierRequired(row.carrierType)) {
|
if (this.isTaskCarrierRequired(row.carrierType)) {
|
||||||
requiredFields.push(['carrierName', row.carrierType === '网货平台' ? '承运方' : '承运商']);
|
requiredFields.push(['carrierName', row.carrierType === '网货平台' ? '承运方' : '承运商']);
|
||||||
}
|
}
|
||||||
|
if (this.isWaybillDetailLayout && row.carrierType === '承运商') {
|
||||||
|
requiredFields.push(['carrierContractId', '承运商合同']);
|
||||||
|
}
|
||||||
if (this.isRoadTransport && row.carrierType === '自运') {
|
if (this.isRoadTransport && row.carrierType === '自运') {
|
||||||
requiredFields.push(['driverName', '司机']);
|
requiredFields.push(['driverName', '司机']);
|
||||||
requiredFields.push(['driverPhone', '手机号']);
|
requiredFields.push(['driverPhone', '手机号']);
|
||||||
@@ -9035,6 +9088,7 @@ export default {
|
|||||||
carrierType: row.carrierType,
|
carrierType: row.carrierType,
|
||||||
carrierId: row.carrierId,
|
carrierId: row.carrierId,
|
||||||
carrierName: row.carrierName,
|
carrierName: row.carrierName,
|
||||||
|
carrierContractId: row.carrierContractId,
|
||||||
driverId: row.driverId,
|
driverId: row.driverId,
|
||||||
driverName: row.driverName,
|
driverName: row.driverName,
|
||||||
driverPhone: row.driverPhone,
|
driverPhone: row.driverPhone,
|
||||||
@@ -9062,6 +9116,7 @@ export default {
|
|||||||
carrierType: row.carrierType,
|
carrierType: row.carrierType,
|
||||||
carrierId: row.carrierId,
|
carrierId: row.carrierId,
|
||||||
carrierName: row.carrierName,
|
carrierName: row.carrierName,
|
||||||
|
carrierContractId: row.carrierContractId,
|
||||||
driverId: row.driverId,
|
driverId: row.driverId,
|
||||||
driverName: row.driverName,
|
driverName: row.driverName,
|
||||||
driverPhone: row.driverPhone,
|
driverPhone: row.driverPhone,
|
||||||
@@ -12298,6 +12353,31 @@ export default {
|
|||||||
names.forEach(append);
|
names.forEach(append);
|
||||||
return options;
|
return options;
|
||||||
},
|
},
|
||||||
|
getWaybillCarrierContractOptions(contracts = []) {
|
||||||
|
const carrierNameCounts = contracts.reduce((counts, contract) => {
|
||||||
|
const carrierName = String(contract.partyB || '').trim();
|
||||||
|
if (carrierName) counts[carrierName] = (counts[carrierName] || 0) + 1;
|
||||||
|
return counts;
|
||||||
|
}, {});
|
||||||
|
return contracts
|
||||||
|
.map(contract => {
|
||||||
|
const carrierName = String(contract.partyB || '').trim();
|
||||||
|
if (!carrierName || !contract.id) return null;
|
||||||
|
const contractIdentifier = contract.contractName || contract.contractNo || contract.id;
|
||||||
|
return {
|
||||||
|
id: contract.id,
|
||||||
|
value: contract.id,
|
||||||
|
label:
|
||||||
|
carrierNameCounts[carrierName] > 1
|
||||||
|
? `${carrierName}(${contractIdentifier})`
|
||||||
|
: carrierName,
|
||||||
|
carrierName,
|
||||||
|
fullName: carrierName,
|
||||||
|
carrierContractId: contract.id,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.filter(Boolean);
|
||||||
|
},
|
||||||
loadDispatchCarrierOptions(plan = this.dispatchRow) {
|
loadDispatchCarrierOptions(plan = this.dispatchRow) {
|
||||||
if (this.dispatchCarrierLoading) return Promise.resolve(this.dispatchCarrierOptions);
|
if (this.dispatchCarrierLoading) return Promise.resolve(this.dispatchCarrierOptions);
|
||||||
const projectId = plan?.projectId;
|
const projectId = plan?.projectId;
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
<el-form :model="route" label-position="right" label-width="auto" class="dispatch-form carrier-form">
|
<el-form :model="route" label-position="right" label-width="auto" class="dispatch-form carrier-form">
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<template v-if="isRoad(route)">
|
<template v-if="isRoad(route)">
|
||||||
<el-col v-if="route.carrierType !== '自运'" :span="6"><el-form-item label="承运商" required><el-select v-model="route.carrierContractId" filterable clearable placeholder="请选择" :loading="carrierLoading" @change="value => handleCarrierContractChange(route, value)"><el-option v-for="item in carrierOptions" :key="item.contractId" :label="item.carrierName" :value="item.contractId" /></el-select></el-form-item></el-col>
|
<el-col v-if="route.carrierType === '承运商'" :span="6"><el-form-item label="承运商" required><el-select v-model="route.carrierContractId" filterable clearable placeholder="请选择" :loading="carrierLoading" @change="value => handleCarrierContractChange(route, value)"><el-option v-for="item in carrierOptions" :key="item.contractId" :label="carrierOptionLabel(item)" :value="item.contractId" /></el-select></el-form-item></el-col>
|
||||||
<el-col :span="6"><el-form-item label="司机" :required="route.carrierType !== '承运商'"><el-autocomplete :ref="element => setDriverInput(route.segmentNo, element)" v-model="route.driverName" :debounce="300" :fetch-suggestions="fetchDriverSuggestions" clearable placeholder="请输入司机" :loading="driverLoading" @select="item => handleDriverSuggestionSelect(route, item)" /></el-form-item></el-col>
|
<el-col :span="6"><el-form-item label="司机" :required="route.carrierType !== '承运商'"><el-autocomplete :ref="element => setDriverInput(route.segmentNo, element)" v-model="route.driverName" :debounce="300" :fetch-suggestions="fetchDriverSuggestions" clearable placeholder="请输入司机" :loading="driverLoading" @select="item => handleDriverSuggestionSelect(route, item)" /></el-form-item></el-col>
|
||||||
<el-col :span="6"><el-form-item :label="route.carrierType === '承运商' ? '手机号' : '司机手机号'" :required="route.carrierType !== '承运商'"><el-input v-model="route.driverPhone" placeholder="请输入" /></el-form-item></el-col>
|
<el-col :span="6"><el-form-item :label="route.carrierType === '承运商' ? '手机号' : '司机手机号'" :required="route.carrierType !== '承运商'"><el-input v-model="route.driverPhone" placeholder="请输入" /></el-form-item></el-col>
|
||||||
<el-col :span="6"><el-form-item label="车牌号" required><el-input v-model="route.vehicleNo" placeholder="请输入" /></el-form-item></el-col>
|
<el-col :span="6"><el-form-item label="车牌号" required><el-input v-model="route.vehicleNo" placeholder="请输入" /></el-form-item></el-col>
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
<el-col v-if="route.carrierType !== '承运商'" :span="6"><el-form-item label="押运人手机号" required><el-input v-model="route.escortPhone" placeholder="请输入" /></el-form-item></el-col>
|
<el-col v-if="route.carrierType !== '承运商'" :span="6"><el-form-item label="押运人手机号" required><el-input v-model="route.escortPhone" placeholder="请输入" /></el-form-item></el-col>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-col v-if="route.carrierType !== '自运'" :span="6"><el-form-item label="承运商" required><el-select v-model="route.carrierContractId" filterable clearable placeholder="请选择" :loading="carrierLoading" @change="value => handleCarrierContractChange(route, value)"><el-option v-for="item in carrierOptions" :key="item.contractId" :label="item.carrierName" :value="item.contractId" /></el-select></el-form-item></el-col>
|
<el-col v-if="route.carrierType === '承运商'" :span="6"><el-form-item label="承运商" required><el-select v-model="route.carrierContractId" filterable clearable placeholder="请选择" :loading="carrierLoading" @change="value => handleCarrierContractChange(route, value)"><el-option v-for="item in carrierOptions" :key="item.contractId" :label="carrierOptionLabel(item)" :value="item.contractId" /></el-select></el-form-item></el-col>
|
||||||
<el-col :span="6"><el-form-item label="船/航/班列号" required><el-input v-model="route.vehicleNo" placeholder="请输入" /></el-form-item></el-col>
|
<el-col :span="6"><el-form-item label="船/航/班列号" required><el-input v-model="route.vehicleNo" placeholder="请输入" /></el-form-item></el-col>
|
||||||
<el-col :span="6"><el-form-item label="船长" required><el-input v-model="route.captainName" placeholder="请输入" /></el-form-item></el-col>
|
<el-col :span="6"><el-form-item label="船长" required><el-input v-model="route.captainName" placeholder="请输入" /></el-form-item></el-col>
|
||||||
<el-col :span="6"><el-form-item label="联系电话" required><el-input v-model="route.driverPhone" placeholder="请输入" /></el-form-item></el-col>
|
<el-col :span="6"><el-form-item label="联系电话" required><el-input v-model="route.driverPhone" placeholder="请输入" /></el-form-item></el-col>
|
||||||
@@ -527,7 +527,7 @@ export default {
|
|||||||
route.escortName = '';
|
route.escortName = '';
|
||||||
route.escortPhone = '';
|
route.escortPhone = '';
|
||||||
}
|
}
|
||||||
if (value === '自运') {
|
if (value !== '承运商') {
|
||||||
route.carrierContractId = '';
|
route.carrierContractId = '';
|
||||||
route.carrierName = '';
|
route.carrierName = '';
|
||||||
}
|
}
|
||||||
@@ -539,6 +539,12 @@ export default {
|
|||||||
route.carrierContractId = contract?.contractId || '';
|
route.carrierContractId = contract?.contractId || '';
|
||||||
route.carrierName = contract?.carrierName || '';
|
route.carrierName = contract?.carrierName || '';
|
||||||
},
|
},
|
||||||
|
carrierOptionLabel(item) {
|
||||||
|
const duplicateCount = this.carrierOptions.filter(option => option.carrierName === item.carrierName).length;
|
||||||
|
return duplicateCount > 1
|
||||||
|
? `${item.carrierName}(${item.contractName || item.contractId})`
|
||||||
|
: item.carrierName;
|
||||||
|
},
|
||||||
driverOptionLabel(item) { return item.driverName || item.name || ''; },
|
driverOptionLabel(item) { return item.driverName || item.name || ''; },
|
||||||
driverOptionKey(item) { return item.id || item.driverId || this.driverOptionLabel(item) || item.mobile; },
|
driverOptionKey(item) { return item.id || item.driverId || this.driverOptionLabel(item) || item.mobile; },
|
||||||
handleDriverChange(route, value) {
|
handleDriverChange(route, value) {
|
||||||
@@ -611,9 +617,9 @@ export default {
|
|||||||
if (!this.validateRoutePhones(route)) return;
|
if (!this.validateRoutePhones(route)) return;
|
||||||
if (route.documentType === '运单') {
|
if (route.documentType === '运单') {
|
||||||
if (this.isRoad(route)) {
|
if (this.isRoad(route)) {
|
||||||
if (route.carrierType !== '自运' && (!route.carrierContractId || !route.carrierName || !route.vehicleNo)) return this.$message.warning('请选择承运商并填写车牌号');
|
if (route.carrierType === '承运商' && (!route.carrierContractId || !route.carrierName || !route.vehicleNo)) return this.$message.warning('请选择承运商并填写车牌号');
|
||||||
if (route.carrierType !== '承运商' && (!route.driverName || !route.driverPhone || !route.vehicleNo || !route.trailerVehicleNo || !route.escortName || !route.escortPhone)) return this.$message.warning('请补全自运或网货平台的车辆与人员信息');
|
if (route.carrierType !== '承运商' && (!route.driverName || !route.driverPhone || !route.vehicleNo || !route.trailerVehicleNo || !route.escortName || !route.escortPhone)) return this.$message.warning('请补全自运或网货平台的车辆与人员信息');
|
||||||
} else if (!route.vehicleNo || !route.captainName || !route.driverPhone || !route.containerNo || !route.cabinNo || (route.carrierType !== '自运' && (!route.carrierContractId || !route.carrierName))) {
|
} else if (!route.vehicleNo || !route.captainName || !route.driverPhone || !route.containerNo || !route.cabinNo || (route.carrierType === '承运商' && (!route.carrierContractId || !route.carrierName))) {
|
||||||
return this.$message.warning('请补全非公路运输的承运信息');
|
return this.$message.warning('请补全非公路运输的承运信息');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -823,7 +823,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="loading-manage-dialog__grid loading-manage-dialog__task-grid">
|
<div class="loading-manage-dialog__grid loading-manage-dialog__task-grid">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="dialogForm.carrierType !== '自运'"
|
v-if="dialogForm.carrierType === '承运商'"
|
||||||
label="承运商"
|
label="承运商"
|
||||||
required
|
required
|
||||||
>
|
>
|
||||||
@@ -1606,7 +1606,7 @@ export default {
|
|||||||
this.dialogForm.waybillIdsJson,
|
this.dialogForm.waybillIdsJson,
|
||||||
this.dialogForm.loadingSubNos
|
this.dialogForm.loadingSubNos
|
||||||
);
|
);
|
||||||
if (this.dialogForm.carrierType === '自运') {
|
if (this.dialogForm.carrierType !== '承运商') {
|
||||||
this.dialogForm.carrierContractId = '';
|
this.dialogForm.carrierContractId = '';
|
||||||
this.dialogForm.carrierName = '';
|
this.dialogForm.carrierName = '';
|
||||||
}
|
}
|
||||||
@@ -2131,7 +2131,7 @@ export default {
|
|||||||
normalizePayload() {
|
normalizePayload() {
|
||||||
this.syncRouteAddressFields();
|
this.syncRouteAddressFields();
|
||||||
this.rebuildSummaryFromWaybills(false);
|
this.rebuildSummaryFromWaybills(false);
|
||||||
if (this.dialogForm.carrierType === '自运') {
|
if (this.dialogForm.carrierType !== '承运商') {
|
||||||
this.dialogForm.carrierContractId = '';
|
this.dialogForm.carrierContractId = '';
|
||||||
this.dialogForm.carrierName = '';
|
this.dialogForm.carrierName = '';
|
||||||
}
|
}
|
||||||
@@ -2142,6 +2142,7 @@ export default {
|
|||||||
taskInfoJson: JSON.stringify({
|
taskInfoJson: JSON.stringify({
|
||||||
carrierType: this.dialogForm.carrierType,
|
carrierType: this.dialogForm.carrierType,
|
||||||
carrierName: this.dialogForm.carrierName,
|
carrierName: this.dialogForm.carrierName,
|
||||||
|
carrierContractId: this.dialogForm.carrierContractId,
|
||||||
driverName: this.dialogForm.driverName,
|
driverName: this.dialogForm.driverName,
|
||||||
driverPhone: this.dialogForm.driverPhone,
|
driverPhone: this.dialogForm.driverPhone,
|
||||||
vehicleNo: this.dialogForm.vehicleNo,
|
vehicleNo: this.dialogForm.vehicleNo,
|
||||||
@@ -2194,7 +2195,7 @@ export default {
|
|||||||
ElMessage.warning('请输入车牌号');
|
ElMessage.warning('请输入车牌号');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.dialogForm.carrierType !== '自运' && !this.dialogForm.carrierContractId) {
|
if (this.dialogForm.carrierType === '承运商' && !this.dialogForm.carrierContractId) {
|
||||||
ElMessage.warning('请选择承运商合同');
|
ElMessage.warning('请选择承运商合同');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2316,10 +2317,13 @@ export default {
|
|||||||
this.dialogForm.escortName = '';
|
this.dialogForm.escortName = '';
|
||||||
this.dialogForm.escortPhone = '';
|
this.dialogForm.escortPhone = '';
|
||||||
}
|
}
|
||||||
if (this.dialogForm.carrierType === '自运') {
|
if (this.dialogForm.carrierType !== '承运商') {
|
||||||
this.dialogForm.carrierContractId = '';
|
this.dialogForm.carrierContractId = '';
|
||||||
this.dialogForm.carrierName = '';
|
this.dialogForm.carrierName = '';
|
||||||
|
this.taskCarrierOptions = [];
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
this.loadTaskCarrierOptions();
|
||||||
},
|
},
|
||||||
handleTaskCarrierChange(contractId) {
|
handleTaskCarrierChange(contractId) {
|
||||||
const contract = this.taskCarrierOptions.find(item => String(item.id) === String(contractId));
|
const contract = this.taskCarrierOptions.find(item => String(item.id) === String(contractId));
|
||||||
@@ -2427,7 +2431,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async loadTaskCarrierOptions() {
|
async loadTaskCarrierOptions() {
|
||||||
const requestId = ++this.taskCarrierRequestId;
|
const requestId = ++this.taskCarrierRequestId;
|
||||||
if (!this.selectedWaybillRows.length) {
|
if (this.dialogForm.carrierType !== '承运商' || !this.selectedWaybillRows.length) {
|
||||||
this.taskCarrierOptions = [];
|
this.taskCarrierOptions = [];
|
||||||
this.taskCarrierLoading = false;
|
this.taskCarrierLoading = false;
|
||||||
this.dialogForm.carrierContractId = '';
|
this.dialogForm.carrierContractId = '';
|
||||||
@@ -2436,7 +2440,10 @@ export default {
|
|||||||
}
|
}
|
||||||
this.taskCarrierLoading = true;
|
this.taskCarrierLoading = true;
|
||||||
try {
|
try {
|
||||||
const response = await loadingApi.getCarrierContracts();
|
const projectIds = [
|
||||||
|
...new Set(this.selectedWaybillRows.map(row => row.projectId).filter(Boolean)),
|
||||||
|
];
|
||||||
|
const response = await loadingApi.getCarrierContracts(projectIds);
|
||||||
if (requestId !== this.taskCarrierRequestId) return [];
|
if (requestId !== this.taskCarrierRequestId) return [];
|
||||||
const contracts = response.data?.data || response.data || [];
|
const contracts = response.data?.data || response.data || [];
|
||||||
this.taskCarrierOptions = contracts;
|
this.taskCarrierOptions = contracts;
|
||||||
|
|||||||
Reference in New Issue
Block a user