|
|
@@ -150,6 +150,7 @@ let divideObj = {
|
|
|
if(parentMap[r.ID] && parentMap[r.ID].length > 0){
|
|
|
for(let c of parentMap[r.ID]){
|
|
|
setItemsPrice(c);
|
|
|
+ c.quantity = scMathUtil.roundForObj(c.quantity,getDecimal("ration.quantity"));
|
|
|
datas.push(c);
|
|
|
}
|
|
|
}
|
|
|
@@ -160,10 +161,12 @@ let divideObj = {
|
|
|
|
|
|
function setItemsPrice(item){
|
|
|
if(item.fees){
|
|
|
+ let pre = "bills";
|
|
|
+ if(item.itemType == "定额") pre = "ration";
|
|
|
let commonFee = _.find(item.fees,{"fieldName":"common"})
|
|
|
if (commonFee){
|
|
|
- item.marketPrice = commonFee.unitFee;
|
|
|
- item.marketTotalFee = commonFee.totalFee;
|
|
|
+ item.marketPrice = scMathUtil.roundForObj(commonFee.unitFee,getDecimal(pre+".unitPrice"));
|
|
|
+ item.marketTotalFee = scMathUtil.roundForObj(commonFee.totalFee,getDecimal(pre+".totalPrice"));
|
|
|
}else{
|
|
|
delete item.marketPrice;
|
|
|
delete item.marketTotalFee;
|
|
|
@@ -588,7 +591,7 @@ let divideObj = {
|
|
|
let item = divideObj.getSelectedItem();
|
|
|
if(item.bills){
|
|
|
for(let b of item.bills){
|
|
|
- datas.push(b);
|
|
|
+ if(b.divideRate > 0) datas.push(b);
|
|
|
}
|
|
|
}
|
|
|
return datas;
|
|
|
@@ -1257,9 +1260,9 @@ let divideObj = {
|
|
|
let bNode = projectObj.project.mainTree.findNode(b.ID);
|
|
|
if(!bNode) continue;
|
|
|
let divideRate = scMathUtil.roundForObj(b.divideRate,3);
|
|
|
- let marketUnitFee = item.marketTotalFee?scMathUtil.roundForObj(item.marketTotalFee,getDecimal("bills.totalPrice")):0;
|
|
|
- let quantity = divideRate;//item.quantity?scMathUtil.roundForObj(item.quantity,3):0;
|
|
|
- //quantity = scMathUtil.roundForObj(quantity*divideRate,getDecimal("ration.quantity"))//量价数量为分摊项的数量*分摊比例
|
|
|
+ let marketUnitFee = item.marketPrice?scMathUtil.roundForObj(item.marketPrice,getDecimal("bills.unitPrice")):0;
|
|
|
+ let quantity = item.quantity?scMathUtil.roundForObj(item.quantity,3):0;
|
|
|
+ quantity = scMathUtil.roundForObj(quantity*divideRate,getDecimal("ration.quantity"))//量价数量为分摊项的数量*分摊比例
|
|
|
if(quantity > 0 && marketUnitFee > 0){
|
|
|
let serialNo = 0;
|
|
|
let preID = "";
|