modifyworkPersonInfo.jsp 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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 show(message) {
  52. $.messager.show({
  53. title: '提示信息',
  54. msg: message,
  55. timeout: 2000,
  56. showType: 'slide'
  57. });
  58. }
  59. function fLoadTable(){
  60. $('#tt').datagrid({
  61. fit: true,//自动大小
  62. title: '工作人员信息',
  63. width: '100%',
  64. height: 580,
  65. toolbar: '#toolbar',
  66. fitColumns: true,
  67. loadMsg:'正在加载, 请稍等 …',
  68. nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取
  69. striped : true,//设置为true将交替显示行背景
  70. collapsible : true,//显示可折叠按钮
  71. fitColumns:true,//允许表格自动缩放,以适应父容器
  72. rownumbers:true,
  73. columns:[[
  74. {field:'name',title:'姓名',width:'12%'},
  75. {field:'idNo',title:'身份证号',width:'12%'},
  76. {field:'operatorNo',title:'操作员编号',width:'12%'},
  77. {field:'sex',title:'性别',width:'12%',formatter: function(value, row, index){
  78. if(value==0){
  79. return "男";
  80. }else if(value==1){
  81. return "女";
  82. }else{
  83. return "未知";
  84. }
  85. }},
  86. {field:'licence',title:'许可证号',width:'12%'},
  87. {field:'licenceOrg',title:'发证机构',width:'13%'},
  88. {field:'licenceDate',title:'发证时间',width:'13%'},
  89. {field:'validity',title:'有效期',width:'13%'}
  90. ]]
  91. });
  92. }
  93. function fLoadData(page,rows){
  94. $.messager.progress({
  95. title: '请等待',
  96. msg: '正在加载数据...',
  97. text: '查询中.......'
  98. });
  99. $.ajax({
  100. type:"POST",
  101. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  102. url:"ajax/modifyWorkPersonInfoCheck?page="+page+"&psize="+rows,
  103. success:function (data){
  104. $.messager.progress('close');
  105. var vData = $.parseJSON(data);
  106. sum = vData.total;
  107. if(sum==0){
  108. show("没有查询到相关信息!!!");
  109. }
  110. totalpage = Math.ceil(sum/rows);
  111. $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
  112. $('#pp').pagination({
  113. total:sum,
  114. pageList: [2,10,50,100],
  115. beforePageText: '第',//页数文本框前显示的汉字
  116. afterPageText: '页 共 {pages} 页',
  117. displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
  118. onSelectPage:function(pageNumber, pageSize){
  119. fLoadData();
  120. }
  121. });
  122. }
  123. });
  124. }
  125. </script>
  126. </head>
  127. <body>
  128. <!-- 查询结果:数据表格 -->
  129. <table id="tt" cellspacing="0" cellpadding="0" >
  130. </table>
  131. </body>
  132. </html>