From 935b22c059cfe9ee5dec5e12e0fa2a77840bfe74 Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Thu, 29 May 2025 08:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E9=A2=86=E5=AF=BC=E5=AE=A1=E6=89=B9=EF=BC=8C?= =?UTF-8?q?=E9=99=A4=E9=A1=B9=E7=9B=AE=E9=83=A8=E5=A4=96=EF=BC=8C=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E4=BB=85=E5=B1=95=E7=A4=BA=E4=B8=80=E4=B8=AA=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E9=A9=B3=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../outsourceAudit/outsourceAuditForm.html | 109 +++++++++++++++++- 1 file changed, 105 insertions(+), 4 deletions(-) diff --git a/src/main/resources/static/pages/evaluate/outsourceAudit/outsourceAuditForm.html b/src/main/resources/static/pages/evaluate/outsourceAudit/outsourceAuditForm.html index 7a37793..9e0e5a5 100644 --- a/src/main/resources/static/pages/evaluate/outsourceAudit/outsourceAuditForm.html +++ b/src/main/resources/static/pages/evaluate/outsourceAudit/outsourceAuditForm.html @@ -11,6 +11,10 @@ +
+ + +
@@ -107,8 +111,8 @@ //如果d.isApprove == 1 去除当前行的编辑功能 let text = ""; console.log("======") - console.log("======",getUrlParam("type")) - console.log("======",d.isApprove) + console.log("======", getUrlParam("type")) + console.log("======", d.isApprove) if (getUrlParam("type") == '1') { if (d.isApprove == 0) { @@ -117,12 +121,12 @@ text += '驳回'; - }else if (d.isApprove == 1) { + } else if (d.isApprove == 1) { text += '已通过'; } else if (d.isApprove == 2) { text += '已驳回'; } - }else{ + } else { if (d.isApprove == 1) { text += '已通过'; } else if (d.isApprove == 2) { @@ -173,6 +177,34 @@ }); } + function allAudit(type) { + let title = type === 1 ? '全部通过' : '全部驳回'; + layer.confirm('确定' + title + '吗?', function (index) { + var tableId = 'baseTable'; + var allData = table.cache[tableId]; + console.log("allData", allData); + allData.forEach(function (rowData, index) { + // 构造一个类似单行操作时的 obj 对象 + var fakeObj = { + data: rowData, // 当前行数据 + index: index, // 行索引 + config: {id: tableId} // 表格ID(需和你的表格一致) + }; + // 调用 audit(),模拟单行操作 + if (type === 1) { + rowData.isApprove = 1; + auditlc(fakeObj, 1, rowData); + parent.layer.closeAll(); + } else if (type === 2) { + rowData.isApprove = 2; + auditlc(fakeObj, 2, rowData); + parent.layer.closeAll(); + } + + }); + }); + } + function audit(obj, type, data) { let title = type === 1 ? '通过' : '驳回'; if (type === 1) { @@ -245,6 +277,75 @@ } } + function auditlc(obj, type, data) { + if (type === 1) { + $.ajax({ + url: ctxPath + '/outsourcer/audit', + type: 'post', + async: false, + data: { + evaluateId: getUrlParam('id'), + id: data.id, + type: type, + detailsId: data.detailsId, + evaluateType: '1' + }, + success: function (res) { + if (res.res == '1') { + data.isApprove = 1; + obj.update(data); + layer.msg(title + '成功'); + } else { + data.isApprove = 0; + layer.msg(res.resMsg); + } + } + }); + } else { + let content = '
*' + title + + '原因:
'; + layer.open({ + type: 1, + title: title, + content: content, + async: false, + btn: ['确定', '取消'], + yes: function (index, layero) { + let rejectReason = $('#rejectReason').val(); + if (!rejectReason) { + layer.msg('请输入驳回原因'); + return; + } + $.ajax({ + url: ctxPath + '/outsourcer/audit', + type: 'post', + data: { + id: data.id, + evaluateId: data.evaluateId, + templateId: data.templateId, + detailsId: data.detailsId, + type: type, + rejectReason: rejectReason, + evaluateType: '1' + }, + success: function (res) { + layer.close(index); + if (res.res == '1') { + layer.msg(title + '成功'); + data.isApprove = 2; + obj.update(data); + } else { + code = 0; + data.isApprove = 0; + layer.msg(res.resMsg); + } + } + }); + } + }); + } + } + function getTitle(deptId) { $.ajax({ url: ctxPath + '/outsourcer/getAuditTitleData',