Ver código fonte

广东建筑,计取安装增加费时,当“统一设置计取安装费用”窗口中选择的费用类型为“措施费用”,在造价书界面生成子目的取费专业应默认为“安装费用(措施)”

vian 5 anos atrás
pai
commit
3d8ba9b4c9

+ 8 - 2
web/building_saas/main/js/models/installation_fee.js

@@ -546,7 +546,7 @@ var installation_fee = {
 
             function allInOne(item,rule,rations,newBills,pre_key,rationKeyMap) {//统一设置
                 let billData = getBillNodeData(item,rule,newBills);//取对应的清单或生成一个新的清单数据
-                let newRationData = createNewRationData(billData.ID,-1,rule);
+                let newRationData = createNewRationData(billData.ID,-1,rule, item.feeType);
                 let gljDecimal = getDecimal('glj.quantity');
                 let labourSum = 0,materialSum =0,machineSum = 0;
                 for(let r of rations){//措施费用的情况下,多条定额生成一条安装子目
@@ -572,7 +572,7 @@ var installation_fee = {
                 return rationData;
             }
 
-            function createNewRationData(billItemID,nextID,rule) {
+            function createNewRationData(billItemID,nextID,rule,feeType) {
                 let br = project.Ration.getBillsSortRation(billItemID);
                 let serialNo = 0;
                 if(billSerialMap[billItemID]){
@@ -584,6 +584,12 @@ var installation_fee = {
                 serialNo = br.length > 0 ? br[br.length - 1].serialNo + 1 : 1;
                 let newRationData = project.Ration.getTempRationData(project.Ration.getNewRationID(), billItemID, serialNo, rationType.install);
                 newRationData = setNewRationProperty(newRationData,nextID,rule);
+                if (feeType && feeType === '措施费用') {
+                    const installationMeasure = project.calcProgram.templates.find(item => item.name === '安装费用(措施)');
+                    if (installationMeasure) {
+                        newRationData.programID = installationMeasure.ID;
+                    }
+                }
                 return newRationData;
             }
             function getBillNodeData(item,rule,newBills) {