修改系统bug
This commit is contained in:
parent
58b08f45f7
commit
2ff2574729
|
|
@ -1,10 +1,13 @@
|
|||
package com.bonus.gs.sub.evaluate.evaluate.beans;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author xliu
|
||||
* @date 2024/11/15 18:49
|
||||
* 班组评价-实体类
|
||||
*/
|
||||
@Data
|
||||
public class TeamEvaluateBean {
|
||||
|
||||
private Integer id;
|
||||
|
|
@ -28,6 +31,18 @@ public class TeamEvaluateBean {
|
|||
private String subName;
|
||||
/**项目Id*/
|
||||
private Integer proId;
|
||||
|
||||
private String supName;
|
||||
/**
|
||||
* 创建史
|
||||
*/
|
||||
private String times;
|
||||
|
||||
private String startTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
|
||||
/**项目名称*/
|
||||
private String proName;
|
||||
/**项目经理*/
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class EvalSummaryController extends BaseController<EvaluateBean> {
|
|||
// 返回文件路径
|
||||
String pathname = targetFile.getAbsolutePath();
|
||||
ar.setSucceedMsg("文件上传成功");
|
||||
int result = service.addEvalSummary(pathname, date, evaluateTitle,evaluateDept);
|
||||
int result = service.addEvalSummary(fileName, date, evaluateTitle,evaluateDept);
|
||||
ar.setSucceed(result);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
|
|
|
|||
|
|
@ -406,7 +406,17 @@ public class OutsourcerEvaluateController extends BaseController<EvaluateSubBean
|
|||
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
|
||||
|
|
|
|||
|
|
@ -129,6 +129,13 @@ public class TeamEvaluateController extends BaseController<TeamEvaluateBean> {
|
|||
return service.notification(bean);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getSupList", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes getSupList(@RequestBody TeamEvaluateBean bean) {
|
||||
return service.getSupList(bean);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下载
|
||||
*
|
||||
|
|
|
|||
|
|
@ -142,6 +142,10 @@ public interface OutsourcerEvaluateDao {
|
|||
|
||||
int isCheckTwoIsAudit(EvaluateDataBean o);
|
||||
|
||||
int isCheckThreeIsAudit(EvaluateDataBean o);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 重新
|
||||
* @param o
|
||||
|
|
|
|||
|
|
@ -57,4 +57,11 @@ public interface TeamEvaluateDao {
|
|||
* @return List<TeamEvaluateBean>
|
||||
*/
|
||||
List<TeamEvaluateBean> getTeamEvaluateList(TeamEvaluateBean o);
|
||||
|
||||
/**
|
||||
* 查询班组里面分包商
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<String> getSupList(TeamEvaluateBean bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,4 +74,6 @@ public interface OutsourcerEvaluateService {
|
|||
AjaxRes isCheckOneIsAudit(EvaluateDataBean o);
|
||||
|
||||
AjaxRes isCheckTwoIsAudit(EvaluateDataBean o);
|
||||
|
||||
AjaxRes isCheckThreeIsAudit(EvaluateDataBean o);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.manager.utils.AjaxRes;
|
||||
import com.bonus.gs.sub.evaluate.manager.utils.UserUtil;
|
||||
import com.sun.java.browser.plugin2.DOM;
|
||||
import lombok.val;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.aspectj.weaver.loadtime.Aj;
|
||||
|
|
@ -17,6 +18,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.Array;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
|
@ -1349,12 +1351,38 @@ public class OutsourcerEvaluateServiceImpl implements OutsourcerEvaluateService
|
|||
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 childParams = JSONArray.toJSON(childDataList).toString();
|
||||
ar.setSucceed(resParams, childParams);
|
||||
return ar;
|
||||
}
|
||||
|
||||
public static boolean isNumeric(String str) {
|
||||
return str.matches("-?\\d+(\\.\\d+)?");
|
||||
}
|
||||
@Override
|
||||
public AjaxRes isCheckOneIsAudit(EvaluateDataBean o) {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
|
|
@ -1378,4 +1406,16 @@ public class OutsourcerEvaluateServiceImpl implements OutsourcerEvaluateService
|
|||
}
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ public class PersonServiceImpl implements PersonService {
|
|||
dao.updateOldUser(list);
|
||||
ar.setSucceed(GlobalConst.SAVE_SUCCEED);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
ar.setFailMsg("添加失败");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,4 +65,11 @@ public interface TeamEvaluateService {
|
|||
* @return List<TeamEvaluateBean>
|
||||
*/
|
||||
List<TeamEvaluateBean> getTeamEvaluateList(TeamEvaluateBean o);
|
||||
|
||||
/**
|
||||
* 查询全部分包商数据
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
AjaxRes getSupList(TeamEvaluateBean bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.dao.TeamEvaluateDao;
|
||||
import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes;
|
||||
import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst;
|
||||
import com.bonus.gs.sub.evaluate.manager.utils.KtySmsUtil;
|
||||
import com.bonus.gs.sub.evaluate.manager.utils.UserUtil;
|
||||
import com.bonus.gs.sub.evaluate.manager.utils.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.session.Session;
|
||||
|
|
@ -26,6 +24,7 @@ import java.util.List;
|
|||
* @description:班组评价
|
||||
*/
|
||||
@Service(value = "TeamEvaluateService")
|
||||
@Slf4j
|
||||
public class TeamEvaluateServiceImpl implements TeamEvaluateService {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -85,8 +84,7 @@ public class TeamEvaluateServiceImpl implements TeamEvaluateService {
|
|||
phoneArray = new String[]{phones};
|
||||
}
|
||||
KtySmsUtil ktySmsUtil = new KtySmsUtil();
|
||||
String content = "【甘肃教育培训系统提醒您】您有一个已退场的班组未进行评价,请抓紧评价!";
|
||||
|
||||
String content = "【甘肃分包评价系统】您有一个已退场的班组未进行评价,请抓紧评价!";
|
||||
boolean allSentSuccessfully = true;
|
||||
for (String phone : phoneArray) {
|
||||
String msg = ktySmsUtil.setPhoneMsg(phone.trim(), content);
|
||||
|
|
@ -135,6 +133,10 @@ public class TeamEvaluateServiceImpl implements TeamEvaluateService {
|
|||
*/
|
||||
@Override
|
||||
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())));
|
||||
if ("5".equals(UserUtil.getLoginUser().getRoleId()) || Arrays.asList(UserUtil.getLoginUser().getRoleId().split(",")).contains("5")) {
|
||||
o.setRoleId("5");
|
||||
|
|
@ -147,4 +149,20 @@ public class TeamEvaluateServiceImpl implements TeamEvaluateService {
|
|||
}
|
||||
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("请求失败");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
package com.bonus.gs.sub.evaluate.manager.config;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
|
|
@ -13,6 +17,9 @@ import com.bonus.gs.sub.evaluate.manager.table.PageTableArgumentResolver;
|
|||
@Configuration
|
||||
public class WebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
@Value("${upload.dir}")
|
||||
private String filesPath;
|
||||
|
||||
/**
|
||||
* 跨域支持
|
||||
*
|
||||
|
|
@ -48,8 +55,10 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||
*/
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.gs.sub.evaluate.manager.utils;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
|
@ -90,6 +91,32 @@ public class AjaxRes implements Serializable {
|
|||
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)
|
||||
{
|
||||
this.setCode(0);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ spring.http.multipart.maxRequestSize=10Mb
|
|||
token.expire.seconds=7200
|
||||
spring.servlet.multipart.enabled=true
|
||||
|
||||
#upload.dir=/data/upload
|
||||
upload.dir=D:/upload
|
||||
|
||||
user.password=admin
|
||||
upload.dir=/home/gswbs/upload
|
||||
#upload.dir=D:/upload
|
||||
user.password=Bonus@admin123
|
||||
|
|
|
|||
|
|
@ -768,6 +768,7 @@
|
|||
select count(1) from pj_evaluate_details where evaluate_id = #{evaluateId} and post_id = #{deptId} and
|
||||
check_one = '1' and sub_evaluate_id = #{templateId}
|
||||
</select>
|
||||
|
||||
<select id="getEvaluateSubInfo" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.EvaluateDataBean">
|
||||
select
|
||||
pes.sub_id as subId,
|
||||
|
|
@ -791,10 +792,14 @@
|
|||
pes.sub_id
|
||||
</select>
|
||||
<select id="isCheckTwoIsAudit" resultType="java.lang.Integer">
|
||||
|
||||
select count(1) from pj_evaluate_details where evaluate_id = #{evaluateId} and post_id = #{deptId} and
|
||||
check_two = '1' and sub_evaluate_id = #{templateId}
|
||||
</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 dept_id from pj_evaluate_result where evaluate_id =#{evaluateId} group by
|
||||
dept_id
|
||||
|
|
|
|||
|
|
@ -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_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'
|
||||
where pu.IS_ACTIVE = '1' and pu.if_active = '1' and evaluate_pass_word is null
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@
|
|||
pte.sub_name AS subName,
|
||||
pte.pro_name AS proName,
|
||||
pte.manager,
|
||||
pte.evaluate_time evaluateTime,
|
||||
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,
|
||||
|
|
@ -205,6 +206,12 @@
|
|||
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="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">
|
||||
AND poi1.user_id = #{evUserId}
|
||||
</if>
|
||||
|
|
@ -230,6 +237,7 @@
|
|||
INSTR(pte.manager,#{keyWord}) > 0
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="evStatus == 4">
|
||||
AND (pte.ev_status = '1' and (check_status=0 or check_status_two=0 ))
|
||||
</if>
|
||||
|
|
@ -254,6 +262,15 @@
|
|||
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
||||
AND DATE_FORMAT(pte.evaluate_time, '%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
|
||||
</if>
|
||||
<if test="subName!=null and subName!=''">
|
||||
AND pte.sub_name=#{subName}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<!--查询班组评价全部分包商-->
|
||||
<select id="getSupList" resultType="java.lang.String">
|
||||
select distinct sub_name
|
||||
from pt_team_exit
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ function initTable() {
|
|||
}
|
||||
|
||||
function downloadFile(data) {
|
||||
let fileUrl = data.pathName;
|
||||
let fileUrl = data.filePath;
|
||||
// let fileUrl = '/2024/12/26/外包商对标打分统计表9月_20241226104522A025.xlsx';
|
||||
//解析fileUrl获取文件名
|
||||
let fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);
|
||||
|
|
@ -157,7 +157,7 @@ function initTable() {
|
|||
if (fileUrl.indexOf("http") !== -1) {
|
||||
truePath = fileUrl;
|
||||
} else {
|
||||
truePath = filePreviewPath + "/" + fileUrl;
|
||||
truePath = filePreviewPath + fileUrl;
|
||||
}
|
||||
download(truePath, fileName);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,54 @@ $(function () {
|
|||
layer = layui.layer;
|
||||
laydate = layui.laydate;
|
||||
table = layui.table;
|
||||
laydate.render({
|
||||
elem: '#times'
|
||||
//设置开始日期、日期日期的 input 选择器
|
||||
//数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
||||
, range: ['#times']
|
||||
, rangeLinked: true
|
||||
});
|
||||
initSubList();
|
||||
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() {
|
||||
//渲染表格
|
||||
table.render({
|
||||
|
|
@ -36,6 +79,7 @@ function initTable() {
|
|||
},
|
||||
{field: 'manager', align: 'center', title: '项目经理'},
|
||||
{field: 'sendPhone', align: 'center', title: '项目经理手机号'},
|
||||
{field: 'evaluateTime', align: 'center', title: '评价时间'},
|
||||
{field: 'level', align: 'center', title: '评价结果'}
|
||||
, {
|
||||
fixed: 'right', width: 180, title: '操作', align: 'center', templet: d => {
|
||||
|
|
@ -99,6 +143,8 @@ function search(type) {
|
|||
} else {
|
||||
$('#keyWord').val('')
|
||||
$('#evStatus').val('')
|
||||
$('#subName').val('')
|
||||
$('#times').val('')
|
||||
layui.form.render();
|
||||
}
|
||||
table.reload('baseTable', {
|
||||
|
|
@ -109,6 +155,9 @@ function search(type) {
|
|||
operType: 3,
|
||||
keyWord: $("#keyWord").val(),
|
||||
evStatus: $("#evStatus").val(),
|
||||
subName: $("#subName").val(),
|
||||
times: $("#times").val(),
|
||||
|
||||
} //设定异步数据接口的额外参数
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ $(function () {
|
|||
layer = layui.layer;
|
||||
laydate = layui.laydate;
|
||||
table = layui.table;
|
||||
|
||||
|
||||
|
||||
initTable();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -78,6 +78,11 @@ function print() {
|
|||
|
||||
// 提交
|
||||
function submitApply(data) {
|
||||
let name=$("#name5").val();
|
||||
if(name && name.length<20){
|
||||
layer.msg('评价内容至少20字', {icon: 2});
|
||||
return false;
|
||||
}
|
||||
let obj = {};
|
||||
obj.level = $('input[name="level"]:checked').val();
|
||||
obj.operType = 1;
|
||||
|
|
|
|||
|
|
@ -88,8 +88,12 @@ var Base64 = {
|
|||
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=";
|
||||
|
||||
|
|
@ -100,6 +104,7 @@ function filePreview(url) {
|
|||
} else {
|
||||
path = filePreviewPath + url;
|
||||
}
|
||||
console.log(path)
|
||||
let time = encryptCBC(Math.floor(Date.now()).toString())
|
||||
return filePreviewPathAll + encodeURIComponent(Base64.encode(path))+"&token="+time;
|
||||
|
||||
|
|
|
|||
|
|
@ -76,35 +76,37 @@
|
|||
elem: '#baseTable',
|
||||
cols: finalCols,
|
||||
data: JSON.parse(msg), // 使用从 API 获取的数据
|
||||
//data: msg, // 使用从 API 获取的数据
|
||||
loading: true,
|
||||
done: function (res) {
|
||||
tableLoading && layer.close(tableLoading);
|
||||
//对每一行取平均值
|
||||
layui.each(res.data, function (i, itemData) {
|
||||
let sum = 0;
|
||||
let count = 0;
|
||||
layui.each(itemData, function (j, item) {
|
||||
//LAY_INDEX,LAY_INDEX_INIT,LAY_NUM,avgScore,subName不参与计算
|
||||
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++;
|
||||
if(code === 1){
|
||||
table.render({
|
||||
elem: '#baseTable',
|
||||
cols: finalCols,
|
||||
data: res.data, // 使用从 API 获取的数据
|
||||
//data: msg, // 使用从 API 获取的数据
|
||||
loading: true,
|
||||
});
|
||||
}
|
||||
layer.close(tableLoading)
|
||||
// console.log(res);
|
||||
// tableLoading && layer.close(tableLoading);
|
||||
// //对每一行取平均值
|
||||
// layui.each(res.data, function (i, itemData) {
|
||||
// let sum = 0;
|
||||
// let count = 0;
|
||||
// layui.each(itemData, function (j, item) {
|
||||
// //LAY_INDEX,LAY_INDEX_INIT,LAY_NUM,avgScore,subName不参与计算
|
||||
// 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++;
|
||||
// if(code === 1){
|
||||
// table.render({
|
||||
// elem: '#baseTable',
|
||||
// cols: finalCols,
|
||||
// data: res.data, // 使用从 API 获取的数据
|
||||
// //data: msg, // 使用从 API 获取的数据
|
||||
// loading: true,
|
||||
// });
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
)
|
||||
;
|
||||
table.on('tool(test)', function (obj) {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
tableLoading = layer.load(2, { shade: [0.1, '#fff'] });
|
||||
let deptId = getUrlParam('deptId');
|
||||
isCheckOneIsAudit(deptId);
|
||||
|
||||
// isCheckThreeIsAudit(deptId);
|
||||
initTable(deptId);
|
||||
form.on('submit(formDemo)', function (data) {
|
||||
getTableData();
|
||||
|
|
@ -70,6 +70,7 @@
|
|||
},
|
||||
success: function (res) {
|
||||
if (res.res == '1') {
|
||||
isCheckThreeIsAudit(deptId);
|
||||
$("#btnGroup").show();
|
||||
$("#txtTip").hide();
|
||||
} 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) {
|
||||
getTitle(deptId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@
|
|||
},
|
||||
success: function (res) {
|
||||
if (res.res == '1') {
|
||||
isCheckThreeIsAudit(deptId);
|
||||
$("#btnGroup").show();
|
||||
$("#txtTip").hide();
|
||||
} 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) {
|
||||
getTitle(deptId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,14 @@
|
|||
<option value="2">已评价</option>
|
||||
</select>
|
||||
</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>
|
||||
<div class="layui-inline">
|
||||
<button id='searchBtn' class="layui-btn layui-btn-warm" title="过滤" type="button"
|
||||
|
|
|
|||
|
|
@ -149,8 +149,8 @@
|
|||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required_icon">*</span>5.安全质量(至少20字)</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" id="name5" name="name5" lay-verify="required"
|
||||
lay-affix="clear" autocomplete="off" maxlength="50">
|
||||
<input class="layui-input" id="name5" name="name5" lay-verify="required|isLength"
|
||||
lay-affix="clear" autocomplete="off" maxlength="80">
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" id="formSubmit" class="layui-btn" lay-submit=""
|
||||
|
|
|
|||
Loading…
Reference in New Issue