Przeglądaj źródła

台账分解,数据检查,改版重做

MaiXinRong 4 lat temu
rodzic
commit
e0261e3bae

+ 10 - 2
app/public/js/ledger_check.js

@@ -114,9 +114,17 @@ const ledgerCheckUtil = {
                 }
             }
             if (node.is_tp) {
-                if (node.end_contract_tp > node.total_price) error.push(node);
+                if (option.isTz) {
+                    if (node.end_contract_tp > node.total_price) error.push(node);
+                } else {
+                    if (node.end_contract_tp > node.deal_bills_tp) error.push(node);
+                }
             } else {
-                if (node.end_contract_qty > node.quantity) error.push(node);
+                if (option.isTz) {
+                    if (node.end_contract_qty > node.quantity) error.push(node);
+                } else {
+                    if (node.end_contract_qty > node.deal_bills_qty) error.push(node);
+                }
             }
         }
         return error;

+ 33 - 24
app/public/js/revise.js

@@ -2559,30 +2559,39 @@ $(document).ready(() => {
         errorList: errorList,
     });
 
-    LedgerChecker({
-        ledgerTree: billsTree,
-        ledgerPos: pos,
-        checkList: checkList,
-        decimal: decimal,
-        checkOption: {
-            sibling: { enable: 1 },
-            empty_code: { enable: 1 },
-            calc: {
-                enable: 1,
-                fields: ['sgfh_qty', 'qtcl_qty', 'sjcl_qty', 'quantity'],
-            },
-            zero: { enable: 1 },
-            tp: {
-                enable: 1,
-                fields: [
-                    {qty: 'sgfh_qty', tp: 'sgfh_tp'},
-                    {qty: 'sjcl_qty', tp: 'sjcl_tp'},
-                    {qty: 'qtcl_qty', tp: 'qtcl_tp'},
-                    {qty: 'quantity', tp: 'total_price'},
-                    {qty: 'deal_qty', tp: 'deal_tp'},
-                ],
-            },
-        }
+    $('#ledger-check2').click(() => {
+        const result = ledgerCheck2({
+            ledgerTree: billsTree,
+            ledgerPos: pos,
+            checkList: checkList,
+            decimal: decimal,
+            checkOption: {
+                sibling: { enable: 1 },
+                empty_code: { enable: 1 },
+                calc: {
+                    enable: 1,
+                    fields: ['sgfh_qty', 'qtcl_qty', 'sjcl_qty', 'quantity'],
+                },
+                zero: { enable: 1 },
+                tp: {
+                    enable: 1,
+                    fields: [
+                        {qty: 'sgfh_qty', tp: 'sgfh_tp'},
+                        {qty: 'sjcl_qty', tp: 'sjcl_tp'},
+                        {qty: 'qtcl_qty', tp: 'qtcl_tp'},
+                        {qty: 'quantity', tp: 'total_price'},
+                        {qty: 'deal_qty', tp: 'deal_tp'},
+                    ],
+                },
+            }
+        });
+        check2Viewing({
+            extra: ZhCalc.div(billsTree.datas.length + pos.datas.length, 10000, 0),
+            randomWait: true,
+            prefix: 'check2-',
+            checks: result,
+            checkList: checkList,
+        })
     });
 
     $('[name=revise-start]').submit(function (e) {

+ 1 - 1
app/view/revise/info.ejs

@@ -45,7 +45,7 @@
             <% } %>
             <div class="ml-auto">
                 <% if (revise.status !== audit.status.checked) { %>
-                    <a class="btn btn-sm btn-primary mr-1" href="#ledger-check-modal" data-toggle="modal" data-target="#ledger-check-modal">数据检查</a>
+                    <a class="btn btn-sm btn-primary mr-1" id="ledger-check2" href="javascript: void(0);">数据检查</a>
                 <% } %>
                 <% if (revise.status === audit.status.uncheck && revise.uid === ctx.session.sessionUser.accountId) { %>
                 <a href="#sub-sp" data-toggle="modal" data-target="#sub-sp" class="btn btn-primary btn-sm mr-1">上报审批</a>

+ 1 - 1
app/view/revise/info_modal.ejs

@@ -720,7 +720,7 @@
     <% include ../shares/import_excel_modal.ejs %>
     <% include ../shares/delete_hint_modal.ejs %>
     <% include ../shares/check_data_modal.ejs %>
-    <% include ../shares/ledger_check_modal.ejs %>
+    <% include ../shares/check_modal2.ejs %>
     <% if(ctx.session.sessionUser.accountId === revise.uid && (revise.status === auditConst.status.uncheck || revise.status === auditConst.status.checkNo)) { %>
     <script>
         const cur_uid = '<%- ctx.session.sessionUser.accountId %>';

+ 1 - 0
config/web.js

@@ -227,6 +227,7 @@ const JsFiles = {
                     '/public/js/zh_calc.js',
                     '/public/js/path_tree.js',
                     '/public/js/std_lib.js',
+                    '/public/js/ledger_check.js',
                     '/public/js/revise.js',
                 ],
                 mergeFile: 'revise',