|
|
@@ -40,7 +40,7 @@ function chkAndSetBillsUnitPrice(billsNodes) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function chkAndResetBills(adHocSheet) {
|
|
|
+function chkAndResetBills(adHocSheet, adHocNodes) {
|
|
|
//用户调整了工程特征后调用
|
|
|
for (let key in projectObj.project.mainTree.nodes) {
|
|
|
const node = projectObj.project.mainTree.nodes[key];
|
|
|
@@ -62,15 +62,22 @@ function chkAndResetBills(adHocSheet) {
|
|
|
}
|
|
|
if (adHocSheet) {
|
|
|
let rCount = adHocSheet.getRowCount();
|
|
|
- for (let idx = 0; idx < rCount; idx++) {
|
|
|
- let cell1 = adHocSheet.getCell(idx, 1);
|
|
|
- let cell2 = adHocSheet.getCell(idx, 2);
|
|
|
- let cell3 = adHocSheet.getCell(idx, 3);
|
|
|
- if (_chkIfEquals(node.data.code, cell1.value()) && _chkIfEquals(node.data.name, cell2.value()) && _chkIfEquals(node.data.unit, cell3.value())) {
|
|
|
- let cell4 = adHocSheet.getCell(idx, 4);
|
|
|
- unitFeeVal = unitFeeVal.toFixed(2);
|
|
|
- if (unitFeeVal === '0.00') unitFeeVal = '';
|
|
|
- cell4.value(unitFeeVal);
|
|
|
+ for (let aNode of adHocNodes) {
|
|
|
+ unitFeeVal = _commonChkAndSetPrice(aNode.data, false);
|
|
|
+ if (unitFeeVal !== 0) {
|
|
|
+ for (let idx = 0; idx < rCount; idx++) {
|
|
|
+ let cell1 = adHocSheet.getCell(idx, 1);
|
|
|
+ let cell2 = adHocSheet.getCell(idx, 2);
|
|
|
+ let cell3 = adHocSheet.getCell(idx, 3);
|
|
|
+ if (_chkIfEquals(aNode.data.code, cell1.value()) && _chkIfEquals(aNode.data.name, cell2.value()) && _chkIfEquals(aNode.data.unit, cell3.value())) {
|
|
|
+ let cell4 = adHocSheet.getCell(idx, 4);
|
|
|
+ unitFeeVal = unitFeeVal + 0.0000001; //前端四舍五入补偿用
|
|
|
+ unitFeeVal = unitFeeVal.toFixed(2);
|
|
|
+ if (unitFeeVal === '0.00') unitFeeVal = '';
|
|
|
+ cell4.value(unitFeeVal);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|