|
@@ -114,59 +114,53 @@ $(document).ready(function () {
|
|
|
// });
|
|
|
// });
|
|
|
// 审批人分组选择
|
|
|
- $('#account_group').change(function () {
|
|
|
- let account_html = '<option value="0">选择审批人</option>';
|
|
|
- for (const account of accountList) {
|
|
|
- if ((parseInt($(this).val()) === 0 || parseInt($(this).val()) === account.account_group) && account.id !== parseInt(userID)) {
|
|
|
- const role = account.role !== '' ? '(' + account.role + ')' : '';
|
|
|
- const company = account.company !== '' ? ' -' + account.company : '';
|
|
|
- account_html += '<option value="' + account.id + '">' + account.name + role + company + '</option>';
|
|
|
- }
|
|
|
- }
|
|
|
- $('#account_list').html(account_html);
|
|
|
- });
|
|
|
+ // $('#account_group').change(function () {
|
|
|
+ // let account_html = '<option value="0">选择审批人</option>';
|
|
|
+ // for (const account of accountList) {
|
|
|
+ // if ((parseInt($(this).val()) === 0 || parseInt($(this).val()) === account.account_group) && account.id !== parseInt(userID)) {
|
|
|
+ // const role = account.role !== '' ? '(' + account.role + ')' : '';
|
|
|
+ // const company = account.company !== '' ? ' -' + account.company : '';
|
|
|
+ // account_html += '<option value="' + account.id + '">' + account.name + role + company + '</option>';
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // $('#account_list').html(account_html);
|
|
|
+ // });
|
|
|
// 添加到审批流程中
|
|
|
$('dl').on('click', 'dd', function () {
|
|
|
const id = parseInt($(this).data('id'));
|
|
|
if (id !== 0) {
|
|
|
- postData(getUrlPre() + '/audit/add', { auditorId: id }, (data) => {
|
|
|
+ postData(getUrlPre() + '/audit/add', { auditorId: id }, (datas) => {
|
|
|
const html = [];
|
|
|
- html.push('<li class="list-group-item" auditorId="'+ data.aid +'"><a href="javascript: void(0)" class="text-danger pull-right">移除</a>');
|
|
|
- html.push('<span>');
|
|
|
- html.push(data.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.aid +'">');
|
|
|
+ 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.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.aid + '">');
|
|
|
+ auditorshtml.push('<i class="fa fa-stop-circle"></i> ');
|
|
|
+ auditorshtml.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
|
|
|
+ if (index === 0) {
|
|
|
+ auditorshtml.push('<span class="pull-right">原报</span>');
|
|
|
+ } else if (index+1 === datas.length) {
|
|
|
+ auditorshtml.push('<span class="pull-right">终审</span>');
|
|
|
+ } else {
|
|
|
+ auditorshtml.push('<span class="pull-right">'+ transFormToChinese(index) +'审</span>');
|
|
|
+ }
|
|
|
+ auditorshtml.push('</li>');
|
|
|
}
|
|
|
- // 添加新审批人
|
|
|
- auditorshtml.push('<li class="list-group-item" data-auditid="' + data.aid + '">');
|
|
|
- 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.aid + '">');
|
|
|
- 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(''));
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -185,19 +179,19 @@ $(document).ready(function () {
|
|
|
|
|
|
// 如果是重新上报
|
|
|
// 令最后一个图标转换
|
|
|
- $('#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)) + '审');
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -252,7 +246,11 @@ $(document).ready(function () {
|
|
|
// 检查上报情况
|
|
|
function checkAuditorFrom () {
|
|
|
if ($('#auditors li').length === 0) {
|
|
|
- toastr.error('请先选择审批人,再上报数据');
|
|
|
+ if(shenpi_status === shenpiConst.sp_status.gdspl) {
|
|
|
+ toast('请联系管理员添加审批人', 'error', 'exclamation-circle');
|
|
|
+ } else {
|
|
|
+ toast('请先选择审批人,再上报数据', 'error', 'exclamation-circle');
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
$('#hide-all').show();
|