|
@@ -278,6 +278,163 @@ $(function () {
|
|
|
$('.c-body .tender-info').eq(0).click();// 需要延时加载
|
|
|
}, 500);
|
|
|
|
|
|
+ $('#audit-list').on('click', 'a', 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('#end-target').text($(this).data('idx') + '#')
|
|
|
+ auditCard.find('#fold-btn').text('收起历史审核记录')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ $(this).data('target', 'show')
|
|
|
+ auditCard.find('.fold-card').slideUp('swing', () => {
|
|
|
+ auditCard.find('#end-target').text('1#')
|
|
|
+ auditCard.find('#fold-btn').text('展开历史审核记录')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 获取审批流程
|
|
|
+ $('body').on('click', 'a[data-target="#sp-list" ]', function () {
|
|
|
+ const data = {
|
|
|
+ type: 'get-auditors',
|
|
|
+ id: $(this).attr('c-id'),
|
|
|
+ };
|
|
|
+ postData(`/sp/${spid}/financial/pay/save`, data, function (result) {
|
|
|
+ const { auditHistory, auditors2, user } = result;
|
|
|
+ let auditorsHTML = [];
|
|
|
+ auditors2.forEach((group, idx) => {
|
|
|
+ if (idx === 0) {
|
|
|
+ auditorsHTML.push(`<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
|
+ <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
|
|
|
+ <span class="text-muted">${getGroupAuditHtml(group)}</span>
|
|
|
+ <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
|
|
|
+ </li>`);
|
|
|
+ } else if(idx === auditors2.length -1 && idx !== 0) {
|
|
|
+ auditorsHTML.push(`<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
|
+ <span class="mr-1"><i class="fa fa fa-stop-circle fa-rotate-90"></i></span>
|
|
|
+ <span class="text-muted">${getGroupAuditHtml(group)}</span>
|
|
|
+ <div class="d-flex ml-auto">
|
|
|
+ ${getAuditTypeHtml(group[0].audit_type)}
|
|
|
+ <span class="badge badge-light badge-pill ml-auto"><small>终审</small></span>
|
|
|
+ </div>
|
|
|
+ </li>`);
|
|
|
+ } else {
|
|
|
+ auditorsHTML.push(`<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
|
+ <span class="mr-1"><i class="fa fa fa-chevron-circle-down"></i></span>
|
|
|
+ <span class="text-muted">${getGroupAuditHtml(group)}</span>
|
|
|
+ <div class="d-flex ml-auto">
|
|
|
+ ${getAuditTypeHtml(group[0].audit_type)}
|
|
|
+ <span class="badge badge-light badge-pill"><small>${transFormToChinese(idx)}审</small></span>
|
|
|
+ </div>
|
|
|
+ </li>`);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#auditor-list').empty();
|
|
|
+ $('#auditor-list').append(auditorsHTML.join(''));
|
|
|
+
|
|
|
+ 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 ${ 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 === auditConst.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 === 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) {
|
|
|
+ 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 if (group.status === auditConst.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">');
|
|
|
+ historyHTML.push('<div class="py-1">');
|
|
|
+ const statuStr = group.status !== auditConst.status.uncheck ?
|
|
|
+ `<span class="pull-right ${auditConst.statusClass[group.status]}">${auditConst.statusString[group.status]}</span>` : '';
|
|
|
+ historyHTML.push(`
|
|
|
+ <span class="text-black-50">
|
|
|
+ ${ group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审' } ${getAuditTypeText(group.audit_type)}
|
|
|
+ </span>
|
|
|
+ ${statuStr}`);
|
|
|
+ historyHTML.push('</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 === auditConst.status.checked) {
|
|
|
+ historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');
|
|
|
+ } else if (auditor.status === auditConst.status.checkNo) {
|
|
|
+ historyHTML.push('<span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>');
|
|
|
+ } else if (auditor.status === auditConst.status.checking) {
|
|
|
+ historyHTML.push('<span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>');
|
|
|
+ } else if (auditor.status === auditConst.status.checkAgain) {
|
|
|
+ historyHTML.push('<span class="pull-right text-warning"><i class="fa fa-check"></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(''));
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
$.subMenu({
|
|
|
menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
|
|
|
toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
|
|
@@ -295,3 +452,16 @@ $(function () {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+const getGroupAuditHtml = function (group) {
|
|
|
+ return group.map(u => { return `<small class="d-inline-block text-dark mx-1" title="${u.role}" data-auditorId="${u.aid}">${u.name}</small>`; }).join('');
|
|
|
+};
|
|
|
+
|
|
|
+const getAuditTypeHtml = function (type) {
|
|
|
+ if (type === auditType.key.common) return '';
|
|
|
+ return `<div class="li-subscript"><span class="badge badge-pill badge-${auditType.info[type].class} p-1 badge-bg-small"><small>${auditType.info[type].short}</small></span></div>`;
|
|
|
+};
|
|
|
+
|
|
|
+const getAuditTypeText = function (type) {
|
|
|
+ if (type === auditType.key.common) return '';
|
|
|
+ return `<span class="text-${auditType.info[type].class}">${auditType.info[type].long}</span>`;
|
|
|
+};
|