|
@@ -124,7 +124,6 @@ $(function () {
|
|
|
const newLedgerList = setMonthToLedger(data.ledgerData, slmList, nextSlmList, endSlmList, yearSlmList, curYearStageData);
|
|
|
baseLedgerTree.loadDatas(newLedgerList);
|
|
|
treeCalc.calculateAll(baseLedgerTree);
|
|
|
- console.log(baseLedgerTree);
|
|
|
for (const d of baseLedgerTree.nodes) {
|
|
|
if (!d.b_code) {
|
|
|
const one = _.find(selectedLedgerList, function (item) {
|
|
@@ -269,8 +268,10 @@ function setMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm, yearLedgerD
|
|
|
}
|
|
|
if (yearLedgerData.length > 0) {
|
|
|
for (const yl of yearLedgerData) {
|
|
|
- const index = _.findIndex(ledgerList, {'id': yl.lid});
|
|
|
- if (index && index !== -1) {
|
|
|
+ const index = _.findIndex(ledgerList, function (item) {
|
|
|
+ return item.id === yl.lid;
|
|
|
+ });
|
|
|
+ if (index !== undefined && index !== -1) {
|
|
|
ledgerList[index].year_contract_qty = ZhCalc.add(yl.contract_qty, yl.qc_qty);
|
|
|
ledgerList[index].year_gather_tp = ZhCalc.add(yl.contract_tp, yl.qc_tp);
|
|
|
}
|