|
|
@@ -665,29 +665,19 @@ var gljOprObj = {
|
|
|
if (this.sheetData.length > 0) {
|
|
|
node = node ? node : projectObj.project.mainTree.selected;
|
|
|
let ration = node.data;
|
|
|
- let quantity = ration.quantity;
|
|
|
- quantity = (quantity == 0 || quantity == undefined || quantity == null || quantity == "") ? 0 : quantity;
|
|
|
for (let glj of this.sheetData) {
|
|
|
glj.totalQuantity= this.getTotalQuantity(glj,ration);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
getTotalQuantity:function(glj,ration){
|
|
|
+ if (glj.isMixRatio == true) return;//如果是用于显示的组成物,则不用计算,跳过
|
|
|
ration=ration?ration: _.find(projectObj.project.Ration.datas,{"ID":glj.rationID});
|
|
|
- if(ration){
|
|
|
- let quantity = ration.quantity;
|
|
|
- quantity = (quantity == 0 || quantity == undefined || quantity == null || quantity == "") ? 0 : quantity;
|
|
|
- if (glj.isMixRatio == true) {//如果是用于显示的组成物,则不用计算,跳过
|
|
|
- return;
|
|
|
- }
|
|
|
- quantity = scMathUtil.roundForObj(quantity, getDecimal("ration.quantity"));//计算前进行4舍5入
|
|
|
- glj.quantity = scMathUtil.roundForObj(glj.quantity, getDecimal("glj.quantity"));
|
|
|
- glj.totalQuantity = scMathUtil.roundToString(quantity * glj.quantity, getDecimal("glj.quantity"));
|
|
|
- if (glj.hasOwnProperty('subList')) {//需要计算glj下挂的组成物的总消耗量
|
|
|
- this.calcMixRationTotalQuantity(glj.subList,glj.totalQuantity);
|
|
|
- }
|
|
|
- return glj.totalQuantity;
|
|
|
+ glj.totalQuantity = gljUtil.getTotalQuantity(glj,ration,getDecimal("ration.quantity"),getDecimal("glj.quantity"));
|
|
|
+ if (glj.hasOwnProperty('subList')) {//需要计算glj下挂的组成物的总消耗量
|
|
|
+ this.calcMixRationTotalQuantity(glj.subList,glj.totalQuantity);
|
|
|
}
|
|
|
+ return glj.totalQuantity;
|
|
|
},
|
|
|
calcMixRationTotalQuantity(mList,pTotal){ //计算组成物的总消耗量
|
|
|
for (let subG of mList) {
|