fillingMachineInfo.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  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.constant.Constant" %>
  8. <%
  9. String path = request.getContextPath();
  10. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  11. User user = (User)session.getAttribute(Constant.userMark);
  12. List<AuthorityRegionPlace> arplist = user.getPrivilegePlaces1();
  13. List<CityPlace> cplist = new ArrayList<CityPlace>();
  14. List<CountryPlace> cyplist = new ArrayList<CountryPlace>();
  15. List<Station> slist = new ArrayList<Station>();
  16. %>
  17. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  18. <html>
  19. <head>
  20. <base href="<%=basePath%>">
  21. <title>充装设备信息</title>
  22. <meta http-equiv="pragma" content="no-cache">
  23. <meta http-equiv="cache-control" content="no-cache">
  24. <meta http-equiv="expires" content="0">
  25. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  26. <meta http-equiv="description" content="This is my page">
  27. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  28. <meta http-equiv="X-UA-Compatible" content="IE=10"/>
  29. <link rel="stylesheet" type="text/css" href="css/easyui/themes/default/easyui.css">
  30. <link rel="stylesheet" type="text/css" href="css/easyui/themes/icon.css">
  31. <link rel="stylesheet" type="text/css" href="css/easyui/demo/demo.css">
  32. <script type="text/javascript" src="css/easyui/jquery.min.js"></script>
  33. <script type="text/javascript" src="css/easyui/jquery.easyui.min.js" charset="utf-8"></script>
  34. <script type="text/javascript" src="css/easyui/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>
  35. <link rel="stylesheet" type="text/css" href="css/common/hzbstyle.css">
  36. <script type="text/javascript" src="js/common/area.js"></script>
  37. <style type="text/css">
  38. a:HOVER{
  39. color: red;
  40. text-decoration: none;
  41. }
  42. a{
  43. color: #f08300;
  44. text-decoration: none;
  45. }
  46. </style>
  47. <script type="text/javascript" src="js/easyui/export.js"></script>
  48. <script type="text/javascript">
  49. var grid="";
  50. var exportString="";
  51. var i = 1;//第几页
  52. var sum;//总条数
  53. var pageSize =10;
  54. var totalpage;//总页数
  55. $(document).ready(function(){
  56. fLoadTable();
  57. selectCountry();
  58. selectstation();
  59. fLoadData(1,10);
  60. });
  61. function fLoadTable(){
  62. grid=$('#tt').datagrid({
  63. fit: true,//自动大小
  64. title: '',
  65. width: '100%',
  66. height: 580,
  67. toolbar: '#toolbar',
  68. fitColumns: true,
  69. singleSelect:false,
  70. loadMsg:'正在加载, 请稍等 …',
  71. nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取
  72. striped : true,//设置为true将交替显示行背景
  73. collapsible : false,//显示可折叠按钮
  74. singleSelect:true,//为true时只能选择单行
  75. fitColumns:true,//允许表格自动缩放,以适应父容器
  76. rownumbers:true,
  77. columns:[[
  78. {field:'placeAB',align:'left',title:'站点名',width:'24%'},
  79. {field:'machineNo',align:'left',title:'加气机编号',width:'24%'},
  80. {field:'type',align:'left',title:'加气机类型',width:'24%'},
  81. {field:'manu',align:'left',title:'生产厂家',width:'24%'}
  82. ]]
  83. });
  84. }
  85. function show(message) {
  86. $.messager.show({
  87. title: '提示信息',
  88. msg: message,
  89. timeout: 2000,
  90. showType: 'slide'
  91. });
  92. }
  93. function fLoadData(page,rows){
  94. $.messager.progress({
  95. title: '请等待',
  96. msg: '正在加载数据...',
  97. text: '查询中.......'
  98. });
  99. $.ajax({
  100. type:"POST",
  101. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  102. data:$('#fillingMachineInfoForm').serialize(),
  103. url:"ajax/fillingMachineInfo?page="+page+"&psize="+rows,
  104. success:function (data){
  105. $.messager.progress('close');
  106. var vData = $.parseJSON(data);
  107. sum = vData.total;
  108. if(sum==0){
  109. show("没有查询到相关信息!!!");
  110. }
  111. totalpage = Math.ceil(sum/rows);
  112. $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
  113. var p = $('#tt').datagrid('getPager');
  114. $(p).pagination({
  115. pageList: [10,20,30,100,200,400],//可以设置每页记录条数的列表
  116. beforePageText: '第',//页数文本框前显示的汉字
  117. afterPageText: '页 共 {pages} 页',
  118. displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
  119. onSelectPage: function (pageNumber, pageSize) {
  120. fLoadData(pageNumber, pageSize);
  121. }
  122. });
  123. }
  124. });
  125. }
  126. function selectCountry(){
  127. var id=document.getElementById("city").value;
  128. var select = document.getElementById("country");
  129. for(var i=select.options.length-1;i>=0;i--) {
  130. select.options.remove(i);
  131. }
  132. $.ajax({
  133. type:"POST",
  134. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  135. url:"ajax/hiddenCity?cityId="+id,
  136. success:function (data){
  137. var obj=eval("(" + data + ")");
  138. $.each(obj.rows, function(i,item){
  139. select.options.add(new Option(item.name, item.id));
  140. });
  141. }
  142. });
  143. }
  144. function selectCountry1(){
  145. selectCountry();
  146. selectstation();
  147. //changeSize();
  148. }
  149. function changeSize(){
  150. fLoadData(1,10);
  151. }
  152. function selectstation(){
  153. var ii=1;
  154. var id=document.getElementById("country").value;
  155. var select = document.getElementById("station");
  156. for(var i=select.options.length-1;i>=0;i--) {
  157. select.options.remove(i);
  158. }
  159. $.ajax({
  160. type:"POST",
  161. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  162. data:$('#fillingMachineInfoForm').serialize(),
  163. url:"ajax/hiddenspeStation?type=2",
  164. success:function (data){
  165. var obj=eval("(" + data + ")");
  166. $.each(obj.rows, function(i,item){
  167. if(ii==1){
  168. if(obj.rows.length>1){
  169. select.options.add(new Option("全部", ""));
  170. }
  171. ii++;
  172. }
  173. select.options.add(new Option(item.name, item.id));
  174. });
  175. }
  176. });
  177. }
  178. function selectstation1(){
  179. selectstation();
  180. changeSize();
  181. }
  182. function expt1(){
  183. expt(grid);
  184. }
  185. function exptSingle(){
  186. if(!grid){
  187. alert("数据为空");
  188. return false;
  189. }else{
  190. expt(grid);
  191. }
  192. }
  193. function exptAll(){
  194. fLoadDataAll(1,5000);
  195. }
  196. function fLoadDataAll(page,rows){
  197. document.getElementById("pageNumber").innerText = i;
  198. document.getElementById("from").innerText = (page-1)*rows;
  199. document.getElementById("to").innerText = page*rows;
  200. $.messager.progress({
  201. title: '请等待',
  202. msg: '正在加载数据...',
  203. text: '查询中.......'
  204. });
  205. $.ajax({
  206. type:"POST",
  207. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  208. data:$('#fillingMachineInfoForm').serialize(),
  209. url:"ajax/CNGQualityQuery?page="+page+"&psize="+rows,
  210. success:function (data){
  211. $.messager.progress('close');
  212. var vData = $.parseJSON(data);
  213. sum = vData.total;
  214. if(sum==0){
  215. show("没有查询到相关信息!!!");
  216. }
  217. totalpage = Math.ceil(sum/rows);
  218. document.getElementById("total").innerText = sum;
  219. document.getElementById("totalpage").innerText = totalpage;
  220. var vData = $.parseJSON(data);
  221. $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
  222. if(!grid){
  223. alert("数据为空");
  224. return false;
  225. }else{
  226. expt(grid);
  227. }
  228. }
  229. });
  230. }
  231. </script>
  232. </head>
  233. <body>
  234. <!-- 查询结果:数据表格 -->
  235. <table id="tt" cellspacing="0" cellpadding="0" >
  236. </table>
  237. <div id="toolbar" style="padding-top: 0px;height: auto;">
  238. <form id="fillingMachineInfoForm" action="ajax/CNGQ" method="post">
  239. <table>
  240. <tr>
  241. <td>
  242. <span class="hzbspan">省:</span>
  243. </td>
  244. <td>
  245. <select name="province" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select">
  246. <%for(AuthorityRegionPlace arp:arplist){
  247. cplist = arp.getCityPlace();
  248. %>
  249. <option value="<%=arp.getId() %>">
  250. <%=arp.getName() %>
  251. </option>
  252. <%} %>
  253. </select>
  254. </td>
  255. <td>
  256. <span class="hzbspan">市:</span>
  257. </td>
  258. <td>
  259. <select name="city" id="city" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select" onchange="selectCountry1()">
  260. <%
  261. for(CityPlace cp:cplist){
  262. cyplist = cp.getSubPlaceList();
  263. %>
  264. <option value="<%=cp.getId() %>">
  265. <%=cp.getName() %>
  266. </option>
  267. <%} %>
  268. </select>
  269. </td>
  270. <td>
  271. <span class="hzbspan">县:</span>
  272. </td>
  273. <td>
  274. <select name="country" id = "country" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select" onchange="selectstation1();" >
  275. </select>
  276. </td>
  277. </tr>
  278. <tr>
  279. <td>
  280. <span class="hzbspan">站点:</span>
  281. </td>
  282. <td>
  283. <select name="station" id = "station" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select" >
  284. <option value="">全部</option>
  285. </select>
  286. </td>
  287. <td colspan="2">
  288. <a id="btninfosearch" onclick="changeSize();" class="easyui-linkbutton" icon="icon-search" href="javascript:void(0)" ><span class="hzbspan" style="color: #f08300;font-size: 16px;">查&nbsp;&nbsp;询&nbsp;&nbsp;</span></a>
  289. <a id="btninfosearch" onclick="exptSingle();" class="easyui-linkbutton" icon="icon-save" href="javascript:void(0)" ><span class="hzbspan" style="color: #f08300;font-size: 16px;">导&nbsp;&nbsp;出&nbsp;&nbsp;</span></a>
  290. </td>
  291. </tr>
  292. </table>
  293. </form>
  294. </div>
  295. <div id="dialog2"></div>
  296. </body>
  297. </html>