修改系统bug

This commit is contained in:
haozq 2025-03-03 14:21:47 +08:00
parent 58b08f45f7
commit 2ff2574729
27 changed files with 330 additions and 49 deletions

View File

@ -1,10 +1,13 @@
package com.bonus.gs.sub.evaluate.evaluate.beans; package com.bonus.gs.sub.evaluate.evaluate.beans;
import lombok.Data;
/** /**
* @author xliu * @author xliu
* @date 2024/11/15 18:49 * @date 2024/11/15 18:49
* 班组评价-实体类 * 班组评价-实体类
*/ */
@Data
public class TeamEvaluateBean { public class TeamEvaluateBean {
private Integer id; private Integer id;
@ -28,6 +31,18 @@ public class TeamEvaluateBean {
private String subName; private String subName;
/**项目Id*/ /**项目Id*/
private Integer proId; private Integer proId;
private String supName;
/**
* 创建史
*/
private String times;
private String startTime;
private String endTime;
/**项目名称*/ /**项目名称*/
private String proName; private String proName;
/**项目经理*/ /**项目经理*/

View File

@ -65,7 +65,7 @@ public class EvalSummaryController extends BaseController<EvaluateBean> {
// 返回文件路径 // 返回文件路径
String pathname = targetFile.getAbsolutePath(); String pathname = targetFile.getAbsolutePath();
ar.setSucceedMsg("文件上传成功"); ar.setSucceedMsg("文件上传成功");
int result = service.addEvalSummary(pathname, date, evaluateTitle,evaluateDept); int result = service.addEvalSummary(fileName, date, evaluateTitle,evaluateDept);
ar.setSucceed(result); ar.setSucceed(result);
} catch (Exception e) { } catch (Exception e) {
logger.error(e.toString(), e); logger.error(e.toString(), e);

View File

@ -406,7 +406,17 @@ public class OutsourcerEvaluateController extends BaseController<EvaluateSubBean
return ar; return ar;
} }
@RequestMapping("isCheckThreeIsAudit")
@ResponseBody
public AjaxRes isCheckThreeIsAudit(EvaluateDataBean o) {
AjaxRes ar = new AjaxRes();
try {
ar = outsourcerEvaluateService.isCheckThreeIsAudit(o);
} catch (Exception e) {
ar.setFailMsg(GlobalConst.DATA_FAIL);
}
return ar;
}
/** /**
* 专员审核 * 专员审核
* @param o * @param o

View File

@ -129,6 +129,13 @@ public class TeamEvaluateController extends BaseController<TeamEvaluateBean> {
return service.notification(bean); return service.notification(bean);
} }
@RequestMapping(value = "getSupList", method = RequestMethod.POST)
@ResponseBody
public AjaxRes getSupList(@RequestBody TeamEvaluateBean bean) {
return service.getSupList(bean);
}
/** /**
* 下载 * 下载
* *

View File

@ -142,6 +142,10 @@ public interface OutsourcerEvaluateDao {
int isCheckTwoIsAudit(EvaluateDataBean o); int isCheckTwoIsAudit(EvaluateDataBean o);
int isCheckThreeIsAudit(EvaluateDataBean o);
/** /**
* 重新 * 重新
* @param o * @param o

View File

@ -57,4 +57,11 @@ public interface TeamEvaluateDao {
* @return List<TeamEvaluateBean> * @return List<TeamEvaluateBean>
*/ */
List<TeamEvaluateBean> getTeamEvaluateList(TeamEvaluateBean o); List<TeamEvaluateBean> getTeamEvaluateList(TeamEvaluateBean o);
/**
* 查询班组里面分包商
* @param bean
* @return
*/
List<String> getSupList(TeamEvaluateBean bean);
} }

View File

@ -74,4 +74,6 @@ public interface OutsourcerEvaluateService {
AjaxRes isCheckOneIsAudit(EvaluateDataBean o); AjaxRes isCheckOneIsAudit(EvaluateDataBean o);
AjaxRes isCheckTwoIsAudit(EvaluateDataBean o); AjaxRes isCheckTwoIsAudit(EvaluateDataBean o);
AjaxRes isCheckThreeIsAudit(EvaluateDataBean o);
} }

View File

