浏览代码

Task #3466 计量台账,变更令,定位至台账调整

MaiXinRong 4 年之前
父节点
当前提交
1571656237
共有 1 个文件被更改,包括 21 次插入1 次删除
  1. 21 1
      app/public/js/stage.js

+ 21 - 1
app/public/js/stage.js

@@ -3043,7 +3043,27 @@ $(document).ready(() => {
                                 const node = stageTree.nodes.find(x => {return x.id === changeBills.gcl_id});
                                 SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), node.ledger_id);
                             } else {
-                                toastr.warning('该清单无法定位');
+                                const cb = {
+                                    b_code: changeBills.code || '',
+                                    name: changeBills.name || '',
+                                    unit: changeBills.unit || '',
+                                    unit_price: changeBills.unit_price || 0,
+                                };
+                                for (const node of stageTree.nodes) {
+                                    if (node.children && node.children.length > 0) continue;
+
+                                    const b = {
+                                        b_code: bills.b_code || '',
+                                        name: bills.name || '',
+                                        unit: bills.unit || '',
+                                        unit_price: bills.unit_price || 0,
+                                    };
+                                    if (_.isMatch(cb, b)) {
+                                        SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), node.ledger_id);
+                                        stagePosSpreadObj.loadCurPosData();
+                                        return;
+                                    }
+                                }
                             }
                         },
                         disabled: function (key, opt) {