fix: 收票登记提交返回列表后刷新列表数据

This commit is contained in:
刘泉佳
2026-11-02 16:36:00 +08:00
parent bd9da83175
commit f5735e6bad
2 changed files with 29 additions and 0 deletions
@@ -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() {
+25
View File
@@ -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;
},