Selaa lähdekoodia

feat: 概算汇总,工程费用金额、设备购置金额根据接口获取

vian 4 vuotta sitten
vanhempi
commit
70a14bb470
1 muutettua tiedostoa jossa 7 lisäystä ja 7 poistoa
  1. 7 7
      modules/main/facade/bill_facade.js

+ 7 - 7
modules/main/facade/bill_facade.js

@@ -134,25 +134,25 @@ module.exports={
     // 获取单位工程ID 工程费用(费用汇总里的totalFee) 映射表
     getUnitsBudgetMap: async function (unitIDs) {
         const rst = {};
-        unitIDs.forEach(unitID => {
+        /* unitIDs.forEach(unitID => {
             rst[unitID] = 1000000;
-        });
-        /* const gatherData = await gatherModel.find({ projectID: { $in: unitIDs } }, '-_id projectID totalFee').lean();
+        }); */
+        const gatherData = await gatherModel.find({ projectID: { $in: unitIDs } }, '-_id projectID totalFee').lean();
         const gatherMap = {};
         gatherData.forEach(item => gatherMap[item.projectID] = item.totalFee || 0);
         unitIDs.forEach(unitID => {
             rst[unitID] = gatherMap[unitID] || 0;
-        }); */
+        });
         return rst;
     },
     // 获取设备购置费
     getUnitsEquipmentMap: async function (unitIDs) {
-        //return await equipmentFacade.getEquipmentTotalCost(unitIDs);
-        const rst = {};
+        /* const rst = {};
         unitIDs.forEach(unitID => {
             rst[unitID] = 5000;
         });
-        return rst;
+        return rst; */
+        return await equipmentFacade.getEquipmentTotalCost(unitIDs);
     },
     // 获取概算汇总初始化数据
     initialBudgetSummary: async function (constructionID) {