diff --git a/src/option/business/transport-plan.js b/src/option/business/transport-plan.js
index 4aebdac..68d3c45 100644
--- a/src/option/business/transport-plan.js
+++ b/src/option/business/transport-plan.js
@@ -51,9 +51,9 @@ const formatGoodsQuantity = value => {
};
const getSecondCargoTypeName = item =>
- item?.cargoType ||
item?.secondCargoTypeName ||
item?.secondCargoType ||
+ item?.cargoType ||
item?.goodsType ||
item?.type ||
item?.cargoTypeName ||
@@ -97,10 +97,10 @@ const formatGoodsInfo = row => {
const text = Object.entries(groups)
.map(([unit, group]) => {
- const quantity = `${formatGoodsQuantity(group.quantity)}${unit}`;
- return `${group.typeName}等${group.count}种货物 | ${quantity}`;
+ const quantity = formatGoodsQuantity(group.quantity);
+ return `${group.typeName}等${group.count}种货物 | ${quantity}${unit ? ` ${unit}` : ''}`;
})
- .join('; ');
+ .join('; ');
return text || row.goodsInfo || '';
};
diff --git a/src/option/business/waybill-manage.js b/src/option/business/waybill-manage.js
index e3b4958..61817cf 100644
--- a/src/option/business/waybill-manage.js
+++ b/src/option/business/waybill-manage.js
@@ -261,6 +261,7 @@ export const config = {
importUrl: '/blade-transport/waybill-manage/import-waybill-manage',
defaultForm: {
carrierType: '承运商',
+ transportType: 'road',
quantityUnit: '吨',
priceUnit: '元/吨',
},
diff --git a/src/views/business/components/business-crud-page.vue b/src/views/business/components/business-crud-page.vue
index a83276e..4bb64b2 100644
--- a/src/views/business/components/business-crud-page.vue
+++ b/src/views/business/components/business-crud-page.vue
@@ -108,6 +108,24 @@
{{ formatTransportPlanGoodsInfo(row) || '-' }}
+
+
+ {{ row.waybillNo }}
+
+ -
+
+
+
+
+ {{ row.loadingNo }}
+
+ -
+
+
-
+
(item.quantityUnit || item.cargoUnit || item.unit) === '吨') ||
- goodsRows[0] ||
- {};
- const name = goods.cargoName || goods.goodsName || goods.name || '';
- const type = goods.cargoType || goods.goodsType || goods.typeName || '';
- const quantity = goods.quantity ?? goods.cargoQuantity ?? goods.goodsQuantity ?? '';
- const unit = goods.quantityUnit || goods.cargoUnit || goods.unit || '';
- return [name, type, quantity === '' ? '' : `${quantity}${unit}`].filter(Boolean).join('/');
+ if (!goodsRows.length) return String(row.goodsInfo || row.cargoInfo || '');
+ const groups = goodsRows.reduce((result, item = {}) => {
+ const unit = item.quantityUnit || item.goodsQuantityUnit || item.cargoUnit || item.unit || '';
+ const key = unit || '__empty__';
+ if (!result[key]) {
+ result[key] = {
+ typeName:
+ item.secondCargoTypeName ||
+ item.secondCargoType ||
+ item.cargoType ||
+ item.goodsType ||
+ item.typeName ||
+ '货物',
+ count: 0,
+ quantity: 0,
+ unit,
+ };
+ }
+ result[key].count += 1;
+ result[key].quantity += this.parseDispatchQuantity(
+ item.quantity ?? item.cargoQuantity ?? item.goodsQuantity
+ );
+ return result;
+ }, {});
+ return Object.values(groups)
+ .map(group => {
+ const quantity = this.formatDispatchQuantity(group.quantity);
+ return `${group.typeName}等${group.count}种货物 | ${quantity}${
+ group.unit ? ` ${group.unit}` : ''
+ }`;
+ })
+ .join('; ');
},
formatTransportPlanDistrictAddress(value) {
const text = String(value || '').trim();
@@ -6836,6 +6877,24 @@ export default {
this.detailLoading = false;
});
},
+ async openLoadingDetail(row = {}) {
+ let id = row.loadingId || row.loadingManageId || '';
+ if (!id && row.loadingNo) {
+ try {
+ const res = await getLoadingList(1, 1, { loadingNo: row.loadingNo });
+ const data = res?.data?.data || res?.data || res || {};
+ const records = data.records || data.rows || (Array.isArray(data) ? data : []);
+ id = records[0]?.id || '';
+ } catch (error) {
+ id = '';
+ }
+ }
+ if (!id) {
+ this.$message.info('当前配载单暂无详情数据');
+ return;
+ }
+ this.$router.push({ path: '/business/loading-manage', query: { detailId: id } });
+ },
loadWaybillDetailProcessNodes(projectId) {
this.waybillDetailProcessNodes = [];
if (!projectId) return Promise.resolve([]);
@@ -11864,9 +11923,9 @@ export default {
const sourceRows = goodsRows.length ? goodsRows : itemGoodsRows.length ? itemGoodsRows : [item];
const groups = sourceRows.reduce((result, goods = {}) => {
const cargoType =
- goods.cargoType ||
goods.secondCargoTypeName ||
goods.secondCargoType ||
+ goods.cargoType ||
goods.goodsType ||
goods.type ||
plan.cargoType ||
@@ -11892,9 +11951,9 @@ export default {
group =>
`${group.cargoType}等${group.count}种货物 | ${this.formatDispatchQuantity(
group.quantity
- )}${group.unit || ''}`
+ )}${group.unit ? ` ${group.unit}` : ''}`
)
- .join(';');
+ .join('; ');
return cargoInfo || plan.goodsInfo || '';
},
dispatchGoodsRows(value) {
diff --git a/src/views/business/loading-manage.vue b/src/views/business/loading-manage.vue
index b0f7019..a8c0eca 100644
--- a/src/views/business/loading-manage.vue
+++ b/src/views/business/loading-manage.vue
@@ -583,6 +583,7 @@
clearable
filterable
placeholder="请选择"
+ :disabled="dialogMode === 'add'"
@visible-change="visible => visible && loadTransportTypeOptions()"
>
-
+
-
+
-
+
@@ -1035,7 +1036,7 @@ const createDialogForm = () => ({
batchNo: '',
currentProcessNode: '接单',
mileage: '',
- estimatedStartDate: dayjs().format('YYYY-MM-DD'),
+ estimatedStartDate: '',
estimatedEndDate: '',
taskRemark: '',
goodsJson: '',
@@ -1195,6 +1196,13 @@ export default {
mounted() {
this.loadTransportTypeOptions();
this.loadTable();
+ const detailId = this.$route.query.detailId;
+ if (detailId) this.openLoadingDialog('view', { id: detailId });
+ },
+ watch: {
+ '$route.query.detailId'(detailId) {
+ if (detailId) this.openLoadingDialog('view', { id: detailId });
+ },
},
methods: {
buildQueryParams(form) {
@@ -1403,6 +1411,7 @@ export default {
this.dialogVisible = true;
this.dialogLoading = true;
this.resetDialogData();
+ if (mode === 'add') this.candidateQuery.transportType = 'road';
try {
if (row?.id) {
const res = await loadingApi.getDetail(row.id);
@@ -1423,6 +1432,7 @@ export default {
} else {
this.dialogForm = createDialogForm();
this.candidateQuery = createCandidateSearchForm();
+ this.candidateQuery.transportType = 'road';
await this.loadCandidateWaybills();
}
} finally {
@@ -1453,6 +1463,7 @@ export default {
},
clearLoadingDialog() {
this.resetDialogData();
+ if (this.dialogMode === 'add') this.candidateQuery.transportType = 'road';
this.loadCandidateWaybills();
},
restoreRouteAndCargo() {
@@ -1702,6 +1713,7 @@ export default {
...this.buildQueryParams(this.candidateQuery),
businessStatus: 'pending',
onlyUnassignedLoading: 1,
+ ...(this.dialogMode === 'add' ? { transportType: 'road' } : {}),
}
);
const page = unwrapPage(res);
@@ -1721,6 +1733,7 @@ export default {
},
handleCandidateReset() {
this.candidateQuery = createCandidateSearchForm();
+ if (this.dialogMode === 'add') this.candidateQuery.transportType = 'road';
this.candidatePage.currentPage = 1;
this.loadCandidateWaybills();
},
@@ -1788,18 +1801,6 @@ export default {
if (!this.dialogForm.transportType) {
this.dialogForm.transportType = rows.find(row => row.transportType)?.transportType || '';
}
- if (!this.dialogForm.carrierName) {
- this.dialogForm.carrierName = rows.find(row => row.carrierName)?.carrierName || '';
- }
- if (!this.dialogForm.driverName) {
- this.dialogForm.driverName = rows.find(row => row.driverName)?.driverName || '';
- }
- if (!this.dialogForm.driverPhone) {
- this.dialogForm.driverPhone = rows.find(row => row.driverPhone)?.driverPhone || '';
- }
- if (!this.dialogForm.vehicleNo) {
- this.dialogForm.vehicleNo = rows.find(row => row.vehicleNo)?.vehicleNo || '';
- }
if (rebuildRoute) {
this.routeNodes = this.buildRouteNodes(rows);
}
@@ -2057,7 +2058,11 @@ export default {
});
},
handleCarrierTypeChange() {
- if (['自运', '网货平台'].includes(this.dialogForm.carrierType)) {
+ if (this.dialogForm.carrierType === '承运商') {
+ this.dialogForm.trailerVehicleNo = '';
+ this.dialogForm.escortName = '';
+ this.dialogForm.escortPhone = '';
+ } else if (['自运', '网货平台'].includes(this.dialogForm.carrierType)) {
this.dialogForm.carrierName = '';
}
},