1、调整导入运单

2、调整对账
This commit is contained in:
2026-09-10 22:50:18 +08:00
parent 38e53e01af
commit 1a9cd55d66
17 changed files with 374 additions and 149 deletions
@@ -205,10 +205,18 @@
<section-card title="导入外部账单">
<template #extra>
<div class="reconciliation-editor__actions" v-if="editable">
<el-button type="primary" plain @click="downloadTemplate('vehicle')"
<el-button
v-if="form.reconciliationMode === 'vehicle'"
type="primary"
plain
@click="downloadTemplate('vehicle')"
>下载整车对账模板</el-button
>
<el-button type="primary" plain @click="downloadTemplate('cargo')"
<el-button
v-if="form.reconciliationMode === 'cargo'"
type="primary"
plain
@click="downloadTemplate('cargo')"
>下载货物明细对账模板</el-button
>
<el-button type="primary" plain @click="chooseImport">导入</el-button>
@@ -374,6 +382,11 @@
formatMoney(row.settlementAmount, row.currency)
}}</template></el-table-column
>
<el-table-column label="审批状态" width="110"
><template #default="{ row }">{{
formalApprovalStatusLabel(row.approvalStatus)
}}</template></el-table-column
>
<el-table-column label="操作" width="100" fixed="right" align="center">
<template #default="{ row }">
<el-link type="primary" @click="selectFormal(row)">选择</el-link>
@@ -1081,6 +1094,19 @@ export default {
getFeeItemAmount(row, name) {
return (row.feeItems || this.parseFeeItems(row.feeItemsJson))[name] ?? 0;
},
formalApprovalStatusLabel(value) {
return (
{
draft: '草稿',
reviewing: '审批中',
approved: '审批通过',
returned: '已驳回',
voided: '已作废',
}[value] ||
value ||
'-'
);
},
async loadFormalOptions() {
this.formalDialog.loading = true;
try {
@@ -1096,20 +1122,8 @@ export default {
params
)
);
let rows = data.records || [];
let total = data.total || 0;
if (!rows.length) {
const fallback = await formalSettlementApi.getList(
this.formalDialog.page.current,
this.formalDialog.page.size,
params
);
const fallbackData = this.unwrapData(fallback);
rows = fallbackData.records || [];
total = fallbackData.total || 0;
}
this.formalDialog.rows = rows;
this.formalDialog.page.total = total;
this.formalDialog.rows = data.records || [];
this.formalDialog.page.total = data.total || 0;
} finally {
this.formalDialog.loading = false;
}
@@ -1120,6 +1134,9 @@ export default {
await this.selectFormal(this.formalDialog.selected[0]);
},
async selectFormal(selected) {
if (selected?.approvalStatus && selected.approvalStatus !== 'draft') {
return this.$message.warning('只能选择草稿状态的正式结算单');
}
const formalSettlementChanged = this.form.formalSettlementId !== selected.id;
this.form = {
...this.form,
@@ -1489,7 +1506,14 @@ export default {
}
},
async downloadTemplate(mode) {
const response = await api.template(mode);
if (!this.form.formalSettlementId) {
return this.$message.warning('请先选择正式结算单');
}
const response = await api.template(mode, {
id: this.currentId,
formalSettlementId: this.form.formalSettlementId,
feeItems: this.internalFeeItemNames.join(','),
});
downloadXls(
response.data,
`${mode === 'cargo' ? '货物明细对账模板' : '整车总额对账模板'}.xlsx`