Browse Source

变更清单查询使用调整

MaiXinRong 11 months ago
parent
commit
90651e282c
3 changed files with 5 additions and 7 deletions
  1. 1 1
      app/public/js/revise.js
  2. 1 1
      app/public/js/revise_history.js
  3. 3 5
      app/service/stage_change.js

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

@@ -2165,7 +2165,7 @@ $(document).ready(() => {
             locate: function (att) {
                 if (!att) return;
                 SpreadJsObj.locateTreeNode(billsSheet, att.node.ledger_id, true);
-                billsTreeSpreadObj.loadRelaAtt();
+                reviseAtt.getCurAttHtml(att.node);
                 posSpreadObj.loadCurPosData();
             }
         });

+ 1 - 1
app/public/js/revise_history.js

@@ -185,7 +185,7 @@ $(document).ready(() => {
             locate: function (att) {
                 if (!att) return;
                 SpreadJsObj.locateTreeNode(billsSheet, att.node.ledger_id, true);
-                billsTreeSpreadObj.loadRelaAtt();
+                reviseAtt.getCurAttHtml(att.node);
                 posSpreadObj.loadCurPosData();
             }
         });

+ 3 - 5
app/service/stage_change.js

@@ -591,12 +591,10 @@ module.exports = app => {
             const stages = await this.ctx.service.stage.getAllDataByCondition({ where: { tid: tid }, orders: [['order', 'desc']] });
             for (const stage of stages) {
                 if (stage.status === audit.stage.status.checked) {
-                    const sql = 'SELECT scf.* ' +
-                        '  FROM ' + this.ctx.service.stageChangeFinal.tableName + ' scf ' +
-                        '  LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
-                        this.ctx.helper.whereSql({ tid, cid }, 'scf') + ' And s.order = ?';
-                    const pre = await this.db.query(sql, [stage.order]);
+                    const sql = `SELECT * FROM ${this.ctx.service.stageChangeFinal.tableName} WHERE tid = ? and cid = ? AND sorder = ?`;
+                    const pre = await this.db.query(sql, [tid, cid, stage.order]);
                     result.push(...pre);
+                    break;
                 } else {
                     const sql = 'SELECT * FROM ' + this.tableName + this.ctx.helper.whereSql({ sid: stage.id, cid });
                     const curAll = await this.db.query(sql);