Browse Source

预设公式,搜索问题

MaiXinRong 1 year atrás
parent
commit
fe053baef2
2 changed files with 13 additions and 2 deletions
  1. 12 1
      app/public/js/ledger.js
  2. 1 1
      app/view/ledger/explode_modal.ejs

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

@@ -3376,7 +3376,18 @@ $(document).ready(function() {
             this.searchCur = 0;
             if (keyword) {
                 for (const [i, d] of this.exprSheet.zh_tree.nodes.entries()) {
-                    if (d.code.indexOf(keyword) >= 0 || d.name.indexOf(keyword) >= 0) this.searchResult.push(d);
+                    if (d.code && d.code.indexOf(keyword)) {
+                        this.searchResult.push(d);
+                        continue;
+                    }
+                    if (d.b_code && d.b_code.indexOf(keyword) >= 0) {
+                        this.searchResult.push(d);
+                        continue;
+                    }
+                    if (d.name && d.name.indexOf(keyword) >= 0) {
+                        this.searchResult.push(d);
+                        continue;
+                    }
                 }
             }
             $('#expr_search_count').html(`结果:${this.searchResult.length}`);

+ 1 - 1
app/view/ledger/explode_modal.ejs

@@ -448,7 +448,7 @@
                                         <tr><td class="text-center" name="tr" exprValue="qysl">签约数量</td><td class="text-center" name="tr" exprValue="qyje">签约金额</td></tr>
                                     </table>
                                 </div>
-                                <div class="text-danger mb-3">击添加对应行值到公式框</div>
+                                <div class="text-danger mb-3">击添加对应行值到公式框</div>
                             </div>
                             <div>
                                <h6>本期合同计量公式</h6>