Преглед изворни кода

1、修复床垫清单-配置信息刷新没有正常输出(核价物料顺序和清单补充顺序对不上)

MY пре 2 дана
родитељ
комит
5499bf6140

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

@@ -811,7 +811,7 @@ const orderDefaultAction = [
         return !orderStatus.value;
       },
       clickFunc: item => {
-        RefreshMattressInterfaceQdList(LjDetailRef.value?._mainData.mattressid, 1);
+        RefreshMattressInterfaceQdList(LjDetailRef.value?._mainData.mattressid, 0);
       }
     }),
     buttonDefault({
@@ -821,7 +821,7 @@ const orderDefaultAction = [
       },
       clickFunc: item => {
         fModelChoseMattress().then((res: any) => {
-          RefreshMattressInterfaceQdList(res.mattressid, 1, 0);
+          RefreshMattressInterfaceQdList(res.mattressid, 0, 0);
         });
       }
     }),

+ 37 - 1
JLHWEB/src/views/erpapi/mattressInterface/hooks/index.tsx

@@ -1870,7 +1870,43 @@ export const useHooks = (t?: any) => {
       }
     });
 
-    state.mattressQDList = res.mxList;
+    // 获取先有清单信息
+    const $table = state.QdTableRef?.element;
+    if ($table) {
+      let { visibleData } = $table.getTableData();
+      const copyMap = new Map();
+
+      visibleData.forEach(mx => {
+        const key = `${mx.itemname}|${mx.bj_pzname}|${mx.bj_pzname_mx}`;
+
+        if (!copyMap.has(key)) copyMap.set(key, mx);
+      });
+
+      res.mxList.forEach(mx => {
+        // 创建复合键(使用模板字符串生成唯一标识)
+        const key = `${mx.itemname}|${mx.bj_pzname}|${mx.bj_pzname_mx}`;
+
+        // 从Map中查找对应值(替代TryGetValue)
+        if (copyMap.has(key)) {
+          const mx2 = copyMap.get(key);
+
+          Object.assign(mx, {
+            erp_mtrlid: mx2.erp_mtrlid,
+            erp_mtrlcode: mx2.erp_mtrlcode,
+            erp_mtrlname: mx2.erp_mtrlname,
+            erp_mtrlmode: mx2.erp_mtrlmode,
+            erp_unit: mx2.erp_unit,
+            useqty: mx2.useqty,
+            actual_useqty: mx2.actual_useqty,
+            wrkgrpid: mx2.wrkgrpid,
+            qd_actual_size: mx2.qd_actual_size,
+            qd_pfgroupqty: mx2.qd_pfgroupqty,
+            dscrp: mx2.dscrp
+          });
+        }
+      });
+    }
+    // state.mattressQDList = res.mxList;
 
     resetMergeCellsQd();