1、调整导入运单
2、调整对账
This commit is contained in:
@@ -316,6 +316,25 @@
|
||||
empty-text="暂无货物信息"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="70" align="center" fixed="left" />
|
||||
<el-table-column min-width="220" align="center">
|
||||
<template #header>
|
||||
<span class="transport-plan-page__required-column">货物类型</span>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
<el-cascader
|
||||
v-model="row.cargoTypePath"
|
||||
:options="transportCargoTypeOptions"
|
||||
:props="transportCargoTypeCascaderProps"
|
||||
:placeholder="row.cargoType || '请选择'"
|
||||
clearable
|
||||
filterable
|
||||
:disabled="dialogReadonly"
|
||||
:filter-method="filterBillingCargoType"
|
||||
@visible-change="visible => visible && ensureBillingCargoTypeOptions()"
|
||||
@change="value => handleTransportCargoTypeChange(row, value)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="货物名称" min-width="240" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-autocomplete
|
||||
@@ -334,31 +353,11 @@
|
||||
<template #default="{ item }">
|
||||
<div class="transport-plan-page__cargo-autocomplete-item">
|
||||
<span>{{ formatBillingCargoTypeLabel(item) }}</span>
|
||||
<small v-if="item.cargoCode">{{ item.cargoCode }}</small>
|
||||
</div>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="220" align="center">
|
||||
<template #header>
|
||||
<span class="transport-plan-page__required-column">货物类型</span>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
<el-cascader
|
||||
v-model="row.cargoTypePath"
|
||||
:options="transportCargoTypeOptions"
|
||||
:props="transportCargoTypeCascaderProps"
|
||||
:placeholder="row.cargoType || '请选择'"
|
||||
clearable
|
||||
filterable
|
||||
:disabled="dialogReadonly"
|
||||
:filter-method="filterBillingCargoType"
|
||||
@visible-change="visible => visible && ensureBillingCargoTypeOptions()"
|
||||
@change="value => handleTransportCargoTypeChange(row, value)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" min-width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input
|
||||
@@ -1494,10 +1493,12 @@
|
||||
v-model="dispatchItemForm.departureName"
|
||||
:placeholder="dispatchStationNamePlaceholder"
|
||||
:suffix-icon="dispatchStationMode ? Search : undefined"
|
||||
disabled
|
||||
/>
|
||||
<el-input
|
||||
v-model="dispatchItemForm.departureAddress"
|
||||
:placeholder="dispatchAddressDetailPlaceholder"
|
||||
disabled
|
||||
>
|
||||
<template v-if="!dispatchStationMode" #suffix>
|
||||
<el-link
|
||||
@@ -1509,9 +1510,9 @@
|
||||
</template>
|
||||
</el-input>
|
||||
<span class="transport-plan-page__route-label">联系人</span>
|
||||
<el-input v-model="dispatchItemForm.departureContact" placeholder="请输入" />
|
||||
<el-input v-model="dispatchItemForm.departureContact" placeholder="请输入" disabled />
|
||||
<span class="transport-plan-page__route-label">联系方式</span>
|
||||
<el-input v-model="dispatchItemForm.departurePhone" placeholder="请输入" />
|
||||
<el-input v-model="dispatchItemForm.departurePhone" placeholder="请输入" disabled />
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="收货地址" required>
|
||||
@@ -1520,10 +1521,12 @@
|
||||
v-model="dispatchItemForm.arrivalName"
|
||||
:placeholder="dispatchStationNamePlaceholder"
|
||||
:suffix-icon="dispatchStationMode ? Search : undefined"
|
||||
disabled
|
||||
/>
|
||||
<el-input
|
||||
v-model="dispatchItemForm.arrivalAddress"
|
||||
:placeholder="dispatchAddressDetailPlaceholder"
|
||||
disabled
|
||||
>
|
||||
<template v-if="!dispatchStationMode" #suffix>
|
||||
<el-link
|
||||
@@ -1535,9 +1538,9 @@
|
||||
</template>
|
||||
</el-input>
|
||||
<span class="transport-plan-page__route-label">联系人</span>
|
||||
<el-input v-model="dispatchItemForm.arrivalContact" placeholder="请输入" />
|
||||
<el-input v-model="dispatchItemForm.arrivalContact" placeholder="请输入" disabled />
|
||||
<span class="transport-plan-page__route-label">联系方式</span>
|
||||
<el-input v-model="dispatchItemForm.arrivalPhone" placeholder="请输入" />
|
||||
<el-input v-model="dispatchItemForm.arrivalPhone" placeholder="请输入" disabled />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
@@ -4849,10 +4852,7 @@ export default {
|
||||
fetchTaskCargoSuggestions(queryString, callback, path = []) {
|
||||
const keyword = String(queryString || '').trim();
|
||||
const normalizedPath = this.normalizeBillingCargoTypePath(path);
|
||||
if (!keyword && !normalizedPath.length) {
|
||||
callback([]);
|
||||
return;
|
||||
}
|
||||
// 移除空查询时返回空数组的限制,允许点击时显示货物列表
|
||||
let loadingKey = '';
|
||||
this.ensureBillingCargoTypeOptions()
|
||||
.then(() => {
|
||||
@@ -4884,11 +4884,42 @@ export default {
|
||||
if (loadingKey) this.setTaskCargoLoadingByKey(loadingKey, false);
|
||||
});
|
||||
},
|
||||
handleTaskCargoRowSelect(row, item = {}) {
|
||||
async handleTaskCargoRowSelect(row, item = {}) {
|
||||
const value = this.formatBillingCargoTypeLabel(item);
|
||||
row.cargoName = value;
|
||||
row.specification = item.specification || item.spec || row.specification || '';
|
||||
row.model = item.model || item.modelName || row.model || '';
|
||||
|
||||
// 确保货物类型树已加载
|
||||
try {
|
||||
await this.ensureBillingCargoTypeOptions();
|
||||
} catch (error) {
|
||||
console.warn('货物类型树加载失败', error);
|
||||
this.syncTransportCargoJson();
|
||||
return;
|
||||
}
|
||||
|
||||
// 从常用货物返回的数据中查找货物类型并反选
|
||||
const matchedCargoType = this.findBillingCargoTypeOption(item);
|
||||
|
||||
if (matchedCargoType?.path?.length) {
|
||||
// 找到匹配的货物类型,回填到当前行
|
||||
const fullPath = this.normalizeBillingCargoTypePath(matchedCargoType.path);
|
||||
row.cargoTypePath = fullPath;
|
||||
row.cargoType = matchedCargoType.cargoName || row.cargoType || '';
|
||||
row.cargoTypeCode =
|
||||
matchedCargoType.cargoCode || matchedCargoType.code || matchedCargoType.id || '';
|
||||
|
||||
console.log('货物名称选择后反选货物类型:', {
|
||||
cargoName: row.cargoName,
|
||||
cargoType: row.cargoType,
|
||||
cargoTypePath: row.cargoTypePath,
|
||||
matchedCargoType: matchedCargoType,
|
||||
});
|
||||
} else {
|
||||
console.warn('未找到匹配的货物类型,item数据:', item);
|
||||
}
|
||||
|
||||
this.syncTransportCargoJson();
|
||||
},
|
||||
loadTaskQuantityUnitOptions() {
|
||||
@@ -6179,6 +6210,49 @@ export default {
|
||||
null
|
||||
);
|
||||
},
|
||||
findBillingCargoTypeOption(row = {}) {
|
||||
const path = this.normalizeBillingCargoTypePath(row.cargoTypePath);
|
||||
if (path.length) {
|
||||
const pathKey = path.join('/');
|
||||
const pathMatch = this.billingCargoTypeFlatOptions.find(item => item.path?.join('/') === pathKey);
|
||||
if (pathMatch) return pathMatch;
|
||||
}
|
||||
|
||||
// 优先通过二级类型编码查找(最准确)
|
||||
if (row.secondCargoTypeCode) {
|
||||
const secondMatch = this.billingCargoTypeFlatOptions.find(
|
||||
item => String(item.cargoCode || item.code || '').trim() === String(row.secondCargoTypeCode).trim()
|
||||
);
|
||||
if (secondMatch) {
|
||||
console.log('通过 secondCargoTypeCode 找到货物类型:', secondMatch);
|
||||
return secondMatch;
|
||||
}
|
||||
}
|
||||
|
||||
// 其他候选编码
|
||||
const codeCandidates = [row.cargoTypeCode, row.firstCargoTypeCode]
|
||||
.map(value => String(value || '').trim())
|
||||
.filter(Boolean);
|
||||
const nameCandidates = [
|
||||
row.secondCargoTypeName,
|
||||
row.cargoType,
|
||||
row.goodsType,
|
||||
row.firstCargoTypeName,
|
||||
]
|
||||
.map(value => String(value || '').trim())
|
||||
.filter(Boolean);
|
||||
|
||||
return (
|
||||
this.billingCargoTypeFlatOptions.find(item =>
|
||||
codeCandidates.some(
|
||||
code => code === String(item.cargoCode || item.code || item.id || '').trim()
|
||||
)
|
||||
) ||
|
||||
this.billingCargoTypeFlatOptions.find(item =>
|
||||
nameCandidates.some(name => name === String(item.cargoName || '').trim())
|
||||
)
|
||||
);
|
||||
},
|
||||
resolveCommonCargoTypePath(row = {}) {
|
||||
const path = this.normalizeBillingCargoTypePath(row.cargoTypePath);
|
||||
if (path.length) return path;
|
||||
|
||||
Reference in New Issue
Block a user