ModifieddataQuerytesting.jsp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ page import="com.runzhixing.bean.CityPlace" %>
  3. <%@ page import="com.runzhixing.bean.CountryPlace" %>
  4. <%@ page import="com.runzhixing.bean.Station" %>
  5. <%@ page import="com.runzhixing.bean.AuthorityRegionPlace" %>
  6. <%@ page import="com.runzhixing.bean.User" %>
  7. <%@ page import="com.runzhixing.tool.Util" %>
  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. selectStation();
  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:'120px'},
  84. {field:'cylinderTypeName',align:'left',title:'气瓶类型',width:'160px'},
  85. {field:'appTypeName',align:'left',title:'应用类型',width:'120px'},
  86. {field:'productNo',align:'left',title:'生产厂家简称',width:'120px'},
  87. {field:'installTypeName',align:'left',title:'安装类型',width:'120px'},
  88. {field:'productDate1',align:'left',title:'生产年月',width:'120px'},
  89. {field:'installDate1',align:'left',title:'安装时间',width:'120px'},
  90. {field:'installStation',align:'left',title:'安装监检单位',width:'200px'},
  91. {field:'installLicence',align:'left',title:'安装监检许可',width:'120px'},
  92. {field:'installCert',align:'left',title:'安装合格证',width:'120px'},
  93. {field:'installLoc',align:'left',title:'安装位置',width:'120px'},
  94. {field:'installWorkerName',align:'left',title:'安装人',width:'120px'},
  95. {field:'editStation',align:'left',title:'登记/修改站点名',width:'180px'},
  96. {field:'editOperator',align:'left',title:'登记/修改人',width:'120px'},
  97. {field:'operStateName',align:'left',title:'状态',width:'120px'},
  98. {field:'editOperTime1',align:'left',title:'录入时间',width:'160px'}
  99. ]]
  100. });
  101. }
  102. function show(message) {
  103. $.messager.show({
  104. title: '提示信息',
  105. msg: message,
  106. timeout: 2000,
  107. showType: 'slide'
  108. });
  109. }
  110. function fLoadData(page,rows){
  111. if(!$('#station option:selected').text()){
  112. return false;
  113. }
  114. $.messager.progress({
  115. title: '请等待',
  116. msg: '正在加载数据...',
  117. text: '查询中.......'
  118. });
  119. $.ajax({
  120. type:"POST",
  121. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  122. data:$('#modifiedform').serialize(),
  123. url:"ajax/modifiedDataQuery?page="+page+"&psize="+rows,
  124. success:function (data){
  125. $.messager.progress('close');
  126. var vData = $.parseJSON(data);
  127. sum = vData.total;
  128. if(sum==0){
  129. show("没有查询到相关信息!!!");
  130. }
  131. totalpage = Math.ceil(sum/rows);
  132. $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
  133. var p = $('#tt').datagrid('getPager');
  134. $(p).pagination({
  135. pageList: [10,20,30,100,200,400],//可以设置每页记录条数的列表
  136. beforePageText: '第',//页数文本框前显示的汉字
  137. afterPageText: '页 共 {pages} 页',
  138. displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
  139. onSelectPage: function (pageNumber, pageSize) {
  140. fLoadData(pageNumber, pageSize);
  141. }
  142. });
  143. }
  144. });
  145. }
  146. function selectCountry(){
  147. var id=document.getElementById("city").value;
  148. var select = document.getElementById("country");
  149. for(var i=select.options.length-1;i>=0;i--) {
  150. select.options.remove(i);
  151. }
  152. $.ajax({
  153. type:"POST",
  154. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  155. url:"ajax/hiddenCity?cityId="+id,
  156. success:function (data){
  157. var obj=eval("(" + data + ")");
  158. $.each(obj.rows, function(i,item){
  159. select.options.add(new Option(item.name, item.id));
  160. });
  161. }
  162. });
  163. }
  164. function selectCountry1(){
  165. selectCountry();
  166. selectStation();
  167. }
  168. function changeSize(){
  169. fLoadData(1,10);
  170. }
  171. function selectStation(){
  172. var ii=1;
  173. var select = document.getElementById("station");
  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:$('#modifiedform').serialize(),
  181. url:"ajax/hiddenspeStation?type=3",
  182. success:function (data){
  183. var obj=eval("(" + data + ")");
  184. $.each(obj.rows, function(i,item){
  185. select.options.add(new Option(item.name, item.id));
  186. });
  187. }
  188. });
  189. }
  190. function selectStation1(){
  191. selectStation();
  192. //changeSize();
  193. }
  194. function expt1(){
  195. expt(grid);
  196. }
  197. function exptSingle(){
  198. if(!grid){
  199. alert("数据为空");
  200. return false;
  201. }else{
  202. expt(grid);
  203. }
  204. }
  205. function exptAll(){
  206. fLoadDataAll(1,5000);
  207. }
  208. function fLoadDataAll(page,rows){
  209. var startTime1 = $('#startTime').datebox('getValue');
  210. var endTime1 = $('#endTime').datebox('getValue');
  211. document.getElementById("pageNumber").innerText = i;
  212. document.getElementById("from").innerText = (page-1)*rows;
  213. document.getElementById("to").innerText = page*rows;
  214. $.messager.progress({
  215. title: '请等待',
  216. msg: '正在加载数据...',
  217. text: '查询中.......'
  218. });
  219. $.ajax({
  220. type:"POST",
  221. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  222. data:$('#modifiedform').serialize(),
  223. url:"ajax/modifiedDataQuery?page="+page+"&psize="+rows,
  224. success:function (data){
  225. $.messager.progress('close');
  226. var vData = $.parseJSON(data);
  227. sum = vData.total;
  228. totalpage = Math.ceil(sum/rows);
  229. document.getElementById("total").innerText = sum;
  230. document.getElementById("totalpage").innerText = totalpage;
  231. var vData = $.parseJSON(data);
  232. $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
  233. var p = $('#tt').datagrid('getPager');
  234. $(p).pagination({
  235. pageList: [10,20,30,100,200,400],//可以设置每页记录条数的列表
  236. beforePageText: '第',//页数文本框前显示的汉字
  237. afterPageText: '页 共 {pages} 页',
  238. displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
  239. onSelectPage: function (pageNumber, pageSize) {
  240. fLoadData(pageNumber, pageSize);
  241. }
  242. });
  243. if(!grid){
  244. alert("数据为空");
  245. return false;
  246. }else{
  247. expt(grid);
  248. }
  249. }
  250. });
  251. }
  252. </script>
  253. </head>
  254. <body>
  255. <!-- 查询结果:数据表格 -->
  256. <table id="tt" cellspacing="0" cellpadding="0" >
  257. </table>
  258. <div id="toolbar" style="padding-top: 0px;height: auto;">
  259. <form id="modifiedform" action="ajax/modified" method="post">
  260. <table>
  261. <tr>
  262. <td>
  263. <span class="hzbspan">省:</span>
  264. </td>
  265. <td>
  266. <select name="province" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select">
  267. <%for(AuthorityRegionPlace arp:arplist){
  268. cplist = arp.getCityPlace();
  269. %>
  270. <option value="<%=arp.getId() %>">
  271. <%=arp.getName() %>
  272. </option>
  273. <%} %>
  274. </select>
  275. </td>
  276. <td>
  277. <span class="hzbspan">市:</span>
  278. </td>
  279. <td>
  280. <select name="city" id="city" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select" onchange="selectCountry1()">
  281. <%
  282. for(CityPlace cp:cplist){
  283. cyplist = cp.getSubPlaceList();
  284. %>
  285. <option value="<%=cp.getId() %>">
  286. <%=cp.getName() %>
  287. </option>
  288. <%} %>
  289. </select>
  290. </td>
  291. <td>
  292. <span class="hzbspan">县:</span>
  293. </td>
  294. <td>
  295. <select name="country" id = "country" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select" onchange="selectStation1();" >
  296. </select>
  297. </td>
  298. </tr>
  299. <tr>
  300. <td>
  301. <span class="hzbspan">安装单位:</span>
  302. </td>
  303. <td>
  304. <select name="station" id = "station" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select" >
  305. <option value="">全部</option>
  306. </select>
  307. </td>
  308. </tr>
  309. <tr><td>
  310. <span style="cursor: default"><span class="hzbspan">气瓶厂家编号:</span></span></td>
  311. <td><input type="text" name="productNo" id="productNo" style="width: 150px;height: 34px;" class="hzbspan" placeholder="- - - - - - -">
  312. </td>
  313. <td><span style="cursor: default"><span class="hzbspan">改装开始时间:</span></span></td>
  314. <td><input type="text" name="refixStartTime" id="refixStartTime" class="easyui-datebox" style="width: 150px;height: 34px;" data-options="prompt:'- - - - - - -'">
  315. </td>
  316. <td>
  317. <span style="cursor: default"><span class="hzbspan">出厂开始时间:</span></span></td>
  318. <td><input type="text" name="startTime" id="startTime" class="easyui-datebox" style="width: 150px;height: 34px;" data-options="prompt:'- - - - - - -'">
  319. <input type="hidden" name="operState" value=""/>
  320. </td></tr><tr>
  321. <td>
  322. <span style="cursor: default"><span class="hzbspan">气瓶出厂编号:</span></span></td>
  323. <td><input type="text" name="cylinderNo" id="cylinderNo" style="width: 150px;height: 34px;" class="hzbspan" placeholder="- - - - - - -">
  324. </td>
  325. <td><span style="cursor: default"><span class="hzbspan">改装结束时间:</span></span></td>
  326. <td><input type="text" name="refixEndTime" id="refixEndTime" class="easyui-datebox" style="width: 150px;height: 34px;" class="hzbspan" data-options="prompt:'- - - - - - -'">
  327. </td>
  328. <td>
  329. <span style="cursor: default"><span class="hzbspan">出厂结束时间:</span></span></td>
  330. <td><input type="text" name="endTime" id="endTime" class="easyui-datebox" style="width: 150px;height: 34px;" data-options="prompt:'- - - - - - -'">
  331. </td></tr><tr><td>
  332. <span style="cursor: default"><span class="hzbspan">应 用 类 型:</span></span></td>
  333. <td><select name="appType" id="appType" style="width: 150px;height: 34px;" class="hzbspan select" >
  334. <option value="-1" selected="selected">全部</option>
  335. <option value="0">其他</option>
  336. <option value="1">出租</option>
  337. <option value="2">公交</option>
  338. <option value="3">私用</option>
  339. <option value="4">货运</option>
  340. <option value="5">客运</option>
  341. <option value="6">营转非</option>
  342. <option value="9">外地车</option>
  343. </select></td>
  344. <td>
  345. <span style="cursor: default"><span class="hzbspan">气瓶 类 型:</span></span></td>
  346. <td><select name="cylinderType" id="cylinderType" style="width: 150px;height: 34px;" class="hzbspan select" >
  347. <option value="-1" selected="selected">全部</option>
  348. <option value="0">其他</option>
  349. <option value="1">钢质气瓶</option>
  350. <option value="2">钢质内胆环向缠绕气瓶</option>
  351. <option value="3">铝合金内胆全缠绕气瓶</option>
  352. <option value="4">塑料内胆全缠绕气瓶</option>
  353. <option value="5">LNG液化天然气气瓶</option>
  354. </select></td>
  355. <td><span style="cursor: default"><span class="hzbspan">车 牌 号:</span></span></td>
  356. <td><input type="text" name="carNo" id="carNo" style="width: 150px;height: 34px;" class="hzbspan" placeholder="- - - - - - -">
  357. </td>
  358. <td colspan="2">
  359. <a id="btninfosearch" class="easyui-linkbutton" onclick="changeSize();" icon="icon-search" href="javascript:void(0)" style="margin-bottom: 5px;" ><span class="hzbspan" style="color: #f08300;font-size: 16px;">查询</span></a>
  360. <a id="btninfosearch" onclick="exptSingle();" class="easyui-linkbutton" icon="icon-save" href="javascript:void(0)" style="margin-bottom: 5px;" ><span class="hzbspan" style="color: #f08300;font-size: 16px;">导出</span></a>
  361. </td>
  362. </tr></table>
  363. </form>
  364. </div>
  365. <div id="dialog2"></div>
  366. </body>
  367. </html>