Explorar el Código

变更清单,插入台账,显示、隐藏计量单元

MaiXinRong hace 1 día
padre
commit
5167b93a66
Se han modificado 3 ficheros con 28 adiciones y 4 borrados
  1. 21 3
      app/public/js/change_revise.js
  2. 1 0
      app/service/cost_stage_book.js
  3. 6 1
      app/view/change/revise.ejs

+ 21 - 3
app/public/js/change_revise.js

@@ -53,7 +53,7 @@ const checkOption = {
 };
 
 $(document).ready(() => {
-    let stdXmj, stdGcl, searchLedger;
+    let stdXmj, stdGcl, searchLedger, posDisplay;
     let changeGclData = false;
     autoFlashHeight();
     billsSpreadSetting.cols.unshift({ title: '变更清单', colSpan: '1', rowSpan: '2', field: 'is_change', hAlign: 1, width: 60, cellType: 'checkbox', readOnly: 'readOnly.isChangeList', });
@@ -3754,7 +3754,7 @@ $(document).ready(() => {
         makeGclGatherData();
         console.log(billsTree);
     }, null);
-    $.divResizer({
+    const mainSpr = $.divResizer({
         select: '#revise-resize',
         callback: function () {
             billsSpread.refresh();
@@ -3763,6 +3763,25 @@ $(document).ready(() => {
             posSpread.refresh();
         }
     });
+    const changePosDisplay = function (show, init = false) {
+        $('#pos-show').html(show ? '<i class="fa fa-eye-slash"></i> 隐藏计量单元' : '<i class="fa fa-eye"></i> 显示计量单元');
+        if (!init) {
+            posDisplay = show;
+            setLocalCache(posShowCache, show ? 1 : 0);
+        }
+        mainSpr.showSprPart(show);
+        billsSpread.refresh();
+        posSpread.refresh();
+    };
+    const reloadPosDisplayCache = function () {
+        posDisplay = getLocalCache(posShowCache);
+        posDisplay = posDisplay ? parseInt(posDisplay) : 1;
+        changePosDisplay(posDisplay, true);
+    };
+    reloadPosDisplayCache();
+    $('#pos-show').click(function() {
+        changePosDisplay(!posDisplay);
+    });
 
     function makeGclGatherData() {
         if (changeGclData || !gclGatherData) {
@@ -5938,7 +5957,6 @@ $(document).ready(() => {
             },
         };
 
-
         $('#batch-pos').on('show.bs.modal', function (e) {
             makeBatchPosSjsHtml();
         });

+ 1 - 0
app/service/cost_stage_book.js

@@ -250,6 +250,7 @@ module.exports = app => {
                 if (detailUpdateData.length > 0) await conn.updateRows(this.ctx.service.costStageBookDetail.tableName, detailUpdateData);
                 await conn.commit();
             } catch(err) {
+                this.ctx.log(err);
                 await conn.rollback();
                 return { calc: false, bills: [], detail: [] };
             }

+ 6 - 1
app/view/change/revise.ejs

@@ -38,6 +38,11 @@
                     <a href="javascript: void(0);" name="cpc" type="paste" class="btn btn-sm btn-light text-primary" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="粘贴"><i class="fa fa-clipboard" aria-hidden="true"></i></a>
                 </div>
                 <div class="d-inline-block">
+                    <div class="btn-group">
+                        <button href="javascript: void(0);" class="btn btn-sm btn-light text-primary" id="pos-show"><i class="fa fa-eye-slash"></i> 隐藏计量单元</button>
+                    </div>
+                </div>
+                <div class="d-inline-block">
                     <div class="input-group input-group-sm ml-2">
                         <div class="input-group-prepend">
                             <span class="input-group-text" id="basic-addon1">表达式</span>
@@ -62,7 +67,7 @@
                 <div class="sjs-height-1" style="overflow: hidden" id="bills-spread">
                 </div>
                 <div class="bcontent-wrap">
-                    <div id="revise-resize" class="resize-y" id="top-spr" r-Type="height" div1=".sjs-height-1" div2=".bcontent-wrap" title="调整大小"><!--调整上下高度条--></div>
+                    <div id="revise-resize" class="resize-y" r-Type="height" div1=".sjs-height-1" div2=".bcontent-wrap" title="调整大小"><!--调整上下高度条--></div>
                     <div class="bc-bar mb-1">
                         <ul class="nav nav-tabs">
                             <li class="nav-item">