testingStationInfoCheck.jsp 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. String hiddenphone =(String)session.getAttribute("hiddenphone");
  6. %>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  8. <html>
  9. <head>
  10. <base href="<%=basePath%>">
  11. <title>检验站-站点信息查看</title>
  12. <meta http-equiv="pragma" content="no-cache">
  13. <meta http-equiv="cache-control" content="no-cache">
  14. <meta http-equiv="expires" content="0">
  15. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  16. <meta http-equiv="description" content="This is my page">
  17. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  18. <meta http-equiv="X-UA-Compatible" content="IE=10"/>
  19. <link rel="stylesheet" type="text/css" href="css/easyui/themes/default/easyui.css">
  20. <link rel="stylesheet" type="text/css" href="css/easyui/themes/icon.css">
  21. <link rel="stylesheet" type="text/css" href="css/easyui/demo/demo.css">
  22. <script type="text/javascript" src="css/easyui/jquery.min.js"></script>
  23. <script type="text/javascript" src="css/easyui/jquery.easyui.min.js" charset="utf-8"></script>
  24. <script type="text/javascript" src="css/easyui/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>
  25. <link rel="stylesheet" type="text/css" href="css/common/hzbstyle.css">
  26. <script type="text/javascript">
  27. var state = false;
  28. function formatDatebox(value) {
  29.     if (value == null || value == '') {
  30.         return '';
  31.     }
  32.     var dt = parseToDate(value);//关键代码,将那个长字符串的日期值转换成正常的JS日期格式
  33.     return dt.format("yyyy-MM-dd"); //这里用到一个javascript的Date类型的拓展方法,这个是自己添加的拓展方法,在后面的步骤3定义
  34. }
  35. /*带时间*/
  36. function formatDateBoxFull(value) {
  37.     if (value == null || value == '') {
  38.         return '';
  39.     }
  40.     var dt = parseToDate(value);
  41.     return dt.format("yyyy-MM-dd hh:mm:ss");
  42. }
  43. </script>
  44. <script type="text/javascript">
  45. var hiddenP='<%=hiddenphone %>';
  46. var i = 1;//第几页
  47. var sum;//总条数
  48. var totalpage;//总页数
  49. $(document).ready(function(){
  50. fLoadTable();
  51. fLoadData(1,10);
  52. });
  53. function fLoadTable(){
  54. $('#tt').datagrid({
  55. fit: true,//自动大小
  56. title: '本站信息查看',
  57. width: '100%',
  58. height: 580,
  59. toolbar: '#toolbar',
  60. fitColumns: true,
  61. loadMsg:'正在加载, 请稍等 …',
  62. nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取
  63. striped : true,//设置为true将交替显示行背景
  64. collapsible : true,//显示可折叠按钮
  65. fitColumns:true,//允许表格自动缩放,以适应父容器
  66. rownumbers:true,
  67. columns:[[
  68. {field:'id',title:'站点编号',width:'9%'},
  69. {field:'name',title:'站点名称',width:'15%'},
  70. {field:'licence',title:'充装许可证',width:'9%'},
  71. {field:'licenceDate1',title:'发证时间',width:'8%'},
  72. {field:'validity1',title:'有效期至',width:'8%'},
  73. {field:'manager',title:'负责人',width:'8%'},
  74. {field:'techManager',title:'技术负责人',width:'8%'},
  75. {field:'post',title:'邮编',width:'8%'},
  76. {field:'mobile',title:'手机',width:'8%'},
  77. {field:'phone',title:'座机',width:'8%'},
  78. {field:'fax',title:'传真',width:'8%'}
  79. ]]
  80. });
  81. if(hiddenP!="0"){
  82. $('#tt').datagrid('hideColumn','mobile');
  83. }
  84. }
  85. function show(message) {
  86. $.messager.show({
  87. title: '提示信息',
  88. msg: message,
  89. timeout: 2000,
  90. showType: 'slide'
  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/testingStationInfoCheck",
  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(1,10);
  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>