testingworkPersonInfo.jsp 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%
  3. String path = request.getContextPath();
  4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  5. %>
  6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  7. <html>
  8. <head>
  9. <base href="<%=basePath%>">
  10. <title>检验站-工作人员信息</title>
  11. <meta http-equiv="pragma" content="no-cache">
  12. <meta http-equiv="cache-control" content="no-cache">
  13. <meta http-equiv="expires" content="0">
  14. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  15. <meta http-equiv="description" content="This is my page">
  16. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  17. <meta http-equiv="X-UA-Compatible" content="IE=10"/>
  18. <link rel="stylesheet" type="text/css" href="css/easyui/themes/default/easyui.css">
  19. <link rel="stylesheet" type="text/css" href="css/easyui/themes/icon.css">
  20. <link rel="stylesheet" type="text/css" href="css/easyui/demo/demo.css">
  21. <script type="text/javascript" src="css/easyui/jquery.min.js"></script>
  22. <script type="text/javascript" src="css/easyui/jquery.easyui.min.js" charset="utf-8"></script>
  23. <script type="text/javascript" src="css/easyui/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>
  24. <link rel="stylesheet" type="text/css" href="css/common/hzbstyle.css">
  25. <script type="text/javascript">
  26. var state = false;
  27. function formatDatebox(value) {
  28.     if (value == null || value == '') {
  29.         return '';
  30.     }
  31.     var dt = parseToDate(value);//关键代码,将那个长字符串的日期值转换成正常的JS日期格式
  32.     return dt.format("yyyy-MM-dd"); //这里用到一个javascript的Date类型的拓展方法,这个是自己添加的拓展方法,在后面的步骤3定义
  33. }
  34. /*带时间*/
  35. function formatDateBoxFull(value) {
  36.     if (value == null || value == '') {
  37.         return '';
  38.     }
  39.     var dt = parseToDate(value);
  40.     return dt.format("yyyy-MM-dd hh:mm:ss");
  41. }
  42. </script>
  43. <script type="text/javascript">
  44. var i = 1;//第几页
  45. var sum;//总条数
  46. var totalpage;//总页数
  47. $(document).ready(function(){
  48. fLoadTable();
  49. fLoadData(1,10);
  50. });
  51. function fLoadTable(){
  52. $('#tt').datagrid({
  53. fit: true,//自动大小
  54. title: '',
  55. width: '100%',
  56. height: 580,
  57. toolbar: '#toolbar',
  58. fitColumns: true,
  59. singleSelect:false,
  60. loadMsg:'正在加载, 请稍等 …',
  61. nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取
  62. striped : true,//设置为true将交替显示行背景
  63. collapsible : false,//显示可折叠按钮
  64. singleSelect:true,//为true时只能选择单行
  65. fitColumns:true,//允许表格自动缩放,以适应父容器
  66. rownumbers:true,
  67. columns:[[
  68. {field:'name',align:'left',title:'姓名',width:'120px'},
  69. {field:'idNo',align:'left',title:'身份证号',width:'120px'},
  70. {field:'operatorNo',align:'left',title:'操作员编号',width:'120px'},
  71. {field:'operatorNo1',align:'left',title:'作业人员种类',width:'120px',formatter: function(value, row, index){
  72. return "车用气瓶检验";
  73. }},
  74. {field:'sex',align:'left',title:'性别',width:'120px',formatter: function(value, row, index){
  75. if(value==0){
  76. return "男";
  77. }else if(value==1){
  78. return "女";
  79. }else{
  80. return "未知";
  81. }
  82. }},
  83. {field:'licence',align:'left',title:'许可证号',width:'120px'},
  84. {field:'licenceOrg',align:'left',title:'发证机构',width:'120px'},
  85. {field:'licenceDate',align:'left',title:'发证时间',width:'120px',formatter: function(value, row, index){
  86. if(!value||value.replace(/(^\s*)|(\s*$)/g,"").length==0){
  87. return "未知";
  88. }else{
  89. if(value.length>9){
  90. return value.substring(0,10);
  91. }else{
  92. return value;
  93. }
  94. }
  95. }},
  96. {field:'validity',align:'left',title:'有效期',width:'120px',formatter: function(value, row, index){
  97. if(!value||value.replace(/(^\s*)|(\s*$)/g,"").length==0){
  98. return "未知";
  99. }else{
  100. if(value.length>9){
  101. return value.substring(0,10);
  102. }else{
  103. return value;
  104. }
  105. }
  106. }},
  107. {field:'profileno',align:'left',title:'档案编号',width:'120px'}
  108. ]]
  109. });
  110. }
  111. function show(message) {
  112. $.messager.show({
  113. title: '提示信息',
  114. msg: message,
  115. timeout: 2000,
  116. showType: 'slide'
  117. });
  118. }
  119. function fLoadData(page,rows){
  120. $.messager.progress({
  121. title: '请等待',
  122. msg: '正在加载数据...',
  123. text: '查询中.......'
  124. });
  125. $.ajax({
  126. type:"POST",
  127. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  128. url:"ajax/testingworkPersonInfo?page="+page+"&psize="+rows,
  129. success:function (data){
  130. $.messager.progress('close');
  131. var vData = $.parseJSON(data);
  132. sum = vData.total;
  133. if(sum==0){
  134. show("没有查询到相关信息!!!");
  135. }
  136. totalpage = Math.ceil(sum/rows);
  137. $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
  138. $('#pp').pagination({
  139. total:sum,
  140. pageList: [2,10,50,100],
  141. beforePageText: '第',//页数文本框前显示的汉字
  142. afterPageText: '页 共 {pages} 页',
  143. displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
  144. onSelectPage:function(pageNumber, pageSize){
  145. fLoadData(1,10);
  146. }
  147. });
  148. }
  149. });
  150. }
  151. </script>
  152. </head>
  153. <body>
  154. <!-- 查询结果:数据表格 -->
  155. <table id="tt" cellspacing="0" cellpadding="0" >
  156. </table>
  157. </body>
  158. </html>