|
@@ -2,7 +2,6 @@
|
|
|
* Created by zhang on 2018/6/7.
|
|
* Created by zhang on 2018/6/7.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-
|
|
|
|
|
let gljUtil = {
|
|
let gljUtil = {
|
|
|
calcProjectGLJQuantity:function (projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal,_,scMathUtil,isReport) {
|
|
calcProjectGLJQuantity:function (projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal,_,scMathUtil,isReport) {
|
|
|
let project_gljs = projectGLJDatas.gljList, mixRatioMap = projectGLJDatas.mixRatioMap, com_electrovalence = projectGLJDatas.com_electrovalence;
|
|
let project_gljs = projectGLJDatas.gljList, mixRatioMap = projectGLJDatas.mixRatioMap, com_electrovalence = projectGLJDatas.com_electrovalence;
|
|
@@ -180,7 +179,7 @@ let gljUtil = {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
if(!pglj.is_adjust_price){
|
|
if(!pglj.is_adjust_price){
|
|
|
- tender_glj_quantity = this.getRationGLJTenderQuantity(rg,tem_ration,q_decimal,scMathUtil);
|
|
|
|
|
|
|
+ tender_glj_quantity = this.getRationGLJTenderQuantity(rg,tem_ration,q_decimal,scMathUtil,pglj);
|
|
|
tender_r_quantity = this.getRationTenderQuantity(tem_ration,q_decimal,scMathUtil);
|
|
tender_r_quantity = this.getRationTenderQuantity(tem_ration,q_decimal,scMathUtil);
|
|
|
}
|
|
}
|
|
|
let total = scMathUtil.roundForObj(glj_quantity*r_quantity, q_decimal);
|
|
let total = scMathUtil.roundForObj(glj_quantity*r_quantity, q_decimal);
|
|
@@ -204,7 +203,7 @@ let gljUtil = {
|
|
|
result.tenderQuantity = tender_qantity_sum;
|
|
result.tenderQuantity = tender_qantity_sum;
|
|
|
return result;
|
|
return result;
|
|
|
},
|
|
},
|
|
|
- getRationGLJTenderQuantity:function (ration_glj,ration,q_decimal,scMathUtil) {
|
|
|
|
|
|
|
+ getRationGLJTenderQuantity:function (ration_glj,ration,q_decimal,scMathUtil,projectGLJ) {
|
|
|
let coeMap = {
|
|
let coeMap = {
|
|
|
1:'labour', //人工
|
|
1:'labour', //人工
|
|
|
2:'material',//材料
|
|
2:'material',//材料
|
|
@@ -221,14 +220,12 @@ let gljUtil = {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
let coe = 1;
|
|
let coe = 1;
|
|
|
- if (!calcTools.isTenderProjectGLJ(ration_glj)){
|
|
|
|
|
- coe = 1;
|
|
|
|
|
- }
|
|
|
|
|
- else{
|
|
|
|
|
- coe = ration.quantityCoe&&this.isNotEmpty(ration.quantityCoe[coeField])?ration.quantityCoe[coeField]:1;
|
|
|
|
|
- coe = parseFloat(coe);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if(projectGLJ && projectGLJ.is_adjust_price == 1){
|
|
|
|
|
+ coe = ration.quantityCoe&&this.isNotEmpty(ration.quantityCoe[coeField])?ration.quantityCoe[coeField]:1;
|
|
|
|
|
+ coe = parseFloat(coe);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ coe = 1;
|
|
|
|
|
+ }
|
|
|
if (coe == 0) coe = 1;
|
|
if (coe == 0) coe = 1;
|
|
|
let glj_quantity = scMathUtil.roundForObj(ration_glj.quantity, q_decimal);
|
|
let glj_quantity = scMathUtil.roundForObj(ration_glj.quantity, q_decimal);
|
|
|
return scMathUtil.roundForObj(glj_quantity * coe,q_decimal);
|
|
return scMathUtil.roundForObj(glj_quantity * coe,q_decimal);
|
|
@@ -282,7 +279,7 @@ let gljUtil = {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
getFlag:function (b) {
|
|
getFlag:function (b) {
|
|
|
- return _.find(b.flags,{"fieldName":"fixed"});
|
|
|
|
|
|
|
+ return this._.find(b.flags,{"fieldName":"fixed"});
|
|
|
},
|
|
},
|
|
|
getGLJPrice:function (glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil,ext,tenderCoe, isReport) {
|
|
getGLJPrice:function (glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil,ext,tenderCoe, isReport) {
|
|
|
let result = {};
|
|
let result = {};
|
|
@@ -504,7 +501,8 @@ let gljUtil = {
|
|
|
quantity = (quantity == 0 || quantity == undefined || quantity == null || quantity == "") ? 0 : quantity;
|
|
quantity = (quantity == 0 || quantity == undefined || quantity == null || quantity == "") ? 0 : quantity;
|
|
|
quantity = scMathUtil.roundForObj(quantity, rd);//计算前进行4舍5入
|
|
quantity = scMathUtil.roundForObj(quantity, rd);//计算前进行4舍5入
|
|
|
glj.quantity = scMathUtil.roundForObj(glj.quantity, gd);
|
|
glj.quantity = scMathUtil.roundForObj(glj.quantity, gd);
|
|
|
- glj.tenderQuantity = this.getRationGLJTenderQuantity(glj, ration, gd, scMathUtil);
|
|
|
|
|
|
|
+ let pglj = calcTools.getProjectGLJ(glj);
|
|
|
|
|
+ glj.tenderQuantity = this.getRationGLJTenderQuantity(glj, ration, gd, scMathUtil,pglj);
|
|
|
|
|
|
|
|
return scMathUtil.roundToString(quantity * glj.quantity, gd);
|
|
return scMathUtil.roundToString(quantity * glj.quantity, gd);
|
|
|
}
|
|
}
|
|
@@ -637,4 +635,9 @@ let gljUtil = {
|
|
|
hasCompMaterial:[202, 203, 204],//有组成物的材料
|
|
hasCompMaterial:[202, 203, 204],//有组成物的材料
|
|
|
hasCompMachine:[301],//有组成物的机械
|
|
hasCompMachine:[301],//有组成物的机械
|
|
|
machineComposition:[201,302,303]//可以做为机械组成物的类型
|
|
machineComposition:[201,302,303]//可以做为机械组成物的类型
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+if (typeof module !== 'undefined') {
|
|
|
|
|
+ gljUtil._ = require("lodash");
|
|
|
|
|
+ module.exports = gljUtil;
|
|
|
}
|
|
}
|