|
|
@@ -340,6 +340,15 @@ export const useKeepAliveStore = defineStore({
|
|
|
tabStore.setTabs(tabsMenuList);
|
|
|
|
|
|
// 移除编辑页的 keepAlive 缓存(removeKeepAliveName 已包含解锁逻辑)
|
|
|
+ console.log("情况1解锁检查:", {
|
|
|
+ oldEditTab: {
|
|
|
+ path: oldEditTab.path,
|
|
|
+ needLock: oldEditTab.needLock,
|
|
|
+ billid: oldEditTab.billid,
|
|
|
+ keyword: oldEditTab.keyword,
|
|
|
+ billcode: oldEditTab.billcode
|
|
|
+ }
|
|
|
+ });
|
|
|
this.removeKeepAliveName(oldEditTab);
|
|
|
|
|
|
isReplace = true;
|
|
|
@@ -418,9 +427,20 @@ export const useKeepAliveStore = defineStore({
|
|
|
tabsMenuList[editTabIndex] = tabsParams;
|
|
|
tabStore.setTabs(tabsMenuList);
|
|
|
|
|
|
- // 移除编辑页的 keepAlive 缓存(removeKeepAliveName 已包含解锁逻辑)
|
|
|
+ // 移除编辑页的 keepAlive 缓存
|
|
|
this.removeKeepAliveName(from);
|
|
|
|
|
|
+ // 手动解锁单据(因为 from 路由对象可能缺少锁定属性,需要单独处理)
|
|
|
+ if (from.meta?.needLock && from.query?.id) {
|
|
|
+ UnLockBill({
|
|
|
+ keyword: String(from.meta.billtype),
|
|
|
+ billid: Number(from.query.id),
|
|
|
+ billcode: String(from.query.code)
|
|
|
+ }).catch(err => {
|
|
|
+ console.warn("edit->detail 解锁失败:", err);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
isReplace = true;
|
|
|
to.meta.isKeepAlive && this.addKeepAliveName(to);
|
|
|
to.meta.isKeepAlive && this.updateKeepAliveName(to);
|