From 46e7952e4943eb50339cbe99f7b5900ed31110e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B3=89=E4=BD=B3?= <1107186916@qq.com> Date: Sat, 31 Oct 2026 16:07:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=98=E6=AC=BE=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=8D=95=E9=80=89=E6=94=B6=E7=A5=A8=E5=8D=95=E5=85=A8=E9=A2=9D?= =?UTF-8?q?=E8=AE=A4=E9=A2=86=E5=B9=B6=E6=96=B0=E5=A2=9E=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E7=99=BB=E8=AE=B0=E6=8E=A8=E9=80=81=E6=8C=87=E5=AE=9A=E5=BA=94?= =?UTF-8?q?=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/settlement/formalSettlement.js | 8 + .../components/formal-settlement-editor.vue | 63 +++++++- .../formal-settlement-table-panel.vue | 7 + .../invoice-receipt-candidates-dialog.vue | 150 ++++++++++++++++++ src/views/settlement/formal-settlement.vue | 141 +++++++++++++++- 5 files changed, 359 insertions(+), 10 deletions(-) create mode 100644 src/views/settlement/components/invoice-receipt-candidates-dialog.vue diff --git a/src/api/settlement/formalSettlement.js b/src/api/settlement/formalSettlement.js index 2d980d4..032e253 100644 --- a/src/api/settlement/formalSettlement.js +++ b/src/api/settlement/formalSettlement.js @@ -58,5 +58,13 @@ export const applyPayments = data => request({ url: `${baseUrl}/apply-payments`, method: 'post', data }); export const claimInvoices = data => request({ url: `${baseUrl}/claim-invoices`, method: 'post', data }); +// 先票后款:发票登记确认推送(认领收票单逐单 A302-6 指定应付),涉及多次金蝶远程调用,覆盖全局超时 +export const invoiceAssignKingdee = id => + request({ + url: `${baseUrl}/invoice-assign-kingdee`, + method: 'post', + timeout: 30000, + params: { id }, + }); export const queryInvoicePool = params => request({ url: `${baseUrl}/invoice-pool`, method: 'get', params }); diff --git a/src/views/settlement/components/formal-settlement-editor.vue b/src/views/settlement/components/formal-settlement-editor.vue index 7455abb..2589487 100644 --- a/src/views/settlement/components/formal-settlement-editor.vue +++ b/src/views/settlement/components/formal-settlement-editor.vue @@ -440,8 +440,15 @@ /> -
- 认领查询 +
+ + 选择收票单 + 认领查询
@@ -452,11 +459,6 @@ - - - + + + + + + + {{ invoiceRegisterDialog.row.formalSettlementNo || '-' }} + + + {{ formatMoney(invoiceRegisterDialog.row.settlementAmount, invoiceRegisterDialog.row.currency) }} + + + {{ formatMoney(invoiceRegisterDialog.row.invoiceAmount, invoiceRegisterDialog.row.currency) }} + + + {{ kingdeeSyncName(invoiceRegisterDialog.row.kingdeeSyncStatus) }} + + + + + 选择收票单 + + + + + + + + + + + + + + + + + + + + + @@ -113,16 +186,17 @@ import { isAdministrator } from '@/utils/auth'; import { downloadFile } from '@/utils/util'; import * as api from '@/api/settlement/formalSettlement'; import * as paymentApi from '@/api/payment/paymentApplication'; -import { formalSettlementOption } from '@/option/settlement/formalSettlement'; +import { formalSettlementOption, kingdeeSyncName } from '@/option/settlement/formalSettlement'; import organizationSearch from '@/mixins/organization-search'; import FormalSettlementEditor from './components/formal-settlement-editor.vue'; import FormalSettlementTablePanel from './components/formal-settlement-table-panel.vue'; +import InvoiceReceiptCandidatesDialog from './components/invoice-receipt-candidates-dialog.vue'; import { submitMkApprovalFlow, loadMkEnabled } from '@/utils/mk-approval'; import { getMKApprovalUrl } from '@/api/system/business-process'; export default { name: 'FormalSettlement', - components: { FormalSettlementEditor, FormalSettlementTablePanel }, + components: { FormalSettlementEditor, FormalSettlementTablePanel, InvoiceReceiptCandidatesDialog }, mixins: [organizationSearch], props: { /** 菜单拆分后锁定结算类型:payable=付款结算单,receivable=收款结算单 */ @@ -151,6 +225,16 @@ export default { rows: [], form: { appliedAmount: 0, remark: '' }, }, + // 先票后款路径B:发票登记(关联收票单 + 确认推送指定应付) + invoiceRegisterDialog: { + visible: false, + saving: false, + row: {}, + candidates: [], + }, + candidatesDialog: { + visible: false, + }, mkEnabled: false, // keep-alive 多标签下仅激活实例响应 detailNo,避免缓存页重复弹窗 isPageActive: true, @@ -297,6 +381,7 @@ export default { return: () => this.handleReturn(row), void: () => this.handleVoid(row), print: () => this.handlePrint(row), + invoiceRegister: () => this.openInvoiceRegisterDialog(row), }; (handlers[type] || (() => {}))(); }, @@ -596,6 +681,58 @@ export default { this.paymentDialog.loading = false; } }, + // 先票后款路径B:发票登记——认领收票单(claim-invoices 走增量认领并同步收票侧关系) + openInvoiceRegisterDialog(row) { + this.invoiceRegisterDialog.row = row || {}; + this.invoiceRegisterDialog.candidates = []; + this.invoiceRegisterDialog.visible = true; + }, + addInvoiceRegisterCandidates(rows) { + const existing = new Set( + this.invoiceRegisterDialog.candidates.map(item => String(item.invoiceNo)) + ); + const added = rows.filter(row => !existing.has(String(row.invoiceNo))); + if (!added.length) { + this.$message.warning('所选收票单均已登记'); + return; + } + // 全额认领:匹配金额固定=发票金额 + this.invoiceRegisterDialog.candidates.push( + ...added.map(row => ({ ...row, matchedAmount: Number(row.invoiceAmount || 0) })) + ); + }, + async submitInvoiceRegister() { + const settlement = this.invoiceRegisterDialog.row; + const invoices = this.invoiceRegisterDialog.candidates.map(row => ({ + ...row, + attachmentJson: row.attachmentJson || row.attachmentsJson, + invoiceType: row.invoiceType || '', + taxRate: row.taxRate ?? null, + availableInvoiceAmount: Number(row.invoiceAmount || 0), + matchedAmount: Number(row.invoiceAmount || 0), + })); + this.invoiceRegisterDialog.saving = true; + try { + await api.claimInvoices({ formalSettlementId: settlement.id, invoices }); + this.invoiceRegisterDialog.visible = false; + this.onLoad(this.page); + try { + await this.$confirm('是否将发票匹配数据推送金蝶?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + }); + } catch { + this.$message.info('已保存认领,未推送金蝶'); + return; + } + const data = this.unwrapData(await api.invoiceAssignKingdee(settlement.id)); + this.$message.success(data || '发票登记推送金蝶成功'); + this.onLoad(this.page); + } finally { + this.invoiceRegisterDialog.saving = false; + } + }, handlePrint(row) { if (!row) { row = this.selectedOne('打印');