laiguoran 4 gadi atpakaļ
vecāks
revīzija
4447882069
2 mainītis faili ar 25 papildinājumiem un 4 dzēšanām
  1. 24 3
      app/public/js/schedule_plan.js
  2. 1 1
      app/view/stage/audit_modal.ejs

+ 24 - 3
app/public/js/schedule_plan.js

@@ -110,19 +110,27 @@ $(function () {
                 node.dgn_price = ZhCalc.round(ZhCalc.div(node.total_price, node.dgn_qty1), 2);
             }
         });
-        baseLedgerTree.loadDatas(data.bills);
+        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');
+        }
         for (const d of baseLedgerTree.nodes) {
             if (!d.b_code) {
                 const one = _.find(selectedLedgerList, function (item) {
                     return item === d.ledger_id;
                 });
                 if(one) {
-                    ledgerTree.addData(d, ['ledger_id', 'ledger_pid', 'order', 'level', 'tender_id', 'full_path',
-                        'code', 'name', 'unit', 'dgn_qty1', 'dgn_qty2', 'dgn_price', 'quantity', 'total_price']);
+                    ledgerTree.addData(d, showList);
                 }
             }
         }
+        console.log(ledgerTree);
         ledgerTree.sortTreeNode(true);
         // console.log(ledgerTree);
         SpreadJsObj.loadSheetData(ledgerSpread.getActiveSheet(), SpreadJsObj.DataType.Tree, ledgerTree);
@@ -488,6 +496,19 @@ function setLeafData(tree) {
     }
     return newtree;
 }
+
+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) {
+                ledgerList[index][s.yearmonth + '_tp'] = s.plan_tp;
+                ledgerList[index][s.yearmonth + '_gcl'] = s.plan_gcl;
+            }
+        }
+    }
+    return ledgerList;
+}
 const is_numeric = (value) => {
     if (typeof(value) === 'object') {
         return false;

+ 1 - 1
app/view/stage/audit_modal.ejs

@@ -644,7 +644,7 @@
                                                                 id="inlineRadio2"
                                                                 value="<%- auditConst.status.checkNoPre %>">
                                                             <label class="form-check-label" for="inlineRadio2">退回上一审批人
-                                                                <%- auditors[index-1].status === auditConst.status.checkAgain ? auditors[index-3].name : auditors[index-1].name %></label>
+                                                                <%- auditors[index-1].status === auditConst.status.checkAgain || auditors[index-1].status === auditConst.status.checkNoPre ? auditors[index-3].name : auditors[index-1].name %></label>
                                                         </div>
                                                         <% } %>
                                                     </div>