|
@@ -45,7 +45,7 @@ let ration_glj = {
|
|
|
};
|
|
|
|
|
|
|
|
|
- ration_glj.prototype.getGatherGljArrByRations = function (rations, needOneBill, billQuantity) {
|
|
|
+ ration_glj.prototype.getGljArrByBill = function (treeNode, needOneBill) {
|
|
|
let result = [];
|
|
|
let clone = function (obj) {
|
|
|
if (obj === null) return null;
|
|
@@ -63,6 +63,13 @@ let ration_glj = {
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+ let nodeQ = calcTools.uiNodeQty(treeNode);
|
|
|
+ let q = nodeQ ? nodeQ : 1;
|
|
|
+ let allNodes = projectObj.project.Ration.getRationNodes(treeNode);
|
|
|
+ let rNodes = allNodes.filter(function (node) {return calcTools.isRationItem(node)});
|
|
|
+ let rations = rNodes.map(function (node) {return node.data});
|
|
|
+
|
|
|
for (let ration of rations) {
|
|
|
if (ration.type == rationType.volumePrice || ration.type == rationType.gljRation){
|
|
|
let glj = JSON.parse(JSON.stringify(ration));
|
|
@@ -77,12 +84,18 @@ let ration_glj = {
|
|
|
let rationGljs = projectObj.project.calcProgram.getGljArrByRation(ration);
|
|
|
for (let glj of rationGljs) {
|
|
|
let sameGlj = findGlj(glj, result);
|
|
|
+ let coe = calcTools.tenderCoe_GLJQty(treeNode, glj);
|
|
|
if (!sameGlj) {
|
|
|
sameGlj = clone(glj);
|
|
|
sameGlj.quantity = (sameGlj.quantity * ration.quantity).toDecimal(4);
|
|
|
+ // glj的 tenderQuantity = glj的quantity * 定额的quantity * glj的消耗量调整系数coe。
|
|
|
+ // 与定额的tenderQuantity无关,与定额的子目工程量调整系数coe无关。下面这里直接取数量即可,因为它在上一句已经乘过定额数量了。
|
|
|
+ sameGlj.tenderQuantity = (sameGlj.quantity * coe).toDecimal(4);
|
|
|
result.push(sameGlj);
|
|
|
} else {
|
|
|
sameGlj.quantity = sameGlj.quantity + (glj.quantity * ration.quantity).toDecimal(4);
|
|
|
+ sameGlj.tenderQuantity = sameGlj.tenderQuantity + (glj.quantity * coe).toDecimal(4);
|
|
|
+
|
|
|
sameGlj.totalQuantity = (parseFloat(sameGlj.totalQuantity) + parseFloat(glj.totalQuantity)).toDecimal(4);
|
|
|
}
|
|
|
}
|
|
@@ -107,8 +120,8 @@ let ration_glj = {
|
|
|
glj.type = glj.subType;
|
|
|
};
|
|
|
|
|
|
- // glj.quantity = (glj.quantity / billQuantity).toDecimal(decimalObj.glj.quantity);
|
|
|
- glj.quantity = (glj.quantity / billQuantity).toDecimal(decimalObj.process); // 广联达这里没有取舍
|
|
|
+ glj.quantity = (glj.quantity / q).toDecimal(decimalObj.process); // 广联达这里没有取舍
|
|
|
+ glj.tenderQuantity = (glj.tenderQuantity / q).toDecimal(decimalObj.process);
|
|
|
};
|
|
|
return oneBill;
|
|
|
}
|