|
@@ -45,6 +45,7 @@
|
|
|
</div>
|
|
|
<div class="modal-body">
|
|
|
<div class="dropdown text-right">
|
|
|
+ <% if (ctx.tender.info.shenpi.revise !== shenpiConst.sp_status.gdspl) { %>
|
|
|
<button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="dropdownMenuButton"
|
|
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
添加审批流程
|
|
@@ -69,6 +70,7 @@
|
|
|
<% }) %>
|
|
|
</dl>
|
|
|
</div>
|
|
|
+ <% } %>
|
|
|
</div>
|
|
|
<div class="card mt-3">
|
|
|
<div class="card-header">
|
|
@@ -78,8 +80,11 @@
|
|
|
<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 %>">
|
|
|
+ <% if (ctx.tender.info.shenpi.revise === shenpiConst.sp_status.sqspr ||
|
|
|
+ (ctx.tender.info.shenpi.revise === shenpiConst.sp_status.gdzs && i+1 !== iLen)) { %>
|
|
|
<a href="javascript: void(0)" class="text-danger pull-right">移除</a>
|
|
|
- <%- auditorList[i].audit_order %> <%- auditorList[i].name %>
|
|
|
+ <% } %>
|
|
|
+ <span><%- auditorList[i].audit_order %> <%- auditorList[i].name %></span>
|
|
|
<small class="text-muted"><%- auditorList[i].role %></small>
|
|
|
</li>
|
|
|
<% } %>
|
|
@@ -97,7 +102,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<% } %>
|
|
|
-<% if (revise.status === auditConst.status.checking || revise.status === auditConst.status.checkNoPre) { %>
|
|
|
+<% if (revise.status === auditConst.status.checking) { %>
|
|
|
<% if (curAuditor && curAuditor.audit_id === ctx.session.sessionUser.accountId) { %>
|
|
|
<<!--审批通过-->
|
|
|
<div class="modal fade sp-location-list" id="sp-done" data-backdrop="static">
|
|
@@ -542,7 +547,7 @@
|
|
|
id="hideSp">修改审批流程</a>
|
|
|
<% } %>
|
|
|
<div class="card mt-3">
|
|
|
- <ul class="list-group list-group-flush">
|
|
|
+ <ul class="list-group list-group-flush" id="auditors-list">
|
|
|
<% auditors.forEach((item, idx) => { %>
|
|
|
<% if (idx === 0) { %>
|
|
|
<li class="list-group-item" data-auditorId="<%- item.audit_id %>">
|
|
@@ -721,6 +726,8 @@
|
|
|
const cur_uid = '<%- ctx.session.sessionUser.accountId %>';
|
|
|
const accountList = JSON.parse('<%- JSON.stringify(accountList) %>');
|
|
|
const accountGroup = JSON.parse('<%- JSON.stringify(accountGroup ) %>');
|
|
|
+ const shenpi_status = <%- ctx.tender.info.shenpi.revise %>;
|
|
|
+ const shenpiConst = JSON.parse('<%- JSON.stringify(shenpiConst) %>');
|
|
|
let timer = null;
|
|
|
let oldSearchVal = null;
|
|
|
|
|
@@ -768,44 +775,32 @@
|
|
|
$('dl').on('click', 'dd', function () {
|
|
|
const auditorId = parseInt($(this).data('id'))
|
|
|
if (auditorId) {
|
|
|
- postData('/tender/<%- ctx.tender.id %>/revise/audit/add', { auditorId }, (data) => {
|
|
|
+ postData('/tender/<%- ctx.tender.id %>/revise/audit/add', { auditorId }, (datas) => {
|
|
|
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');
|
|
|
- for (let i = 0; i < $('#auditors-list li').length; i++) {
|
|
|
- $('#auditors-list li').eq(i).find('.pull-right').text(transFormToChinese(i + 1) + '审');
|
|
|
- $('#auditors-list2 li').eq(i).find('.pull-right').text(transFormToChinese(i + 1) + '审');
|
|
|
+ for (const [index,data] of datas.entries()) {
|
|
|
+ if (index !== 0) {
|
|
|
+ html.push('<li class="list-group-item" auditorId="' + data.audit_id + '">');
|
|
|
+ if (shenpi_status === shenpiConst.sp_status.sqspr || (shenpi_status === shenpiConst.sp_status.gdzs && index+1 !== datas.length)) {
|
|
|
+ html.push('<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>');
|
|
|
+ }
|
|
|
+ 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('<span class="pull-right">终审</span>');
|
|
|
+ auditorshtml.push('</li>');
|
|
|
}
|
|
|
- // 添加新审批人
|
|
|
- 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('<span class="pull-right">终审</span>');
|
|
|
- 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>');
|
|
|
- auditorshtml2.push('<span class="pull-right">终审</span>');
|
|
|
- auditorshtml2.push('</h5></li>');
|
|
|
- $('#auditors-list2').append(auditorshtml2.join(''));
|
|
|
+ $('#auditors').html(html.join(''));
|
|
|
+ $('#auditors-list').html(auditorshtml.join(''));
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -824,19 +819,19 @@
|
|
|
|
|
|
// 如果是重新上报
|
|
|
// 令最后一个图标转换
|
|
|
- $('#auditors-list li[data-auditid="' + data.auditorId + '"]').remove();
|
|
|
+ $('#auditors-list li[data-auditorid="' + 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');
|
|
|
- }
|
|
|
+ // $('#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');
|
|
|
+ // }
|
|
|
for (let i = 0; i < $('#auditors-list li').length; i++) {
|
|
|
- $('#auditors-list li').eq(i).find('.pull-right').text((i + 1 === $('#auditors-list li').length ? '终' : transFormToChinese(i + 1)) + '审');
|
|
|
- $('#auditors-list2 li').eq(i).find('.pull-right').text((i + 1 === $('#auditors-list2 li').length ? '终' : transFormToChinese(i + 1)) + '审');
|
|
|
+ $('#auditors-list li').eq(i).find('.pull-right').text(i === 0 ? '原报' : (i+1 === $('#auditors-list li').length ? '终' : transFormToChinese(i+1)) + '审');
|
|
|
+ // $('#auditors-list2 li').eq(i).find('.pull-right').text((i + 1 === $('#auditors-list2 li').length ? '终' : transFormToChinese(i + 1)) + '审');
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -893,7 +888,11 @@
|
|
|
return false;
|
|
|
}
|
|
|
if ($('#auditors li').length === 0) {
|
|
|
- toastr.error('请先选择审批人,再上报数据');
|
|
|
+ if(shenpi_status === shenpiConst.sp_status.gdspl) {
|
|
|
+ toastr.error('请联系管理员添加审批人');
|
|
|
+ } else {
|
|
|
+ toastr.error('请先选择审批人,再上报数据');
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
$('#hide-all').show();
|