let auditUtils; $(function () { autoFlashHeight(); $('#tid_select').change(function () { const tid = parseInt($(this).val()) || 0; setSelectValue('tid', tid); }); $('#status_select .to-log-link').click(function () { const status = parseInt($(this).data('val')) || null; setSelectValue('status', status); }); $('#used_select .to-log-link').click(function () { const used = $(this).data('val') || null; setSelectValue('used', used); }); function setSelectValue(select, value) { const routes = []; const tid = select === 'tid' ? value : $('#tid_select').val(); if (tid) { routes.push('tid=' + tid); } const status = select === 'status' ? value : $('#status_selected').data('value'); if (status) { routes.push('status=' + status); } const used = select === 'used' ? value : $('#used_selected').data('value'); if (used) { routes.push('used=' + used); } window.location.href = '/financial/' + spid + '/pay' + (routes.length ? '?' + routes.join('&') : ''); } let timer = null let oldSearchVal = null $('#liucheng').on('input propertychange', '.gr-search', function(e) { oldSearchVal = e.target.value; timer && clearTimeout(timer); timer = setTimeout(() => { const newVal = $(this).val(); const code = $(this).attr('data-code'); let html = ''; if (newVal && newVal === oldSearchVal) { accountList.filter(item => item && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => { html += `

${item.name}${item.mobile || ''}

${item.role || ''}
` }); $('#' + code + '_dropdownMenu .book-list').empty(); $('#' + code + '_dropdownMenu .book-list').append(html); } else { if (!$('#' + code + '_dropdownMenu .acc-btn').length) { accountGroup.forEach((group, idx) => { if (!group) return; html += `
${group.groupName}
`; group.groupList.forEach(item => { html += `

${item.name}${item.mobile || ''}

${item.role || ''}
`; }); html += '
'; }); $('#' + code + '_dropdownMenu .book-list').empty(); $('#' + code + '_dropdownMenu .book-list').append(html); } } }, 400); }); $('#liucheng').on('show.bs.modal', function (e) { $('#shenpi-tender-list tr').removeClass('bg-warning'); if (tenders.length > 0) { $('#shenpi-tender-list tr').eq(0).addClass('bg-warning'); auditUtils. makeReportListHtml(tenders[0]); auditUtils.makeShenpiListHtml(tenders[0]); } }); $('#shenpi-tender-list').on('click', '.change-tender', function () { if ($(this).hasClass('bg-warning')) { return; } $('#shenpi-tender-list tr').removeClass('bg-warning'); $(this).parents('tr').addClass('bg-warning'); const tid = parseInt($(this).parents('tr').data('tid')) || 0; const tender = tenders.find(t => t.id === tid); if (!tender) { toastr.error('请选择标段'); return; } auditUtils.makeReportListHtml(tender); auditUtils.makeShenpiListHtml(tender); }); auditUtils = { makeReportListHtml: function (flow) { let addHtml = ''; $('#select-all-ptAudits').prop('checked', false); for (const pl of flow.permissionList) { addHtml += ` ${pl.name}${pl.company} 移除 `; } $('#report-list').html(addHtml); }, makeShenpiListHtml: function (flow) { let addhtml = '\n'; $('#shenpi-list').html(addhtml); }, getAuditHtml: function(audit, is_report = 0) { return ''+ audit.name +' \n' + ' \n' + ' \n' + ' ' + ' \n' }, getAuditTypeHtml: function(code, type) { const html = []; html.push(` '); return html.join(''); }, getSelectAuditHtml: function (code, is_report = 0) { let divhtml = ''; accountGroup.forEach((group, idx) => { let didivhtml = ''; if(group) { group.groupList.forEach(item => { didivhtml += '
\n' + '

' + item.name + '' + item.mobile + '

\n' + ' ' + item.role + '\n' + '
\n'; }); divhtml += '
' + group.groupName + '
\n' + '
\n' + didivhtml + '
\n'; } }); const html = ' \n' + ' \n' + ' \n'; return html; }, // 以下i从1开始 getAuditGroupInnerHtml: function(code, auditGroup, i) { const html = []; const type = auditGroup.length > 0 ? auditGroup[0].audit_type : auditType.key.common; html.push(`${transFormToChinese(i)}审`); html.push(this.getAuditTypeHtml(code, type)); for (const audit of auditGroup) { html.push(this.getAuditHtml(audit)); } if (type !== auditType.key.common || auditGroup.length === 0) { html.push(this.getSelectAuditHtml(code)); } if (type === auditType.key.union && auditGroup.length > 0) { html.push(``); } html.push(''); return html.join(''); }, getAuditGroupHtml: function (code, auditGroup, i) { return `
  • ${this.getAuditGroupInnerHtml(code, auditGroup, i)}
  • `; }, getgdsplHtml(flow, this_code) { let addhtml = ''; if (flow.auditGroupList.length !== 0) { for(const [i, auditGroup] of flow.auditGroupList.entries()) { addhtml += this.getAuditGroupHtml(this_code, auditGroup, i + 1); } const addGroupHtml = this_code === 'change' && (!flow.groupList || (flow.groupList && flow.groupList.length === 0)) ? ` 存为审批组\n` : ''; addhtml += '
  • \n' + ' 添加流程\n' + addGroupHtml + '
  • '; } else { addhtml += this.getAuditGroupHtml(this_code, [], 1); } return addhtml; }, // 以下i从0开始 addAudit: function (tender, user, i) { const flow = tender; if (!flow.auditGroupList) flow.auditGroupList = []; if (!flow.auditGroupList[i]) flow.auditGroupList[i] = []; flow.auditGroupList[i].push(user); return flow.auditGroupList[i]; }, removeAudit: function (tender, audit_id, i) { const flow = tender; if (flow.auditGroupList[i].length === 1) { flow.auditGroupList.splice(i, 1); return null; } flow.auditGroupList[i].splice(flow.auditGroupList[i].findIndex(x => { return x.audit_id === audit_id; }), 1); return flow.auditGroupList[i]; }, setAuditType: function (tender, audit_type, i) { const flow = tender; if (!flow || !flow.auditGroupList || !flow.auditGroupList[i]) return; flow.auditGroupList[i].forEach(x => { x.audit_type = audit_type}); return flow.auditGroupList[i]; } }; // 选中填报人 $('body').on('click', 'div[id="report_audit_dropdownMenu"] dl dd', function () { const tid = parseInt($('#shenpi-tender-list tr.bg-warning').data('tid')); const tender = tenders.find(t => t.id === tid); if (!tender) { toastr.error('请选择标段'); return; } const id = parseInt($(this).data('id')); if (!id) return; if (!isNaN(id) && id !== 0) { postData('/financial/'+ spid + '/pay/save', {type: 'add-tender-audit', id: id, tid: tender.id }, function (result) { tender.permissionList = result; auditUtils.makeReportListHtml(tender); }) } }); // 移除填报人 $('body').on('click', '#report-list .remove-audit', function () { const tid = parseInt($('#shenpi-tender-list tr.bg-warning').data('tid')); const tender = tenders.find(t => t.id === tid); if (!tender) { toastr.error('请选择标段'); return; } const id = parseInt($(this).data('id')); deleteAfterHint(function () { postData('/financial/'+ spid + '/pay/save', {type: 'del-tender-audit', id, tid: tender.id }, function (result) { tender.permissionList = result.permissionList; tender.auditGroupList = result.auditGroupList; auditUtils.makeReportListHtml(tender); auditUtils.makeShenpiListHtml(tender); }); }, '确认删除该标段用户?'); }); // 勾选是否为填报人 $('body').on('click', '#report-list .save-report', function () { const tid = parseInt($('#shenpi-tender-list tr.bg-warning').data('tid')); const tender = tenders.find(t => t.id === tid); if (!tender) { toastr.error('请选择标段'); return; } const id = parseInt($(this).data('id')); const isReport = $(this).prop('checked'); const permission = tender.permissionList.find(p => p.id === id); if (!permission) { toastr.error('该用户不存在'); return; } postData('/financial/'+ spid + '/pay/save', {type: 'save-permission', updateData: { id, is_report: isReport } }, function (result) { permission.is_report = isReport; }); }); $('#select-all-ptAudits').click(function () { $('#report-list .select-ptAudit').prop('checked', $(this).prop('checked')); }); $('#batch-del-ptAudit').click(function () { const tid = parseInt($('#shenpi-tender-list tr.bg-warning').data('tid')); const tender = tenders.find(t => t.id === tid); if (!tender) { toastr.error('请选择标段'); return; } const ids = []; $('#report-list .select-ptAudit:checked').each(function () { ids.push(parseInt($(this).data('id'))); }); if (ids.length === 0) { toastr.warning('请勾选要删除的用户'); return; } deleteAfterHint(function () { postData('/financial/'+ spid + '/pay/save', {type: 'del-tender-audit', id: ids, tid: tender.id }, function (result) { tender.permissionList = result.permissionList; tender.auditGroupList = result.auditGroupList; auditUtils.makeReportListHtml(tender); auditUtils.makeShenpiListHtml(tender); }); }, '确认删除已勾选的标段用户?'); }); $('#batch-other-ptAudit').click(function () { const cur_tenderid = parseInt($('#shenpi-tender-list tr.bg-warning').data('tid')); const tender = tenders.find(t => t.id === cur_tenderid); if (!tender) { toastr.error('请选择标段'); return; } const ids = []; $('#report-list .select-ptAudit:checked').each(function () { ids.push(parseInt($(this).data('id'))); }); if (ids.length === 0) { toastr.warning('请勾选要同步的用户'); return; } const num = $('#shenpi-tender-list input:checked').length; if (num === 0 || (num === 1 && parseInt($('#shenpi-tender-list input:checked').eq(0).parents('tr').data('tid')) === cur_tenderid)) { toastr.warning('请选择需要设置审批同步的标段'); return; } const tenderList = []; for (let i = 0; i < num; i++) { const tid = parseInt($('#shenpi-tender-list input:checked').eq(i).parents('tr').data('tid')); if (tid !== cur_tenderid) { tenderList.push(tid); } } const data = { type: 'copy-tender-audit', id: ids, this_tid: tender.id, } data.tidList = tenderList.join(','); postData('/financial/'+ spid + '/pay/save', data, function (result) { toastr.success('已同步到其它勾选标段'); for (let i = 0; i < num; i++) { const tid = parseInt($('#shenpi-tender-list input:checked').eq(i).parents('tr').data('tid')); if (tid !== cur_tenderid) { const other_tender = tenders.find(t => t.id === tid); const permissionList = _.filter(result.otherPermissionList, { tid: tid }); other_tender.permissionList = permissionList; } } }); }); // 选中审批人 $('body').on('click', '#shenpi-list div[id$="_dropdownMenu"] dl dd', function () { const tid = parseInt($('#shenpi-tender-list tr.bg-warning').data('tid')); const tender = tenders.find(t => t.id === tid); if (!tender) { toastr.error('请选择标段'); return; } const id = parseInt($(this).data('id')); if (!id) return; let this_code = 'financial'; const user = _.find(accountList, function (item) { return item.id === id; }); // 判断是否已存在审批人 const aid_num = $(this).parents('ul').find('.remove-audit').length; for (let i = 0; i < aid_num; i++) { const aid = parseInt($(this).parents('ul').find('.remove-audit').eq(i).data('id')); if (aid === id) { toastr.warning('该审核人已存在,请勿重复添加'); return; } } const prop = { status: sp_status.gdspl, code: sp_type[this_code], audit_id: id, type: 'add', audit_type: parseInt($(this).parents('li').find('select[class*="audit-type-key"]')[0].value), audit_order: $(this).parents('li').index() + 1, }; const _self = $(this); postData('/financial/' + spid + '/pay/save', { type: 'add-shenpi-audit', shenpi: prop, tid }, function (result) { const data = result.shenpi; const auditGroup = auditUtils.addAudit(tender, { audit_id: data.audit_id, name: user.name, audit_type: data.audit_type, audit_order: data.audit_order }, prop.audit_order - 1); if (_self.parents('ul').find('.add-audit').length === 0) { _self.parents('ul').append('
  • \n' + ' 添加流程\n' + '
  • '); } _self.parents('li').html(auditUtils.getAuditGroupInnerHtml(this_code, auditGroup, prop.audit_order)); tender.permissionList = result.permissionList; auditUtils.makeReportListHtml(tender); }); }); // 移除审批人 $('body').on('click', '#shenpi-list .remove-audit', function () { const tid = parseInt($('#shenpi-tender-list tr.bg-warning').data('tid')); const tender = tenders.find(t => t.id === tid); if (!tender) { toastr.error('请选择标段'); return; } const id = parseInt($(this).data('id')); const this_code = 'financial'; const prop = { status: sp_status.gdspl, code: sp_type[this_code], audit_id: id, type: 'del', }; const _self = $(this); postData('/tender/' + tid + '/shenpi/audit/save', prop, function (data) { const index = _self.parents('li').index(); const auditGroup = auditUtils.removeAudit(tender, id, index); if (auditGroup) { _self.parents('li').html(auditUtils.getAuditGroupInnerHtml(this_code, auditGroup, index + 1)); } else { const _selflc = _self.parents('#shenpi-list'); _self.parents('li').remove(); const aid_num = parseInt(_selflc.children('ul').find('li.d-flex').length); if (aid_num === 0) { _selflc.children('ul').html(auditUtils.getAuditGroupHtml(this_code, [], 1)); } else { for (let i = 0; i < aid_num; i++) { _selflc.find('li.d-flex').eq(i).find('.col-auto').text(transFormToChinese(i+1) + '审'); } } } }) }); $('body').on('click', '#shenpi-list .add-audit', function () { const num = $(this).parents('ul').children('li').length; const this_code = 'financial'; const addhtml = auditUtils.getAuditGroupHtml(this_code, [], num); $(this).parents('ul').append(addhtml); $(this).parents('li').remove(); }); // 设置会签、或签 $('body').on('change', 'select[class*="audit-type-key"]', function() { const tid = parseInt($('#shenpi-tender-list tr.bg-warning').data('tid')); const tender = tenders.find(t => t.id === tid); if (!tender) { toastr.error('请选择标段'); return; } const removes = $(this).parents('.d-flex').find('.remove-audit'); if (removes.length === 0) return; const this_status = sp_status.gdspl; const this_code = 'financial'; const ids = []; const liParent = $(this).parents('li'); removes.each((i, r) => { ids.push(parseInt(r.getAttribute('data-id'))); }); const prop = { status: this_status, code: sp_type[this_code], audit_id: ids, audit_type: parseInt(this.value), type: 'audit-type', }; if (prop.audit_type === auditType.key.common && ids.length > 1) { toastr.warning('设置个人审批前请先删除多余的审批人'); this.value = this.getAttribute('data-type'); return; } const _self = this; postData('/tender/'+ tid +'/shenpi/audit/save', prop, function () { _self.setAttribute('data-type', _self.value); const auditGroup = auditUtils.setAuditType(tender, prop.audit_type, liParent.index()); liParent.html(auditUtils.getAuditGroupInnerHtml(this_code, auditGroup, liParent.index() + 1)); }); }); $('#set-other-tenders').on('click', function () { const cur_tenderid = parseInt($('#shenpi-tender-list tr.bg-warning').data('tid')); const tender = tenders.find(t => t.id === cur_tenderid); if (!tender) { toastr.error('请选择标段'); return; } if (tender.auditGroupList.length === 0) { toastr.warning('请先设置审批流程再同步到其它标段'); return; } const this_code = 'financial'; const num = $('#shenpi-tender-list input:checked').length; if (num === 0 || (num === 1 && parseInt($('#shenpi-tender-list input:checked').eq(0).parents('tr').data('tid')) === cur_tenderid)) { toastr.warning('请选择需要设置审批同步的标段'); return; } const data = { type: 'copy-shenpi-audit', status: sp_status.gdspl, code: this_code, this_tid: cur_tenderid, }; // 二维数组变一维 data.auditList = []; for (const auditGroup of tender.auditGroupList) { data.auditList.push(...auditGroup); } const tenderList = []; for (let i = 0; i < num; i++) { const tid = parseInt($('#shenpi-tender-list input:checked').eq(i).parents('tr').data('tid')); if (tid !== cur_tenderid) { tenderList.push(tid); } } data.tidList = tenderList.join(','); console.log(data); postData('/financial/' + spid + '/pay/save', data, function (result) { toastr.success('已同步到其它勾选标段'); for (let i = 0; i < num; i++) { const tid = parseInt($('#shenpi-tender-list input:checked').eq(i).parents('tr').data('tid')); if (tid !== cur_tenderid) { const other_tender = tenders.find(t => t.id === tid); other_tender.auditGroupList = tender.auditGroupList; const permissionList = _.filter(result.otherPermissionList, { tid: tid }); other_tender.permissionList = permissionList; } } }); }); // 添加到成员中 $('body').on('click', '.book-list dt', function () { const idx = $(this).find('.acc-btn').attr('data-groupid') const type = $(this).find('.acc-btn').attr('data-type') if (type === 'hide') { $(this).parent().find(`div[data-toggleid="${idx}"]`).show(() => { $(this).children().find('i').removeClass('fa-plus-square').addClass('fa-minus-square-o') $(this).find('.acc-btn').attr('data-type', 'show') }) } else { $(this).parent().find(`div[data-toggleid="${idx}"]`).hide(() => { $(this).children().find('i').removeClass('fa-minus-square-o').addClass('fa-plus-square') $(this).find('.acc-btn').attr('data-type', 'hide') }) } return false }); $('#add-pay').on('show.bs.modal', function () { let t = null; if (tenders.length > 0) { if (is_admin) { t = tenders[0]; } else { const filterTender = tenders.filter(t => _.includes(fptReportTids, t.id)); if (filterTender.length > 0) { t = filterTender[0]; } } } $('#add-pay-tender').val(t ? t.id : ''); changeTender(t); }); $('#add-pay-tender').on('change', function () { const tender = tenders.find(t => t.id === parseInt($(this).val())); changeTender(tender); }); $('#add-pay-btn').on('click', function () { const tid = $('#add-pay-tender').val(); const tender = tenders.find(t => t.id === parseInt(tid)); if (!tender) { toastr.error('请选择支付标段'); return; } const code = $('#add-pay-code').val(); if (!code) { toastr.error('请先去标段属性,填写合同编号'); return; } const prop = { tid: tender.id, code: code, used: $('#add-pay-used').val(), }; postData('/financial/'+ spid + '/pay/save', { type: 'add-pay', updateData: prop }, function (result) { window.location.href = '/financial/' + spid + '/pay/' + result.id + '/detail'; }); }); $('body').on('click', '#pay-list .del-pay-btn', function () { const fpid = $(this).data('id'); deleteAfterHint(function () { postData('/financial/'+ spid + '/pay/save', {type: 'del-pay', postData: { node: fpid }}, function (result) { window.location.reload(); }) }, '确认删除该资金支付?'); }); $('#pay-list tr').on('click', function () { const tid = parseInt($(this).data('tid')); const tender = tenders.find(t => t.id === tid); if (tid && tender) { $(this).siblings().removeClass('alert-warning'); $(this).addClass('alert-warning'); $('#show-pay-account').show(); $('#payaccount input[name="tid"]').val(tender.id); } else { $(this).siblings().removeClass('alert-warning'); $('#show-pay-account').hide(); $('#payaccount input[name="tid"]').val(''); } }); $('#payaccount').on('show.bs.modal', function () { const tid = parseInt($('#payaccount input[name="tid"]').val()); const tender = tenders.find(t => t.id === tid); $('#payaccount .modal-title').text('付款账号()'); $('#payaccount input[name="name"]').val(''); $('#payaccount input[name="bank"]').val(''); $('#payaccount input[name="bank_account"]').val(''); $('#payaccount input[name="contact"]').val(''); $('#payaccount input[name="phone"]').val(''); if (tid && tender) { $('#payaccount .modal-title').text('付款账号(' + tender.name + ')'); $('#payaccount input[name="name"]').val(tender.pt.name); $('#payaccount input[name="bank"]').val(tender.pt.bank); $('#payaccount input[name="bank_account"]').val(tender.pt.bank_account); $('#payaccount input[name="contact"]').val(tender.pt.contact); $('#payaccount input[name="phone"]').val(tender.pt.phone); if (is_admin || (fptReportTids && _.includes(fptReportTids, tid))) { $('#payaccount table input').attr('readonly', false); $('#get-form-tender').show(); $('#set-pay-btn').show(); $('#payaccount input[name="id"]').val(tender.pt.id); } else { $('#payaccount table input').attr('readonly', true); $('#get-form-tender').hide(); $('#set-pay-btn').hide(); $('#payaccount input[name="id"]').val(''); $('#payaccount input[name="tid"]').val(''); } } }); $('#get-form-tender').on('click', function () { const tid = $('#payaccount input[name="tid"]').val(); const tender = tenders.find(t => t.id === parseInt(tid)); if (!tid || !tender) { toastr.error('标段不存在'); return; } $('#payaccount input[name="name"]').val(tender.pay_account.name); $('#payaccount input[name="bank"]').val(tender.pay_account.bank); $('#payaccount input[name="bank_account"]').val(tender.pay_account.account); $('#payaccount input[name="contact"]').val(tender.pay_account.contact); $('#payaccount input[name="phone"]').val(tender.pay_account.phone); toastr.success('已同步'); }); $('#set-pay-btn').on('click', function () { const tid = $('#payaccount input[name="tid"]').val(); const tender = tenders.find(t => t.id === parseInt(tid)); if (!tid || !tender) { toastr.error('标段不存在'); return; } if (is_admin || (fptReportTids && _.includes(fptReportTids, tender.id))) { const data = { id: parseInt($('#payaccount input[name="id"]').val()), tid: tender.id, name: $('#payaccount input[name="name"]').val(), bank: $('#payaccount input[name="bank"]').val(), bank_account: $('#payaccount input[name="bank_account"]').val(), contact: $('#payaccount input[name="contact"]').val(), phone: $('#payaccount input[name="phone"]').val(), } if (!data.name) { toastr.error('请填写开户名称'); return; } if (!data.bank) { toastr.error('请填写开户银行'); return; } if (!data.bank_account) { toastr.error('请填写开户账号'); return; } postData('/financial/'+ spid + '/pay/save', { type: 'set-pay-tender', updateData: data }, function (result) { toastr.success('保存成功'); tender.pt = result; }); } else { toastr.error('无权限操作'); return; } }); $('#pay-list tr').eq(0).click(); function changeTender(tender) { $('#add-pay-tender').val(tender ? tender.id : ''); if (!tender) { toastr.warning('请先为项目添加标段再申请支付'); return; } if (tender.dealCode) { $('#add-pay-code').val(tender.dealCode + '-' + moment().format('YYYYMMDD') + '-' + makeNum(tender.startNum)); $('#add-pay-code').siblings('span').text(''); } else { $('#add-pay-code').val(''); $('#add-pay-code').siblings('span').html('请先去标段属性,填写合同编号'); } } function makeNum(num) { let str = num.toString(); while (str.length < 3) { str = '0' + str; } return str; } $('#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('展开历史审核记录') }) } }); // 获取审批流程 $('a[data-target="#sp-list" ]').on('click', function () { const data = { type: 'get-auditors', id: $(this).attr('c-id'), }; postData('/financial/'+ spid + '/pay/save', data, function (result) { const { auditHistory, auditors2, user } = result; let auditorsHTML = []; auditors2.forEach((group, idx) => { if (idx === 0) { auditorsHTML.push(`
  • ${getGroupAuditHtml(group)} 原报
  • `); } else if(idx === auditors2.length -1 && idx !== 0) { auditorsHTML.push(`
  • ${getGroupAuditHtml(group)}
    ${getAuditTypeHtml(group[0].audit_type)} 终审
  • `); } else { auditorsHTML.push(`
  • ${getGroupAuditHtml(group)}
    ${getAuditTypeHtml(group[0].audit_type)} ${transFormToChinese(idx)}审
  • `); } }); $('#auditor-list').empty(); $('#auditor-list').append(auditorsHTML.join('')); let historyHTML = []; auditHistory.forEach((his, idx) => { if (idx === auditHistory.length - 1 && auditHistory.length !== 1) { historyHTML.push(`
    展开历史审批流程
    `); } historyHTML.push(`
    `); historyHTML.push(`
    ${idx+1}#
    `); historyHTML.push(`
    '); historyHTML.push(''); }); $('#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', key: 'menu.1.0.0', miniHint: '#sub-mini-hint', hintKey: 'menu.hint.1.0.1', callback: function (info) { if (info.mini) { $('.panel-title').addClass('fluid'); $('#sub-menu').removeClass('panel-sidebar'); } else { $('.panel-title').removeClass('fluid'); $('#sub-menu').addClass('panel-sidebar'); } autoFlashHeight(); } }); }); const getGroupAuditHtml = function (group) { return group.map(u => { return `${u.name}`; }).join(''); }; const getAuditTypeHtml = function (type) { if (type === auditType.key.common) return ''; return `
    ${auditType.info[type].short}
    `; }; const getAuditTypeText = function (type) { if (type === auditType.key.common) return ''; return `${auditType.info[type].long}`; };