班主注册及产线问题修复

This commit is contained in:
liang.chao 2025-08-19 10:00:16 +08:00
parent 962a79e63d
commit b158ad6705
29 changed files with 651 additions and 364 deletions

View File

@ -69,4 +69,5 @@ public class OrganizationalBean {
private String orgType;
private Integer pParentId;
private Integer isCompletion;
}

View File

@ -84,4 +84,7 @@ public class OutSourceBean {
private String isAuditTask;
private String checkOne;
private Integer allCheckOne;
private Integer allCheckTwo;
private Integer allCheckThree;
}

View File

@ -23,5 +23,7 @@ public class ProjectBean {
private Integer personInChargeId;
// 所属事业部Id
private Integer departmentId;
// 项目是否完工 0 1是
private Integer isCompletion;
private String keyWord;
}

View File

@ -41,6 +41,21 @@ public class ProjectController {
return ar;
}
/**
* 项目完工
*/
@PostMapping("projectCompletion")
public AjaxRes projectCompletion(@RequestBody ProjectBean projectBean) {
AjaxRes ar = new AjaxRes();
Integer i = service.updateprojectCompletion(projectBean);
if (i > 0) {
ar.setSucceedMsg("成功");
} else {
ar.setFailMsg("失败");
}
return ar;
}
@PostMapping("updateName")
public AjaxRes updateName(@RequestBody ProjectBean projectBean) {
AjaxRes ar = new AjaxRes();

View File

@ -1,7 +1,5 @@
package com.bonus.gs.sub.evaluate.evaluate.controller;
import com.bonus.gs.sub.evaluate.evaluate.beans.OrganizationalBean;
import com.bonus.gs.sub.evaluate.evaluate.beans.ProjectBean;
import com.bonus.gs.sub.evaluate.evaluate.beans.TeamGroupBean;
import com.bonus.gs.sub.evaluate.evaluate.service.TeamGroupService;
import com.bonus.gs.sub.evaluate.manager.controller.BaseController;
@ -9,26 +7,14 @@ import com.bonus.gs.sub.evaluate.manager.utils.AesCbcUtils;
import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes;
import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst;
import com.bonus.gs.sub.evaluate.manager.utils.UserUtil;
import com.bonus.gs.sub.evaluate.outsourceEnterprise.beans.ImportUserDataVo;
import com.bonus.gs.sub.evaluate.outsourceEnterprise.beans.ViolationBean;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Authorliang.chao
@ -79,8 +65,9 @@ public class TeamGroupController extends BaseController<TeamGroupBean> {
}
return ar;
}
/**
* 各事业部审核人专责汇总审批
* 各事业部审核人专责汇总审批列表
*
* @param teamGroupBean
* @return
@ -97,6 +84,24 @@ public class TeamGroupController extends BaseController<TeamGroupBean> {
return ar;
}
/**
* 各事业部审核人专责汇总审批
* 0草稿 1事业部负责人审核中 2专责审核中 3汇总审核中 4已通过 5已驳回
* @param teamGroupBean
* @return
*/
@PostMapping("auditRegister")
public AjaxRes auditRegister(@RequestBody TeamGroupBean teamGroupBean) {
AjaxRes ar = new AjaxRes();
Integer i = teamGroupService.auditRegister(teamGroupBean);
if (i > 0) {
ar.setSucceedMsg("审核成功");
} else {
ar.setFailMsg("审核失败");
}
return ar;
}
@PostMapping("delTeamGroup")
public AjaxRes delTeamGroup(@RequestBody TeamGroupBean teamGroupBean) {
AjaxRes ar = new AjaxRes();

View File

@ -35,4 +35,6 @@ public interface ProjectDao {
Integer getTeamGroup(ProjectBean bean);
int getProIsExistByDepartmentId(OrganizationalBean bean);
Integer updateprojectCompletion(ProjectBean projectBean);
}

View File

@ -64,4 +64,6 @@ public interface TeamGroupDao {
TeamGroupBean getTeamLeader(TeamGroupBean groupBean);
String getDepartmentName(String applyMan);
Integer auditRegister(TeamGroupBean teamGroupBean);
}

View File

@ -139,6 +139,8 @@ public class OrganizationalServiceImpl implements OrganizationalService {
return ar;
}
} else if (bean.getLevel() == 3) {
// 默认未完工
bean.setIsCompletion(0);
int count = projectDao.getProIsExistByDepartmentId(bean);
if (count > 0) {
ar.setFailMsg("该项目在此事业部下已存在");

View File

@ -290,9 +290,9 @@ public class OutsourcerEvaluateServiceImpl implements OutsourcerEvaluateService
childMap.put("title", deptName);
childMap.put("mergeType", "colspan");
childMap.put("num", num);
if (!StringUtils.isBlank(type) && "evaluate".equals(type)) {
childMap.put("edit", "text");
}
// if (!StringUtils.isBlank(type) && "evaluate".equals(type)) {
// childMap.put("edit", "text");
// }
childMap.put("field", setTemplateBean.getParentId() + "-" + setTemplateBean.getId() + "-" + deptId);
list.add(childMap);
}

View File

@ -25,4 +25,6 @@ public interface ProjectService {
Integer delProjectSubcontractor(ViolationBean bean);
List<OrganizationalBean> getNoBindSubcontractorSelect(ViolationBean bean);
Integer updateprojectCompletion(ProjectBean projectBean);
}

View File

@ -66,4 +66,9 @@ public class ProjectServiceImpl implements ProjectService {
public List<OrganizationalBean> getNoBindSubcontractorSelect(ViolationBean bean) {
return projectDao.getNoBindSubcontractorSelect(bean);
}
@Override
public Integer updateprojectCompletion(ProjectBean projectBean) {
return projectDao.updateprojectCompletion(projectBean);
}
}

View File

@ -33,4 +33,6 @@ public interface TeamGroupService {
List<TeamGroupBean> getRegisterList(TeamGroupBean teamGroupBean);
List<TeamGroupBean> auditRegisterList(TeamGroupBean teamGroupBean);
Integer auditRegister(TeamGroupBean teamGroupBean);
}

View File

@ -280,6 +280,11 @@ public class TeamGroupServiceImpl implements TeamGroupService {
return getTeamLeaderInfo(registerList);
}
@Override
public Integer auditRegister(TeamGroupBean teamGroupBean) {
return teamGroupDao.auditRegister(teamGroupBean);
}
private List<TeamGroupBean> getTeamLeaderInfo(List<TeamGroupBean> list) {
for (TeamGroupBean groupBean : list) {
TeamGroupBean teamLeader = teamGroupDao.getTeamLeader(groupBean);

View File

@ -15,6 +15,7 @@
<if test="orgType != null">org_type,</if>
<if test="lkId != null">lk_id,</if>
<if test="tableSource != null">table_source,</if>
<if test="isCompletion != null">is_completion,</if>
status
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -29,6 +30,7 @@
<if test="orgType != null">#{orgType},</if>
<if test="lkId != null">#{lkId},</if>
<if test="tableSource != null">#{tableSource},</if>
<if test="isCompletion != null">#{isCompletion},</if>
1
</trim>
</insert>

View File

@ -383,6 +383,9 @@
per.create_time AS createTime,
r.proNum AS projectNum,
r.subNum AS outsourcerNum,
c.allCheckOne,
c.allCheckTwo,
c.allCheckThree,
ifnull( GROUP_CONCAT( ped.post_id ), '' ) AS deptId,
IF(ped.check_one is null, 0,IF( ped.check_one > 0, '0', '1' )) as isApprove,
ped.isReject as isReject,
@ -431,6 +434,9 @@
SELECT
evaluate_id AS evaluateId,
COUNT( id ) AS evaluateNum,
MIN(CASE WHEN check_one = 0 THEN 0 ELSE 1 END) AS allCheckOne,
MIN(CASE WHEN check_two = 0 THEN 0 ELSE 1 END) AS allCheckTwo,
MIN(CASE WHEN check_three = 0 THEN 0 ELSE 1 END) AS allCheckThree,
GROUP_CONCAT(DISTINCT IF(reject_one is null or reject_one = '',null,reject_one)) as rejectReason,
GROUP_CONCAT(DISTINCT IF(reject_two is null or reject_two = '',null,reject_two)) as rejectReasonTwo
FROM

View File

@ -8,6 +8,7 @@
level,
status,
table_source,
is_completion,
user_id,
user_name)
VALUES(
@ -15,7 +16,8 @@
#{parentId},
3,
1,
'pm_dept'
'pm_dept',
0,
#{userId},
#{userName}
)
@ -27,6 +29,13 @@
WHERE
id = #{id}
</update>
<update id="updateprojectCompletion">
UPDATE pm_org_info
SET
is_completion = 1
WHERE
id = #{id}
</update>
<delete id="delProject">
DELETE FROM pm_org_info
WHERE
@ -42,6 +51,7 @@
SELECT
poi1.id,
poi1.name as projectName,
poi1.is_completion as isCompletion,
poi2.id as departmentId,
poi2.name as department,
su.username as projectManager

View File

@ -37,6 +37,9 @@
update team_person set name = #{name},id_card = #{idCard},phone = #{phone},sex = #{sex},work_type = #{workType},face_url = #{faceUrl}
where id = #{id}
</update>
<update id="auditRegister">
update pm_org_info set audit_status = #{auditStatus} where id = #{id}
</update>
<delete id="delTeamGroup">
delete from pm_org_info where id = #{id}
</delete>

View File

@ -114,15 +114,19 @@
where is_active = 1 and is_enable = 0
</select>
<select id="getOrgTree" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.NodeBean">
SELECT id,
name as title,
name,
level,
parent_id AS parentId,
IFNULL(org_type, '1') as org_type
FROM pm_org_info
where level &lt; 4
having org_type != 2
SELECT
id,
name AS title,
name,
level,
parent_id AS parentId,
IFNULL(org_type, '1') AS org_type
FROM
pm_org_info
WHERE
level &lt; 4
AND (org_type != 2 OR org_type IS NULL)
AND NOT (level = 3 AND is_completion = 1)
</select>
<select id="getSubListByOrgId" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.InitiateEvaluateBean">
SELECT

View File

@ -9,7 +9,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<title>甘肃分包评价</title>
<title>分包评价</title>
<link rel="stylesheet" href="layui/css/layui.css" media="all" />
<link rel="stylesheet" href="css/global.css" media="all" />
<link rel="stylesheet" href="css/font-awesome/css/font-awesome.css" media="all" />
@ -36,7 +36,7 @@
<div class="layui-main">
<div class="admin-login-box">
<a class="logo" style="left: 0;" href="/">
<span style="font-size: 22px;color: black;font-weight: bold">甘肃分包评价</span>
<span style="font-size: 22px;color: black;font-weight: bold">分包评价</span>
</a>
<div class="admin-side-toggle">
<i class="fa fa-bars" aria-hidden="true"></i>

View File

@ -1,11 +1,12 @@
// 专责审批 js文件
let layer, laydate, table, form;
let layer, laydate, table, form, loginUser;
$(function () {
layui.use(["layer", "laydate", "table", "form"], function () {
layer = layui.layer;
laydate = layui.laydate;
form = layui.form;
table = layui.table;
loginUser = JSON.parse(localStorage.getItem("loginUser"));
laydate.render({
elem: "#startDate",
type: "month",
@ -124,6 +125,12 @@ function initTable() {
'<a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 15px"' +
' id="edit">编辑</a>';
if ((loginUser.roleId == '6' || loginUser.roleId == '1') && d.isCompletion == 0) {
text +=
'<a lay-event="completion" style="color: #009688;cursor: pointer;font-size:' +
' 15px;margin-left: 10px"' +
' id="completion">完工</a>';
}
// if (d.noAppearingTeamGroupNum === 0) {
// text +=
// '<a lay-event="del" style="color: #009688;cursor: pointer;font-size:' +
@ -177,6 +184,9 @@ function initTable() {
case "del":
DelReviews(data, "删除");
break;
case "completion":
CompletionReviews(data, "完工");
break;
default:
console.warn(`未知事件: ${layEvent}`);
}
@ -265,6 +275,61 @@ function initTable() {
layer.msg("发生异常,请查看控制台", {icon: 2});
}
}
//项目确认完工
function CompletionReviews(data, title) {
try {
layer.confirm('是否确认完工?', {
title: title || '提示',
icon: 3,
shade: 0.3,
btn: ['确定', '取消']
}, function (index) {
// 禁用按钮防止重复提交
$(".save").addClass("layui-btn-disabled").attr("disabled", true);
$(".cancel").addClass("layui-btn-disabled").attr("disabled", true);
let item = {
id: data.id
};
$.ajax({
url: `${ctxPath}/project/projectCompletion`,
type: "POST",
data: JSON.stringify(item),
dataType: "json",
contentType: "application/json",
success: function (res) {
$(".save").removeClass("layui-btn-disabled").attr("disabled", false);
$(".cancel").removeClass("layui-btn-disabled").attr("disabled", false);
if (res.res === 1) {
layer.msg("成功", {icon: 1});
search(1); // 刷新列表
} else {
layer.msg("失败:" + (res.resMsg || "未知错误"), {icon: 2});
}
layer.close(index); // 关闭弹窗
},
error: function () {
layer.close(loadingMsg);
$(".save").removeClass("layui-btn-disabled").attr("disabled", false);
$(".cancel").removeClass("layui-btn-disabled").attr("disabled", false);
layer.msg("服务异常,请稍后重试", {
icon: 2,
time: 2000
});
}
});
}, function (index) {
// 取消操作
layer.close(index);
});
} catch (error) {
console.error("CompletionReviews 错误:", error);
layer.msg("发生异常,请查看控制台", {icon: 2});
}
}
}
function addProject() {
@ -301,4 +366,4 @@ function openTeamMemberPage(data) {
} catch (error) {
console.error("openTeamMemberPage 错误:", error);
}
}
}

View File

@ -169,4 +169,4 @@ function download(url, filename) {
getBlob(url).then(blob => {
saveAs(blob, filename);
});
}
}

View File

@ -11,7 +11,7 @@
<body>
<div class="login">
<div class="message">甘肃分包评价</div>
<div class="message">分包评价</div>
<div id="darkbannerwrap"></div>
<form id="login-form" method="post" onsubmit="return false;">

View File

@ -491,4 +491,4 @@
parent.layer.close(index); // 再执行关闭
}
</script>
</script>

View File

@ -103,6 +103,7 @@
});
});
function search(type) {
if (type === 1) {
} else {
@ -176,10 +177,15 @@
}
, {
field: 'auditStatus', align: 'center', title: '审核状态', templet: function (d) {
if (d.rejectReason) {
return '已驳回'
/* if (d.rejectReason) {
return '已驳回'
} else {
return Number(d.isApprove) > 0 && d.rejectReason ? '已驳回' : (Number(d.isApprove) === 1 ? '已通过' : (Number(d.evaluateNum) > 0 && d.isApprove == 0 ? '待审批' : '待评价'))
}*/
if (d.allCheckOne == 0) {
return '待审批'
} else {
return Number(d.isApprove) > 0 && d.rejectReason ? '已驳回' : (Number(d.isApprove) === 1 ? '已通过' : (Number(d.evaluateNum) > 0 && d.isApprove == 0 ? '待审批' : '待评价'))
return '已审批'
}
}
}
@ -187,18 +193,18 @@
, {
fixed: 'right', width: 180, title: '操作', align: 'center', templet: d => {
let text = "";
if (Number(d.isAuditTask) > 0) {
if (d.allCheckOne === 0) {
text += '<a lay-event="audit" style="color: #009688;cursor: pointer;font-size: 15px"' +
' id="audit">审核</a>';
}
}
if (Number(d.evaluateNum) > 0 && d.rejectReason) {
text +=
'<a lay-event="view" style="color: #009688;cursor: pointer;font-size: 15px;margin-left: 10px"' +
' id="view">查看</a>';
return text;
}
if (Number(d.isAuditTask) > 0) {
if (Number(d.isApprove === '0')) {
text += '<a lay-event="audit" style="color: #009688;cursor: pointer;font-size: 15px"' +
' id="audit">审核</a>';
}
}
text +=
'<a lay-event="view" style="color: #009688;cursor: pointer;font-size: 15px;margin-left: 10px"' +
' id="view">查看</a>';
@ -284,4 +290,4 @@
layer.open(layerOptions);
}
}
</script>
</script>

View File

@ -397,7 +397,6 @@
}
});
function getTitle() {
let path = getUrlParam("type") == '0' ? '/outsourcer/getTableTitle' : '/outsourcer/getAuditTitleData';
$.ajax({
@ -454,4 +453,4 @@
parent.search(1)
parent.layer.close(index); // 再执行关闭
}
</script>
</script>

View File

@ -5,278 +5,255 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Demo</title>
<link rel="stylesheet" href="../../../layui/css/layui.css" />
<link rel="stylesheet" href="../../../layui/css/layui.css"/>
</head>
<body>
<div class="layui-inline" style="margin-top: 10px;display: flex;justify-content: flex-end; margin-right: 10px;"
id="btnGroup">
<button class="layui-btn layui-btn-sm" onclick="allAudit(1)">通过</button>
<button class="layui-btn layui-btn-sm" onclick="allAudit(2)">驳回</button>
<div class="layui-inline" style="margin-top: 10px;display: flex;justify-content: flex-end; margin-right: 10px;"
id="btnGroup">
<button class="layui-btn layui-btn-sm" onclick="allAudit(1)">通过</button>
<button class="layui-btn layui-btn-sm" onclick="allAudit(2)">驳回</button>
</div>
<div id="txtTip" style="margin-top: 10px;display: flex;justify-content: flex-end;width: 99%;">
注:如无审核按钮,则表示当前评价停留在一级审核处
</div>
<form class="layui-form layui-form-pane fromData" action="">
<div style="width: 100%;overflow:auto">
<table class="layui-table" id="baseTable" lay-filter="test">
</table>
</div>
<div id="txtTip" style="margin-top: 10px;display: flex;justify-content: flex-end;width: 99%;">
注:如无审核按钮,则表示当前评价停留在一级审核处</div>
<form class="layui-form layui-form-pane fromData" action="">
<div style="width: 100%;overflow:auto">
<table class="layui-table" id="baseTable" lay-filter="test">
</table>
<div class="layui-form-item" style="display: none">
<div class="layui-input-block">
<button type="submit" class="layui-btn subBtn" id="commit" lay-submit lay-filter="formDemo">提交
</button>
</div>
<div class="layui-form-item" style="display: none">
<div class="layui-input-block">
<button type="submit" class="layui-btn subBtn" id="commit" lay-submit lay-filter="formDemo">提交
</button>
</div>
</div>
</form>
<script src="../../../js/publicJs.js"></script>
<script src="../../../js/common_methon.js"></script>
<script src="../../../js/common.js"></script>
<script type="text/javascript" src="../../../js/libs/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../../../js/jq.js"></script>
<script type="text/javascript" src="../../../js/my/permission.js"></script>
<script src="../../../layui/layui.js"></script>
<script>
let headerRows;
let layer, laydate, table, form;
let tableLoading;
$(function () {
layui.use(['layer', 'laydate', 'table', 'form'], function () {
layer = layui.layer;
laydate = layui.laydate;
table = layui.table;
form = layui.form;
tableLoading = layer.load(2, { shade: [0.1, '#fff'] });
let deptId = getUrlParam('deptId');
isCheckOneIsAudit(deptId);
</div>
</form>
<script src="../../../js/publicJs.js"></script>
<script src="../../../js/common_methon.js"></script>
<script src="../../../js/common.js"></script>
<script type="text/javascript" src="../../../js/libs/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../../../js/jq.js"></script>
<script type="text/javascript" src="../../../js/my/permission.js"></script>
<script src="../../../layui/layui.js"></script>
<script>
let headerRows;
let layer, laydate, table, form;
let tableLoading;
let tableRowList = []
$(function () {
layui.use(['layer', 'laydate', 'table', 'form'], function () {
layer = layui.layer;
laydate = layui.laydate;
table = layui.table;
form = layui.form;
tableLoading = layer.load(2, {shade: [0.1, '#fff']});
let deptId = getUrlParam('deptId');
isCheckOneIsAudit(deptId);
initTable(deptId);
form.on('submit(formDemo)', function (data) {
getTableData();
return false;
});
initTable(deptId);
form.on('submit(formDemo)', function (data) {
getTableData();
return false;
});
});
});
function isCheckOneIsAudit(deptId) {
$.ajax({
url: ctxPath + '/outsourcer/isCheckOneIsAudit',
type: 'get',
data: {
templateId: getUrlParam('templateId'),
evaluateId: getUrlParam('evaluateId'),
deptId: deptId,
evaluateType: '2',
type: 'auditAll',
},
success: function (res) {
if (res.res == '1') {
$("#btnGroup").show();
$("#txtTip").hide();
} else {
$("#btnGroup").hide();
}
if (getUrlParam("type") == '1') {
$("#btnGroup").hide();
$("#txtTip").hide();
}
}
})
}
function initTable(deptId) {
getTitle(deptId);
}
function setCols(data, msg) {
//重新加载表格 清空之前的表头和内容
table.reload('baseTable', {
cols: []
});
headerRows = [];
headerRows = JSON.parse(data);
// Clear existing headers
const thead = document.querySelector('#baseTable thead');
if (thead) {
thead.innerHTML = '';
} else {
const newThead = document.createElement('thead');
document.querySelector('#baseTable').appendChild(newThead);
}
//动态生成表头
headerRows.forEach(rowData => {
rowData.forEach(cellData => {
cellData.align = 'center';
if (cellData.title === '序号') {
cellData.type = 'numbers';
}
if (!['审核', '序号', '施工业务外包商', '工程名称', '评价人', '审批'].includes(cellData.title)) {
if (cellData.field.split('-').length === 1) {
cellData.title =
`${cellData.title}<i class="layui-icon layui-icon-tips layui-font-14" lay-event="checkTips"
title="计算方法" style="margin-left: 5px;"></i>`;
}
}
if (cellData.mergeType === "colspan") {
cellData.colspan = cellData.num;
} else if (cellData.mergeType === "rowspan") {
cellData.rowspan = cellData.num;
}
//去除审核
if (cellData.field === 'examineAndApprove') {
cellData.hide = true;
}
});
});
table.render({
elem: '#baseTable',
cols: headerRows,
data: JSON.parse(msg), // 使用从 API 获取的数据
//data: msg, // 使用从 API 获取的数据
loading: true,
done: function (res) {
var columsName = ['subName'];//需要合并的列名称 ['business_tenant_name','land','contract_begin','contract_end','history_arrears','period'];
var columsIndex = [1];//需要合并的列索引值 [2,3,5,6,14,15];
// res.data.sort(function (a, b) {
// return a.subName.localeCompare(b.subName);
// });
merge(res, columsName, columsIndex);
tableLoading && layer.close(tableLoading);
}
});
table.on('tool(test)', function (obj) {
var data = obj.data; //当前行数据
var rowIndex = obj.index;
var layEvent = obj.event; //当前点击的事件名
if (layEvent === 'pass') {
data.isApprove = 1;
audit(obj, 1, data);
}
if (layEvent === 'reject') {
data.isApprove = 2;
audit(obj, 2, data);
}
});
// 表头自定义元素工具事件 --- 2.8.8+
table.on('colTool(test)', function (obj) {
var event = obj.event;
if (event === 'checkTips') {
let text = `<span><span style="color: red">*</span>指标定义及计算方法:</span> ${obj.col.method}`;
text += `<br/><span><span style="color: red">*</span>积分标准:</span> ${obj.col.standard}`;
layer.alert(text, {
title: `${obj.col.title}`,
});
}
});
}
function allAudit(type) {
let title = type === 1 ? '全部通过' : '全部驳回';
layer.confirm('确定' + title + '吗?', function (index) {
if (type === 1) {
$.ajax({
url: ctxPath + '/outsourcer/dedicatedAllAudit',
type: 'post',
async: false,
data: {
templateId: getUrlParam('templateId'),
evaluateId: getUrlParam('evaluateId'),
type: type,
evaluateType: '2',
deptId: getUrlParam('deptId'),
isApprove: type
},
success: function (res) {
if (res.res == '1') {
parent.layer.closeAll();
parent.layer.msg(res.resMsg);
parent.getAuditBtn()
} else {
layer.msg(res.resMsg);
}
}
});
function isCheckOneIsAudit(deptId) {
$.ajax({
url: ctxPath + '/outsourcer/isCheckOneIsAudit',
type: 'get',
data: {
templateId: getUrlParam('templateId'),
evaluateId: getUrlParam('evaluateId'),
deptId: deptId,
evaluateType: '2',
type: 'auditAll',
},
success: function (res) {
if (res.res == '1') {
$("#btnGroup").show();
$("#txtTip").hide();
} else {
let content = '<div style="padding: 20px 100px;"><span style="color: red">*</span>' + title +
'原因:<input type="text" id="rejectReason" autocomplete="off" lay-verify="required" class="layui-input" style="width: 300px;height: 100px"></div>';
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/dedicatedAllAudit',
type: 'post',
async: false,
data: {
templateId: getUrlParam('templateId'),
evaluateId: getUrlParam('evaluateId'),
type: type,
evaluateType: '2',
deptId: getUrlParam('deptId'),
isApprove: type,
rejectReason: rejectReason,
},
success: function (res) {
if (res.res == '1') {
parent.layer.closeAll();
parent.layer.msg(res.resMsg);
parent.getAuditBtn()
} else {
layer.msg(res.resMsg);
}
}
});
}
});
$("#btnGroup").hide();
}
if (getUrlParam("type") == '1') {
$("#btnGroup").hide();
$("#txtTip").hide();
}
}
})
}
});
function initTable(deptId) {
getTitle(deptId);
}
function setCols(data, msg) {
const tableList = JSON.parse(msg)
let tableListNew = []
tableList.forEach(item => {
let keyList = []
for (let key in item) {
if (key.indexOf('-') > 0 && key.split('-').length - 1 >= 2 && !key.includes('file')) {
keyList.push(item[key])
}
}
const isAllNull = keyList.every(item => {
return (item !== '')
})
tableListNew.push({
...item,
isAllNull: !isAllNull
})
})
tableRowList = tableListNew
//重新加载表格 清空之前的表头和内容
table.reload('baseTable', {
cols: []
});
headerRows = [];
headerRows = JSON.parse(data);
// Clear existing headers
const thead = document.querySelector('#baseTable thead');
if (thead) {
thead.innerHTML = '';
} else {
const newThead = document.createElement('thead');
document.querySelector('#baseTable').appendChild(newThead);
}
//动态生成表头
headerRows.forEach(rowData => {
rowData.forEach(cellData => {
cellData.align = 'center';
if (cellData.title === '序号') {
cellData.type = 'numbers';
}
if (!['审核', '序号', '施工业务外包商', '工程名称', '评价人', '审批'].includes(cellData.title)) {
if (cellData.field.split('-').length === 1) {
cellData.title =
`${cellData.title}<i class="layui-icon layui-icon-tips layui-font-14" lay-event="checkTips"
title="计算方法" style="margin-left: 5px;"></i>`;
}
}
if (cellData.mergeType === "colspan") {
cellData.colspan = cellData.num;
} else if (cellData.mergeType === "rowspan") {
cellData.rowspan = cellData.num;
}
//去除审核
if (cellData.field === 'examineAndApprove') {
cellData.hide = true;
}
});
});
table.render({
elem: '#baseTable',
cols: headerRows,
data: JSON.parse(msg), // 使用从 API 获取的数据
//data: msg, // 使用从 API 获取的数据
loading: true,
done: function (res) {
var columsName = ['subName'];//需要合并的列名称 ['business_tenant_name','land','contract_begin','contract_end','history_arrears','period'];
var columsIndex = [1];//需要合并的列索引值 [2,3,5,6,14,15];
// res.data.sort(function (a, b) {
// return a.subName.localeCompare(b.subName);
// });
merge(res, columsName, columsIndex);
tableLoading && layer.close(tableLoading);
var tableView = this.elem.next();
function audit(status) {
let title = status === 1 ? '通过' : '驳回';
if (status === 1) {
layer.confirm('确定' + title + '吗?', function (index) {
$.ajax({
url: ctxPath + '/outsourcer/dedicatedAudit',
type: 'post',
async: false,
data: {
templateId: "5",
evaluateId: "41",
status: status,
},
success: function (res) {
if (res.res == '1') {
data.isApprove = 1;
obj.update(data);
layer.msg(title + '成功');
} else {
data.isApprove = 0;
layer.msg(res.resMsg);
layui.each(res.data, function (i, item1) {
var cols = tableView.find('tr[data-index=' + i + ']').find('td');
cols.each(function (index, item) {
if (index > 2 && index != cols.length - 1) {
let dataId = $(this).data('field')
if (item1[`${dataId}-file`] && item1[`${dataId}-file`]['fileName'] != '') {
$(this).find('.layui-table-cell').append(`<i class="layui-icon layui-icon-file-b file-icon" data-index="${i}" data-id="${dataId}" style="margin-left:6px;cursor:pointer"></i> `)
}
}
});
})
})
}
});
table.on('tool(test)', function (obj) {
var data = obj.data; //当前行数据
var rowIndex = obj.index;
var layEvent = obj.event; //当前点击的事件名
if (layEvent === 'pass') {
data.isApprove = 1;
audit(obj, 1, data);
}
if (layEvent === 'reject') {
data.isApprove = 2;
audit(obj, 2, data);
}
});
// 表头自定义元素工具事件 --- 2.8.8+
table.on('colTool(test)', function (obj) {
var event = obj.event;
if (event === 'checkTips') {
let text = `<span><span style="color: red">*</span>指标定义及计算方法:</span> ${obj.col.method}`;
text += `<br/><span><span style="color: red">*</span>积分标准:</span> ${obj.col.standard}`;
layer.alert(text, {
title: `${obj.col.title}`,
});
}
});
}
$(document).on('click', '.layui-table-cell', function (e) {
console.log('点击了单元格')
// 判断是否有文件图标
if ($(this).find('.file-icon').length > 0) {
var dataId = $(this).find('.file-icon').data('id');
var dataIndex = $(this).find('.file-icon').data('index');
console.log('File icon clicked', {
dataIndex: dataIndex,
dataId: dataId,
rowData: tableRowList[dataIndex]
});
window.open(ctxPath + "/statics/" + tableRowList[dataIndex][`${dataId}-file`].filePath.split('/upload/')[1])
}
});
function allAudit(type) {
let title = type === 1 ? '全部通过' : '全部驳回';
layer.confirm('确定' + title + '吗?', function (index) {
if (type === 1) {
$.ajax({
url: ctxPath + '/outsourcer/dedicatedAllAudit',
type: 'post',
async: false,
data: {
templateId: getUrlParam('templateId'),
evaluateId: getUrlParam('evaluateId'),
type: type,
evaluateType: '2',
deptId: getUrlParam('deptId'),
isApprove: type
},
success: function (res) {
if (res.res == '1') {
parent.layer.closeAll();
parent.layer.msg(res.resMsg);
parent.getAuditBtn()
} else {
layer.msg(res.resMsg);
}
}
});
} else {
let content = '<div style="padding: 20px 100px;"><span style="color: red">*</span>' + title +
'原因:<input type="text" id="rejectReason" autocomplete="off" lay-verify="required" class="layui-input" style="width: 300px;height: 100px"></div>';
layer.open({
@ -292,23 +269,25 @@
return;
}
$.ajax({
url: ctxPath + '/outsourcer/dedicatedAudit',
url: ctxPath + '/outsourcer/dedicatedAllAudit',
type: 'post',
async: false,
data: {
templateId: "5",
evaluateId: "41",
status: status,
rejectReason: rejectReason
templateId: getUrlParam('templateId'),
evaluateId: getUrlParam('evaluateId'),
type: type,
evaluateType: '2',
deptId: getUrlParam('deptId'),
isApprove: type,
rejectReason: rejectReason,
},
success: function (res) {
layer.close(index);
if (res.res == '1') {
layer.msg(title + '成功');
data.isApprove = 2;
obj.update(data);
parent.layer.closeAll();
parent.layer.msg(res.resMsg);
parent.getAuditBtn()
} else {
code = 0;
data.isApprove = 0;
layer.msg(res.resMsg);
}
}
@ -316,62 +295,133 @@
}
});
}
}
function getTitle(deptId) {
$.ajax({
url: ctxPath + '/outsourcer/getAuditTitleData',
type: 'get',
data: {
templateId: getUrlParam('templateId'),
evaluateId: getUrlParam('evaluateId'),
type: 'auditAll',
deptId: deptId,
evaluateType: '2'
},
success: function (res) {
setCols(res.obj, res.resMsg);
});
}
function audit(status) {
let title = status === 1 ? '通过' : '驳回';
if (status === 1) {
layer.confirm('确定' + title + '吗?', function (index) {
$.ajax({
url: ctxPath + '/outsourcer/dedicatedAudit',
type: 'post',
async: false,
data: {
templateId: "5",
evaluateId: "41",
status: status,
},
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 = '<div style="padding: 20px 100px;"><span style="color: red">*</span>' + title +
'原因:<input type="text" id="rejectReason" autocomplete="off" lay-verify="required" class="layui-input" style="width: 300px;height: 100px"></div>';
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/dedicatedAudit',
type: 'post',
data: {
templateId: "5",
evaluateId: "41",
status: status,
rejectReason: rejectReason
},
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 getTableData() {
//获取表格填写的数据
var tableData = table.cache.baseTable;
let filed = [];
//定义一个map
let obj = tableData[0];
for (let key in obj) {
if (key.indexOf('LAY') === -1 && !['subName', 'proName', 'subId', 'proId'].includes(key)) {
filed.push(key);
}
}
//TODO 校验数据
let data = {
function getTitle(deptId) {
$.ajax({
url: ctxPath + '/outsourcer/getAuditTitleData',
type: 'get',
data: {
templateId: getUrlParam('templateId'),
evaluateId: getUrlParam('evaluateId'),
jsonData: JSON.stringify(tableData),
titleFiled: filed.join(',')
};
$.ajax({
url: ctxPath + '/outsourcer/saveEvaluateData',
type: 'post',
data: data,
success: function (res) {
if (res.res == '1') {
layer.msg('保存成功');
closePage();
} else {
layer.msg(res.resMsg);
}
}
})
}
type: 'auditAll',
deptId: deptId,
evaluateType: '2'
},
success: function (res) {
setCols(res.obj, res.resMsg);
}
function closePage() {
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
parent.search(1)
parent.layer.close(index); // 再执行关闭
})
}
function getTableData() {
//获取表格填写的数据
var tableData = table.cache.baseTable;
let filed = [];
//定义一个map
let obj = tableData[0];
for (let key in obj) {
if (key.indexOf('LAY') === -1 && !['subName', 'proName', 'subId', 'proId'].includes(key)) {
filed.push(key);
}
}
</script>
//TODO 校验数据
let data = {
templateId: getUrlParam('templateId'),
evaluateId: getUrlParam('evaluateId'),
jsonData: JSON.stringify(tableData),
titleFiled: filed.join(',')
};
$.ajax({
url: ctxPath + '/outsourcer/saveEvaluateData',
type: 'post',
data: data,
success: function (res) {
if (res.res == '1') {
layer.msg('保存成功');
closePage();
} else {
layer.msg(res.resMsg);
}
}
})
}
function closePage() {
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
parent.search(1)
parent.layer.close(index); // 再执行关闭
}
</script>

View File

@ -40,6 +40,7 @@
let headerRows;
let layer, laydate, table, form;
let tableLoading;
let tableRowList = []
$(function () {
layui.use(['layer', 'laydate', 'table', 'form'], function () {
layer = layui.layer;
@ -86,6 +87,26 @@
}
function setCols(data, msg) {
const tableList = JSON.parse(msg)
let tableListNew = []
tableList.forEach(item => {
let keyList = []
for (let key in item) {
if (key.indexOf('-') > 0 && key.split('-').length - 1 >= 2 && !key.includes('file') ) {
keyList.push(item[key])
}
}
const isAllNull = keyList.every(item => {
return (item !== '')
})
tableListNew.push({
...item,
isAllNull: !isAllNull
})
})
tableRowList = tableListNew
//重新加载表格 清空之前的表头和内容
table.reload('baseTable', {
cols: []
@ -193,6 +214,19 @@
// });
merge(res, columsName, columsIndex);
tableLoading && layer.close(tableLoading);
var tableView = this.elem.next();
layui.each(res.data, function (i, item1) {
var cols = tableView.find('tr[data-index=' + i + ']').find('td');
cols.each(function (index, item) {
if (index > 2 && index != cols.length - 1) {
let dataId = $(this).data('field')
if (item1[`${dataId}-file`] && item1[`${dataId}-file`]['fileName'] != '') {
$(this).find('.layui-table-cell').append(`<i class="layui-icon layui-icon-file-b file-icon" data-index="${i}" data-id="${dataId}" style="margin-left:6px;cursor:pointer"></i> `)
}
}
})
})
}
});
table.on('tool(test)', function (obj) {
@ -220,7 +254,21 @@
}
});
}
$(document).on('click', '.layui-table-cell', function (e) {
console.log('点击了单元格')
// 判断是否有文件图标
if ($(this).find('.file-icon').length > 0) {
var dataId = $(this).find('.file-icon').data('id');
var dataIndex = $(this).find('.file-icon').data('index');
console.log('File icon clicked', {
dataIndex: dataIndex,
dataId: dataId,
rowData: tableRowList[dataIndex]
});
window.open(ctxPath + "/statics/" + tableRowList[dataIndex][`${dataId}-file`].filePath.split('/upload/')[1])
}
});
function allAudit(type) {
if (noMessage > 0) {
layer.msg("当前页面评价驳回数据或者一级审核未通过数据,无法进行全部通过或者全部驳回操作 ")
@ -433,4 +481,4 @@
parent.search(1)
parent.layer.close(index); // 再执行关闭
}
</script>
</script>

View File

@ -40,6 +40,7 @@
let headerRows;
let layer, laydate, table, form;
let tableLoading;
let tableRowList = []
$(function () {
layui.use(['layer', 'laydate', 'table', 'form'], function () {
layer = layui.layer;
@ -107,6 +108,26 @@
}
function setCols(data, msg) {
const tableList = JSON.parse(msg)
let tableListNew = []
tableList.forEach(item => {
let keyList = []
for (let key in item) {
if (key.indexOf('-') > 0 && key.split('-').length - 1 >= 2 && !key.includes('file') ) {
keyList.push(item[key])
}
}
const isAllNull = keyList.every(item => {
return (item !== '')
})
tableListNew.push({
...item,
isAllNull: !isAllNull
})
})
tableRowList = tableListNew
//重新加载表格 清空之前的表头和内容
table.reload('baseTable', {
cols: []
@ -216,6 +237,19 @@
// });
merge(res, columsName, columsIndex);
tableLoading && layer.close(tableLoading);
var tableView = this.elem.next();
layui.each(res.data, function (i, item1) {
var cols = tableView.find('tr[data-index=' + i + ']').find('td');
cols.each(function (index, item) {
if (index > 2 && index != cols.length - 1) {
let dataId = $(this).data('field')
if (item1[`${dataId}-file`] && item1[`${dataId}-file`]['fileName'] != '') {
$(this).find('.layui-table-cell').append(`<i class="layui-icon layui-icon-file-b file-icon" data-index="${i}" data-id="${dataId}" style="margin-left:6px;cursor:pointer"></i> `)
}
}
})
})
}
});
table.on('tool(test)', function (obj) {
@ -243,7 +277,21 @@
}
});
}
$(document).on('click', '.layui-table-cell', function (e) {
console.log('点击了单元格')
// 判断是否有文件图标
if ($(this).find('.file-icon').length > 0) {
var dataId = $(this).find('.file-icon').data('id');
var dataIndex = $(this).find('.file-icon').data('index');
console.log('File icon clicked', {
dataIndex: dataIndex,
dataId: dataId,
rowData: tableRowList[dataIndex]
});
window.open(ctxPath + "/statics/" + tableRowList[dataIndex][`${dataId}-file`].filePath.split('/upload/')[1])
}
});
function allAudit(type) {
if (noMessage > 0) {
layer.msg("当前页面评价驳回数据或者一级审核未通过数据,无法进行全部通过或者全部驳回操作 ")
@ -456,4 +504,4 @@
parent.search(1)
parent.layer.close(index); // 再执行关闭
}
</script>
</script>

View File

@ -604,4 +604,4 @@
</script>
</body>
</html>
</html>