@ -6,6 +6,7 @@ import com.bonus.gs.sub.evaluate.evaluate.beans.*;
import com.bonus.gs.sub.evaluate.evaluate.dao.OutsourcerEvaluateDao; import com.bonus.gs.sub.evaluate.evaluate.dao.OutsourcerEvaluateDao;
import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes; import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes;
import com.bonus.gs.sub.evaluate.manager.utils.UserUtil; import com.bonus.gs.sub.evaluate.manager.utils.UserUtil;
import com.sun.java.browser.plugin2.DOM;
import lombok.val; import lombok.val;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.aspectj.weaver.loadtime.Aj; import org.aspectj.weaver.loadtime.Aj;
@ -17,6 +18,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
@ -1349,12 +1351,38 @@ public class OutsourcerEvaluateServiceImpl implements OutsourcerEvaluateService
finalTitleList.add(map); finalTitleList.add(map);
} }
} }
//计算平准值进行重新计算
for (Map<String, Object> map:childDataList){
BigDecimal bigDecimal=new BigDecimal("0");
int num=0;
for (String key : map.keySet()) {
if(key.contains("-")){
String[] year=key.split("-");
if (year.length==2 && isNumeric(year[0]) && isNumeric(year[1]) ){
BigDecimal pfnum=new BigDecimal(String.valueOf(map.get(key)));
bigDecimal=bigDecimal.add(pfnum);
num++;
}
}
}
BigDecimal nums=new BigDecimal(num);
BigDecimal avg= bigDecimal.divide(nums);
map.put("avgScore",avg.toString());
}
childDataList.sort((o1, o2) -> {
Double one = Double.valueOf(o1.get("avgScore").toString());
Double two = Double.valueOf(o2.get("avgScore").toString());
return two.compareTo(one); //one.compareTo(two)为升序two.compareTo(one)为降序
});
String resParams = JSONArray.toJSON(finalTitleList).toString(); String resParams = JSONArray.toJSON(finalTitleList).toString();
String childParams = JSONArray.toJSON(childDataList).toString(); String childParams = JSONArray.toJSON(childDataList).toString();
ar.setSucceed(resParams, childParams); ar.setSucceed(resParams, childParams);
return ar; return ar;
} }
public static boolean isNumeric(String str) {
return str.matches("-?\\d+(\\.\\d+)?");
}
@Override @Override
public AjaxRes isCheckOneIsAudit(EvaluateDataBean o) { public AjaxRes isCheckOneIsAudit(EvaluateDataBean o) {
AjaxRes ar = new AjaxRes(); AjaxRes ar = new AjaxRes();
@ -1378,4 +1406,16 @@ public class OutsourcerEvaluateServiceImpl implements OutsourcerEvaluateService
} }
return ar; return ar;
} }
@Override
public AjaxRes isCheckThreeIsAudit(EvaluateDataBean o) {
AjaxRes ar = new AjaxRes();
int count = outsourcerEvaluateDao.isCheckThreeIsAudit(o);
if (count > 0) {
ar.setSucceed("1");
} else {
ar.setFailMsg("0");
}
return ar;
}
} }

View File

@ -56,6 +56,7 @@ public class PersonServiceImpl implements PersonService {
dao.updateOldUser(list); dao.updateOldUser(list);
ar.setSucceed(GlobalConst.SAVE_SUCCEED); ar.setSucceed(GlobalConst.SAVE_SUCCEED);
} catch (Exception e) { } catch (Exception e) {
log.error(e.toString(),e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
ar.setFailMsg("添加失败"); ar.setFailMsg("添加失败");
} }

View File

@ -65,4 +65,11 @@ public interface TeamEvaluateService {
* @return List<TeamEvaluateBean> * @return List<TeamEvaluateBean>
*/ */
List<TeamEvaluateBean> getTeamEvaluateList(TeamEvaluateBean o); List<TeamEvaluateBean> getTeamEvaluateList(TeamEvaluateBean o);
/**
* 查询全部分包商数据
* @param bean
* @return
*/
AjaxRes getSupList(TeamEvaluateBean bean);
} }

View File

