Explorar el Código

批量插入清单-计量单元,调整

MaiXinRong hace 5 años
padre
commit
26432a2cb5

+ 9 - 1
app/public/js/ledger.js

@@ -2105,6 +2105,11 @@ $(document).ready(function() {
             this.obj = obj;
             this.billsCount = 6;
             this.posCount = 1000;
+            this.filter = getLocalCache('zh-calc-batch-filter');
+            if (!this.filter) {
+                this.filter = '1';
+            }
+            $('input[name=batch-filter]')[0].checked = this.filter && this.filter != '0';
             // 初始化 清单编号窗口 参数
             this.qdSpreadSetting = {
                 cols: [
@@ -2296,6 +2301,9 @@ $(document).ready(function() {
                     }
                 }
             });
+            $('input[name=batch-filter]').change(function () {
+                setLocalCache('zh-calc-batch-filter', this.checked ? 1 : 0);
+            });
         }
         // 初始化左侧表格
         initView () {
@@ -2341,7 +2349,6 @@ $(document).ready(function() {
                     price: _.toNumber(qdSheet.getText(iRow, 3)),
                     pos: [],
                 };
-                result.push(qd);
                 for (let iPosRow = 0; iPosRow < posSheet.getRowCount(); iPosRow++) {
                     const value = _.toNumber(posSheet.getText(iPosRow, iRow + 2));
                     if (value !== 0 && !isNaN(value)) {
@@ -2352,6 +2359,7 @@ $(document).ready(function() {
                         });
                     }
                 }
+                if (!$('input[name=batch-filter]')[0].checked || qd.pos.length > 0) result.push(qd);
             }
             return result;
         }

+ 9 - 1
app/public/js/revise.js

@@ -1588,6 +1588,11 @@ $(document).ready(() => {
             this.obj = obj;
             this.billsCount = 6;
             this.posCount = 1000;
+            this.filter = getLocalCache('zh-calc-batch-filter');
+            if (!this.filter) {
+                this.filter = '1';
+            }
+            $('input[name=batch-filter]')[0].checked = this.filter && this.filter != '0';
             // 初始化 清单编号窗口 参数
             this.qdSpreadSetting = {
                 cols: [
@@ -1730,6 +1735,9 @@ $(document).ready(() => {
                     }, null, true);
                 }
             });
+            $('input[name=batch-filter]').change(function () {
+                setLocalCache('zh-calc-batch-filter', this.checked ? 1 : 0);
+            });
 
             $.contextMenu({
                 selector: '.batch-l-t',
@@ -1815,7 +1823,6 @@ $(document).ready(() => {
                     price: _.toNumber(qdSheet.getText(iRow, 3)),
                     pos: [],
                 };
-                result.push(qd);
                 for (let iPosRow = 0; iPosRow < posSheet.getRowCount(); iPosRow++) {
                     const value = _.toNumber(posSheet.getText(iPosRow, iRow + 2));
                     if (value !== 0 && !isNaN(value)) {
@@ -1826,6 +1833,7 @@ $(document).ready(() => {
                         });
                     }
                 }
+                if (!$('input[name=batch-filter]')[0].checked || qd.pos.length > 0) result.push(qd);
             }
             return result;
         }

+ 6 - 0
app/view/ledger/explode_modal.ejs

@@ -55,6 +55,12 @@
                 <h5 class="modal-title">批量插入清单-计量单元</h5>
             </div>
             <div class="modal-body">
+                <div class="custom-control custom-checkbox mb-2">
+                    <label class="form-check-label">
+                        <input class="form-check-input" type="checkbox" name="batch-filter">
+                        过滤无计量单元的清单
+                    </label>
+                </div>
                 <div class="row">
                     <div class="col-6">
                         <h6>清单信息</h6>

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

@@ -7,6 +7,12 @@
             </div>
             <div class="modal-body">
                 <div class="row">
+                    <div class="custom-control custom-checkbox mb-2">
+                        <label class="form-check-label">
+                            <input class="form-check-input" type="checkbox" name="batch-filter">
+                            过滤无计量单元的清单
+                        </label>
+                    </div>
                     <div class="col-6">
                         <h6>清单信息</h6>
                         <div class="batch-l-t">