Quellcode durchsuchen

定位至台账,付青青强制要求,必须定位到台账上id与变更清单记录的gcl_id一样的台账节点上

MaiXinRong vor 4 Jahren
Ursprung
Commit
274e2f993e
1 geänderte Dateien mit 4 neuen und 43 gelöschten Zeilen
  1. 4 43
      app/public/js/stage.js

+ 4 - 43
app/public/js/stage.js

@@ -206,7 +206,6 @@ $(document).ready(() => {
         node.end_gather_percent = ZhCalc.mul(ZhCalc.div(node.end_gather_tp, node.end_final_tp), 100, 2);
         node.end_correct_percent = ZhCalc.mul(ZhCalc.div(node.end_correct_tp, node.end_final_tp), 100, 2);
         node.final_dgn_price = ZhCalc.round(ZhCalc.div(node.end_gather_tp, ZhCalc.add(node.deal_dgn_qty1, node.c_dgn_qty1)), tenderInfo.decimal.up);
-        if (node.b_code === '209-2-3') console.log(node);
     };
     const stageTree = createNewPathTree('stage', stageTreeSetting);
     // 初始化 计量单元 数据结构
@@ -3053,50 +3052,12 @@ $(document).ready(() => {
                         name: '定位至台账',
                         icon: 'fa-sign-in',
                         callback: function (key, opt) {
-                            const checkPosMatch = function (bills, posName) {
-                                const posRange = stagePos.getLedgerPos(p.id);
-                                for (const pr of posRange) {
-                                    if (pr.name === posName) return true;
-                                }
-                                return false;
-                            };
-                            const checkBillsMatch = function (bills, checkData, posName) {
-                                if (bills.children && bills.children.length > 0) return false;
-                                const billsCheckData = {
-                                    b_code: bills.b_code || '',
-                                    name: bills.name || '',
-                                    unit: bills.unit || '',
-                                    unit_price: bills.unit_price || 0,
-                                };
-                                if (!_.isMatch(checkData, billsCheckData)) return false;
-                                return !posName || checkPosMatch(bills, posName);
-                            };
                             const changeBills = SpreadJsObj.getSelectObject(self.changeBillsSheet);
-                            const cb = {
-                                b_code: changeBills.code || '',
-                                name: changeBills.name || '',
-                                unit: changeBills.unit || '',
-                                unit_price: changeBills.unit_price || 0,
-                            };
-                            if (changeBills.lid && changeBills.lid !== '0') {
-                                const node = stageTree.nodes.find(x => {return x.id === changeBills.lid});
-                                const posterity = stageTree.getPosterity(node) || [];
-                                posterity.unshift(node);
-                                for (const p of posterity) {
-                                    if (checkBillsMatch(p, cb, changeBills.detail)) {
-                                        SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), p.ledger_id);
-                                        stagePosSpreadObj.loadCurPosData();
-                                        return;
-                                    }
-                                }
+                            if (changeBills.gcl_id) {
+                                const node = stageTree.nodes.find(x => {return x.id === changeBills.gcl_id});
+                                SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), node.ledger_id);
                             } else {
-                                for (const node of stageTree.nodes) {
-                                    if (checkBillsMatch(node, cb, changeBills.detail)) {
-                                        SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), node.ledger_id);
-                                        stagePosSpreadObj.loadCurPosData();
-                                        return;
-                                    }
-                                }
+                                toastr.warning('该清单无法定位');
                             }
                         },
                         disabled: function (key, opt) {