|
@@ -67,15 +67,20 @@ var ration_glj = {
|
|
|
return null;
|
|
|
}
|
|
|
for (let ration of rations) {
|
|
|
- let rationGljs = this.getGljArrByRation(ration.ID);
|
|
|
- for (let glj of rationGljs) {
|
|
|
- let sameGlj = findGlj(glj, result);
|
|
|
- if (!sameGlj) {
|
|
|
- sameGlj = clone(glj);
|
|
|
- sameGlj.quantity = (sameGlj.quantity * ration.quantity).toDecimal(4);
|
|
|
- result.push(sameGlj);
|
|
|
- } else {
|
|
|
- sameGlj.quantity = sameGlj.quantity + (glj.quantity * ration.quantity).toDecimal(4);
|
|
|
+ if (ration.type == rationType.volumePrice || ration.type == rationType.gljRation){
|
|
|
+ result.push(ration);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ let rationGljs = this.getGljArrByRation(ration.ID);
|
|
|
+ for (let glj of rationGljs) {
|
|
|
+ let sameGlj = findGlj(glj, result);
|
|
|
+ if (!sameGlj) {
|
|
|
+ sameGlj = clone(glj);
|
|
|
+ sameGlj.quantity = (sameGlj.quantity * ration.quantity).toDecimal(4);
|
|
|
+ result.push(sameGlj);
|
|
|
+ } else {
|
|
|
+ sameGlj.quantity = sameGlj.quantity + (glj.quantity * ration.quantity).toDecimal(4);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -83,9 +88,20 @@ var ration_glj = {
|
|
|
result = gljOprObj.combineWithProjectGlj(result);
|
|
|
|
|
|
// 上面取的是清单下所有工料机的总量,我要算清单单价,所以要取单位清单的工料机数量,所以下面要除以清单数量。
|
|
|
- let oneBill = Array.from(result);
|
|
|
+ let oneBill = JSON.parse(JSON.stringify(result));
|
|
|
+
|
|
|
for (let glj of oneBill){
|
|
|
- glj.quantity = (glj.quantity / billQuantity).toDecimal(decimalObj.glj.quantity);
|
|
|
+ if (glj.type == rationType.volumePrice){ // 量价、工料机形式的定额要进行数据变换才能参与基数计算。
|
|
|
+ glj.type = glj.subType;
|
|
|
+ glj.basePrice = glj.marketUnitFee;
|
|
|
+ glj.marketPrice = glj.marketUnitFee;
|
|
|
+ glj.adjustPrice = glj.marketUnitFee;
|
|
|
+ }
|
|
|
+ else if (glj.type == rationType.gljRation){
|
|
|
+ glj.type = glj.subType;
|
|
|
+ };
|
|
|
+
|
|
|
+ glj.quantity = (glj.quantity / billQuantity).toDecimal(decimalObj.glj.quantity);
|
|
|
};
|
|
|
return oneBill;
|
|
|
}
|