|
|
@@ -516,7 +516,7 @@ $(document).ready(function() {
|
|
|
})
|
|
|
console.log(pays);
|
|
|
newPays.forEach((pay, idx) => {
|
|
|
- const shenpi_html = pay_shenpi_status ? setPayShenpiHtml(pay) : '';
|
|
|
+ const shenpi_html = setPayShenpiHtml(pay);
|
|
|
const operationHtml = !pay.fpcid ? `<a href="javascript:void(0);" class="text-primary pay-edit" data-id="${pay.id}" ${!pay.showEdit ? `style="display:none"` : ''}>编辑</a> <a href="javascript:void(0);" class="text-danger pay-del" data-id="${pay.id}" ${!pay.showEdit ? `style="display:none"` : ''}>删除</a>` : '';
|
|
|
paysHtml += `<tr class="text-center" data-cpid="${pay.id}">
|
|
|
<td style="position: relative">${idx + 1}${ pay.fpcid ? '<a href="javascript:void(0);" style="position: absolute;right: 2px;top:50%;transform: translate(-50%, -50%);"><i class="fa fa-cny"></i></a>' : ''}</td>
|
|
|
@@ -2522,6 +2522,38 @@ $(document).ready(function() {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ function setPayShenpiHtml(pay, reload = false) {
|
|
|
+ let shenpi_html = '';
|
|
|
+ if (pay_shenpi_status) {
|
|
|
+ shenpi_html += !reload ? `<td class="shenpi-td ${auditConst.auditProgressClass[pay.status]}">` : '';
|
|
|
+ if ((pay.status === auditConst.status.uncheck || pay.status === auditConst.status.checkNo) && pay.uid === user_id) {
|
|
|
+ shenpi_html += `<a href="javascript:void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" class="btn ${auditConst.statusButtonClass[pay.status]} btn-sm show-sub-sp">${auditConst.statusButton[pay.status]}</a>`;
|
|
|
+ } else if ((pay.status === auditConst.status.checking || pay.status === auditConst.status.checkNoPre) && pay.curAuditors && pay.curAuditors.findIndex(x => { return x.aid === user_id; }) >= 0) {
|
|
|
+ shenpi_html += `<a href="javascript: void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" data-operate="checked" data-title="审批通过" class="btn btn-success btn-sm mr-2 show-sp-list">审批通过</a>`;
|
|
|
+ shenpi_html += `<a href="javascript: void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" data-operate="checkNo" data-title="审批退回" class="btn btn-warning btn-sm show-sp-list">审批退回</a>`;
|
|
|
+ } else {
|
|
|
+ if (pay.status === auditConst.status.checked && pay.final_auditor_str) {
|
|
|
+ shenpi_html += `<a href="javascript:void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" class="show-sp-list">${pay.final_auditor_str}</a>`;
|
|
|
+ } else if (pay.status === auditConst.status.checkNo && pay.curAuditors2 && pay.curAuditors2.length > 0) {
|
|
|
+ if (pay.curAuditors2[0].audit_type === auditType.key.common) {
|
|
|
+ shenpi_html += `<a href="javascript:void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" class="show-sp-list">${pay.curAuditors2[0].name}${pay.curAuditors2[0].role !== '' && pay.curAuditors2[0].role !== null ? '-' + pay.curAuditors2[0].role : ''}</a>`;
|
|
|
+ } else {
|
|
|
+ shenpi_html += `<a href="javascript:void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" class="show-sp-list">${transFormToChinese(pay.curAuditors2[0].audit_order) + '审'}</a>`;
|
|
|
+ }
|
|
|
+ } else if (pay.curAuditors.length > 0) {
|
|
|
+ if (pay.curAuditors[0].audit_type === auditType.key.common) {
|
|
|
+ shenpi_html += `<a href="javascript:void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" class="show-sp-list">${pay.curAuditors[0].name}${pay.curAuditors[0].role !== '' && pay.curAuditors[0].role !== null ? '-' + pay.curAuditors[0].role : ''}</a>`;
|
|
|
+ } else {
|
|
|
+ shenpi_html += `<a href="javascript:void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" class="show-sp-list">${transFormToChinese(pay.curAuditors[0].audit_order) + '审'}</a>`;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ shenpi_html += ` ${auditConst.auditProgress[pay.status]}`;
|
|
|
+ }
|
|
|
+ shenpi_html += !reload ? '</td>' : '';
|
|
|
+ }
|
|
|
+ return shenpi_html;
|
|
|
+ }
|
|
|
+
|
|
|
if (shenpi_status || pay_shenpi_status) {
|
|
|
$('body').on('click', '.show-sub-sp', function () {
|
|
|
console.log($(this).attr('node-cid'));
|
|
|
@@ -2806,38 +2838,6 @@ $(document).ready(function() {
|
|
|
$('#audit-list').append(historyHTML.join(''));
|
|
|
}
|
|
|
|
|
|
- function setPayShenpiHtml(pay, reload = false) {
|
|
|
- let shenpi_html = '';
|
|
|
- if (pay_shenpi_status) {
|
|
|
- shenpi_html += !reload ? `<td class="shenpi-td ${auditConst.auditProgressClass[pay.status]}">` : '';
|
|
|
- if ((pay.status === auditConst.status.uncheck || pay.status === auditConst.status.checkNo) && pay.uid === user_id) {
|
|
|
- shenpi_html += `<a href="javascript:void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" class="btn ${auditConst.statusButtonClass[pay.status]} btn-sm show-sub-sp">${auditConst.statusButton[pay.status]}</a>`;
|
|
|
- } else if ((pay.status === auditConst.status.checking || pay.status === auditConst.status.checkNoPre) && pay.curAuditors && pay.curAuditors.findIndex(x => { return x.aid === user_id; }) >= 0) {
|
|
|
- shenpi_html += `<a href="javascript: void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" data-operate="checked" data-title="审批通过" class="btn btn-success btn-sm mr-2 show-sp-list">审批通过</a>`;
|
|
|
- shenpi_html += `<a href="javascript: void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" data-operate="checkNo" data-title="审批退回" class="btn btn-warning btn-sm show-sp-list">审批退回</a>`;
|
|
|
- } else {
|
|
|
- if (pay.status === auditConst.status.checked && pay.final_auditor_str) {
|
|
|
- shenpi_html += `<a href="javascript:void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" class="show-sp-list">${pay.final_auditor_str}</a>`;
|
|
|
- } else if (pay.status === auditConst.status.checkNo && pay.curAuditors2 && pay.curAuditors2.length > 0) {
|
|
|
- if (pay.curAuditors2[0].audit_type === auditType.key.common) {
|
|
|
- shenpi_html += `<a href="javascript:void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" class="show-sp-list">${pay.curAuditors2[0].name}${pay.curAuditors2[0].role !== '' && pay.curAuditors2[0].role !== null ? '-' + pay.curAuditors2[0].role : ''}</a>`;
|
|
|
- } else {
|
|
|
- shenpi_html += `<a href="javascript:void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" class="show-sp-list">${transFormToChinese(pay.curAuditors2[0].audit_order) + '审'}</a>`;
|
|
|
- }
|
|
|
- } else if (pay.curAuditors.length > 0) {
|
|
|
- if (pay.curAuditors[0].audit_type === auditType.key.common) {
|
|
|
- shenpi_html += `<a href="javascript:void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" class="show-sp-list">${pay.curAuditors[0].name}${pay.curAuditors[0].role !== '' && pay.curAuditors[0].role !== null ? '-' + pay.curAuditors[0].role : ''}</a>`;
|
|
|
- } else {
|
|
|
- shenpi_html += `<a href="javascript:void(0);" node-cid="${pay.cid}" node-cpid="${pay.id}" class="show-sp-list">${transFormToChinese(pay.curAuditors[0].audit_order) + '审'}</a>`;
|
|
|
- }
|
|
|
- }
|
|
|
- shenpi_html += ` ${auditConst.auditProgress[pay.status]}`;
|
|
|
- }
|
|
|
- shenpi_html += !reload ? '</td>' : '';
|
|
|
- }
|
|
|
- return shenpi_html;
|
|
|
- }
|
|
|
-
|
|
|
let timer3 = null
|
|
|
let oldSearchVal3 = null
|
|
|
|