| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <base href="<%=basePath%>">
-
- <title>检验站-工作人员信息</title>
-
- <meta http-equiv="pragma" content="no-cache">
- <meta http-equiv="cache-control" content="no-cache">
- <meta http-equiv="expires" content="0">
- <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
- <meta http-equiv="description" content="This is my page">
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta http-equiv="X-UA-Compatible" content="IE=10"/>
- <link rel="stylesheet" type="text/css" href="css/easyui/themes/default/easyui.css">
- <link rel="stylesheet" type="text/css" href="css/easyui/themes/icon.css">
- <link rel="stylesheet" type="text/css" href="css/easyui/demo/demo.css">
- <script type="text/javascript" src="css/easyui/jquery.min.js"></script>
- <script type="text/javascript" src="css/easyui/jquery.easyui.min.js" charset="utf-8"></script>
- <script type="text/javascript" src="css/easyui/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>
- <link rel="stylesheet" type="text/css" href="css/common/hzbstyle.css">
- <script type="text/javascript">
- var state = false;
- function formatDatebox(value) {
- if (value == null || value == '') {
- return '';
- }
- var dt = parseToDate(value);//关键代码,将那个长字符串的日期值转换成正常的JS日期格式
- return dt.format("yyyy-MM-dd"); //这里用到一个javascript的Date类型的拓展方法,这个是自己添加的拓展方法,在后面的步骤3定义
- }
- /*带时间*/
- function formatDateBoxFull(value) {
- if (value == null || value == '') {
- return '';
- }
- var dt = parseToDate(value);
- return dt.format("yyyy-MM-dd hh:mm:ss");
- }
-
- </script>
- <script type="text/javascript">
- var i = 1;//第几页
- var sum;//总条数
- var totalpage;//总页数
- $(document).ready(function(){
- fLoadTable();
- fLoadData(1,10);
- });
- function fLoadTable(){
- $('#tt').datagrid({
- fit: true,//自动大小
- title: '',
- width: '100%',
- height: 580,
- toolbar: '#toolbar',
- fitColumns: true,
- singleSelect:false,
- loadMsg:'正在加载, 请稍等 …',
- nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取
- striped : true,//设置为true将交替显示行背景
- collapsible : false,//显示可折叠按钮
- singleSelect:true,//为true时只能选择单行
- fitColumns:true,//允许表格自动缩放,以适应父容器
- rownumbers:true,
- columns:[[
- {field:'name',align:'left',title:'姓名',width:'120px'},
- {field:'idNo',align:'left',title:'身份证号',width:'120px'},
- {field:'operatorNo',align:'left',title:'操作员编号',width:'120px'},
- {field:'operatorNo1',align:'left',title:'作业人员种类',width:'120px',formatter: function(value, row, index){
- return "车用气瓶检验";
-
- }},
- {field:'sex',align:'left',title:'性别',width:'120px',formatter: function(value, row, index){
- if(value==0){
- return "男";
- }else if(value==1){
- return "女";
- }else{
- return "未知";
- }
-
- }},
- {field:'licence',align:'left',title:'许可证号',width:'120px'},
- {field:'licenceOrg',align:'left',title:'发证机构',width:'120px'},
- {field:'licenceDate',align:'left',title:'发证时间',width:'120px',formatter: function(value, row, index){
- if(!value||value.replace(/(^\s*)|(\s*$)/g,"").length==0){
- return "未知";
- }else{
- if(value.length>9){
- return value.substring(0,10);
- }else{
- return value;
- }
- }
-
- }},
- {field:'validity',align:'left',title:'有效期',width:'120px',formatter: function(value, row, index){
- if(!value||value.replace(/(^\s*)|(\s*$)/g,"").length==0){
- return "未知";
- }else{
- if(value.length>9){
- return value.substring(0,10);
- }else{
- return value;
- }
- }
-
- }},
- {field:'profileno',align:'left',title:'档案编号',width:'120px'}
-
- ]]
- });
- }
- function show(message) {
- $.messager.show({
- title: '提示信息',
- msg: message,
- timeout: 2000,
- showType: 'slide'
- });
- }
- function fLoadData(page,rows){
- $.messager.progress({
- title: '请等待',
- msg: '正在加载数据...',
- text: '查询中.......'
- });
- $.ajax({
- type:"POST",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- url:"ajax/testingworkPersonInfo?page="+page+"&psize="+rows,
- success:function (data){
- $.messager.progress('close');
- var vData = $.parseJSON(data);
- sum = vData.total;
- if(sum==0){
- show("没有查询到相关信息!!!");
- }
- totalpage = Math.ceil(sum/rows);
- $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
- $('#pp').pagination({
- total:sum,
- pageList: [2,10,50,100],
- beforePageText: '第',//页数文本框前显示的汉字
- afterPageText: '页 共 {pages} 页',
- displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
- onSelectPage:function(pageNumber, pageSize){
- fLoadData(1,10);
- }
-
-
- });
- }
- });
-
-
- }
- </script>
- </head>
-
- <body>
- <!-- 查询结果:数据表格 -->
- <table id="tt" cellspacing="0" cellpadding="0" >
- </table>
- </body>
- </html>
|