bug修改

This commit is contained in:
tqzhang 2025-01-24 15:59:01 +08:00
parent 1cf0d47365
commit d013e08327
36 changed files with 376 additions and 128 deletions

View File

@ -41,4 +41,5 @@ public class EvalSummaryBean {
private String status;
private String keyWord;
private String type;
private String searchDate;
}

View File

@ -77,4 +77,6 @@ public class OutSourceBean {
private String fileName;
private String type;
private String createTime;
private String searchDate;
private String isAuditTask;
}

View File

@ -29,4 +29,5 @@ public class PersonBean {
private String password;
private String personList;
private String evaluatePassWord;
private String type;
}

View File

@ -164,4 +164,6 @@ public interface OrganizationalDao{
void updateUserOutStatus(OrganizationalBean bean);
void deleteUserOutData(OrganizationalBean bean);
int getConsIsExistByPro(OrganizationalBean bean);
}

View File

@ -141,9 +141,13 @@ public class InitiateEvaluateServiceImpl implements InitiateEvaluateService {
dao.insertInitiateEvaluateLink(jsonArray, o.getId());
}
dao.deletePjTaskEvaluate(o.getId());
List<String> uniqueIdsList = idsList.stream().distinct().collect(Collectors.toList());
List<String> uniqueIdsList = new ArrayList<>();
idsList.stream()
.map(ids -> Arrays.stream(ids.split(",")).distinct().collect(Collectors.joining(",")))
.forEach(uniqueIdsList::add);
List<String> uniqueDeptIdList = deptIdList.stream().distinct().collect(Collectors.toList());
IntStream.range(0, uniqueIdsList.size()).forEach(i -> dao.insertPjTaskEvaluate(o.getId(), uniqueIdsList.get(i),
deptIdList.get(i), ("0".equals(deptIdList.get(i)) || "-1".equals(deptIdList.get(i))) ? "1" : "0"));
uniqueDeptIdList.get(i), ("0".equals(uniqueDeptIdList.get(i)) || "-1".equals(uniqueDeptIdList.get(i))) ? "1" : "0"));
ar.setRes(GlobalConst.SUCCEED);
} catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

View File

