Browse Source

feat: 安装增加费验证

zhangweicheng 4 years ago
parent
commit
2dce5efd5c

+ 1 - 1
modules/ration_glj/facade/glj_calculate_facade.js

@@ -305,7 +305,7 @@ function generateAdjustState(glj,coeList,adjustState,gljList,quantity) {
         displayQuantity = displayQuantity&&displayQuantity!=""?parseFloat(displayQuantity):0;
         adjustState.push({index:stateSeq.add,content:'添'+glj.code+'量'+ displayQuantity,type:"添"+glj.code});
     }
-    // to do
+  
 
   //标准附注条件调整 + 自定义乘系数
     if(_.last(gljList).ID == glj.ID){//最后一个工料机的时候才生成,生成一次就可以了

+ 13 - 10
web/building_saas/main/js/models/ration.js

@@ -407,10 +407,10 @@ var Ration = {
             let selectedLib = (cleanzmhs == true && recodes.length > 0)? recodes[0].node.data.libID : sessionStorage.getItem("stdRationLib");
             selectedLib&&selectedLib!='undefined'?libIDs.unshift(selectedLib):libIDs.unshift(defaultLibID);
             for(let r of recodes){
-                let needInstall = false;
-                if(projectObj.project.isInstall()) {//如果是安装工程,要看需不需要生成安装增加费
+                let needInstall = projectObj.project.isInstall();
+               /*  if(projectObj.project.isInstall()) {//如果是安装工程,要看需不需要生成安装增加费
                     needInstall = project.Bills.isFBFX(r.node);
-                }
+                } */
                 r.value===null||r.value===undefined?"":r.value = r.value.replace(/[\s\r\n]/g, "");//去掉空格回车换行等字符
                 if(cleanzmhs  == true||r.value != r.node.data.code){
                     nodeInfo.push({ID:r.node.data.ID,billsItemID:r.node.data.billsItemID,newCode:r.value,needInstall:needInstall});
@@ -479,10 +479,11 @@ var Ration = {
             };
             if(billItemID){
                 let calQuantity = optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'rationQuanACToBillsQuan');
-                if(projectObj.project.isInstall()) {//如果是安装工程,要看需不需要生成安装增加费
+                needInstall = projectObj.project.isInstall();
+                /* if(projectObj.project.isInstall()) {//如果是安装工程,要看需不需要生成安装增加费
                     let billsNode = project.mainTree.getNodeByID(billItemID);
                     needInstall = project.Bills.isFBFX(billsNode);//在分部分项插入的定额才需要定额安装增加费
-                }
+                } */
                 for(let i = 0; i < items.length; i++){
                     let newData = me.getTempRationData(me.getNewRationID(), billItemID, serialNo, items[i].rationType);
                     serialNo++;
@@ -612,10 +613,11 @@ var Ration = {
                         brUpdate.push({projectID:newData.projectID,ID:br[i].ID,serialNo:br[i].serialNo});
                     }
                 }
-                if(projectObj.project.isInstall()) {//如果是安装工程,要看需不需要生成安装增加费
+                needInstall = projectObj.project.isInstall();
+               /*  if(projectObj.project.isInstall()) {//如果是安装工程,要看需不需要生成安装增加费
                     let billsNode = project.mainTree.getNodeByID(billItemID);
                     needInstall = project.Bills.isFBFX(billsNode);//在分部分项插入的定额才需要定额安装增加费
-                }
+                } */
                 if(ext) gljUtil.setProperty(newData,ext);
                 $.bootstrapLoading.start();
                 CommonAjax.post("/ration/addNewRation",{projectID:me.project.ID(),itemQuery:itemQuery,newData:newData,defaultLibID: rationLibObj.getDefaultStdRationLibID(),calQuantity:calQuantity,brUpdate:brUpdate,needInstall:needInstall},function (data) {
@@ -701,14 +703,15 @@ var Ration = {
                         brUpdate.push({projectID:newData.projectID,ID:br[i].ID,serialNo:br[i].serialNo});
                     }
                 }
-                if(projectObj.project.isInstall()) {//如果是安装工程,要看需不需要生成安装增加费
+                needInstall = projectObj.project.isInstall();
+               /*  if(projectObj.project.isInstall()) {//如果是安装工程,要看需不需要生成安装增加费
                     let billsNode = project.mainTree.getNodeByID(billItemID);
-                }
+                } */
                 $.bootstrapLoading.start();
                 newNode = project.mainTree.insert(billItemID, nextID, newID);
                 newNode.sourceType = project.Ration.getSourceType();
                 newNode.data = newData;
-                CommonAjax.post("/ration/addNewRation",{itemQuery:null,newData:newData,defaultLibID: rationLibObj.getDefaultStdRationLibID(),calQuantity:false,brUpdate:brUpdate,needInstall:false},function (data) {
+                CommonAjax.post("/ration/addNewRation",{itemQuery:null,newData:newData,defaultLibID: rationLibObj.getDefaultStdRationLibID(),calQuantity:false,brUpdate:brUpdate,needInstall:needInstall},function (data) {
                     //更新缓存
                     me.datas.push(data.ration);
                     me.addSubListOfRation(data);

+ 3 - 3
web/building_saas/main/js/views/mbzm_view.js

@@ -437,10 +437,10 @@ let mbzm_obj={
     },
     getDefaultRationCreateData:function(newData,code,libID,isFBFX){
         let itemQuery = {userID: userID, rationRepId: libID, code: code};
-        let needInstall = false;
-        if(projectObj.project.isInstall()) {//如果是安装工程,要看需不需要生成安装增加费
+        let needInstall = projectObj.project.isInstall();
+       /*  if(projectObj.project.isInstall()) {//如果是安装工程,要看需不需要生成安装增加费
             needInstall = isFBFX;//在分部分项插入的定额才需要定额安装增加费
-        }
+        } */
         return{itemQuery:itemQuery,newData:newData,defaultLibID: rationLibObj.getDefaultStdRationLibID(),calQuantity:false,brUpdate:[],needInstall:needInstall}
     },
 /*    getQuantity:function (data) {//取最新的消耗量,需经过转换