软测单独项目
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.

357 lines
16 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" />
<style>
.slider_four_in_line {
width: 90%;
margin: 0 auto;
}
</style>
</head>
<body>
<form class="layui-form" action="" style="width: 20%; position: absolute; z-index: 999; left: 29%; top:4%;">
<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>
</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="personalGrade.js"></script>
<script>
layui.use(['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";
//人员信息
function personInfo() {
var data = [];
$.post("../../ashx/SysEmpHandler.ashx", {
Action: "GetEmpByUID",
UID: UID,
random: new Date().getTime()//随机参数
}, function (res) {
if (res.code == 1) {
data = res.data;
if (data.PHOTO != "") {
$("#empimg").attr("src", data.PHOTO)
}
$(".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("../../ashx/TScoreHandler.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: "../../ashx/TScoreHandler.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: "../../ashx/TScoreHandler.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("../../ashx/TScoreHandler.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: 17px;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);
$('.slider_four_in_line').EasySlides({
'autoplay': false,
'show': 6
})
} else {
}
}, "JSON");
}
personInfo();
passRate();
timeScore();
GetBestScore();
$.ajax({//获取机构人员
type: "post",
url: "../../ashx/SysEmpHandler.ashx",
data: { Action: "getOrgEmpGroupSelectByOrgId", OrgId: OrgId },
dataType: "json",
async: false,
success: function (result) {
var personStr = "";
result.data.forEach(function (obj, index, arr) {
if (obj.pid == "0") {
var pid = obj.id;
var pname = obj.name;
personStr += "<optgroup label=\"" + pname + "\">";
result.data.forEach(function (obj2, index2, arr2) {
if (pid == obj2.pid) {
personStr += "<option value='" + obj2.id + "'>" + obj2.name + "</option>";
}
})
personStr += "</optgroup>";
}
});
$("#Person_ID").append(personStr);
form.render('select');
}
});
form.on('select(emp)', function (data) {
UID = data.value;
personInfo();
passRate();
timeScore();
GetBestScore();
});
})
</script>