FillingdataQueryfilling.jsp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  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/easyui/export.js"></script>
  38. <script type="text/javascript" src="js/common/area.js"></script>
  39. <style type="text/css">
  40. a:HOVER{
  41. color: red;
  42. text-decoration: none;
  43. }
  44. a{
  45. color: #f08300;
  46. text-decoration: none;
  47. }
  48. </style>
  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. pageSize = $('#pageSize').val();
  58. selectCountry();
  59. selectstation();
  60. selectjqjandop();
  61. fLoadTable();
  62. //fLoadData(i,pageSize);
  63. });
  64. function show(message) {
  65. $.messager.show({
  66. title: '提示信息',
  67. msg: message,
  68. timeout: 2000,
  69. showType: 'slide'
  70. });
  71. }
  72. function fLoadTable(){
  73. grid=$('#tt').datagrid({
  74. fit: true,//自动大小
  75. title: '充装数据',
  76. width: '100%',
  77. height: 580,
  78. toolbar: '#toolbar',
  79. fitColumns: true,
  80. singleSelect:false,
  81. loadMsg:'正在加载, 请稍等 …',
  82. nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取
  83. striped : true,//设置为true将交替显示行背景
  84. collapsible : true,//显示可折叠按钮
  85. singleSelect:true,//为true时只能选择单行
  86. fitColumns:true,//允许表格自动缩放,以适应父容器
  87. rownumbers:true,
  88. pagination:true,//分页控件
  89. columns:[[
  90. {field:'stationNo',align:'center',title:'充装站',width:'160px'},
  91. {field:'machineNo',align:'center',title:'加气机',width:'120px'},
  92. {field:'gunNo',align:'center',title:'加气枪',width:'120px'},
  93. {field:'operatorName',align:'center',title:'操作员',width:'120px'},
  94. {field:'fillTime1',align:'center',title:'充装时间',width:160},
  95. {field:'endTime1',align:'center',title:'结束时间',width:160},
  96. {field:'carNo',align:'center',title:'车牌号',width:'120px',formatter: function(value, row, index){
  97. if(value){
  98. return '<a href="machineDetailfill?carNo='+value+'&appType='+row.appType+'&operState=-1'+'&plateType='+row.plateType+'&fixCarNo='+row.fixCarNo+'&fillTimes='+row.fillTime1+'" target="_blank">'+value+'</a>';
  99. }
  100. return value;
  101. }},
  102. {field:'plateTypeName',align:'center',title:'车牌类型',width:'120px'},
  103. {field:'appType',align:'center',title:'应用类型',width:'120px'},
  104. {field:'fillState',align:'center',title:'充装状态',width:'120px',formatter: function(value, row, index){
  105. if(value=="超期未检"){
  106. return '<div style="background-color: #f08300;">'+value+'</div>';
  107. }
  108. return value;
  109. }},
  110. {field:'cylinderNum',align:'center',title:'气瓶数量',width:'120px'},
  111. {field:'regNo',align:'center',title:'使用登记证',width:'120px'},
  112. {field:'nowNumber',align:'center',title:'已充装次数',width:'120px'},
  113. {field:'lowPress',align:'center',title:'充装前压',width:'120px',formatter: function(value, row, index){
  114. if(value){
  115. return value.toFixed(1);
  116. }
  117. return value;
  118. }},
  119. {field:'highPress',align:'center',title:'充装后压',width:'120px',formatter: function(value, row, index){
  120. if(value){
  121. return value.toFixed(1);
  122. }
  123. return value;
  124. }},
  125. {field:'flux',align:'center',title:'流量',width:'120px',formatter: function(value, row, index){
  126. if(value){
  127. return value.toFixed(1);
  128. }
  129. return value;
  130. }},
  131. {field:'money',align:'center',title:'金额(元)',width:'120px',formatter: function(value, row, index){
  132. if(value){
  133. return value.toFixed(1);
  134. }
  135. return value;
  136. }}
  137. ]]
  138. });
  139. $('#tt').datagrid('hideColumn','endTime1');
  140. }
  141. function fLoadData(page,rows){
  142. if(!$('#station option:selected').text()){
  143. return false;
  144. }
  145. $.messager.progress({
  146. title: '请等待',
  147. msg: '正在加载数据...',
  148. text: '查询中.......'
  149. });
  150. $.ajax({
  151. type:"POST",
  152. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  153. data:$('#fillingform').serialize(),
  154. url:"ajax/fillingDataQuery?page="+page+"&psize="+rows,
  155. success:function (data){
  156. $.messager.progress('close');
  157. var vData = $.parseJSON(data);
  158. sum = vData.total;
  159. if(sum==0){
  160. show("没有查询到相关信息!!!");
  161. }
  162. totalpage = Math.ceil(sum/rows);
  163. $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
  164. var p = $('#tt').datagrid('getPager');
  165. $(p).pagination({
  166. pageList: [10,20,30,100,200,400],//可以设置每页记录条数的列表
  167. beforePageText: '第',//页数文本框前显示的汉字
  168. afterPageText: '页 共 {pages} 页',
  169. displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
  170. onSelectPage: function (pageNumber, pageSize) {
  171. fLoadData(pageNumber, pageSize);
  172. }
  173. });
  174. }
  175. });
  176. }
  177. function selectCountry(){
  178. var id=document.getElementById("city").value;
  179. var select = document.getElementById("country");
  180. for(var i=select.options.length-1;i>=0;i--) {
  181. select.options.remove(i);
  182. }
  183. $.ajax({
  184. type:"POST",
  185. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  186. url:"ajax/hiddenCity?cityId="+id,
  187. success:function (data){
  188. var obj=eval("(" + data + ")");
  189. if(obj.rows.length==1){
  190. select.options.add(new Option("请选择县", ""));
  191. }
  192. $.each(obj.rows, function(i,item){
  193. select.options.add(new Option(item.name, item.id));
  194. });
  195. }
  196. });
  197. }
  198. function selectCountry1(){
  199. selectCountry();
  200. selectstation();
  201. }
  202. function changeSize(){
  203. fLoadData(1,10);
  204. }
  205. function selectstation(){
  206. var ii=1;
  207. var id=document.getElementById("country").value;
  208. var select = document.getElementById("station");
  209. for(var i=select.options.length-1;i>=0;i--) {
  210. select.options.remove(i);
  211. }
  212. $.ajax({
  213. type:"POST",
  214. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  215. data:$('#fillingform').serialize(),
  216. //url:"ajax/hiddenCNGStation?cityId="+id,
  217. url:"ajax/hiddenspeStation?type=2",
  218. success:function (data){
  219. var obj=eval("(" + data + ")");
  220. $.each(obj.rows, function(i,item){
  221. if(ii==1){
  222. if(obj.rows.length>1){
  223. select.options.add(new Option("全部", ""));
  224. }
  225. ii++;
  226. }
  227. select.options.add(new Option(item.name, item.id));
  228. });
  229. }
  230. });
  231. }
  232. function selectstation1(){
  233. selectstation();
  234. //changeSize();
  235. }
  236. function selectjqjandop(){
  237. selectjqj();
  238. selectoperatorNo();
  239. }
  240. function selectjqj(){
  241. var ii=1;
  242. var id=document.getElementById("station").value;
  243. var select = document.getElementById("jqj");
  244. for(var i=select.options.length-1;i>=0;i--) {
  245. select.options.remove(i);
  246. }
  247. $.ajax({
  248. type:"POST",
  249. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  250. url:"ajax/hiddenjqj?stationId="+id,
  251. success:function (data){
  252. var obj=eval("(" + data + ")");
  253. select.options.add(new Option("全部", ""));
  254. $.each(obj.rows, function(i,item){
  255. select.options.add(new Option(item.manu+item.type, item.machineNo));
  256. });
  257. }
  258. });
  259. }
  260. function selectoperatorNo(){
  261. var ii=1;
  262. var id=document.getElementById("station").value;
  263. var select = document.getElementById("operatorNo");
  264. for(var i=select.options.length-1;i>=0;i--) {
  265. select.options.remove(i);
  266. }
  267. $.ajax({
  268. type:"POST",
  269. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  270. url:"ajax/hiddenoperatorNo?stationId="+id,
  271. success:function (data){
  272. var obj=eval("(" + data + ")");
  273. select.options.add(new Option("全部", ""));
  274. $.each(obj.rows, function(i,item){
  275. select.options.add(new Option(item.name, item.operatorNo));
  276. });
  277. }
  278. });
  279. }
  280. function expt1(){
  281. expt(grid);
  282. }
  283. function exptSingle(){
  284. if(!grid){
  285. alert("数据为空");
  286. return false;
  287. }else{
  288. expt(grid);
  289. }
  290. }
  291. function exptAll(){
  292. fLoadDataAll(1,5000);
  293. }
  294. function fLoadDataAll(page,rows){
  295. var startTime1 = $('#startTime').datebox('getValue');
  296. var endTime1 = $('#endTime').datebox('getValue');
  297. document.getElementById("pageNumber").innerText = i;
  298. document.getElementById("from").innerText = (page-1)*rows;
  299. document.getElementById("to").innerText = page*rows;
  300. $.messager.progress({
  301. title: '请等待',
  302. msg: '正在加载数据...',
  303. text: '查询中.......'
  304. });
  305. $.ajax({
  306. type:"POST",
  307. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  308. data:$('#fillingform').serialize(),
  309. url:"ajax/fillingDataQuery?page="+page+"&psize="+rows,
  310. success:function (data){
  311. $.messager.progress('close');
  312. var vData = $.parseJSON(data);
  313. sum = vData.total;
  314. if(sum==0){
  315. show("没有查询到相关信息!!!");
  316. }
  317. totalpage = Math.ceil(sum/rows);
  318. document.getElementById("total").innerText = sum;
  319. document.getElementById("totalpage").innerText = totalpage;
  320. var vData = $.parseJSON(data);
  321. $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
  322. var p = $('#tt').datagrid('getPager');
  323. $(p).pagination({
  324. pageList: [10,20,30,100,200,400],//可以设置每页记录条数的列表
  325. beforePageText: '第',//页数文本框前显示的汉字
  326. afterPageText: '页 共 {pages} 页',
  327. displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
  328. onSelectPage: function (pageNumber, pageSize) {
  329. fLoadData(pageNumber, pageSize);
  330. }
  331. });
  332. if(!grid){
  333. alert("数据为空");
  334. return false;
  335. }else{
  336. expt(grid);
  337. }
  338. }
  339. });
  340. }
  341. function selectjqjandop22(){
  342. selectjqjandop();
  343. //changeSize();
  344. }
  345. function selectoperatorNo22(){
  346. //selectoperatorNo();
  347. //changeSize();
  348. }
  349. </script>
  350. </head>
  351. <body>
  352. <!-- 查询结果:数据表格 -->
  353. <table id="tt" cellspacing="0" cellpadding="0" >
  354. </table>
  355. <div id="toolbar" style="padding-top: 0px;height: auto;">
  356. <form id="fillingform" action="ajax/filling" method="post">
  357. <span class="easyui-linkbutton" style="cursor: default;margin-bottom: 5px;"><span class="hzbspan" style="color: #f08300;font-size: 16px;" >查询条件:</span></span>
  358. <span class="easyui-linkbutton" style="cursor: default;margin-bottom: 5px;"><span class="hzbspan" style="color: #f08300;font-size: 16px;" >省:</span></span>
  359. <select name="province" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan">
  360. <%for(AuthorityRegionPlace arp:arplist){
  361. cplist = arp.getCityPlace();
  362. %>
  363. <option value="<%=arp.getId() %>">
  364. <%=arp.getName() %>
  365. </option>
  366. <%} %>
  367. </select>
  368. <span class="easyui-linkbutton" style="cursor: default;margin-bottom: 5px;"><span class="hzbspan" style="color: #f08300;font-size: 16px;" >市:</span></span>
  369. <select name="city" id="city" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan" onchange="selectCountry1()">
  370. <%
  371. for(CityPlace cp:cplist){
  372. cyplist = cp.getSubPlaceList();
  373. %>
  374. <option value="<%=cp.getId() %>">
  375. <%=cp.getName() %>
  376. </option>
  377. <%} %>
  378. </select>
  379. <span class="easyui-linkbutton" style="cursor: default;margin-bottom: 5px;"><span class="hzbspan" style="color: #f08300;font-size: 16px;" >县:</span></span>
  380. <select name="country" id = "country" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan" onchange="selectstation1();" >
  381. </select>
  382. <br/>
  383. <span class="easyui-linkbutton" style="cursor: default;margin-bottom: 5px;"><span class="hzbspan" style="color: #f08300;font-size: 16px;" >充装站点:</span></span>
  384. <select name="station" id ="station" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan" onchange="selectjqjandop22();" >
  385. <option value="">全部</option>
  386. </select>
  387. <span class="easyui-linkbutton" style="cursor: default;margin-bottom: 5px;"><span class="hzbspan" style="color: #f08300;font-size: 16px;" >加气机:</span></span>
  388. <select name="jqj" id ="jqj" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan" onchange="selectoperatorNo22();" >
  389. <option value="">全部</option>
  390. </select>
  391. <table>
  392. <tr><td>
  393. <span style="cursor: default"><span class="hzbspan">应用类型:</span></span></td>
  394. <td><select name="appType" id="appType" style="width: 120px;height: 24px;" class="hzbspan" >
  395. <option value="-1" selected="selected">全部</option>
  396. <option value="0">其他</option>
  397. <option value="1">出租</option>
  398. <option value="2">公交</option>
  399. <option value="3">私用</option>
  400. <option value="4">货运</option>
  401. <option value="5">客运</option>
  402. <option value="6">营转非</option>
  403. <option value="9">外地车</option>
  404. </select></td>
  405. <td>
  406. <span style="cursor: default"><span class="hzbspan">开始时间:</span></span></td>
  407. <td><input type="text" name="startTime" id="startTime" class="easyui-datebox" style="width: 100px;height: 24px;" class="hzbspan">
  408. </td>
  409. <td>
  410. <span style="cursor: default"><span class="hzbspan">气枪编号:</span></span></td>
  411. <td><input type="text" name="gunNo" id="gunNo" style="width: 100px;height: 24px;" class="hzbspan">
  412. </td>
  413. <td><span style="cursor: default"><span class="hzbspan">操作员:</span></span></td>
  414. <td><select name="operatorNo" id ="operatorNo" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan" >
  415. <option value="">全部</option>
  416. </select></td>
  417. </tr><tr>
  418. <td>
  419. <span style="cursor: default"><span class="hzbspan">充装状态:</span></span></td>
  420. <td><select name="fillState" id="fillState" style="width: 120px;height: 24px;" class="hzbspan" >
  421. <option value="-1" selected="selected">全部</option>
  422. <option value="0">成功充装</option>
  423. <option value="1">灰名单允许</option>
  424. <option value="2">灰名单不允许</option>
  425. <option value="3">黑名单不充装</option>
  426. <option value="4">检验未通过</option>
  427. <option value="5">超期未检</option>
  428. <option value="6">使用年限超出</option>
  429. <option value="7">次数不足</option>
  430. <option value="8">当天次数不足</option>
  431. <option value="9">站点不匹配</option>
  432. <option value="10">加气机不匹配</option>
  433. <option value="11">加气枪不匹配</option>
  434. </select></td>
  435. <td>
  436. <span style="cursor: default"><span class="hzbspan">结束时间:</span></span></td>
  437. <td><input type="text" name="endTime" id="endTime" class="easyui-datebox" style="width: 100px;height: 24px;" class="hzbspan">
  438. </td>
  439. <td><span style="cursor: default"><span class="hzbspan">车牌号:</span></span></td>
  440. <td><input type="text" name="carNo" id="carNo" style="width: 100px;height: 24px;" class="hzbspan">
  441. </td>
  442. <td>
  443. <a id="btninfosearch" onclick="changeSize();" class="easyui-linkbutton" icon="icon-search" href="javascript:void(0)" style="margin-bottom: 5px;" ><span class="hzbspan" style="color: #f08300;font-size: 16px;">查询</span></a>
  444. </td>
  445. <td>
  446. <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>
  447. </td>
  448. </tr>
  449. </table>
  450. </form>
  451. </div>
  452. <div id="dialog2"></div>
  453. </body>
  454. </html>