|
@@ -75,7 +75,7 @@ $(function () {
|
|
|
const showList = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'ledger_id', 'ledger_pid', 'order', 'level', 'tender_id', 'full_path',
|
|
|
'code', 'name', 'unit', 'dgn_qty1', 'dgn_qty2', 'dgn_price', 'quantity', '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', 'end_correct_tp'];
|
|
|
- const baseLedgerTree = createNewPathTree('base', {
|
|
|
+ const baseLedgerTreeSetting = {
|
|
|
id: 'ledger_id',
|
|
|
pid: 'ledger_pid',
|
|
|
order: 'order',
|
|
@@ -83,9 +83,9 @@ $(function () {
|
|
|
rootId: -1,
|
|
|
fullPath: 'full_path',
|
|
|
calcFields: calcList,
|
|
|
- });
|
|
|
- baseLedgerTree.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'postil', 'used', 'contract_expr'];
|
|
|
- baseLedgerTree.calcFun = function (node) {
|
|
|
+ };
|
|
|
+ baseLedgerTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'postil', 'used', 'contract_expr'];
|
|
|
+ baseLedgerTreeSetting.calcFun = function (node) {
|
|
|
if (!node.children || node.children.length === 0) {
|
|
|
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);
|
|
@@ -111,6 +111,7 @@ $(function () {
|
|
|
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.dgn_price = ZhCalc.round(ZhCalc.div(node.total_price, node.dgn_qty1), 2);
|
|
|
};
|
|
|
+ const baseLedgerTree = createNewPathTree('base', baseLedgerTreeSetting);
|
|
|
// const newLedgerList = setMonthToLedger(data.bills, data.slm);
|
|
|
baseLedgerTree.loadDatas(data.ledgerData);
|
|
|
treeCalc.calculateAll(baseLedgerTree);
|