'use strict'; /** * * * @author Mai * @date * @version */ const RptMemBase = require('./base'); const bindData = {}; class rptMemPaymentSafe extends RptMemBase { constructor(ctx) { super(ctx, bindData); } async doCheckTender(tenderId) { if (this.ctx.paymentTender) return; this.ctx.paymentTender = await this.ctx.service.paymentTender.doCheckTender(tenderId); } async doCheckDetail(detailId) { if (this.ctx.detail) return; this.ctx.detail = await this.ctx.service.paymentDetail.doCheckDetail(detailId); } async doBeforeLoadReport(params) { await this.doCheckTender(params.tender_id); await this.doCheckDetail(params.detail_id); } getCommonData(params, tableName, fields) { switch (tableName) { case 'mem_payment_tender': return this.ctx.paymentTender; case 'mem_payment_tender_info': return this.ctx.service.paymentTenderInfo.getTenderInfo(params.tender_id); case 'mem_payment_detail': return this.ctx.detail; default: return []; } } } module.exports = rptMemPaymentSafe;