|
@@ -185,14 +185,15 @@ $(document).ready(() => {
|
|
// 台账树结构计算相关设置
|
|
// 台账树结构计算相关设置
|
|
stageTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'postil', 'used', 'contract_expr'];
|
|
stageTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'postil', 'used', 'contract_expr'];
|
|
stageTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp',
|
|
stageTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp',
|
|
- 'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp'];
|
|
|
|
|
|
+ 'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp', 'end_correct_tp'];
|
|
stageTreeSetting.calcFun = function (node) {
|
|
stageTreeSetting.calcFun = function (node) {
|
|
- if (node.children && node.children.length === 0) {
|
|
|
|
|
|
+ if (!node.children || node.children.length === 0) {
|
|
node.pre_gather_qty = ZhCalc.add(node.pre_contract_qty, node.pre_qc_qty);
|
|
node.pre_gather_qty = ZhCalc.add(node.pre_contract_qty, node.pre_qc_qty);
|
|
node.gather_qty = ZhCalc.add(node.contract_qty, node.qc_qty);
|
|
node.gather_qty = ZhCalc.add(node.contract_qty, node.qc_qty);
|
|
node.end_contract_qty = ZhCalc.add(node.pre_contract_qty, node.contract_qty);
|
|
node.end_contract_qty = ZhCalc.add(node.pre_contract_qty, node.contract_qty);
|
|
node.end_qc_qty = ZhCalc.add(node.pre_qc_qty, node.qc_qty);
|
|
node.end_qc_qty = ZhCalc.add(node.pre_qc_qty, node.qc_qty);
|
|
node.end_gather_qty = ZhCalc.add(node.pre_gather_qty, node.gather_qty);
|
|
node.end_gather_qty = ZhCalc.add(node.pre_gather_qty, node.gather_qty);
|
|
|
|
+ node.end_correct_tp = ZhCalc.add(node.end_qc_tp, ZhCalc.mul(node.end_contract_qty, node.unit_price, tenderInfo.decimal.tp));
|
|
}
|
|
}
|
|
node.pre_gather_tp = ZhCalc.add(node.pre_contract_tp, node.pre_qc_tp);
|
|
node.pre_gather_tp = ZhCalc.add(node.pre_contract_tp, node.pre_qc_tp);
|
|
node.gather_tp = ZhCalc.add(node.contract_tp, node.qc_tp);
|
|
node.gather_tp = ZhCalc.add(node.contract_tp, node.qc_tp);
|
|
@@ -201,6 +202,7 @@ $(document).ready(() => {
|
|
node.end_gather_tp = ZhCalc.add(node.pre_gather_tp, node.gather_tp);
|
|
node.end_gather_tp = ZhCalc.add(node.pre_gather_tp, node.gather_tp);
|
|
node.end_final_tp = ZhCalc.add(node.end_qc_tp, node.total_price);
|
|
node.end_final_tp = ZhCalc.add(node.end_qc_tp, node.total_price);
|
|
node.end_gather_percent = ZhCalc.mul(ZhCalc.div(node.end_gather_tp, node.end_final_tp), 100, 2);
|
|
node.end_gather_percent = ZhCalc.mul(ZhCalc.div(node.end_gather_tp, node.end_final_tp), 100, 2);
|
|
|
|
+ node.end_correct_percent = ZhCalc.mul(ZhCalc.div(node.end_correct_tp, node.end_final_tp), 100, 2);
|
|
node.final_dgn_price = ZhCalc.round(ZhCalc.div(node.end_gather_tp, ZhCalc.add(node.deal_dgn_qty1, node.c_dgn_qty1)), tenderInfo.decimal.up);
|
|
node.final_dgn_price = ZhCalc.round(ZhCalc.div(node.end_gather_tp, ZhCalc.add(node.deal_dgn_qty1, node.c_dgn_qty1)), tenderInfo.decimal.up);
|
|
};
|
|
};
|
|
const stageTree = createNewPathTree('stage', stageTreeSetting);
|
|
const stageTree = createNewPathTree('stage', stageTreeSetting);
|
|
@@ -3774,5 +3776,11 @@ $(document).ready(() => {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
stageTreeSpreadObj.measureByBatch(posName, ratio, apply2sibling);
|
|
stageTreeSpreadObj.measureByBatch(posName, ratio, apply2sibling);
|
|
|
|
+ });
|
|
|
|
+ $('#correct_percent').click(function () {
|
|
|
|
+ const sheet = slSpread.getActiveSheet();
|
|
|
|
+ const col = sheet.zh_setting.cols.find(x => {return x.field === 'end_gather_percent' || x.field === 'end_correct_percent'});
|
|
|
|
+ col.field = this.checked ? 'end_correct_percent' : 'end_gather_percent';
|
|
|
|
+ SpreadJsObj.reLoadColsData(sheet, [col]);
|
|
})
|
|
})
|
|
});
|
|
});
|