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 @@
- {{ claimStatusChange(row) }}
+
+ {{ row.actionType === 'push' ? row.actionName : claimStatusChange(row) }}
+
@@ -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;
}