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 status;
private String keyWord; private String keyWord;
private String type; private String type;
private String searchDate;
} }

View File

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

View File

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

View File

@ -164,4 +164,6 @@ public interface OrganizationalDao{
void updateUserOutStatus(OrganizationalBean bean); void updateUserOutStatus(OrganizationalBean bean);
void deleteUserOutData(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.insertInitiateEvaluateLink(jsonArray, o.getId());
} }
dao.deletePjTaskEvaluate(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), 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); ar.setRes(GlobalConst.SUCCEED);
} catch (Exception e) { } catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

View File

@ -124,11 +124,17 @@ public class OrganizationalServiceImpl implements OrganizationalService {
ar.setFailMsg("该班组名称已存在"); ar.setFailMsg("该班组名称已存在");
return ar; return ar;
} }
String pwrs = "gsks@123";// 随机密码,以后发邮箱 // String pwrs = "gsks@123";// 随机密码,以后发邮箱
String pwrsMD5 = CipherHelper.generatePassword(pwrs);// 第一次加密md5 // String pwrsMD5 = CipherHelper.generatePassword(pwrs);// 第一次加密md5
String salt = CipherHelper.createSalt(); // String salt = CipherHelper.createSalt();
bean.setSalt(salt); // bean.setSalt(salt);
bean.setPassword(pwrsMD5); // 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); int num = mapper.addData(bean);
if (num > 0) { if (num > 0) {

View File

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

View File

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

View File

@ -230,4 +230,10 @@
and su.id > 1 and su.id > 1
and sru.roleId = '7' and sru.roleId = '7'
</select> </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> </mapper>

View File

@ -139,7 +139,8 @@
IF(ped.check_one is null, 0,IF( ped.check_one > 0, '0', '1' )) as isApprove, IF(ped.check_one is null, 0,IF( ped.check_one > 0, '0', '1' )) as isApprove,
ped.isReject as isReject, ped.isReject as isReject,
IFNULL(c.evaluateNum,0) as evaluateNum, 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 from pj_evaluate_record per
left join ( left join (
select select
@ -164,15 +165,25 @@
pj_evaluate_details pj_evaluate_details
WHERE WHERE
post_id = #{deptId} post_id = #{deptId}
<if test="deptId == 0 or deptId == '0'">
and person_id = #{userId}
</if>
GROUP BY evaluate_id GROUP BY evaluate_id
) ped ON ped.evaluate_id = per.evaluate_id ) ped ON ped.evaluate_id = per.evaluate_id
LEFT JOIN ( LEFT JOIN (
SELECT evaluate_id as evaluateId,COUNT(id) as evaluateNum, 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_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 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 )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 != ''"> <if test="evaluateDeptId != null and evaluateDeptId != ''">
and per.dept_id = #{evaluateDeptId} and per.dept_id = #{evaluateDeptId}
</if> </if>
@ -344,7 +355,8 @@
IF(ped.check_one is null, 0,IF( ped.check_one > 0, '0', '1' )) as isApprove, IF(ped.check_one is null, 0,IF( ped.check_one > 0, '0', '1' )) as isApprove,
ped.isReject as isReject, ped.isReject as isReject,
IFNULL( c.evaluateNum, 0 ) AS evaluateNum, 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 FROM
pj_evaluate_record per pj_evaluate_record per
LEFT JOIN ( LEFT JOIN (
@ -387,7 +399,8 @@
SELECT SELECT
evaluate_id AS evaluateId, evaluate_id AS evaluateId,
COUNT( id ) AS evaluateNum, 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 FROM
pj_evaluate_result pj_evaluate_result
WHERE WHERE
@ -398,9 +411,15 @@
GROUP BY GROUP BY
evaluate_id evaluate_id
) c ON c.evaluateId = per.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 WHERE
per.is_active = 1 per.is_active = 1 and FIND_IN_SET(#{userId},pjTaskExamine.user_list)
<if test="isBusinessDivision == 0 or isBusinessDivision == '0'"> <if test="isBusinessDivision == 0 or isBusinessDivision == '0'">
AND ped.post_id = #{deptId} AND ped.post_id = #{deptId}
</if> </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_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_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' 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 and pu.id != 1
<if test="bean.id != null and bean.id != ''"> <if test="bean.id != null and bean.id != ''">
and pu.dept_id in and pu.dept_id in

View File

@ -165,6 +165,7 @@
pte.sub_name AS subName, pte.sub_name AS subName,
pte.pro_name AS proName, pte.pro_name AS proName,
pte.manager, pte.manager,
su.phone AS sendPhone,
DATE_FORMAT(pte.evaluate_time,'%Y-%m-%d %H:%i:%s') AS evaluateTime, 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.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, 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 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 poi ON poi.id = pte.parent_id
LEFT JOIN pm_org_info poi1 ON poi1.id = poi.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> <where>
<if test="operType == 1"> <if test="operType == 1">
AND poi1.user_id = #{evUserId} AND poi1.user_id = #{evUserId}

View File

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

View File

@ -14,16 +14,24 @@
<if test="params.status != null and params.status != ''"> <if test="params.status != null and params.status != ''">
and t.status = #{params.status} and t.status = #{params.status}
</if> </if>
<if test="params.roleName != null and params.roleName != ''">
and sr.name like concat('%', #{params.roleName}, '%')
</if>
</where> </where>
</sql> </sql>
<select id="count" resultType="int"> <select id="count" resultType="int">
select count(1) from sys_user t 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" /> <include refid="where" />
</select> </select>
<select id="list" resultType="com.bonus.gs.sub.evaluate.manager.model.SysUser"> <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" /> <include refid="where" />
${params.orderBy} ${params.orderBy}
limit #{offset}, #{limit} limit #{offset}, #{limit}

View File

@ -13,6 +13,20 @@
<link rel="stylesheet" href="layui/css/layui.css" media="all" /> <link rel="stylesheet" href="layui/css/layui.css" media="all" />
<link rel="stylesheet" href="css/global.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" /> <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> </head>
<body> <body>

View File

@ -129,10 +129,10 @@ function initTreeTable() {
} }
if (d.level === 5) { if (d.level === 5) {
if(user.roleId == 6 || user.roleId == 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) { 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 tableData = treeTable.getData('ID-treeTable-demo');
let parentNode = getParentNode(d, tableData); let parentNode = getParentNode(d, tableData);

View File

@ -64,9 +64,14 @@ function initTable() {
, {field: 'evaluateMonth', align: 'center', title: '评价年月'} , {field: 'evaluateMonth', align: 'center', title: '评价年月'}
, {field: 'projectNum', align: 'center', title: '项目数量'} , {field: 'projectNum', align: 'center', title: '项目数量'}
, {field: 'outsourcerNum', align: 'center', title: '外包商数量'} , {field: 'outsourcerNum', align: 'center', title: '外包商数量'}
, {field: 'isApprove', align: 'center', title: '评价状态', templet: d => , {field: 'isApprove', align: 'center', title: '评价状态', templet: d =>{
Number(d.isApprove) === 0 ? '待评价' : (Number(d.isApprove) === 1 ? '已评价' : '') 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 => , {field: 'status', align: 'center', title: '审核状态', templet: d =>
Number(d.status) === 0 ? '待审核' : (Number(d.status) === 1 ? '已审核' : '审核中') Number(d.status) === 0 ? '待审核' : (Number(d.status) === 1 ? '已审核' : '审核中')
} }

View File

@ -34,7 +34,8 @@ function initTable() {
return setEvStatus(d); return setEvStatus(d);
} }
}, },
{field: 'manger', align: 'center', title: '项目经理'}, {field: 'manager', align: 'center', title: '项目经理'},
{field: 'sendPhone', align: 'center', title: '项目经理手机号'},
{field: 'level', align: 'center', title: '评价结果'} {field: 'level', align: 'center', title: '评价结果'}
, { , {
fixed: 'right', width: 180, title: '操作', align: 'center', templet: d => { fixed: 'right', width: 180, title: '操作', align: 'center', templet: d => {
@ -82,6 +83,7 @@ function initTable() {
var rowIndex = obj.index; var rowIndex = obj.index;
var layEvent = obj.event; //当前点击的事件名 var layEvent = obj.event; //当前点击的事件名
if (layEvent === 'notification') { if (layEvent === 'notification') {
console.log(data)
notification(data); notification(data);
} }
if (layEvent === 'evaluateTable') { if (layEvent === 'evaluateTable') {
@ -173,3 +175,29 @@ function notification(obj) {
notificationAjax(obj); 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: 'subName', align: 'center', title: '退场前所属外包商'}
, {field: 'proName', align: 'center', title: '退场前所属项目'} , {field: 'proName', align: 'center', title: '退场前所属项目'}
, {field: 'checkStatus', 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 => { fixed: 'right', title: '评价时间', align: 'center', templet: d => {
return handleTime(d); return handleTime(d);
@ -90,11 +91,10 @@ function initTable() {
} }
} }
} }
}
text += '<a lay-event="evaluateTable" style="color: #009688;cursor: pointer;font-size:' + text += '<a lay-event="evaluateTable" style="color: #009688;cursor: pointer;font-size:' +
' 15px;margin-left: 10px"' + ' 15px;margin-left: 10px"' +
' id="evaluateTable">查看评价</a>'; ' id="evaluateTable">查看评价</a>';
}
return text; return text;
} }
}, },

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -199,6 +199,32 @@
//获取其对应的二级标题 用于计算 //获取其对应的二级标题 用于计算
let currentItem = headerRows[1][index]; let currentItem = headerRows[1][index];
let standardScore = Number(currentItem.standardScore); 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) { if (value > standardScore) {
layer.msg('输入值不能大于标准值'); layer.msg('输入值不能大于标准值');
//清空当前单元格 //清空当前单元格

View File

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

View File

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

View File

@ -340,8 +340,14 @@
table.on('tool(test)', function (obj) { table.on('tool(test)', function (obj) {
var data = obj.data; var data = obj.data;
if (obj.event === 'del') { if (obj.event === 'del') {
console.log(data);
console.log(tableData);
layer.confirm('确定删除该条数据吗?', function (index) { 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); layer.close(index);
//对表格序号进行重新排序 //对表格序号进行重新排序
inst.reload( inst.reload(

View File

@ -135,9 +135,9 @@
done: function (res) { done: function (res) {
var columsName = ['subName'];//需要合并的列名称 ['business_tenant_name','land','contract_begin','contract_end','history_arrears','period']; var columsName = ['subName'];//需要合并的列名称 ['business_tenant_name','land','contract_begin','contract_end','history_arrears','period'];
var columsIndex = [1];//需要合并的列索引值 [2,3,5,6,14,15]; var columsIndex = [1];//需要合并的列索引值 [2,3,5,6,14,15];
res.data.sort(function (a, b) { // res.data.sort(function (a, b) {
return a.subName.localeCompare(b.subName); // return a.subName.localeCompare(b.subName);
}); // });
merge(res, columsName, columsIndex); merge(res, columsName, columsIndex);
tableLoading && layer.close(tableLoading); tableLoading && layer.close(tableLoading);
} }
@ -201,8 +201,8 @@
}else{ }else{
let content = '<div style="padding: 20px 100px;">' + title + let content = '<div style="padding: 20px 100px;"><span style="color: red">*</span>' + title +
'原因:<input type="text" id="rejectReason" autocomplete="off" class="layui-input" style="width: 300px;height: 100px"></div>'; '原因:<input type="text" id="rejectReason" autocomplete="off" lay-verify="required" class="layui-input" style="width: 300px;height: 100px"></div>';
layer.open({ layer.open({
type: 1, type: 1,
title: title, title: title,
@ -211,6 +211,10 @@
btn: ['确定', '取消'], btn: ['确定', '取消'],
yes: function (index, layero) { yes: function (index, layero) {
let rejectReason = $('#rejectReason').val(); let rejectReason = $('#rejectReason').val();
if (!rejectReason) {
layer.msg('请输入驳回原因');
return;
}
$.ajax({ $.ajax({
url: ctxPath + '/outsourcer/allAudit', url: ctxPath + '/outsourcer/allAudit',
type: 'post', type: 'post',
@ -270,8 +274,8 @@
}); });
}); });
} else { } else {
let content = '<div style="padding: 20px 100px;">' + title + let content = '<div style="padding: 20px 100px;"><span style="color: red">*</span>' + title +
'原因:<input type="text" id="rejectReason" autocomplete="off" class="layui-input" style="width: 300px;height: 100px"></div>'; '原因:<input type="text" id="rejectReason" autocomplete="off" lay-verify="required" class="layui-input" style="width: 300px;height: 100px"></div>';
layer.open({ layer.open({
type: 1, type: 1,
title: title, title: title,
@ -280,6 +284,10 @@
btn: ['确定', '取消'], btn: ['确定', '取消'],
yes: function (index, layero) { yes: function (index, layero) {
let rejectReason = $('#rejectReason').val(); let rejectReason = $('#rejectReason').val();
if (!rejectReason) {
layer.msg('请输入驳回原因');
return;
}
$.ajax({ $.ajax({
url: ctxPath + '/outsourcer/audit', url: ctxPath + '/outsourcer/audit',
type: 'post', type: 'post',

View File

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

View File

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

View File

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

View File

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

View File

@ -61,15 +61,24 @@
cols: [[ cols: [[
{field: 'name', title: '角色', width: '20%', unresize: true, align: "left"}, {field: 'name', title: '角色', width: '20%', unresize: true, align: "left"},
{field: 'description', title: '描述', width: '40%', 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 => { fixed: 'right', width: '19.9%', title: '操作', align: 'center', templet: d => {
let html = ""; let html = "";
html += '<a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 15px"' + html += '<a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 15px"' +
' id="add">编辑</a>'; ' id="add">编辑</a>';
html += // html +=
'<a lay-event="del" style="color: #009688;cursor: pointer;font-size: 15px;margin-left: 10px"' + // '<a lay-event="del" style="color: #009688;cursor: pointer;font-size: 15px;margin-left: 10px"' +
' id="add">删除</a>'; // ' id="add">删除</a>';
return html; return html;
} }
}, },

View File

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