addMotorcade.jsp 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  6. <title>新增车队</title>
  7. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  8. <link href="${ pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  9. <script type="text/javascript" src="/shares/js/jquery-1.3.2.min.js"></script>
  10. <script type="text/javascript" src="/shares/js/constant.js"></script>
  11. <script type="text/javascript" src="/shares/js/common.js"></script>
  12. <script type="text/javascript" src="/shares/js/yw/oa/appliance.js"></script>
  13. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  14. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
  15. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
  16. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerTree.js" type="text/javascript"></script>
  17. <script type="text/javascript">
  18. $(function (){
  19. $("#motorcade_names").ligerComboBox({
  20. width: 130,
  21. selectBoxWidth: 200,
  22. selectBoxHeight: 200,
  23. valueField: 'universalid',
  24. valueFieldID :'universalids',
  25. textField:'motorcade_name',
  26. treeLeafOnly:false,
  27. tree: { url: 'carMotorcadeCarAction.do?task=toMotorcadeList&time='+ new Date().getTime(),
  28. idFieldName :'universalid',
  29. parentIDFieldName :'pid',
  30. textFieldName : 'motorcade_name',
  31. parentIcon:'',
  32. childIcon:'',
  33. checkbox: false,
  34. onSuccess : function() {
  35. this.expandAll();
  36. }
  37. }
  38. });
  39. });
  40. $(function() {
  41. loadTypeTree("selectDeptButton",{type:"singledept",tab:"1,2,3",backId:"department_name",backName:"department"});
  42. loadTypeTree("selectbutton", {type : "singleuser",backId : "link_man_name",backName : "link_man",tab : "1,2,3"});
  43. });
  44. function checkForm(){
  45. var rs = $.validate({
  46. name : "motorcade_number",
  47. model : [ {
  48. type : "require",
  49. msg : "车队编号不能为空!"
  50. },{type : "len",min : 0,max : 20,msg : "车队编号长度不能超过20个字符!"}]
  51. });
  52. rs = $.validate({
  53. name : "motorcade_name",
  54. model : [ {
  55. type : "require",
  56. msg : "车队名称不能为空!"
  57. }, {
  58. type : "len",
  59. min : 1,
  60. max : 100,
  61. msg : "车队名称长度不能超过100个字!"
  62. } ]
  63. });
  64. /* rs = $.validate({
  65. name : "link_man",
  66. model : [ {
  67. type : "require",
  68. msg : "车队管理员不能为空!"
  69. }]
  70. })&& rs; */
  71. rs = $.validate({
  72. name : "link_phone",
  73. model : [ {
  74. type : "isNumber",
  75. msg : "请输入数字!"
  76. },{type : "len",min : 0,max : 50,msg : "联系电话长度不能超过50个字符!"}]
  77. })&& rs;
  78. if (rs) {
  79. return true;
  80. }else{
  81. return false;
  82. }
  83. }
  84. //查重
  85. function reRequestNumber(){
  86. var motorcade_names = document.getElementById("motorcade_name").value;
  87. var motorcade_name = encodeURI(motorcade_names);
  88. $.ajax({
  89. url:'carMotorcadeCarAction.do?task=checkRepeat',
  90. type: 'post',
  91. async: false,
  92. data: {'motorcade_name':motorcade_name},
  93. cache: false,
  94. error: function(obj){
  95. },
  96. success: function(obj){
  97. if(obj>0){
  98. addFieldError('motorcade_name','车队名称不能重复!');
  99. $("#btnSave").attr({"disabled":"disabled"});
  100. }else{
  101. clearSingelMsg('motorcade_name');
  102. $("#btnSave").removeAttr("disabled");//将按钮可用
  103. }
  104. }
  105. });
  106. }
  107. function CloseWin(){
  108. window.parent.dialog.close();
  109. }
  110. function refresh(obj){
  111. if(obj == "1"){
  112. //refreshWindow();
  113. //window.parent.loadTree();
  114. window.parent.reload();
  115. window.parent.dialog.close();
  116. }
  117. }
  118. //获得焦点事件
  119. function onFocusCheck(objValue){
  120. //var motorcade_numbers = $("#motorcade_numbers").val();
  121. if(objValue != "" && typeof (objValue) != "undefined"){
  122. $("#motorcade_number").val("");
  123. $("#motorcade_numbers").val(objValue);
  124. return;
  125. }
  126. }
  127. //失去焦点事件
  128. function onBlurCheck(objValue){
  129. var motoecadeCode = "${requestScope.motoecadeCode }";
  130. var motorcade_numbers = $("#motorcade_numbers").val();
  131. if(objValue != "" && typeof (objValue) != "undefined"){
  132. return;
  133. }else{
  134. $("#motorcade_number").val(motorcade_numbers);
  135. }
  136. }
  137. $(document).ready(function() {
  138. $("[name='motorcade_names']").focus();
  139. });
  140. </script>
  141. </head>
  142. <body onload="refresh(${msgEvent})">
  143. <%@ include file="/include/message.jsp"%>
  144. <form action="carMotorcadeCarAction.do" method="post" onsubmit="return checkForm();">
  145. <div id="title" class="form-button">
  146. <input id="btnSave" type="submit" class="l-button" value="保存" />
  147. <input type="button" class="l-button" value="关闭" onclick="CloseWin();" />
  148. </div>
  149. <div class="container-layout">
  150. <div class="forum-container">
  151. <center>
  152. <table class="l-table-edit line">
  153. <tr>
  154. <th colspan="2">新增车队信息</th>
  155. </tr>
  156. <tr>
  157. <td class="l-table-edit-text">上级车队<FONT COLOR="red">*</FONT>:</td>
  158. <td class="l-table-edit-td">
  159. <input type = "text" id = "motorcade_names" name="motorcade_names" value="${motorcade.motorcade_name }">
  160. <input type = "hidden" id = "universalids" nanme="universalids" value="${motorcade.universalid }" >
  161. </td>
  162. </tr>
  163. <tr>
  164. <td class="l-table-edit-text">车队名称<FONT COLOR="red">*</FONT>:</td>
  165. <td class="l-table-edit-td">
  166. <input type="text" id="motorcade_name" name="motorcade_name" value="" style="width: 203px;"/>
  167. </td>
  168. </tr>
  169. <tr>
  170. <td class="l-table-edit-text">车队编号<FONT COLOR="red">*</FONT>:</td>
  171. <td class="l-table-edit-td">
  172. <input type="text" id="motorcade_number" name="motorcade_number" value="${requestScope.motoecadeCode }" onfocus="onFocusCheck(this.value);" onblur="onBlurCheck(this.value);"/>
  173. <input type="hidden" id="motorcade_numbers" name="motorcade_numbers" value=""/>
  174. </td>
  175. </tr>
  176. <tr>
  177. <td class="l-table-edit-text">所属部门:</td>
  178. <td class="l-table-edit-td">
  179. <input type="text" id="department" name="department" value="" onfocus="this.blur()">
  180. <input type="hidden" id="department_name" name="department_name" value="">
  181. <input type="button" class="l-button" id="selectDeptButton" value="选择" />
  182. </td>
  183. </tr>
  184. <tr>
  185. <td class="l-table-edit-text">车队管理员:</td>
  186. <td class="l-table-edit-td">
  187. <input type="text" id="link_man" name="link_man" value="" onfocus="this.blur()">
  188. <input type="hidden" id="link_man_name" name="link_man_name" value="">
  189. <input type="button" class="l-button" id="selectbutton" value="选择" />
  190. </td>
  191. </tr>
  192. <tr>
  193. <td class="l-table-edit-text">管理员联系电话:</td>
  194. <td class="l-table-edit-td">
  195. <input type="text" id="link_phone" name="link_phone" value="" />
  196. </td>
  197. </tr>
  198. <!--
  199. <tr>
  200. <td class="l-table-edit-text">是否停用:</td>
  201. <td class="l-table-edit-td">
  202. <input type="checkbox" id="state" name="state" value="2" />
  203. </td>
  204. </tr>
  205. -->
  206. <tr>
  207. <td class="l-table-edit-text">备注:</td>
  208. <td class="l-table-edit-td">
  209. <div style="float: left;">
  210. <textarea id="remark" name="remark" rows="4" cols="31"></textarea>
  211. </div>
  212. </td>
  213. </tr>
  214. <tr>
  215. </tr>
  216. </table>
  217. <input type="hidden" id="task" name="task" value="toAddMotoecadeOk" />
  218. </center>
  219. </div>
  220. </div>
  221. </form>
  222. </body>
  223. </html>