From 888241ae6843e4e74f4da971b9daabdf57bed7fd Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期三, 26 十一月 2025 16:02:04 +0800
Subject: [PATCH] 1.修改生产工单中   总可报数量值bug

---
 src/permission.js                     |   41 +++++++++++++++++++++++------------------
 src/views/workOrder/workOrderList.vue |   14 +++++++++++---
 2 files changed, 34 insertions(+), 21 deletions(-)

diff --git a/src/permission.js b/src/permission.js
index 7842d41..110ebfb 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -33,28 +33,33 @@
         next()
       } else {
         try {
-          // 鎷夊彇info
-          // const info = await store.dispatch('user/getInfo')
+          if (whiteList.indexOf(to.path) !== -1) {
+            // in the free login whitelist, go directly
+            next()
+          } else {
+            // 鎷夊彇info
+            // const info = await store.dispatch('user/getInfo')
 
-          // jwt瑙e瘑鑾峰彇鐢ㄦ埛缂栫爜
-          const jwt = decode(localStorage.getItem('token'))
-          localStorage.setItem('usercode', jwt.usercode)
-          localStorage.setItem('username', jwt.username)
-          localStorage.setItem('torg_name', jwt.storg_name)
-          localStorage.setItem('torg_code', jwt.storg_code)
-          localStorage.setItem('mesSetting', jwt.mesSetting)
+            // jwt瑙e瘑鑾峰彇鐢ㄦ埛缂栫爜
+            const jwt = decode(localStorage.getItem('token'))
+            localStorage.setItem('usercode', jwt.usercode)
+            localStorage.setItem('username', jwt.username)
+            localStorage.setItem('torg_name', jwt.storg_name)
+            localStorage.setItem('torg_code', jwt.storg_code)
+            localStorage.setItem('mesSetting', jwt.mesSetting)
 
-          // 鎷夊彇鑿滃崟淇℃伅琛�
-          const menu = await store.dispatch('user/getMenu')
-          // 鐢熸垚鍙闂殑璺敱琛�
-          await store.dispatch('permission/generateRoutes', menu)
-          // 鍔ㄦ�佹坊鍔犲彲璁块棶璺敱琛�
-          router.addRoutes(store.getters.addRouters)
+            // 鎷夊彇鑿滃崟淇℃伅琛�
+            const menu = await store.dispatch('user/getMenu')
+            // 鐢熸垚鍙闂殑璺敱琛�
+            await store.dispatch('permission/generateRoutes', menu)
+            // 鍔ㄦ�佹坊鍔犲彲璁块棶璺敱琛�
+            router.addRoutes(store.getters.addRouters)
 
-          // hack鏂规硶 纭繚addRoutes宸插畬鎴�
-          next({ ...to, replace: true })
+            // hack鏂规硶 纭繚addRoutes宸插畬鎴�
+            next({ ...to, replace: true })
 
-          // next()
+            // next()
+          }
         } catch (error) {
           // remove token and go to login page to re-login
           await store.dispatch('user/resetToken')
diff --git a/src/views/workOrder/workOrderList.vue b/src/views/workOrder/workOrderList.vue
index f9ed3a2..7e53a57 100644
--- a/src/views/workOrder/workOrderList.vue
+++ b/src/views/workOrder/workOrderList.vue
@@ -505,6 +505,7 @@
 
       <div class="elTableDiv">
         <el-table
+          ref="tableDataRef2"
           :data="tableDataDetail"
           border
           height="210px"
@@ -3004,7 +3005,9 @@
         // do something with the new and old value of stepSelectedValue
         console.log(val, 1)
         console.log(this.stepTableData, 3)
+
         const arr = JSON.parse(JSON.stringify(this.stepTableData))
+        console.log(arr, 33, this.dialogForm.mesqty)
         const arrStepcode = arr.map(i => i.stepcode)
         this.stepTableData = []
         val.forEach(i => {
@@ -3119,7 +3122,8 @@
         if (i.stepdata.length > 0) {
           i.stepdata.forEach(j => {
             j.ratio = parseFloat(j.ratio) > 0 ? parseFloat(j.ratio) : 0
-            j.sumqty = Math.round(parseFloat(i.canupdate_qty) * (1 + (parseFloat(j.ratio) > 0 ? parseFloat(j.ratio) / 100 : 0)))
+            // j.sumqty = Math.round(parseFloat(i.canupdate_qty) * (1 + (parseFloat(j.ratio) > 0 ? parseFloat(j.ratio) / 100 : 0)))
+            j.sumqty = Math.round(parseFloat(this.formData3[index].mesqty) * (1 + (parseFloat(j.ratio) > 0 ? parseFloat(j.ratio) / 100 : 0)))
           })
           this.formData3[index].stepTableData = i.stepdata
           this.formData3[index].stepSelectedValue = i.stepdata.map(j => j.stepcode)
@@ -3700,7 +3704,8 @@
                 stepname: i.stepname,
                 stepprice: i.stepprice,
                 ratio: parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) : 0,
-                sumqty: Math.round(parseFloat(res.canupdate_qty) * (1 + (parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) / 100 : 0)))
+                // sumqty: Math.round(parseFloat(res.canupdate_qty) * (1 + (parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) / 100 : 0)))
+                sumqty: Math.round(parseFloat(this.dialogForm.mesqty) * (1 + (parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) / 100 : 0)))
               }
             )
           })
@@ -3734,7 +3739,8 @@
                 stepname: i.stepname,
                 stepprice: i.stepprice,
                 ratio: parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) : 0,
-                sumqty: Math.round(parseFloat(res.canupdate_qty) * (1 + (parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) / 100 : 0)))
+                // sumqty: Math.round(parseFloat(res.canupdate_qty) * (1 + (parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) / 100 : 0)))
+                sumqty: Math.round(parseFloat(this.dialogForm.mesqty) * (1 + (parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) / 100 : 0)))
               }
             )
           })
@@ -4009,6 +4015,7 @@
         }
         this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
         this.$refs.tableDataRef.doLayout()
+        this.$refs.tableDataRef2.doLayout()
       })
     },
     // 宸ヨ壓璺嚎鏀惧ぇ闀滅偣鍑�
@@ -4552,6 +4559,7 @@
 
       this.$nextTick(() => {
         this.$refs.tableDataRef.doLayout()
+        this.$refs.tableDataRef2.doLayout()
       })
       return sums
     }

--
Gitblit v1.9.3