diff --git a/src/option/settlement/formalSettlementForm.js b/src/option/settlement/formalSettlementForm.js index 4b51186..5afba6b 100644 --- a/src/option/settlement/formalSettlementForm.js +++ b/src/option/settlement/formalSettlementForm.js @@ -8,6 +8,8 @@ export const formalSettlementFormFields = [ { label: '收款方', prop: 'payeeName', readonly: true }, { label: '结算类型', prop: 'settlementTypeName', readonly: true }, { label: '结算金额', prop: 'settlementAmount', readonly: true, money: true }, + { label: '业务模式', prop: 'businessModel', type: 'select', optionsKey: 'businessModelOptions' }, + { label: '运输方式', prop: 'transportType', type: 'select', optionsKey: 'transportTypeOptions' }, { label: '汇率日期', prop: 'exchangeRateDate', type: 'date', required: true }, { label: '结算汇率', prop: 'exchangeRate', type: 'number', required: true }, { label: '本位币合计', prop: 'localSettlementAmount', readonly: true, money: true }, @@ -25,6 +27,8 @@ export const createFormalSettlementForm = () => ({ settlementType: '', sourcePreSettlementIds: [], sourceDetailIds: [], + businessModel: '', + transportType: '', exchangeRateDate: '', exchangeRate: 1, createUserName: '', diff --git a/src/option/settlement/formalSettlementTable.js b/src/option/settlement/formalSettlementTable.js index f53ee46..93393b9 100644 --- a/src/option/settlement/formalSettlementTable.js +++ b/src/option/settlement/formalSettlementTable.js @@ -8,6 +8,8 @@ export const formalSettlementTableColumns = [ { label: '合同编号', prop: 'contractNo', minWidth: 150 }, { label: '合同名称', prop: 'contractName', minWidth: 170 }, { label: '原币结算金额', prop: 'settlementAmount', minWidth: 145, money: true }, + { label: '业务模式', prop: 'businessModelName', minWidth: 120 }, + { label: '运输方式', prop: 'transportTypeName', minWidth: 120 }, { label: '本位币结算金额', prop: 'localSettlementAmount', minWidth: 155, money: true }, { label: '结算汇率', prop: 'exchangeRate', minWidth: 110 }, { label: '申请付款金额(含预付)', prop: 'appliedPaymentAmount', minWidth: 185, money: true }, diff --git a/src/option/settlement/preSettlementForm.js b/src/option/settlement/preSettlementForm.js index ef70be7..64754ba 100644 --- a/src/option/settlement/preSettlementForm.js +++ b/src/option/settlement/preSettlementForm.js @@ -12,6 +12,8 @@ export const preSettlementFormFields = [ { label: '付款方', prop: 'payerName', readonly: true }, { label: '结算类型', prop: 'settlementType', readonly: true }, { label: '结算金额', prop: 'settlementAmount', readonly: true, money: true }, + { label: '业务模式', prop: 'businessModel', type: 'select', optionsKey: 'businessModelOptions' }, + { label: '运输方式', prop: 'transportType', type: 'select', optionsKey: 'transportTypeOptions' }, { label: '汇率日期', prop: 'exchangeRateDate', type: 'date' }, { label: '结算汇率', prop: 'exchangeRate', type: 'number', class: 'exchange-rate-input' }, { label: '本位币合计', prop: 'localSettlementAmount', readonly: true, money: true }, @@ -64,6 +66,8 @@ export const emptyPreSettlementForm = () => ({ settlementType: 'payable', currency: 'RMB', settlementAmount: 0, + businessModel: '', + transportType: '', localCurrency: 'RMB', localSettlementAmount: 0, exchangeRateDate: '', diff --git a/src/option/settlement/preSettlementTable.js b/src/option/settlement/preSettlementTable.js index e3c6e55..b253079 100644 --- a/src/option/settlement/preSettlementTable.js +++ b/src/option/settlement/preSettlementTable.js @@ -8,6 +8,8 @@ export const preSettlementTableColumns = [ { label: '合同编号', prop: 'contractNo', minWidth: 140 }, { label: '合同名称', prop: 'contractName', minWidth: 160 }, { label: '原币结算金额', prop: 'settlementAmount', minWidth: 140, money: true, precision: 2 }, + { label: '业务模式', prop: 'businessModelName', minWidth: 120 }, + { label: '运输方式', prop: 'transportTypeName', minWidth: 120 }, { label: '本位币结算金额', prop: 'localSettlementAmount', minWidth: 150, money: true, precision: 2 }, { label: '结算汇率', prop: 'exchangeRate', minWidth: 110, precision: 2 }, { diff --git a/src/utils/import-excel.js b/src/utils/import-excel.js index 4d69c81..b6a9093 100644 --- a/src/utils/import-excel.js +++ b/src/utils/import-excel.js @@ -7,7 +7,7 @@ import 'nprogress/nprogress.css'; const excelPattern = /\.(xls|xlsx)$/; /** 是否为浏览器 Blob(含跨 realm 的 Blob-like) */ -const isBlobLike = value => +export const isBlobLike = value => value != null && typeof value === 'object' && typeof value.size === 'number' && @@ -15,14 +15,14 @@ const isBlobLike = value => (typeof value.text === 'function' || typeof value.arrayBuffer === 'function'); /** axios 拦截器已把 JSON Blob 解析成的业务对象 */ -const isBusinessJson = value => +export const isBusinessJson = value => value != null && typeof value === 'object' && !isBlobLike(value) && !(value instanceof ArrayBuffer) && ('code' in value || 'success' in value || 'msg' in value); -const isExcelResponse = res => { +export const isExcelResponse = res => { // 已是业务 JSON(导入成功/失败提示)时,绝不能当失败明细 Excel 处理 if (isBusinessJson(res?.data)) { return false; @@ -54,7 +54,7 @@ const isExcelResponse = res => { * 提前解析成普通对象;此处需同时兼容 Blob / 字符串 / 已解析对象,避免再调 * `blob.text()` 时出现「blob.text is not a function」。 */ -const parseBlobJson = async data => { +export const parseBlobJson = async data => { if (data == null) { return {}; } diff --git a/src/utils/settlement-adjust-rule.js b/src/utils/settlement-adjust-rule.js index 066cda3..7d58540 100644 --- a/src/utils/settlement-adjust-rule.js +++ b/src/utils/settlement-adjust-rule.js @@ -3,10 +3,27 @@ export function isFreightFeeName(name) { return text.includes('运费') || text.includes('运输费'); } +function parseBillingRules(row = {}) { + const rule = row.billingRule || {}; + const nested = Array.isArray(rule.rules) ? rule.rules : []; + if (nested.length) return nested; + const raw = row.billingRulesJson ?? row.billingRules; + if (Array.isArray(raw)) return raw.filter(item => item && typeof item === 'object'); + if (typeof raw === 'string' && raw.trim()) { + try { + const parsed = JSON.parse(raw); + return Array.isArray(parsed) ? parsed.filter(item => item && typeof item === 'object') : []; + } catch (error) { + return []; + } + } + return []; +} + /** 运输单价对应的运费计费类型。 */ export function freightBillingType(row = {}) { const rule = row.billingRule || {}; - const rules = Array.isArray(rule.rules) ? rule.rules : []; + const rules = parseBillingRules(row); const freightRule = rules.find( item => isFreightFeeName(item?.feeItem) || isFreightFeeName(item?.feeType) ); diff --git a/src/utils/settlement-change-record.js b/src/utils/settlement-change-record.js new file mode 100644 index 0000000..b59b1dc --- /dev/null +++ b/src/utils/settlement-change-record.js @@ -0,0 +1,6 @@ +/** 审批通过、驳回等审批流转类变更内容,不在结算单变更记录中展示。 */ +export function isApprovalSettlementChange(content) { + const text = String(content || '').trim(); + if (!text) return false; + return text.includes('审批通过') || text.includes('审批驳回') || text === '已驳回'; +} diff --git a/src/views/settlement/components/formal-settlement-editor.vue b/src/views/settlement/components/formal-settlement-editor.vue index 2fe8b24..b572070 100644 --- a/src/views/settlement/components/formal-settlement-editor.vue +++ b/src/views/settlement/components/formal-settlement-editor.vue @@ -64,6 +64,20 @@ :precision="2" :controls="false" /> + + + {{ formatMoney(form[field.prop]) }} + {{ + formSelectLabel(field, form[field.prop]) + }} {{ displayValue(form.contractName) }} @@ -424,26 +441,7 @@
- - - - - - - 认领查询 - - - + 认领查询
@@ -544,7 +542,6 @@ title="查询可认领发票" confirm-text="确认认领" multiple - :initial-invoice-no="String(invoiceClaimNo || '').trim()" :query-api="invoicePoolQueryApi" @confirm="handleInvoiceClaimConfirm" /> @@ -697,9 +694,19 @@ + + +
+ +