From 09da05c75e9af9e4f0cb60f178494f4121eeb085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B3=89=E4=BD=B3?= <1107186916@qq.com> Date: Tue, 29 Sep 2026 01:03:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=B6=E6=AC=BE=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E9=A1=B5=E6=96=B0=E5=A2=9E=E6=8E=A8=E9=80=81=E9=87=91=E8=9D=B6?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=B8=8E=E6=8E=A8=E9=80=81=E7=8A=B6=E6=80=81?= =?UTF-8?q?/=E5=A4=B1=E8=B4=A5=E5=8E=9F=E5=9B=A0/=E9=87=91=E8=9D=B6?= =?UTF-8?q?=E5=8D=95=E5=8F=B7=E5=88=97=EF=BC=8C=E8=AE=A4=E9=A2=86=E5=8F=A3?= =?UTF-8?q?=E5=BE=84=E5=88=87=E5=85=AC=E5=91=8A=E6=9C=AA=E8=AE=A4=E9=A2=86?= =?UTF-8?q?=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 行按钮推送金蝶(receipt_flow_push 权限,认领完成且未推送可点),成功提示金蝶收款单号 - 列表/详情展示推送状态、推送失败原因、金蝶收款单号与金蝶状态,留痕表含推送记录 - 认领表单/批量认领上限校验切公告未认领金额口径,新增剩余可认领金额展示 --- src/api/payment/receiptFlow.js | 2 + src/option/payment/receiptFlow.js | 4 + src/views/payment/receipt-flow-batch-form.vue | 4 +- src/views/payment/receipt-flow-form.vue | 14 +++- src/views/payment/receipt-flow.vue | 82 +++++++++++++++++-- 5 files changed, 94 insertions(+), 12 deletions(-) diff --git a/src/api/payment/receiptFlow.js b/src/api/payment/receiptFlow.js index 64cec7b..ccbb253 100644 --- a/src/api/payment/receiptFlow.js +++ b/src/api/payment/receiptFlow.js @@ -13,6 +13,8 @@ export const getSettlementCandidates = (keyword, flowId) => }); export const claim = data => request({ url: `${baseUrl}/claim`, method: 'post', data }); export const sync = () => request({ url: `${baseUrl}/sync`, method: 'post' }); +export const pushKingdee = flowId => + request({ url: `${baseUrl}/push-kingdee`, method: 'post', params: { flowId } }); export const claimStatusOptions = [ { label: '未认领', value: 'unclaimed' }, diff --git a/src/option/payment/receiptFlow.js b/src/option/payment/receiptFlow.js index cf21023..983f4a1 100644 --- a/src/option/payment/receiptFlow.js +++ b/src/option/payment/receiptFlow.js @@ -11,4 +11,8 @@ export const receiptFlowTableColumns = [ { prop: 'kingdeeClaimStatusName', label: '公告状态', minWidth: 110 }, { prop: 'claimedAmount', label: '已认领金额', minWidth: 130, money: true }, { prop: 'unclaimedAmount', label: '金蝶未认领金额', minWidth: 140, money: true }, + { prop: 'pushStatusName', label: '推送状态', minWidth: 110, status: true }, + { prop: 'pushFailReason', label: '推送失败原因', minWidth: 160 }, + { prop: 'kingdeeBillNo', label: '金蝶收款单号', minWidth: 150 }, + { prop: 'kingdeeBillStatusName', label: '金蝶状态', minWidth: 110 }, ]; diff --git a/src/views/payment/receipt-flow-batch-form.vue b/src/views/payment/receipt-flow-batch-form.vue index 4d199b1..b7f0bd8 100644 --- a/src/views/payment/receipt-flow-batch-form.vue +++ b/src/views/payment/receipt-flow-batch-form.vue @@ -339,11 +339,11 @@ export default { for (const flow of this.flows) { const total = this.flowAllocatedTotal(flow.id); const remaining = Math.max( - Number(flow.receiptAmount || 0) - Number(flow.claimedAmount || 0), + Number(flow.unclaimedAmount || 0) - Number(flow.claimedAmount || 0), 0 ); if (total > remaining + 0.001) { - this.$message.warning(`流水${flow.receiptNoticeNo}的分摊金额不能超过剩余可认领金额`); + this.$message.warning(`流水${flow.receiptNoticeNo}的累计认领金额不能超过公告未认领金额`); return; } } diff --git a/src/views/payment/receipt-flow-form.vue b/src/views/payment/receipt-flow-form.vue index 980fd01..2171f28 100644 --- a/src/views/payment/receipt-flow-form.vue +++ b/src/views/payment/receipt-flow-form.vue @@ -51,6 +51,10 @@ > + @@ -247,6 +251,12 @@ export default { 0 ); }, + claimableAmount() { + return Math.max( + Number(this.form.unclaimedAmount || 0) - Number(this.form.claimedAmount || 0), + 0 + ); + }, }, created() { if (!this.batchMode) this.initialize(); @@ -336,8 +346,8 @@ export default { this.$message.warning('分摊收款金额必须大于0'); return; } - if (this.allocatedTotal > amount - Number(this.form.claimedAmount || 0) + 0.001) { - this.$message.warning('本次分摊金额不能超过流水剩余可认领金额'); + if (this.allocatedTotal > this.claimableAmount + 0.001) { + this.$message.warning('累计认领金额不能超过公告未认领金额(剩余可认领金额)'); return; } for (const row of this.form.settlements) diff --git a/src/views/payment/receipt-flow.vue b/src/views/payment/receipt-flow.vue index a71b187..2b91695 100644 --- a/src/views/payment/receipt-flow.vue +++ b/src/views/payment/receipt-flow.vue @@ -90,7 +90,7 @@ {{ displayValue(row[column.prop]) }} @@ -99,10 +99,23 @@ {{ displayValue(row[column.prop]) }} - + @@ -153,7 +166,7 @@ {{ displayValue(detailDialog.data.detailSerialNo) }} - + {{ displayValue(detailDialog.data.claimStatusName) }} @@ -166,6 +179,20 @@ {{ formatMoney(detailDialog.data.unclaimedAmount) }} + + + {{ displayValue(detailDialog.data.pushStatusName) }} + + + + {{ displayValue(detailDialog.data.kingdeeBillNo) }} + + + {{ displayValue(detailDialog.data.kingdeeBillStatusName) }} + + + {{ displayValue(detailDialog.data.pushFailReason) }} + {{ displayValue(detailDialog.data.summary) }} @@ -180,7 +207,9 @@ - + @@ -218,6 +247,7 @@ export default { selectedRows: [], loading: false, syncing: false, + pushingId: null, searchExpanded: false, page: { current: 1, size: 10, total: 0 }, detailDialog: { visible: false, loading: false, data: {}, claimRecords: [] }, @@ -334,8 +364,41 @@ export default { canClaim(row) { return this.hasPermission('receipt_flow_claim') && Number(row.remainingAmount || 0) > 0; }, - statusType(status) { - return { claimed: 'success', partial: 'warning', unclaimed: 'info' }[status] || ''; + canPush(row) { + return ( + this.hasPermission('receipt_flow_push') && + !!row.billId && + row.claimStatus === 'claimed' && + row.pushStatus !== 'pushed' + ); + }, + async handlePush(row) { + try { + await this.$confirm( + `确认将流水【${row.receiptNoticeNo || row.detailSerialNo || ''}】推送金蝶生成收款单?`, + '推送金蝶', + { type: 'warning' } + ); + } catch { + return; + } + this.pushingId = row.id; + try { + const data = this.unwrapData(await api.pushKingdee(row.id)); + const billNo = data?.kingdeeBillNo; + this.$message.success(billNo ? `推送成功,金蝶收款单号:${billNo}` : '推送成功'); + await this.loadTable(); + } finally { + this.pushingId = null; + } + }, + statusType(row, column) { + if (column?.prop === 'pushStatusName') { + return { pushed: 'success', failed: 'danger' }[row.pushStatus] || 'info'; + } + return ( + { claimed: 'success', partial: 'warning', unclaimed: 'info' }[row.claimStatus] || '' + ); }, claimStatusChange(row) { const label = status => @@ -398,6 +461,9 @@ export default { .receipt-flow-page :deep(.el-table) { --el-table-border-color: #eff1f7; } +.receipt-flow-page :deep(.el-table .cell .el-link + .el-link) { + margin-left: 12px; +} .receipt-flow-page :deep(.el-table__row:nth-child(even) > td.el-table__cell) { background: #fafafa; }