|
@@ -98,6 +98,15 @@ $(function () {
|
|
|
// treeData = setLeafData(treeData);
|
|
|
// console.log(treeData);
|
|
|
// let treeData = data;
|
|
|
+ const calcList = ['total_price'];
|
|
|
+ const showList = ['ledger_id', 'ledger_pid', 'order', 'level', 'tender_id', 'full_path',
|
|
|
+ 'code', 'name', 'unit', 'dgn_qty1', 'dgn_qty2', 'dgn_price', 'quantity', 'total_price'];
|
|
|
+ for (const m of monthList) {
|
|
|
+ showList.push(m + '_tp');
|
|
|
+ showList.push(m + '_gcl');
|
|
|
+ // calcList.push(m + '_tp');
|
|
|
+ // calcList.push(m + '_gcl');
|
|
|
+ }
|
|
|
const baseLedgerTree = createNewPathTree('base', {
|
|
|
id: 'ledger_id',
|
|
|
pid: 'ledger_pid',
|
|
@@ -105,21 +114,15 @@ $(function () {
|
|
|
level: 'level',
|
|
|
rootId: -1,
|
|
|
fullPath: 'full_path',
|
|
|
- calcFields: ['total_price'],
|
|
|
+ calcFields: calcList,
|
|
|
calcFun: function (node) {
|
|
|
node.dgn_price = ZhCalc.round(ZhCalc.div(node.total_price, node.dgn_qty1), 2);
|
|
|
}
|
|
|
});
|
|
|
const newLedgerList = setMonthToLedger(data.bills, data.slm);
|
|
|
- console.log(newLedgerList);
|
|
|
baseLedgerTree.loadDatas(newLedgerList);
|
|
|
treeCalc.calculateAll(baseLedgerTree);
|
|
|
- const showList = ['ledger_id', 'ledger_pid', 'order', 'level', 'tender_id', 'full_path',
|
|
|
- 'code', 'name', 'unit', 'dgn_qty1', 'dgn_qty2', 'dgn_price', 'quantity', 'total_price'];
|
|
|
- for (const m of monthList) {
|
|
|
- showList.push(m + '_tp');
|
|
|
- showList.push(m + '_gcl');
|
|
|
- }
|
|
|
+ console.log(baseLedgerTree);
|
|
|
for (const d of baseLedgerTree.nodes) {
|
|
|
if (!d.b_code) {
|
|
|
const one = _.find(selectedLedgerList, function (item) {
|