Browse Source

原报人及签署修复

laiguoran 2 years ago
parent
commit
26822d1d2d
2 changed files with 23 additions and 10 deletions
  1. 12 1
      app/controller/payment_controller.js
  2. 11 9
      app/view/payment/list.ejs

+ 12 - 1
app/controller/payment_controller.js

@@ -402,8 +402,13 @@ module.exports = app => {
                         break;
                     case 'update_sign':
                         if (ctx.detail.status === auditConst.status.checked) {
-                            throw '您无法操作签字/签章';
+                            // 判断是否存在下一期,是则无法签章
+                            const detailMsg = await ctx.service.paymentDetail.getDataByCondition({ tr_id: ctx.detail.tr_id, order: ctx.detail.order + 1 });
+                            if (detailMsg) {
+                                throw '您无法操作签字/签章';
+                            }
                         }
+
                         responseData.data = await ctx.service.paymentRptAudit.updateSignatureMsg(ctx.detail.id, ctx.session.sessionUser.accountId, data.signature_msg);
                         break;
                     case 'add_audit':
@@ -637,10 +642,16 @@ module.exports = app => {
 
                 // 获取列表
                 const trDetailList = await ctx.service.paymentDetail.getValidDetails(trInfo.id);
+                const accountList = await ctx.service.projectAccount.getAllDataByCondition({
+                    where: { project_id: ctx.session.sessionProject.id, enable: 1 },
+                    columns: ['id', 'name', 'company', 'role', 'enable', 'is_admin', 'account_group', 'mobile'],
+                });
                 for (const s of trDetailList) {
                     // s.curAuditor = null;
                     // 根据期状态返回展示用户
                     s.curAuditor = await ctx.service.paymentDetailAudit.getAuditorByStatus(s.id, s.status, s.times);
+                    const userInfo = ctx.helper._.find(accountList, { id: s.uid });
+                    s.user_name = userInfo ? userInfo.name : '';
                 }
                 const renderData = {
                     tender: ctx.tender,

+ 11 - 9
app/view/payment/list.ejs

@@ -35,26 +35,28 @@
                                 <table class="table table-bordered">
                                     <thead>
                                     <tr>
-                                        <th>期数</th>
-                                        <th>编号</th>
-                                        <th>创建时间</th>
-                                        <th>审批进度</th>
-                                        <th>操作</th>
+                                        <th class="text-center">期数</th>
+                                        <th class="text-center">编号</th>
+                                        <th class="text-center">上报人</th>
+                                        <th class="text-center">创建时间</th>
+                                        <th class="text-center">审批进度</th>
+                                        <th class="text-center">操作</th>
                                     </tr>
                                     </thead>
                                     <tbody>
                                     <% for (const info of trDetailList) { %>
                                     <tr>
-                                        <td>第<%- info.order %>期</td>
-                                        <td><a href="/payment/<%- info.tender_id %>/detail/<%- info.id %>"><%- info.code %></a></td>
-                                        <td><%- info.s_time %></td>
+                                        <td class="text-center">第<%- info.order %>期</td>
+                                        <td class="text-center"><a href="/payment/<%- info.tender_id %>/detail/<%- info.id %>"><%- info.code %></a></td>
+                                        <td class="text-center"><%- info.user_name %></td>
+                                        <td class="text-center"><%- info.s_time %></td>
                                         <td class="<%- auditConst.auditProgressClass[info.status] %>">
                                             <% if (info.curAuditor) { %>
                                                 <a href="#sp-list" data-toggle="modal" data-target="#sp-list" m-order="<%- info.order %>"><%- info.curAuditor.name %><%if (info.curAuditor.role !== '' && info.curAuditor.role !== null) { %>-<%- info.curAuditor.role %><% } %></a>
                                             <% } %>
                                             <%- auditConst.auditProgress[info.status] %>
                                         </td>
-                                        <td>
+                                        <td class="text-center">
                                             <% if (info.status === auditConst.status.uncheck && info.uid === ctx.session.sessionUser.accountId) { %>
                                                 <a href="<%- '/payment/' + ctx.tender.id + '/detail/' + info.id %>" class="btn <%- auditConst.statusButtonClass[info.status] %> btn-sm"><%- auditConst.statusButton[info.status] %></a>
                                             <% } else if (info.status === auditConst.status.checkNo && info.curAuditor && info.uid === ctx.session.sessionUser.accountId) { %>