Procházet zdrojové kódy

fix: 清单精灵配置材料,应仅显示材料大类、主材和设备

vian před 3 roky
rodič
revize
bc323c1d45
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. 3 2
      modules/std_billsGuidance_lib/facade/facades.js

+ 3 - 2
modules/std_billsGuidance_lib/facade/facades.js

@@ -415,7 +415,7 @@ async function updateItems(updateDatas) {
 
 // 获取清单材料数据
 async function getBillMaterials(libID, billID) {
-    // 指引下已有定额人材机
+    // 指引下已有定额人材机(材料大类)
     let allGljList = [];
     const rationItems = await billsGuideItemsModel.find({ libID, billsID: billID, rationID: { $ne: null } }, '-_id rationID').lean();
     if (rationItems.length) {
@@ -428,7 +428,8 @@ async function getBillMaterials(libID, billID) {
             }
         });
         if (gljIDs.length) {
-            allGljList = await gljModel.find({ ID: { $in: [...new Set(gljIDs)] } }, '-_id ID code name specs').lean();
+            allGljList = await gljModel.find({ ID: { $in: [...new Set(gljIDs)] } }, '-_id ID code name specs gljType').lean();
+            allGljList = allGljList.filter(glj => /^2/.test(glj.gljType) || [4, 5].includes(glj.gljType));
         }
     }
     // 清单材料