MaiXinRong преди 5 години
родител
ревизия
143d1caaf4
променени са 2 файла, в които са добавени 5 реда и са изтрити 4 реда
  1. 2 2
      app/lib/rpt_data_analysis.js
  2. 3 2
      app/service/report_memory.js

+ 2 - 2
app/lib/rpt_data_analysis.js

@@ -1144,8 +1144,8 @@ const sortPos = {
             return billsIndex[billsId];
             return billsIndex[billsId];
         };
         };
         pos.sort(function (x, y) {
         pos.sort(function (x, y) {
-            const xIndex = findBillsIndex(x) * 1000 + x.porder;
-            const yIndex = findBillsIndex(y) * 1000 + y.porder;
+            const xIndex = findBillsIndex(x.lid) * 1000 + x.porder;
+            const yIndex = findBillsIndex(y.lid) * 1000 + y.porder;
             return xIndex - yIndex;
             return xIndex - yIndex;
         });
         });
     }
     }

+ 3 - 2
app/service/report_memory.js

@@ -202,7 +202,6 @@ module.exports = app => {
                 if (cache) return cache;
                 if (cache) return cache;
             }
             }
 
 
-            // console.log('build');
             if (!this.stageImData) {
             if (!this.stageImData) {
                 this.stageImData = {};
                 this.stageImData = {};
                 try {
                 try {
@@ -423,7 +422,9 @@ module.exports = app => {
 
 
         async getStagePosData(tid, sid, fields) {
         async getStagePosData(tid, sid, fields) {
             await this.ctx.service.tender.checkTender(tid);
             await this.ctx.service.tender.checkTender(tid);
-            await this.ctx.service.stage.checkStage(sid);
+            if (sid) {
+                await this.ctx.service.stage.checkStage(sid);
+            }
 
 
             const posData = await this.ctx.service.pos.getAllDataByCondition({ where: {tid: this.ctx.tender.id }});
             const posData = await this.ctx.service.pos.getAllDataByCondition({ where: {tid: this.ctx.tender.id }});
             if (this._checkFieldsExist(fields, posFields.stage)) {
             if (this._checkFieldsExist(fields, posFields.stage)) {