diff --git a/src/components/address-map-picker/main.vue b/src/components/address-map-picker/main.vue
index aab6ba6..ac8800f 100644
--- a/src/components/address-map-picker/main.vue
+++ b/src/components/address-map-picker/main.vue
@@ -10,12 +10,8 @@
搜索
{{ status }}
@@ -28,6 +24,8 @@
diff --git a/src/option/business/waybill-manage.js b/src/option/business/waybill-manage.js
index fe51191..c981066 100644
--- a/src/option/business/waybill-manage.js
+++ b/src/option/business/waybill-manage.js
@@ -543,7 +543,8 @@ export const option = {
prop: 'projectName',
formslot: true,
search: true,
- searchLabel: '项目',
+ searchLabel: '项目名称',
+ searchPlaceholder: '请选择或输入',
searchOrder: 22,
span: 6,
order: 890,
@@ -555,6 +556,7 @@ export const option = {
prop: 'customerName',
search: true,
searchLabel: '客户名称',
+ searchPlaceholder: '请选择或输入',
searchOrder: 21,
minWidth: 150,
addDisplay: false,
@@ -576,6 +578,7 @@ export const option = {
prop: 'driverName',
search: true,
searchLabel: '司机名称',
+ searchPlaceholder: '请选择或输入',
searchOrder: 14,
minWidth: 120,
display: false,
@@ -626,6 +629,7 @@ export const option = {
prop: 'carrierName',
search: true,
searchLabel: '承运商名称',
+ searchPlaceholder: '请选择或输入',
searchOrder: 15,
minWidth: 150,
display: false,
@@ -729,6 +733,7 @@ export const option = {
prop: 'planName',
formslot: true,
search: true,
+ searchPlaceholder: '请选择或输入',
searchOrder: 7,
span: 6,
order: 870,
@@ -738,6 +743,7 @@ export const option = {
label: '货物类型',
prop: 'cargoType',
search: true,
+ searchPlaceholder: '请选择或输入',
searchOrder: 18,
formatter: row => formatGoodsField(row, ['cargoType', 'goodsType', 'typeName']),
minWidth: 130,
diff --git a/src/page/login/facelogin.vue b/src/page/login/facelogin.vue
index e1da201..0c09cb7 100644
--- a/src/page/login/facelogin.vue
+++ b/src/page/login/facelogin.vue
@@ -13,8 +13,8 @@ export default {
data() {
return {
loginForm: {
- username: 'admin',
- password: '123456',
+ username: '',
+ password: '',
},
};
},
diff --git a/src/page/login/userlogin.vue b/src/page/login/userlogin.vue
index d981745..c22a330 100644
--- a/src/page/login/userlogin.vue
+++ b/src/page/login/userlogin.vue
@@ -93,9 +93,9 @@ export default {
//角色ID
roleId: '',
//用户名
- username: 'admin',
+ username: '',
//密码
- password: 'admin',
+ password: '',
//账号类型
type: 'account',
//验证码的值
diff --git a/src/styles/common.scss b/src/styles/common.scss
index 892329c..97be467 100644
--- a/src/styles/common.scss
+++ b/src/styles/common.scss
@@ -150,12 +150,15 @@ a {
bottom: 0;
}
.map-picker-content {
- display: flex;
- gap: 12px;
+ position: relative;
+ display: block;
+ min-width: 0;
+ overflow: visible;
> [class$='__map'],
> .address-map {
- flex: 1 1 auto;
+ position: relative;
+ z-index: 1;
width: 100%;
min-width: 0;
box-sizing: border-box;
@@ -165,4 +168,8 @@ a {
height: 100% !important;
}
}
+
+ > .map-search-results {
+ z-index: 2000;
+ }
}
diff --git a/src/utils/carrier-org-resource.js b/src/utils/carrier-org-resource.js
new file mode 100644
index 0000000..65ffbc5
--- /dev/null
+++ b/src/utils/carrier-org-resource.js
@@ -0,0 +1,140 @@
+import { getDetail, getList as getCustomerList } from '@/api/vehicle/customer-archive';
+import { getList as getDriverList } from '@/api/transportCapacity/driver';
+import { getList as getVehicleList } from '@/api/transportCapacity/transport-vehicle';
+
+const orgNameCache = new Map();
+
+const extractRecords = res => {
+ const data = res?.data?.data ?? res?.data ?? res;
+ if (Array.isArray(data)) return data;
+ if (Array.isArray(data?.records)) return data.records;
+ if (Array.isArray(data?.data)) return data.data;
+ return [];
+};
+
+const normalizeOrgName = value => String(value || '').trim();
+
+const uniqueOrgNames = (values = []) => {
+ const seen = new Set();
+ const result = [];
+ values.forEach(value => {
+ const name = normalizeOrgName(value);
+ if (!name || seen.has(name)) return;
+ seen.add(name);
+ result.push(name);
+ });
+ return result;
+};
+
+/**
+ * 解析承运商客商档案上联系人的所属组织(branchName),无联系人时回退客商所属组织。
+ */
+export const resolveCarrierOrganizationNames = async ({ carrierId, carrierName } = {}) => {
+ const id = String(carrierId || '').trim();
+ const name = normalizeOrgName(carrierName);
+ const cacheKey = id || name;
+ if (!cacheKey) return [];
+ if (orgNameCache.has(cacheKey)) return orgNameCache.get(cacheKey);
+
+ let detail = null;
+ if (id) {
+ try {
+ const res = await getDetail(id);
+ detail = res?.data?.data || res?.data || null;
+ } catch (error) {
+ detail = null;
+ }
+ }
+ if (!detail && name) {
+ try {
+ const res = await getCustomerList(1, 20, { fullName: name });
+ const records = extractRecords(res);
+ const matched =
+ records.find(item => normalizeOrgName(item.fullName || item.customerName) === name) ||
+ records[0];
+ if (matched?.id) {
+ const detailRes = await getDetail(matched.id);
+ detail = detailRes?.data?.data || detailRes?.data || matched;
+ }
+ } catch (error) {
+ detail = null;
+ }
+ }
+
+ const contacts = Array.isArray(detail?.contacts) ? detail.contacts : [];
+ const orgNames = uniqueOrgNames([
+ ...contacts.map(item => item.branchName),
+ detail?.deptName,
+ detail?.organizationName,
+ ]);
+ orgNameCache.set(cacheKey, orgNames);
+ if (id && name) orgNameCache.set(name, orgNames);
+ return orgNames;
+};
+
+export const clearCarrierOrganizationCache = (carrier = {}) => {
+ const id = String(carrier.carrierId || '').trim();
+ const name = normalizeOrgName(carrier.carrierName);
+ if (id) orgNameCache.delete(id);
+ if (name) orgNameCache.delete(name);
+};
+
+export const matchOrganizationName = (value, orgNames = []) => {
+ const text = normalizeOrgName(value);
+ if (!text || !orgNames.length) return false;
+ return orgNames.some(org => text === org || text.includes(org) || org.includes(text));
+};
+
+const filterByOrganizations = (records = [], orgNames = []) => {
+ if (!orgNames.length) return [];
+ return records.filter(item => matchOrganizationName(item.organizationName, orgNames));
+};
+
+/**
+ * 按承运商联系人所属组织筛选司机。
+ * 未选择承运商时返回空列表(需先选承运商)。
+ */
+export const fetchDriversByCarrierOrganizations = async (
+ query = {},
+ { carrierId, carrierName } = {}
+) => {
+ if (!String(carrierId || '').trim() && !normalizeOrgName(carrierName)) {
+ return [];
+ }
+ const orgNames = await resolveCarrierOrganizationNames({ carrierId, carrierName });
+ if (!orgNames.length) return [];
+
+ const size = Math.max(Number(query.size) || 50, 50);
+ const params = { ...query };
+ delete params.size;
+ // 单组织时用后端模糊条件缩小范围;多组织再前端精确过滤
+ if (orgNames.length === 1) {
+ params.organizationName = orgNames[0];
+ }
+ const res = await getDriverList(1, Math.min(size * 5, 200), params);
+ return filterByOrganizations(extractRecords(res), orgNames).slice(0, size);
+};
+
+/**
+ * 按承运商联系人所属组织筛选车辆。
+ * 未选择承运商时返回空列表。
+ */
+export const fetchVehiclesByCarrierOrganizations = async (
+ query = {},
+ { carrierId, carrierName } = {}
+) => {
+ if (!String(carrierId || '').trim() && !normalizeOrgName(carrierName)) {
+ return [];
+ }
+ const orgNames = await resolveCarrierOrganizationNames({ carrierId, carrierName });
+ if (!orgNames.length) return [];
+
+ const size = Math.max(Number(query.size) || 50, 50);
+ const params = { ...query };
+ delete params.size;
+ if (orgNames.length === 1) {
+ params.organizationName = orgNames[0];
+ }
+ const res = await getVehicleList(1, Math.min(size * 5, 200), params);
+ return filterByOrganizations(extractRecords(res), orgNames).slice(0, size);
+};
diff --git a/src/utils/map-search.js b/src/utils/map-search.js
new file mode 100644
index 0000000..a2bf1dd
--- /dev/null
+++ b/src/utils/map-search.js
@@ -0,0 +1,39 @@
+/**
+ * 将高德 Geocoder 结果规范化为地图选址浮层列表数据。
+ * @param {Array|Object} geocodesOrResult geocodes 数组,或含 geocodes/location 的结果对象
+ * @param {string} keyword 搜索关键词兜底文案
+ * @returns {Array<{id: string|number, name: string, address: string, location: any, photo: string}>}
+ */
+export function normalizeMapSearchResults(geocodesOrResult, keyword = '') {
+ const fallback = String(keyword || '').trim();
+ let list = [];
+ if (Array.isArray(geocodesOrResult)) {
+ list = geocodesOrResult;
+ } else if (geocodesOrResult && typeof geocodesOrResult === 'object') {
+ if (Array.isArray(geocodesOrResult.geocodes)) {
+ list = geocodesOrResult.geocodes;
+ } else if (geocodesOrResult.location) {
+ list = [geocodesOrResult];
+ }
+ }
+
+ return list.map((item, index) => {
+ const buildingName = pickNamedField(item?.building);
+ const neighborhoodName = pickNamedField(item?.neighborhood);
+ const address = item?.formattedAddress || item?.address || fallback || '-';
+ return {
+ id: item?.id || index,
+ name: buildingName || neighborhoodName || address,
+ address,
+ location: item?.location,
+ photo: item?.photo || item?.image || '',
+ };
+ });
+}
+
+function pickNamedField(value) {
+ if (!value) return '';
+ if (typeof value === 'string') return value.trim();
+ if (typeof value === 'object' && value.name) return String(value.name).trim();
+ return '';
+}
diff --git a/src/views/base/common-address.vue b/src/views/base/common-address.vue
index cc31086..724cb2a 100644
--- a/src/views/base/common-address.vue
+++ b/src/views/base/common-address.vue
@@ -233,8 +233,8 @@
{{ mapStatus }}
@@ -270,6 +270,7 @@ import { createOption } from '@/option/base/common-address';
import { mapGetters } from 'vuex';
import { downloadXls } from '@/utils/util';
import { getToken } from '@/utils/auth';
+import { normalizeMapSearchResults } from '@/utils/map-search';
import { isMobile } from '@/utils/validate';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
@@ -1117,12 +1118,7 @@ export default {
this.ensureAmapGeocoder()
.then(() => this.runAmapGeocode('location', keyword))
.then(result => {
- this.mapSearchResults = (result.geocodes || []).map((item, index) => ({
- id: item.id || index,
- name: item.formattedAddress || keyword,
- address: item.formattedAddress || keyword,
- location: item.location,
- }));
+ this.mapSearchResults = normalizeMapSearchResults(result, keyword);
const point = this.resolveMapPoint(result);
if (!point) {
this.mapStatus = '未找到匹配地址';
diff --git a/src/views/business/common-route.vue b/src/views/business/common-route.vue
index e595c0d..54fe158 100644
--- a/src/views/business/common-route.vue
+++ b/src/views/business/common-route.vue
@@ -289,8 +289,8 @@
{{ routeMapStatus }}
@@ -323,6 +323,7 @@ import { addressTypeOptions } from '@/option/base/common-address';
import { config, excelOption, option } from '@/option/business/common-route';
import { getToken } from '@/utils/auth';
import { openImportDialog } from '@/utils/import-excel';
+import { normalizeMapSearchResults } from '@/utils/map-search';
import { downloadXls } from '@/utils/util';
import { isMobile } from '@/utils/validate';
import { List, Search } from '@element-plus/icons-vue';
@@ -616,12 +617,7 @@ export default {
})
.then(() => this.runAmapGeocode('location', keyword))
.then(result => {
- this.routeMapSearchResults = (result.geocodes || []).map((item, index) => ({
- id: item.id || index,
- name: item.formattedAddress || keyword,
- address: item.formattedAddress || keyword,
- location: item.location,
- }));
+ this.routeMapSearchResults = normalizeMapSearchResults(result, keyword);
const point = this.resolveMapPoint(result);
if (!point) {
this.routeMapStatus = '未找到匹配地址';
diff --git a/src/views/business/components/business-crud-page.vue b/src/views/business/components/business-crud-page.vue
index f6c27e2..4c2f4f3 100644
--- a/src/views/business/components/business-crud-page.vue
+++ b/src/views/business/components/business-crud-page.vue
@@ -4007,7 +4007,7 @@
剩余数量:{{
- formatDispatchQuantity(dispatchItemRemainingQuantity(dispatchItemForm))
+ formatDispatchQuantity(dispatchItemHintRemainingQuantity(dispatchItemForm))
}}
{{ dispatchItemForm.quantityUnit || '吨' }}
@@ -4064,7 +4064,11 @@
-
+ handleDispatchNumberInput('otherFeeTotal', value)"
+ >
{{ dispatchItemFreightCurrencyLabel }}
@@ -4996,8 +5000,8 @@
{{ transportMapStatus }}
@@ -5271,7 +5275,7 @@ import {
getVoucherImages as getProcessConfigVoucherImages,
} from '@/api/business/process-config';
import { getList as getCarrierCustomerList } from '@/api/vehicle/customer-archive';
-import { getList as getDriverList } from '@/api/transportCapacity/driver';
+import { fetchDriversByCarrierOrganizations } from '@/utils/carrier-org-resource';
import { getDictionary } from '@/api/system/dictbiz';
import { getDictionary as getSystemDictionary } from '@/api/system/dict';
import { addressTypeOptions } from '@/option/base/common-address';
@@ -5279,6 +5283,7 @@ import { packageOptions } from '@/option/business/common';
import { formatUpdateUserName } from '@/utils/audit';
import { getToken } from '@/utils/auth';
import { openImportDialog } from '@/utils/import-excel';
+import { normalizeMapSearchResults } from '@/utils/map-search';
import { applyTableMenuWidth } from '@/utils/table-menu';
import { downloadFileByUrl, downloadXls } from '@/utils/util';
import { isMobile } from '@/utils/validate';
@@ -6340,19 +6345,21 @@ export default {
if (this.dispatchItemForm.taskEntryMode !== 'full') {
const quantity = Number(this.dispatchItemForm.quantity || 0);
const unitPrice = Number(this.dispatchItemForm.unitPrice || 0);
- const otherFeeTotal = Number(this.dispatchItemForm.otherFeeTotal || 0);
+ const otherFeeRaw = this.normalizeDispatchFeeValue(this.dispatchItemForm.otherFeeTotal);
+ const otherFeeTotal = Number(otherFeeRaw || 0);
const hasFreight = this.dispatchItemForm.unitPrice !== '' && quantity > 0;
- const hasOtherFee = this.dispatchItemForm.otherFeeTotal !== '';
+ const hasOtherFee = otherFeeRaw !== '';
if (!hasFreight && !hasOtherFee) return '';
const total = (hasFreight ? quantity * unitPrice : 0) + (hasOtherFee ? otherFeeTotal : 0);
return Number.isInteger(total) ? String(total) : String(Number(total.toFixed(2)));
}
- const otherFeeTotal = Number(this.dispatchItemForm.otherFeeTotal || 0);
+ const otherFeeRaw = this.normalizeDispatchFeeValue(this.dispatchItemForm.otherFeeTotal);
+ const otherFeeTotal = Number(otherFeeRaw || 0);
const freightTotal = this.dispatchItemCargoRows.reduce(
(total, cargo) => total + Number(this.dispatchCargoFreightAmount(cargo) || 0),
0
);
- const hasOtherFee = this.dispatchItemForm.otherFeeTotal !== '';
+ const hasOtherFee = otherFeeRaw !== '';
if (!freightTotal && !hasOtherFee) return '';
const total = freightTotal + (hasOtherFee ? otherFeeTotal : 0);
return Number.isInteger(total) ? String(total) : String(Number(total.toFixed(2)));
@@ -8919,6 +8926,7 @@ export default {
this.form.carrierContractId = '';
}
this.form.carrierType = nextValue;
+ this.clearTaskDriverVehicleFields();
if (this.isWaybillDetailLayout) {
this.taskCarrierRequestId += 1;
this.taskCarrierOptions = [];
@@ -9036,25 +9044,58 @@ export default {
},
handleTaskCarrierChange(value) {
const carrier = this.taskCarrierOptions.find(item =>
- [item.value, item.customerName, item.carrierName, item.fullName, item.name].some(name =>
- String(name || '') === String(value || '')
- )
+ [
+ item.value,
+ item.customerName,
+ item.carrierName,
+ item.fullName,
+ item.name,
+ item.carrierContractId,
+ ].some(name => 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;
+ } else {
+ this.form.carrierId = carrier?.id || carrier?.carrierId || '';
+ this.form.carrierName = value || '';
}
- this.form.carrierId = carrier?.id || '';
- this.form.carrierName = value || '';
+ this.clearTaskDriverVehicleFields();
+ },
+ clearTaskDriverVehicleFields() {
+ this.form.driverId = '';
+ this.form.driverName = '';
+ this.form.driverPhone = '';
+ this.form.vehicleNo = '';
+ this.form.trailerVehicleNo = '';
+ this.form.escortName = '';
+ this.form.escortPhone = '';
+ this.taskDriverOptions = [];
+ },
+ getActiveCarrierFilter() {
+ if (this.dispatchItemBox) {
+ return {
+ carrierId: this.dispatchItemForm.carrierId || '',
+ carrierName: this.dispatchItemForm.carrierName || '',
+ };
+ }
+ return {
+ carrierId: this.form.carrierId || '',
+ carrierName: this.form.carrierName || '',
+ };
},
loadTaskDriverOptions() {
if (!this.taskInfoFormEnabled || this.taskDriverLoading) return Promise.resolve([]);
+ const carrier = this.getActiveCarrierFilter();
+ if (!carrier.carrierId && !carrier.carrierName) {
+ this.taskDriverOptions = [];
+ return Promise.resolve([]);
+ }
this.taskDriverLoading = true;
- return getDriverList(1, 9999, {})
- .then(res => {
- this.taskDriverOptions = extractRecords(res);
+ return fetchDriversByCarrierOrganizations({ size: 9999, posts: '司机' }, carrier)
+ .then(records => {
+ this.taskDriverOptions = records;
return this.taskDriverOptions;
})
.finally(() => {
@@ -9063,10 +9104,17 @@ export default {
},
fetchTaskDriverSuggestions(queryString, callback) {
const keyword = String(queryString || '').trim();
+ const carrier = this.getActiveCarrierFilter();
+ if (!carrier.carrierId && !carrier.carrierName) {
+ callback([]);
+ return;
+ }
this.taskDriverLoading = true;
- getDriverList(1, 20, keyword ? { driverName: keyword } : {})
- .then(res => {
- const records = extractRecords(res);
+ fetchDriversByCarrierOrganizations(
+ { size: 20, ...(keyword ? { driverName: keyword } : {}), posts: '司机' },
+ carrier
+ )
+ .then(records => {
this.taskDriverOptions = records;
callback(
records.map(item => ({
@@ -10239,12 +10287,7 @@ export default {
this.ensureTransportAmapGeocoder()
.then(() => this.runAmapGeocode('location', keyword))
.then(result => {
- this.transportMapSearchResults = (result.geocodes || []).map((item, index) => ({
- id: item.id || index,
- name: item.formattedAddress || keyword,
- address: item.formattedAddress || keyword,
- location: item.location,
- }));
+ this.transportMapSearchResults = normalizeMapSearchResults(result, keyword);
const point = this.resolveMapPoint(result);
if (!point) {
this.transportMapStatus = '未找到匹配地址';
@@ -12760,6 +12803,9 @@ export default {
...baseRow,
...(index >= 0 ? row : {}),
};
+ this.dispatchItemForm.otherFeeTotal = this.normalizeDispatchFeeValue(
+ this.dispatchItemForm.otherFeeTotal
+ );
this.dispatchItemForm.carrierType = this.dispatchItemForm.carrierType || '承运商';
const goodsRows = this.parseJsonArray(this.dispatchItemForm.goodsJson);
this.dispatchItemCargoRows = (goodsRows.length ? goodsRows : [this.dispatchItemForm]).map(
@@ -12816,6 +12862,7 @@ export default {
}
}
this.dispatchItemForm.carrierType = nextValue;
+ this.clearDispatchDriverVehicleFields();
this.loadDispatchCarrierOptions(this.dispatchRow);
},
isDispatchCarrierRequired(carrierType) {
@@ -12945,20 +12992,39 @@ export default {
});
if (this.dispatchIsCarrierMode) {
this.dispatchItemForm.carrierContractId = carrier?.carrierContractId || '';
- this.dispatchItemForm.carrierId = '';
+ this.dispatchItemForm.carrierId = carrier?.carrierId || '';
this.dispatchItemForm.carrierName = carrier?.carrierName || '';
- return;
+ } else {
+ this.dispatchItemForm.carrierContractId = '';
+ this.dispatchItemForm.carrierId = carrier?.id || carrier?.carrierId || '';
+ this.dispatchItemForm.carrierName = carrier?.carrierName || value || '';
}
- this.dispatchItemForm.carrierContractId = '';
- this.dispatchItemForm.carrierId = carrier?.id || '';
- this.dispatchItemForm.carrierName = carrier?.carrierName || value || '';
+ this.clearDispatchDriverVehicleFields();
+ },
+ clearDispatchDriverVehicleFields() {
+ this.dispatchItemForm.driverId = '';
+ this.dispatchItemForm.driverName = '';
+ this.dispatchItemForm.driverPhone = '';
+ this.dispatchItemForm.vehicleNo = '';
+ this.dispatchItemForm.trailerVehicleNo = '';
+ this.dispatchItemForm.escortName = '';
+ this.dispatchItemForm.escortPhone = '';
+ this.taskDriverOptions = [];
},
loadDispatchDriverOptions() {
if (this.taskDriverLoading) return Promise.resolve([]);
+ const carrier = {
+ carrierId: this.dispatchItemForm.carrierId || '',
+ carrierName: this.dispatchItemForm.carrierName || '',
+ };
+ if (!carrier.carrierId && !carrier.carrierName) {
+ this.taskDriverOptions = [];
+ return Promise.resolve([]);
+ }
this.taskDriverLoading = true;
- return getDriverList(1, 9999, {})
- .then(res => {
- this.taskDriverOptions = extractRecords(res);
+ return fetchDriversByCarrierOrganizations({ size: 9999, posts: '司机' }, carrier)
+ .then(records => {
+ this.taskDriverOptions = records;
return this.taskDriverOptions;
})
.finally(() => {
@@ -13035,6 +13101,11 @@ export default {
this.dispatchItemForm[prop] =
parts.length > 1 ? `${parts[0]}.${parts.slice(1).join('').slice(0, 2)}` : parts[0];
},
+ normalizeDispatchFeeValue(value) {
+ if (value === undefined || value === null || value === '') return '';
+ if (Number(value) === -1) return '';
+ return value;
+ },
addDispatchCargoRow(index = -1) {
const nextRow = this.normalizeTransportCargoRow({ priceUnit: '元/吨' });
if (index > -1) this.dispatchItemCargoRows.splice(index + 1, 0, nextRow);
@@ -13118,6 +13189,12 @@ export default {
}, 0)
);
},
+ /** 精简录入提示:可调度余量扣减当前本次数量后的剩余 */
+ dispatchItemHintRemainingQuantity(row = {}) {
+ const available = this.dispatchItemRemainingQuantity(row);
+ const current = this.parseDispatchQuantity(row.quantity);
+ return Math.max(available - current, 0);
+ },
pruneDispatchPendingRows(rows = []) {
const planQuantities = new Map();
this.dispatchPlanGoodsRows.forEach(goods => {
@@ -13364,14 +13441,29 @@ export default {
}),
];
const firstGoods = goodsRows[0] || {};
+ const quantitySum = goodsRows.reduce(
+ (sum, goods) => sum + this.parseDispatchQuantity(goods.quantity),
+ 0
+ );
+ const quantityText = quantitySum
+ ? this.formatDispatchQuantity(quantitySum)
+ : firstGoods.quantity || this.dispatchItemForm.quantity || '';
+ const otherFeeTotal = this.normalizeDispatchFeeValue(this.dispatchItemForm.otherFeeTotal);
const nextRow = {
...this.dispatchItemForm,
goodsJson: JSON.stringify(goodsRows),
cargoType: firstGoods.cargoType || this.dispatchItemForm.cargoType || '',
cargoTypeCode: firstGoods.cargoTypeCode || this.dispatchItemForm.cargoTypeCode || '',
cargoTypePath: firstGoods.cargoTypePath || this.dispatchItemForm.cargoTypePath || [],
- cargoName: firstGoods.cargoName || this.dispatchItemForm.cargoName || '',
- quantity: firstGoods.quantity || this.dispatchItemForm.quantity || '',
+ cargoName:
+ goodsRows
+ .map(goods => goods.cargoName || goods.goodsName || '')
+ .filter(Boolean)
+ .join('.') ||
+ firstGoods.cargoName ||
+ this.dispatchItemForm.cargoName ||
+ '',
+ quantity: quantityText,
quantityUnit: firstGoods.quantityUnit || this.dispatchItemForm.quantityUnit || '',
unitPrice: firstGoods.unitPrice || '',
priceUnit: firstGoods.priceUnit || '',
@@ -13379,7 +13471,7 @@ export default {
freightJson: JSON.stringify({
currency: this.dispatchItemForm.freightCurrency || 'CNY',
totalFreightAmount: this.dispatchItemFreightSubtotal,
- otherFreightAmount: this.dispatchItemForm.otherFeeTotal || '',
+ otherFreightAmount: otherFeeTotal,
freightItems: goodsRows.map((cargo, index) => ({
cargoIndex: index,
cargoName: cargo.cargoName || '',
@@ -13395,7 +13487,7 @@ export default {
};
nextRow.cargoInfo = this.formatDispatchCargoInfo({}, nextRow);
nextRow.freight = this.getDispatchFeeFields({}, nextRow).freight;
- nextRow.otherFeeTotal = this.dispatchItemForm.otherFeeTotal || '';
+ nextRow.otherFeeTotal = otherFeeTotal;
const quantityUnit = this.getDispatchQuantityUnit(nextRow);
const otherDispatchedQuantity = this.dispatchRows.reduce((total, row, index) => {
if (
diff --git a/src/views/business/components/master-order-dispatch.vue b/src/views/business/components/master-order-dispatch.vue
index 019a265..9b0f04a 100644
--- a/src/views/business/components/master-order-dispatch.vue
+++ b/src/views/business/components/master-order-dispatch.vue
@@ -156,11 +156,11 @@
handleCarrierContractChange(route, value)">
- handleDriverSuggestionSelect(route, item)" />
+ handleDriverSuggestionSelect(route, item)" />
- handleEscortSuggestionSelect(route, item)" />
+ handleEscortSuggestionSelect(route, item)" />
@@ -233,7 +233,7 @@