laiguoran 4 gadi atpakaļ
vecāks
revīzija
336bf180b2

+ 4 - 2
app/controller/material_controller.js

@@ -216,7 +216,9 @@ module.exports = app => {
                 }
             }
             // 获取审批流程中左边列表
-            ctx.material.auditors2 = await ctx.service.materialAudit.getAuditorsWithOwner(ctx.material.id, ctx.material.times);
+            ctx.material.auditors2 = ctx.material.status === auditConst.status.checkNo && ctx.material.user_id !== ctx.session.sessionUser.accountId ?
+                await ctx.service.materialAudit.getAuditorsWithOwner(ctx.material.id, times) :
+                await ctx.service.materialAudit.getAuditorsWithOwner(ctx.material.id, ctx.material.times);
             if (ctx.material.status === auditConst.status.uncheck || ctx.material.status === auditConst.status.checkNo) {
                 ctx.material.auditorList = await ctx.service.materialAudit.getAuditors(ctx.material.id, ctx.material.times);
             }
@@ -741,7 +743,7 @@ module.exports = app => {
                 if (exist) {
                     throw '该审核人已存在,请勿重复添加';
                 }
-                const is_gdzs = ctx.tender.info.shenpi && JSON.parse(ctx.tender.info.shenpi).material === shenpiConst.sp_status.gdzs ? 1 : 0;
+                const is_gdzs = ctx.tender.info.shenpi.material === shenpiConst.sp_status.gdzs ? 1 : 0;
                 const result = await ctx.service.materialAudit.addAuditor(ctx.material.id, id, ctx.material.times, is_gdzs);
                 if (!result) {
                     throw '添加审核人失败';

+ 3 - 0
app/middleware/material_check.js

@@ -122,6 +122,9 @@ module.exports = options => {
                     // 判断最后一个id是否与固定终审id相同,不同则删除原审批流中如果存在的id和添加终审
                     if (shenpiInfo && shenpiInfo.audit_id !== _.last(auditIdList)) {
                         yield this.service.materialAudit.updateLastAudit(material, auditList, shenpiInfo.audit_id);
+                    } else if (!shenpiInfo) {
+                        // 不存在终审人的状态下这里恢复为授权审批人
+                        this.tender.info.shenpi.material = shenpiConst.sp_status.sqspr;
                     }
                 }
             }

+ 1 - 1
app/public/js/shenpi.js

@@ -11,7 +11,7 @@
 $(document).ready(function () {
     let timer = null;
     let oldSearchVal = null;
-    $('body').bind('input propertychange', '.gr-search', function(e) {
+    $('body').on('input propertychange', '.gr-search', function(e) {
         oldSearchVal = e.target.value;
         timer && clearTimeout(timer);
         timer = setTimeout(() => {

+ 3 - 3
app/view/tender/shenpi.ejs

@@ -57,7 +57,7 @@
                                                                 <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>" data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
                                                                 <div class="dd-content" data-toggleid="<%- idx %>">
                                                                     <% group.groupList.forEach(item => { %>
-                                                                        <% if (item.id !== ctx.session.sessionUser.accountId) { %>
+                                                                        <% if (item.id !== ctx.tender.data.user_id) { %>
                                                                             <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
                                                                     <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
                                                                                 class="ml-auto"><%- item.mobile %></span></p>
@@ -108,7 +108,7 @@
                                                                 <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>" data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
                                                                     <div class="dd-content" data-toggleid="<%- idx %>">
                                                                     <% group.groupList.forEach(item => { %>
-                                                                        <% if (item.id !== ctx.session.sessionUser.accountId) { %>
+                                                                        <% if (item.id !== ctx.tender.data.user_id) { %>
                                                                         <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
                                                                         <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
                                                                                     class="ml-auto"><%- item.mobile %></span></p>
@@ -144,7 +144,7 @@
     const sp_status_list = JSON.parse('<%- JSON.stringify(shenpi.sp_status_list) %>');
     const accountGroup = JSON.parse('<%- JSON.stringify(accountGroup) %>');
     const accountList = JSON.parse('<%- JSON.stringify(accountList) %>');
-    const cur_uid = parseInt('<%- ctx.session.sessionUser.accountId %>');
+    const cur_uid = parseInt('<%- ctx.tender.data.user_id %>');
 </script>
 <script src="/public/js/shenpi.js"></script>
 <script>