瀏覽代碼

计量台账,调用变更令,无计量单元清单,匹配变更部位

MaiXinRong 5 月之前
父節點
當前提交
531098d55c
共有 2 個文件被更改,包括 18 次插入10 次删除
  1. 17 9
      app/public/js/stage.js
  2. 1 1
      app/view/stage/modal.ejs

+ 17 - 9
app/public/js/stage.js

@@ -659,13 +659,19 @@ $(document).ready(() => {
                 toastr.error('查询变更令有误,请刷新页面后重试');
             }
         }
+        _matchPos(match, change) {
+            return match && this.callData.pos
+                ? (change.gcl_id === this.callData.bills.id && change.b_bwmx === this.callData.pos.name)
+                : true;
+        }
+        _matchBillsParent(match, change) {
+            return match ? (!change.b_bwmx || change.b_bwmx === this.callData.leafXmj.name) : true;
+        }
         _filterChange(filterEmpty, matchPosName) {
             this.displayChanges = [];
             for (const c of this.changes) {
                 const filterVisible = filterEmpty ? (c.vamount ? !checkZero(c.vamount) : false) : true;
-                const matchVisible = matchPosName && this.callData.pos
-                    ? (c.gcl_id === this.callData.bills.id && c.b_bwmx === this.callData.pos.name)
-                    : true;
+                const matchVisible = this.callData.pos ? this._matchPos(matchPosName, c) : this._matchBillsParent(matchPosName, c);
                 if ((filterVisible && matchVisible) || (c.org_uamount)) {
                     this.displayChanges.push(c);
                 }
@@ -675,11 +681,12 @@ $(document).ready(() => {
         }
         loadChanges(data) {
             this.callData = data;
-            if (this.callData.pos) {
-                $('#matchPos').parent().show();
-            } else {
-                $('#matchPos').parent().hide();
-            }
+            // if (this.callData.pos) {
+            //     $('#matchPos').parent().show();
+            // } else {
+            //     $('#matchPos').parent().hide();
+            // }
+            $('#matchPos').parent().show();
             const self = this;
             $('#b-code-hint').text('当前变更清单:' + data.bills.b_code);
             postData(window.location.pathname + '/valid-change', data, function (result) {
@@ -725,7 +732,8 @@ $(document).ready(() => {
                 const nodePos = stagePos.getLedgerPos(data.id);
                 if (nodePos && nodePos.length > 0) return;
                 const minus = col.field === 'qc_minus_qty' ? 1 : 0;
-                changesObj.loadChanges({bills: data, minus, noValue: minus});
+                const leafXmj = stageTree.getLeafXmjParent(data);
+                changesObj.loadChanges({bills: data, minus, noValue: minus, leafXmj: leafXmj});
                 break;
             default: return;
         }

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

@@ -46,7 +46,7 @@
                             <li class="nav-item">
                                 <p class="mb-0 mt-2 mr-3" id="b-code-hint">当前变更清单:201-1-1</p>
                             </li>
-                            <li class="nav-item">
+                            <li class="nav-item mr-2">
                                 <div class="custom-control custom-checkbox my-2">
                                     <input class="custom-control-input" id="filterEmpty" checked="" type="checkbox">
                                     <label class="custom-control-label" for="filterEmpty">显示可变更数量为0项 </label>