Pārlūkot izejas kodu

fix: 获取基本信息调整

vian 4 gadi atpakaļ
vecāks
revīzija
b6fb032f49

+ 5 - 2
modules/pm/facade/pm_facade.js

@@ -2617,10 +2617,13 @@ async function getBasicInfo(compilationID, fileKind = null) {
     const billValuation = compilation.bill_valuation.find(function (data) {
         return data.enable;
     });
-    if (!billValuation) {
+    const rationValuation = compilation.ration_valuation.find(function (data) {
+        return data.enable;
+    });
+    if (!billValuation && !rationValuation) {
         return null;
     }
-    const engineerings = await engineeringModel.find({valuationID: billValuation.id}).lean();
+    const engineerings = await engineeringModel.find({valuationID: {$in: [billValuation.id, rationValuation.id] }, 'info_lib.0': {$exists: true}}).lean();
     const engineering = engineerings.find(function (data) {
         return data.info_lib && data.info_lib.length > 0;
     });

+ 1 - 0
web/building_saas/standard_interface/import/base.js

@@ -500,6 +500,7 @@ const INTERFACE_EXPORT_BASE = (() => {
     const projectCount = 1 + importData.tenders.length;
     // const feeName = compilationData.name === '安徽养护(2018)' ? '安徽养护' : '公路工程';
     // 一些接口需要根据导入文件,匹配工程专业库
+    debugger;
     const rationValuationData = rationValuation && JSON.parse(rationValuation)[0]; // 只有工程量清单才能导入接口
     if (!rationValuationData) {
       throw '无法获取工程量清单计价数据';