editDriver.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  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. <script src="/shares/js/jquery-1.6.4.min.js" type="text/javascript"></script>
  9. <script type="text/javascript" src="/shares/js/constant.js"></script>
  10. <script type="text/javascript" src="/shares/js/common.js"></script>
  11. <script type="text/javascript" src="/shares/js/file.js"></script>
  12. <link href="${pageContext.request.contextPath }/main.css" rel="stylesheet" type="text/css" />
  13. <script src="/shares/xheditor/xheditor-1.1.14/xheditor-1.1.14-zh-cn.min.js" type="text/javascript" ></script>
  14. <link href="./liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css"></link>
  15. <script src="./liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  16. <script src="./liger/lib/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
  17. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
  18. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
  19. <script type="text/javascript">
  20. //焦点
  21. $(document).ready(function() {
  22. $("input[type='text']:first").focus();
  23. });
  24. $(function (){
  25. var id = "${driver.driver_type }";
  26. var name = "${requestScope.driver_types }";
  27. $("#sex").ligerComboBox();
  28. $("#driver_type").ligerComboBox({
  29. selectBoxHeight: 200,
  30. initText:''+name+'',
  31. initValue:''+id+'',
  32. url :'carDictionaryAction.do?task=toDictionaryListTypes',
  33. isShowCheckBox: true,
  34. isMultiSelect: true,
  35. textField : 'dictionary_name',
  36. valueField : 'universalid',
  37. valueFieldID: 'driver_type_id',
  38. split :','
  39. });
  40. });
  41. function checkForm(){
  42. var rs = $.validate({
  43. name : "driver_name",
  44. model : [ {type : "require",msg : "驾驶员姓名不能为空!"},
  45. {type : "len",min : 1,max : 50,msg : "驾驶员姓名长度不能超过50个字符!"} ]});
  46. rs = $.validate({
  47. name : "identity_card_number",
  48. model : [{type : "len",min : 0,max : 50,msg : "身份证号码长度不能超过50个字符!"}]}) && rs;
  49. rs = $.validate({
  50. name : "driver_number",
  51. model : [{type : "len",min : 0,max : 50,msg : "驾驶证号长度不能超过50个字符!"}]}) && rs;
  52. rs = $.validate({
  53. name : "remark",
  54. model : [ {type : "len",min : 0,max : 255,msg : "备注长度不能超过255个字符!"}]}) && rs;
  55. /* rs = $.validate({
  56. name : "sex",
  57. model : [ {type : "require",msg : "驾驶员性别不能为空!"} ]}) && rs;
  58. rs = $.validate({
  59. name : "identity_card_number",
  60. model : [ {type : "require",msg : "身份证号码不能为空!"},
  61. {type : "len",min : 1,max : 50,msg : "身份证号码长度不能超过50个字符!"}
  62. // { type : "regex",
  63. //regex: new RegExp("^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$"),
  64. //msg : "身份证格式输入错误"
  65. //}
  66. ]}) && rs;
  67. rs = $.validate({
  68. name : "driver_type",
  69. model : [ {type : "require",msg : "准驾类型不能为空!"}]}) && rs;
  70. //,msgBox:"driver_type_empty"}
  71. rs = $.validate({
  72. name : "driver_number",
  73. model : [ {type : "require",msg : "驾驶证号不能为空!"},
  74. {type : "len",min : 1,max : 50,msg : "驾驶证号长度不能超过50个字符!"}
  75. // { type : "regex",
  76. //regex: new RegExp("^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$"),
  77. //msg : "驾驶证号格式输入错误"
  78. //}
  79. ]}) && rs;
  80. rs = $.validate({
  81. name : "issuing_authority",
  82. model : [ {type : "require",msg : "发证机关不能为空!"},
  83. {type : "len",min : 1,max : 50,msg : "发证机关长度不能超过50个字符!"}]}) && rs;
  84. rs = $.validate({
  85. name : "get_Date",
  86. model : [ {type : "require",msg : "领证日期不能为空!"}]}) && rs;
  87. rs = $.validate({
  88. name : "begin_date",
  89. model : [ {type : "require",msg : "有效开始时间不为空!",msgBox:"begin_date_prompt"}]}) && rs;
  90. rs = $.validate({
  91. name : "end_date",
  92. model : [ {type : "require",msg : "有效结束时间不为空!",msgBox:"end_date_prompt"}]}) && rs;
  93. rs = $.validate({
  94. name : "practitioners_number",
  95. model : [ {type : "len",min : 0,max : 50,msg : "从业资格证号长度不能超过50个字符!"}]}) && rs;
  96. rs = $.validate({
  97. name : "remark",
  98. model : [ {type : "len",min : 0,max : 255,msg : "备注长度不能超过255个字符!"}]}) && rs; */
  99. if (rs) {
  100. /* var begin_date = $("#begin_date").val();
  101. var end_date = $("#end_date").val();
  102. var begin_dates = begin_date.split("-");
  103. var starttime = (new Date(begin_dates[0], begin_dates[1], begin_dates[2])).getTime();
  104. var end_dates = end_date.split("-");
  105. var endtime = (new Date(end_dates[0], end_dates[1], end_dates[2])).getTime();
  106. if (starttime >= endtime) {
  107. $.ligerDialog.alert('有效期结束时间不能小于开始时间!', '提示', 'warn');
  108. return false;
  109. } */
  110. return true;
  111. }else{
  112. return false;
  113. }
  114. }
  115. $(function() {
  116. loadTypeTree("selectbutton1", {type : "singleuser",backId : "dev_buy_person",backName : "dev_buy_person_name",tab : 1});
  117. loadTypeTree("selectbutton2", {type : "detpusersingle",backId : "dev_useman",backName : "dev_useman_name",tab : 1});
  118. $("#get_Date").ligerDateEditor({labelAlign : 'left'});
  119. $("#begin_date").ligerDateEditor({labelAlign : 'left'});
  120. $("#end_date").ligerDateEditor({labelAlign : 'left'});
  121. });
  122. //选择准驾类型
  123. function chooseDriverType(o){
  124. var driver_Type = ${requestScope.driver_Type};
  125. o = $.extend({
  126. driver_type_id : "driver_type_id",
  127. driver_type : "driver_type",
  128. checkbox : true
  129. }, o);
  130. $.ligerDialog.open({
  131. url : 'carDictionaryAction.do?task=toList2&driver_type='+driver_Type+'&lookup=lookup&checkbox='+o.checkbox,
  132. height : 340,
  133. width : 800,
  134. title : "准驾类型",
  135. buttons : [{text : '确定',
  136. onclick : function(item, dialog) {
  137. var rows = dialog.frame.f_select();
  138. if(rows.length == 0){
  139. $.ligerDialog.alert('请选择一个信息!', '提示', 'warn');
  140. return;
  141. }
  142. var universalids = "", dictionary_names = "";
  143. if (rows) {
  144. for ( var i = 0; i < rows.length; i++) {
  145. universalids += ("," + rows[i].universalid);
  146. dictionary_names += ("," + rows[i].dictionary_name);
  147. }
  148. universalid = universalids.substring(1, universalids.length);
  149. dictionary_name = dictionary_names.substring(1, dictionary_names.length);
  150. }
  151. if ($("#" + o.driver_type_id).length > 0){
  152. $("#" + o.driver_type_id).val(universalid);
  153. }
  154. if ($("#" + o.driver_type).length > 0){
  155. $("#" + o.driver_type).val(dictionary_name);
  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. function refresh(obj){
  171. if(obj == "1"){
  172. parent.location.reload();
  173. }
  174. }
  175. </script>
  176. <style type="text/css">
  177. .file-style{
  178. width: 550px;
  179. }
  180. .file-style input[type='file'] {
  181. width:385px ;
  182. height:24px;
  183. line-height:22px;
  184. vertical-align: bottom;
  185. background-color: #fff;
  186. border: 1px solid #cccccc;
  187. margin-top: 2px;
  188. margin-bottom: 2px;
  189. }
  190. </style>
  191. </head>
  192. <body>
  193. <%@ include file="/include/message.jsp"%>
  194. <form action="carDriverAction.do" method="post" onsubmit="return checkForm()">
  195. <div id="title" class="form-button">
  196. <input type="submit" class="l-button" value="确定" />
  197. <input type="button" value="关闭" class="l-button" onclick="closeWindow();" />
  198. </div>
  199. <div class="container-layout">
  200. <div class="forum-container">
  201. <center>
  202. <table class="l-table-edit line">
  203. <tr>
  204. <th colspan="4">
  205. 驾驶员信息
  206. </th>
  207. </tr>
  208. <tr>
  209. <td class="l-table-edit-text">驾驶员姓名<FONT COLOR="red">*</FONT>:</td>
  210. <td class="l-table-edit-td" colspan="3">
  211. <input type="text" id="driver_name" name="driver_name" value="${driver.driver_name }" >
  212. </td>
  213. </tr>
  214. <tr>
  215. <td class="l-table-edit-text">性别:</td>
  216. <td class="l-table-edit-td" colspan="3">
  217. <select id="sex" name="sex" style="width: 60px;">
  218. <option value="${dictionary2.universalid }">${dictionary2.dictionary_name }</option>
  219. <c:forEach items="${dictionaries}" var="inforpubdict">
  220. <c:if test="${dictionary2.universalid != inforpubdict.universalid}">
  221. <option value="${inforpubdict.universalid}" >${inforpubdict.dictionary_name}</option>
  222. </c:if>
  223. </c:forEach>
  224. </select>
  225. </td>
  226. </tr>
  227. <tr>
  228. <td class="l-table-edit-text">驾驶证号:</td>
  229. <td class="l-table-edit-td" colspan="3">
  230. <input type="text" id="driver_number" name="driver_number" value="${driver.driver_number }">
  231. </td>
  232. </tr>
  233. <tr>
  234. <td class="l-table-edit-text">证件到期时间:</td>
  235. <td class="l-table-edit-td" colspan="3">
  236. <input type="text" id="end_date" name="end_date" value="${driver.end_date }" readonly="readonly">
  237. <label id="end_date_prompt"></label>
  238. </td>
  239. </tr>
  240. <tr>
  241. <td class="l-table-edit-text">准驾类型:</td>
  242. <td class="l-table-edit-td" colspan="3">
  243. <input type="text" id="driver_type" name="driver_type" value="${requestScope.driver_types }"/>
  244. <input type="hidden" id="driver_type_id" name="driver_type_id" value="${driver.driver_type }"/>
  245. <!-- <input type="button" class="l-button" value="选择"
  246. onclick="chooseDriverType({driver_type_id:'driver_type_id',driver_type:'driver_type'});" /> -->
  247. </td>
  248. </tr>
  249. <tr>
  250. <td class="l-table-edit-text">身份证号码:</td>
  251. <td class="l-table-edit-td" colspan="3">
  252. <input type="text" id="identity_card_number" name="identity_card_number" value="${driver.identity_card_number }">
  253. </td>
  254. </tr>
  255. <tr>
  256. <td class="l-table-edit-text">备注:</td>
  257. <td class="l-table-edit-td" colspan="3">
  258. <div style="float: left;">
  259. <textarea id="remark" name="remark" rows="3" cols="50">${driver.remark }</textarea>
  260. </div>
  261. </td>
  262. </tr>
  263. </table>
  264. <input type="hidden" id="universalid" name="universalid" value="${driver.universalid }">
  265. <input type="hidden" id="task" name="task" value="doEditDriver">
  266. <input type="hidden" id="tabid" name="tabid" value="${requestScope.tabid}">
  267. </center>
  268. </div>
  269. </div>
  270. </form>
  271. </body>
  272. </html>