@ -124,11 +124,17 @@ public class OrganizationalServiceImpl implements OrganizationalService {
ar.setFailMsg("该班组名称已存在");
return ar;
}
String pwrs = "gsks@123";// 随机密码,以后发邮箱
String pwrsMD5 = CipherHelper.generatePassword(pwrs);// 第一次加密md5
String salt = CipherHelper.createSalt();
bean.setSalt(salt);
bean.setPassword(pwrsMD5);
// String pwrs = "gsks@123";// 随机密码,以后发邮箱
// String pwrsMD5 = CipherHelper.generatePassword(pwrs);// 第一次加密md5
// String salt = CipherHelper.createSalt();
// bean.setSalt(salt);
// bean.setPassword(pwrsMD5);
}else if (bean.getLevel() == 4){
int count = mapper.getConsIsExistByPro(bean);
if (count > 0) {
ar.setFailMsg("该承包商在此项目下已存在");
return ar;
}
}
int num = mapper.addData(bean);
if (num > 0) {

View File

@ -95,7 +95,8 @@ public class OutsourcerEvaluateServiceImpl implements OutsourcerEvaluateService
addEvaChildMap(twoList, setTemplateBean, 1);
addEvaChildMap(threeList, setTemplateBean, 1, deptName, deptId, o.getType());
} else if (isBusinessDivision == 1) {
if (Arrays.asList(setTemplateBean.getResponsibleDepartment().split(",")).contains("-1")) {
if (Arrays.asList(setTemplateBean.getResponsibleDepartment().split(",")).contains("-1") ||
Arrays.asList(setTemplateBean.getResponsibleDepartment().split(",")).contains(deptId)) {
addEvaChildMap(twoList, setTemplateBean, 1);
addEvaChildMap(threeList, setTemplateBean, 1, deptName, deptId, o.getType());
}
@ -774,6 +775,7 @@ public class OutsourcerEvaluateServiceImpl implements OutsourcerEvaluateService
@Override
public List<OutSourceBean> getEvaluateAuditList(OutSourceBean o) {
o.setUserId(UserUtil.getLoginUser().getId().toString());
return dao.getEvaluateAuditList(o);
}
@ -868,6 +870,8 @@ public class OutsourcerEvaluateServiceImpl implements OutsourcerEvaluateService
finalList.add(oneList);
finalList.add(twoList);
finalList.add(threeList);
//childList根据subName进行排序
childList.sort(Comparator.comparing(map -> map.get("subName").toString()));
String resParams = JSONArray.toJSON(finalList).toString();
String childParams = JSONArray.toJSON(childList).toString();
ar.setSucceed(resParams, childParams);

View File

@ -58,8 +58,8 @@
<if test="evaluateDeptId != null and evaluateDeptId != ''">
and per.dept_id = #{evaluateDeptId}
</if>
<if test="startDate != null and startDate != ''">
and per.year_and_month = #{startDate}
<if test="searchDate != null and searchDate != ''">
and per.year_and_month = #{searchDate}
</if>
<if test="keyWord != null and keyWord != ''">
and per.evaluate_name like concat('%', #{keyWord}, '%' )

View File

@ -230,4 +230,10 @@
and su.id > 1
and sru.roleId = '7'
</select>
<select id="getConsIsExistByPro" resultType="java.lang.Integer">
select count(1)
from pm_org_info
where parent_id = #{parentId} and name = #{name}
and status = 1
</select>
</mapper>

View File

@ -139,7 +139,8 @@
IF(ped.check_one is null, 0,IF( ped.check_one > 0, '0', '1' )) as isApprove,
ped.isReject as isReject,
IFNULL(c.evaluateNum,0) as evaluateNum,
IF(c.rejectReason is null or c.rejectReason = '',c.rejectReasonTwo,c.rejectReason) as rejectReason
IF(c.rejectReason is null or c.rejectReason = '',c.rejectReasonTwo,c.rejectReason) as rejectReason,
task.postId as taskPostId
from pj_evaluate_record per
left join (
select
@ -152,7 +153,7 @@
)r on per.evaluate_id = r.evaluate_id
left join pj_template_config pt on pt.config_id = per.template_id and pt.is_active = 1
left join pm_org_info poi on per.dept_id = poi.id and poi.status = 1
left join pm_org_info poi1 on FIND_IN_SET(poi1.id, r.pro_id) and poi.status = 1
left join pm_org_info poi1 on FIND_IN_SET(poi1.id, r.pro_id) and poi.status = 1
LEFT JOIN (
SELECT
post_id,
@ -163,16 +164,26 @@
FROM
pj_evaluate_details
WHERE
post_id = #{deptId}
post_id = #{deptId}
<if test="deptId == 0 or deptId == '0'">
and person_id = #{userId}
</if>
GROUP BY evaluate_id
) ped ON ped.evaluate_id = per.evaluate_id
LEFT JOIN (
SELECT evaluate_id as evaluateId,COUNT(id) as evaluateNum,
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 pj_evaluate_result where dept_id = #{deptId} GROUP BY evaluate_id
from pj_evaluate_result where dept_id = #{deptId}
<if test="deptId == 0 or deptId == '0'">
and person_id = #{userId}
</if>
GROUP BY evaluate_id
)c on c.evaluateId = per.evaluate_id
where per.is_active = 1
left join (
select group_concat(post_id) as postId,evaluate_id from pj_task_evaluated GROUP BY evaluate_id
)task on task.evaluate_id = per.evaluate_id
where per.is_active = 1 and FIND_IN_SET(#{deptId},task.postId)
<if test="evaluateDeptId != null and evaluateDeptId != ''">
and per.dept_id = #{evaluateDeptId}
</if>
@ -344,7 +355,8 @@
IF(ped.check_one is null, 0,IF( ped.check_one > 0, '0', '1' )) as isApprove,
ped.isReject as isReject,
IFNULL( c.evaluateNum, 0 ) AS evaluateNum,
c.rejectReason AS rejectReason
if(c.rejectReason is null,c.rejectReasonTwo,c.rejectReason)AS rejectReason,
ifnull(pjTaskExamine.num,0) as isAuditTask
FROM
pj_evaluate_record per
LEFT JOIN (
@ -387,7 +399,8 @@
SELECT
evaluate_id AS evaluateId,
COUNT( id ) AS evaluateNum,
IF(GROUP_CONCAT(reject_one) = REPEAT(',', LENGTH(GROUP_CONCAT(reject_one))), '', TRIM(BOTH ',' FROM GROUP_CONCAT(reject_one))) AS rejectReason
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
pj_evaluate_result
WHERE
@ -398,9 +411,15 @@
GROUP BY
evaluate_id
) c ON c.evaluateId = per.evaluate_id
left join (
SELECT
count(1) as num,
GROUP_CONCAT(user_list) as user_list,
evaluate_id
from pj_task_examine
group by evaluate_id) pjTaskExamine on pjTaskExamine.evaluate_id = per.evaluate_id
WHERE
per.is_active = 1
per.is_active = 1 and FIND_IN_SET(#{userId},pjTaskExamine.user_list)
<if test="isBusinessDivision == 0 or isBusinessDivision == '0'">
AND ped.post_id = #{deptId}
</if>

View File

@ -66,7 +66,13 @@
left join gs_exam.pm_dept pd on pu.DEPT_ID = pd.ID and pd.IS_ACTIVE = '1'
left join gs_exam.pm_new_role_user pnru on pu.ID = pnru.user_id and pnru.del_flag = '0'
left join gs_exam.pm_new_role pnr on pnru.ROLE_ID = pnr.id and pnr.del_flag = '0'
where pu.IS_ACTIVE = '1' and pu.if_active = '1' and pu.LOGIN_NAME not in (select id_card from sys_user where status = '1' and id_card is not null)
where pu.IS_ACTIVE = '1' and pu.if_active = '1'
<if test="bean.type == 'team'">
and pu.LOGIN_NAME not in (select id_card from sys_user where status = '1' and id_card is not null)
</if>
<if test="bean.type == 'evaluate'">
and pu.LOGIN_NAME not in (select id_card from pm_org_info where status = '1' and id_card is not null)
</if>
and pu.id != 1
<if test="bean.id != null and bean.id != ''">
and pu.dept_id in

View File

@ -165,6 +165,7 @@
pte.sub_name AS subName,
pte.pro_name AS proName,
pte.manager,
su.phone AS sendPhone,
DATE_FORMAT(pte.evaluate_time,'%Y-%m-%d %H:%i:%s') AS evaluateTime,
CASE pte.level WHEN '1' THEN '优' WHEN '2' THEN '良' WHEN '3' THEN '中' WHEN '4' THEN '差' END AS level,
CASE pte.ev_status WHEN '0' THEN '待评价' WHEN '1' THEN '已评价' ELSE '待评价' END AS evStatus,
@ -202,6 +203,7 @@
LEFT JOIN gs_exam.pm_user pu ON pte.ev_user_id = pu.ID
LEFT JOIN pm_org_info poi ON poi.id = pte.parent_id
LEFT JOIN pm_org_info poi1 ON poi1.id = poi.parent_id
left join sys_user su on su.id = pte.ev_user_id
<where>
<if test="operType == 1">
AND poi1.user_id = #{evUserId}

View File

@ -136,7 +136,7 @@
count(1) as count
from pj_evaluate_record per
where per.dept_id = #{orgId}
and per.year_and_month = #{evaluateDate}
and per.year_and_month = #{evaluateDate} and is_active = '1'
</select>
<select id="getInitiateEvaluateDetails"
resultType="com.bonus.gs.sub.evaluate.evaluate.beans.InitiateEvaluateBean">

View File

@ -14,16 +14,24 @@
<if test="params.status != null and params.status != ''">
and t.status = #{params.status}
</if>
<if test="params.roleName != null and params.roleName != ''">
and sr.name like concat('%', #{params.roleName}, '%')
</if>
</where>
</sql>
<select id="count" resultType="int">
select count(1) from sys_user t
left join sys_role_user sru on t.id = sru.userId
left join sys_role sr on sru.roleId = sr.id
<include refid="where" />
</select>
<select id="list" resultType="com.bonus.gs.sub.evaluate.manager.model.SysUser">
select *,org_id as deptId from sys_user t
select *,org_id as deptId,sr.name as roleName from sys_user t
left join sys_role_user sru on t.id = sru.userId
left join sys_role sr on sru.roleId = sr.id
<include refid="where" />
${params.orderBy}
limit #{offset}, #{limit}

View File

@ -13,6 +13,20 @@
<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" />
<style>
.layui-nav .layui-nav-more {
position: absolute;
top: 0;
right: 3px;
left: auto !important;
margin-top: 0;
font-size: 12px;
cursor: pointer;
transition: all .2s;
-webkit-transition: all .2s;
margin-left: 5px!important;
}
</style>
</head>
<body>

View File

@ -129,10 +129,10 @@ function initTreeTable() {
}
if (d.level === 5) {
if(user.roleId == 6 || user.roleId == 5){
html += '<a lay-event="changeTheTeamLeader" style="color: #009688;cursor: pointer;font-size: 15px" id="changeTheTeamLeader">编辑</a>';
html += '<a lay-event="changeTheTeamLeader" style="color: #009688;cursor: pointer;font-size: 15px" id="changeTheTeamLeader">更换班长</a>';
}
if (user.roleId == 7 && d.userName == user.nickname) {
html += '<a lay-event="changeTheTeamLeader" style="color: #009688;cursor: pointer;font-size: 15px" id="changeTheTeamLeader">编辑</a>';
html += '<a lay-event="changeTheTeamLeader" style="color: #009688;cursor: pointer;font-size: 15px" id="changeTheTeamLeader">更换班长</a>';
}
let tableData = treeTable.getData('ID-treeTable-demo');
let parentNode = getParentNode(d, tableData);

View File

@ -64,9 +64,14 @@ function initTable() {
, {field: 'evaluateMonth', align: 'center', title: '评价年月'}
, {field: 'projectNum', align: 'center', title: '项目数量'}
, {field: 'outsourcerNum', align: 'center', title: '外包商数量'}
, {field: 'isApprove', align: 'center', title: '评价状态', templet: d =>
Number(d.isApprove) === 0 ? '待评价' : (Number(d.isApprove) === 1 ? '已评价' : '')
}
, {field: 'isApprove', align: 'center', title: '评价状态', templet: d =>{
if (d.rejectReason){
return '评价驳回'
}else {
return Number(d.isApprove) === 0 ? '待评价' : (Number(d.isApprove) === 1 ? '已评价' : '')
}
// Number(d.isApprove) === 0 ? '待评价' : (Number(d.isApprove) === 1 ? '已评价' : '')
}}
, {field: 'status', align: 'center', title: '审核状态', templet: d =>
Number(d.status) === 0 ? '待审核' : (Number(d.status) === 1 ? '已审核' : '审核中')
}

View File

@ -34,7 +34,8 @@ function initTable() {
return setEvStatus(d);
}
},
{field: 'manger', align: 'center', title: '项目经理'},
{field: 'manager', align: 'center', title: '项目经理'},
{field: 'sendPhone', align: 'center', title: '项目经理手机号'},
{field: 'level', align: 'center', title: '评价结果'}
, {
fixed: 'right', width: 180, title: '操作', align: 'center', templet: d => {
@ -82,6 +83,7 @@ function initTable() {
var rowIndex = obj.index;
var layEvent = obj.event; //当前点击的事件名
if (layEvent === 'notification') {
console.log(data)
notification(data);
}
if (layEvent === 'evaluateTable') {
@ -172,4 +174,30 @@ function notification(obj) {
layer.close(layerIndex);
notificationAjax(obj);
});
}
function notificationAjax(obj) {
let loadingMsg = layer.msg('正在发送通知,请稍等...', {icon: 16, shade: 0.01, time: '0'});
$.ajax({
url: `${ctxPath}` + '/backstage/teamEvaluate/notification',
type: 'POST',
data: JSON.stringify({
phone:obj.sendPhone
}),
contentType: "application/json",
dataType: 'json',
success: function (result) {
layer.close(loadingMsg); // 关闭提示层
console.error(result)
if (result.res === 1) {
layer.msg(result.resMsg, {icon: 1});
} else {
layer.msg(result.resMsg, {icon: 2});
}
},
error: function (result) {
layer.close(loadingMsg); // 关闭提示层
layer.msg('服务异常,请稍后重试', {icon: 16, scrollbar: false, time: 2000});
}
});
}

View File

@ -62,7 +62,8 @@ function initTable() {
, {field: 'subName', align: 'center', title: '退场前所属外包商'}
, {field: 'proName', align: 'center', title: '退场前所属项目'}
, {field: 'checkStatus', align: 'center', title: '审核状态'},
{field: 'manger', align: 'center', title: '项目经理'},
{field: 'manager', align: 'center', title: '项目经理'},
{field: 'sendPhone', align: 'center', title: '项目经理手机号'},
{
fixed: 'right', title: '评价时间', align: 'center', templet: d => {
return handleTime(d);
@ -90,11 +91,10 @@ function initTable() {
}
}
}
text += '<a lay-event="evaluateTable" style="color: #009688;cursor: pointer;font-size:' +
' 15px;margin-left: 10px"' +
' id="evaluateTable">查看评价</a>';
}
text += '<a lay-event="evaluateTable" style="color: #009688;cursor: pointer;font-size:' +
' 15px;margin-left: 10px"' +
' id="evaluateTable">查看评价</a>';
return text;
}
},

File diff suppressed because one or more lines are too long

View File

@ -261,7 +261,7 @@
// // console.log(data);
// // 结束填充单元格背景颜色
var filename = tableCode === 1 ? '评价详情.xlsx' : tableCode === 2 ? '得分统计.xlsx' : '汇总统计.xlsxz';
var filename = tableCode === 1 ? '评价详情.xlsx' : tableCode === 2 ? '得分统计.xlsx' : '汇总统计.xlsx';
// 第一行行高40其余行默认20
var rowConf = excel.makeRowConfig({

View File

@ -34,7 +34,7 @@
</div>
<div class="layui-inline" id="timeRange">
<div class="layui-input-inline">
<input type="text" class="layui-input" id="searchDate" placeholder="yyyy-MM">
<input type="text" class="layui-input" autocomplete="off" id="searchDate" placeholder="yyyy-MM">
</div>
</div>
<input type="text" name="operType" id="operType" value="1" hidden>
@ -108,8 +108,7 @@
$("#keyWord").val("");
$("#evaluateDeptId").val("");
$("#evStatus").val("");
$("#startDate").val("");
$("#endDate").val("");
$("#searchDate").val("");
form.render('select');
}
table.reload('baseTable', {
@ -122,8 +121,7 @@
keyWord: $("#keyWord").val(),
evaluateDeptId: $("#evaluateDeptId").val(),
evStatus: $("#evStatus").val(),
startDate: $("#startDate").val(),
endDate: $("#endDate").val(),
searchDate: $("#searchDate").val(),
}
});
}

View File

@ -140,7 +140,8 @@
, toolbar: 'default' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
, where: {
keyWord: $("#keyWord").val(),
id: alreadyChooseTrees.join(",")
id: alreadyChooseTrees.join(","),
type:'evaluate'
} //post请求必须加where post请求需要的参数
, cellMinWidth: 80,
cols: [[ //标题栏
@ -209,7 +210,8 @@
},
where: {
keyWord: $("#keyWord").val(),
id: alreadyChooseTrees.join(",")
id: alreadyChooseTrees.join(","),
type:'evaluate'
}
});
}

View File

@ -106,7 +106,11 @@
cellData.templet = function (d) {
//如果d.isApprove == 1 去除当前行的编辑功能
let text = "";
if (getUrlParam("type") === '审核') {
console.log("======")
console.log("======",getUrlParam("type"))
console.log("======",d.isApprove)
if (getUrlParam("type") == '1') {
if (d.isApprove == 0) {
text += '<a lay-event="pass" style="color: #009688;cursor: pointer;font-size: 15px"' +
' id="pass">通过</a>';
@ -197,8 +201,8 @@
});
});
} else {
let content = '<div style="padding: 20px 100px;">' + title +
'原因:<input type="text" id="rejectReason" autocomplete="off" class="layui-input" style="width: 300px;height: 100px"></div>';
let content = '<div style="padding: 20px 100px;"><span style="color: red">*</span>' + title +
'原因:<input type="text" id="rejectReason" autocomplete="off" class="layui-input" lay-verify="required" style="width: 300px;height: 100px"></div>';
layer.open({
type: 1,
title: title,
@ -207,6 +211,10 @@
btn: ['确定', '取消'],
yes: function (index, layero) {
let rejectReason = $('#rejectReason').val();
if (!rejectReason) {
layer.msg('请输入驳回原因');
return;
}
$.ajax({
url: ctxPath + '/outsourcer/audit',
type: 'post',

View File

@ -145,8 +145,18 @@
, {field: 'evaluateMonth', align: 'center', title: '评价年月'}
, {field: 'projectNum', align: 'center', title: '项目数量'}
, {field: 'outsourcerNum', align: 'center', title: '外包商数量'}
, {field: 'evaluateStatus', align: 'center', title: '评价状态', templet: d =>
Number(d.evaluateNum) > 0 && d.rejectReason ? '评价驳回' : (Number(d.evaluateNum) > 0 ? '已评价' : '未评价')
, {field: 'evaluateStatus', align: 'center', title: '评价状态', templet: d =>{
if (Number(d.evaluateNum) > 0 && d.rejectReason) {
return '评价驳回';
} else if (Number(d.evaluateNum) > 0 && d.isAuditTask > 0) {
return '已评价';
} else if (Number(d.evaluateNum) > 0 && d.isAuditTask == 0) {
return '评价中';
}else{
return '未评价'
}
}
// Number(d.evaluateNum) > 0 && d.rejectReason ? '评价驳回' : (Number(d.evaluateNum) > 0 ? '已评价' : '未评价')
}
, {field: 'auditStatus', align: 'center', title: '审核状态', templet: d =>
Number(d.isApprove) > 0 && d.rejectReason ? '已驳回' : (Number(d.isApprove) > 0 ? '已通过' : (Number(d.evaluateNum) > 0 && d.isApprove == 0 ? '待审批' : '待评价' ))
@ -155,11 +165,20 @@
, {
fixed: 'right', width: 180, title: '操作', align: 'center', templet: d => {
let text = "";
if (Number(d.isApprove === '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;
}
text += '<a lay-event="view" style="color: #009688;cursor: pointer;font-size: 15px"' +
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>';
return text;
}
@ -208,7 +227,10 @@
//评价子页面
function evaluatingSubpages(title,data) {
openPage(title, './outsourceAuditForm.html?type=' + title + '&templateId=' + data.templateId + '&id=' + data.id);
let code = title === '审核' ? 1 : 2
openPage(title, './outsourceAuditForm.html?type=' + code + '&templateId=' +
data.templateId +
'&id=' + data.id);
}
function openPage(title, url) {

View File

@ -199,6 +199,32 @@
//获取其对应的二级标题 用于计算
let currentItem = headerRows[1][index];
let standardScore = Number(currentItem.standardScore);
//是否包含前缀0
if (value.indexOf('0') === 0 && value.length > 1) {
layer.msg('输入值不能以0开头');
//清空当前单元格
obj.update({
[field]: ''
});
return;
}
//判断是否数字
if (value < 0) {
layer.msg('输入值不能小于0');
//清空当前单元格
obj.update({
[field]: ''
});
return;
}
if (!isPositiveInteger(value)) {
layer.msg('请输入正整数');
//清空当前单元格
obj.update({
[field]: ''
});
return;
}
if (value > standardScore) {
layer.msg('输入值不能大于标准值');
//清空当前单元格

View File

@ -153,7 +153,8 @@
, toolbar: 'default' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
, where: {
keyWord: $("#keyWord").val(),
id: alreadyChooseTrees.join(",")
id: alreadyChooseTrees.join(","),
type:'team'
} //post请求必须加where post请求需要的参数
, cellMinWidth: 80,
cols: [[ //标题栏

View File

@ -79,7 +79,7 @@
'.layui-table-cell select{height: 36px; padding: 0 5px;}'
].join(''),
cols: [[ //标题栏
{type: 'checkbox', fixed: 'left'},
// {type: 'checkbox', fixed: 'left'},
{
field: 'number', width: 80, title: '序号', align: 'center', type: 'numbers'
},
@ -200,9 +200,9 @@
function closePage() {
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
parent.searchTable(1)
parent.selectData = [];
localStorage.removeItem("personList");
parent.layer.close(index); // 再执行关闭
parent.layer.close(index); // 关闭当前层
let parentIndex = parent.parent.layer.getFrameIndex(parent.window.name); // 获取父层的索引
parent.parent.searchTable(1)
parent.parent.layer.close(parentIndex); // 关闭父层
}
</script>

View File

@ -340,8 +340,14 @@
table.on('tool(test)', function (obj) {
var data = obj.data;
if (obj.event === 'del') {
console.log(data);
console.log(tableData);
layer.confirm('确定删除该条数据吗?', function (index) {
tableData = tableData.filter(item => item.id !== data.id);
tableData.forEach(function (item, i) {
if (item.id === data.id && item.proId === data.proId) {
tableData.splice(i, 1);
}
});
layer.close(index);
//对表格序号进行重新排序
inst.reload(

View File

@ -135,9 +135,9 @@
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);
});
// res.data.sort(function (a, b) {
// return a.subName.localeCompare(b.subName);
// });
merge(res, columsName, columsIndex);
tableLoading && layer.close(tableLoading);
}
@ -201,8 +201,8 @@
}else{
let content = '<div style="padding: 20px 100px;">' + title +
'原因:<input type="text" id="rejectReason" autocomplete="off" class="layui-input" style="width: 300px;height: 100px"></div>';
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,
@ -211,6 +211,10 @@
btn: ['确定', '取消'],
yes: function (index, layero) {
let rejectReason = $('#rejectReason').val();
if (!rejectReason) {
layer.msg('请输入驳回原因');
return;
}
$.ajax({
url: ctxPath + '/outsourcer/allAudit',
type: 'post',
@ -270,8 +274,8 @@
});
});
} else {
let content = '<div style="padding: 20px 100px;">' + title +
'原因:<input type="text" id="rejectReason" autocomplete="off" class="layui-input" style="width: 300px;height: 100px"></div>';
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,
@ -280,6 +284,10 @@
btn: ['确定', '取消'],
yes: function (index, layero) {
let rejectReason = $('#rejectReason').val();
if (!rejectReason) {
layer.msg('请输入驳回原因');
return;
}
$.ajax({
url: ctxPath + '/outsourcer/audit',
type: 'post',

View File

@ -32,6 +32,7 @@
<script type="text/javascript" src="../../../js/my/permission.js"></script>
<script src="../../../layui/layui.js"></script>
<script>
let noMessage = 0
let headerRows;
let layer, laydate, table, form;
let tableLoading;
@ -119,23 +120,28 @@
if (getUrlParam("type") != '1'){
if (cellData.field === 'examineAndApprove') {
cellData.templet = function (d) {
console.log("ddddd:",d)
//如果d.isApprove == 1 去除当前行的编辑功能
let text = "";
if (d.isTwoApprove == 0) {
if (d.isTwoApprove == 0 && d.isApprove == 1 ) {
text += '<a lay-event="pass" style="color: #009688;cursor: pointer;font-size: 15px"' +
' id="pass">通过</a>';
text +=
'<a lay-event="reject" style="color: #a59e9e;cursor: pointer;font-size: 15px;margin-left: 10px"' +
' id="reject">驳回</a>';
}else{
if (d.isTwoApprove == 1 && d.isApprove == 1 ) {
text += '<a style="color: #009688;cursor: pointer;font-size: 15px"' +
' id="pass">已通过</a>';
}else if (d.isTwoApprove == 2 && d.isApprove == 1 ) {
text += '<a style="color: #a59e9e;cursor: pointer;font-size: 15px"' +
' id="reject">已驳回</a>';
}else{
noMessage++
return ''
}
}
if (d.isTwoApprove == 1) {
text += '<a style="color: #009688;cursor: pointer;font-size: 15px"' +
' id="pass">已通过</a>';
}
if (d.isTwoApprove == 2) {
text += '<a style="color: #a59e9e;cursor: pointer;font-size: 15px"' +
' id="reject">已驳回</a>';
}
// text += '<a lay-event="pass" style="color: #009688;cursor: pointer;font-size: 15px"' +
// ' id="pass">通过</a>';
@ -178,9 +184,9 @@
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);
});
// res.data.sort(function (a, b) {
// return a.subName.localeCompare(b.subName);
// });
merge(res, columsName, columsIndex);
tableLoading && layer.close(tableLoading);
}
@ -212,6 +218,10 @@
}
function allAudit(type) {
if (noMessage > 0){
layer.msg("当前页面评价驳回数据或者一级审核未通过数据,无法进行全部通过或者全部驳回操作 ")
return
}
let title = type === 1 ? '全部通过' : '全部驳回';
layer.confirm('确定'+title+'吗?', function (index) {
if(type === 1){
@ -241,8 +251,8 @@
}else{
let content = '<div style="padding: 20px 100px;">' + title +
'原因:<input type="text" id="rejectReason" autocomplete="off" class="layui-input" style="width: 300px;height: 100px"></div>';
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,
@ -251,6 +261,10 @@
btn: ['确定', '取消'],
yes: function (index, layero) {
let rejectReason = $('#rejectReason').val();
if (!rejectReason) {
layer.msg('请输入驳回原因');
return;
}
$.ajax({
url: ctxPath + '/outsourcer/allAudit',
type: 'post',
@ -315,8 +329,8 @@
}else {
let content = '<div style="padding: 20px 100px;">' + title +
'原因:<input type="text" id="rejectReason" autocomplete="off" class="layui-input" style="width: 300px;height: 100px"></div>';
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,
@ -325,6 +339,10 @@
btn: ['确定', '取消'],
yes: function (index, layero) {
let rejectReason = $('#rejectReason').val();
if (!rejectReason) {
layer.msg('请输入驳回原因');
return;
}
$.ajax({
url: ctxPath + '/outsourcer/audit',
type: 'post',
@ -338,6 +356,7 @@
rejectReason: rejectReason,
},
success: function (res) {
debugger
layer.close(index);
if (res.res == '1') {
status.isTwoApprove = type;

View File

@ -61,10 +61,10 @@
搜索
</button>
<button class="layui-btn" title="重置" type="button" onclick="search(2)">重置</button>
<button class="layui-btn " title="新增" type="button"
onclick="add()">
新增
</button>
<!-- <button class="layui-btn " title="新增" type="button"-->
<!-- onclick="add()">-->
<!-- 新增-->
<!-- </button>-->
</div>
</div>
</form>

View File

@ -22,13 +22,16 @@
<div class="layui-inline" style="width: 50%">
<label class="layui-form-label"><span style="color: red">*</span>模板名称:</label>
<div class="layui-input-block" style="width: 100%">
<input type="text" name="templateName" id="templateName" lay-verify="required" placeholder="请输入模板名称"
<input type="text" name="templateName" id="templateName" lay-verify="required"
placeholder="请输入模板名称"
autocomplete="off" maxlength="100"
class="layui-input" lay-affix="clear" lay-verify="required">
</div>
</div>
<div class="layui-inline" style="margin-left: 10px;">
<button class="layui-btn addTemplateBtn" onclick="addTemplate(1,event)" style="margin-left: 10px;">新增评价模板</button>
<button class="layui-btn addTemplateBtn" onclick="addTemplate(1,event)" style="margin-left: 10px;">
新增评价模板
</button>
</div>
</div>
<div class="template_container" style="height:auto;overflow-y:auto;">
@ -86,7 +89,7 @@
</label>
<div class="layui-input-block" style="width: 100%;">
<input type="radio" name="collect_161" value="累加" title="累加" checked>
<!-- <input type="radio" name="collect_161" value="递减" title="递减">-->
<!-- <input type="radio" name="collect_161" value="递减" title="递减">-->
<input type="radio" name="collect_161" value="最小值" title="最小值">
<input type="radio" name="collect_161" value="平均值" title="平均值">
</div>
@ -119,8 +122,9 @@
placeholder="请输入标准分值"
autocomplete="off"
min="0"
lay-affix="number"
class="layui-input" lay-affix="clear" lay-verify="required">
onblur="checkStandardScore(this)"
lay-affix="text"
class="layui-input" lay-affix="clear">
</div>
</div>
</div>
@ -214,6 +218,22 @@
layui.use(['layer', 'form'], function () {
layer = layui.layer;
form = layui.form;
// form.verify({
// subStandardScore: function (value, item) {
// //验证是否为正整数
// if (value === '') {
// return '请输入标准分值';
// }
// //是否包含前缀0
// if (value.indexOf('0') === 0) {
// layer.msg('输入值不能以0开头');
// return;
// }
// if (!isPositiveInteger(value)) {
// return '请输入正整数';
// }
// }
// });
type = getUrlParam("type");
getResponsibleDepartment();
let xmSelectInstance = xmSelect.render({
@ -234,11 +254,11 @@
addTemplate(1);
let clone = $(".templateSub").last();
fillTemplate(clone, item);
//删除第一个subclass
//删除第一个subclass
$(".template_container").append(clone);
});
//如果只有一个模板 隐藏删除按钮
if(data.length === 1){
if (data.length === 1) {
$(".layui-btn-danger").hide();
}
@ -265,7 +285,7 @@
form.on('submit(formDemo)', function (data) {
//查询所有的subclass下的responsibleDepartment是否有值
let allDepartments = $(".fromData .responsibleDepartment").map(function() {
let allDepartments = $(".fromData .responsibleDepartment").map(function () {
return $(this).data('xmSelectInstance').getValue('valueStr');
}).get();
let emptyIndex = allDepartments.findIndex(dept => dept === '');
@ -312,7 +332,7 @@
totalScore += parseInt(item.subStandardScore);
});
standardScore = totalScore;
}else if (total === '最小值') {
} else if (total === '最小值') {
let totalScore = 0;
subClassData.forEach(function (item) {
if (totalScore === 0) {
@ -322,7 +342,7 @@
}
});
standardScore = totalScore;
}else if (total === '平均值') {
} else if (total === '平均值') {
let totalScore = 0;
subClassData.forEach(function (item) {
totalScore += parseInt(item.subStandardScore);
@ -342,7 +362,7 @@
type: "POST",
url: ctxPath + '/setTemplate/addTemplate',
data: {
id: type === 'add' ? '' : getUrlParam("id"),
id: type === 'add' ? '' : getUrlParam("id"),
name: data.field.templateName,
jsonTxt: JSON.stringify(templateData),
version: type === 'edit' ? getUrlParam("version") : ''
@ -461,11 +481,11 @@
$(radio).prop("checked", true);
}
});
if (type ==='view'){
if (type === 'view') {
clone.find("input[type='radio']").attr("disabled", true);
}
// 上述数据无问题
item.subClass.forEach(function (subItem,subIndex) {
item.subClass.forEach(function (subItem, subIndex) {
//模拟点击当前模板的新增按钮
if (subIndex !== 0) {
clone.find(".subclass").last().find(".layui-icon-add-circle").click();
@ -482,7 +502,7 @@
let xmSelectInstance = subClone.find('.responsibleDepartment').data('xmSelectInstance');
xmSelectInstance.setValue(subItem.responsibleDepartment.split(','));
//如果responsibleDepartment展示不全需要对其进行鼠标移入操作 进行展示
subClone.find(".xm-select").on("mouseenter", function() {
subClone.find(".xm-select").on("mouseenter", function () {
$(this).attr("title", $(this).text());
});
@ -493,20 +513,20 @@
$(radio).prop("checked", true);
}
});
if (type ==='view'){
if (type === 'view') {
//去除clear按钮
removeClear();
//对radio设置不可编辑
subClone.find("input[type='radio']").attr("disabled", true);
//对当前的xm-select设置不可编辑
xmSelectInstance.update({ disabled: true })
xmSelectInstance.update({disabled: true})
}
}
function removeClear() {
document.querySelectorAll('[lay-affix="clear"]').forEach(function(element) {
document.querySelectorAll('[lay-affix="clear"]').forEach(function (element) {
element.removeAttribute('lay-affix');
});
}
@ -529,4 +549,24 @@
parent.search(1)
parent.layer.close(index); // 再执行关闭
}
function checkStandardScore(e) {
if (e.value === '') {
layer.msg('请输入标准分值');
//清除value
e.value = '';
return;
}
if (e.value.indexOf('0') === 0 && e.value.length > 1) {
layer.msg('输入值不能以0开头');
e.value = '';
return;
}
if (!isPositiveInteger(e.value)) {
layer.msg('请输入正整数');
e.value = '';
return;
}
}
</script>

View File

@ -26,7 +26,7 @@
<label class="col-md-2 control-label">描述</label>
<div class="col-md-10">
<textarea class="form-control" style="width: 60%" placeholder="描述" name="description"
id="description"></textarea>
id="description" maxlength="100" type="text" ></textarea>
</div>
</div>
<div class="form-group">

View File

@ -61,15 +61,24 @@
cols: [[
{field: 'name', title: '角色', width: '20%', unresize: true, align: "left"},
{field: 'description', title: '描述', width: '40%', unresize: true, align: "left"},
{field: 'updateTime', title: '修改时间', width: '20%', unresize: true, align: "left"},
{field: 'updateTime', title: '修改时间', width: '20%', unresize: true, align: "left", templet: function(d) {
var date = new Date(d.updateTime);
var year = date.getFullYear();
var month = ('0' + (date.getMonth() + 1)).slice(-2);
var day = ('0' + date.getDate()).slice(-2);
var hours = ('0' + date.getHours()).slice(-2);
var minutes = ('0' + date.getMinutes()).slice(-2);
var seconds = ('0' + date.getSeconds()).slice(-2);
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
}},
{
fixed: 'right', width: '19.9%', title: '操作', align: 'center', templet: d => {
let html = "";
html += '<a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 15px"' +
' id="add">编辑</a>';
html +=
'<a lay-event="del" style="color: #009688;cursor: pointer;font-size: 15px;margin-left: 10px"' +
' id="add">删除</a>';
// html +=
// '<a lay-event="del" style="color: #009688;cursor: pointer;font-size: 15px;margin-left: 10px"' +
// ' id="add">删除</a>';
return html;
}
},

View File

@ -19,11 +19,11 @@
<div class="form-group">
用户名:
<input id="username" type="text" class="form-control" placeholder="用户名">
昵称
<input id="nickname" type="text" class="form-control" placeholder="昵称">
状态:
<select class="form-control input-sm" id="status">
</select>
角色
<input id="roleName" type="text" class="form-control" placeholder="角色">
<!-- 状态:-->
<!-- <select class="form-control input-sm" id="status">-->
<!-- </select>-->
<button id="searchBt" class="layui-btn layui-btn-sm" permission="sys:user:query"><i
class="layui-icon">&#xe615;</i>搜索
</button>
@ -48,11 +48,11 @@
<tr>
</tr>
<tr>
<th>username</th>
<th>昵称</th>
<th>用户名</th>
<th>角色</th>
<th>手机号</th>
<th>邮箱</th>
<th>状态</th>
<!-- <th>状态</th>-->
<th>操作</th>
</tr>
</thead>
@ -99,8 +99,8 @@
"type": "get",
"data": function (d) {
d.username = $('#username').val();
d.nickname = $('#nickname').val();
d.status = $('#status').val();
d.roleName = $('#roleName').val();
// d.status = $('#status').val();
},
"error": function (xhr, textStatus, errorThrown) {
var msg = xhr.responseText;
@ -125,16 +125,16 @@
"dom": "<'dt-toolbar'r>t<'dt-toolbar-footer'<'col-sm-10 col-xs-12 hidden-xs'i><'col-xs-12 col-sm-10' p v>>",
"columns": [
{"data": "username", "defaultContent": ""},
{"data": "nickname", "defaultContent": ""},
{"data": "roleName", "defaultContent": ""},
{"data": "phone", "defaultContent": "", "render": function(data, type, row) { return maskSensitiveInfo(data, 'phone'); }},
{"data": "email", "defaultContent": ""},
{
"data": "status",
"defaultContent": "",
"render": function (data, type, row) {
return userStatus[data];
}
},
// {
// "data": "status",
// "defaultContent": "",
// "render": function (data, type, row) {
// return userStatus[data];
// }
// },
{
"data": "",
"defaultContent": "",
@ -142,9 +142,10 @@
"render": function (data, type, row) {
var id = row['id'];
var href = "updateUser.html?id=" + id;
var edit = buttonEdit(href, "sys:user:add", pers);
// var edit = buttonEdit(href, "sys:user:add", pers);
var change = buttonChange(id,row['phone'], "sys:user:add", pers);
return edit + change;
// return edit + change;
return change;
}
},