Browse Source

计量台账、中间计量,界面加载速度优化

MaiXinRong 5 years ago
parent
commit
ea166caed1

+ 46 - 16
app/controller/stage_controller.js

@@ -139,20 +139,25 @@ module.exports = app => {
                 [renderData.ledgerSpread, renderData.posSpread] = this._getSpreadSetting();
                 renderData.changeConst = changeConst;
                 renderData.ledgerData = await ctx.service.ledger.getDataByTenderId(ctx.tender.id, -1);
+                let curStageData, preStageData;
                 // 当前操作人查看最新数据,其他人查看历史数据
                 if (ctx.stage.readOnly) {
-                    renderData.curStageData = await ctx.service.stageBills.getAuditorStageData(ctx.tender.id, ctx.stage.id, ctx.stage.curTimes, ctx.stage.curOrder);
+                    curStageData = await ctx.service.stageBills.getAuditorStageData(ctx.tender.id, ctx.stage.id, ctx.stage.curTimes, ctx.stage.curOrder);
                 } else {
-                    renderData.curStageData = await ctx.service.stageBills.getLastestStageData(ctx.tender.id, ctx.stage.id);
+                    curStageData = await ctx.service.stageBills.getLastestStageData(ctx.tender.id, ctx.stage.id);
                 }
-                renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.stage.index);
                 // 查询截止上期数据
                 if (ctx.stage.order > 1) {
-                    renderData.preStageData = await ctx.service.stageBillsFinal.getFinalData(ctx.tender.data, ctx.stage);
+                    preStageData = await ctx.service.stageBillsFinal.getFinalData(ctx.tender.data, ctx.stage);
                     //renderData.preStageData = await ctx.service.stageBills.getEndStageData(ctx.tender.id, ctx.stage.order - 1);
                 } else {
-                    renderData.preStageData = [];
+                    preStageData = [];
                 }
+                this.ctx.helper.assignRelaData(renderData.ledgerData, [
+                    {data: curStageData, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'postil'], prefix: '', relaId: 'lid',},
+                    {data: preStageData, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'], prefix: 'pre_', relaId: 'lid',}
+                ]);
+                renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.stage.index);
                 renderData.whiteList = this.ctx.app.config.multipart.whitelist;
                 // 获取附件列表
                 const attData = await ctx.service.stageAtt.getDataByTenderIdAndStageId(ctx.tender.id, ctx.params.order);