@ -2,10 +2,8 @@ package com.bonus.gs.sub.evaluate.evaluate.service;
import com.bonus.gs.sub.evaluate.evaluate.beans.TeamEvaluateBean; import com.bonus.gs.sub.evaluate.evaluate.beans.TeamEvaluateBean;
import com.bonus.gs.sub.evaluate.evaluate.dao.TeamEvaluateDao; import com.bonus.gs.sub.evaluate.evaluate.dao.TeamEvaluateDao;
import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes; import com.bonus.gs.sub.evaluate.manager.utils.*;
import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst; import lombok.extern.slf4j.Slf4j;
import com.bonus.gs.sub.evaluate.manager.utils.KtySmsUtil;
import com.bonus.gs.sub.evaluate.manager.utils.UserUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session; import org.apache.shiro.session.Session;
@ -26,6 +24,7 @@ import java.util.List;
* @description:班组评价 * @description:班组评价
*/ */
@Service(value = "TeamEvaluateService") @Service(value = "TeamEvaluateService")
@Slf4j
public class TeamEvaluateServiceImpl implements TeamEvaluateService { public class TeamEvaluateServiceImpl implements TeamEvaluateService {
@Autowired @Autowired
@ -85,8 +84,7 @@ public class TeamEvaluateServiceImpl implements TeamEvaluateService {
phoneArray = new String[]{phones}; phoneArray = new String[]{phones};
} }
KtySmsUtil ktySmsUtil = new KtySmsUtil(); KtySmsUtil ktySmsUtil = new KtySmsUtil();
String content = "【甘肃教育培训系统提醒您】您有一个已退场的班组未进行评价,请抓紧评价!"; String content = "【甘肃分包评价系统】您有一个已退场的班组未进行评价,请抓紧评价!";
boolean allSentSuccessfully = true; boolean allSentSuccessfully = true;
for (String phone : phoneArray) { for (String phone : phoneArray) {
String msg = ktySmsUtil.setPhoneMsg(phone.trim(), content); String msg = ktySmsUtil.setPhoneMsg(phone.trim(), content);
@ -135,6 +133,10 @@ public class TeamEvaluateServiceImpl implements TeamEvaluateService {
*/ */
@Override @Override
public List<TeamEvaluateBean> getTeamEvaluateList(TeamEvaluateBean o) { public List<TeamEvaluateBean> getTeamEvaluateList(TeamEvaluateBean o) {
if(StringHelper.isNotEmpty(o.getTimes())){
o.setStartTime(o.getTimes().split(" - ")[0]);
o.setEndTime(o.getTimes().split(" - ")[1]);
}
o.setEvUserId(Integer.parseInt(String.valueOf(UserUtil.getLoginUser().getId()))); o.setEvUserId(Integer.parseInt(String.valueOf(UserUtil.getLoginUser().getId())));
if ("5".equals(UserUtil.getLoginUser().getRoleId()) || Arrays.asList(UserUtil.getLoginUser().getRoleId().split(",")).contains("5")) { if ("5".equals(UserUtil.getLoginUser().getRoleId()) || Arrays.asList(UserUtil.getLoginUser().getRoleId().split(",")).contains("5")) {
o.setRoleId("5"); o.setRoleId("5");
@ -147,4 +149,20 @@ public class TeamEvaluateServiceImpl implements TeamEvaluateService {
} }
return dao.getTeamEvaluateList(o); return dao.getTeamEvaluateList(o);
} }
/**
* 查询全部分包商数据
* @param bean
* @return
*/
@Override
public AjaxRes getSupList(TeamEvaluateBean bean) {
try{
List<String> msg=dao.getSupList(bean);
return AjaxRes.success("请求成功",msg);
}catch (Exception e){
log.error(e.toString(),e);
}
return AjaxRes.error("请求失败");
}
} }

View File

@ -1,8 +1,12 @@
package com.bonus.gs.sub.evaluate.manager.config; package com.bonus.gs.sub.evaluate.manager.config;
import java.io.File;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.util.ResourceUtils;
import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
@ -13,6 +17,9 @@ import com.bonus.gs.sub.evaluate.manager.table.PageTableArgumentResolver;
@Configuration @Configuration
public class WebMvcConfig implements WebMvcConfigurer { public class WebMvcConfig implements WebMvcConfigurer {
@Value("${upload.dir}")
private String filesPath;
/** /**
* 跨域支持 * 跨域支持
* *
@ -48,8 +55,10 @@ public class WebMvcConfig implements WebMvcConfigurer {
*/ */
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
// registry.addResourceHandler("/statics/**") /** 本地文件上传路径 */
// .addResourceLocations(ResourceUtils.FILE_URL_PREFIX + filesPath + File.separator); registry.addResourceHandler("/statics/**")
.addResourceLocations("file:" + filesPath+"/");
registry.addResourceHandler("/files/**")
.addResourceLocations("file:"+filesPath);
} }
} }

View File

@ -1,6 +1,7 @@
package com.bonus.gs.sub.evaluate.manager.utils; package com.bonus.gs.sub.evaluate.manager.utils;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.formula.functions.T;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
@ -90,6 +91,32 @@ public class AjaxRes implements Serializable {
this.setSucceed(obj); this.setSucceed(obj);
} }
public static AjaxRes success(String msg){
AjaxRes ajax= new AjaxRes();
ajax.setCode(200);
ajax.setMsg(msg);
return ajax;
}
public static<T> AjaxRes success(String msg, List<T> data){
AjaxRes ajax= new AjaxRes();
ajax.setCode(200);
ajax.setMsg(msg);
ajax.setData(data);
return ajax;
}
public static AjaxRes error(String msg){
AjaxRes ajax= new AjaxRes();
ajax.setCode(201);
ajax.setMsg(msg);
return ajax;
}
public static AjaxRes error(String msg, Object data){
AjaxRes ajax= new AjaxRes();
ajax.setCode(201);
ajax.setMsg(msg);
ajax.setObj(data);
return ajax;
}
public void getDataTableLayui(List<?> list, int count) public void getDataTableLayui(List<?> list, int count)
{ {
this.setCode(0); this.setCode(0);

View File

@ -41,7 +41,6 @@ spring.http.multipart.maxRequestSize=10Mb
token.expire.seconds=7200 token.expire.seconds=7200
spring.servlet.multipart.enabled=true spring.servlet.multipart.enabled=true
#upload.dir=/data/upload upload.dir=/home/gswbs/upload
upload.dir=D:/upload #upload.dir=D:/upload
user.password=Bonus@admin123
user.password=admin

View File

@ -768,6 +768,7 @@
select count(1) from pj_evaluate_details where evaluate_id = #{evaluateId} and post_id = #{deptId} and select count(1) from pj_evaluate_details where evaluate_id = #{evaluateId} and post_id = #{deptId} and
check_one = '1' and sub_evaluate_id = #{templateId} check_one = '1' and sub_evaluate_id = #{templateId}
</select> </select>
<select id="getEvaluateSubInfo" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.EvaluateDataBean"> <select id="getEvaluateSubInfo" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.EvaluateDataBean">
select select
pes.sub_id as subId, pes.sub_id as subId,
@ -791,10 +792,14 @@
pes.sub_id pes.sub_id
</select> </select>
<select id="isCheckTwoIsAudit" resultType="java.lang.Integer"> <select id="isCheckTwoIsAudit" resultType="java.lang.Integer">
select count(1) from pj_evaluate_details where evaluate_id = #{evaluateId} and post_id = #{deptId} and select count(1) from pj_evaluate_details where evaluate_id = #{evaluateId} and post_id = #{deptId} and
check_two = '1' and sub_evaluate_id = #{templateId} check_two = '1' and sub_evaluate_id = #{templateId}
</select> </select>
<select id="isCheckThreeIsAudit" resultType="java.lang.Integer">
select count(1) from pj_evaluate_details where evaluate_id = #{evaluateId} and post_id = #{deptId} and
check_three = '1' and sub_evaluate_id = #{templateId}
</select>
<select id="getPjEvaluateResultDeptId" resultType="java.lang.String"> <select id="getPjEvaluateResultDeptId" resultType="java.lang.String">
select dept_id from pj_evaluate_result where evaluate_id =#{evaluateId} group by select dept_id from pj_evaluate_result where evaluate_id =#{evaluateId} group by
dept_id dept_id

View File

@ -66,7 +66,7 @@
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' where pu.IS_ACTIVE = '1' and pu.if_active = '1' and evaluate_pass_word is null
<if test="bean.type == 'team'"> <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) and pu.LOGIN_NAME not in (select id_card from sys_user where status = '1' and id_card is not null)
</if> </if>

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,
pte.evaluate_time evaluateTime,
su.phone AS sendPhone, 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,
@ -205,6 +206,12 @@
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 left join sys_user su on su.id = pte.ev_user_id
<where> <where>
<if test="times!=null and times!=''">
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and DATE_FORMAT(pte.evaluate_time,'%Y-%m-%d') between #{startTime} and #{endTime}
</if>
</if>
<if test="operType == 1"> <if test="operType == 1">
AND poi1.user_id = #{evUserId} AND poi1.user_id = #{evUserId}
</if> </if>
@ -230,6 +237,7 @@
INSTR(pte.manager,#{keyWord}) > 0 INSTR(pte.manager,#{keyWord}) > 0
) )
</if> </if>
<if test="evStatus == 4"> <if test="evStatus == 4">
AND (pte.ev_status = '1' and (check_status=0 or check_status_two=0 )) AND (pte.ev_status = '1' and (check_status=0 or check_status_two=0 ))
</if> </if>
@ -254,6 +262,15 @@
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''"> <if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
AND DATE_FORMAT(pte.evaluate_time, '%Y-%m-%d') BETWEEN #{startDate} AND #{endDate} AND DATE_FORMAT(pte.evaluate_time, '%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
</if> </if>
<if test="subName!=null and subName!=''">
AND pte.sub_name=#{subName}
</if>
</where> </where>
</select> </select>
<!--查询班组评价全部分包商-->
<select id="getSupList" resultType="java.lang.String">
select distinct sub_name
from pt_team_exit
</select>
</mapper> </mapper>

