feat: 查看页重推认领收票单并放开付款匹配金额编辑
This commit is contained in:
@@ -66,5 +66,13 @@ export const invoiceAssignKingdee = id =>
|
||||
timeout: 30000,
|
||||
params: { id },
|
||||
});
|
||||
// 先票后款:查看页重推认领收票单(收票单A303-2+指定应付A302-6 一步式),涉及多次金蝶远程调用,覆盖全局超时
|
||||
export const repushClaimedInvoice = (id, invoiceNo) =>
|
||||
request({
|
||||
url: `${baseUrl}/repush-claimed-invoice`,
|
||||
method: 'post',
|
||||
timeout: 30000,
|
||||
params: { id, invoiceNo },
|
||||
});
|
||||
export const queryInvoicePool = params =>
|
||||
request({ url: `${baseUrl}/invoice-pool`, method: 'get', params });
|
||||
|
||||
@@ -482,9 +482,9 @@
|
||||
align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<!-- 先票后款:收票单认领金额固定=发票金额(全额认领),不可改 -->
|
||||
<!-- 匹配结算单金额支持手动修改(收款/付款一致),默认=发票金额全额认领,收票覆盖度按匹配合计判定 -->
|
||||
<el-input-number
|
||||
v-if="editable && form.settlementType === 'receivable'"
|
||||
v-if="editable"
|
||||
v-model="row.matchedAmount"
|
||||
:min="0"
|
||||
:max="Number(row.availableInvoiceAmount || 0)"
|
||||
@@ -496,9 +496,23 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="是否已指定应付" min-width="130" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.kingdeePushStatus === 'assigned' ? 'success' : 'info'" size="small">
|
||||
{{ row.kingdeePushStatus === 'assigned' ? '已指定应付' : '未指定' }}
|
||||
</el-tag>
|
||||
<el-tooltip
|
||||
:disabled="row.kingdeePushStatus !== 'failed'"
|
||||
:content="row.kingdeePushMsg || '推送金蝶失败,可重新推送'"
|
||||
placement="top"
|
||||
>
|
||||
<el-tag
|
||||
:type="
|
||||
{ assigned: 'success', failed: 'danger' }[row.kingdeePushStatus] || 'info'
|
||||
"
|
||||
size="small"
|
||||
>
|
||||
{{
|
||||
{ assigned: '已指定应付', failed: '指定失败' }[row.kingdeePushStatus] ||
|
||||
'未指定'
|
||||
}}
|
||||
</el-tag>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="220" fixed="right" align="center">
|
||||
@@ -516,6 +530,14 @@
|
||||
@click="downloadInvoiceAttachment(row)"
|
||||
>下载</el-link
|
||||
>
|
||||
<!-- 查看页重推入口:付款结算单已同步金蝶且认领票未指定应付(failed/pushed) -->
|
||||
<el-link
|
||||
v-if="canRepushInvoice(row)"
|
||||
type="warning"
|
||||
:disabled="repushing"
|
||||
@click="repushInvoice(row)"
|
||||
>重新推送</el-link
|
||||
>
|
||||
<el-link v-if="editable" type="danger" @click="removeInvoice($index)">删除</el-link>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1068,6 +1090,7 @@ import {
|
||||
getNextNo,
|
||||
getReceiptClaims,
|
||||
claimInvoices as claimInvoicesApi,
|
||||
repushClaimedInvoice,
|
||||
queryInvoicePool,
|
||||
save,
|
||||
syncKingdee,
|
||||
@@ -1166,6 +1189,8 @@ export default {
|
||||
attachments: [],
|
||||
selectedAttachmentRows: [],
|
||||
invoices: [],
|
||||
// 查看页认领收票单重推进行中(行级操作守卫)
|
||||
repushing: false,
|
||||
// 开票申请经金蝶回写的发票结果(只读展示,含板式文件/数电PDF下载地址)
|
||||
issuedInvoices: [],
|
||||
// 金蝶侧发票附件查看/下载进行中(行组级 loading 守卫)
|
||||
@@ -2676,6 +2701,38 @@ export default {
|
||||
openInvoiceReceiptDialog() {
|
||||
this.invoiceReceiptDialog.visible = true;
|
||||
},
|
||||
// 查看页重推入口展示条件:只读 + 付款结算单 + 审批通过 + 金蝶应付单已同步 + 该票未指定应付(failed/pushed)
|
||||
canRepushInvoice(row) {
|
||||
return (
|
||||
!this.editable &&
|
||||
this.form.settlementType !== 'receivable' &&
|
||||
this.form.approvalStatus === 'approved' &&
|
||||
this.form.kingdeeSyncStatus === 'synced' &&
|
||||
['failed', 'pushed'].includes(row.kingdeePushStatus || '')
|
||||
);
|
||||
},
|
||||
// 重推 = 收票单A303-2 + 指定应付A302-6 一步式,服务端返回结果描述;完成后重载详情刷新状态
|
||||
async repushInvoice(row) {
|
||||
try {
|
||||
await this.$confirm(`确认重新推送发票${row.invoiceNo || ''}到金蝶并指定应付?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
});
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
this.repushing = true;
|
||||
try {
|
||||
const data = this.unwrapData(
|
||||
await repushClaimedInvoice(this.form.id, row.invoiceNo)
|
||||
);
|
||||
this.$message.success(data || '重新推送成功');
|
||||
await this.loadFormalDetail(this.form.id);
|
||||
} finally {
|
||||
this.repushing = false;
|
||||
}
|
||||
},
|
||||
async handleInvoiceReceiptConfirm(rows) {
|
||||
// 收票单行 → 结算单发票行:匹配金额固定=发票金额(全额认领),附件契约归一为单数 attachmentJson
|
||||
const invoices = rows.map(row => ({
|
||||
|
||||
Reference in New Issue
Block a user