修复业务模块bug

This commit is contained in:
2026-08-13 14:07:04 +08:00
parent 6554ad80dd
commit f62e36e846
15 changed files with 941 additions and 186 deletions
+11 -23
View File
@@ -18,6 +18,7 @@ const transportTypeDict = {
};
const isEmpty = value => value === undefined || value === null || value === '';
const normalizeNumericDisplayValue = value => (Number(value) === -1 ? '' : value);
const parseJsonArray = value => {
if (Array.isArray(value)) return value;
@@ -86,7 +87,9 @@ const formatGoodsInfo = row => {
const name = getFirstValue(item, ['cargoName', 'goodsName', 'name']);
const type = getFirstValue(item, ['cargoType', 'goodsType', 'typeName']);
const quantity = joinText([
getFirstValue(item, ['quantity', 'cargoQuantity', 'goodsQuantity']),
normalizeNumericDisplayValue(
getFirstValue(item, ['quantity', 'cargoQuantity', 'goodsQuantity'])
),
getFirstValue(item, ['quantityUnit', 'cargoUnit', 'unit']),
]);
return joinText([name, type, quantity]);
@@ -102,17 +105,17 @@ const formatGoodsField = (row, props) => {
return goods ? getFirstValue(goods, props) : '';
};
const formatTransportMode = row =>
getFirstValue(row, ['transportModeName', 'transportMode', 'transportWayName', 'transportWay']);
const formatUnitPrice = row => {
const value = getFirstValue(row, ['unitPrice', 'price']);
const value = normalizeNumericDisplayValue(getFirstValue(row, ['unitPrice', 'price']));
const unit = getFirstValue(row, ['priceUnit', 'billingUnit', 'unit']);
if (!isEmpty(value)) return unit ? `${value}(${unit})` : value;
const billing = getBillingRows(row).find(item => !isEmpty(item.unitPrice));
const billing = getBillingRows(row).find(
item => !isEmpty(normalizeNumericDisplayValue(item.unitPrice))
);
if (!billing) return '';
const billingUnit = getFirstValue(billing, ['priceUnit', 'billingUnit', 'unit']);
return billingUnit ? `${billing.unitPrice}(${billingUnit})` : billing.unitPrice;
const billingPrice = normalizeNumericDisplayValue(billing.unitPrice);
return billingUnit ? `${billingPrice}(${billingUnit})` : billingPrice;
};
const formatAmount = (row, props) => getFirstValue(row, props);
@@ -176,8 +179,6 @@ const auditColumn = prop => ({ ...auditColumns.find(item => item.prop === prop)
export const config = {
title: '运单管理',
permission: 'waybill_manage',
exportUrl: '/blade-transport/waybill-manage/export-waybill-manage',
exportName: '运单管理',
importUrl: '/blade-transport/waybill-manage/import-waybill-manage',
defaultForm: {
carrierType: '承运商',
@@ -332,19 +333,6 @@ export const option = {
},
{
label: '运输方式',
prop: 'transportMode',
type: 'select',
search: true,
searchOrder: 1,
formatter: row => formatTransportMode(row),
...transportTypeDict,
minWidth: 130,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '运输类型',
prop: 'transportType',
type: 'select',
search: true,
@@ -353,7 +341,7 @@ export const option = {
order: 850,
...transportTypeDict,
minWidth: 130,
rules: selectRule('运输类型'),
rules: selectRule('运输方式'),
},
{
label: '过程节点',