View File

@ -149,7 +149,7 @@ function initTable() {
} }
function downloadFile(data) { function downloadFile(data) {
let fileUrl = data.pathName; let fileUrl = data.filePath;
// let fileUrl = '/2024/12/26/外包商对标打分统计表9月_20241226104522A025.xlsx'; // let fileUrl = '/2024/12/26/外包商对标打分统计表9月_20241226104522A025.xlsx';
//解析fileUrl获取文件名 //解析fileUrl获取文件名
let fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1); let fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);
@ -157,7 +157,7 @@ function initTable() {
if (fileUrl.indexOf("http") !== -1) { if (fileUrl.indexOf("http") !== -1) {
truePath = fileUrl; truePath = fileUrl;
} else { } else {
truePath = filePreviewPath + "/" + fileUrl; truePath = filePreviewPath + fileUrl;
} }
download(truePath, fileName); download(truePath, fileName);

View File

@ -4,11 +4,54 @@ $(function () {
layer = layui.layer; layer = layui.layer;
laydate = layui.laydate; laydate = layui.laydate;
table = layui.table; table = layui.table;
laydate.render({
elem: '#times'
//设置开始日期、日期日期的 input 选择器
//数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
, range: ['#times']
, rangeLinked: true
});
initSubList();
initTable(); initTable();
}); });
}); });
function initSubList(){
$.ajax({
url: `${ctxPath}` + '/backstage/teamEvaluate/getSupList',
type: 'POST',
data: JSON.stringify({
phone:133
}),
contentType: "application/json",
dataType: 'json',
success: function (result) {
console.log(result.code);
let options="";
if(result.code && result.code ===200){
let list=result.data;
if(list && list.length>0){
for (let i = 0; i <list.length ; i++) {
let options2="<option value='"+list[i]+"'>"+list[i]+"</option>";
options=options+options2;
}
}
$("#subName").append(options);
layui.form.render('select');
}
},
error: function (result) {
console.log(result)
}
});
}
function initTable() { function initTable() {
//渲染表格 //渲染表格
table.render({ table.render({
@ -36,6 +79,7 @@ function initTable() {
}, },
{field: 'manager', align: 'center', title: '项目经理'}, {field: 'manager', align: 'center', title: '项目经理'},
{field: 'sendPhone', align: 'center', title: '项目经理手机号'}, {field: 'sendPhone', align: 'center', title: '项目经理手机号'},
{field: 'evaluateTime', 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 => {
@ -99,6 +143,8 @@ function search(type) {
} else { } else {
$('#keyWord').val('') $('#keyWord').val('')
$('#evStatus').val('') $('#evStatus').val('')
$('#subName').val('')
$('#times').val('')
layui.form.render(); layui.form.render();
} }
table.reload('baseTable', { table.reload('baseTable', {
@ -109,6 +155,9 @@ function search(type) {
operType: 3, operType: 3,
keyWord: $("#keyWord").val(), keyWord: $("#keyWord").val(),
evStatus: $("#evStatus").val(), evStatus: $("#evStatus").val(),
subName: $("#subName").val(),
times: $("#times").val(),
} //设定异步数据接口的额外参数 } //设定异步数据接口的额外参数
}); });
} }

View File

@ -4,6 +4,9 @@ $(function () {
layer = layui.layer; layer = layui.layer;
laydate = layui.laydate; laydate = layui.laydate;
table = layui.table; table = layui.table;
initTable(); initTable();
}); });

View File

@ -78,6 +78,11 @@ function print() {
// 提交 // 提交
function submitApply(data) { function submitApply(data) {
let name=$("#name5").val();
if(name && name.length<20){
layer.msg('评价内容至少20字', {icon: 2});
return false;
}
let obj = {}; let obj = {};
obj.level = $('input[name="level"]:checked').val(); obj.level = $('input[name="level"]:checked').val();
obj.operType = 1; obj.operType = 1;

View File

@ -88,8 +88,12 @@ var Base64 = {
return t return t
} }
} }
//
var filePreviewPath = "http://36.33.26.201:21624/GsSubEvaluate/statics/";
var filePreviewPath = "http://36.33.26.201:21624/GsSubEvaluate/statics";
// var filePreviewPath = "http://127.0.0.1:1803/GsSubEvaluate/statics/";
// var filePreviewPath = "http://192.168.0.2:1803/GsSubEvaluate/statics/";
var filePreviewPathAll = "http://192.168.0.14:8012/onlinePreview?url="; var filePreviewPathAll = "http://192.168.0.14:8012/onlinePreview?url=";
@ -100,6 +104,7 @@ function filePreview(url) {
} else { } else {
path = filePreviewPath + url; path = filePreviewPath + url;
} }
console.log(path)
let time = encryptCBC(Math.floor(Date.now()).toString()) let time = encryptCBC(Math.floor(Date.now()).toString())
return filePreviewPathAll + encodeURIComponent(Base64.encode(path))+"&token="+time; return filePreviewPathAll + encodeURIComponent(Base64.encode(path))+"&token="+time;

View File

@ -76,35 +76,37 @@
elem: '#baseTable', elem: '#baseTable',
cols: finalCols, cols: finalCols,
data: JSON.parse(msg), // 使用从 API 获取的数据 data: JSON.parse(msg), // 使用从 API 获取的数据
//data: msg, // 使用从 API 获取的数据
loading: true, loading: true,
done: function (res) { done: function (res) {
tableLoading && layer.close(tableLoading); layer.close(tableLoading)
//对每一行取平均值 // console.log(res);
layui.each(res.data, function (i, itemData) { // tableLoading && layer.close(tableLoading);
let sum = 0; // //对每一行取平均值
let count = 0; // layui.each(res.data, function (i, itemData) {
layui.each(itemData, function (j, item) { // let sum = 0;
//LAY_INDEX,LAY_INDEX_INIT,LAY_NUMavgScoresubName不参与计算 // let count = 0;
if (j !== 'LAY_INDEX' && j !== 'LAY_INDEX_INIT' && j !== 'LAY_NUM' && j !== 'avgScore' && j !== 'subName') { // layui.each(itemData, function (j, item) {
sum += parseFloat(isEmpty(item) ? 0 : item); // //LAY_INDEX,LAY_INDEX_INIT,LAY_NUMavgScoresubName不参与计算
count++; // if (j !== 'LAY_INDEX' && j !== 'LAY_INDEX_INIT' && j !== 'LAY_NUM' && j !== 'avgScore' && j !== 'subName') {
} // sum += parseFloat(isEmpty(item) ? 0 : item);
}); // count++;
itemData.avgScore = (sum / count).toFixed(2); // }
}); // });
code++; // itemData.avgScore = (sum / count).toFixed(2);
if(code === 1){ // });
table.render({ // code++;
elem: '#baseTable', // if(code === 1){
cols: finalCols, // table.render({
data: res.data, // 使用从 API 获取的数据 // elem: '#baseTable',
//data: msg, // 使用从 API 获取的数据 // cols: finalCols,
loading: true, // data: res.data, // 使用从 API 获取的数据
}); // //data: msg, // 使用从 API 获取的数据
} // loading: true,
// });
// }
} }
} }
) )
; ;
table.on('tool(test)', function (obj) { table.on('tool(test)', function (obj) {

View File

@ -48,7 +48,7 @@
tableLoading = layer.load(2, { shade: [0.1, '#fff'] }); tableLoading = layer.load(2, { shade: [0.1, '#fff'] });
let deptId = getUrlParam('deptId'); let deptId = getUrlParam('deptId');
isCheckOneIsAudit(deptId); isCheckOneIsAudit(deptId);
// isCheckThreeIsAudit(deptId);
initTable(deptId); initTable(deptId);
form.on('submit(formDemo)', function (data) { form.on('submit(formDemo)', function (data) {
getTableData(); getTableData();
@ -70,6 +70,7 @@
}, },
success: function (res) { success: function (res) {
if (res.res == '1') { if (res.res == '1') {
isCheckThreeIsAudit(deptId);
$("#btnGroup").show(); $("#btnGroup").show();
$("#txtTip").hide(); $("#txtTip").hide();
} else { } else {
@ -82,7 +83,26 @@
} }
}) })
} }
function isCheckThreeIsAudit(deptId) {
$.ajax({
url: ctxPath + '/outsourcer/isCheckThreeIsAudit',
type: 'get',
data: {
templateId: getUrlParam('templateId'),
evaluateId: getUrlParam('evaluateId'),
deptId: deptId,
evaluateType: '3',
type: 'auditAll',
},
success: function (res) {
if (res.res == '1') {
$("#btnGroup").hide();
$("#txtTip").hide();
}
}
})
}
function initTable(deptId) { function initTable(deptId) {
getTitle(deptId); getTitle(deptId);
} }

View File

@ -69,6 +69,7 @@
}, },
success: function (res) { success: function (res) {
if (res.res == '1') { if (res.res == '1') {
isCheckThreeIsAudit(deptId);
$("#btnGroup").show(); $("#btnGroup").show();
$("#txtTip").hide(); $("#txtTip").hide();
} else { } else {
@ -81,6 +82,26 @@
} }
}) })
} }
function isCheckThreeIsAudit(deptId) {
$.ajax({
url: ctxPath + '/outsourcer/isCheckThreeIsAudit',
type: 'get',
data: {
templateId: getUrlParam('templateId'),
evaluateId: getUrlParam('evaluateId'),
deptId: deptId,
evaluateType: '3',
type: 'auditAll',
},
success: function (res) {
if (res.res == '1') {
$("#btnGroup").hide();
$("#txtTip").hide();
}
}
})
}
function initTable(deptId) { function initTable(deptId) {
getTitle(deptId); getTitle(deptId);
} }

