|
@@ -0,0 +1,832 @@
|
|
|
+<% if ((ctx.detail.status === auditConst.status.uncheck || ctx.detail.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === ctx.detail.uid) { %>
|
|
|
+ <!--上报审批-->
|
|
|
+ <div class="modal fade" id="sub-sp" data-backdrop="static">
|
|
|
+ <div class="modal-dialog" role="document">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h5 class="modal-title">上报审批</h5>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <div class="dropdown text-right">
|
|
|
+ <% if (trInfo.sp_status !== shenpiConst.sp_status.gdspl && ctx.session.sessionUser.accountId === ctx.detail.uid) { %>
|
|
|
+ <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button"
|
|
|
+ id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
|
|
|
+ aria-expanded="false">
|
|
|
+ 添加审批流程
|
|
|
+ </button>
|
|
|
+ <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"
|
|
|
+ style="width:220px">
|
|
|
+ <div class="mb-2 p-2"><input class="form-control form-control-sm"
|
|
|
+ placeholder="姓名/手机 检索" id="gr-search" autocomplete="off"></div>
|
|
|
+ <dl class="list-unstyled book-list">
|
|
|
+ <% accountGroup.forEach((group, idx) => { %>
|
|
|
+ <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) { %>
|
|
|
+ <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>
|
|
|
+ <span class="text-muted"><%- item.role %></span>
|
|
|
+ </dd>
|
|
|
+ <% } %>
|
|
|
+ <% });%>
|
|
|
+ </div>
|
|
|
+ <% }) %>
|
|
|
+ </dl>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+ <div class="card mt-3">
|
|
|
+ <div class="card-header">
|
|
|
+ 审批流程
|
|
|
+ </div>
|
|
|
+ <div class="modal-height-500" style="overflow: auto">
|
|
|
+ <ul class="list-group list-group-flush" id="auditors">
|
|
|
+ <% for (let i = 0, iLen = ctx.detail.auditorList.length; i < iLen; i++) { %>
|
|
|
+ <li class="list-group-item" auditorId="<%- ctx.detail.auditorList[i].aid %>">
|
|
|
+ <% if ((trInfo.sp_status === shenpiConst.sp_status.sqspr ||
|
|
|
+ (trInfo.sp_status === shenpiConst.sp_status.gdzs && i+1 !== iLen)) && ctx.session.sessionUser.accountId === ctx.detail.uid) { %>
|
|
|
+ <a href="javascript: void(0)" class="text-danger pull-right">移除</a>
|
|
|
+ <% } %>
|
|
|
+ <span><%- ctx.detail.auditorList[i].order %> <%- ctx.detail.auditorList[i].name %></span>
|
|
|
+ <small class="text-muted"><%- ctx.detail.auditorList[i].role %></small>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
|
|
|
+ <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
|
|
|
+ <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
|
|
|
+ <% if (ctx.session.sessionUser.accountId === ctx.detail.uid) { %>
|
|
|
+ <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
|
|
|
+ <% } %>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+<% } %>
|
|
|
+
|
|
|
+<!--审批流程/结果-->
|
|
|
+<div class="modal fade" id="sp-list" data-backdrop="static">
|
|
|
+ <div class="modal-dialog modal-lg" role="document">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h5 class="modal-title"><%- ctx.detail.status === auditConst.status.checking ? '审批流程' : '重新上报' %></h5>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-4">
|
|
|
+ <% if(ctx.detail.status === auditConst.status.checkNo) { %>
|
|
|
+ <a class="sp-list-item" href="#sub-sp" data-toggle="modal" data-target="#sub-sp" id="hideSp">修改审批流程</a>
|
|
|
+ <% } %>
|
|
|
+ <div class="card mt-3">
|
|
|
+ <ul class="list-group list-group-flush" id="auditors-list">
|
|
|
+ <% ctx.detail.auditors2.forEach((item, idx) => { %>
|
|
|
+ <% if (idx === 0) { %>
|
|
|
+ <li class="list-group-item" data-auditorId="<%- item.aid %>">
|
|
|
+ <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- item.name %>
|
|
|
+ <small class="text-muted"><%- item.role %></small>
|
|
|
+ <span class="pull-right">原报</span>
|
|
|
+ </li>
|
|
|
+ <% } else if(idx === ctx.detail.auditors2.length -1 && idx !== 0) { %>
|
|
|
+ <li class="list-group-item" data-auditorId="<%- item.aid %>">
|
|
|
+ <i class="fa fa fa-stop-circle"></i> <%- item.name %>
|
|
|
+ <small class="text-muted"><%- item.role %></small>
|
|
|
+ <span class="pull-right">终审</span>
|
|
|
+ </li>
|
|
|
+ <% } else {%>
|
|
|
+ <li class="list-group-item" data-auditorId="<%- item.aid %>">
|
|
|
+ <i class="fa fa-chevron-circle-down"></i> <%- item.name %>
|
|
|
+ <small class="text-muted"><%- item.role %></small>
|
|
|
+ <span class="pull-right"><%= ctx.helper.transFormToChinese(idx) %>审</span>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
+ <% }) %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-8 modal-height-500" style="overflow: auto">
|
|
|
+ <% ctx.detail.auditHistory.forEach((auditors, idx) => { %>
|
|
|
+ <!-- 展开/收起历史流程 -->
|
|
|
+ <% if(idx === ctx.detail.auditHistory.length - 1 && ctx.detail.auditHistory.length !== 1) { %>
|
|
|
+ <div class="text-right">
|
|
|
+ <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <div class="<%- idx < ctx.detail.auditHistory.length - 1 ? 'fold-card' : '' %>">
|
|
|
+ <div class="text-center text-muted"><%- idx+1 %>#</div>
|
|
|
+ <ul class="timeline-list list-unstyled mt-2">
|
|
|
+ <% auditors.forEach((auditor, index) => { %>
|
|
|
+ <% if (index === 0) { %>
|
|
|
+ <li class="timeline-list-item pb-2">
|
|
|
+ <div class="timeline-item-date">
|
|
|
+ <%- ctx.helper.formatDate(auditor.begin_time) %>
|
|
|
+ </div>
|
|
|
+ <div class="timeline-item-tail"></div>
|
|
|
+ <div class="timeline-item-icon bg-success text-light">
|
|
|
+ <i class="fa fa-caret-down"></i>
|
|
|
+ </div>
|
|
|
+ <div class="timeline-item-content">
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-body p-3">
|
|
|
+ <div class="card-text">
|
|
|
+ <p class="mb-1"><span
|
|
|
+ class="h5"><%- ctx.detail.user.name %></span><span
|
|
|
+ class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
|
|
|
+ </p>
|
|
|
+ <p class="text-muted mb-0"><%- ctx.detail.user.role %></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="timeline-list-item pb-2">
|
|
|
+ <div class="timeline-item-date">
|
|
|
+ <%- ctx.helper.formatDate(auditor.end_time) %>
|
|
|
+ </div>
|
|
|
+ <% if(index < auditors.length - 1) { %>
|
|
|
+ <div class="timeline-item-tail"></div>
|
|
|
+ <% } %>
|
|
|
+ <% if(auditor.status === auditConst.status.checked) { %>
|
|
|
+ <div class="timeline-item-icon bg-success text-light">
|
|
|
+ <i class="fa fa-check"></i>
|
|
|
+ </div>
|
|
|
+ <% } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {%>
|
|
|
+ <div class="timeline-item-icon bg-warning text-light">
|
|
|
+ <i class="fa fa-level-up"></i>
|
|
|
+ </div>
|
|
|
+ <% } else if(auditor.status === auditConst.status.checking) { %>
|
|
|
+ <div class="timeline-item-icon bg-warning text-light">
|
|
|
+ <i class="fa fa-ellipsis-h"></i>
|
|
|
+ </div>
|
|
|
+ <% } else {%>
|
|
|
+ <div class="timeline-item-icon bg-secondary text-light">
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <div class="timeline-item-content">
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-body p-3">
|
|
|
+ <div class="card-text">
|
|
|
+ <p class="mb-1"><span class="h5"><%- auditor.name %></span><span
|
|
|
+ class="pull-right <%- auditConst.statusClass[auditor.status] %>"><%- auditConst.statusString[auditor.status] %></span>
|
|
|
+ </p>
|
|
|
+ <p class="text-muted mb-0"><%- auditor.role %></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!--审批意见-->
|
|
|
+ <% if (auditor.opinion) { %>
|
|
|
+ <div class="card-body p-3 border-top">
|
|
|
+ <p style="margin: 0;"><%- auditor.opinion %></p>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <% } else {%>
|
|
|
+ <li class="timeline-list-item pb-2">
|
|
|
+ <div class="timeline-item-date">
|
|
|
+ <%- ctx.helper.formatDate(auditor.end_time) %>
|
|
|
+ </div>
|
|
|
+ <% if(index < auditors.length - 1) { %>
|
|
|
+ <div class="timeline-item-tail"></div>
|
|
|
+ <% } %>
|
|
|
+ <% if(auditor.status === auditConst.status.checked) { %>
|
|
|
+ <div class="timeline-item-icon bg-success text-light">
|
|
|
+ <i class="fa fa-check"></i>
|
|
|
+ </div>
|
|
|
+ <% } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {%>
|
|
|
+ <div class="timeline-item-icon bg-warning text-light">
|
|
|
+ <i class="fa fa-level-up"></i>
|
|
|
+ </div>
|
|
|
+ <% } else if(auditor.status === auditConst.status.checking) { %>
|
|
|
+ <div class="timeline-item-icon bg-warning text-light">
|
|
|
+ <i class="fa fa-ellipsis-h"></i>
|
|
|
+ </div>
|
|
|
+ <% } else { %>
|
|
|
+ <div class="timeline-item-icon bg-secondary text-light">
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <div class="timeline-item-content">
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-body p-3">
|
|
|
+ <div class="card-text">
|
|
|
+ <p class="mb-1"><span class="h5"><%- auditor.name %></span>
|
|
|
+ <span
|
|
|
+ class="pull-right
|
|
|
+ <%- auditConst.statusClass[auditor.status] %>"><%- auditor.status !== auditConst.status.uncheck ? auditConst.statusString[auditor.status] : ''%>
|
|
|
+ <%- auditor.status === auditConst.status.checkNo ? ctx.detail.user.name : '' %>
|
|
|
+ <%- auditor.status === auditConst.status.checkNoPre ? auditors.find(item => item.sort === auditor.sort-1).name : '' %>
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+ <p class="text-muted mb-0"><%- auditor.role %></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--审批意见-->
|
|
|
+ <% if (auditor.opinion) { %>
|
|
|
+ <div class="card-body p-3 border-top">
|
|
|
+ <p style="margin: 0;"><%- auditor.opinion %></p>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
+ <% }) %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <% }) %>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
|
|
|
+ <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
|
|
|
+ <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
|
|
|
+ <% if(ctx.detail.status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === ctx.detail.uid) { %>
|
|
|
+ <button class="btn btn-primary btn-sm sp-list-item" type="submit">确认上报</button>
|
|
|
+ <% } %>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<% if (ctx.detail.status === auditConst.status.checking || ctx.detail.status === auditConst.status.checkNoPre) { %>
|
|
|
+ <% if (ctx.detail.curAuditor && ctx.detail.curAuditor.aid === ctx.session.sessionUser.accountId) { %>
|
|
|
+ <!--审批通过-->
|
|
|
+ <div class="modal fade sp-location-list" id="sp-done" data-backdrop="static">
|
|
|
+ <div class="modal-dialog modal-lg" role="document">
|
|
|
+ <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck(0);">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h5 class="modal-title">审批通过</h5>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-4">
|
|
|
+ <div class="card mt-3">
|
|
|
+ <ul class="list-group list-group-flush">
|
|
|
+ <% ctx.detail.auditors2.forEach((item, idx) => { %>
|
|
|
+ <% if (idx === 0) { %>
|
|
|
+ <li class="list-group-item" data-auditorId="<%- item.aid %>">
|
|
|
+ <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- item.name %>
|
|
|
+ <small class="text-muted"><%- item.role %></small>
|
|
|
+ <span class="pull-right">原报</span>
|
|
|
+ </li>
|
|
|
+ <% } else if(idx === ctx.detail.auditors2.length -1 && idx !== 0) { %>
|
|
|
+ <li class="list-group-item" data-auditorId="<%- item.aid %>">
|
|
|
+ <i class="fa fa fa-stop-circle"></i> <%- item.name %>
|
|
|
+ <small class="text-muted"><%- item.role %></small>
|
|
|
+ <span class="pull-right">终审</span>
|
|
|
+ </li>
|
|
|
+ <% } else {%>
|
|
|
+ <li class="list-group-item" data-auditorId="<%- item.aid %>">
|
|
|
+ <i class="fa fa-chevron-circle-down"></i> <%- item.name %>
|
|
|
+ <small class="text-muted"><%- item.role %></small>
|
|
|
+ <span class="pull-right"><%= ctx.helper.transFormToChinese(idx) %>审</span>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
+ <% }) %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-8 modal-height-500" style="overflow: auto">
|
|
|
+ <% ctx.detail.auditHistory.forEach((auditors, idx) => { %>
|
|
|
+ <!-- 展开/收起历史流程 -->
|
|
|
+ <% if(idx === ctx.detail.auditHistory.length - 1 && ctx.detail.auditHistory.length !== 1) { %>
|
|
|
+ <div class="text-right">
|
|
|
+ <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <div class="<%- idx < ctx.detail.auditHistory.length - 1 ? 'fold-card' : '' %>">
|
|
|
+ <div class="text-center text-muted"><%- idx+1 %>#</div>
|
|
|
+ <ul class="timeline-list list-unstyled mt-2">
|
|
|
+ <% auditors.forEach((auditor, index) => { %>
|
|
|
+ <% if (index === 0) { %>
|
|
|
+ <li class="timeline-list-item pb-2">
|
|
|
+ <div class="timeline-item-date">
|
|
|
+ <%- ctx.helper.formatDate(auditor.begin_time) %>
|
|
|
+ </div>
|
|
|
+ <div class="timeline-item-tail"></div>
|
|
|
+ <div class="timeline-item-icon bg-success text-light">
|
|
|
+ <i class="fa fa-caret-down"></i>
|
|
|
+ </div>
|
|
|
+ <div class="timeline-item-content">
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-body p-3">
|
|
|
+ <div class="card-text">
|
|
|
+ <p class="mb-1"><span
|
|
|
+ class="h5"><%- ctx.detail.user.name %></span><span
|
|
|
+ class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
|
|
|
+ </p>
|
|
|
+ <p class="text-muted mb-0"><%- ctx.detail.user.role %></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="timeline-list-item pb-2">
|
|
|
+ <div class="timeline-item-date">
|
|
|
+ <%- ctx.helper.formatDate(auditor.end_time) %>
|
|
|
+ </div>
|
|
|
+ <% if(index < auditors.length - 1) { %>
|
|
|
+ <div class="timeline-item-tail"></div>
|
|
|
+ <% } %>
|
|
|
+ <% if(auditor.status === auditConst.status.checked) { %>
|
|
|
+ <div class="timeline-item-icon bg-success text-light">
|
|
|
+ <i class="fa fa-check"></i>
|
|
|
+ </div>
|
|
|
+ <% } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {%>
|
|
|
+ <div class="timeline-item-icon bg-warning text-light">
|
|
|
+ <i class="fa fa-level-up"></i>
|
|
|
+ </div>
|
|
|
+ <% } else if(auditor.status === auditConst.status.checking) { %>
|
|
|
+ <div class="timeline-item-icon bg-warning text-light">
|
|
|
+ <i class="fa fa-ellipsis-h"></i>
|
|
|
+ </div>
|
|
|
+ <% } else {%>
|
|
|
+ <div class="timeline-item-icon bg-secondary text-light">
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <div class="timeline-item-content">
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-body p-3">
|
|
|
+ <div class="card-text">
|
|
|
+ <p class="mb-1"><span class="h5"><%- auditor.name %></span><span
|
|
|
+ class="pull-right <%- auditConst.statusClass[auditor.status] %>"><%- auditConst.statusString[auditor.status] %></span>
|
|
|
+ </p>
|
|
|
+ <p class="text-muted mb-0"><%- auditor.role %></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--审批意见-->
|
|
|
+ <% if(auditor.status !== auditConst.status.uncheck) { %>
|
|
|
+ <% if (ctx.detail.times === idx + 1 && auditor.status === auditConst.status.checking) { %>
|
|
|
+ <div class="card-body p-3 border-top">
|
|
|
+ <label>审批意见<b class="text-danger">*</b></label>
|
|
|
+ <textarea class="form-control form-control-sm"
|
|
|
+ name="opinion">同意</textarea>
|
|
|
+ </div>
|
|
|
+ <% } else if (auditor.opinion) { %>
|
|
|
+ <div class="card-body p-3 border-top">
|
|
|
+ <p style="margin: 0;"><%- auditor.opinion %></p>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <% } else {%>
|
|
|
+ <li class="timeline-list-item pb-2">
|
|
|
+ <div class="timeline-item-date">
|
|
|
+ <%- ctx.helper.formatDate(auditor.end_time) %>
|
|
|
+ </div>
|
|
|
+ <% if(index < auditors.length - 1) { %>
|
|
|
+ <div class="timeline-item-tail"></div>
|
|
|
+ <% } %>
|
|
|
+ <% if(auditor.status === auditConst.status.checked) { %>
|
|
|
+ <div class="timeline-item-icon bg-success text-light">
|
|
|
+ <i class="fa fa-check"></i>
|
|
|
+ </div>
|
|
|
+ <% } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {%>
|
|
|
+ <div class="timeline-item-icon bg-warning text-light">
|
|
|
+ <i class="fa fa-level-up"></i>
|
|
|
+ </div>
|
|
|
+ <% } else if(auditor.status === auditConst.status.checking) { %>
|
|
|
+ <div class="timeline-item-icon bg-warning text-light">
|
|
|
+ <i class="fa fa-ellipsis-h"></i>
|
|
|
+ </div>
|
|
|
+ <% } else { %>
|
|
|
+ <div class="timeline-item-icon bg-secondary text-light">
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <div class="timeline-item-content">
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-body p-3">
|
|
|
+ <div class="card-text">
|
|
|
+ <p class="mb-1"><span class="h5"><%- auditor.name %></span>
|
|
|
+ <span
|
|
|
+ class="pull-right
|
|
|
+ <%- auditConst.statusClass[auditor.status] %>"><%- auditor.status !== auditConst.status.uncheck ? auditConst.statusString[auditor.status] : ''%>
|
|
|
+ <%- auditor.status === auditConst.status.checkNo ? ctx.detail.user.name : '' %>
|
|
|
+ <%- auditor.status === auditConst.status.checkNoPre ? auditors.find(item => item.sort === auditor.sort-1).name : '' %>
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+ <p class="text-muted mb-0"><%- auditor.role %></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--审批意见-->
|
|
|
+ <% if(auditor.status !== auditConst.status.uncheck) { %>
|
|
|
+ <% if (ctx.detail.times === idx + 1 && auditor.status === auditConst.status.checking) { %>
|
|
|
+ <div class="card-body p-3 border-top">
|
|
|
+ <label>审批意见<b class="text-danger">*</b></label>
|
|
|
+ <textarea class="form-control form-control-sm"
|
|
|
+ name="opinion">同意</textarea>
|
|
|
+ </div>
|
|
|
+ <% } else if (auditor.opinion) { %>
|
|
|
+ <div class="card-body p-3 border-top">
|
|
|
+ <p style="margin: 0;"><%- auditor.opinion %></p>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
+ <% }) %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <% }) %>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
|
|
|
+ <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
|
|
|
+ <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
|
|
|
+ <button type="submit" class="btn btn-success btn-sm">确认通过</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--审批退回-->
|
|
|
+ <div class="modal fade sp-location-list" id="sp-back" data-backdrop="static">
|
|
|
+ <div class="modal-dialog modal-lg" role="document">
|
|
|
+ <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post"
|
|
|
+ onsubmit="return auditCheck(1);">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h5 class="modal-title">审批退回</h5>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-4">
|
|
|
+ <div class="card mt-3">
|
|
|
+ <ul class="list-group list-group-flush">
|
|
|
+ <% ctx.detail.auditors2.forEach((item, idx) => { %>
|
|
|
+ <% if (idx === 0) { %>
|
|
|
+ <li class="list-group-item" data-auditorId="<%- item.aid %>">
|
|
|
+ <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- item.name %>
|
|
|
+ <small class="text-muted"><%- item.role %></small>
|
|
|
+ <span class="pull-right">原报</span>
|
|
|
+ </li>
|
|
|
+ <% } else if(idx === ctx.detail.auditors2.length -1 && idx !== 0) { %>
|
|
|
+ <li class="list-group-item" data-auditorId="<%- item.aid %>">
|
|
|
+ <i class="fa fa fa-stop-circle"></i> <%- item.name %>
|
|
|
+ <small class="text-muted"><%- item.role %></small>
|
|
|
+ <span class="pull-right">终审</span>
|
|
|
+ </li>
|
|
|
+ <% } else {%>
|
|
|
+ <li class="list-group-item" data-auditorId="<%- item.aid %>">
|
|
|
+ <i class="fa fa-chevron-circle-down"></i> <%- item.name %>
|
|
|
+ <small class="text-muted"><%- item.role %></small>
|
|
|
+ <span class="pull-right"><%= ctx.helper.transFormToChinese(idx) %>审</span>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
+ <% }) %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-8 modal-height-500" style="overflow: auto">
|
|
|
+ <% ctx.detail.auditHistory.forEach((auditors, idx) => { %>
|
|
|
+ <!-- 展开/收起历史流程 -->
|
|
|
+ <% if(idx === ctx.detail.auditHistory.length - 1 && ctx.detail.auditHistory.length !== 1) { %>
|
|
|
+ <div class="text-right">
|
|
|
+ <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <div class="<%- idx < ctx.detail.auditHistory.length - 1 ? 'fold-card' : '' %>">
|
|
|
+ <div class="text-center text-muted"><%- idx+1 %>#</div>
|
|
|
+ <ul class="timeline-list list-unstyled mt-2">
|
|
|
+ <% auditors.forEach((auditor, index) => { %>
|
|
|
+ <% if (index === 0) { %>
|
|
|
+ <li class="timeline-list-item pb-2">
|
|
|
+ <div class="timeline-item-date">
|
|
|
+ <%- ctx.helper.formatDate(auditor.begin_time) %>
|
|
|
+ </div>
|
|
|
+ <div class="timeline-item-tail"></div>
|
|
|
+ <div class="timeline-item-icon bg-success text-light">
|
|
|
+ <i class="fa fa-caret-down"></i>
|
|
|
+ </div>
|
|
|
+ <div class="timeline-item-content">
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-body p-3">
|
|
|
+ <div class="card-text">
|
|
|
+ <p class="mb-1"><span
|
|
|
+ class="h5"><%- ctx.detail.user.name %></span><span
|
|
|
+ class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
|
|
|
+ </p>
|
|
|
+ <p class="text-muted mb-0"><%- ctx.detail.user.role %></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="timeline-list-item pb-2">
|
|
|
+ <div class="timeline-item-date">
|
|
|
+ <%- ctx.helper.formatDate(auditor.end_time) %>
|
|
|
+ </div>
|
|
|
+ <% if(index < auditors.length - 1) { %>
|
|
|
+ <div class="timeline-item-tail"></div>
|
|
|
+ <% } %>
|
|
|
+ <% if(auditor.status === auditConst.status.checked) { %>
|
|
|
+ <div class="timeline-item-icon bg-success text-light">
|
|
|
+ <i class="fa fa-check"></i>
|
|
|
+ </div>
|
|
|
+ <% } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {%>
|
|
|
+ <div class="timeline-item-icon bg-warning text-light">
|
|
|
+ <i class="fa fa-level-up"></i>
|
|
|
+ </div>
|
|
|
+ <% } else if(auditor.status === auditConst.status.checking) { %>
|
|
|
+ <div class="timeline-item-icon bg-warning text-light">
|
|
|
+ <i class="fa fa-ellipsis-h"></i>
|
|
|
+ </div>
|
|
|
+ <% } else {%>
|
|
|
+ <div class="timeline-item-icon bg-secondary text-light">
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <div class="timeline-item-content">
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-body p-3">
|
|
|
+ <div class="card-text">
|
|
|
+ <p class="mb-1"><span class="h5"><%- auditor.name %></span><span
|
|
|
+ class="pull-right <%- auditConst.statusClass[auditor.status] %>"><%- auditConst.statusString[auditor.status] %></span>
|
|
|
+ </p>
|
|
|
+ <p class="text-muted mb-0"><%- auditor.role %></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!--审批意见-->
|
|
|
+ <% if(auditor.times === ctx.detail.times && auditor.status !== auditConst.status.uncheck) { %>
|
|
|
+ <div class="card-body p-3 border-top">
|
|
|
+ <% if (ctx.detail.times === idx + 1 && auditor.status === auditConst.status.checking) { %>
|
|
|
+ <label>审批意见<b class="text-danger">*</b></label>
|
|
|
+ <textarea class="form-control form-control-sm"
|
|
|
+ name="opinion">不同意</textarea>
|
|
|
+ <% if (ctx.detail.curAuditor.aid === auditor.aid) { %>
|
|
|
+ <div id="reject-process" class="alert alert-warning"
|
|
|
+ style="margin-top: 15px;">
|
|
|
+ <div class="form-check form-check-inline">
|
|
|
+ <input class="form-check-input" type="radio" name="checkType"
|
|
|
+ id="inlineRadio1" value="<%- auditConst.status.checkNo %>">
|
|
|
+ <label class="form-check-label" for="inlineRadio1">退回原报
|
|
|
+ <%- ctx.detail.user.name %></label>
|
|
|
+ </div>
|
|
|
+ <% if (auditor.order > 1 && auditor.aid !== auditors[0].aid) { %>
|
|
|
+ <div class="form-check form-check-inline">
|
|
|
+ <input class="form-check-input" type="radio" name="checkType"
|
|
|
+ id="inlineRadio2"
|
|
|
+ value="<%- auditConst.status.checkNoPre %>">
|
|
|
+ <label class="form-check-label" for="inlineRadio2">退回上一审批人
|
|
|
+ <%- auditors.find(item => item.sort === auditor.sort-1).name %></label>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <% } else if(auditor.status === auditConst.status.checked && auditor.opinion){ %>
|
|
|
+ <p style="margin: 0;"><%- auditor.opinion %></p>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <% } else {%>
|
|
|
+ <li class="timeline-list-item pb-2">
|
|
|
+ <div class="timeline-item-date">
|
|
|
+ <%- ctx.helper.formatDate(auditor.end_time) %>
|
|
|
+ </div>
|
|
|
+ <% if(index < auditors.length - 1) { %>
|
|
|
+ <div class="timeline-item-tail"></div>
|
|
|
+ <% } %>
|
|
|
+ <% if(auditor.status === auditConst.status.checked) { %>
|
|
|
+ <div class="timeline-item-icon bg-success text-light">
|
|
|
+ <i class="fa fa-check"></i>
|
|
|
+ </div>
|
|
|
+ <% } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {%>
|
|
|
+ <div class="timeline-item-icon bg-warning text-light">
|
|
|
+ <i class="fa fa-level-up"></i>
|
|
|
+ </div>
|
|
|
+ <% } else if(auditor.status === auditConst.status.checking) { %>
|
|
|
+ <div class="timeline-item-icon bg-warning text-light">
|
|
|
+ <i class="fa fa-ellipsis-h"></i>
|
|
|
+ </div>
|
|
|
+ <% } else { %>
|
|
|
+ <div class="timeline-item-icon bg-secondary text-light">
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <div class="timeline-item-content">
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-body p-3">
|
|
|
+ <div class="card-text">
|
|
|
+ <p class="mb-1"><span class="h5"><%- auditor.name %></span>
|
|
|
+ <span
|
|
|
+ class="pull-right
|
|
|
+ <%- auditConst.statusClass[auditor.status] %>"><%- auditor.status !== auditConst.status.uncheck ? auditConst.statusString[auditor.status] : ''%>
|
|
|
+ <%- auditor.status === auditConst.status.checkNo ? ctx.detail.user.name : '' %>
|
|
|
+ <%- auditor.status === auditConst.status.checkNoPre ? auditors.find(item => item.sort === auditor.sort-1).name : '' %>
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+ <p class="text-muted mb-0"><%- auditor.role %></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--审批意见-->
|
|
|
+ <% if(auditor.times === ctx.detail.times && auditor.status !== auditConst.status.uncheck) { %>
|
|
|
+ <div class="card-body p-3 border-top">
|
|
|
+ <% if (ctx.detail.times === idx + 1 && auditor.status === auditConst.status.checking) { %>
|
|
|
+ <label>审批意见<b class="text-danger">*</b></label>
|
|
|
+ <textarea class="form-control form-control-sm"
|
|
|
+ name="opinion">不同意</textarea>
|
|
|
+ <% if (ctx.detail.curAuditor.aid === auditor.aid ) { %>
|
|
|
+ <div id="reject-process" class="alert alert-warning"
|
|
|
+ style="margin-top: 15px;">
|
|
|
+ <div class="form-check form-check-inline">
|
|
|
+ <input class="form-check-input" type="radio" name="checkType"
|
|
|
+ id="inlineRadio1" value="<%- auditConst.status.checkNo %>">
|
|
|
+ <label class="form-check-label" for="inlineRadio1">退回原报
|
|
|
+ <%- ctx.detail.user.name %></label>
|
|
|
+ </div>
|
|
|
+ <% if (auditor.order > 1 && auditor.aid !== auditors[0].aid) { %>
|
|
|
+ <div class="form-check form-check-inline">
|
|
|
+ <input class="form-check-input" type="radio" name="checkType"
|
|
|
+ id="inlineRadio2"
|
|
|
+ value="<%- auditConst.status.checkNoPre %>">
|
|
|
+ <label class="form-check-label" for="inlineRadio2">退回上一审批人
|
|
|
+ <%- auditors.find(item => item.sort === auditor.sort-1).name %></label>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <% } else if (auditor.opinion) { %>
|
|
|
+ <p style="margin: 0;"><%- auditor.opinion %></p>
|
|
|
+ <% } %>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
+ <% }) %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <% }) %>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
|
|
|
+ <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
|
|
|
+ <button type="submit" class="btn btn-warning btn-sm">确认退回</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+<% } %>
|
|
|
+<% if (ctx.detail.auditors !== undefined && ctx.detail.auditors.length !== 0 && ctx.detail.auditors[ctx.detail.auditors.length-1].aid === ctx.session.sessionUser.accountId && ctx.detail.status === auditConst.status.checked && ctx.detail.order === ctx.detail.highOrder) { %>
|
|
|
+ <% if (ctx.detail && !ctx.detail.authMobile && ctx.session.sessionUser.loginStatus === 0) { %>
|
|
|
+ <!--终审重新审批-->
|
|
|
+ <div class="modal fade" id="sp-down-back" data-backdrop="static">
|
|
|
+ <div class="modal-dialog" role="document">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h5 class="modal-title">重新审批</h5>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <h5>重新审批需要您的手机短信验证</h5>
|
|
|
+ <h5>您目前还没设置认证手机,请先设置。</h5>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
|
|
|
+ <a href="/profile/sms" class="btn btn-sm btn-primary">去设置</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <% } else { %>
|
|
|
+ <div class="modal fade" id="sp-down-back" data-backdrop="static">
|
|
|
+ <div class="modal-dialog" role="document">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h5 class="modal-title">重新审批</h5>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <h5>确认由「终审-<%= ctx.detail.auditors[ctx.detail.auditors.length-1].name %>」重新审批「第<%= ctx.detail.order %>期」?
|
|
|
+ </h5>
|
|
|
+ <% if (ctx.session.sessionUser.loginStatus === 0) { %>
|
|
|
+ <div class="form-group">
|
|
|
+ <label>重审需要验证码确认,验证码将发送至尾号<%- ctx.detail.authMobile.slice(-4) %>的手机</label>
|
|
|
+ <div class="input-group input-group-sm mb-3">
|
|
|
+ <input class="form-control" type="text" readonly="readonly" name="code"
|
|
|
+ placeholder="输入短信中的6位验证码" />
|
|
|
+ <div class="input-group-append">
|
|
|
+ <button class="btn btn-outline-secondary" type="button" id="get-code">获取验证码</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
|
|
|
+ <!--<a href="<%- preUrl %>/audit/check/again" disabled class="btn btn-warning btn-sm">确定重审</a>-->
|
|
|
+ <button <% if (ctx.session.sessionUser.loginStatus === 0) { %>disabled<% } %> id="re-shenpi-btn"
|
|
|
+ class="btn btn-warning btn-sm">确定重审</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+<% } %>
|
|
|
+<script type="text/javascript">
|
|
|
+ const csrf = '<%= ctx.csrf %>';
|
|
|
+ const authMobile = '<%= ctx.detail.authMobile %>';
|
|
|
+</script>
|
|
|
+<% if (ctx.session.sessionUser.accountId === ctx.detail.uid && (ctx.detail.status === auditConst.status.uncheck || ctx.detail.status === auditConst.status.checkNo)) { %>
|
|
|
+ <script>
|
|
|
+ const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
|
|
|
+ const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
|
|
|
+ const shenpi_status = <%- trInfo.sp_status %>;
|
|
|
+ const shenpiConst = JSON.parse('<%- JSON.stringify(shenpiConst) %>');
|
|
|
+ </script>
|
|
|
+<% } %>
|
|
|
+<script>const cur_uid = parseInt('<%- ctx.session.sessionUser.accountId %>');</script>
|
|
|
+<script>
|
|
|
+ $('.sp-location-list').on('shown.bs.modal', function () {
|
|
|
+ const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
|
|
|
+ const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
|
|
|
+ scrollBox.scrollTop(0);
|
|
|
+ const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
|
|
|
+ const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
|
|
|
+ if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
|
|
|
+ scrollBox.scrollTop(hdheight - bdiv);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ function divSearch(div) {
|
|
|
+ if (div.length > 0) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 展开历史审核记录
|
|
|
+ $('.modal-body #fold-btn').click(function () {
|
|
|
+ const type = $(this).data('target')
|
|
|
+ const auditCard = $(this).parent().parent()
|
|
|
+ if (type === 'show') {
|
|
|
+ $(this).data('target', 'hide')
|
|
|
+ auditCard.find('.fold-card').slideDown('swing', () => {
|
|
|
+ auditCard.find('#fold-btn').text('收起历史审核记录')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ $(this).data('target', 'show')
|
|
|
+ auditCard.find('.fold-card').slideUp('swing', () => {
|
|
|
+ auditCard.find('#fold-btn').text('展开历史审核记录')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $('.sp-list-btn').click(function () {
|
|
|
+ const type = $(this).data('type')
|
|
|
+ if (type === 'hide') {
|
|
|
+ $('.sp-list-item').hide()
|
|
|
+ $('.modal-title').text('审批流程')
|
|
|
+ } else {
|
|
|
+ $('.sp-list-item').show()
|
|
|
+ $('.modal-title').text('重新上报')
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 重新审批按钮
|
|
|
+ $("#re-shenpi-btn").click(function () {
|
|
|
+ const data = {
|
|
|
+ };
|
|
|
+ <% if (ctx.session.sessionUser.loginStatus === 0) { %>
|
|
|
+ const code = $("#sp-down-back input[name='code']").val();
|
|
|
+ if ($(this).hasClass('disabled')) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (code.length < 6) {
|
|
|
+ // alert('请填写正确的验证码');
|
|
|
+ toastr.error('请填写正确的验证码');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ data.code = code;
|
|
|
+ <% } %>
|
|
|
+ $.ajax({
|
|
|
+ url: '<%- preUrl %>/audit/check/again',
|
|
|
+ type: 'get',
|
|
|
+ data: data,
|
|
|
+ dataTye: 'json',
|
|
|
+ success: function (response) {
|
|
|
+ if (response.err === 0) {
|
|
|
+ window.location.href = response.url;
|
|
|
+ } else {
|
|
|
+ toastr.error(response.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+</script>
|