Procházet zdrojové kódy

修复投资进度bug

ellisran před 3 týdny
rodič
revize
9da0db91a3

+ 1 - 1
app/public/js/schedule_plan.js

@@ -615,7 +615,7 @@ function setMonthToLedger(ledgerList, slm) {
     if (slm.length > 0) {
         for(const s of slm) {
             const index = _.findIndex(ledgerList, { 'ledger_id': s.lid });
-            if (index && index !== -1) {
+            if (index !== -1) {
                 ledgerList[index][s.yearmonth + '_tp'] = s.plan_tp;
                 ledgerList[index][s.yearmonth + '_gcl'] = s.plan_gcl;
             }

+ 5 - 5
app/public/js/schedule_stage_gcl.js

@@ -703,7 +703,7 @@ function setMonthToLedger(ledgerList, slm) {
         for(const s of slm) {
             const index = _.findIndex(ledgerList, { 'ledger_id': s.lid });
             const canCalc = _.find(scheduleMonth, { 'yearmonth': s.yearmonth, 'stage_gcl_used': 1});
-            if (index && index !== -1 && canCalc) {
+            if (index !== -1 && canCalc) {
                 ledgerList[index][s.yearmonth + '_plan_tp'] = s.plan_tp;
                 ledgerList[index][s.yearmonth + '_plan_gcl'] = s.plan_gcl;
                 ledgerList[index][s.yearmonth + '_sj_tp'] = s.sj_tp;
@@ -717,7 +717,7 @@ function setGclMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm) {
     if (slm.length > 0) {
         for(const s of slm) {
             const index = _.findIndex(ledgerList, { 'ledger_id': s.lid });
-            if (index && index !== -1) {
+            if (index !== -1) {
                 ledgerList[index].plan_tp = s.plan_tp;
                 ledgerList[index].plan_gcl = s.plan_gcl;
                 ledgerList[index].sj_tp = s.sj_tp;
@@ -728,7 +728,7 @@ function setGclMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm) {
     if (nextSlm.length > 0) {
         for (const ns of nextSlm) {
             const index = _.findIndex(ledgerList, {'ledger_id': ns.lid});
-            if (index && index !== -1) {
+            if (index !== -1) {
                 ledgerList[index].next_plan_tp = ns.plan_tp;
                 ledgerList[index].next_plan_gcl = ns.plan_gcl;
             }
@@ -737,7 +737,7 @@ function setGclMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm) {
     if (endSlm.length > 0) {
         for (const es of endSlm) {
             const index = _.findIndex(ledgerList, {'ledger_id': es.lid});
-            if (index && index !== -1) {
+            if (index !== -1) {
                 ledgerList[index].end_plan_tp = es.plan_tp;
                 ledgerList[index].end_plan_gcl = es.plan_gcl;
                 ledgerList[index].end_sj_tp = es.sj_tp;
@@ -748,7 +748,7 @@ function setGclMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm) {
     if (yearSlm.length > 0) {
         for (const ys of yearSlm) {
             const index = _.findIndex(ledgerList, {'ledger_id': ys.lid});
-            if (index && index !== -1) {
+            if (index !== -1) {
                 ledgerList[index].year_plan_tp = ys.plan_tp;
                 ledgerList[index].year_plan_gcl = ys.plan_gcl;
                 ledgerList[index].year_sj_tp = ys.sj_tp;

+ 4 - 4
app/public/js/schedule_stage_tp.js

@@ -258,7 +258,7 @@ function setMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm, yearLedgerD
     if (slm.length > 0) {
         for(const s of slm) {
             const index = _.findIndex(ledgerList, { 'ledger_id': s.lid });
-            if (index && index !== -1) {
+            if (index !== -1) {
                 ledgerList[index].plan_tp = s.plan_tp;
                 ledgerList[index].plan_gcl = s.plan_gcl;
             }
@@ -267,7 +267,7 @@ function setMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm, yearLedgerD
     if (nextSlm.length > 0) {
         for (const ns of nextSlm) {
             const index = _.findIndex(ledgerList, {'ledger_id': ns.lid});
-            if (index && index !== -1) {
+            if (index !== -1) {
                 ledgerList[index].next_plan_tp = ns.plan_tp;
                 ledgerList[index].next_plan_gcl = ns.plan_gcl;
             }
@@ -276,7 +276,7 @@ function setMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm, yearLedgerD
     if (endSlm.length > 0) {
         for (const es of endSlm) {
             const index = _.findIndex(ledgerList, {'ledger_id': es.lid});
-            if (index && index !== -1) {
+            if (index !== -1) {
                 ledgerList[index].end_plan_tp = es.plan_tp;
                 ledgerList[index].end_plan_gcl = es.plan_gcl;
             }
@@ -285,7 +285,7 @@ function setMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm, yearLedgerD
     if (yearSlm.length > 0) {
         for (const ys of yearSlm) {
             const index = _.findIndex(ledgerList, {'ledger_id': ys.lid});
-            if (index && index !== -1) {
+            if (index !== -1) {
                 ledgerList[index].year_plan_tp = ys.plan_tp;
                 ledgerList[index].year_plan_gcl = ys.plan_gcl;
             }