ModifieddataQuery.jsp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  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. select.options.add(new Option("全部", ""));
  185. $.each(obj.rows, function(i,item){
  186. select.options.add(new Option(item.name, item.id));
  187. });
  188. }
  189. });
  190. }
  191. function selectStation1(){
  192. selectStation();
  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:$('#modifiedform').serialize(),
  224. url:"ajax/modifiedDataQuery?page="+page+"&psize="+rows,
  225. success:function (data){
  226. $.messager.progress('close');
  227. var vData = $.parseJSON(data);
  228. sum = vData.total;
  229. totalpage = Math.ceil(sum/rows);
  230. document.getElementById("total").innerText = sum;
  231. document.getElementById("totalpage").innerText = totalpage;
  232. var vData = $.parseJSON(data);
  233. $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
  234. var p = $('#tt').datagrid('getPager');
  235. $(p).pagination({
  236. pageList: [10,20,30,100,200,400],//可以设置每页记录条数的列表
  237. beforePageText: '第',//页数文本框前显示的汉字
  238. afterPageText: '页 共 {pages} 页',
  239. displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
  240. onSelectPage: function (pageNumber, pageSize) {
  241. fLoadData(pageNumber, pageSize);
  242. }
  243. });
  244. if(!grid){
  245. alert("数据为空");
  246. return false;
  247. }else{
  248. expt(grid);
  249. }
  250. }
  251. });
  252. }
  253. </script>
  254. </head>
  255. <body>
  256. <!-- 查询结果:数据表格 -->
  257. <table id="tt" cellspacing="0" cellpadding="0" >
  258. </table>
  259. <div id="toolbar" style="padding-top: 5px;height: auto;">
  260. <form id="modifiedform" action="ajax/modified" method="post">
  261. <table>
  262. <tr>
  263. <td>
  264. <span class="hzbspan">省:</span>
  265. </td>
  266. <td>
  267. <select name="province" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan1 select">
  268. <%for(AuthorityRegionPlace arp:arplist){
  269. cplist = arp.getCityPlace();
  270. %>
  271. <option value="<%=arp.getId() %>">
  272. <%=arp.getName() %>
  273. </option>
  274. <%} %>
  275. </select>
  276. </td>
  277. <td>
  278. <span class="hzbspan">市:</span>
  279. </td>
  280. <td>
  281. <select name="city" id="city" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan1 select" onchange="selectCountry1()">
  282. <%
  283. for(CityPlace cp:cplist){
  284. cyplist = cp.getSubPlaceList();
  285. %>
  286. <option value="<%=cp.getId() %>">
  287. <%=cp.getName() %>
  288. </option>
  289. <%} %>
  290. </select>
  291. </td>
  292. <td>
  293. <span class="hzbspan">县:</span>
  294. </td>
  295. <td>
  296. <select name="country" id = "country" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan1 select" onchange="selectStation1();" >
  297. </select>
  298. </td>
  299. <td>
  300. <span class="hzbspan">安装站点:</span>
  301. </td>
  302. <td>
  303. <select name="station" id = "station" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan1 select" >
  304. <option value="">全部</option>
  305. </select>
  306. </td>
  307. </tr>
  308. <tr>
  309. <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>
  314. <span style="cursor: default"><span class="hzbspan">改装开始时间:</span></span></td>
  315. <td><input type="text" name="refixStartTime" id="refixStartTime" class="easyui-datebox" style="width: 150px;height: 34px;" data-options="prompt:'- - - - - - -'">
  316. </td>
  317. </td>
  318. <td>
  319. <span style="cursor: default"><span class="hzbspan">出厂开始时间:</span></span></td>
  320. <td><input type="text" name="startTime" id="startTime" class="easyui-datebox" style="width: 150px;height: 34px;" data-options="prompt:'- - - - - - -'">
  321. <input type="hidden" name="operState" value=""/>
  322. </td>
  323. </tr>
  324. <tr>
  325. <td>
  326. <span style="cursor: default"><span class="hzbspan">气瓶出厂编号:</span></span></td>
  327. <td><input type="text" name="cylinderNo" id="cylinderNo" style="width: 150px;height: 34px;" class="hzbspan" placeholder="- - - - - - -">
  328. </td>
  329. <td>
  330. <span style="cursor: default"><span class="hzbspan">改装结束时间:</span></span></td>
  331. <td><input type="text" name="refixEndTime" id="refixEndTime" class="easyui-datebox" style="width: 150px;height: 34px;" class="hzbspan" data-options="prompt:'- - - - - - -'">
  332. </td>
  333. <td>
  334. <span style="cursor: default"><span class="hzbspan">出厂结束时间:</span></span></td>
  335. <td><input type="text" name="endTime" id="endTime" class="easyui-datebox" style="width: 150px;height: 34px;" data-options="prompt:'- - - - - - -'">
  336. </td>
  337. </tr>
  338. <tr>
  339. <td>
  340. <span style="cursor: default"><span class="hzbspan">车 牌 号:</span></span></td>
  341. <td><input type="text" name="carNo" id="carNo" style="width: 150px;height: 34px;" class="hzbspan" placeholder="- - - - - - -">
  342. </td>
  343. <td><span style="cursor: default"><span class="hzbspan">应 用 类 型:</span></span></td>
  344. <td><select name="appType" id="appType" style="width: 150px;height: 34px;" class="hzbspan select" >
  345. <option value="-1" selected="selected">全部</option>
  346. <option value="0">其他</option>
  347. <option value="1">出租</option>
  348. <option value="2">公交</option>
  349. <option value="3">私用</option>
  350. <option value="4">货运</option>
  351. <option value="5">客运</option>
  352. <option value="6">营转非</option>
  353. <option value="9">外地车</option>
  354. </select></td>
  355. <td>
  356. <span style="cursor: default"><span class="hzbspan">气瓶 类 型:</span></span></td>
  357. <td><select name="cylinderType" id="cylinderType" style="width: 150px;height: 34px;" class="hzbspan select" >
  358. <option value="-1" selected="selected">全部</option>
  359. <option value="0">其他</option>
  360. <option value="1">钢质气瓶</option>
  361. <option value="2">钢质内胆环向缠绕气瓶</option>
  362. <option value="3">铝合金内胆全缠绕气瓶</option>
  363. <option value="4">塑料内胆全缠绕气瓶</option>
  364. <option value="5">LNG液化天然气气瓶</option>
  365. </select>
  366. </td>
  367. <td colspan="2">
  368. <a id="btninfosearch" class="easyui-linkbutton" onclick="changeSize();" icon="icon-search" href="javascript:void(0)"><span class="hzbspan" style="color: #f08300;font-size: 16px;">查询</span></a>
  369. <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>
  370. </td>
  371. </tr>
  372. </table>
  373. </form>
  374. </div>
  375. <div id="dialog2"></div>
  376. </body>
  377. </html>