accident.jsp 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <%@ page language="java" contentType="text/html;charset=GBK"
  2. pageEncoding="GBK"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  7. <title>事故档案</title>
  8. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  9. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  10. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
  11. <link href="${pageContext.request.contextPath}/main.css"
  12. rel="stylesheet" type="text/css" />
  13. <script type="text/javascript" src="/shares/js/constant.js"></script>
  14. <script type="text/javascript" src="/shares/js/common.js"></script>
  15. <script type="text/javascript">
  16. $(function() {
  17. $("#start_time").ligerDateEditor({ showTime: true, labelAlign: 'left', showTime:false});
  18. $("#end_time").ligerDateEditor({ showTime: true, labelAlign: 'left', showTime:false});
  19. loadAccidentList();
  20. });
  21. var grid = null;
  22. function loadAccidentList(params1,params2,params3) {
  23. grid = $("#accidentList")
  24. .ligerGrid({columns : [
  25. {display : '车牌号' ,name : 'plate_number',width : 100},
  26. {display : '事故项目',name : 'accident_explain',width : 120,
  27. render : function(a,b){
  28. if(a["accident_explain"] == null || a["accident_explain"] == ''){
  29. return '--';
  30. }else{
  31. return a["accident_explain"];
  32. }
  33. }},
  34. {display : '事故处理号' ,name : 'dispose_number',width : 120,
  35. render : function(a,b){
  36. if(a["dispose_number"] == null || a["dispose_number"] == ''){
  37. return '--';
  38. }else{
  39. return a["dispose_number"];
  40. }
  41. }},
  42. {display : '事故地点',name : 'accident_place',width : 150,
  43. render : function(a,b){
  44. if(a["accident_place"] == null || a["accident_place"] == ''){
  45. return '--';
  46. }else{
  47. return a["accident_place"];
  48. }
  49. }},
  50. {display : '事故日期',name : 'accident_time',width :100},
  51. {display : '驾驶员',name : 'driver_name',width : 100,
  52. render : function(a,b){
  53. if(a["driver_name"] == null || a["driver_name"] == ''){
  54. return '--';
  55. }else{
  56. return a["driver_name"];
  57. }
  58. }},
  59. {display : '操作',isAllowHide : false,
  60. render : function(row) {
  61. var html = '<a href=\"#\" onclick=\"viewAccident('
  62. + row.universalid
  63. + ')\">查看</a>&nbsp;';
  64. html += '<a href=\"#\" onclick=\"editAccident('
  65. + row.universalid
  66. + ')\">编辑</a>&nbsp;';
  67. html += '<a href=\"#\" onclick=\"delAccident('
  68. + row.universalid
  69. + ')\">删除</a>&nbsp;';
  70. return html;
  71. }
  72. } ],
  73. pageSizeOptions: [5,10, 20, 30, 40, 50],
  74. frozen: false,
  75. allowAdjustColWidth : false,
  76. url : 'carAccidentAction.do?task=toAccidentList&time='
  77. + new Date().getTime() + params1 +params2+params3,
  78. pageParmName : 'p', //页索引参数名,(提交给服务器)
  79. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  80. width : '99.7%',
  81. enabledEdit : true,
  82. height : '99%'});
  83. $("#pageloading").hide();
  84. }
  85. //查询
  86. function searchByKword() {
  87. grid.set("newPage","1");
  88. var plate_number= document.getElementById("plate_number");
  89. var s1 = "";
  90. if (plate_number.value != "" && typeof (plate_number.value) != "undefined") {
  91. s1 += "&plate_number=" + encodeURI(encodeURI(plate_number.value));
  92. }
  93. var start_time= document.getElementById("start_time");
  94. var s2 = "";
  95. if (start_time.value != "" && typeof (start_time.value) != "undefined") {
  96. s2 += "&start_time=" + encodeURI(encodeURI(start_time.value));
  97. }
  98. var end_time= document.getElementById("end_time");
  99. var s3 = "";
  100. if (end_time.value != "" && typeof (end_time.value) != "undefined") {
  101. s3 += "&end_time=" + encodeURI(encodeURI(end_time.value));
  102. }
  103. $(function() {
  104. loadAccidentList(s1,s2,s3);
  105. });
  106. }
  107. function addAccident() {
  108. window.parent.f_addTab('addAccident', '新增事故',
  109. 'carAccidentAction.do?task=addAccident&tabid=' + getCurrentTabId());
  110. }
  111. function editAccident(accident_id) {
  112. window.parent.f_addTab(''+accident_id+'editAccident', '编辑事故',
  113. 'carAccidentAction.do?task=editAccident&universalid=' + accident_id+ '&tabid=' + getCurrentTabId());
  114. }
  115. function viewAccident(accident_id) {
  116. window.parent.f_addTab(''+accident_id+'viewAccident', '查看事故',
  117. 'carAccidentAction.do?task=viewAccident&universalid=' + accident_id+ '&tabid=' + getCurrentTabId());
  118. }
  119. function delAccident(accident_id) {
  120. if (confirm("确定要删除吗?")) {
  121. $.ajax({
  122. type : "POST",
  123. url : "carAccidentAction.do?task=delAccident",
  124. data : {"universalid" : accident_id},
  125. timeout : 10000,
  126. cache : false,
  127. dataType : "json",
  128. success : function(data) {
  129. var success = data.success;
  130. if (success != undefined) {
  131. $.ligerDialog.success("删除成功");
  132. } else {
  133. showAjaxError(null, data.error);
  134. }
  135. loadAccidentList();
  136. },
  137. error : showAjaxError
  138. });
  139. }
  140. }
  141. $(document).ready(function() {
  142. $("[name='plate_number']").focus();
  143. });
  144. </script>
  145. </head>
  146. <body>
  147. <%@ include file="/include/message.jsp"%>
  148. <form action="" method="post">
  149. <div class="container">
  150. <div id="title" class="form-button">
  151. <input type="button" class="l-button" value="新增事故登记" style="width: 90px;" onclick="addAccident()">
  152. <input type="submit" value="关闭" class="l-button" onclick="closeWindow();" />
  153. </div>
  154. <div class="default_search" style="margin: 0; height:30px;">
  155. </div>
  156. <div class="default_search" style="margin: 0;">
  157. <ul class="list_search">
  158. <li class="title">车牌号:</li>
  159. <li class="text"><input type="text" name="plate_number" id="plate_number">
  160. </li>
  161. </ul>
  162. <ul class="list_search" >
  163. <li class="title">事故时间:</li>
  164. <li class="text" >
  165. <input type="text" id="start_time" name="start_time" value="">
  166. </li>
  167. <li class="title title_rqjg">
  168. </li>
  169. <li class="text" >
  170. <input type="text" id="end_time" name="end_time" value="">
  171. </li>
  172. </ul>
  173. <ul class="list_search">
  174. <li class="search-button"><input type="button" class='l-button'
  175. name="search" onclick="searchByKword()" value="查询" /></li>
  176. </ul>
  177. </div>
  178. <div style="clear:both;"></div>
  179. <div style="overflow: hidden; clear: both;">
  180. <div id="accidentList" style="margin: 0; padding: 0"></div>
  181. </div>
  182. </div>
  183. </form>
  184. </body>
  185. </html>