@@ -177,22 +182,34 @@ module.exports = app => {
                 const condition = JSON.parse(ctx.request.body.data) || {};
                 condition.tid = ctx.tender.id;
                 const responseData = {err: 0, msg: '', data: {}};
-                responseData.data.pos = await ctx.service.pos.getPosData(condition);
+
+                let curStageData, preStageData;
+                responseData.data = await ctx.service.pos.getPosData(condition);
                 // 根据当前人,或指定对象查询数据
+                console.time('cur');
+                const curWhere = JSON.parse(ctx.request.body.data);
                 if (ctx.stage.readOnly) {
-                    responseData.data.curStageData = await ctx.service.stagePos.getAuditorStageData(ctx.tender.id,
-                        ctx.stage.id, ctx.stage.curTimes, ctx.stage.curOrder, this.app._.map(responseData.data.pos, 'id'));
+                    curStageData = await ctx.service.stagePos.getAuditorStageData(ctx.tender.id,
+                        ctx.stage.id, ctx.stage.curTimes, ctx.stage.curOrder, curWhere);
                 } else {
-                    responseData.data.curStageData = await ctx.service.stagePos.getLastestStageData(ctx.tender.id,
-                        ctx.stage.id, this.app._.map(responseData.data.pos, 'id'));
+                    curStageData = await ctx.service.stagePos.getLastestStageData(ctx.tender.id, ctx.stage.id, curWhere);
                 }
+                console.timeEnd('cur');
                 // 查询截止上期数据
+                console.time('pre');
                 if (ctx.stage.order > 1) {
-                    responseData.data.preStageData = await ctx.service.stagePosFinal.getFinalData(ctx.tender.data, ctx.stage);
+                    preStageData = await ctx.service.stagePosFinal.getFinalData(ctx.tender.data, ctx.stage);
                     //responseData.data.preStageData = await ctx.service.stagePos.getEndStageData(ctx.tender.id, ctx.stage.order - 1);
                 } else {
-                    responseData.data.preStageData = [];
+                    preStageData = [];
                 }
+                console.timeEnd('pre');
+                console.time('assign');
+                this.ctx.helper.assignRelaData(responseData.data, [
+                    {data: curStageData, fields: ['contract_qty', 'qc_qty', 'postil'], prefix: '', relaId: 'pid'},
+                    {data: preStageData, fields: ['contract_qty', 'qc_qty'], prefix: 'pre_', relaId: 'pid'}
+                ]);
+                console.timeEnd('assign');
                 ctx.body = responseData;
             } catch (err) {
                 this.log(err);
@@ -355,14 +372,27 @@ module.exports = app => {
                     result.ledger = await ctx.service.ledger.getDataByTenderId(ctx.tender.id, -1);
                     result.pos = await ctx.service.pos.getPosData({tid: ctx.tender.id});
                     if (ctx.stage.readOnly) {
-                        result.curStage = await ctx.service.stageBills.getAuditorStageData(ctx.tender.id, ctx.stage.id, ctx.stage.curTimes, ctx.stage.curOrder);
-                        result.curPosStage = await ctx.service.stagePos.getAuditorStageData(ctx.tender.id, ctx.stage.id, ctx.stage.curTimes, ctx.stage.curOrder);
+                        const curStage = await ctx.service.stageBills.getAuditorStageData(ctx.tender.id, ctx.stage.id, ctx.stage.curTimes, ctx.stage.curOrder);
+                        this.ctx.helper.assignRelaData(result.ledger, [
+                            {data: curStage, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'], prefix: '', relaId: 'lid'}
+                        ]);
+                        const curPosStage = await ctx.service.stagePos.getAuditorStageData(ctx.tender.id, ctx.stage.id, ctx.stage.curTimes, ctx.stage.curOrder);
+                        this.ctx.helper.assignRelaData(result.pos, [
+                            {data: curPosStage, fields: ['contract_qty', 'qc_qty'], prefix: '', relaId: 'pid'}
+                        ]);
                         result.stageDetail = await ctx.service.stageDetail.getAuditorStageData(ctx.tender.id, ctx.stage.id, ctx.stage.curTimes, ctx.stage.curOrder);
                     } else {
-                        result.curStage = await ctx.service.stageBills.getLastestStageData(ctx.tender.id, ctx.stage.id);
-                        result.curPosStage = await ctx.service.stagePos.getLastestStageData(ctx.tender.id, ctx.stage.id);
+                        const curStage = await ctx.service.stageBills.getLastestStageData(ctx.tender.id, ctx.stage.id);
+                        this.ctx.helper.assignRelaData(result.ledger, [
+                            {data: curStage, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'], prefix: '', relaId: 'lid'}
+                        ]);
+                        const curPosStage = await ctx.service.stagePos.getLastestStageData(ctx.tender.id, ctx.stage.id);
+                        this.ctx.helper.assignRelaData(result.pos, [
+                            {data: curPosStage, fields: ['contract_qty', 'qc_qty'], prefix: '', relaId: 'pid'}
+                        ]);
                         result.stageDetail = await ctx.service.stageDetail.getLastestStageData(ctx.tender.id, ctx.stage.id);
                     }
+                    console.log(result.length);
                     ctx.body = { err: 0, msg: '', data: result };
                 }
             } catch (err) {

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

@@ -455,8 +455,8 @@ $(document).ready(() => {
     SpreadJsObj.initSheet(slSpread.getActiveSheet(), ledgerSpreadSetting);
 
     stageTree.loadDatas(ledgerData);
-    stageTree.loadCurStageData(curStageData);
-    stageTree.loadPreStageData(preStageData);
+    // stageTree.loadCurStageData(curStageData);
+    // stageTree.loadPreStageData(preStageData);
     // 根据设置 计算 台账树结构
     treeCalc.calculateAll(stageTree);
     // 绘制界面
@@ -1044,16 +1044,8 @@ $(document).ready(() => {
     console.time('loadPosFromServer');
     postData(window.location.pathname + '/pos', null, function (result) {
         console.timeEnd('loadPosFromServer');
-        console.log('pos: ' + result.pos.length);
-        console.log('cur: ' + result.curStageData.length);
-        console.log('pre: ' + result.preStageData.length);
-        stagePos.loadDatas(result.pos);
-        if (result.curStageData) {
-            stagePos.loadCurStageData(result.curStageData);
-        }
-        if (result.preStageData) {
-            stagePos.loadPreStageData(result.preStageData);
-        }
+        console.log('pos: ' + result.length);
+        stagePos.loadDatas(result);
         stagePos.calculateAll();
         stagePosSpreadObj.loadCurPosData();
         SpreadJsObj.resetTopAndSelect(spSpread.getActiveSheet());

+ 4 - 1
app/public/js/stage_detail.js

@@ -221,8 +221,11 @@ $(document).ready(() => {
         detailOperationObj.loadLeafXmjsData();
     }
 
+    console.time('loadDetailRela');
     postData(window.location.pathname + '/load', { loadType: 'all' }, function (data) {
-        stageIm.loadData(data.ledger, data.curStage, data.pos, data.curPosStage, data.stageDetail);
+        console.timeEnd('loadDetailRela');
+        //stageIm.loadData(data.ledger, data.curStage, data.pos, data.curPosStage, data.stageDetail);
+        stageIm.loadData(data.ledger, data.pos, data.stageDetail);
         reBuildImData();
     });
 

+ 16 - 5
app/public/js/stage_im.js

@@ -64,21 +64,32 @@ const stageIm = (function () {
 
     }
 
-    function loadData (ledger, curStage, pos, curPosStage, stageDetail) {
+    function loadData (ledger, pos, stageDetail) {
         gsTree.loadDatas(ledger);
-
-        gsTree.loadCurStageData(curStage);
-        // 根据设置 计算 台账树结构
         treeCalc.calculateAll(gsTree);
 
         gsPos.loadDatas(pos);
-        gsPos.loadCurStageData(curPosStage);
         gsPos.calculateAll();
 
         initCheck();
         details = stageDetail;
     }
 
+    // function loadData (ledger, curStage, pos, curPosStage, stageDetail) {
+    //     gsTree.loadDatas(ledger);
+    //
+    //     gsTree.loadCurStageData(curStage);
+    //     // 根据设置 计算 台账树结构
+    //     treeCalc.calculateAll(gsTree);
+    //
+    //     gsPos.loadDatas(pos);
+    //     gsPos.loadCurStageData(curPosStage);
+    //     gsPos.calculateAll();
+    //
+    //     initCheck();
+    //     details = stageDetail;
+    // }
+
     /**
      * 整数前补零
      * @param {Number} num - 数字

+ 1 - 2
app/service/stage_bills_final.js

@@ -36,8 +36,7 @@ module.exports = app => {
                 '      WHERE tid = ? AND sorder < ?' +
                 '      GROUP BY `lid`' +
                 '  ) As MaxFilter ' +
-                '  ON Bills.sorder = MaxFilter.sorder And Bills.lid = MaxFilter.lid' +
-                '  WHERE Bills.tid = ?';
+                '  ON Bills.sorder = MaxFilter.sorder And Bills.lid = MaxFilter.lid';
             const sqlParam = [tender.id, stage.order, tender.id];
             return await this.db.query(sql, sqlParam);
         }

+ 1 - 1
app/service/stage_change.js

@@ -221,7 +221,7 @@ module.exports = app => {
             try {
                 const data = { bills: {}, pos: {} };
                 data.bills.curStageData = await this.ctx.service.stageBills.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, [pos.lid]);
-                data.pos.curStageData = await this.ctx.service.stagePos.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, [pos.id]);
+                data.pos.curStageData = await this.ctx.service.stagePos.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, {pid: pos.id});
                 return data;
             } catch(err) {
                 throw '获取数据错误,请刷新页面';

+ 40 - 83
app/service/stage_pos.js

@@ -25,6 +25,26 @@ module.exports = app => {
             this.qtyFields = ['contract_qty', 'qc_qty']
         }
 
+        _getPosFilterSql(where, asTable) {
+            let whereSql = '';
+            if (!where) return whereSql;
+            if (where.pid) {
+                if (where.pid instanceof Array) {
+                    whereSql += ' And ' + asTable + 'pid in ('  + this.ctx.helper.getInArrStrSqlFilter(where.pid) + ')';
+                } else if (typeof where.pid === "string") {
+                    whereSql += ' And ' + asTable + 'pid = ' + this.db.escape(where.pid);
+                }
+            }
+            if (where.lid) {
+                if (where.lid instanceof Array) {
+                    whereSql += ' And ' + asTable + 'lid in ('  + this.ctx.helper.getInArrStrSqlFilter(where.lid) + ')';
+                } else if (typeof where.pid === "string") {
+                    whereSql += ' And ' + asTable + 'lid = ' + this.db.escape(where.lid);
+                }
+            }
+            return whereSql;
+        }
+
         /**
          * 查询期计量最后审核人数据
          * @param {Number} tid - 标段id
@@ -32,31 +52,18 @@ module.exports = app => {
          * @param {Number|Array} pid - 部位明细id(可以为空)
          * @returns {Promise<*>}
          */
-        async getLastestStageData(tid, sid, pid) {
-            let pidSql = '';
-            if (pid) {
-                if (pid instanceof Array) {
-                    pidSql = pid.length > 0 ? (' And pid in ('  + this.ctx.helper.getInArrStrSqlFilter(pid) + ')') : '';
-                } else {
-                    pidSql = (typeof pid === 'string') ? ' And pid = ' + this.db.escape(pid) : '';
-                }
-            }
-            const sql = 'SELECT Pos.* FROM ' + this.tableName + ' As Pos ' +
+        async getLastestStageData(tid, sid, where) {
+            const filterSql = this._getPosFilterSql(where);
+            const sql = 'SELECT Pos.lid, Pos.pid, Pos.contract_qty, Pos.qc_qty, Pos.postil FROM ' +
+                '  (SELECT * FROM ' + this.tableName + ' WHERE tid = ? And sid = ?) As Pos ' +
                 '  INNER JOIN ( ' +
                 '    SELECT MAX(`times` * ' + timesLen + ' + `order`) As `flow`, `tid`, `sid`, `pid` From ' + this.tableName +
-                '      WHERE `tid` = ? And sid = ?' + pidSql +
+                '      WHERE `tid` = ? And sid = ?' + filterSql +
                 '      GROUP BY `pid`' +
                 '  ) As MaxFilter ' +
-                '  ON (Pos.times * ' + timesLen + ' + Pos.order) = MaxFilter.flow And Pos.pid = MaxFilter.pid' +
-                '    And Pos.`tid` = MaxFilter.`tid` And Pos.`sid` = MaxFilter.`sid`';
-            const sqlParam = [tid, sid];
-            if (!pid) {
-                return await this.db.query(sql, sqlParam);
-            } else if (pid instanceof Array) {
-                return await this.db.query(sql, sqlParam);
-            } else {
-                return await this.db.queryOne(sql, sqlParam);
-            }
+                '  ON (Pos.times * ' + timesLen + ' + Pos.order) = MaxFilter.flow And Pos.pid = MaxFilter.pid And Pos.sid = MaxFilter.sid';
+            const sqlParam = [tid, sid, tid, sid];
+            return await this.db.query(sql, sqlParam);
         }
         /**
          * 查询 某期 某轮审批 某审核人数据
@@ -67,68 +74,18 @@ module.exports = app => {
          * @param {Number|Array|Null} pid - 部位明细id - 为空则查询全部
          * @returns {Promise<*>}
          */
-        async getAuditorStageData(tid, sid, times, order, pid) {
-            let pidSql;
-            if (pid instanceof Array) {
-                pidSql = pid.length > 0 ? ' And Pos.pid in (' + this.ctx.helper.getInArrStrSqlFilter(pid) + ')' : '';
-            } else {
-                pidSql = pid ? 'And Pos.pid = ' + this.db.escape(pid) : '';
-            }
-            const sql = 'SELECT Pos.* FROM ' + this.tableName + ' As Pos ' +
+        async getAuditorStageData(tid, sid, times, order, where) {
+            const filterSql = this._getPosFilterSql(where);
+            const sql = 'SELECT Pos.pid, Pos.lid, Pos.contract_qty, Pos.qc_qty, Pos.postil FROM ' +
+                '  (SELECT * FROM '+ this.tableName + ' WHERE tid = ? And sid = ?) As Pos ' +
                 '  INNER JOIN ( ' +
-                '    SELECT MAX(`times` * ' + timesLen + ' + `order`) As `flow`, `pid` From ' + this.tableName +
-                '      WHERE `times` < ? OR (`times` = ? AND `order` <= ?)' +
+                '    SELECT MAX(`times` * ' + timesLen + ' + `order`) As `flow`, `pid`, `sid` From ' + this.tableName +
+                '      WHERE `times` < ? OR (`times` = ? AND `order` <= ?) And tid = ? And sid = ?' + filterSql +
                 '      GROUP BY `pid`' +
                 '  ) As MaxFilter ' +
-                '  ON (Pos.times * ' + timesLen + ' + Pos.order) = MaxFilter.flow And Pos.pid = MaxFilter.pid' +
-                '  WHERE Pos.tid = ? And Pos.sid = ?' + pidSql;
-            const sqlParam = [times, times, order, tid, sid];
-            if (!pid) {
-                return await this.db.query(sql, sqlParam);
-            } else if (pid instanceof Array) {
-                return await this.db.query(sql, sqlParam);
-            } else {
-                return await this.db.queryOne(sql, sqlParam);
-            }
-        }
-
-        /**
-         * 获取截止本期数据
-         * @param {Number} tid - 标段
-         * @param {Number} sorder - 截止期序号
-         * @param {String|Array[String]}lid - 台账id
-         * @returns {Promise<*>}
-         */
-        async getEndStageData(tid, sorder, lid) {
-            let lidSql = '';
-            if (lid) {
-                if (lid instanceof Array) {
-                    lidSql = lid.length > 0 ? this.ctx.helper.getInArrStrSqlFilter(lid) : '';
-                } else {
-                    lidSql = (lid instanceof String || lid instanceof Number) ? ' And pid = ' + lid : '';
-                }
-            }
-
-            const sql = 'SELECT Pos.tid, Pos.lid, Pos.pid, SUM(Pos.contract_qty) As contract_qty, SUM(Pos.qc_qty) As qc_qty, Pos.postil FROM ' + this.tableName + ' As Pos ' +
-                '  INNER JOIN ( ' +
-                '    SELECT MAX(`times` * ' + timesLen + ' + `order`) As `flow`, `tid`, `sid`, `pid` From ' + this.tableName +
-                '      WHERE `tid` = ? ' + lidSql +
-                '      GROUP BY `pid`, `sid`' +
-                '  ) As MaxFilter ' +
-                '  ON (Pos.times * ' + timesLen + ' + Pos.order) = MaxFilter.flow And Pos.pid = MaxFilter.pid' +
-                '    And Pos.`tid` = MaxFilter.`tid` And Pos.`sid` = MaxFilter.`sid`' +
-                '  INNER JOIN ' + this.ctx.service.stage.tableName + ' As Stage' +
-                '  ON Pos.sid = Stage.id' +
-                '  WHERE Stage.order <= ?' +
-                '  GROUP BY `pid`';
-            const sqlParam = [tid, sorder];
-            if (!lid) {
-                return await this.db.query(sql, sqlParam);
-            } else if (lid instanceof Array) {
-                return await this.db.query(sql, sqlParam);
-            } else {
-                return await this.db.queryOne(sql, sqlParam);
-            }
+                '  ON (Pos.times * ' + timesLen + ' + Pos.order) = MaxFilter.flow And Pos.pid = MaxFilter.pid And Pos.sid = MaxFilter.sid';
+            const sqlParam = [tid, sid, times, times, order, tid, sid];
+            return await this.db.query(sql, sqlParam);
         }
 
         /**
@@ -213,7 +170,7 @@ module.exports = app => {
             const result = {ledger: [], pos: [], stageUpdate: true}, ledgerCalc = [];
             const datas = data instanceof Array ? data : [data];
             const orgPos = await this.ctx.service.pos.getPosDataByIds(this._.map(datas, 'pid'));
-            const orgStagePos = await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, this._.map(datas, 'pid'));
+            const orgStagePos = await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, {pid: this._.map(datas, 'pid')});
             for (const d of datas) {
                 if (d.sgfh_qty || d.qtcl_qty || d.sjcl_qty || d.contract_qty || d.qc_qty) {
                     if (!bills || bills.id !== data.lid) {
@@ -348,7 +305,7 @@ module.exports = app => {
                 if (refreshData.pos && refreshData.pos.length > 0) {
                     result.pos.pos = await this.ctx.service.pos.getPosData({id: refreshData.pos});
                     if (refreshData.stageUpdate) {
-                        result.pos.curStageData = await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, refreshData.pos);
+                        result.pos.curStageData = await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, {pid: refreshData.pos});
                     }
                 }
                 return result;
@@ -358,7 +315,7 @@ module.exports = app => {
         }
 
         async updateChangeQuantity(transaction, pos, qty) {
-            const orgPos = await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, pos.id);
+            const orgPos = await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, {pid: pos.id})[0];
             if (orgPos && orgPos.times === this.ctx.stage.curTimes && orgPos.order === this.ctx.stage.curOrder) {
                 await transaction.update(this.tableName, {id: orgPos.id, qc_qty: qty});
             } else {

+ 5 - 4
app/service/stage_pos_final.js

@@ -31,15 +31,16 @@ module.exports = app => {
          * @returns {Promise<void>}
          */
         async getFinalData(tender, stage) {
-            const sql = 'SELECT * FROM ' + this.tableName + ' As Pos' +
+            const sql = 'SELECT Pos.pid, Pos.contract_qty, Pos.qc_qty FROM ' +
+                //'  (SELECT pid, contract_qty, qc_qty, sorder FROM ' + this.tableName + ' WHERE tid = ?) As Pos' +
+                this.tableName + 'As Pos' +
                 '  INNER JOIN ( ' +
                 '    SELECT MAX(`sorder`) As `sorder`, `pid` From ' + this.tableName +
                 '      WHERE tid = ? AND sorder < ?' +
                 '      GROUP BY `pid`' +
                 '  ) As MaxFilter ' +
-                '  ON Pos.sorder = MaxFilter.sorder And Pos.pid = MaxFilter.pid' +
-                '  WHERE Pos.tid = ?';
-            const sqlParam = [tender.id, stage.order, tender.id];
+                '  ON Pos.sorder = MaxFilter.sorder And Pos.pid = MaxFilter.pid';
+            const sqlParam = [tender.id, tender.id, stage.order];
             return await this.db.query(sql, sqlParam);
         }
 

+ 0 - 5
app/view/stage/index.ejs

@@ -230,9 +230,6 @@
     </div>
 </div>
 <script>
-    GC.Spread.Sheets.LicenseKey = "559432293813965#A0y3iTOzEDOzkjMyMDN9UTNiojIklkI1pjIEJCLi4TPB9mM5AFNTd4cvZ7SaJUVy3CWKtWYXx4VVhjMpp7dYNGdx2ia9sEVlZGOTh7NRlTUwkWR9wEV4gmbjBDZ4ElR8N7cGdHVvEWVBtCOwIGW0ZmeYVWVr3mI0IyUiwCMzETN8kzNzYTM0IicfJye&Qf35VfiEzRwEkI0IyQiwiIwEjL6ByUKBCZhVmcwNlI0IiTis7W0ICZyBlIsIyNyMzM5ADI5ADNwcTMwIjI0ICdyNkIsIibj9SbvNmL4N7bjRnch56ciojIz5GRiwiI8+Y9sWY9QmZ0Jyp96uL9v6L0wap9biY9qiq95q197Wr9g+89iojIh94Wiqi";
-</script>
-<script>
     String.prototype.replaceAll = function (FindText, RepText) {
         regExp = new RegExp(FindText, 'g');
         return this.replace(regExp, RepText);
@@ -245,8 +242,6 @@
     const measureType = JSON.parse('<%- JSON.stringify(measureType) %>');
     const stage = JSON.parse('<%- JSON.stringify(ctx.stage) %>');
     const ledgerData = JSON.parse('<%- JSON.stringify(ledgerData) %>');
-    const curStageData = JSON.parse('<%- JSON.stringify(curStageData) %>');
-    const preStageData = JSON.parse('<%- JSON.stringify(preStageData) %>');
     const whiteList = JSON.parse('<%- JSON.stringify(whiteList) %>');
     const attData = JSON.parse('<%- JSON.stringify(attData) %>');
     const userID = '<%- ctx.session.sessionUser.accountId %>';

+ 2 - 1
package.json

@@ -8,8 +8,8 @@
     "decimal.js": "^10.2.0",
     "egg": "^1.13.0",
     "egg-js-validator": "^1.0.2",
-    "egg-mysql": "^3.0.0",
     "egg-multipart": "^2.7.1",
+    "egg-mysql": "^3.0.0",
     "egg-redis": "^1.0.2",
     "egg-scripts": "^1.0.0",
     "egg-session-redis": "^1.0.0",
@@ -51,6 +51,7 @@
   "scripts": {
     "start": "egg-scripts start --daemon --port 7002",
     "stop": "egg-scripts stop",
+    "start-qa": "set EGG_SERVER_ENV=qa&&egg-scripts start --daemon --port 7002",
     "dev": "egg-bin dev --port 7002",
     "dev-local": "set EGG_SERVER_ENV=qa&&egg-bin dev --port 7002",
     "dev-qa": "set EGG_SERVER_ENV=qa&&egg-bin dev --port 7002",