班主注册及产线问题修复
This commit is contained in:
parent
962a79e63d
commit
b158ad6705
|
|
@ -69,4 +69,5 @@ public class OrganizationalBean {
|
|||
|
||||
private String orgType;
|
||||
private Integer pParentId;
|
||||
private Integer isCompletion;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,4 +84,7 @@ public class OutSourceBean {
|
|||
private String isAuditTask;
|
||||
|
||||
private String checkOne;
|
||||
private Integer allCheckOne;
|
||||
private Integer allCheckTwo;
|
||||
private Integer allCheckThree;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,5 +23,7 @@ public class ProjectBean {
|
|||
private Integer personInChargeId;
|
||||
// 所属事业部Id
|
||||
private Integer departmentId;
|
||||
// 项目是否完工 0 否 1是
|
||||
private Integer isCompletion;
|
||||
private String keyWord;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* @Author:liang.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();
|
||||
|
|
|
|||
|
|
@ -35,4 +35,6 @@ public interface ProjectDao {
|
|||
Integer getTeamGroup(ProjectBean bean);
|
||||
|
||||
int getProIsExistByDepartmentId(OrganizationalBean bean);
|
||||
|
||||
Integer updateprojectCompletion(ProjectBean projectBean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,4 +64,6 @@ public interface TeamGroupDao {
|
|||
TeamGroupBean getTeamLeader(TeamGroupBean groupBean);
|
||||
|
||||
String getDepartmentName(String applyMan);
|
||||
|
||||
Integer auditRegister(TeamGroupBean teamGroupBean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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("该项目在此事业部下已存在");
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,4 +25,6 @@ public interface ProjectService {
|
|||
Integer delProjectSubcontractor(ViolationBean bean);
|
||||
|
||||
List<OrganizationalBean> getNoBindSubcontractorSelect(ViolationBean bean);
|
||||
|
||||
Integer updateprojectCompletion(ProjectBean projectBean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,4 +33,6 @@ public interface TeamGroupService {
|
|||
List<TeamGroupBean> getRegisterList(TeamGroupBean teamGroupBean);
|
||||
|
||||
List<TeamGroupBean> auditRegisterList(TeamGroupBean teamGroupBean);
|
||||
|
||||
Integer auditRegister(TeamGroupBean teamGroupBean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
SELECT
|
||||
id,
|
||||
name AS title,
|
||||
name,
|
||||
level,
|
||||
parent_id AS parentId,
|
||||
IFNULL(org_type, '1') as org_type
|
||||
FROM pm_org_info
|
||||
where level < 4
|
||||
having org_type != 2
|
||||
IFNULL(org_type, '1') AS org_type
|
||||
FROM
|
||||
pm_org_info
|
||||
WHERE
|
||||
level < 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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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;">
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
/* 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 '已审批'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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>';
|
||||
|
|
|
|||
|
|
@ -397,7 +397,6 @@
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
function getTitle() {
|
||||
let path = getUrlParam("type") == '0' ? '/outsourcer/getTableTitle' : '/outsourcer/getAuditTitleData';
|
||||
$.ajax({
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@
|
|||
<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>
|
||||
注:如无审核按钮,则表示当前评价停留在一级审核处
|
||||
</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">
|
||||
|
|
@ -39,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;
|
||||
|
|
@ -88,6 +90,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: []
|
||||
|
|
@ -143,6 +165,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) {
|
||||
|
|
@ -171,6 +206,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) {
|
||||
let title = type === 1 ? '全部通过' : '全部驳回';
|
||||
layer.confirm('确定' + title + '吗?', function (index) {
|
||||
|
|
|
|||
|
|
@ -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("当前页面评价驳回数据或者一级审核未通过数据,无法进行全部通过或者全部驳回操作 !")
|
||||
|
|
|
|||
|
|
@ -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("当前页面评价驳回数据或者一级审核未通过数据,无法进行全部通过或者全部驳回操作 !")
|
||||
|
|
|
|||
Loading…
Reference in New Issue