浏览代码

feat: 安装增加费取默认定额ID

zhangweicheng 4 年之前
父节点
当前提交
3d724cf146
共有 1 个文件被更改,包括 9 次插入7 次删除
  1. 9 7
      modules/main/facade/installation_facade.js

+ 9 - 7
modules/main/facade/installation_facade.js

@@ -90,13 +90,15 @@ async function copyInstallationFeeFromLib(projectID,engineering_id) {
     let ration_lib = engineering.ration_lib;
     let installationFeeList = [];
     for(let rl of ration_lib){
-        let newInstallationFee = await getInstallationFeeFromLib(rl.id);
-        if(newInstallationFee){
-            newInstallationFee.libID = rl.id;
-            newInstallationFee.libName = rl.name;
-            newInstallationFee.projectID = projectID;
-            newInstallationFee.ID = uuidV1();
-            installationFeeList.push(newInstallationFee);
+        if(rl.isDefault === true){//取默认的定额库ID;
+            let newInstallationFee = await getInstallationFeeFromLib(rl.id);
+            if(newInstallationFee){
+                newInstallationFee.libID = rl.id;
+                newInstallationFee.libName = rl.name;
+                newInstallationFee.projectID = projectID;
+                newInstallationFee.ID = uuidV1();
+                installationFeeList.push(newInstallationFee);
+            }
         }
     }
     if(installationFeeList.length > 0){