|
@@ -1190,25 +1190,26 @@
|
|
|
<script>
|
|
|
const tenderId = parseInt('<%- tender.id %>');
|
|
|
const auditType = JSON.parse('<%- JSON.stringify(audit.auditType) %>');
|
|
|
- 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, auditConst) {
|
|
|
- const { auditHistory, auditors2, user } = result;
|
|
|
- let historyHTML = [];
|
|
|
- const darkHTML = !dayMode ? 'bg-dark border-secondary text-white' : '';
|
|
|
- const textClass = !dayMode ? 'text-light' : '';
|
|
|
- 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">
|
|
|
+ $(document).ready(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, auditConst) {
|
|
|
+ const { auditHistory, auditors2, user } = result;
|
|
|
+ let historyHTML = [];
|
|
|
+ const darkHTML = !dayMode ? 'bg-dark border-secondary text-white' : '';
|
|
|
+ const textClass = !dayMode ? 'text-light' : '';
|
|
|
+ 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 class="${textClass}">${group.beginDate}</span>
|
|
@@ -1236,75 +1237,75 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</li>`);
|
|
|
- }
|
|
|
- historyHTML.push(`<li class="timeline-list-item pb-2 ${ group.status === auditConst.status.uncheck && idx === auditHistory.length - 1 && auditHistory.length !== 1 ? 'is_uncheck' : ''}">`);
|
|
|
- if (group.endYear) {
|
|
|
- historyHTML.push(`<div class="timeline-item-date ${textClass}">${group.endYear}<span class="${textClass}">${group.endDate}</span><span class="${textClass}">${group.endTime}</span></div>`);
|
|
|
- }
|
|
|
- if (index < his.length - 1) {
|
|
|
- historyHTML.push('<div class="timeline-item-tail"></div>');
|
|
|
- }
|
|
|
- if (group.status === auditConst.status.checked) {
|
|
|
- historyHTML.push('<div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>');
|
|
|
- } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.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 === auditConst.status.checking) {
|
|
|
- historyHTML.push('<div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>');
|
|
|
- } else {
|
|
|
- historyHTML.push('<div class="timeline-item-icon bg-secondary text-light"></div>');
|
|
|
- }
|
|
|
+ }
|
|
|
+ historyHTML.push(`<li class="timeline-list-item pb-2 ${ group.status === auditConst.status.uncheck && idx === auditHistory.length - 1 && auditHistory.length !== 1 ? 'is_uncheck' : ''}">`);
|
|
|
+ if (group.endYear) {
|
|
|
+ historyHTML.push(`<div class="timeline-item-date ${textClass}">${group.endYear}<span class="${textClass}">${group.endDate}</span><span class="${textClass}">${group.endTime}</span></div>`);
|
|
|
+ }
|
|
|
+ if (index < his.length - 1) {
|
|
|
+ historyHTML.push('<div class="timeline-item-tail"></div>');
|
|
|
+ }
|
|
|
+ if (group.status === auditConst.status.checked) {
|
|
|
+ historyHTML.push('<div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>');
|
|
|
+ } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.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 === auditConst.status.checking) {
|
|
|
+ historyHTML.push('<div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></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 !== auditConst.status.uncheck ?
|
|
|
- `<span class="pull-right ${auditConst.statusClass[group.status]}">${auditConst.statusString[group.status]}</span>` : '';
|
|
|
- historyHTML.push(`<div class="py-1">
|
|
|
+ historyHTML.push('<div class="timeline-item-content">');
|
|
|
+ const statuStr = group.status !== auditConst.status.uncheck ?
|
|
|
+ `<span class="pull-right ${auditConst.statusClass[group.status]}">${auditConst.statusString[group.status]}</span>` : '';
|
|
|
+ historyHTML.push(`<div class="py-1">
|
|
|
<span class="">
|
|
|
${ !group.is_final ? group.audit_order + '' : '终' }审 ${getAuditTypeText(group.audit_type)}
|
|
|
</span>
|
|
|
${statuStr}
|
|
|
</div>`);
|
|
|
- historyHTML.push(`<div class="card ${darkHTML}"><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 === auditConst.status.checked) {
|
|
|
- historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');
|
|
|
- } if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) {
|
|
|
- historyHTML.push('<span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>');
|
|
|
- }
|
|
|
- historyHTML.push('</div>');
|
|
|
- if (auditor.opinion) {
|
|
|
- historyHTML.push(`<div class="col-12 py-1"><i class="fa fa-commenting-o mr-1"></i>${auditor.opinion}</div>`);
|
|
|
+ historyHTML.push(`<div class="card ${darkHTML}"><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 === auditConst.status.checked) {
|
|
|
+ historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');
|
|
|
+ } if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) {
|
|
|
+ historyHTML.push('<span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>');
|
|
|
+ }
|
|
|
+ historyHTML.push('</div>');
|
|
|
+ if (auditor.opinion) {
|
|
|
+ historyHTML.push(`<div class="col-12 py-1"><i class="fa fa-commenting-o mr-1"></i>${auditor.opinion}</div>`);
|
|
|
+ }
|
|
|
+ historyHTML.push('</div>');
|
|
|
}
|
|
|
+ historyHTML.push('</div></div>');
|
|
|
historyHTML.push('</div>');
|
|
|
- }
|
|
|
- historyHTML.push('</div></div>');
|
|
|
+ historyHTML.push('</li>');
|
|
|
+ });
|
|
|
historyHTML.push('</div>');
|
|
|
- historyHTML.push('</li>');
|
|
|
+ historyHTML.push('</ul>');
|
|
|
});
|
|
|
- historyHTML.push('</div>');
|
|
|
- historyHTML.push('</ul>');
|
|
|
- });
|
|
|
- $('#audit-list').empty();
|
|
|
- $('#audit-list').append(historyHTML.join(''));
|
|
|
- }
|
|
|
- const loadHistory = function (result, auditConst) {
|
|
|
- const { auditHistory, auditors, user } = result
|
|
|
- let historyHTML = ''
|
|
|
- const leftAuditors = auditors;
|
|
|
- const darkHTML = !dayMode ? 'bg-dark border-secondary text-white' : '';
|
|
|
- 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"
|
|
|
+ $('#audit-list').empty();
|
|
|
+ $('#audit-list').append(historyHTML.join(''));
|
|
|
+ }
|
|
|
+ const loadHistory = function (result, auditConst) {
|
|
|
+ const { auditHistory, auditors, user } = result
|
|
|
+ let historyHTML = ''
|
|
|
+ const leftAuditors = auditors;
|
|
|
+ const darkHTML = !dayMode ? 'bg-dark border-secondary text-white' : '';
|
|
|
+ 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' : ''}">
|
|
|
+ }
|
|
|
+ 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">
|
|
|
+ auditors.forEach((auditor, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ historyHTML += `<li class="timeline-list-item pb-2">
|
|
|
<div class="timeline-item-date">
|
|
|
${formatDate(auditor.begin_time, !dayMode)}
|
|
|
</div>
|
|
@@ -1331,27 +1332,27 @@
|
|
|
${formatDate(auditor.end_time, !dayMode)}
|
|
|
</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">
|
|
|
+ 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">
|
|
|
+ } 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">
|
|
|
+ } 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>`
|
|
|
+ } else {
|
|
|
+ historyHTML += `<div class="timeline-item-icon bg-secondary text-light"></div>`
|
|
|
|
|
|
- }
|
|
|
- historyHTML += `<div class="timeline-item-content">
|
|
|
+ }
|
|
|
+ historyHTML += `<div class="timeline-item-content">
|
|
|
<div class="card ${darkHTML}">
|
|
|
<div class="card-body p-3">
|
|
|
<div class="card-text">
|
|
@@ -1361,38 +1362,38 @@
|
|
|
<p class="text-muted mb-0">${auditor.role}</p>
|
|
|
</div>
|
|
|
</div>`
|
|
|
- if (auditor.opinion) {
|
|
|
- historyHTML += `<div class="card-body p-3 border-top">
|
|
|
+ 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">
|
|
|
+ }
|
|
|
+ historyHTML += `</div></div></li>`
|
|
|
+ } else {
|
|
|
+ historyHTML += `<li class="timeline-list-item pb-2">
|
|
|
<div class="timeline-item-date">
|
|
|
${formatDate(auditor.end_time, !dayMode)}
|
|
|
</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">
|
|
|
+ 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">
|
|
|
+ } 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">
|
|
|
+ } 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">
|
|
|
+ } else {
|
|
|
+ historyHTML += `<div class="timeline-item-icon bg-secondary text-light"></div>`
|
|
|
+ }
|
|
|
+ historyHTML += `<div class="timeline-item-content">
|
|
|
<div class="card ${darkHTML}">
|
|
|
<div class="card-body p-3">
|
|
|
<div class="card-text">
|
|
@@ -1408,21 +1409,20 @@
|
|
|
</div>
|
|
|
</div>`
|
|
|
|
|
|
- if (auditor.opinion) {
|
|
|
- historyHTML += `<div class="card-body p-3 border-top">
|
|
|
+ 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 += `</div></div></li>`
|
|
|
- }
|
|
|
- })
|
|
|
- historyHTML += '</ul></div>'
|
|
|
+ })
|
|
|
+ historyHTML += '</ul></div>'
|
|
|
|
|
|
- })
|
|
|
- $('#audit-list').empty()
|
|
|
- $('#audit-list').append(historyHTML);
|
|
|
- };
|
|
|
- $(document).ready(function () {
|
|
|
+ })
|
|
|
+ $('#audit-list').empty()
|
|
|
+ $('#audit-list').append(historyHTML);
|
|
|
+ };
|
|
|
// 获取审批流程
|
|
|
$('a[data-target="#sp-list" ]').on('click', function () {
|
|
|
const type = $(this).attr('data-type');
|