|
@@ -48,21 +48,13 @@
|
|
|
</div>
|
|
|
<!--审批流程/结果-->
|
|
|
<div class="modal fade" id="sp-list" data-backdrop="static">
|
|
|
- <div class="modal-dialog modal-lg" role="document">
|
|
|
+ <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="row">
|
|
|
- <div class="col-4">
|
|
|
- <div class="card mt-3">
|
|
|
- <ul class="list-group list-group-flush" id="auditor-list">
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="col-8 modal-height-500" style="overflow: auto" id="audit-list">
|
|
|
- </div>
|
|
|
+ <div class="modal-height-500 scroll-y" style="overflow: auto" id="audit-list">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="modal-footer">
|
|
@@ -100,6 +92,7 @@
|
|
|
<% } %>
|
|
|
|
|
|
<script>
|
|
|
+ const auditType = JSON.parse('<%- JSON.stringify(auditType) %>');
|
|
|
let dbClickFlag = true;
|
|
|
function dbClick() {
|
|
|
if(dbClickFlag){
|
|
@@ -111,164 +104,117 @@
|
|
|
const auditConst = JSON.parse('<%- auditConst2 %>');
|
|
|
|
|
|
$(function () {
|
|
|
+ const getAuditTypeText = function (type) {
|
|
|
+ if (type === auditType.key.common) return '';
|
|
|
+ return `<span class="text-${auditType.info[type].class}">${auditType.info[type].long}</span>`;
|
|
|
+ };
|
|
|
+ const loadStageHistory = function (result, auditConst2) {
|
|
|
+ const { auditHistory, user } = result;
|
|
|
+ let historyHTML = [];
|
|
|
+ auditHistory.forEach((his, idx) => {
|
|
|
+ if (idx === auditHistory.length - 1 && auditHistory.length !== 1) {
|
|
|
+ historyHTML.push(`<div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a></div>`);
|
|
|
+ }
|
|
|
+ historyHTML.push(`<div class="${idx < auditHistory.length - 1 ? 'fold-card' : ''}">`);
|
|
|
+ historyHTML.push(`<div class="text-center text-muted">${idx+1}#</div>`);
|
|
|
+ historyHTML.push(`<ul class="timeline-list list-unstyled mt-2 pr-1 ${ idx === auditHistory.length - 1 && auditHistory.length !== 1 ? 'last-auditor-list' : '' }">`);
|
|
|
+ his.forEach((group, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ historyHTML.push(`<li class="timeline-list-item pb-2">
|
|
|
+ <div class="timeline-item-date">
|
|
|
+ ${group.beginYear}
|
|
|
+ <span>${group.beginDate}</span>
|
|
|
+ <span>${group.beginTime}</span>
|
|
|
+
|
|
|
+ </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="py-1">
|
|
|
+ <span class="text-black-50">原报</span>
|
|
|
+ <span class="pull-right text-success">${idx !== 0 ? '重新' : '' }上报审批</span>
|
|
|
+ </div>
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-body px-3 py-0">
|
|
|
+ <div class="card-text p-2 py-3 row">
|
|
|
+ <div class="col">
|
|
|
+ <span class="h6">${user.name}</span>
|
|
|
+ <span class="text-muted ml-1">${user.role}</span>
|
|
|
+ </div>
|
|
|
+ <div class="col">
|
|
|
+ <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>`);
|
|
|
+ }
|
|
|
+ historyHTML.push(`<li class="timeline-list-item pb-2 ${ group.status === auditConst2.status.uncheck && idx === auditHistory.length - 1 && auditHistory.length !== 1 ? 'is_uncheck' : ''}">`);
|
|
|
+ if (group.endYear) {
|
|
|
+ historyHTML.push(`<div class="timeline-item-date">${group.endYear}<span>${group.endDate}</span><span>${group.endTime}</span></div>`);
|
|
|
+ }
|
|
|
+ if (index < his.length - 1) {
|
|
|
+ historyHTML.push('<div class="timeline-item-tail"></div>');
|
|
|
+ }
|
|
|
+ if (group.status === auditConst2.status.checked) {
|
|
|
+ historyHTML.push('<div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>');
|
|
|
+ } else if (group.status === auditConst2.status.checkNo || group.status === auditConst2.status.checkNoPre || group.status === auditConst2.status.checkCancel) {
|
|
|
+ historyHTML.push('<div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>');
|
|
|
+ } else if (group.status === auditConst2.status.checking) {
|
|
|
+ historyHTML.push('<div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>');
|
|
|
+ } else if(group.status === auditConst2.status.checkAgain) {
|
|
|
+ historyHTML.push('<div class="timeline-item-icon bg-warning text-light"><i class="fa fa-check"></i></div>');
|
|
|
+ } else {
|
|
|
+ historyHTML.push('<div class="timeline-item-icon bg-secondary text-light"></div>');
|
|
|
+ }
|
|
|
+
|
|
|
+ historyHTML.push('<div class="timeline-item-content">');
|
|
|
+ const statuStr = group.status !== auditConst2.status.uncheck ?
|
|
|
+ `<span class="pull-right ${auditConst2.auditStringClass[group.status]}">${auditConst2.statusString[group.status]}</span>` : '';
|
|
|
+ historyHTML.push(`<div class="py-1">
|
|
|
+ <span class="text-black-50">
|
|
|
+ ${ !group.is_final ? group.audit_order + '' : '终' }审 ${getAuditTypeText(group.audit_type)}
|
|
|
+ </span>
|
|
|
+ ${statuStr}
|
|
|
+ </div>`);
|
|
|
+ historyHTML.push('<div class="card"><div class="card-body px-3 py-0">');
|
|
|
+ for (const [i, auditor] of group.auditors.entries()) {
|
|
|
+ historyHTML.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
|
|
|
+ historyHTML.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
|
|
|
+ historyHTML.push('<div class="col">');
|
|
|
+ if (auditor.status === auditConst2.status.checked) {
|
|
|
+ historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');
|
|
|
+ } if (auditor.status === auditConst2.status.checkNo || auditor.status === auditConst2.status.checkNoPre || auditor.status === auditConst2.status.checkCancel) {
|
|
|
+ historyHTML.push('<span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>');
|
|
|
+ } else if (auditor.status === auditConst2.status.checking) {
|
|
|
+ historyHTML.push('<span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>');
|
|
|
+ } else if (auditor.status === auditConst2.status.checkAgain) {
|
|
|
+ historyHTML.push('<span class="pull-right text-warning"><i class="fa fa-check-circle"></i></span>');
|
|
|
+ }
|
|
|
+ historyHTML.push('</div>');
|
|
|
+ if (auditor.opinion) {
|
|
|
+ historyHTML.push(`<div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i>${auditor.opinion}</div>`);
|
|
|
+ }
|
|
|
+ historyHTML.push('</div>');
|
|
|
+ }
|
|
|
+ historyHTML.push('</div></div>');
|
|
|
+ historyHTML.push('</div>');
|
|
|
+ historyHTML.push('</li>');
|
|
|
+ });
|
|
|
+ historyHTML.push('</div>');
|
|
|
+ historyHTML.push('</ul>');
|
|
|
+ });
|
|
|
+ $('#audit-list').empty();
|
|
|
+ $('#audit-list').append(historyHTML.join(''));
|
|
|
+ }
|
|
|
// 获取审批流程
|
|
|
$('a[data-target="#sp-list"]').on('click', function () {
|
|
|
const data = {
|
|
|
id: $(this).attr('lr-id'),
|
|
|
};
|
|
|
postData('<%- preUrl + "/revise/auditors" %>', data, function (result) {
|
|
|
- const { auditHistory, auditors, user } = result
|
|
|
- let auditorsHTML = ''
|
|
|
- let historyHTML = ''
|
|
|
- auditors.forEach((auditor, idx) => {
|
|
|
- if (idx === 0) {
|
|
|
- auditorsHTML += `<li class="list-group-item">
|
|
|
- <i class="fa fa fa-play-circle fa-rotate-90"></i> ${auditor.name}
|
|
|
- <small class="text-muted">${auditor.role}</small>
|
|
|
- <span class="pull-right">原报</span>
|
|
|
- </li>`
|
|
|
- } else if(idx === auditors.length -1 && idx !== 0) {
|
|
|
- auditorsHTML += `<li class="list-group-item">
|
|
|
- <i class="fa fa fa-stop-circle"></i> ${auditor.name}
|
|
|
- <small class="text-muted">${auditor.role}</small>
|
|
|
- <span class="pull-right">终审</span>
|
|
|
- </li>`
|
|
|
- } else {
|
|
|
- auditorsHTML += `<li class="list-group-item">
|
|
|
- <i class="fa fa-chevron-circle-down"></i> ${auditor.name}
|
|
|
- <small class="text-muted">${auditor.role}</small>
|
|
|
- <span class="pull-right">${transFormToChinese(idx)}审</span>
|
|
|
- </li>`
|
|
|
- }
|
|
|
- })
|
|
|
- $('#auditor-list').empty()
|
|
|
- $('#auditor-list').append(auditorsHTML)
|
|
|
- auditHistory.forEach((auditors, idx) => {
|
|
|
- if(idx === auditHistory.length - 1 && auditHistory.length !== 1) {
|
|
|
- historyHTML += `<div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a></div>`
|
|
|
- }
|
|
|
- historyHTML += `<div class="${idx < 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) {
|
|
|
- historyHTML += `<li class="timeline-list-item pb-2">
|
|
|
- <div class="timeline-item-date">
|
|
|
- ${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">${user.name}</span><span
|
|
|
- class="pull-right text-success">${idx !== 0 ? '重新' : ''}上报审批</span>
|
|
|
- </p>
|
|
|
- <p class="text-muted mb-0">${user.role}</p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li class="timeline-list-item pb-2">
|
|
|
- <div class="timeline-item-date">
|
|
|
- ${formatDate(auditor.end_time)}
|
|
|
- </div>`
|
|
|
-
|
|
|
- if(index < auditors.length - 1) {
|
|
|
- historyHTML += `<div class="timeline-item-tail"></div>`
|
|
|
- }
|
|
|
- if(auditor.status === auditConst.status.checked) {
|
|
|
- historyHTML += `<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) {
|
|
|
- historyHTML += `<div class="timeline-item-icon bg-warning text-light">
|
|
|
- <i class="fa fa-level-up"></i>
|
|
|
- </div>`
|
|
|
- } else if(auditor.status === auditConst.status.checking) {
|
|
|
- historyHTML += `<div class="timeline-item-icon bg-warning text-light">
|
|
|
- <i class="fa fa-ellipsis-h"></i>
|
|
|
- </div>`
|
|
|
- } else {
|
|
|
- historyHTML += `<div class="timeline-item-icon bg-secondary text-light"></div>`
|
|
|
-
|
|
|
- }
|
|
|
- historyHTML += `<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) {
|
|
|
- historyHTML += `<div class="card-body p-3 border-top">
|
|
|
- <p style="margin: 0;">${auditor.opinion}</p>
|
|
|
- </div>`
|
|
|
- }
|
|
|
- historyHTML += `</div></div></li>`
|
|
|
- } else {
|
|
|
- historyHTML += `<li class="timeline-list-item pb-2">
|
|
|
- <div class="timeline-item-date">
|
|
|
- ${formatDate(auditor.end_time)}
|
|
|
- </div>`
|
|
|
-
|
|
|
- if(index < auditors.length - 1) {
|
|
|
- historyHTML += `<div class="timeline-item-tail"></div>`
|
|
|
- }
|
|
|
- if(auditor.status === auditConst.status.checked) {
|
|
|
- historyHTML += `<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) {
|
|
|
- historyHTML += `<div class="timeline-item-icon bg-warning text-light">
|
|
|
- <i class="fa fa-level-up"></i>
|
|
|
- </div>`
|
|
|
-
|
|
|
- } else if(auditor.status === auditConst.status.checking) {
|
|
|
- historyHTML += `<div class="timeline-item-icon bg-warning text-light">
|
|
|
- <i class="fa fa-ellipsis-h"></i>
|
|
|
- </div>`
|
|
|
- } else {
|
|
|
- historyHTML += `<div class="timeline-item-icon bg-secondary text-light"></div>`
|
|
|
- }
|
|
|
- historyHTML += `<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 ? user.name : ''}
|
|
|
- ${auditor.status === auditConst.status.checkNoPre ? auditors[index-1].name : ''}
|
|
|
- </span>
|
|
|
- </p>
|
|
|
- <p class="text-muted mb-0">${auditor.role}</p>
|
|
|
- </div>
|
|
|
- </div>`
|
|
|
-
|
|
|
- if (auditor.opinion) {
|
|
|
- historyHTML += `<div class="card-body p-3 border-top">
|
|
|
- <p style="margin: 0;">${auditor.opinion} </p>
|
|
|
- </div>`
|
|
|
- }
|
|
|
- historyHTML += `</div></div></li>`
|
|
|
- }
|
|
|
- })
|
|
|
- historyHTML += '</ul></div>'
|
|
|
-
|
|
|
- })
|
|
|
- $('#audit-list').empty()
|
|
|
- $('#audit-list').append(historyHTML)
|
|
|
+ loadStageHistory(result, auditConst)
|
|
|
})
|
|
|
});
|
|
|
});
|