|
|
@@ -479,6 +479,72 @@ $(document).ready(function () {
|
|
|
return html;
|
|
|
}
|
|
|
|
|
|
+ function makeSpHtml(datas) {
|
|
|
+ const html = [];
|
|
|
+ // 如果是重新上报,添加到重新上报列表中
|
|
|
+ const auditorshtml = [];
|
|
|
+ for (const [index,data] of datas.entries()) {
|
|
|
+ if (index !== 0) {
|
|
|
+ html.push('<li class="list-group-item d-flex" auditorId="'+ data[0].aid +'">');
|
|
|
+ html.push(`<div class="col-auto">${index}</div>`);
|
|
|
+ html.push('<div class="col">');
|
|
|
+ for (const auditor of data) {
|
|
|
+ html.push(`<div class="d-inline-block mx-1" auditorId="${auditor.uid}"><i class="fa fa-user text-muted"></i> ${auditor.name} <small class="text-muted">${auditor.role}</small></div>`);
|
|
|
+ }
|
|
|
+ html.push('</div>');
|
|
|
+ html.push('<div class="col-auto">');
|
|
|
+ // todo 添加会签或签时
|
|
|
+ if (data[0].audit_type !== auditType.key.common) {
|
|
|
+ html.push(`<span class="badge badge-pill badge-${auditType.info[data[0].audit_type].class} badge-bg-small"><small>${auditType.info[data[0].audit_type].long}</small></span>`);
|
|
|
+ }
|
|
|
+ // html.push('<span class="badge badge-pill badge-primary badge-bg-small"><small></small></span>');
|
|
|
+ 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('</div>');
|
|
|
+ html.push('</li>');
|
|
|
+ }
|
|
|
+ // 添加新审批人流程修改
|
|
|
+ auditorshtml.push('<li class="list-group-item d-flex justify-content-between align-items-center" data-auditorid="' + data[0].aid + '">');
|
|
|
+ auditorshtml.push('<span class="mr-1"><i class="fa ' + (index === 0 ? 'fa-play-circle fa-rotate-90' : index+1 === datas.length ? 'fa-stop-circle' : 'fa-chevron-circle-down') + '"></i></span>');
|
|
|
+ auditorshtml.push('<span class="text-muted">');
|
|
|
+ for (const auditor of data) {
|
|
|
+ auditorshtml.push(`<small class="d-inline-block text-dark mx-1" title="${auditor.role}" data-auditorId="${auditor.uid}">${auditor.name}</small>`);
|
|
|
+ }
|
|
|
+ auditorshtml.push('</span>');
|
|
|
+ auditorshtml.push('<div class="d-flex ml-auto">');
|
|
|
+ if (data[0].audit_type !== auditType.key.common) {
|
|
|
+ auditorshtml.push(`<span class="badge badge-pill badge-${auditType.info[data[0].audit_type].class} p-1"><small>${auditType.info[data[0].audit_type].short}</small></span>`);
|
|
|
+ }
|
|
|
+ if (index === 0) {
|
|
|
+ auditorshtml.push('<span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>');
|
|
|
+ } else if (index+1 === datas.length) {
|
|
|
+ auditorshtml.push('<span class="badge badge-light badge-pill"><small>终审</small></span>');
|
|
|
+ } else {
|
|
|
+ auditorshtml.push('<span class="badge badge-light badge-pill"><small>'+ transFormToChinese(index) +'审</small></span>');
|
|
|
+ }
|
|
|
+ auditorshtml.push('</div>');
|
|
|
+ auditorshtml.push('</li>');
|
|
|
+ }
|
|
|
+ $('#auditors').html(html.join(''));
|
|
|
+ $('#auditors-list').html(auditorshtml.join(''));
|
|
|
+ }
|
|
|
+
|
|
|
+ $('#change-sp-group').change(function () {
|
|
|
+ const data = {
|
|
|
+ type: 'change_sp_group',
|
|
|
+ sp_group: parseInt($(this).val()),
|
|
|
+ }
|
|
|
+ if (!data.sp_group) {
|
|
|
+ toastr.error('请选择固定审批组');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ postData(preUrl + '/audit/spgroup', data, (datas) => {
|
|
|
+ makeSpHtml(datas);
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
});
|
|
|
// 检查上报情况
|
|
|
function checkAuditorFrom () {
|
|
|
@@ -544,3 +610,4 @@ function codeSuccess(btn) {
|
|
|
counter -= 1;
|
|
|
}, 1000);
|
|
|
}
|
|
|
+
|