Просмотр исходного кода

1、修复加锁解锁功能失效问题

iggy недель назад: 2
Родитель
Сommit
b937630ae0

+ 6 - 6
JLHWEB/src/routers/index.ts

@@ -87,9 +87,9 @@ router.beforeEach(async (to, from, next) => {
   authStore.setRouteName(to.name as string);
 
   // 8.如果需要加锁的路由,进入时尝试加锁
-  if (to.meta.needLock && Number(to.params.id)) {
+  if (to.meta.needLock && Number(to.query.id)) {
     try {
-      await LockBill({ keyword: String(to.meta.billtype), billid: Number(to.params.id), billcode: String(to.params.code) });
+      await LockBill({ keyword: String(to.meta.billtype), billid: Number(to.query.id), billcode: String(to.query.code) });
     } catch (err) {
       return next(false);
     }
@@ -137,15 +137,15 @@ router.afterEach(async (to, from) => {
   }
 
   // 2. 如果来源页面是需要加锁的,离开时解锁
-  if (from.meta.needLock && Number(from.params.id)) {
+  if (from.meta.needLock && Number(from.query.id)) {
     try {
       await UnLockBill({
         keyword: String(from.meta.billtype),
-        billid: Number(from.params.id),
-        billcode: String(from.params.code)
+        billid: Number(from.query.id),
+        billcode: String(from.query.code)
       });
     } catch (err) {
-      console.warn("解锁失败:", from.meta.billtype, from.params.id, err);
+      console.warn("解锁失败:", from.meta.billtype, from.query.id, err);
     }
   }
 

+ 2 - 0
JLHWEB/src/views/erpapi/mattressInterface/detail.vue

@@ -695,6 +695,7 @@ const orderDefaultAction = [
           code: _cur.mattresscode
         },
         query: {
+          id: _cur.mattressid,
           code: _cur.mattresscode
         },
         replace: true
@@ -1289,6 +1290,7 @@ const routeToEdit = async (type: any) => {
       code: _cur.mattresscode
     },
     query: {
+      id: _cur.mattressid,
       code: _cur.mattresscode,
       type: type
     },

+ 1 - 0
JLHWEB/src/views/erpapi/mattressInterface/index.vue

@@ -356,6 +356,7 @@ const routeToEdit = async type => {
       code: _cur.mattresscode
     },
     query: {
+      id: _cur.mattressid,
       code: _cur.mattresscode,
       type: type
     }

+ 1 - 0
JLHWEB/src/views/quote/mattressQuote/hooks/index.tsx

@@ -6063,6 +6063,7 @@ export const useHooks = (t?: any) => {
         code: _cur.mattresscode
       },
       query: {
+        id: _cur.mattressid,
         code: _cur.mattresscode,
         type: type
       }