feat: 结算单详情开票回写发票合并至发票信息表格展示

This commit is contained in:
刘泉佳
2026-11-10 17:35:13 +08:00
parent 96822cc24b
commit 64aba30e3f
@@ -450,7 +450,7 @@
>
<el-button v-else type="primary" @click="openInvoiceClaimDialog">认领查询</el-button>
</div>
<el-table :data="invoices" border>
<el-table :data="invoiceRows" border>
<el-table-column type="index" label="序号" width="64" align="center" />
<el-table-column prop="invoiceNo" label="发票号" min-width="150" align="center" />
<el-table-column prop="invoiceDate" label="开票日期" min-width="130" align="center">
@@ -473,7 +473,9 @@
min-width="180"
align="center"
>
<template #default="{ row }">{{ formatMoney(row.availableInvoiceAmount) }}</template>
<template #default="{ row }">{{
row.issued ? '-' : formatMoney(row.availableInvoiceAmount)
}}</template>
</el-table-column>
<el-table-column
prop="matchedAmount"
@@ -491,7 +493,7 @@
:precision="2"
:controls="false"
/>
<span v-else>{{ formatMoney(row.matchedAmount) }}</span>
<span v-else>{{ row.issued ? '-' : formatMoney(row.matchedAmount) }}</span>
</template>
</el-table-column>
<el-table-column
@@ -526,13 +528,13 @@
<el-link
type="primary"
:disabled="kingdeeAttachmentBusy"
@click="viewInvoiceAttachment(row)"
@click="viewInvoiceFile(row)"
>查看</el-link
>
<el-link
type="primary"
:disabled="kingdeeAttachmentBusy"
@click="downloadInvoiceAttachment(row)"
@click="downloadInvoiceFile(row)"
>下载</el-link
>
<!-- 查看页重推入口:付款结算单已同步金蝶且认领票未指定应付(failed/pushed) -->
@@ -543,35 +545,13 @@
@click="repushInvoice(row)"
>重新推送</el-link
>
<el-link v-if="editable" type="danger" @click="removeInvoice($index)">删除</el-link>
<el-link v-if="editable && !row.issued" type="danger" @click="removeInvoice($index)"
>删除</el-link
>
</div>
</template>
</el-table-column>
</el-table>
<div v-if="issuedInvoices.length" class="formal-editor__issued-invoices">
<div class="formal-editor__issued-title">
开票发票(本结算单开票申请经金蝶开票回写,文件由金蝶发票云直链提供)
</div>
<el-table :data="issuedInvoices" border>
<el-table-column type="index" label="序号" width="64" align="center" />
<el-table-column prop="invoiceNo" label="发票号" min-width="150" align="center" />
<el-table-column prop="invoiceDate" label="开票日期" min-width="130" align="center">
<template #default="{ row }">{{ displayValue(row.invoiceDate) }}</template>
</el-table-column>
<el-table-column prop="invoiceAmount" label="价税合计" min-width="130" align="center">
<template #default="{ row }">{{ formatMoney(row.invoiceAmount) }}</template>
</el-table-column>
<el-table-column label="操作" width="160" fixed="right" align="center">
<template #default="{ row }">
<div class="formal-editor__links">
<el-link type="primary" @click="viewIssuedInvoice(row)">查看</el-link>
<el-link type="primary" @click="downloadIssuedInvoice(row)">下载</el-link>
</div>
</template>
</el-table-column>
</el-table>
</div>
</section-card>
<kingdee-invoice-pool-dialog
@@ -1123,6 +1103,7 @@ import {
sourceColumns,
summaryColumns,
} from '@/option/settlement/formalSettlementTable';
import { invoiceTypeOptions } from '@/api/payment/invoiceApplication';
import { getDictionary } from '@/api/system/dictbiz';
import { h } from 'vue';
import { mapGetters } from 'vuex';
@@ -1324,6 +1305,21 @@ export default {
editable() {
return !this.readonly;
},
// 发票信息合并展示:结算单发票行在前 + 金蝶回写开票发票行在后(issued 标记,只读不保存);
// 回写行恒在尾部,保证下方 $index 删除操作与 this.invoices 索引一致;回写行票种按开票申请字典翻译
invoiceRows() {
return [
...this.invoices,
...this.issuedInvoices.map(row => ({
...row,
issued: true,
invoiceType:
invoiceTypeOptions.find(item => item.value === row.invoiceType)?.label ||
row.invoiceType ||
'',
})),
];
},
// 查看页面「同步」按钮:仅已审批且未同步金蝶(含推送失败)的单据显示,口径与后端推送闸门一致
canSync() {
return (
@@ -2702,9 +2698,10 @@ export default {
openInvoiceReceiptDialog() {
this.invoiceReceiptDialog.visible = true;
},
// 查看页重推入口展示条件:只读 + 付款结算单 + 审批通过 + 金蝶应付单已同步 + 该票未指定应付(failed/pushed)
// 查看页重推入口展示条件:只读 + 付款结算单 + 审批通过 + 金蝶应付单已同步 + 该票未指定应付(failed/pushed);金蝶回写行不参与
canRepushInvoice(row) {
return (
!row.issued &&
!this.editable &&
this.form.settlementType !== 'receivable' &&
this.form.approvalStatus === 'approved' &&
@@ -2954,6 +2951,13 @@ export default {
this.kingdeeAttachmentBusy = false;
}
},
// 发票文件入口分流:金蝶回写开票发票走发票云直链,其余走金蝶票池/登记附件
viewInvoiceFile(row) {
return row.issued ? this.viewIssuedInvoice(row) : this.viewInvoiceAttachment(row);
},
downloadInvoiceFile(row) {
return row.issued ? this.downloadIssuedInvoice(row) : this.downloadInvoiceAttachment(row);
},
// 开票发票预览地址:数电PDF优先(OFD浏览器无法预览),退预览图、板式文件
issuedInvoicePreviewUrl(row) {
return row.invoicePdfFileUrl || row.invoiceImageUrl || row.invoiceFileUrl || '';
@@ -3591,14 +3595,6 @@ export default {
justify-content: flex-end;
margin-bottom: 12px;
}
.formal-editor__issued-invoices {
margin-top: 16px;
}
.formal-editor__issued-title {
margin-bottom: 8px;
color: var(--el-text-color-secondary);
font-size: 13px;
}
.formal-editor__negative-amount {
color: var(--el-color-danger);
}