浏览代码

1. 台账分解,数据检查,检查结果筛选
2. 台账修订,移植数据检查功能

MaiXinRong 4 年之前
父节点
当前提交
e2db206876
共有 5 个文件被更改,包括 56 次插入1 次删除
  1. 29 0
      app/public/js/revise.js
  2. 16 1
      app/public/js/shares/cs_tools.js
  3. 1 0
      app/view/ledger/explode.ejs
  4. 9 0
      app/view/revise/info.ejs
  5. 1 0
      app/view/revise/info_modal.ejs

+ 29 - 0
app/public/js/revise.js

@@ -59,6 +59,21 @@ $(document).ready(() => {
             if (posSpread) posSpread.refresh();
         },
     });
+    const checkList = $.ledger_checkList({
+        id: 'check-list',
+        tabSelector: '#check-list-tab',
+        selector: '#check-list',
+        relaSpread: billsSpread,
+        storeKey: 'revise-check-' + window.location.pathname.split('/')[2] + '-' + window.location.pathname.split('/')[4],
+        checkType: ledgerCheckType,
+        afterLocated:  function () {
+            posSpreadObj.loadCurPosData();
+        },
+        afterShow: function () {
+            billsSpread.refresh();
+            if (posSpread) posSpread.refresh();
+        },
+    });
 
     // 初始化 节点树结构
     const treeSetting = {
@@ -1734,6 +1749,8 @@ $(document).ready(() => {
         pos.loadDatas(result.pos);
         posSpreadObj.loadCurPosData();
         SpreadJsObj.resetTopAndSelect(posSheet);
+
+        checkList.loadHisCheckData();
     }, null);    
     $.divResizer({
         select: '#revise-resize',
@@ -2249,6 +2266,9 @@ $(document).ready(() => {
             if (searchLedger) {
                 searchLedger.spread.refresh();
             }
+            if (checkList) {
+                checkList.spread.refresh();
+            }
         }
     });
 
@@ -2429,6 +2449,8 @@ $(document).ready(() => {
                 searchLedger.spread.refresh();
             } else if (tab.attr('content') === '#error-list') {
                 errorList.spread.refresh();
+            } else if (tab.attr('content') === '#check-list') {
+                checkList.spread.refresh();
             }
         }
         else {// 收起工具栏
@@ -2492,6 +2514,13 @@ $(document).ready(() => {
         },
         errorList: errorList,
     });
+
+    LedgerChecker({
+        ledgerTree: billsTree,
+        ledgerPos: pos,
+        checkList: checkList,
+    });
+
     $('[name=revise-start]').submit(function (e) {
         if (checkAuditorFrom()) {
             $(this).parent().parent().parent().modal('hide');

+ 16 - 1
app/public/js/shares/cs_tools.js

@@ -244,6 +244,7 @@ const showSideTools = function (show) {
             );
             autoFlashHeight();
 
+
             const spread = SpreadJsObj.createNewSpread($('#' + resultId)[0]);
             const sheet = spread.getActiveSheet();
             SpreadJsObj.initSheet(sheet, setting.spreadSetting);
@@ -263,6 +264,20 @@ const showSideTools = function (show) {
                 }
             });
 
+            const filterCheckData = function () {
+                const filter = $(this).attr('check-type');
+                $('#' + setting.id + 'drop').html(this.innerHTML);
+                for (const d of sheet.zh_data) {
+                    if (filter === 'all') {
+                        d.visible = true;
+                    } else {
+                        d.visible = d.type == filter;
+                    }
+                }
+                SpreadJsObj.refreshTreeRowVisible(sheet);
+            };
+            $('a[check-type]').bind('click', filterCheckData);
+
             const hideCheckData = function () {
                 const tab = $(setting.tabSelector), tabPanel = $(tab.attr('content'));
                 if (tab.hasClass('active')) {
@@ -285,7 +300,7 @@ const showSideTools = function (show) {
                     d.serialNo = sourceTree.getNodeIndex(sourceTree.getItems(d.ledger_id)) + 1;
                 }
 
-                $('#' + setting.id + '-time').html('检查时间:' + data.check_time.toLocaleString());
+                $('#' + setting.id + '-time').html('检查时间:' + moment(data.check_time).format('YYYY-MM-DD hh:mm:ss'));
                 SpreadJsObj.loadSheetData(sheet, SpreadJsObj.DataType.Data, data.warning_data);
                 if (!his && setting.storeKey) {
                     setLocalCache(setting.storeKey, JSON.stringify(data));

+ 1 - 0
app/view/ledger/explode.ejs

@@ -176,6 +176,7 @@
         </div>
     </div>
 </div>
+<script src="/public/js/moment/moment.min.js"></script>
 <script type="text/javascript">
     const readOnly = <%- ctx.tender.ledgerReadOnly %>;
     const tender = JSON.parse('<%- JSON.stringify(tender) %>');

+ 9 - 0
app/view/revise/info.ejs

@@ -41,6 +41,9 @@
                         <input type="text" class="form-control form-control-sm m-0" id="bills-expr" readonly="">
                     </div>
                 </div>
+                <div class="d-inline-block ml-3">
+                    <a class="btn btn-sm btn-primary" href="#ledger-check-modal" data-toggle="modal" data-target="#ledger-check-modal">数据检查</a>
+                </div>
             </div>
             <% } %>
             <div class="ml-auto">
@@ -178,6 +181,8 @@
                     </div>
                     <div id="error-list" class="tab-pane">
                     </div>
+                    <div id="check-list" class="tab-pane">
+                    </div>
                 </div>
             </div>
         </div>
@@ -206,10 +211,14 @@
                 <li class="nav-item">
                     <a class="nav-link" content="#error-list" id="error-list-tab" href="javascript: void(0);" style="display: none;">错误列表</a>
                 </li>
+                <li class="nav-item">
+                    <a class="nav-link" content="#check-list" id="check-list-tab" href="javascript: void(0);" style="display: none;">数据检查</a>
+                </li>
             </ul>
         </div>
     </div>
 </div>
+<script src="/public/js/moment/moment.min.js"></script>
 <script>
     const readOnly = <%- readOnly %>;
     const isTz = <%- ctx.tender.data.measure_type === measureType.tz.value %>;

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

@@ -570,6 +570,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 %>
 <script>
     <% if (ctx.session.sessionUser.accountId === revise.uid && (revise.status === audit.status.uncheck || revise.status === audit.status.checkNo)) { %>
     const accountList = JSON.parse('<%- JSON.stringify(accountList) %>');