ModifieddataQuery.jsp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  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 : true,//显示可折叠按钮
  75. fitColumns:true,//允许表格自动缩放,以适应父容器
  76. rownumbers:true,
  77. pagination:true,//分页控件
  78. columns:[[
  79. {field:'carNo',align:'center',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:'center',title:'车牌类型',width:'120px'},
  83. {field:'cylinderNo',align:'center',title:'气瓶出厂编号',width:'120px'},
  84. {field:'cylinderTypeName',align:'center',title:'气瓶类型',width:'160px'},
  85. {field:'appTypeName',align:'center',title:'应用类型',width:'120px'},
  86. {field:'productNo',align:'center',title:'生产厂家简称',width:'120px'},
  87. {field:'installTypeName',align:'center',title:'安装类型',width:'120px'},
  88. {field:'productDate1',align:'center',title:'生产年月',width:'120px'},
  89. {field:'installDate1',align:'center',title:'安装时间',width:'120px'},
  90. {field:'installStation',align:'center',title:'安装监检单位',width:'200px'},
  91. {field:'installLicence',align:'center',title:'安装监检许可',width:'120px'},
  92. {field:'installCert',align:'center',title:'安装合格证',width:'120px'},
  93. {field:'installLoc',align:'center',title:'安装位置',width:'120px'},
  94. {field:'installWorkerName',align:'center',title:'安装人',width:'120px'},
  95. {field:'editStation',align:'center',title:'登记/修改站点名',width:'180px'},
  96. {field:'editOperator',align:'center',title:'登记/修改人',width:'120px'},
  97. {field:'operStateName',align:'center',title:'状态',width:'120px'},
  98. {field:'editOperTime1',align:'center',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. <span class="easyui-linkbutton" style="cursor: default;margin-bottom: 5px;"><span class="hzbspan" style="color: #f08300;font-size: 16px;" >查询条件:</span></span>
  262. <span class="easyui-linkbutton" style="cursor: default;margin-bottom: 5px;"><span class="hzbspan" style="color: #f08300;font-size: 16px;" >省:</span></span>
  263. <select name="province" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan1">
  264. <%for(AuthorityRegionPlace arp:arplist){
  265. cplist = arp.getCityPlace();
  266. %>
  267. <option value="<%=arp.getId() %>">
  268. <%=arp.getName() %>
  269. </option>
  270. <%} %>
  271. </select>
  272. <span class="easyui-linkbutton" style="cursor: default;margin-bottom: 5px;"><span class="hzbspan" style="color: #f08300;font-size: 16px;" >市:</span></span>
  273. <select name="city" id="city" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan1" onchange="selectCountry1()">
  274. <%
  275. for(CityPlace cp:cplist){
  276. cyplist = cp.getSubPlaceList();
  277. %>
  278. <option value="<%=cp.getId() %>">
  279. <%=cp.getName() %>
  280. </option>
  281. <%} %>
  282. </select>
  283. <span class="easyui-linkbutton" style="cursor: default;margin-bottom: 5px;"><span class="hzbspan" style="color: #f08300;font-size: 16px;" >县:</span></span>
  284. <select name="country" id = "country" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan1" onchange="selectStation1();" >
  285. </select>
  286. <br/>
  287. <span class="easyui-linkbutton" style="cursor: default;margin-bottom: 5px;"><span class="hzbspan" style="color: #f08300;font-size: 16px;" >安装单位:</span></span>
  288. <select name="station" id = "station" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan1" >
  289. <option value="">全部</option>
  290. </select>
  291. <br/>
  292. <table>
  293. <tr>
  294. <td>
  295. <span style="cursor: default"><span class="hzbspan">气瓶厂家编号:</span></span></td>
  296. <td><input type="text" name="productNo" id="productNo" style="width: 100px;height: 24px;" class="hzbspan">
  297. </td>
  298. <td>
  299. <span style="cursor: default"><span class="hzbspan">改装开始时间:</span></span></td>
  300. <td><input type="text" name="refixStartTime" id="refixStartTime" class="easyui-datebox" style="width: 100px;height: 24px;">
  301. </td>
  302. </td>
  303. <td>
  304. <span style="cursor: default"><span class="hzbspan">出厂开始时间:</span></span></td>
  305. <td><input type="text" name="startTime" id="startTime" class="easyui-datebox" style="width: 100px;height: 24px;">
  306. <input type="hidden" name="operState" value=""/>
  307. </td>
  308. </tr>
  309. <tr>
  310. <td>
  311. <span style="cursor: default"><span class="hzbspan">气瓶出厂编号:</span></span></td>
  312. <td><input type="text" name="cylinderNo" id="cylinderNo" style="width: 100px;height: 24px;" class="hzbspan">
  313. </td>
  314. <td>
  315. <span style="cursor: default"><span class="hzbspan">改装结束时间:</span></span></td>
  316. <td><input type="text" name="refixEndTime" id="refixEndTime" class="easyui-datebox" style="width: 100px;height: 24px;" class="hzbspan">
  317. </td>
  318. <td>
  319. <span style="cursor: default"><span class="hzbspan">出厂结束时间:</span></span></td>
  320. <td><input type="text" name="endTime" id="endTime" class="easyui-datebox" style="width: 100px;height: 24px;">
  321. </td>
  322. </tr>
  323. <tr>
  324. <td>
  325. <span style="cursor: default"><span class="hzbspan">车 牌 号:</span></span></td>
  326. <td><input type="text" name="carNo" id="carNo" style="width: 100px;height: 24px;" class="hzbspan">
  327. </td>
  328. <td><span style="cursor: default"><span class="hzbspan">应 用 类 型:</span></span></td>
  329. <td><select name="appType" id="appType" style="width: 100px;height: 24px;" class="hzbspan" >
  330. <option value="-1" selected="selected">全部</option>
  331. <option value="0">其他</option>
  332. <option value="1">出租</option>
  333. <option value="2">公交</option>
  334. <option value="3">私用</option>
  335. <option value="4">货运</option>
  336. <option value="5">客运</option>
  337. <option value="6">营转非</option>
  338. <option value="9">外地车</option>
  339. </select></td>
  340. <td>
  341. <span style="cursor: default"><span class="hzbspan">气瓶 类 型:</span></span></td>
  342. <td><select name="cylinderType" id="cylinderType" style="width: auto;height: 24px;" class="hzbspan" >
  343. <option value="-1" selected="selected">全部</option>
  344. <option value="0">其他</option>
  345. <option value="1">钢质气瓶</option>
  346. <option value="2">钢质内胆环向缠绕气瓶</option>
  347. <option value="3">铝合金内胆全缠绕气瓶</option>
  348. <option value="4">塑料内胆全缠绕气瓶</option>
  349. <option value="5">LNG液化天然气气瓶</option>
  350. </select>
  351. <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>
  352. <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>
  353. </td>
  354. </tr>
  355. </table>
  356. </form>
  357. </div>
  358. <div id="dialog2"></div>
  359. </body>
  360. </html>