Browse Source

计量台账,查找定位
1. 部位明细,提示文字调整
2. 收起的节点,查找后,不应收起

MaiXinRong 5 years ago
parent
commit
3de0ce6900
2 changed files with 49 additions and 9 deletions
  1. 48 8
      app/public/js/stage.js
  2. 1 1
      app/view/stage/index.ejs

+ 48 - 8
app/public/js/stage.js

@@ -1245,7 +1245,7 @@ $(document).ready(() => {
                 const curBills = data[info.row];
                 if (!curBills) { return }
 
-                SpreadJsObj.locateTreeNode(self.mainSpread.getActiveSheet(), curBills.ledger_id);
+                SpreadJsObj.locateTreeNode(self.mainSpread.getActiveSheet(), curBills.ledger_id, true);
                 stagePosSpreadObj.loadCurPosData();
             });
         }
@@ -1267,7 +1267,9 @@ $(document).ready(() => {
                     if ((node.code && node.code.indexOf(keyword) > -1) ||
                         node.b_code && node.b_code.indexOf(keyword) > -1 ||
                         node.name && node.name.indexOf(keyword) > -1) {
-                        this.searchResult.push(node);
+                        const data = JSON.parse(JSON.stringify(node));
+                        data.visible = true;
+                        this.searchResult.push(data);
                     }
                 }
                 this.calculateCompletePercent();
@@ -1281,11 +1283,15 @@ $(document).ready(() => {
                 if (node.children && node.children.length > 0) continue;
                 if (node.end_gather_qty) {
                     if (!node.quantity || Math.abs(node.end_gather_qty) > Math.abs(node.quantity)) {
-                        this.searchResult.push(node);
+                        const data = JSON.parse(JSON.stringify(node));
+                        data.visible = true;
+                        this.searchResult.push(data);
                     }
                 } else if (node.end_gather_tp) {
                     if (!node.total_price || Math.abs(node.end_gather_tp) > Math.abs(node.total_price)) {
-                        this.searchResult.push(node);
+                        const data = JSON.parse(JSON.stringify(node));
+                        data.visible = true;
+                        this.searchResult.push(data);
                     }
                 }
             }
@@ -1299,11 +1305,15 @@ $(document).ready(() => {
                 if (node.children && node.children.length > 0) continue;
                 if (node.quantity) {
                     if (!node.end_gather_qty || checkZero(node.end_gather_qty)) {
-                        this.searchResult.push(node);
+                        const data = JSON.parse(JSON.stringify(node));
+                        data.visible = true;
+                        this.searchResult.push(data);
                     }
                 } else if (node.total_price) {
                     if (!node.end_gather_tp || checkZero(node.end_gather_tp)) {
-                        this.searchResult.push(node);
+                        const data = JSON.parse(JSON.stringify(node));
+                        data.visible = true;
+                        this.searchResult.push(data);
                     }
                 }
             }
@@ -1317,11 +1327,15 @@ $(document).ready(() => {
                 if (node.children && node.children.length > 0) continue;
                 if (node.quantity) {
                     if (ZhCalc.sub(node.quantity, node.end_gather_qty) > 0) {
-                        this.searchResult.push(node);
+                        const data = JSON.parse(JSON.stringify(node));
+                        data.visible = true;
+                        this.searchResult.push(data);
                     }
                 } else if (node.total_price) {
                     if (ZhCalc.sub(node.total_price, node.end_gather_tp) > 0) {
-                        this.searchResult.push(node);
+                        const data = JSON.parse(JSON.stringify(node));
+                        data.visible = true;
+                        this.searchResult.push(data);
                     }
                 }
             }
@@ -1426,6 +1440,19 @@ $(document).ready(() => {
         } else {
             $('[for=' + this.id +']').removeClass('text-warning');
         }
+        if (this.checked) {
+            if ($('#pos-over-search')[0].checked) {
+                $('#pos-search-keyword').attr('placeholder', '按名称查询');
+            } else {
+                $('#pos-search-keyword').attr('placeholder', '漏计中按名称查询');
+            }
+        } else {
+            if ($('#pos-over-search')[0].checked) {
+                $('#pos-search-keyword').attr('placeholder', '超计中按名称查询');
+            } else {
+                $('#pos-search-keyword').attr('placeholder', '按名称查询');
+            }
+        }
         posSearch.searchAndLocate();
     });
     $('#pos-over-search').click(function () {
@@ -1434,6 +1461,19 @@ $(document).ready(() => {
         } else {
             $('[for=' + this.id +']').removeClass('text-danger');
         }
+        if (this.checked) {
+            if ($('#pos-empty-search')[0].checked) {
+                $('#pos-search-keyword').attr('placeholder', '按名称查询');
+            } else {
+                $('#pos-search-keyword').attr('placeholder', '超计中按名称查询');
+            }
+        } else {
+            if ($('#pos-empty-search')[0].checked) {
+                $('#pos-search-keyword').attr('placeholder', '漏计中按名称查询');
+            } else {
+                $('#pos-search-keyword').attr('placeholder', '按名称查询');
+            }
+        }
         posSearch.searchAndLocate();
     });
     $('#pos-search-next').click(() => {posSearch.locateNext()});

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

@@ -74,7 +74,7 @@
                                                 </div>
                                             </div>
                                         </div>
-                                        <input type="text" class="form-control" placeholder="漏计中按名称查找" id="pos-search-keyword">
+                                        <input type="text" class="form-control" placeholder="按名称查找" id="pos-search-keyword">
                                         <!--搜索结果显示-->
                                         <div class="input-group-append" >
                                             <span class="input-group-text" id="pos-search-result">结果:0</span>