|
@@ -341,18 +341,24 @@ let executeObj = {
|
|
if (!me.treeNode.data.gljList) return 0;
|
|
if (!me.treeNode.data.gljList) return 0;
|
|
let result = 0;
|
|
let result = 0;
|
|
for (let glj of me.treeNode.data.gljList) {
|
|
for (let glj of me.treeNode.data.gljList) {
|
|
- let price = 0;
|
|
|
|
|
|
+ let price = 0, temp = 0;
|
|
if (base.gljTypes.indexOf(glj.type) >= 0) {
|
|
if (base.gljTypes.indexOf(glj.type) >= 0) {
|
|
- if (base.calcType == baseCalcType.baseCalc){ price = parseFloat(glj["basePrice"]);}
|
|
|
|
- else if (base.calcType == baseCalcType.adjustCalc){price = parseFloat(glj["adjustPrice"]);}
|
|
|
|
- else if (base.calcType == baseCalcType.budgetCalc){price = parseFloat(glj["marketPrice"]);}
|
|
|
|
- else if (base.calcType == baseCalcType.diffCalc){
|
|
|
|
|
|
+ if (base.calcType == baseCalcType.diffCalc){
|
|
let aprice = glj["adjustPrice"] ? glj["adjustPrice"] : 0;
|
|
let aprice = glj["adjustPrice"] ? glj["adjustPrice"] : 0;
|
|
|
|
+ aprice = parseFloat(aprice);
|
|
let mprice = glj["marketPrice"] ? glj["marketPrice"] : 0;
|
|
let mprice = glj["marketPrice"] ? glj["marketPrice"] : 0;
|
|
- price = (parseFloat(mprice) - parseFloat(aprice)).toDecimal(decimalObj.process);
|
|
|
|
|
|
+ mprice = parseFloat(mprice);
|
|
|
|
+ temp = (glj["quantity"] * mprice).toDecimal(decimalObj.ration.unitPrice) - (glj["quantity"] * aprice).toDecimal(decimalObj.ration.unitPrice);
|
|
|
|
+ temp = temp.toDecimal(decimalObj.ration.unitPrice);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if (base.calcType == baseCalcType.baseCalc){ price = parseFloat(glj["basePrice"]);}
|
|
|
|
+ else if (base.calcType == baseCalcType.adjustCalc){price = parseFloat(glj["adjustPrice"]);}
|
|
|
|
+ else if (base.calcType == baseCalcType.budgetCalc){price = parseFloat(glj["marketPrice"]);}
|
|
|
|
+ temp = (glj["quantity"] * price).toDecimal(decimalObj.ration.unitPrice);
|
|
};
|
|
};
|
|
- result = result + (glj["quantity"] * price).toDecimal(decimalObj.process);
|
|
|
|
- result = (result).toDecimal(decimalObj.process);
|
|
|
|
|
|
+
|
|
|
|
+ result = (result + temp).toDecimal(decimalObj.ration.unitPrice);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return result;
|
|
return result;
|