fix: 修复带detailNo跳转正式结算单时缓存实例重复弹出查看弹框
This commit is contained in:
@@ -253,6 +253,10 @@ export default {
|
|||||||
if (detailNo) this.openRouteDetail(detailNo);
|
if (detailNo) this.openRouteDetail(detailNo);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
// 标签机制按 fullPath 缓存同页多实例:仅当前路由实例应响应 detailNo 跳转,防止缓存旧实例也弹窗
|
||||||
|
this.ownFullPath = this.$route.fullPath;
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadOrganizationOptions();
|
this.loadOrganizationOptions();
|
||||||
this.loadTable();
|
this.loadTable();
|
||||||
@@ -342,7 +346,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async openRouteDetail(detailNo = this.$route.query.detailNo) {
|
async openRouteDetail(detailNo = this.$route.query.detailNo) {
|
||||||
const formalSettlementNo = String(detailNo || '').trim();
|
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 response = await api.getList(1, 10, { formalSettlementNo });
|
||||||
const data = this.unwrapData(response);
|
const data = this.unwrapData(response);
|
||||||
const row = (data.records || []).find(item => item.formalSettlementNo === formalSettlementNo);
|
const row = (data.records || []).find(item => item.formalSettlementNo === formalSettlementNo);
|
||||||
|
|||||||
Reference in New Issue
Block a user