checkSeeQuerytesting.jsp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ page import="com.runzhixing.tool.Util" %>
  3. <%@ page import="com.runzhixing.bean.CityPlace" %>
  4. <%@ page import="com.runzhixing.bean.CountryPlace" %>
  5. <%@ page import="com.runzhixing.bean.Station" %>
  6. <%@ page import="com.runzhixing.bean.AuthorityRegionPlace" %>
  7. <%@ page import="com.runzhixing.bean.User" %>
  8. <%@ page import="com.runzhixing.constant.Constant" %>
  9. <%
  10. String path = request.getContextPath();
  11. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  12. User user = (User)session.getAttribute(Constant.userMark);
  13. List<AuthorityRegionPlace> arplist = user.getPrivilegePlaces1();
  14. List<CityPlace> cplist = new ArrayList<CityPlace>();
  15. List<CountryPlace> cyplist = new ArrayList<CountryPlace>();
  16. List<Station> slist = new ArrayList<Station>();
  17. %>
  18. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  19. <html>
  20. <head>
  21. <base href="<%=basePath%>">
  22. <title>监检数据查询</title>
  23. <meta http-equiv="pragma" content="no-cache">
  24. <meta http-equiv="cache-control" content="no-cache">
  25. <meta http-equiv="expires" content="0">
  26. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  27. <meta http-equiv="description" content="This is my page">
  28. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  29. <meta http-equiv="X-UA-Compatible" content="IE=10"/>
  30. <link rel="stylesheet" type="text/css" href="css/easyui/themes/default/easyui.css">
  31. <link rel="stylesheet" type="text/css" href="css/easyui/themes/icon.css">
  32. <link rel="stylesheet" type="text/css" href="css/easyui/demo/demo.css">
  33. <script type="text/javascript" src="css/easyui/jquery.min.js"></script>
  34. <script type="text/javascript" src="css/easyui/jquery.easyui.min.js" charset="utf-8"></script>
  35. <script type="text/javascript" src="css/easyui/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>
  36. <link rel="stylesheet" type="text/css" href="css/common/hzbstyle.css">
  37. <script type="text/javascript" src="js/common/area.js"></script>
  38. <style type="text/css">
  39. a:HOVER{
  40. color: red;
  41. text-decoration: none;
  42. }
  43. a{
  44. color: #f08300;
  45. text-decoration: none;
  46. }
  47. </style>
  48. <script type="text/javascript" src="js/easyui/export.js"></script>
  49. <script type="text/javascript">
  50. var grid="";
  51. var exportString="";
  52. var i = 1;//第几页
  53. var sum;//总条数
  54. var pageSize =10;
  55. var totalpage;//总页数
  56. $(document).ready(function(){
  57. fLoadTable();
  58. pageSize = $('#pageSize').val();
  59. selectCountry();
  60. selsectCheckStation();
  61. //fLoadData(i,pageSize);
  62. });
  63. function fLoadTable(){
  64. grid=$('#tt').datagrid({
  65. fit: true,//自动大小
  66. title: '',
  67. width: '100%',
  68. height: 580,
  69. toolbar: '#toolbar',
  70. fitColumns: true,
  71. loadMsg:'正在加载, 请稍等 …',
  72. nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取
  73. striped : true,//设置为true将交替显示行背景
  74. collapsible : false,//显示可折叠按钮
  75. fitColumns:true,//允许表格自动缩放,以适应父容器
  76. rownumbers:true,
  77. pagination:true,//分页控件
  78. columns:[[
  79. {field:'carNo',align:'left',title:'所属车辆',width:'120px',formatter: function(value, row, index){
  80. return '<a href="machineDetail?carNo='+value+'&appType='+row.appType+'&operState='+row.operState+'&plateType='+row.plateType+'&carGuid='+row.carGuid+'" target="_blank">'+value+'</a>';
  81. }},
  82. {field:'plateTypeName',align:'left',title:'车牌类型',width:'120px'},
  83. {field:'cylinderNo',align:'left',title:'气瓶出厂编号',width:'160px',formatter: function(value, row, index){
  84. return '<a href="cylinderGuid?cylinderGuid='+row.cylinderGuid+'&carGuid='+row.carGuid+'&carNo='+row.carNo+'&districtNo='+row.installGuid+'" target="_blank">'+value+'</a>';
  85. }},
  86. {field:'cylinderTypeName',align:'left',title:'气瓶类型',width:'180px'},
  87. {field:'appTypeName',align:'left',title:'应用类型',width:60},
  88. {field:'productNo',align:'left',title:'厂家',width:30},
  89. {field:'productDate1',align:'left',title:'生产日期',width:'120px'},
  90. {field:'monitorStation',align:'left',title:'安装监检单位',width:'180px'},
  91. {field:'monitorDate1',align:'left',title:'安装监检日期',width:'160px'},
  92. {field:'monitorLicence',align:'left',title:'安装监检许可',width:'180px'},
  93. {field:'monitorCert',align:'left',title:'安装监检证书',width:'180px'},
  94. {field:'monitorWorkerName',align:'left',title:'安装监检人员',width:'120px'},
  95. {field:'editStation',align:'left',title:'登记/修改站点',width:'180px'},
  96. {field:'editOperator',align:'left',title:'登记/修改操作人员',width:'120px'},
  97. {field:'editOperTime1',align:'left',title:'录入时间',width:'160px'}
  98. ]]
  99. });
  100. }
  101. function show(message) {
  102. $.messager.show({
  103. title: '提示信息',
  104. msg: message,
  105. timeout: 2000,
  106. showType: 'slide'
  107. });
  108. }
  109. function fLoadData(page,rows){
  110. if(!$('#checkStation option:selected').text()){
  111. return false;
  112. }
  113. $.messager.progress({
  114. title: '请等待',
  115. msg: '正在加载数据...',
  116. text: '查询中.......'
  117. });
  118. $.ajax({
  119. type:"POST",
  120. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  121. data:$('#checkStationform').serialize(),
  122. url:"ajax/checkSeedataform?page="+page+"&psize="+rows,
  123. success:function (data){
  124. $.messager.progress('close');
  125. var vData = $.parseJSON(data);
  126. sum = vData.total;
  127. if(sum==0){
  128. show("没有查询到相关信息!!!");
  129. }
  130. totalpage = Math.ceil(sum/rows);
  131. $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
  132. var p = $('#tt').datagrid('getPager');
  133. $(p).pagination({
  134. pageList: [10,20,30,100,200,400],//可以设置每页记录条数的列表
  135. beforePageText: '第',//页数文本框前显示的汉字
  136. afterPageText: '页 共 {pages} 页',
  137. displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
  138. onSelectPage: function (pageNumber, pageSize) {
  139. fLoadData(pageNumber, pageSize);
  140. }
  141. });
  142. }
  143. });
  144. }
  145. function selectCountry(){
  146. var id=document.getElementById("city").value;
  147. var select = document.getElementById("country");
  148. for(var i=select.options.length-1;i>=0;i--) {
  149. select.options.remove(i);
  150. }
  151. $.ajax({
  152. type:"POST",
  153. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  154. url:"ajax/hiddenCity?cityId="+id,
  155. success:function (data){
  156. var obj=eval("(" + data + ")");
  157. $.each(obj.rows, function(i,item){
  158. select.options.add(new Option(item.name, item.id));
  159. });
  160. }
  161. });
  162. }
  163. function selectCountry1(){
  164. selectCountry();
  165. selsectCheckStation();
  166. //changeSize();
  167. }
  168. function changeSize(){
  169. fLoadData(1,10);
  170. }
  171. function selsectCheckStation(){
  172. var ii=1;
  173. var select = document.getElementById("checkStation");
  174. for(var i=select.options.length-1;i>=0;i--) {
  175. select.options.remove(i);
  176. }
  177. $.ajax({
  178. type:"POST",
  179. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  180. data:$('#checkStationform').serialize(),
  181. url:"ajax/hiddenspeStation?type=1",
  182. success:function (data){
  183. var obj=eval("(" + data + ")");
  184. var sum = obj.total;
  185. $.each(obj.rows, function(i,item){
  186. select.options.add(new Option(item.name, item.id));
  187. });
  188. }
  189. });
  190. }
  191. function selsectCheckStation1(){
  192. selsectCheckStation();
  193. //changeSize();
  194. }
  195. function expt1(){
  196. expt(grid);
  197. }
  198. function exptSingle(){
  199. if(!grid){
  200. alert("数据为空");
  201. return false;
  202. }else{
  203. expt(grid);
  204. }
  205. }
  206. function exptAll(){
  207. fLoadDataAll(1,5000);
  208. }
  209. function fLoadDataAll(page,rows){
  210. var startTime1 = $('#startTime').datebox('getValue');
  211. var endTime1 = $('#endTime').datebox('getValue');
  212. document.getElementById("pageNumber").innerText = i;
  213. document.getElementById("from").innerText = (page-1)*rows;
  214. document.getElementById("to").innerText = page*rows;
  215. $.messager.progress({
  216. title: '请等待',
  217. msg: '正在加载数据...',
  218. text: '查询中.......'
  219. });
  220. $.ajax({
  221. type:"POST",
  222. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  223. data:$('#checkStationform').serialize(),
  224. url:"ajax/testingdataQuery?page="+page+"&psize="+rows,
  225. success:function (data){
  226. $.messager.progress('close');
  227. var vData = $.parseJSON(data);
  228. sum = vData.total;
  229. if(sum==0){
  230. show("没有查询到相关信息!!!");
  231. }
  232. totalpage = Math.ceil(sum/rows);
  233. document.getElementById("total").innerText = sum;
  234. document.getElementById("totalpage").innerText = totalpage;
  235. var vData = $.parseJSON(data);
  236. $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
  237. var p = $('#tt').datagrid('getPager');
  238. $(p).pagination({
  239. pageList: [10,20,30,100,200,400],//可以设置每页记录条数的列表
  240. beforePageText: '第',//页数文本框前显示的汉字
  241. afterPageText: '页 共 {pages} 页',
  242. displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
  243. onSelectPage: function (pageNumber, pageSize) {
  244. fLoadData(pageNumber, pageSize);
  245. }
  246. });
  247. if(!grid){
  248. alert("数据为空");
  249. return false;
  250. }else{
  251. expt(grid);
  252. }
  253. }
  254. });
  255. }
  256. </script>
  257. </head>
  258. <body>
  259. <!-- 查询结果:数据表格 -->
  260. <table id="tt" cellspacing="0" cellpadding="0" >
  261. </table>
  262. <div id="toolbar" style="padding-top: 0px;height: auto;">
  263. <form id="checkStationform" action="ajax/checkStation" method="post">
  264. <table>
  265. <tr>
  266. <td>
  267. <span class="hzbspan">省:</span>
  268. </td>
  269. <td>
  270. <select name="province" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select">
  271. <%for(AuthorityRegionPlace arp:arplist){
  272. cplist = arp.getCityPlace();
  273. %>
  274. <option value="<%=arp.getId() %>">
  275. <%=arp.getName() %>
  276. </option>
  277. <%} %>
  278. </select>
  279. </td>
  280. <td>
  281. <span class="hzbspan">市:</span>
  282. </td>
  283. <td>
  284. <select name="city" id="city" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select" onchange="selectCountry1()">
  285. <%
  286. for(CityPlace cp:cplist){
  287. cyplist = cp.getSubPlaceList();
  288. %>
  289. <option value="<%=cp.getId() %>">
  290. <%=cp.getName() %>
  291. </option>
  292. <%} %>
  293. </select>
  294. </td>
  295. <td>
  296. <span class="hzbspan">县:</span>
  297. </td>
  298. <td>
  299. <select name="country" id = "country" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select" onchange="selsectCheckStation1();" >
  300. </select>
  301. </td>
  302. </tr>
  303. <tr>
  304. <td>
  305. <span class="hzbspan">监检单位:</span>
  306. </td>
  307. <td>
  308. <select name="checkStation" id = "checkStation" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select" >
  309. <option value="">全部</option>
  310. </select>
  311. </td>
  312. </tr>
  313. <tr><td>
  314. <span style="cursor: default"><span class="hzbspan">气瓶类型:</span></span></td>
  315. <td><select name="cylinderType" id="cylinderType" style="width: 150px;height: 34px;" class="hzbspan select" >
  316. <option value="-1" selected="selected">全部</option>
  317. <option value="0">其他</option>
  318. <option value="1">钢质气瓶</option>
  319. <option value="2">钢质内胆环向缠绕气瓶</option>
  320. <option value="3">铝合金内胆全缠绕气瓶</option>
  321. <option value="4">塑料内胆全缠绕气瓶</option>
  322. <option value="5">LNG液化天然气气瓶</option>
  323. </select>
  324. </td>
  325. <td><span style="cursor: default"><span class="hzbspan">监检开始时间:</span></span></td>
  326. <td><input type="text" name="startTime" id="startTime" class="easyui-datebox" style="width: 150px;height: 34px;" class="hzbspan" data-options="prompt:'- - - - - - -'">
  327. </td>
  328. <td><span style="cursor: default"><span class="hzbspan">监检结束时间:</span></span></td>
  329. <td><input type="text" name="endTime" id="endTime" class="easyui-datebox" style="width: 150px;height: 34px;" class="hzbspan" data-options="prompt:'- - - - - - -'">
  330. </td>
  331. <td>
  332. <span style="cursor: default"><span class="hzbspan">监检单位编号:</span></span></td>
  333. <td><input type="text" name="monitorStationNo" id="monitorStationNo" style="width: 150px;height: 34px;" class="hzbspan" placeholder="- - - - - - -">
  334. </td></tr><tr>
  335. <td>
  336. <span style="cursor: default"><span class="hzbspan">气瓶厂家编号:</span></span></td>
  337. <td><input type="text" name="productNo" id="productNo" style="width: 180px;height: 34px;" class="hzbspan" placeholder="- - - - - - -">
  338. </td>
  339. <td><span style="cursor: default"><span class="hzbspan">气瓶出厂编号:</span></span></td>
  340. <td><input type="text" name="cylinderNo" id="cylinderNo" style="width: 150px;height: 34px;" class="hzbspan" placeholder="- - - - - - -">
  341. </td>
  342. <td>
  343. <span style="cursor: default"><span class="hzbspan">车牌号:</span></span></td>
  344. <td><input type="text" name="carNo" id="carNo" style="width: 150px;height: 34px;" class="hzbspan" placeholder="- - - - - - -">
  345. </td>
  346. <td colspan="2">
  347. <a id="btninfosearch" onclick="changeSize();" class="easyui-linkbutton" icon="icon-search" href="javascript:void(0)" ><span class="hzbspan" style="color: #f08300;font-size: 16px;">查询</span></a>
  348. <a id="btninfosearch" onclick="exptSingle();" class="easyui-linkbutton" icon="icon-save" href="javascript:void(0)" ><span class="hzbspan" style="color: #f08300;font-size: 16px;">导出</span></a>
  349. </td>
  350. </tr></table>
  351. </form>
  352. </div>
  353. <div id="dialog2"></div>
  354. </body>
  355. </html>