Преглед на файлове

台账修订,默认展开修订详情

MaiXinRong преди 5 години
родител
ревизия
1c22819747
променени са 3 файла, в които са добавени 31 реда и са изтрити 25 реда
  1. 30 23
      app/public/js/revise.js
  2. 0 1
      app/service/stage_bills.js
  3. 1 1
      app/view/revise/info.ejs

+ 30 - 23
app/public/js/revise.js

@@ -1352,33 +1352,40 @@ $(document).ready(() => {
             }
         }
     });
+    const showSideTools = function (show) {
+        const left = $('#left-view'), right = $('#right-view'), parent = left.parent();
+        if (show) {
+            right.show();
+            autoFlashHeight();
+            /**
+             * right.show()后, parent被撑开成2倍left.height, 导致parent.width减少了10px
+             * 第一次left.width调整后,parent的缩回left.height, 此时parent.width又增加了10px
+             * 故需要通过最终的parent.width再计算一次left.width
+             *
+             * Q: 为什么不通过先计算left.width的宽度,以避免计算两次left.width?
+             * A: 右侧工具栏不一定显示,当右侧工具栏显示过一次后,就必须使用parent和right来计算left.width
+             *
+             */
+                //left.css('width', parent.width() - right.outerWidth());
+                //left.css('width', parent.width() - right.outerWidth());
+            const percent = 100 - right.outerWidth() /parent.width() * 100;
+            left.css('width', percent + '%');
+        } else {
+            left.width(parent.width());
+            right.hide();
+        }
+    };
+    $('#content-tab').addClass('active');
+    $('#xd-content').addClass('active');
+    showSideTools(true);
+    billsSpread.refresh();
+    if (posSpread) {
+        posSpread.refresh();
+    }
     // 展开收起标准节点
     $('a', '#side-menu').bind('click', function (e) {
         e.preventDefault();
         const tab = $(this), tabPanel = $(tab.attr('content'));
-        const showSideTools = function (show) {
-            const left = $('#left-view'), right = $('#right-view'), parent = left.parent();
-            if (show) {
-                right.show();
-                autoFlashHeight();
-                /**
-                 * right.show()后, parent被撑开成2倍left.height, 导致parent.width减少了10px
-                 * 第一次left.width调整后,parent的缩回left.height, 此时parent.width又增加了10px
-                 * 故需要通过最终的parent.width再计算一次left.width
-                 *
-                 * Q: 为什么不通过先计算left.width的宽度,以避免计算两次left.width?
-                 * A: 右侧工具栏不一定显示,当右侧工具栏显示过一次后,就必须使用parent和right来计算left.width
-                 *
-                 */
-                    //left.css('width', parent.width() - right.outerWidth());
-                    //left.css('width', parent.width() - right.outerWidth());
-                const percent = 100 - right.outerWidth() /parent.width() * 100;
-                left.css('width', percent + '%');
-            } else {
-                left.width(parent.width());
-                right.hide();
-            }
-        };
         // 展开工具栏、切换标签
         if (!tab.hasClass('active')) {
             const close = $('.active', '#side-menu').length === 0;

+ 0 - 1
app/service/stage_bills.js

@@ -123,7 +123,6 @@ module.exports = app => {
                 '  ) As MaxFilter ' +
                 '  ON (Bills.times * ' + timesLen + ' + `order`) = MaxFilter.progress And Bills.lid = MaxFilter.lid And Bills.`sid` = MaxFilter.`sid`';
             const sqlParam = [tid, sid];
-            console.log(this.db.format(sql, sqlParam));
             const stageBills = await this.db.query(sql, sqlParam);
             return this._.map(this._.filter(stageBills, 'used'), 'lid');
         }

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

@@ -165,7 +165,7 @@
             <!--右侧菜单-->
             <ul class="nav flex-column right-nav" id="side-menu">
                 <li class="nav-item">
-                    <a class="nav-link" content="#xd-content" href="javascript: void(0);">修订详情</a>
+                    <a class="nav-link" id="content-tab" content="#xd-content" href="javascript: void(0);">修订详情</a>
                 </li>
                 <li class="nav-item">
                     <a class="nav-link" content="#search" href="javascript: void(0);">查找定位</a>