Parcourir la source

fix: 合同支付报表界面隐藏合同支付业务按钮

Tony Kang il y a 19 heures
Parent
commit
536bcea3a7

+ 8 - 7
app/controller/pay_controller.js

@@ -47,7 +47,7 @@ module.exports = app => {
                     phasePays,
                     validStages,
                     auditConst: audit.common,
-                    jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.phasePay.list)
+                    jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.phasePay.list),
                 };
                 await this.layout('phase_pay/index.ejs', renderData, 'phase_pay/modal.ejs');
             } catch (err) {
@@ -68,7 +68,7 @@ module.exports = app => {
 
                 const pays = await ctx.service.phasePay.getAllPhasePay(ctx.tender.id, 'DESC');
                 const unCompleteCount = pays.filter(s => { return s.status !== audit.common.status.checked; }).length;
-                if (unCompleteCount.length > 0) throw `最新一起未审批通过,请审批通过后再新增`;
+                if (unCompleteCount.length > 0) throw '最新一起未审批通过,请审批通过后再新增';
                 const stages = stage ? await ctx.service.stage.getAllDataByCondition({ where: { tid: ctx.tender.id, order: stage } }) : [];
 
                 const newPhase = await ctx.service.phasePay.add(ctx.tender.id, stages, date, memo);
@@ -177,6 +177,7 @@ module.exports = app => {
                     shenpiConst,
                     auditType: audit.auditType,
                     authMobile: pa.auth_mobile,
+                    showAudit: true,
                 };
                 await this.layout('phase_pay/detail.ejs', renderData, 'phase_pay/detail_modal.ejs');
             } catch (err) {
@@ -194,7 +195,7 @@ module.exports = app => {
 
                 const result = {};
                 for (const f of filter) {
-                    switch(f) {
+                    switch (f) {
                         case 'pay':
                             result.pay = await this.ctx.service.phasePayDetail.getDetailData(ctx.phasePay);
                             break;
@@ -269,7 +270,7 @@ module.exports = app => {
         async uploadFile(ctx) {
             let stream;
             try {
-                const parts = ctx.multipart({autoFields: true});
+                const parts = ctx.multipart({ autoFields: true });
 
                 let index = 0;
                 const create_time = Date.parse(new Date()) / 1000;
@@ -306,7 +307,7 @@ module.exports = app => {
                 }
 
                 const result = await ctx.service.phasePayFile.addFiles(ctx.phasePay, 'pay', uploadfiles, user);
-                ctx.body = {err: 0, msg: '', data: result};
+                ctx.body = { err: 0, msg: '', data: result };
             } catch (error) {
                 ctx.log(error);
                 // 失败需要消耗掉stream 以防卡死
@@ -315,12 +316,12 @@ module.exports = app => {
             }
         }
         async deleteFile(ctx) {
-            try{
+            try {
                 const data = JSON.parse(ctx.request.body.data);
                 if (!data && !data.id) throw '缺少参数';
                 const result = await ctx.service.phasePayFile.delFiles(data.id);
                 ctx.body = { err: 0, msg: '', data: result };
-            } catch(error) {
+            } catch (error) {
                 ctx.log(error);
                 ctx.ajaxErrorBody(error, '删除附件失败');
             }

+ 1 - 0
app/controller/report_controller.js

@@ -1022,6 +1022,7 @@ module.exports = app => {
                     otherHintName: '',
                     bizId: bglObj.BUSINESS_ID,
                     permissions: '[]',
+                    showAudit: false,
                 };
                 await this.layout('report/index.ejs', renderData, 'report/rpt_all_popup.ejs');
             } catch (err) {

+ 3 - 1
app/view/phase_pay/sub_menu_list.ejs

@@ -1,4 +1,6 @@
 <nav-menu title="返回" url="/tender/<%= ctx.tender.id %>/pay" tclass="text-primary" ml="1" icon="fa-chevron-left"></nav-menu>
 <nav-menu title="支付明细" url="/tender/<%= ctx.tender.id %>/pay/<%= ctx.phasePay.phase_order + '/detail'%>" ml="3" active="<%= (ctx.url.indexOf('detail') >= 0 ? 1 : -1) %>"></nav-menu>
 <nav-menu title="输出报表" url="/tender/<%= ctx.tender.id %>/pay/<%= ctx.phasePay.phase_order + '/report'%>" ml="3" active="<%= (ctx.url.indexOf('report') >= 0 ? 1 : -1) %>"></nav-menu>
-<% include ./audit_btn.ejs %>
+<% if (showAudit) { %>
+    <% include ./audit_btn.ejs %>
+<% } %>