548 lines
25 KiB
Plaintext
548 lines
25 KiB
Plaintext
<%--
|
||
Created by IntelliJ IDEA.
|
||
User: limo
|
||
Date: 2021/10/21
|
||
Time: 下午4:35
|
||
To change this template use File | Settings | File Templates.
|
||
--%>
|
||
<%--
|
||
Created by IntelliJ IDEA.
|
||
User: lihongye
|
||
Date: 2021/10/12
|
||
Time: 上午10:43
|
||
To change this template use File | Settings | File Templates.
|
||
--%>
|
||
<%@page import="com.sipai.entity.base.ServerObject" %>
|
||
<%@ page import="com.sipai.tools.SessionManager" %>
|
||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||
<%
|
||
SessionManager sessionManager = new SessionManager();
|
||
%>
|
||
|
||
<!DOCTYPE html>
|
||
<!-- <html lang="zh-CN"> -->
|
||
<!-- BEGIN HEAD -->
|
||
<head>
|
||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||
</title>
|
||
|
||
<style>
|
||
.t_tab {
|
||
display: inline-block;
|
||
margin: 0;
|
||
}
|
||
</style>
|
||
|
||
<!-- 引用页头及CSS页-->
|
||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||
<script type="text/javascript">
|
||
|
||
|
||
var dosearch = function () {
|
||
if ($('#deptId').val() !== undefined) {
|
||
$("#rhistorytable").bootstrapTable('refresh');
|
||
}
|
||
};
|
||
var oldUser = '';
|
||
var jobid = "";//职位id
|
||
var data99 = {
|
||
deptId: '',
|
||
periodYear: '',
|
||
periodType: '',
|
||
periodNo: '',
|
||
}
|
||
|
||
|
||
$(function () {
|
||
initTreeView();
|
||
/*
|
||
var key = setInterval(() => {
|
||
let newUser = $('#objUserId').val()
|
||
if (newUser.length > 0) {
|
||
if (oldUser != newUser) {
|
||
$("#rhistorytable").bootstrapTable('refresh');
|
||
oldUser = newUser
|
||
}
|
||
}
|
||
}, 500)
|
||
*/
|
||
|
||
// 考核年份
|
||
var selelct_4Data =
|
||
jQuery.parseJSON('[{"id":"2020","text":"2020"},{"id":"2021","text":"2021"},{"id":"2022","text":"2022"},{"id":"2023","text":"2023"},{"id":"2024","text":"2024"},{"id":"2025","text":"2025"},{"id":"2026","text":"2026"},{"id":"2027","text":"2027"},{"id":"2028","text":"2028"},{"id":"2029","text":"2029"},{"id":"2030","text":"2030"},{"id":"2031","text":"2031"},{"id":"2032","text":"2032"},{"id":"2033","text":"2033"},{"id":"2034","text":"2034"},{"id":"2035","text":"2035"},{"id":"2036","text":"2036"},{"id":"2037","text":"2037"},{"id":"2038","text":"2038"},{"id":"2039","text":"2039"},{"id":"2040","text":"2040"},{"id":"2041","text":"2041"},{"id":"2042","text":"2042"},{"id":"2043","text":"2043"},{"id":"2044","text":"2044"},{"id":"2045","text":"2045"},{"id":"2046","text":"2046"},{"id":"2047","text":"2047"},{"id":"2048","text":"2048"},{"id":"2049","text":"2049"},{"id":"2050","text":"2050"}]');
|
||
var selelct_4 = $("#periodYear").select2({
|
||
data: selelct_4Data,
|
||
cache: false,
|
||
placeholder: '全部',//默认文字提示
|
||
allowClear: true,//允许清空
|
||
escapeMarkup: function (markup) {
|
||
return markup;
|
||
}, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
formatResult: function formatRepo(repo) {
|
||
return repo.text;
|
||
}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo) {
|
||
return repo.text;
|
||
} // 函数用于呈现当前的选择
|
||
});
|
||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||
var date = new Date();
|
||
selelct_4.val(date.getFullYear()).trigger("change");
|
||
selelct_4.on("change", function (e) {
|
||
/* if ($('#deptId').val() !== undefined) {
|
||
$("#rhistorytable").bootstrapTable('refresh');
|
||
}*/
|
||
});
|
||
$("#objUserName").on("change", function (e) {
|
||
// if ($('#objUserName').val() != '') {
|
||
// $('.input_clear').show()
|
||
// } else {
|
||
// $('.input_clear').hide()
|
||
// }
|
||
/* if ($('#deptId').val() !== undefined) {
|
||
$("#rhistorytable").bootstrapTable('refresh');
|
||
}*/
|
||
});
|
||
|
||
var selelct_1Data = jQuery.parseJSON('${periodType}');
|
||
console.log(selelct_1Data)
|
||
var selelct_1 = $("#periodType").select2({
|
||
data: selelct_1Data,
|
||
cache: false,
|
||
placeholder: '全部',//默认文字提示
|
||
allowClear: true,//允许清空
|
||
escapeMarkup: function (markup) {
|
||
return markup;
|
||
}, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
formatResult: function formatRepo(repo) {
|
||
return repo.text;
|
||
}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo) {
|
||
return repo.text;
|
||
} // 函数用于呈现当前的选择
|
||
});
|
||
|
||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||
// selelct_1.val('').trigger("change");
|
||
selelct_1.on("change", function (e) {
|
||
/*if (data99.deptId !== undefined) {
|
||
$("#rhistorytable").bootstrapTable('refresh');
|
||
}*/
|
||
showPeriodNo();
|
||
});
|
||
selelct_1.val(selelct_1Data[0].id).trigger("change")
|
||
|
||
$("#rhistorytable").bootstrapTable({ // 对应table标签的id
|
||
|
||
url: ext.contextPath + '/kpi/KpiResult/getList.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||
pageSize: 50, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
// sortName: 'update_time', // 要排序的字段
|
||
// sortOrder: 'desc', // 排序规
|
||
|
||
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
<%--periodInstanceId: ${periodInstanceId}, 报错--%>
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order, // 排序规则
|
||
userInfoLike: $('#userInfoLike').val(),
|
||
jobType: $('#jobType').val(),
|
||
deptId: data99.deptId,
|
||
periodYear: $('#periodYear').val(),
|
||
periodType: $('#periodType').val(),
|
||
periodNo: $('#periodNo').val(),
|
||
isAllSearch: $('#isAllSearch').val()
|
||
}
|
||
},
|
||
columns: [
|
||
{
|
||
field: 'userName', // 返回json数据中的name
|
||
title: '姓名', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
}, {
|
||
field: 'userCardId', // 返回json数据中的name
|
||
title: '工号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
}, {
|
||
field: 'deptName', // 返回json数据中的name
|
||
title: '部门', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
}, {
|
||
field: 'jobName', // 返回json数据中的name
|
||
title: '岗位', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
}, {
|
||
field: 'jobLevelTypeName', // 返回json数据中的name
|
||
title: '岗位类型', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
}, {
|
||
field: 'periodYear', // 返回json数据中的name
|
||
title: '年份', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
}, {
|
||
field: 'periodTypeName', // 返回json数据中的name
|
||
title: '周期类型', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
}, {
|
||
field: 'resultPoint', // 返回json数据中的name
|
||
title: '考核结果', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
}, {
|
||
field: 'statusName', // 返回json数据中的name
|
||
title: '状态', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
}, {
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
|
||
formatter: function (value, row, index) {
|
||
|
||
var buts = "";
|
||
if (row.status === 5 && '${loginUserid}' === row.objUserId) {
|
||
buts += '<button class="btn btn-default btn-sm" onclick="detailFun(\'' + row.id + '\')" data-toggle="tooltip" title="确认"><i class="fa fa-add "></i><span> 确认</span></button>';
|
||
}
|
||
if (row.status === 3) {
|
||
buts += '<button class="btn btn-default btn-sm" onclick="showContent(\'' + row.id + '\',\'' + row.periodInstanceId + '\',\'' + row.applyBizId + '\',\'' + row.jobLevelType + '\')" data-toggle="tooltip" title="详情"><i class="fa fa-edit "></i><span> 详情</span></button>';
|
||
|
||
} else {
|
||
buts += '<button class="btn btn-default btn-sm" onclick="detailFun(\'' + row.id + '\')" data-toggle="tooltip" title="详情"><i class="fa fa-edit "></i><span> 详情</span></button>';
|
||
|
||
}
|
||
|
||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||
return buts;
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function () { //加载成功时执行
|
||
adjustBootstrapTableView("rhistorytable");
|
||
console.log('${loginUserid}', "1111111")
|
||
},
|
||
onLoadError: function () { //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
|
||
})
|
||
|
||
|
||
var selelct_5Data = jQuery.parseJSON('${jobType}');
|
||
var selelct_5 = $("#jobType").select2({
|
||
data: selelct_5Data,
|
||
cache: false,
|
||
placeholder: '全部',//默认文字提示
|
||
allowClear: true,//允许清空
|
||
escapeMarkup: function (markup) {
|
||
return markup;
|
||
}, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
formatResult: function formatRepo(repo) {
|
||
return repo.text;
|
||
}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo) {
|
||
return repo.text;
|
||
} // 函数用于呈现当前的选择
|
||
});
|
||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||
selelct_5.find('option:eq(0)').attr('selected', 'selected');
|
||
selelct_5.on("change", function (e) {
|
||
|
||
/* if (data99.deptId !== undefined) {
|
||
$("#rhistorytable").bootstrapTable('refresh');
|
||
}*/
|
||
|
||
|
||
});
|
||
selelct_5.val(selelct_5.val()).trigger("change");
|
||
|
||
|
||
});
|
||
|
||
|
||
//考核周期初始化
|
||
function showPeriodNo() {
|
||
var periodType = $("#periodType").val();
|
||
$.post(ext.contextPath + "/kpi/KpiPeriodInstance/periodNoList.do?periodType=" + periodType, function (data) {
|
||
|
||
if ($('#periodNo').data('select2')) {
|
||
$('#periodNo').select2('destroy').empty()
|
||
}
|
||
let temp = $("#periodNo").select2({
|
||
data: data,
|
||
placeholder: '全部',//默认文字提示
|
||
allowClear: true,//允许清空
|
||
escapeMarkup: function (markup) {
|
||
return markup;
|
||
}, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
formatResult: function formatRepo(repo) {
|
||
return repo.text;
|
||
}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo) {
|
||
return repo.text;
|
||
} // 函数用于呈现当前的选择
|
||
});
|
||
console.log(temp);
|
||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||
temp.on("change", function (e) {
|
||
/* if (data99.deptId !== undefined) {
|
||
$("#rhistorytable").bootstrapTable('refresh');
|
||
}*/
|
||
})
|
||
temp.val(data[0].id).trigger("change")
|
||
}, 'json');
|
||
}
|
||
|
||
|
||
//获取部门树
|
||
var initTreeView = function () {
|
||
$.post(ext.contextPath + '/user/getAllParentByUnitId.do?unitId=' + unitId, {ng: ''}, function (res) {
|
||
$('#companytree').treeview({
|
||
data: res,
|
||
showBorder: true,
|
||
levels: 3,
|
||
});
|
||
$('#companytree').on('nodeSelected', function (event, node) {
|
||
data99.deptId = node.id;
|
||
// TODO 判断选中的是否为部门?
|
||
|
||
|
||
// console.log(node)
|
||
});
|
||
}, 'json');
|
||
};
|
||
|
||
|
||
// 确认结果
|
||
function confirmFun(id) {
|
||
|
||
}
|
||
|
||
function showContent(id, periodInstanceId, applyBizId, jobType) {
|
||
window.location.href = ext.contextPath + "/kpi/KpiPlanStaffDetail/showList.do?status=1&planStaffId=" + id + '&periodInstanceId=' + periodInstanceId + '&applyBizId=' + applyBizId + '&jobType=' + jobType;
|
||
|
||
// $.get(ext.contextPath + "/kpi/KpiPlanStaffDetail/showList.do?status=1&planStaffId=" + id + '&periodInstanceId=' + periodInstanceId, function (data) {
|
||
// $("#subDiv").html(data);
|
||
// openModal('subModal');
|
||
// });
|
||
}
|
||
|
||
function jobList() {
|
||
|
||
// console.log("111111111111111111111"),
|
||
$("#jobId").select2({
|
||
|
||
ajax: {
|
||
url: ext.contextPath + "/user/getJsonJobByUser.do?userId=" + $('#objUserId').val(),
|
||
dataType: 'json',
|
||
type: "GET",
|
||
processResults: function (data) {
|
||
var obj = jQuery.parseJSON(data);
|
||
return {
|
||
results: obj,
|
||
text: 'name'
|
||
};
|
||
}
|
||
},
|
||
cache: false,
|
||
placeholder: '请选择',//默认文字提示
|
||
// allowClear: true,//允许清空
|
||
escapeMarkup: function (markup) {
|
||
return markup;
|
||
}, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
formatResult: function formatRepo(repo) {
|
||
return repo.text;
|
||
}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo) {
|
||
return repo.text;
|
||
} // 函数用于呈现当前的选择
|
||
});
|
||
}
|
||
|
||
// 考核详情列表页
|
||
function detailFun(id) {
|
||
|
||
$.get(ext.contextPath + "/kpi/KpiResult/resultDetail.do?planStaffId=" + id, function (data) {
|
||
$("#subDiv").html(data);
|
||
openModal('subModal');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
function showUser4OneSelectFun() {
|
||
// console.log("1111111"),
|
||
// console.log($('#objUserName').val()),
|
||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||
{formId: "addForm", hiddenId: "objUserId", textId: "objUserName"},
|
||
function (data) {
|
||
$("#user4SelectDiv").html(data);
|
||
openModal('user4SelectModal');
|
||
});
|
||
}
|
||
|
||
function clearInput() {
|
||
$('#objUserName').val('');
|
||
$('#objUserId').val('');
|
||
// $('.input_clear').hide();
|
||
$("#rhistorytable").bootstrapTable('refresh');
|
||
}
|
||
function getExcelData() {
|
||
if (data99.deptId !== undefined) {
|
||
$("#rhistorytable").bootstrapTable('refresh');
|
||
}
|
||
}
|
||
|
||
</script>
|
||
|
||
</head>
|
||
<body>
|
||
<div class="wrapper">
|
||
|
||
<div class="content-wrapper">
|
||
<!-- Content Header (Page header) -->
|
||
<section class="content-header">
|
||
<%-- <h1 id="head_title" class="ul_title t_tab"></h1>--%>
|
||
<h3>记录查询</h3>
|
||
<ol class="breadcrumb">
|
||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||
<!-- <li class="active">Here</li> -->
|
||
</ol>
|
||
</section>
|
||
<!-- Main content -->
|
||
<section class="content container-fluid">
|
||
<%-- <div id="mainAlertdiv"></div>--%>
|
||
<div id="subDiv"></div>
|
||
<div id="position4Select"></div>
|
||
<div id="user4SelectDiv"></div>
|
||
<div id="menu4SelectDiv"></div>
|
||
<div>
|
||
<div style="float: left;width: 20%">
|
||
|
||
|
||
<div class="form-group pull-left form-inline" style="padding:0;height: 30px;width:100%">
|
||
|
||
<div id="companytree" style="height:550px;overflow:auto; "></div>
|
||
</div>
|
||
</div>
|
||
<div style="float: right;width:80%">
|
||
|
||
<div class="form-group pull-right form-inline" style="padding:0;height: 30px;">
|
||
|
||
<form id="addForm">
|
||
<div class="input-group input-group-sm " style="width:300px;">
|
||
<label class="col-sm-4 control-label"
|
||
style="padding:0px 10px 0px 10px;line-height:30px;">考核对象:</label>
|
||
<input type="text" id="userInfoLike" name="userInfoLike" class="form-control"
|
||
placeholder="请输入姓名、工号或者岗位名称" style="width: 200px"/>
|
||
</div>
|
||
|
||
<div class="input-group input-group-sm " style="width:230px;">
|
||
<label class="col-sm-5 control-label"
|
||
style="padding:0px 10px 0px 10px;line-height:30px;">岗位类型:</label>
|
||
<div class="col-sm-7 control-label" style="padding: 0px;">
|
||
<select class="form-control select2 " id="jobType" name="jobType"
|
||
style="width:100px;"></select>
|
||
</div>
|
||
</div>
|
||
<div class="input-group input-group-sm " style="width:230px;">
|
||
<label class="col-sm-5 control-label"
|
||
style="padding:0px 10px 0px 10px;line-height:30px;">周期类型:</label>
|
||
<div class="col-sm-7 control-label" style="padding: 0px;">
|
||
<select class="form-control select2 " id="periodType" name="periodType"
|
||
style="width:100px;"></select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group input-group-sm" style="width:230px;">
|
||
<label class="col-sm-5 control-label"
|
||
style="padding:0px 10px 0px 10px;line-height:30px;">考核年份:</label>
|
||
<div class="col-sm-7">
|
||
<select class="form-control" id="periodYear" name="periodYear"
|
||
style="width: 100px"></select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group input-group-sm" style="width:230px;">
|
||
<label class="col-sm-5 control-label"
|
||
style="padding:0px 10px 0px 10px;line-height:30px;">考核周期:</label>
|
||
<div class="col-sm-7">
|
||
<select class="form-control" id="periodNo" name="periodNo"
|
||
style="width: 100px"></select>
|
||
</div>
|
||
</div>
|
||
<%if (sessionManager.havePermission(session,"kpi/KpiResult/searchAll.do")) {%>
|
||
<div class="form-group input-group-sm" style="width:290px;">
|
||
<label class="col-sm-5 control-label"
|
||
style="padding:0px 10px 0px 10px;line-height:30px;">是否查询全员:</label>
|
||
<div class="col-sm-7">
|
||
<select class="form-control" id="isAllSearch" name="isAllSearch"
|
||
style="width: 100px">
|
||
<option value="true">是</option>
|
||
<option value="false" selected="selected">否</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<%}%>
|
||
<div class="form-group input-group-sm" style="width:290px;">
|
||
|
||
<div class="col-sm-7">
|
||
<button type="button" class="control-label btn btn-primary"
|
||
style="padding:0px 10px 0px 10px;line-height:30px;" onclick="getExcelData()">查询
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<br>
|
||
<table id="rhistorytable"></table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</section>
|
||
<!-- /.content -->
|
||
</div>
|
||
|
||
</div>
|
||
</body>
|
||
<!-- 引入daterangepicker-->
|
||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||
charset="utf-8"></script>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||
charset="utf-8"></script>
|
||
|
||
</html>
|