diff --git a/src/option/settlement/preSettlementTable.js b/src/option/settlement/preSettlementTable.js index 26c06ed..e3c6e55 100644 --- a/src/option/settlement/preSettlementTable.js +++ b/src/option/settlement/preSettlementTable.js @@ -52,6 +52,7 @@ export const settlementDetailColumns = [ { label: '运输总量', prop: 'transportQuantityText', minWidth: 120 }, { label: '里程(KM)', prop: 'mileage', minWidth: 120 }, { label: '批次号', prop: 'batchNo', minWidth: 130 }, + { label: '计费方式', prop: 'billingType', minWidth: 130 }, { label: '运输单价', prop: 'unitPrice', minWidth: 120, money: true }, { label: '运费', prop: 'freightAmount', minWidth: 120, money: true }, { label: '原金额', prop: 'originalAmount', minWidth: 120, money: true }, @@ -94,5 +95,6 @@ export const candidateDetailColumns = [ { label: '货物名称', prop: 'cargoName', minWidth: 140 }, { label: '货物类型', prop: 'cargoType', minWidth: 130 }, { label: '批次号', prop: 'batchNo', minWidth: 120 }, + { label: '计费方式', prop: 'billingType', minWidth: 130 }, { label: '结算金额', prop: 'totalAmount', minWidth: 130, money: true }, ]; diff --git a/src/utils/settlement-adjust-rule.js b/src/utils/settlement-adjust-rule.js new file mode 100644 index 0000000..066cda3 --- /dev/null +++ b/src/utils/settlement-adjust-rule.js @@ -0,0 +1,30 @@ +export function isFreightFeeName(name) { + const text = String(name || ''); + return text.includes('运费') || text.includes('运输费'); +} + +/** 运输单价对应的运费计费类型。 */ +export function freightBillingType(row = {}) { + const rule = row.billingRule || {}; + const rules = Array.isArray(rule.rules) ? rule.rules : []; + const freightRule = rules.find( + item => isFreightFeeName(item?.feeItem) || isFreightFeeName(item?.feeType) + ); + return freightRule?.billingType || row.billingType || rule.billingType || ''; +} + +export function isTierUnitPrice(row) { + return freightBillingType(row) === '阶梯单价'; +} + +export function isIntervalBilling(row) { + const type = freightBillingType(row); + return type === '区间单价' || (type.includes('区间') && type.includes('一口价')); +} + +/** 阶梯单价、区间单价、区间一口价的运输单价不开放手工调整。 */ +export function isUnitPriceAdjustable(row) { + const type = freightBillingType(row); + if (!type) return true; + return !isTierUnitPrice(row) && !isIntervalBilling(row); +} diff --git a/src/views/payment/payment-application-form.vue b/src/views/payment/payment-application-form.vue index 9c69366..637a2df 100644 --- a/src/views/payment/payment-application-form.vue +++ b/src/views/payment/payment-application-form.vue @@ -121,7 +121,7 @@ >