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.
164 lines
6.1 KiB
164 lines
6.1 KiB
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title></title>
|
|
<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
|
|
<style>
|
|
dl dd {
|
|
text-align: left;
|
|
}
|
|
|
|
.layui-form {
|
|
width: 100%
|
|
}
|
|
|
|
#dataTime_1 {
|
|
width: 260px;
|
|
margin: 0 5px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div style="margin:0 auto;text-align: center;">
|
|
<form class="layui-form" style="float: right;width: 100%">
|
|
<div class="layui-input-inline">
|
|
<input type="text" class="layui-input" id="dataTime_1" placeholder="请选择查询的时间段">
|
|
</div>
|
|
<div class="layui-input-inline">
|
|
<span id="span_1" style="float: left;line-height: 40px;font-size: 22px;font-weight: bold;">值班人员统计数据</span>
|
|
</div>
|
|
<div style="float: right;margin-right: 20px;">
|
|
<button id="exportWord" type="button" class="layui-btn">导出</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div style="width: 90%;height: 500px;float: left;margin-left: 5%;">
|
|
<table id="DutyList" lay-filter="DutyList"></table>
|
|
</div>
|
|
<script src="../../js/jquery-2.1.3.min.js"></script>
|
|
<script src="../../js/jq_extend.js"></script>
|
|
<script type="text/javascript" src="../../layui/layui.js"></script>
|
|
<script src="../../js/echarts.min.js"></script>
|
|
<script>
|
|
var OrgId = JSON.parse(window.sessionStorage.getItem("userInfo")).OrgID;
|
|
//OrgId = "fbbb44bb458c4336a84e009df74c8598";
|
|
layui.use(['form', 'layer', 'table', 'laydate'], function () {
|
|
form = layui.form,
|
|
layer = layui.layer,
|
|
table = layui.table,
|
|
laydate = layui.laydate;
|
|
|
|
|
|
//获取当前日期
|
|
var myDate = new Date();
|
|
var nowY = myDate.getFullYear();
|
|
var nowM = myDate.getMonth() + 1;
|
|
var lastY = nowY;
|
|
var lastM = nowM + 1;
|
|
if (nowM == "12") {
|
|
lastY = nowY + 1;
|
|
lastM = "1";
|
|
}
|
|
laydate.render({
|
|
elem: '#dataTime_1',
|
|
type: 'month',
|
|
value: nowY + '-01 - ' + lastY + '-' + (lastM < 10 ? "0" + lastM : lastM),
|
|
isInitValue: true,
|
|
range: true,
|
|
done: function (value) {
|
|
if (value.indexOf(" - ") != -1) {
|
|
var STime = value.split(" - ")[0]
|
|
var ETime = value.split(" - ")[1];
|
|
work_obj.getVisitorReportDetails(STime, ETime);
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
var work_obj = {
|
|
selectYear: function (id) {
|
|
var getyear = new Date().getFullYear();
|
|
for (var i = getyear; i > (getyear - 5); i--) {
|
|
$(id).append("<option value = '" + i + "'>" + i + "</option>");
|
|
}
|
|
$(id).find("option[value='" + getyear + "']").attr("selected", true);
|
|
$(id).val(getyear);
|
|
form.render('select');
|
|
work_obj.getVisitorReportBar(getyear);
|
|
},
|
|
|
|
getVisitorReportDetails: function (STime, ETime) {
|
|
var iscontain = "";
|
|
$("input:checkbox[name='iscontain']:checked").each(function (i) {
|
|
iscontain = $(this).val();
|
|
});
|
|
table.render({
|
|
elem: '#DutyList',
|
|
url: '../../ashx/OaDutyManageHandler.ashx',
|
|
where: {
|
|
Action: 'getStaDutyHoliday',
|
|
orgId: OrgId,
|
|
STime: STime,
|
|
ETime: ETime
|
|
},
|
|
cellMinWidth: 95,
|
|
page: false,
|
|
limits: [10, 15, 20, 25],
|
|
limit: 15,
|
|
id: "DutyListTable",
|
|
cols: [[
|
|
{ field: 'EMP_NAME', title: '姓名', minWidth: 60, align: "center" },
|
|
{ field: 'WEEKDAYS', title: '工作日', minWidth: 60, align: "center" },
|
|
{ field: 'WEEKEND', title: '周末', minWidth: 60, align: "center" },
|
|
{ field: 'HOLIDAY', title: '节假日', minWidth: 60, align: "center" },
|
|
{
|
|
field: 'TOATLE', title: '总计', minWidth: 60, align: "center", templet: function (d) {
|
|
|
|
return Number(d.WEEKDAYS) + Number(d.WEEKEND) + Number(d.HOLIDAY);
|
|
|
|
}
|
|
}
|
|
|
|
]]
|
|
});
|
|
}
|
|
};
|
|
|
|
$("#exportWord").click(function () {
|
|
//load提交
|
|
var index = layer.msg('正在导出...请稍候', { icon: 16, time: false, shade: 0.2 });
|
|
var startDate = nowY + "-01";
|
|
var endDate = lastY + "-" + (lastM < 10 ? "0" + lastM : lastM);
|
|
var value = $("#dataTime_1").val();
|
|
if (value.indexOf(" - ") != -1) {
|
|
startDate = value.split(" - ")[0]
|
|
endDate = value.split(" - ")[1];
|
|
}
|
|
|
|
var data = {
|
|
Action: "htmlToWord",
|
|
OrgId: OrgId,
|
|
STime: startDate,
|
|
Etime: endDate,
|
|
random: new Date().getTime()
|
|
};
|
|
var url = "../../ashx/OaDutyManageHandler.ashx";
|
|
var method = "POST";
|
|
$.downLoadFile(url, data, method, false);
|
|
|
|
layer.close(index);
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
//初始化列表
|
|
work_obj.getVisitorReportDetails(nowY + '-01 ', lastY + '-' + (lastM < 10 ? "0" + lastM : lastM));
|
|
})
|
|
</script>
|
|
</body>
|
|
</html>
|