View File

@ -33,6 +33,14 @@
<option value="2">已评价</option> <option value="2">已评价</option>
</select> </select>
</div> </div>
<div class="layui-inline">
<select class="layui-select" id="subName" name="subName">
<option value="">请选择所属外包商</option>
</select>
</div>
<div class="layui-inline">
<input type="text" name="times" id="times" placeholder="请选择评价时间" class="layui-input" readonly>
</div>
<input type="text" name="operType" id="operType" value="1" hidden> <input type="text" name="operType" id="operType" value="1" hidden>
<div class="layui-inline"> <div class="layui-inline">
<button id='searchBtn' class="layui-btn layui-btn-warm" title="过滤" type="button" <button id='searchBtn' class="layui-btn layui-btn-warm" title="过滤" type="button"

View File

@ -149,8 +149,8 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><span class="required_icon">*</span>5.安全质量(至少20字)</label> <label class="layui-form-label"><span class="required_icon">*</span>5.安全质量(至少20字)</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input class="layui-input" id="name5" name="name5" lay-verify="required" <input class="layui-input" id="name5" name="name5" lay-verify="required|isLength"
lay-affix="clear" autocomplete="off" maxlength="50"> lay-affix="clear" autocomplete="off" maxlength="80">
</div> </div>
</div> </div>
<button type="submit" id="formSubmit" class="layui-btn" lay-submit="" <button type="submit" id="formSubmit" class="layui-btn" lay-submit=""