|
@@ -1,4 +1,3 @@
|
|
|
-
|
|
|
<!--批量添加清单部位-->
|
|
|
<div class="modal fade" id="batch" data-backdrop="static">
|
|
|
<div class="modal-dialog modal-lg" role="document">
|
|
@@ -30,7 +29,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-<% if (revise.status === audit.status.uncheck) { %>
|
|
|
+<% if ((revise.status === audit.status.uncheck || revise.status === audit.status.checkNo) && ctx.session.sessionUser.accountId === revise.uid) { %>
|
|
|
<!--上报审批-->
|
|
|
<div class="modal fade" id="sub-sp" data-backdrop="static">
|
|
|
<div class="modal-dialog" role="document">
|
|
@@ -40,43 +39,50 @@
|
|
|
</div>
|
|
|
<div class="modal-body">
|
|
|
<div class="form-group">
|
|
|
- <label>搜索审批人</label>
|
|
|
+ <label>选择审批人</label>
|
|
|
<div class="input-group">
|
|
|
- <input class="form-control" placeholder="请输入姓名进行检索" type="text">
|
|
|
- <div class="input-group-append">
|
|
|
- <button class="btn btn-outline-secondary" type="button"><i class="fa fa-search"></i></button>
|
|
|
+ <div class="input-group-prepend">
|
|
|
+ <select class="form-control" id="account_group">
|
|
|
+ <option value="0">所有分组</option>
|
|
|
+ <% for (const dw in accountGroup) { %>
|
|
|
+ <option value="<%= dw %>"><%= accountGroup[dw] %></option>
|
|
|
+ <% } %>
|
|
|
+ </select>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="card border-primary">
|
|
|
- <div class="card-body">
|
|
|
- <h5 class="card-title">
|
|
|
- <a href="#" class="btn btn-primary btn-sm pull-right">添加</a>张三
|
|
|
- </h5>
|
|
|
- <h6 class="card-subtitle mb-2 text-muted">监理</h6>
|
|
|
- <p class="card-text">XXXXX公司</p>
|
|
|
+ <select class="form-control" id="account_list">
|
|
|
+ <option value="0">选择审批人</option>
|
|
|
+ <% for (const account of accountList) { %>
|
|
|
+ <option value="<%= account.id %>"><%= account.name %><% if (account.role !== '') { %>(<%= account.role %>)<% } %><% if (account.company !== '') { %> -<%= account.company %><% } %></option>
|
|
|
+ <% } %>
|
|
|
+ </select>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="card mt-3">
|
|
|
<div class="card-header">
|
|
|
审批流程
|
|
|
</div>
|
|
|
- <ul class="list-group list-group-flush">
|
|
|
- <li class="list-group-item"><a href="" class="text-danger pull-right">移除</a>1 张三 <small class="text-muted">监理</small></li>
|
|
|
- <li class="list-group-item"><a href="" class="text-danger pull-right">移除</a>2 王五 <small class="text-muted">监理</small></li>
|
|
|
- <li class="list-group-item"><a href="" class="text-danger pull-right">移除</a>3 李四 <small class="text-muted">监理</small></li>
|
|
|
+ <ul class="list-group list-group-flush" id="auditors">
|
|
|
+ <% for (let i = 0, iLen = auditorList.length; i < iLen; i++) { %>
|
|
|
+ <li class="list-group-item" auditorId="<%- auditorList[i].audit_id %>">
|
|
|
+ <a href="javascript: void(0)" class="text-danger pull-right">移除</a>
|
|
|
+ <%- auditorList[i].audit_order %> <%- auditorList[i].name %>
|
|
|
+ <small class="text-muted"><%- auditorList[i].role %></small>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="modal-footer">
|
|
|
- <button type="button" class="btn btn-primary">确认上报</button>
|
|
|
+ <form class="modal-footer" method="post" action="/tender/<%- ctx.tender.id %>/revise/audit/start" onsubmit="return checkAuditorFrom()">
|
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
|
|
|
- </div>
|
|
|
+ <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
|
|
|
+ <button class="btn btn-primary" type="submit">确认上报</button>
|
|
|
+ </form>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-<% } else if (revise.status === audit.status.checkNo) { %>
|
|
|
-<!--重新审批-->
|
|
|
+<% } %>
|
|
|
+<% if (revise.status === audit.status.checkNo && ctx.session.sessionUser.accountId === revise.uid) { %>
|
|
|
+<!--重新上报-->
|
|
|
<div class="modal fade" id="sub-sp2" data-backdrop="static">
|
|
|
<div class="modal-dialog" role="document">
|
|
|
<div class="modal-content">
|
|
@@ -84,114 +90,192 @@
|
|
|
<h5 class="modal-title">重新上报</h5>
|
|
|
</div>
|
|
|
<div class="modal-body">
|
|
|
- <div class="alert alert-primary" role="alert">
|
|
|
- 重新上报后,将由 王五 继续审批
|
|
|
- </div>
|
|
|
- <div class="card mt-3">
|
|
|
- <div class="card-header">
|
|
|
- 审批流程
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-4">
|
|
|
+ <a 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">
|
|
|
+ <li class="list-group-item">
|
|
|
+ <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <ul class="list-group list-group-flush" id="auditors-list">
|
|
|
+ <% for (let i = 0; i < auditorList.length; i++) { %>
|
|
|
+ <li class="list-group-item" data-auditid="<%- auditorList[i].audit_id %>">
|
|
|
+ <% if (i < auditorList.length - 1) { %>
|
|
|
+ <i class="fa fa-chevron-circle-down"></i> <%- auditorList[i].name %> <small class="text-muted"><%- auditorList[i].role %></small>
|
|
|
+ <% } else {%>
|
|
|
+ <i class="fa fa fa-stop-circle"></i> <%- auditorList[i].name %> <small class="text-muted"><%- auditorList[i].role %></small>
|
|
|
+ <% } %>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-8 modal-height-500" style="overflow: auto">
|
|
|
+ <% for (const ah of auditHistory) { %>
|
|
|
+ <div class="card mt-3">
|
|
|
+ <ul class="list-group list-group-flush">
|
|
|
+ <% for (let iA = 0; iA < ah.length; iA++) { %>
|
|
|
+ <% if (iA === 0) { %>
|
|
|
+ <li class="list-group-item">
|
|
|
+ <span class="text-success pull-right"><% if (auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
|
|
|
+ <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small></h5>
|
|
|
+ <p class="card-text"><small class="text-muted"><%- ah[iA].begin_time.toLocaleDateString() %></small></p>
|
|
|
+ </li>
|
|
|
+ <li class="list-group-item">
|
|
|
+ <% if (ah[iA].status !== audit.status.uncheck) { %>
|
|
|
+ <span class="<%- audit.statusClass[ah[iA].status] %> pull-right"><%- audit.statusString[ah[iA].status]%><% if (ah[iA].status === audit.status.checkNo) { %> <%- user.name %><% } %></span>
|
|
|
+ <% } %>
|
|
|
+ <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- audit.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
|
|
|
+ <% if (ah[iA].status === audit.status.checked || ah[iA].status === audit.status.checkNo) { %>
|
|
|
+ <p class="card-text mb-1"><%- ah[iA].opinion %></p>
|
|
|
+ <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
|
|
|
+ <% } %>
|
|
|
+ </li>
|
|
|
+ <% } else if (iA === ah.length - 1) { %>
|
|
|
+ <li class="list-group-item">
|
|
|
+ <% if (ah[iA].status !== audit.status.uncheck) { %>
|
|
|
+ <span class="<%- audit.statusClass[ah[iA].status] %> pull-right"><%- audit.statusString[ah[iA].status]%><% if (ah[iA].status === audit.status.checkNo) { %> <%- user.name %><% } %></span>
|
|
|
+ <% } %>
|
|
|
+ <h5 class="card-title"><i class="fa fa-stop-circle <%- audit.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
|
|
|
+ <% if (ah[iA].status === audit.status.checked || ah[iA].status === audit.status.checkNo) { %>
|
|
|
+ <p class="card-text mb-1"><%- ah[iA].opinion %></p>
|
|
|
+ <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
|
|
|
+ <% } %>
|
|
|
+ </li>
|
|
|
+ <% } else { %>
|
|
|
+ <li class="list-group-item">
|
|
|
+ <% if (ah[iA].status !== audit.status.uncheck) { %>
|
|
|
+ <span class="<%- audit.statusClass[ah[iA].status] %> pull-right"><%- audit.statusString[ah[iA].status]%><% if (ah[iA].status === audit.status.checkNo) { %> <%- user.name %><% } %></span>
|
|
|
+ <% } %>
|
|
|
+ <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- audit.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
|
|
|
+ <% if (ah[iA].status === audit.status.checked || ah[iA].status === audit.status.checkNo) { %>
|
|
|
+ <p class="card-text mb-1"><%- ah[iA].opinion %></p>
|
|
|
+ <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
|
|
|
+ <% } %>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
+ <% } %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <% if (revise.status === audit.status.checkNo) {%>
|
|
|
+ <div class="card mt-3">
|
|
|
+ <ul class="list-group list-group-flush">
|
|
|
+ <li class="list-group-item">
|
|
|
+ <span class="pull-right">重新上报中</span>
|
|
|
+ <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small></h5>
|
|
|
+ <p class="card-text"><small class="text-muted"></small></p>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <ul class="list-group list-group-flush" id="auditors-list2">
|
|
|
+ <% for (let iA = 0; iA < auditorList.length; iA++) { %>
|
|
|
+ <% if (iA === auditorList.length - 1) { %>
|
|
|
+ <li class="list-group-item" data-auditid="<%- auditorList[iA].audit_id %>">
|
|
|
+ <h5 class="card-title"><i class="fa fa-stop-circle"></i> <%- auditorList[iA].name %> <small class="text-muted"><%- auditorList[iA].role %></small></h5>
|
|
|
+ </li>
|
|
|
+ <% } else { %>
|
|
|
+ <li class="list-group-item" data-auditid="<%- auditorList[iA].audit_id %>">
|
|
|
+ <h5 class="card-title"><i class="fa fa-chevron-circle-down"></i> <%- auditorList[iA].name %> <small class="text-muted"><%- auditorList[iA].role %></small></h5>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
+ <% } %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
</div>
|
|
|
- <ul class="list-group list-group-flush">
|
|
|
- <li class="list-group-item">
|
|
|
- <span class="text-success pull-right">审批通过</span>
|
|
|
- <h5 class="card-title">1 张三 <small class="text-muted">监理</small></h5>
|
|
|
- <p class="card-text">审批意见。2018-01-01</p>
|
|
|
- </li>
|
|
|
- <li class="list-group-item">
|
|
|
- <span class="text-warning pull-right">退回</span>
|
|
|
- <h5 class="card-title">2 王五 <small class="text-muted">监理</small></h5>
|
|
|
- <p class="card-text"></p>
|
|
|
- </li>
|
|
|
- <li class="list-group-item">
|
|
|
- <h5 class="card-title">3 李四 <small class="text-muted">监理</small></h5>
|
|
|
- <p class="card-text"></p>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="modal-footer">
|
|
|
- <button type="button" class="btn btn-primary">确认上报</button>
|
|
|
+ <form class="modal-footer" action="/tender/<%- ctx.tender.id %>/revise/audit/start" method="post" onsubmit="return checkAuditorFrom()">
|
|
|
+ <button type="submit" class="btn btn-primary">确认上报</button>
|
|
|
+ <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
|
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
|
|
|
- </div>
|
|
|
+ </form>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-<% } else if (revise.status === audit.status.checking) { %>
|
|
|
+<% } %>
|
|
|
+<% if (revise.status === audit.status.checking && curAuditor.audit_id === ctx.session.sessionUser.accountId) { %>
|
|
|
<!--审批通过-->
|
|
|
<div class="modal fade" id="sp-done" data-backdrop="static">
|
|
|
<div class="modal-dialog" role="document">
|
|
|
- <div class="modal-content">
|
|
|
+ <form class="modal-content" action="/tender/<%- ctx.tender.id %>/revise/audit/check" method="post">
|
|
|
<div class="modal-header">
|
|
|
<h5 class="modal-title">审批通过</h5>
|
|
|
</div>
|
|
|
<div class="modal-body">
|
|
|
<div class="card mt-3">
|
|
|
<ul class="list-group list-group-flush">
|
|
|
- <li class="list-group-item">
|
|
|
- <span class="text-success pull-right">审批通过</span>
|
|
|
- <h5 class="card-title">1 张三 <small class="text-muted">监理</small></h5>
|
|
|
- <p class="card-text">审批意见。2018-01-01</p>
|
|
|
- </li>
|
|
|
- <li class="list-group-item">
|
|
|
- <span class="text-warning pull-right">审批中</span>
|
|
|
- <h5 class="card-title">2 王五 <small class="text-muted">监理</small></h5>
|
|
|
+ <% for (let i = 0, iLen = auditors.length; i < iLen; i++) { %>
|
|
|
+ <li class="list-group-item" auditorId="<%- auditors[i].audit_id %>">
|
|
|
+ <% if (auditors[i].status !== audit.status.uncheck) { %>
|
|
|
+ <span class="<%- audit.statusClass[auditors[i].status] %> pull-right"><%- audit.statusString[auditors[i].status] %></span>
|
|
|
+ <% } %>
|
|
|
+ <h5 class="card-title"><%- auditors[i].audit_order %> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small></h5>
|
|
|
+ <% if (auditors[i].status === audit.status.checked) { %>
|
|
|
+ <p class="card-text"><%- auditors[i].opinion %> <%- auditors[i].end_time ? auditors[i].end_time.toLocaleString() : '' %></p>
|
|
|
+ <% } else if (auditors[i].status === audit.status.checking) { %>
|
|
|
<div class="form-group">
|
|
|
<label>审批意见<b class="text-danger">*</b></label>
|
|
|
- <textarea class="form-control" ></textarea>
|
|
|
+ <textarea class="form-control" name="opinion">同意</textarea>
|
|
|
</div>
|
|
|
+ <% } %>
|
|
|
</li>
|
|
|
- <li class="list-group-item">
|
|
|
- <h5 class="card-title">3 李四 <small class="text-muted">监理</small></h5>
|
|
|
- </li>
|
|
|
+ <% } %>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="modal-footer">
|
|
|
- <button type="button" class="btn btn-success" >确认通过</button>
|
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
|
|
|
+ <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
|
|
|
+ <input type="hidden" name="checkType" value="<%= audit.status.checked %>" />
|
|
|
+ <button type="submit" class="btn btn-success" >确认通过</button>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </form>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!--审批退回-->
|
|
|
<div class="modal fade" id="sp-back" data-backdrop="static">
|
|
|
<div class="modal-dialog" role="document">
|
|
|
- <div class="modal-content">
|
|
|
+ <form class="modal-content" action="/tender/<%- ctx.tender.id %>/revise/audit/check" method="post">
|
|
|
<div class="modal-header">
|
|
|
<h5 class="modal-title">审批退回</h5>
|
|
|
</div>
|
|
|
<div class="modal-body">
|
|
|
<div class="card mt-3">
|
|
|
<ul class="list-group list-group-flush">
|
|
|
- <li class="list-group-item">
|
|
|
- <span class="text-success pull-right">审批通过</span>
|
|
|
- <h5 class="card-title">1 张三 <small class="text-muted">监理</small></h5>
|
|
|
- <p class="card-text">审批意见。2018-01-01</p>
|
|
|
- </li>
|
|
|
- <li class="list-group-item">
|
|
|
- <span class="text-warning pull-right">审批中</span>
|
|
|
- <h5 class="card-title">2 王五 <small class="text-muted">监理</small></h5>
|
|
|
+ <% for (let i = 0, iLen = auditors.length; i < iLen; i++) { %>
|
|
|
+ <li class="list-group-item" auditorId="<%- auditors[i].audit_id %>">
|
|
|
+ <% if (auditors[i].status !== audit.status.uncheck) { %>
|
|
|
+ <span class="<%- audit.statusClass[auditors[i].status] %> pull-right"><%- audit.statusString[auditors[i].status] %></span>
|
|
|
+ <% } %>
|
|
|
+ <h5 class="card-title"><%- auditors[i].audit_order %> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small></h5>
|
|
|
+ <% if (auditors[i].status === audit.status.checked) { %>
|
|
|
+ <p class="card-text"><%- auditors[i].opinion %> <%- auditors[i].end_time ? auditors[i].end_time.toLocaleString() : '' %></p>
|
|
|
+ <% } else if (auditors[i].status === audit.status.checking) { %>
|
|
|
<div class="form-group">
|
|
|
<label>审批意见<b class="text-danger">*</b></label>
|
|
|
- <textarea class="form-control" ></textarea>
|
|
|
+ <textarea class="form-control" name="opinion">不同意</textarea>
|
|
|
</div>
|
|
|
- <div class="alert alert-warning">审批退回,将直接退回给上报人。</data-min-view>
|
|
|
- </li>
|
|
|
- <li class="list-group-item">
|
|
|
- <h5 class="card-title">3 李四 <small class="text-muted">监理</small></h5>
|
|
|
+ <div class="alert alert-warning">审批退回,将直接退回给上报人。</div>
|
|
|
+ <% } %>
|
|
|
</li>
|
|
|
+ <% } %>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="modal-footer">
|
|
|
- <button type="button" class="btn btn-warning" >确认退回</button>
|
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
|
|
|
+ <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
|
|
|
+ <input type="hidden" name="checkType" value="<%= audit.status.checkNo %>" />
|
|
|
+ <button type="submit" class="btn btn-warning" >确认退回</button>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </form>
|
|
|
</div>
|
|
|
</div>
|
|
|
<% } %>
|
|
|
-<% if (revise.status !== audit.status.uncheck) { %>
|
|
|
+<% if (revise.status !== audit.status.uncheck || revise.times > 1) { %>
|
|
|
<!--审批流程/结果-->
|
|
|
<div class="modal fade" id="sp-list" data-backdrop="static">
|
|
|
<div class="modal-dialog" role="document">
|
|
@@ -200,22 +284,99 @@
|
|
|
<h5 class="modal-title">审批流程</h5>
|
|
|
</div>
|
|
|
<div class="modal-body">
|
|
|
- <div class="card mt-3">
|
|
|
- <ul class="list-group list-group-flush">
|
|
|
- <li class="list-group-item">
|
|
|
- <span class="text-success pull-right">审批通过</span>
|
|
|
- <h5 class="card-title">1 张三 <small class="text-muted">监理</small></h5>
|
|
|
- <p class="card-text">审批意见。2018-01-01</p>
|
|
|
- </li>
|
|
|
- <li class="list-group-item">
|
|
|
- <span class="text-warning pull-right">审批中</span>
|
|
|
- <h5 class="card-title">2 王五 <small class="text-muted">监理</small></h5>
|
|
|
- <p class="card-text"></p>
|
|
|
- </li>
|
|
|
- <li class="list-group-item">
|
|
|
- <h5 class="card-title">3 李四 <small class="text-muted">监理</small></h5>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-4">
|
|
|
+ <div class="card mt-3">
|
|
|
+ <ul class="list-group list-group-flush">
|
|
|
+ <li class="list-group-item">
|
|
|
+ <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small>
|
|
|
+ </li>
|
|
|
+ <% for (let i = 0; i < auditors.length; i++) { %>
|
|
|
+ <li class="list-group-item">
|
|
|
+ <% if (i < auditors.length - 1) { %>
|
|
|
+ <i class="fa fa-chevron-circle-down"></i> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small>
|
|
|
+ <% } else {%>
|
|
|
+ <i class="fa fa fa-stop-circle"></i> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small>
|
|
|
+ <% } %>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-8 modal-height-500" style="overflow: auto">
|
|
|
+ <% for (const ah of auditHistory) { %>
|
|
|
+ <div class="card mt-3">
|
|
|
+ <ul class="list-group list-group-flush">
|
|
|
+ <li class="list-group-item">
|
|
|
+ <span class="text-success pull-right"><% if (auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
|
|
|
+ <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small></h5>
|
|
|
+ <p class="card-text"><small class="text-muted"><%- ah[0].begin_time.toLocaleDateString() %></small></p>
|
|
|
+ </li>
|
|
|
+ <% for (let iA = 0; iA < ah.length; iA++) { %>
|
|
|
+ <% if (iA === ah.length - 1) { %>
|
|
|
+ <li class="list-group-item">
|
|
|
+ <% if (ah[iA].status !== audit.status.uncheck) { %>
|
|
|
+ <span class="<%- audit.statusClass[ah[iA].status] %> pull-right"><%- audit.statusString[ah[iA].status]%><% if (ah[iA].status === audit.status.checkNo) { %> <%- user.name %><% } %></span>
|
|
|
+ <% } %>
|
|
|
+ <h5 class="card-title"><i class="fa fa-stop-circle <%- audit.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
|
|
|
+ <% if (ah[iA].status === audit.status.checked || ah[iA].status === audit.status.checkNo) { %>
|
|
|
+ <p class="card-text mb-1"><%- ah[iA].opinion %></p>
|
|
|
+ <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
|
|
|
+ <% } %>
|
|
|
+ </li>
|
|
|
+ <% } else { %>
|
|
|
+ <li class="list-group-item">
|
|
|
+ <% if (ah[iA].status !== audit.status.uncheck) { %>
|
|
|
+ <span class="<%- audit.statusClass[ah[iA].status] %> pull-right"><%- audit.statusString[ah[iA].status]%><% if (ah[iA].status === audit.status.checkNo) { %> <%- user.name %><% } %></span>
|
|
|
+ <% } %>
|
|
|
+ <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- audit.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
|
|
|
+ <% if (ah[iA].status === audit.status.checked || ah[iA].status === audit.status.checkNo) { %>
|
|
|
+ <p class="card-text mb-1"><%- ah[iA].opinion %></p>
|
|
|
+ <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
|
|
|
+ <% } %>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
+ <% } %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <% if (revise.status === audit.status.checking || revise.status === audit.status.checked) {%>
|
|
|
+ <div class="card mt-3">
|
|
|
+ <ul class="list-group list-group-flush">
|
|
|
+ <li class="list-group-item">
|
|
|
+ <span class="text-success pull-right"><% if (revise.times > 1) { %>重新<% } %>上报</span>
|
|
|
+ <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small></h5>
|
|
|
+ <p class="card-text"><small class="text-muted"><%- auditors[0].begin_time ? auditors[0].begin_time.toLocaleDateString() : ''%></small></p>
|
|
|
+ </li>
|
|
|
+ <% for (let iA = 0; iA < auditors.length; iA++) { %>
|
|
|
+ <% if (iA === auditors.length - 1) { %>
|
|
|
+ <li class="list-group-item">
|
|
|
+ <% if (auditors[iA].status !== audit.status.uncheck) { %>
|
|
|
+ <span class="<%- audit.statusClass[auditors[iA].status] %> pull-right"><%- audit.statusString[auditors[iA].status]%><% if (auditors[iA].status === audit.status.checkNo) { %> <%- user.name %><% } %></span>
|
|
|
+ <% } %>
|
|
|
+ <h5 class="card-title"><i class="fa fa-stop-circle <%- audit.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small></h5>
|
|
|
+ <% if (auditors[iA].status === audit.status.checked || auditors[iA].status === audit.status.checkNo) { %>
|
|
|
+ <p class="card-text mb-1"><%- auditors[iA].opinion %></p>
|
|
|
+ <p class="card-text"><small class="text-muted"><%- auditors[iA].end_time.toLocaleDateString() %></small></p>
|
|
|
+ <% } %>
|
|
|
+ </li>
|
|
|
+ <% } else { %>
|
|
|
+ <li class="list-group-item">
|
|
|
+ <% if (auditors[iA].status !== audit.status.uncheck) { %>
|
|
|
+ <span class="<%- audit.statusClass[auditors[iA].status] %> pull-right"><%- audit.statusString[auditors[iA].status]%><% if (auditors[iA].status === audit.status.checkNo) { %> <%- user.name %><% } %></span>
|
|
|
+ <% } %>
|
|
|
+ <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- audit.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small></h5>
|
|
|
+ <% if (auditors[iA].status === audit.status.checked || auditors[iA].status === audit.status.checkNo) { %>
|
|
|
+ <p class="card-text mb-1"><%- auditors[iA].opinion %></p>
|
|
|
+ <p class="card-text"><small class="text-muted"><%- auditors[iA].end_time.toLocaleDateString() %></small></p>
|
|
|
+ <% } %>
|
|
|
+ </li>
|
|
|
+ <% } %>
|
|
|
+ <% } %>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="modal-footer">
|
|
@@ -224,4 +385,101 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-<% } %>
|
|
|
+<% } %>
|
|
|
+<script>
|
|
|
+ <% if (ctx.session.sessionUser.accountId === revise.uid && (revise.status === audit.status.uncheck || revise.status === audit.status.checkNo)) { %>
|
|
|
+ const accountList = JSON.parse('<%- JSON.stringify(accountList) %>');
|
|
|
+ // 审批人分组选择
|
|
|
+ $('#account_group').change(function () {
|
|
|
+ let account_html = '<option value="0">选择审批人</option>';
|
|
|
+ for (const account of accountList) {
|
|
|
+ if (parseInt($(this).val()) === 0 || parseInt($(this).val()) === account.account_group) {
|
|
|
+ const role = account.role !== '' ? '(' + account.role + ')' : '';
|
|
|
+ const company = account.company !== '' ? ' -' + account.company : '';
|
|
|
+ account_html += '<option value="' + account.id + '">' + account.name + role + company + '</option>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $('#account_list').html(account_html);
|
|
|
+ });
|
|
|
+ // 添加到审批流程中
|
|
|
+ $('body').on('change', '#account_list', function () {
|
|
|
+ let id = $(this).val();
|
|
|
+ id = parseInt(id);
|
|
|
+ if (id !== 0) {
|
|
|
+ const data = {
|
|
|
+ auditorId: $(this).val(),
|
|
|
+ };
|
|
|
+ postData('/tender/<%- ctx.tender.id %>/revise/audit/add', data, (data) => {
|
|
|
+ const html = [];
|
|
|
+ html.push('<li class="list-group-item" auditorId="' + data.audit_id + '"><a href="javascript: void(0)" class="text-danger pull-right">移除</a>');
|
|
|
+ html.push('<span>');
|
|
|
+ html.push(data.audit_order + ' ');
|
|
|
+ html.push(data.name + ' ');
|
|
|
+ html.push('</span>');
|
|
|
+ html.push('<small class="text-muted">');
|
|
|
+ html.push(data.role);
|
|
|
+ html.push('</small></li>');
|
|
|
+ $('#auditors').append(html.join(''));
|
|
|
+
|
|
|
+ // 如果是重新上报,添加到重新上报列表中
|
|
|
+ const auditorshtml = [];
|
|
|
+ // 重新上报时。令其它的审批人流程图标转换
|
|
|
+ $('#auditors-list li i').removeClass('fa-stop-circle').addClass('fa-chevron-circle-down');
|
|
|
+ // 添加新审批人
|
|
|
+ auditorshtml.push('<li class="list-group-item" data-auditid="' + data.audit_id + '">');
|
|
|
+ auditorshtml.push('<i class="fa fa-stop-circle"></i> ');
|
|
|
+ auditorshtml.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
|
|
|
+ auditorshtml.push('</li>');
|
|
|
+ $('#auditors-list').append(auditorshtml.join(''));
|
|
|
+
|
|
|
+ const auditorshtml2 = [];
|
|
|
+ // 重新上报时。令其它的审批人流程图标转换
|
|
|
+ $('#auditors-list2 li i').removeClass('fa-stop-circle').addClass('fa-chevron-circle-down');
|
|
|
+ // 添加新审批人
|
|
|
+ auditorshtml2.push('<li class="list-group-item" data-auditid="' + data.audit_id + '">');
|
|
|
+ auditorshtml2.push('<h5 class="card-title"><i class="fa fa-stop-circle"></i> ');
|
|
|
+ auditorshtml2.push(data.name + ' <small class="text-muted">' + data.role + '</small></h5>');
|
|
|
+ auditorshtml2.push('</li>');
|
|
|
+ $('#auditors-list2').append(auditorshtml2.join(''));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('body').on('click', '#auditors li>a', function () {
|
|
|
+ const li = $(this).parent();
|
|
|
+ const data = {
|
|
|
+ auditorId: parseInt(li.attr('auditorId')),
|
|
|
+ };
|
|
|
+ postData('/tender/<%- ctx.tender.id %>/revise/audit/remove', data, (data2) => {
|
|
|
+ li.remove();
|
|
|
+ for (const a of data2) {
|
|
|
+ const aLi = $('li[auditorId=' + a.audit_id + ']');
|
|
|
+ $('span', aLi).text(a.audit_order + ' ' + a.name + ' ');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果是重新上报
|
|
|
+ // 令最后一个图标转换
|
|
|
+ $('#auditors-list li[data-auditid="' + data.auditorId + '"]').remove();
|
|
|
+ if ($('#auditors-list li').length !== 0 && !$('#auditors-list li i').hasClass('fa-stop-circle')) {
|
|
|
+ $('#auditors-list li').eq($('#auditors-list li').length-1).children('i')
|
|
|
+ .removeClass('fa-chevron-circle-down').addClass('fa-stop-circle');
|
|
|
+ }
|
|
|
+ $('#auditors-list2 li[data-auditid="' + data.auditorId + '"]').remove();
|
|
|
+ if ($('#auditors-list2 li').length !== 0 && !$('#auditors-list2 li i').hasClass('fa-stop-circle')) {
|
|
|
+ $('#auditors-list2 li').eq($('#auditors-list2 li').length-1).children('i')
|
|
|
+ .removeClass('fa-chevron-circle-down').addClass('fa-stop-circle');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ $('#hideSp').click(function () {
|
|
|
+ $('#sub-sp2').modal('hide');
|
|
|
+ });
|
|
|
+ <% } %>
|
|
|
+
|
|
|
+ // 检查上报情况
|
|
|
+ function checkAuditorFrom () {
|
|
|
+ if ($('#auditors li').length === 0) {
|
|
|
+ toast('请先选择审批人,再上报数据', 'error', 'exclamation-circle');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|