Browse Source

报表相关

MaiXinRong 1 year ago
parent
commit
1b4f2bbf03
3 changed files with 4 additions and 4 deletions
  1. 1 1
      app/controller/report_controller.js
  2. 1 1
      app/service/payment_detail.js
  3. 2 2
      app/service/rpt_tpl.js

+ 1 - 1
app/controller/report_controller.js

@@ -556,7 +556,7 @@ module.exports = app => {
             if (!rptTpl || rptTpl.length !== 1) {
                 throw '获取模板失败';
             }
-            const source_type = rptTpl.source_type;
+            const source_type = rptTpl[0].source_type;
             rptTpl = JSON.parse(rptTpl[0].rpt_content);
             rptTpl.source_type = source_type || sourceTypeConst.defaultSourceType;
             rptTpl.id = params.rpt_tpl_id;

+ 1 - 1
app/service/payment_detail.js

@@ -339,7 +339,7 @@ module.exports = app => {
 
         async doCheckDetail(id) {
             const accountId = this.ctx.session.sessionUser.accountId;
-            const auditPermission = await this.service.paymentPermissionAudit.getOnePermission(this.session.sessionUser.is_admin, accountId);
+            const auditPermission = await this.service.paymentPermissionAudit.getOnePermission(this.ctx.session.sessionUser.is_admin, accountId);
             if (!auditPermission) throw '权限不足';
 
             const detail = await this.getDataById(id);

+ 2 - 2
app/service/rpt_tpl.js

@@ -28,7 +28,7 @@ module.exports = app => {
                 value: id,
                 operate: '=',
             });
-            this.sqlBuilder.columns = ['id', 'rpt_type', 'rpt_tpl_name', 'rpt_content'];
+            this.sqlBuilder.columns = ['id', 'rpt_type', 'rpt_tpl_name', 'rpt_content', 'source_type'];
             const [sql, sqlParam] = this.sqlBuilder.build(this.tableName);
             const list = await this.db.query(sql, sqlParam);
             return list;
@@ -40,7 +40,7 @@ module.exports = app => {
                 value: rpt_ids,
                 operate: 'in',
             });
-            this.sqlBuilder.columns = ['id', 'rpt_type', 'rpt_tpl_name', 'rpt_content'];
+            this.sqlBuilder.columns = ['id', 'rpt_type', 'rpt_tpl_name', 'rpt_content', 'source_type'];
             const [sql, sqlParam] = this.sqlBuilder.build(this.tableName);
             const list = await this.db.query(sql, sqlParam);
             return list;