软测单独项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

524 lines
22 KiB

11 months ago
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>营区一体化综合管理平台</title>
<link href="../../layui/css/layui.css" rel="stylesheet" />
<link type="text/css" href="../../css/zhgl-style2.css" rel="stylesheet" />
<link href="../../css/jquery.easy_slides.css" rel="stylesheet" />
<link href="../../css/ztree/metro/ztree.css" rel="stylesheet" />
<link rel="stylesheet" href="../../css/newtheme/layuiextend.css" />
<style>
.slider_four_in_line {
width: 90%;
margin: 0 auto;
}
.layui-form-select dl {
background-color: #02203a;
color: #fff;
}
.ztree li a.curSelectedNode {
padding-top: 0px;
background-color: #00e9ff;
color: black;
height: 21px;
opacity: 0.8;
}
</style>
</head>
<body style="border: 1px solid #0c6f89;
padding: 20px;
box-sizing: border-box;
">
<div style=" position: absolute; top: 0; bottom: 0px; left: 0; width: 270px; min-height: 500px; border: 1px solid #0c6f89; border-radius: 4px; ">
<div style="width: 100%;height: calc(100% - 0px);overflow: auto">
<ul id="ztree" class="ztree"></ul>
</div>
</div>
<div class="layui-col-lg10 layui-col-md10 layui-col-xs10" style=" position: absolute; left: 290px; right: 0; top: 0; bottom: 0; z-index: 998; width: auto; overflow: hidden; overflow-y: auto; box-sizing: border-box; border: 1px solid #0c6f89; border-radius: 4px; padding: 20px; ">
<form class="layui-form" action="" style="width: 20%; position: absolute; z-index: 999; left: 29%; top:1%;">
<div class="layui-form-item">
<select class="layui-select" lay-filter="emp" id="Person_ID">
<option value="">请选择</option>
<!--<option value="18999083018">石贤忠</option>
<option value="18130812911">艾旭春</option>-->
</select>
</div>
</form>
<div class="zh-content" style="top:0px;">
<div class="zh-row1 clearfix">
<!-- 请假、用车统计 -->
<div class="zh-ryxx fr" style="width: calc(50% - 30px); margin-left: 15px; float:left;">
<div class="zh-tit" style="background: url(img/zh-icon5.png) left center no-repeat;">个人档案</div>
<div class="zh-con">
<div id="grda" style="width: 100%; height: 100%;">
<div style="height: 100%; width: 30%; float: left;">
<img id="empimg" src="../../images/imgPerDefaut.jpg" style="width: 100%; height: 100%; padding: 10%;" />
</div>
<div style=" height: 100%; width: 70%; float: left; line-height: 38px; font-size: 17px;">
<p style="text-align: center; font-size: xx-large;"><span class="usersName"></span></p>
<p>机构:<span class="orgName"></span></p>
<p>出生年月:<span class="birthday"></span></p>
<p>入职时间:<span class="enlisted_time"></span></p>
<p>电话:<span class="userMobile"></span></p>
<p>家庭住址:<span class="familyaddr"></span></p>
</div>
</div>
</div>
</div>
<!-- 个人最好成绩 -->
<div class="zh-ryxx fl" style="width: calc(50% - 30px); margin-left: 15px;">
<div class="zh-tit" style="background: url(img/zh-icon5.png) left center no-repeat;">个人最好成绩</div>
<div class="zh-con">
<div id="topscore" style="width: 100%; height: 100%;">
<div class="htmleaf-content" style="width: 100%; height: 100%;">
<div class="slider slider_four_in_line">
<div class="next_button"></div>
<div class="prev_button"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="zh-row1" style="height: calc(53.61% - 30px);">
<!--训练通过率统计图-->
<div class="zh-ryxx fr" style="width: calc(50% - 30px); margin-left: 15px; float:left;">
<div class="zh-tit" style="background: url(img/zh-icon5.png) left center no-repeat;">训练通过率统计图</div>
<div class="zh-con">
<div id="passrate" style="width: 100%; height: 100%;">
<div style="width: 100%;height: 30%;line-height: 4vh;font-size: 2vh;">
<p style="font-size: 2.5vh;">历史训练总次数<span class="rateall"></span></p>
<p>
体能训练总次数<span class="ratetineng"></span>
&nbsp;&nbsp;
技能训练总次数<span class="ratejineng"></span>
</p>
</div>
<div style="width: 100%;height: 70%;">
<div style="height: 100%;width: 50%;float: left;">
<div id="tineng" style="width: 100%;height: 80%;padding: 5% 10%;"></div>
<p style="text-align: center;">体能训练通过率</p>
</div>
<div style="height: 100%;width: 50%;float: left;">
<div id="jineng" style="width: 100%;height: 80%;padding: 5% 10%;"></div>
<p style="text-align: center;">技能训练通过率</p>
</div>
</div>
</div>
</div>
</div>
<!--近期训练成绩统计图-->
<div class="zh-ryxx fl" style="width: calc(50% - 30px); margin-left: 15px;">
<div class="zh-tit" style="background: url(img/zh-icon5.png) left center no-repeat;">近期训练成绩统计图</div>
<div class="zh-con">
<div id="timescore" style="width: 100%; height: 100%;"></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<script src="../../js/jquery-2.1.3.min.js"></script>
<script src="../../js/jquery.easy_slides.js"></script>
<script src="../../layui/layui.js"></script>
<script src="../../js/echarts.min.js"></script>
<script src="../../js/config.js"></script>
<script src="home.js"></script>
<script>
layui.config({
base: '../../js/'
}).use(['ztree', 'form', 'layer', 'table', 'laytpl', 'laydate', 'upload', 'element'], function () {
var form = layui.form,
layer = parent.layer === undefined ? layui.layer : top.layer,
laytpl = layui.laytpl,
table = layui.table,
upload = layui.upload,
laydate = layui.laydate,
element = layui.element;
var OrgId = JSON.parse(window.sessionStorage.getItem("userInfo")).OrgID;
var UID = JSON.parse(window.sessionStorage.getItem("userInfo")).UserCode;
var orgName = JSON.parse(window.sessionStorage.getItem("userInfo")).orgName;
var usersName = JSON.parse(window.sessionStorage.getItem("userInfo")).usersName;
var userMobile = JSON.parse(window.sessionStorage.getItem("userInfo")).userMobile;
//OrgId = "9668E5E778854EC3939246D6B6A9EFC1";
//orgName = "喀什消防支队";
//usersName = "喀什市消防支队";
//UID = "13579080336";
//userMobile = "12345678910";
var $zTree, OrgList = [];
var setting = {
view: {
selectedMulti: false
},
data: {
key: {
name: "NAME"
},
simpleData: {
enable: true,
type: "TYPE",
idKey: "ID",
pIdKey: "PID"
}
},
edit: {
enable: false
},
callback: {
onClick: function (e, treeId, treeNode) {
search(treeNode.ID, treeNode.TYPE);
}
}
};
//初始化树
$(function () {
$.ajax({
type: "post",
url: configData.url.zxUrl+"ashx/ZYSysEmpHandler.ashx",
data: { Action: "getOrgOnlyTree", OrgId: OrgId },
dataType: "json",
success: function (result) {
var zNodes = result.data;
if (zNodes.length > 0) {
for (var i in zNodes) {
OrgList.push(zNodes[i].ID);
}
}
$zTree = $.fn.zTree.init($("#ztree"), setting, zNodes);
}
});
});
//延迟展开根节点
setTimeout(function () {
var nodes = $zTree.getNodes();
for (var i = 0; i < nodes.length; i++) {
$zTree.expandNode($zTree.getNodes()[i], true, false, false);
}
}, 500);
//每次加载节点触发的方法
function onAsyncSuccess(event, treeId, treeNode, msg) {
//递归展开子节点
if (treeNode != undefined) {
expandNodes(treeNode.children, "ztree");
}
}
//递归展开子节点
function expandNodes(nodes, treeId) {
if (!nodes) return;
var zTree = $.fn.zTree.getZTreeObj(treeId);
for (var i = 0, l = nodes.length; i < l; i++) {
zTree.expandNode(nodes[i], true, false, false);
if (nodes[i].isParent && nodes[i].zAsync) {
expandNodes(nodes[i].children, treeId);
}
}
}
function search(treeid, type) {
OrgId = treeid;
getOrgEmpGroupSelectByOrgId(OrgId);
}
//人员信息
function personInfo() {
var data = [];
$.post(configData.url.zxUrl+"ashx/ZYSysEmpHandler.ashx", {
Action: "GetEmpByUID",
UID: UID,
random: new Date().getTime()//随机参数
}, function (res) {
if (res.code == 1) {
data = res.data[0];
if (data.PHOTO != "") {
$("#empimg").attr("src", "http://xzcamp.xfzn365.com/" + data.PHOTO)
} else {
$("#empimg").attr("src", "http://xzcamp.xfzn365.com/images/imgPerDefaut.jpg" )
}
$(".usersName").html(data.EMP_NAME);
$(".orgName").html(data.ORG_NAME);
$(".birthday").html(data.BIRTHDAY);
$(".enlisted_time").html(data.ENLISTED_TIME);
$(".userMobile").html(data.EMP_MOBILE);
$(".familyaddr").html(data.FAMILYADDR);
} else {
}
}, "JSON");
}
//历史成绩通过率
function passRate() {
var rateall = 0, ratetinengall = 0, ratejinengall = 0, ratetinengpass = 0, ratejinengpass = 0;
$.post(configData.url.zxUrl+"ashx/ZYTScoreHandler.ashx", {
Action: "GetPassRate",
UID: UID,
random: new Date().getTime()//随机参数
}, function (res) {
if (res.code == 1) {
var num = res.data;
num.forEach(function (val) {
if (val.RATENUMNAME == "1_体能训练") { //及格
rateall += Number(val.RATENUM);
ratetinengall += Number(val.RATENUM);
ratetinengpass = Number(val.RATENUM);
} else if (val.RATENUMNAME == "0_体能训练") {
rateall += Number(val.RATENUM);
ratetinengall += Number(val.RATENUM);
} else if (val.RATENUMNAME == "1_技能训练") {
rateall += Number(val.RATENUM);
ratejinengall += Number(val.RATENUM);
ratejinengpass = Number(val.RATENUM);
} else if (val.RATENUMNAME == "0_技能能训练") {
rateall += Number(val.RATENUM);
ratejinengall += Number(val.RATENUM);
}
});
//
$(".rateall").html(rateall);
$(".ratetineng").html(ratetinengall);
$(".ratejineng").html(ratejinengall);
var r1 = ratetinengall != 0 ? Math.round(ratetinengpass / ratetinengall * 10000)/100 : 0;
var r2 = ratejinengall != 0 ? Math.round(ratejinengall / ratejinengall * 10000) / 100 : 0;
option_tinneg.title.text = "{a|" + r1 + "}{c|%}";
option_tinneg.series[0].data[0].value = r1;
option_tinneg.series[0].data[1].value = 100 - r1;
myCharttineng.setOption(option_tinneg);
option_jinneg.title.text = "{a|" + r2 + "}{c|%}";
option_jinneg.series[0].data[0].value = r2;
option_jinneg.series[0].data[1].value = 100 - r2;
myChartjineng.setOption(option_jinneg);
} else {
$(".rateall").html(0);
$(".ratetineng").html(0);
$(".ratejineng").html(0);
option_tinneg.title.text = "{a|0}{c|%}";
option_tinneg.series[0].data[0].value = 0;
option_tinneg.series[0].data[1].value = 100 - 0;
myCharttineng.setOption(option_tinneg);
option_jinneg.title.text = "{a|" + 0 + "}{c|%}";
option_jinneg.series[0].data[0].value = 0;
option_jinneg.series[0].data[1].value = 100 - 0;
myChartjineng.setOption(option_jinneg);
}
}, "JSON");
}
//近期成绩统计图
function timeScore() {
$.ajax({
type: "post",
url: configData.url.zxUrl+"ashx/ZYTScoreHandler.ashx",
async: false,
data: {
Action: "timeScoreSubject", UID: UID, random: new Date().getTime()
},
dataType: "json",
success: function (res) {
if (res.code == 1) {
option_time.legend.data = [];
option_time.series = [];
myCharttime.setOption(option_time, true);
var num = res.data;
num.forEach(function (val) {
$.ajax({
type: "post",
url: configData.url.zxUrl+"ashx/ZYTScoreHandler.ashx",
async: false,
data: {
Action: "timeScore", UID: UID, subjectid: val.SUBJECTID, random: new Date().getTime()
},
dataType: "json",
success: function (res) {
var name = "", datapush = [];;
if (res.code == 1) {
var data = res.data;
data.forEach(function (valscore) {
if (name == "") {
name = valscore.SUBJECTNAME
}
datapush.push(valscore.ACHIEVEMENT);
});
var obj = { name: name, type: 'line', data: datapush };
option_time.legend.data.push(name);
option_time.series.push(obj);
myCharttime.setOption(option_time, true);
} else {
}
}
})
})
} else {
}
}
})
};
//个人最好成绩
function GetBestScore() {
var rateall = 0, ratetinengall = 0, ratejinengall = 0, ratetinengpass = 0, ratejinengpass = 0;
$.post(configData.url.zxUrl+"ashx/ZYTScoreHandler.ashx", {
Action: "GetBestScore",
UID: UID,
random: new Date().getTime()//随机参数
}, function (res) {
var besthtml = "";
if (res.code == 1) {
$(".slider_four_in_line").html("");
var num = res.data;
num.forEach(function (val) {
besthtml += '<div style=" line-height: 6vh; font-size: 14px;float: left;">';
besthtml += ' <p>科目:<span>' + val.SUBJECTNAME + '</span></p>';
besthtml += ' <p>成绩:<span>' + val.RESULT + '</span ></p > ';
besthtml += ' <p>分数:<span>' + val.ACHIEVEMENT + '</span></p>';
besthtml += ' <p>日期:<span>' + val.TRAINIGDATE + '</span></p>';
besthtml += '</div>';
});
besthtml += '<div class="next_button"></div>';
besthtml += '<div class="prev_button"></div>';
//
$(".slider_four_in_line").html(besthtml);
var shownum = 6;
if (num.length < 6) {
shownum = num.length;
}
$('.slider_four_in_line').EasySlides({
'autoplay': false,
'show': shownum
})
} else {
}
}, "JSON");
}
function getOrgEmpGroupSelectByOrgId(orgId) {
$.ajax({//获取机构人员
type: "post",
url: configData.url.zxUrl+"ashx/ZYSysEmpHandler.ashx",
data: { Action: "getOrgEmpGroupSelectByOrgId", OrgId: orgId },
dataType: "json",
async: false,
success: function (result) {
var personStr = "";
var orgArr = [];
personStr += "<option value=''>--请选择--</option>";;
result.data.forEach(function (obj, index, arr) {
if (obj.PID == OrgId && (obj.TYPE == "org" || obj.TYPE == "dept")) {
personStr += "<optgroup label=\"" + obj.NAME + "\">";
var pid = obj.ID;
result.data.forEach(function (obj2) {
if(obj2.TYPE == "emp" && obj2.PID == pid) {
if (orgArr.indexOf(obj2.ID) == -1) {
orgArr.push(obj2.ID);
personStr += "<option value='" + obj2.ID + "'>" + obj2.NAME + "</option>";
}
}
})
personStr += "</optgroup>";
}
else {
if (orgArr.indexOf(obj.ID) == -1) {
orgArr.push(obj.ID);
personStr += "<option value='" + obj.ID + "'>" + obj.NAME + "</option>";
}
}
})
//if (obj.PID == OrgId && (obj.TYPE == "org" || obj.TYPE == "dept") ) {
// var pid = obj.ID;
// personStr += "<optgroup label=\"" + obj.NAME + "\">";
// result.data.forEach(function (obj2) {
// if ((obj2.TYPE == "org" || obj2.TYPE == "dept") && obj2.PID == pid) {
// var pid2 = obj2.ID;
// personStr += "<optgroup label=\"" + obj2.NAME + "\">";
// result.data.forEach(function (obj3) {
// if (pid2 == obj3.PID) {
// personStr += "<option value='" + obj3.ID + "'>" + obj3.NAME + "</option>";
// }
// })
// } else {
// if (obj2.TYPE ="emp" && pid == obj2.PID) {
// personStr += "<option value='" + obj2.ID + "'>" + obj2.NAME + "</option>";
// }
// }
// })
// personStr += "</optgroup>";
//}
//else
//{
// personStr += "<option value='" + obj.ID + "'>" + obj.NAME + "</option>";
//}
$("#Person_ID").html(personStr);
form.render('select');
}
});
}
personInfo();
passRate();
timeScore();
GetBestScore();
getOrgEmpGroupSelectByOrgId(OrgId);
form.on('select(emp)', function (data) {
console.log(1);
UID = data.value;
personInfo();
passRate();
timeScore();
GetBestScore();
});
})
</script>