Ver código fonte

预付款汇总

MaiXinRong 1 ano atrás
pai
commit
61d2885853
2 arquivos alterados com 19 adições e 1 exclusões
  1. 5 0
      app/service/report.js
  2. 14 1
      app/service/rpt_gather_memory.js

+ 5 - 0
app/service/report.js

@@ -232,6 +232,11 @@ module.exports = app => {
                                 customDefine.gather_select, customSelect ? customSelect.gather_select : null));
                             runnableKey.push(filter);
                             break;
+                        case 'mem_gather_advance_pay':
+                            runnableRst.push(service.rptGatherMemory.getGatherAdvancePay(memFieldKeys[filter],
+                                customDefine.gather_select, customSelect ? customSelect.gather_select : null));
+                            runnableKey.push(filter);
+                            break;
                         case 'mem_select_material':
                             runnableRst.push(service.material.getSelectMaterial(params.tender_id, params.material_order));
                             runnableKey.push(filter);

+ 14 - 1
app/service/rpt_gather_memory.js

@@ -1281,7 +1281,20 @@ module.exports = app => {
                 result.mem_gather_change.push(...change);
                 result.mem_gather_change_bills.push(...changeBills);
             }
-            return result
+            return result;
+        }
+
+        async getGatherAdvancePay(memFieldKeys, gsDefine, gsCustom) {
+            if (!gsDefine || !gsDefine.enable) return [];
+            if (!gsCustom || !gsCustom.tenders || gsCustom.tenders.length === 0) return [];
+
+            const result = { mem_gather_advance_pay: [] };
+            for (const t of gsCustom.tenders) {
+                // const tender = await this.ctx.service.tender.getCheckTender(t.tid);
+                const advance_pay = await this.ctx.service.advance.getAllDataByCondition({ where: { tid: params.tender_id } };
+                result.mem_gather_advance_pay.push(...advance_pay);
+            }
+            return result;
         }
 
         async _gatherStageJgcl(tender, stage) {