瀏覽代碼

审核比较调整

MaiXinRong 5 年之前
父節點
當前提交
77bc91fc10
共有 2 個文件被更改,包括 17 次插入6 次删除
  1. 5 0
      app/controller/stage_controller.js
  2. 12 6
      app/view/stage/compare_modal.ejs

+ 5 - 0
app/controller/stage_controller.js

@@ -1119,6 +1119,11 @@ module.exports = app => {
             try {
                 await this._getStageAuditViewData(ctx);
                 const renderData = await this._getDefaultRenderData(ctx);
+                if (ctx.stage.times !== ctx.stage.curTimes) {
+                    renderData.compareAuditors = ctx.stage.auditHistory[ctx.stage.curTimes - 1];
+                } else {
+                    renderData.compareAuditors = ctx.stage.auditors;
+                }
                 [renderData.ledgerSpread, renderData.posSpread] = getCompareSpreadSetting();
                 renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.stage.compare);
                 await this.layout('stage/compare.ejs', renderData, 'stage/compare_modal.ejs');

+ 12 - 6
app/view/stage/compare_modal.ejs

@@ -9,16 +9,22 @@
             <div class="modal-body">
                 <table class="table table-sm">
                     <tr><th>审批人</th><th width="90">选择</th><th></th></tr>
-                    <% for (const [i, a] of ctx.stage.auditors.entries()) { %>
-                    <% if (a.status === auditConst.status.checked || a.status === auditConst.status.checkNoPre || a.status === auditConst.status.checkAgain ||
-                            (a.status === auditConst.status.checking && a.aid === ctx.session.sessionUser.accountId)) { %>
+                    <% for (const [i, a] of compareAuditors.entries()) { %>
                     <tr auditorId="<%- a.aid %>">
                         <td><%- a.name %></td>
-                        <td><% if (a.status !== auditConst.status.checkAgain) {%><input type="checkbox" audit-order="<%- i + 1 %>"><% } %></td>
-                        <td class="text-center <%- auditConst.statusClass[a.status] %>" style="width: 80px"><%- auditConst.statusString[a.status] %></td>
+                        <td>
+                            <% if (a.status === auditConst.status.checked || a.status === auditConst.status.checkNo || a.status === auditConst.status.checkNoPre ||
+                                    (a.status === auditConst.status.checking && a.aid === ctx.session.sessionUser.accountId)) {%>
+                            <input type="checkbox" audit-order="<%- i + 1 %>">
+                            <% } %>
+                        </td>
+                        <td class="text-center <%- auditConst.statusClass[a.status] %>" style="width: 80px">
+                            <% if (a.status !== auditConst.status.uncheck) {%>
+                            <%- auditConst.statusString[a.status] %>
+                            <% } %>
+                        </td>
                     </tr>
                     <% } %>
-                    <% } %>
                 </table>
             </div>
             <div class="modal-footer">