diff --git a/src/views/payment/invoice-receipt-form.vue b/src/views/payment/invoice-receipt-form.vue index fe6d8b8..b9e6538 100644 --- a/src/views/payment/invoice-receipt-form.vue +++ b/src/views/payment/invoice-receipt-form.vue @@ -227,6 +227,9 @@ import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.v import { getMkPublicDetail } from '@/api/mk-process'; import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval'; +// 提交成功后带标记返回,列表页(keep-alive)据此重新拉取 +const invoiceReceiptListRefreshKey = 'invoice-receipt-list-refresh'; + const emptyForm = () => ({ id: null, invoiceNo: '', @@ -555,6 +558,7 @@ export default { mkEnabled: await loadMkEnabled().catch(() => false), }); this.$message.success('提交成功'); + sessionStorage.setItem(invoiceReceiptListRefreshKey, '1'); this.goBack(); }, async syncReferenceData() { diff --git a/src/views/payment/invoice-receipt.vue b/src/views/payment/invoice-receipt.vue index aed1115..0a15cd8 100644 --- a/src/views/payment/invoice-receipt.vue +++ b/src/views/payment/invoice-receipt.vue @@ -223,6 +223,10 @@ import organizationSearch from '@/mixins/organization-search'; import { getMKApprovalUrl } from '@/api/system/business-process'; import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval'; +// 表单提交成功后带标记返回,keep-alive 缓存的列表页据此重新拉取 +const invoiceReceiptListRefreshKey = 'invoice-receipt-list-refresh'; +const invoiceReceiptListRoute = '/payment/invoice-receipt'; + const emptyQuery = () => ({ invoiceNo: '', invoiceDate: '', @@ -281,7 +285,28 @@ export default { this.mkEnabled = false; }); }, + activated() { + this.consumeListRefreshFlag(); + }, + watch: { + $route(to, from) { + if ( + to.path === invoiceReceiptListRoute && + from?.path?.includes('/invoice-receipt/form') + ) { + this.consumeListRefreshFlag(); + } + }, + }, methods: { + /** 表单提交成功后带标记返回时,重新拉取列表 */ + consumeListRefreshFlag() { + if (!sessionStorage.getItem(invoiceReceiptListRefreshKey)) { + return; + } + sessionStorage.removeItem(invoiceReceiptListRefreshKey); + this.loadTable(); + }, hasPermission(code) { return this.permission?.[code] !== false; },