fix: 修复带detailNo跳转正式结算单时缓存实例重复弹出查看弹框

This commit is contained in:
刘泉佳
2026-10-17 16:34:08 +08:00
parent 4b165471e3
commit 73c12cc1c7
+5 -1
View File
@@ -253,6 +253,10 @@ export default {
if (detailNo) this.openRouteDetail(detailNo);
},
},
created() {
// 标签机制按 fullPath 缓存同页多实例:仅当前路由实例应响应 detailNo 跳转,防止缓存旧实例也弹窗
this.ownFullPath = this.$route.fullPath;
},
mounted() {
this.loadOrganizationOptions();
this.loadTable();
@@ -342,7 +346,7 @@ export default {
},
async openRouteDetail(detailNo = this.$route.query.detailNo) {
const formalSettlementNo = String(detailNo || '').trim();
if (!formalSettlementNo) return;
if (!formalSettlementNo || this.ownFullPath !== this.$route.fullPath) return;
const response = await api.getList(1, 10, { formalSettlementNo });
const data = this.unwrapData(response);
const row = (data.records || []).find(item => item.formalSettlementNo === formalSettlementNo);