Bladeren bron

mem_gather_change_bills问题

MaiXinRong 2 jaren geleden
bovenliggende
commit
a8cb1040ee
2 gewijzigde bestanden met toevoegingen van 8 en 7 verwijderingen
  1. 1 1
      app/service/report.js
  2. 7 6
      app/service/rpt_gather_memory.js

+ 1 - 1
app/service/report.js

@@ -401,7 +401,7 @@ module.exports = app => {
                         }
                         break;
                     case 'gatherChange':
-                        const gcResult = await service.rptGatherMemory.getGatherChange(memFieldKeys[filter],
+                        const gcResult = await service.rptGatherMemory.getGatherChange(memFieldKeys['mem_gather_change'],
                             customDefine.gather_select, customSelect ? customSelect.gather_select : null);
                         for (const d in gcResult) {
                             rst[d] = gcResult[d];

+ 7 - 6
app/service/rpt_gather_memory.js

@@ -1185,7 +1185,7 @@ module.exports = app => {
             try {
                 const info = await this.ctx.service.tenderInfo.getTenderInfo(tender.id);
                 const decimal = info.decimal, ctx = this.ctx;
-                const where = { tid, valid: 1 };
+                const where = { tid: tender.id, valid: 1 };
                 if (this.ctx.session.sessionProject.page_show.isOnlyChecked) where.status = auditConst.flow.status.checked;
                 const change = await this.ctx.service.change.getAllDataByCondition({ where, orders: [['in_time', 'desc']] });
                 for (const c of change) {
@@ -1203,7 +1203,7 @@ module.exports = app => {
                     });
                     c.attNames = names.join('\n');
                 }
-                const changeBills = await this.ctx.service.changeAuditList.getChangeAuditBills(tid, this.ctx.session.sessionProject.page_show.isOnlyChecked);
+                const changeBills = await this.ctx.service.changeAuditList.getChangeAuditBills(tender.id, this.ctx.session.sessionProject.page_show.isOnlyChecked);
                 for (const d of changeBills) {
                     d.tender_name = tender.name;
                     d.o_qty = d.oamount;
@@ -1253,11 +1253,12 @@ module.exports = app => {
             if (!gsDefine || !gsDefine.enable) return [];
             if (!gsCustom || !gsCustom.tenders || gsCustom.tenders.length === 0) return [];
 
-            const result = { change: [], changeBills: [] };
-            for (const tender of gsCustom.tenders) {
+            const result = { mem_gather_change: [], mem_gather_change_bills: [] };
+            for (const t of gsCustom.tenders) {
+                const tender = await this.ctx.service.tender.getCheckTender(t.tid);
                 const [change, changeBills] = await this._gatherChange(tender);
-                result.change.push(...change);
-                result.changeBills.push(...changeBills);
+                result.mem_gather_change.push(...change);
+                result.mem_gather_change_bills.push(...changeBills);
             }
             return result
         }