From 422aea7677145bc4f61f10436353d9e62d80fff5 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 25 三月 2026 16:59:35 +0800
Subject: [PATCH] 过程检验列表加上不良数量、合格数量字段。过程检验编辑页面也加上不良数量、合格数量字段,不良数量输入框手填,合格数量,数量输入框置灰,根据根据不良数量+合格数量=数量这一逻辑计算。若不填默认不良数量为0。数量是订单本次生产数量-报废数量

---
 src/utils/dict.js |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/utils/dict.js b/src/utils/dict.js
index 0f9144a..a6db068 100644
--- a/src/utils/dict.js
+++ b/src/utils/dict.js
@@ -1,17 +1,24 @@
+import useDictStore from '@/store/modules/dict'
 import { getDicts } from '@/api/system/dict/data'
 
 /**
  * 鑾峰彇瀛楀吀鏁版嵁
  */
 export function useDict(...args) {
-  const res = ref({});
+  const res = ref({})
   return (() => {
-    args.forEach((d, index) => {
-      res.value[d] = [];
-      getDicts(d).then(resp => {
-        res.value[d] = resp.data.map(p => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.listClass, elTagClass: p.cssClass }))
-      })
+    args.forEach((dictType, index) => {
+      res.value[dictType] = []
+      const dicts = useDictStore().getDict(dictType)
+      if (dicts) {
+        res.value[dictType] = dicts
+      } else {
+        getDicts(dictType).then(resp => {
+          res.value[dictType] = resp.data.map(p => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.listClass, elTagClass: p.cssClass }))
+          useDictStore().setDict(dictType, res.value[dictType])
+        })
+      }
     })
-    return toRefs(res.value);
+    return toRefs(res.value)
   })()
 }
\ No newline at end of file

--
Gitblit v1.9.3