Browse Source

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

zhangweicheng 4 years ago
parent
commit
3d724cf146
1 changed files with 9 additions and 7 deletions
  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 ration_lib = engineering.ration_lib;
     let installationFeeList = [];
     let installationFeeList = [];
     for(let rl of ration_lib){
     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){
     if(installationFeeList.length > 0){