addAccident.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <%@ page language="java" contentType="text/html;charset=GBK"
  2. pageEncoding="GBK"%>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  8. <title>新增事故信息</title>
  9. <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  10. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  11. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  12. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  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" src="/shares/js/file.js"></script>
  16. <script src="/shares/xheditor/xheditor-1.1.14/xheditor-1.1.14-zh-cn.min.js" type="text/javascript"></script>
  17. <script type="text/javascript" src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"></script>
  18. <script type="text/javascript">
  19. //焦点
  20. $(document).ready(function() {
  21. $("input[type='text']:first").focus();
  22. });
  23. function checkForm(){
  24. var rs = $.validate({
  25. name : "plate_number",
  26. model : [ {
  27. type : "require",
  28. msg : "车牌号不能为空!"
  29. }, {
  30. type : "len",
  31. min : 1,
  32. max : 50,
  33. msg : "车牌号长度不能超过50个字!"
  34. } ]
  35. });
  36. /* rs = $.validate({
  37. name : "accident_explain",
  38. model : [ {
  39. type : "require",
  40. msg : "事故项目不能为空!"
  41. } ]
  42. }) && rs; */
  43. rs = $.validate({
  44. name : "insurance_compensation",
  45. model : [ {
  46. type : "isNumber",
  47. msg : "请输入数字!"
  48. }]
  49. }) && rs;
  50. rs = $.validate({
  51. name : "accident_time",
  52. model : [ {
  53. type : "require",
  54. msg : "事故日期不能为空!"
  55. } ]
  56. }) && rs;
  57. /* rs = $.validate({
  58. name : "dispose_number",
  59. model : [ {
  60. type : "require",
  61. msg : "文件处理号不能为空!"
  62. }]
  63. }) && rs;
  64. rs = $.validate({
  65. name : "accident_place",
  66. model : [ {
  67. type : "require",
  68. msg : "事故地点不能为空!"
  69. }]
  70. }) && rs;
  71. rs = $.validate({
  72. name : "driver",
  73. model : [ {
  74. type : "require",
  75. msg : "驾驶员不能为空!"
  76. }]
  77. }) && rs; */
  78. if (rs) {
  79. //上传附件
  80. var e = document.getElementsByName("documentId");
  81. var evalue = "";
  82. for(var i=0;i<e.length;i++){
  83. if(""!=e[i].value){
  84. evalue=evalue + e[i].value +",";
  85. }
  86. }
  87. $("#upload_id").val(evalue);
  88. return true;
  89. }else{
  90. return false;
  91. }
  92. }
  93. $(function() {
  94. $("#accident_time").ligerDateEditor({
  95. labelAlign : 'left'
  96. //initValue : '${requestScope.device.dev_buy_date }'
  97. });
  98. });
  99. /**
  100. * 选择车牌号函数
  101. */
  102. function chooseCustomer(o) {
  103. o = $.extend({
  104. plate_number_id : "plate_number_id",
  105. plate_number : "plate_number",
  106. out_car_mileage : "out_car_mileage",
  107. motorcade : "motorcade",
  108. checkbox : true
  109. }, o);
  110. $.ligerDialog.open({
  111. url : 'carMotorcadeCarAction.do?task=carList2&state=3&lookup=lookup&checkbox='+o.checkbox,
  112. height : 350,
  113. width : 800,
  114. title : "车辆信息",
  115. buttons : [
  116. {
  117. text : '确定',
  118. onclick : function(item, dialog) {
  119. var rows = dialog.frame.f_select();
  120. if(rows.length == 0){
  121. $.ligerDialog.alert('请选择一个车辆信息!', '提示', 'warn');
  122. return;
  123. }
  124. if(rows.length > 1){
  125. $.ligerDialog.alert('只能选择一个车辆信息!', '提示', 'warn');
  126. return;
  127. }
  128. var universalids = "", plate_numbers = "" ,initial_ranges = "" ,motorcades = "";
  129. if (rows) {
  130. for ( var i = 0; i < rows.length; i++) {
  131. universalids += ("," + rows[i].universalid);
  132. plate_numbers += ("," + rows[i].plate_number);
  133. initial_ranges += ("," + rows[i].initial_range);
  134. motorcades += ("," + rows[i].motorcade_name);
  135. }
  136. universalid = universalids.substring(1, universalids.length);
  137. plate_number = plate_numbers.substring(1, plate_numbers.length);
  138. initial_range = initial_ranges.substring(1, initial_ranges.length);
  139. motorcade = motorcades.substring(1, motorcades.length);
  140. }
  141. if ($("#" + o.plate_number_id).length > 0){
  142. $("#" + o.plate_number_id).val(universalid);
  143. }
  144. if ($("#" + o.plate_number).length > 0){
  145. $("#" + o.plate_number).val(plate_number);
  146. }
  147. if ($("#" + o.out_car_mileage).length > 0){
  148. $("#" + o.out_car_mileage).val(initial_range);
  149. }
  150. if ($("#" + o.motorcade).length > 0){
  151. $("#" + o.motorcade).val(motorcade);
  152. }
  153. //加一个获取联系列表的方法,实现客户和联系人的联动效果
  154. //if('' != o.inputid && 'undefined' != o.inputid){
  155. //getContacterList(ids, o);
  156. //}
  157. dialog.close();
  158. $(".l-dialog-win").remove();
  159. }
  160. }, {
  161. text : '取消',
  162. onclick : function(item, dialog) {
  163. dialog.close();
  164. $(".l-dialog-win").remove();
  165. }
  166. } ],
  167. name : "listDialog"
  168. });
  169. }
  170. //选择驾驶员
  171. function chooseDriver(o){
  172. o = $.extend({
  173. driver_id : "driver_id",
  174. driver : "driver",
  175. checkbox : true
  176. }, o);
  177. $.ligerDialog.open({
  178. url : 'carDriverAction.do?task=toList2&lookup=lookup&checkbox='+o.checkbox,
  179. height : 350,
  180. width : 980,
  181. title : "驾驶员",
  182. buttons : [
  183. {
  184. text : '确定',
  185. onclick : function(item, dialog) {
  186. var rows = dialog.frame.f_select();
  187. if(rows.length == 0){
  188. $.ligerDialog.alert('请选择一个单位信息!', '提示', 'warn');
  189. return;
  190. }
  191. if(rows.length > 1){
  192. $.ligerDialog.alert('只能选择一个单位信息!', '提示', 'warn');
  193. return;
  194. }
  195. var universalids = "", driver_names = "";
  196. if (rows) {
  197. for ( var i = 0; i < rows.length; i++) {
  198. universalids += ("," + rows[i].universalid);
  199. driver_names += ("," + rows[i].driver_name);
  200. }
  201. universalid = universalids.substring(1, universalids.length);
  202. driver_name = driver_names.substring(1, driver_names.length);
  203. }
  204. if ($("#" + o.driver_id).length > 0){
  205. $("#" + o.driver_id).val(universalid);
  206. }
  207. if ($("#" + o.driver).length > 0){
  208. $("#" + o.driver).val(driver_name);
  209. }
  210. dialog.close();
  211. $(".l-dialog-win").remove();
  212. }
  213. }, {
  214. text : '取消',
  215. onclick : function(item, dialog) {
  216. dialog.close();
  217. $(".l-dialog-win").remove();
  218. }
  219. } ],
  220. name : "listDialog"
  221. });
  222. }
  223. function refresh(obj){
  224. if(obj == "1"){
  225. parent.location.reload();
  226. }
  227. }
  228. </script>
  229. <style type="text/css">
  230. .file-style{
  231. width: 550px;
  232. }
  233. .file-style input[type='file'] {
  234. width:385px ;
  235. height:24px;
  236. line-height:22px;
  237. vertical-align: bottom;
  238. background-color: #fff;
  239. border: 1px solid #cccccc;
  240. margin-top: 2px;
  241. margin-bottom: 2px;
  242. }
  243. </style>
  244. </head>
  245. <body>
  246. <%@ include file="/include/message.jsp"%>
  247. <form action="carAccidentAction.do" method="post" onsubmit="return checkForm()">
  248. <div id="title" class="form-button">
  249. <input type="submit" class="l-button" value="保存" />
  250. <input type="button" value="关闭" class="l-button" onclick="closeWindow();" />
  251. </div>
  252. <div class="container-layout">
  253. <div class="forum-container">
  254. <center>
  255. <table class="l-table-edit line">
  256. <tr>
  257. <th colspan="4">
  258. 事故信息
  259. </th>
  260. </tr>
  261. <tr>
  262. <td class="l-table-edit-text">车牌号<FONT COLOR="red">*</FONT>:</td>
  263. <td class="l-table-edit-td" width="40%" colspan="3">
  264. <input type="text" id="plate_number" name="plate_number" value="" readonly="readonly">
  265. <input type="hidden" id="plate_number_id" name="plate_number_id" value="" readonly="readonly">
  266. <input type="button" class="l-button" value="选择"
  267. onclick="chooseCustomer({plate_number_id:'plate_number_id',plate_number:'plate_number',out_car_mileage:'out_car_mileage',motorcade:'motorcade'});" />
  268. </td>
  269. </tr>
  270. <tr>
  271. <td class="l-table-edit-text" width="15%">事故日期<FONT COLOR="red">*</FONT>:</td>
  272. <td class="l-table-edit-td" width="35%">
  273. <input type="text" id="accident_time" name="accident_time" value="" readonly="readonly">
  274. <input type="hidden" id="accident_time" name="accident_time" value="">
  275. </td>
  276. <td class="l-table-edit-text" width="15%">事故项目:</td>
  277. <td class="l-table-edit-td" width="35%">
  278. <input type="text" id="accident_explain" name="accident_explain" value="" >
  279. </td>
  280. </tr>
  281. <tr>
  282. <td class="l-table-edit-text" width="15%">文件处理号:</td>
  283. <td class="l-table-edit-td" width="35%">
  284. <input type="text" id="dispose_number" name="dispose_number" value="">
  285. </td>
  286. <td class="l-table-edit-text">事故驾驶员:</td>
  287. <td class="l-table-edit-td">
  288. <input type="text" id="driver" name="driver" value="" readonly="readonly">
  289. <input type="hidden" id="driver_id" name="driver_id" value="">
  290. <input type="button" class="l-button" value="选择" id="select5"
  291. onclick="chooseDriver({driver_id:'driver_id',driver:'driver'});"/>
  292. </td>
  293. </tr>
  294. <tr>
  295. <td class="l-table-edit-text">事故地点:</td>
  296. <td class="l-table-edit-td" colspan="3">
  297. <div style="float: left;">
  298. <textarea id="accident_place" name="accident_place" rows="3" cols="61"></textarea>
  299. </div>
  300. </td>
  301. </tr>
  302. <tr>
  303. <td class="l-table-edit-text">处理情况:</td>
  304. <td class="l-table-edit-td" colspan="3">
  305. <div style="float: left;">
  306. <textarea id="dispose_condition" name="dispose_condition" rows="3" cols="61"></textarea>
  307. </div>
  308. </td>
  309. </tr>
  310. <tr>
  311. <td class="l-table-edit-text">处理结果:</td>
  312. <td class="l-table-edit-td" colspan="3">
  313. <div style="float: left;">
  314. <textarea id="dispose_result" name="dispose_result" rows="3" cols="61"></textarea>
  315. </div>
  316. </td>
  317. </tr>
  318. <tr>
  319. <td class="l-table-edit-text">定损人:</td>
  320. <td class="l-table-edit-td">
  321. <input type="text" id="people_decide" name="people_decide" value="">
  322. </td>
  323. <td class="l-table-edit-text" width="15%">修理地点:</td>
  324. <td class="l-table-edit-td" width="35%">
  325. <input type="text" id="repair_place" name="repair_place" value="">
  326. </td>
  327. </tr>
  328. <tr>
  329. <td class="l-table-edit-text">责任认定:</td>
  330. <td class="l-table-edit-td">
  331. <input type="text" id="duty" name="duty" value="">
  332. </td>
  333. <td class="l-table-edit-text" width="15%">保险赔偿金额:</td>
  334. <td class="l-table-edit-td" width="35%">
  335. <input type="text" id="insurance_compensation" name="insurance_compensation" value="">
  336. </td>
  337. </tr>
  338. <tr style="height: 35px;">
  339. <td class="l-table-edit-text">上传附件:</td>
  340. <td class="l-table-edit-td" colspan="3">
  341. <input type="hidden" name="upload_id" id="upload_id">
  342. <jsp:include page="/include/file.jsp">
  343. <jsp:param name="fieldName" value="documentId"/>
  344. <jsp:param name="folder" value="car"/>
  345. <jsp:param name="documentId" value=""/>
  346. <jsp:param name="size" value="5" />
  347. <jsp:param name="isDelFile" value="2" />
  348. <jsp:param name="definedCss" value="file-style" />
  349. <jsp:param name="isCrypt" value="1" />
  350. </jsp:include>
  351. </td>
  352. </tr>
  353. <tr>
  354. <td class="l-table-edit-text">备注:</td>
  355. <td class="l-table-edit-td" colspan="3">
  356. <div style="float: left;">
  357. <textarea id="remark" name="remark" rows="3" cols="61"></textarea>
  358. </div>
  359. </td>
  360. </tr>
  361. </table>
  362. <input type="hidden" id="dev_id" name="dev_id" value="">
  363. <input type="hidden" id="task" name="task" value="doAddAccident">
  364. <input type="hidden" id="tabid" name="tabid" value="${requestScope.tabid}">
  365. </center>
  366. </div>
  367. </div>
  368. </form>
  369. </body>
  370. </html>