226 lines
7.5 KiB
Plaintext
226 lines
7.5 KiB
Plaintext
<%@ 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"%>
|
||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||
<!DOCTYPE html>
|
||
<!-- <html lang="zh-CN"> -->
|
||
<!-- BEGIN HEAD -->
|
||
|
||
<head>
|
||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||
<!-- 引用页头及CSS页-->
|
||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||
<style>
|
||
.table-hover>tbody>tr:hover {
|
||
cursor: pointer;
|
||
}
|
||
</style>
|
||
<script type="text/javascript">
|
||
var companyId;
|
||
var companyText;
|
||
var searchdate;
|
||
var refreshTable = function () {
|
||
$("#table").bootstrapTable('refresh');
|
||
console.log(yes);
|
||
};
|
||
$(function () {
|
||
$("#searchDay").datepicker({
|
||
language: 'zh-CN',
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
format: 'yyyy-mm-dd',
|
||
})
|
||
$("#searchDay").datepicker('setDate', new Date());
|
||
$("#table").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/timeEfficiency/clockinRecord/getCollection.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||
pageSize: 50, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order,
|
||
date: $('#searchDay').val()
|
||
}
|
||
},
|
||
sortName: 'name', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
showFooter: true,
|
||
onClickRow: function (row) {
|
||
companyId = row.id;
|
||
companyText = row.name;
|
||
searchdate = $('#searchDay').val();
|
||
$.ajax({
|
||
type: "get",
|
||
async: false, //同步请求
|
||
url: ext.contextPath + '/timeEfficiency/clockinRecord/showClockinRecordList.do', // 获取表格数据的url
|
||
data: {},
|
||
timeout: 1000,
|
||
success: function (dates) {
|
||
//alert(dates);
|
||
$("#contentDiv").html(dates);//要刷新的div
|
||
},
|
||
error: function () {
|
||
// alert("失败,请稍后再试!");
|
||
}
|
||
});
|
||
},
|
||
columns: [
|
||
{
|
||
field: 'img', // 返回json数据中的name
|
||
title: '名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
width: 120,
|
||
formatter: function (value, row, index) {
|
||
if (row.clockinCollection.imgPath == null) {
|
||
return '<img style="120px;height:120px;" src="<%=request.getContextPath()%>/IMG/imageError.png" />' +
|
||
row.name;
|
||
} else {
|
||
var path = row.clockinCollection.imgPath;
|
||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
|
||
//console.log(path);
|
||
return '<img style="120px;height:120px;" src="' + path + '" />' +
|
||
row.name;
|
||
}
|
||
return 'sdf';
|
||
|
||
},
|
||
footerFormatter: function (value) {
|
||
return "合计";
|
||
}
|
||
}, {
|
||
field: 'userTotalNum', // 返回json数据中的name
|
||
title: '总人数', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
formatter: function (value, row, index) {
|
||
return row.clockinCollection.userTotalNum;
|
||
},
|
||
footerFormatter: function (value) {
|
||
var count = 0;
|
||
for (var i in value) {
|
||
if (value[i].clockinCollection.userTotalNum != null) {
|
||
count += value[i].clockinCollection.userTotalNum;
|
||
}
|
||
}
|
||
return count
|
||
}
|
||
}, {
|
||
field: 'clockinNum', // 返回json数据中的name
|
||
title: '已打卡数', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
formatter: function (value, row, index) {
|
||
return row.clockinCollection.clockinNum;
|
||
},
|
||
footerFormatter: function (value) {
|
||
var count = 0;
|
||
for (var i in value) {
|
||
if (value[i].clockinCollection.clockinNum != null) {
|
||
count += value[i].clockinCollection.clockinNum;
|
||
}
|
||
}
|
||
return count
|
||
}
|
||
}, {
|
||
field: 'unclockinNum', // 返回json数据中的name
|
||
title: '未打卡数', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
formatter: function (value, row, index) {
|
||
return row.clockinCollection.unclockinNum;
|
||
},
|
||
footerFormatter: function (value) {
|
||
var count = 0;
|
||
for (var i in value) {
|
||
if (value[i].clockinCollection.unclockinNum != null) {
|
||
count += value[i].clockinCollection.unclockinNum;
|
||
}
|
||
}
|
||
return count
|
||
}
|
||
}, {
|
||
field: 'finishedPatrolRecordRate', // 返回json数据中的name
|
||
title: '打卡率', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
formatter: function (value, row, index) {
|
||
var valueNum
|
||
if(row.clockinCollection.userTotalNum<=0){
|
||
valueNum = 0.00;
|
||
}else {
|
||
valueNum = (row.clockinCollection.clockinNum / row.clockinCollection.userTotalNum * 100).toFixed(2);
|
||
}
|
||
|
||
//console.log(valueNum);
|
||
return "<div class='progress progress-striped active'>"
|
||
+ "<div class='progress-bar progress-bar-success' role='progressbar' aria-valuemin='0' aria-valuemax='100' style='width:"
|
||
+ valueNum + "%'><span style='color:#000'>"
|
||
+ valueNum + "%<span></div> </div>";
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function () { //加载成功时执行
|
||
adjustBootstrapTableView("table");
|
||
},
|
||
onLoadError: function () { //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
|
||
})
|
||
|
||
});
|
||
</script>
|
||
|
||
</head>
|
||
|
||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||
<div class="wrapper">
|
||
<div class="content-wrapper">
|
||
<!-- Content Header (Page header) -->
|
||
<section class="content-header">
|
||
<h1 id="head_title"></h1>
|
||
<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="menu4SelectDiv"></div>
|
||
<div id="contentDiv">
|
||
<div class="input-group pull-right input-group-sm" style="margin-bottom: 10px;">
|
||
<div class="input-group date">
|
||
<div class="input-group-addon">
|
||
<i class="fa fa-calendar"></i>
|
||
</div>
|
||
<input type="text" class="form-control" id="searchDay" name="searchDay"
|
||
style="width: 150px;" placeholder="请选择" />
|
||
<div class="input-group-btn ">
|
||
<button type="button" class="btn btn-default" onclick="refreshTable();"><i
|
||
class="fa fa-search"></i> </button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<br />
|
||
<table id="table"></table>
|
||
</div>
|
||
</section>
|
||
<!-- /.content -->
|
||
</div>
|
||
</div>
|
||
</body>
|
||
|
||
</html> |