addOutCarInto.jsp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  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. <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  9. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  10. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  11. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  12. <script type="text/javascript" src="/shares/js/constant.js"></script>
  13. <script type="text/javascript" src="/shares/js/common.js"></script>
  14. <script src="/shares/xheditor/xheditor-1.1.14/xheditor-1.1.14-zh-cn.min.js" type="text/javascript"></script>
  15. <script src="${pageContext.request.contextPath}/liger/lib/json2.js" type="text/javascript"></script>
  16. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
  17. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  18. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
  19. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
  20. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
  21. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>
  22. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
  23. <script type="text/javascript" src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"></script>
  24. <script type="text/javascript">
  25. function checkForm(){
  26. var rs = $.validate({
  27. name : "application",
  28. model : [ {
  29. type : "require",
  30. msg : "申请单号不能为空!"
  31. },{type : "len",min : 0,max : 30,msg : "申请单号长度不能超过30个字符!"}]
  32. });
  33. rs = $.validate({
  34. name : "plate_number",
  35. model : [ {
  36. type : "require",
  37. msg : "车牌号不能为空!"
  38. }]
  39. }) && rs;
  40. if (rs) {
  41. $("#requestForm").submit();
  42. }else{
  43. return false;
  44. }
  45. }
  46. /**
  47. * 选择车牌号函数
  48. */
  49. var car_ky = "${requestScope.CAR_KY}";
  50. var car_cc= "${requestScope.CAR_CC}";
  51. var car_wx = "${requestScope.CAR_WX}";
  52. var car_qt = "${requestScope.CAR_QT}";
  53. function chooseCustomer(o) {
  54. o = $.extend({
  55. plate_number_id : "plate_number_id",
  56. plate_number : "plate_number",
  57. out_car_mileage : "out_car_mileage",
  58. motorcade : "motorcade",
  59. checkbox : true
  60. }, o);
  61. $.ligerDialog.open({
  62. url : 'carMotorcadeCarAction.do?task=carList2&car_state='+car_ky+'-'+car_qt+'&state=1&lookup=lookup&checkbox='+o.checkbox,
  63. height : 350,
  64. width : 800,
  65. title : "车辆信息",
  66. buttons : [
  67. {
  68. text : '确定',
  69. onclick : function(item, dialog) {
  70. var rows = dialog.frame.f_select();
  71. if(rows.length == 0){
  72. $.ligerDialog.alert('请选择一个车辆信息!', '提示', 'warn');
  73. return;
  74. }
  75. if(rows.length > 1){
  76. $.ligerDialog.alert('只能选择一个车辆信息!', '提示', 'warn');
  77. return;
  78. }
  79. var universalids = "", plate_numbers = "" ,initial_ranges = "" ,motorcades = "";
  80. if (rows) {
  81. for ( var i = 0; i < rows.length; i++) {
  82. universalids += ("," + rows[i].universalid);
  83. plate_numbers += ("," + rows[i].plate_number);
  84. initial_ranges += ("," + rows[i].initial_range);
  85. motorcades += ("," + rows[i].motorcade_name);
  86. }
  87. universalid = universalids.substring(1, universalids.length);
  88. plate_number = plate_numbers.substring(1, plate_numbers.length);
  89. initial_range = initial_ranges.substring(1, initial_ranges.length);
  90. motorcade = motorcades.substring(1, motorcades.length);
  91. }
  92. if ($("#" + o.plate_number_id).length > 0){
  93. $("#" + o.plate_number_id).val(universalid);
  94. }
  95. if ($("#" + o.plate_number).length > 0){
  96. $("#" + o.plate_number).val(plate_number);
  97. }
  98. if ($("#" + o.out_car_mileage).length > 0){
  99. $("#" + o.out_car_mileage).val(initial_range);
  100. }
  101. if ($("#" + o.motorcade).length > 0){
  102. $("#" + o.motorcade).val(motorcade);
  103. }
  104. //加一个获取联系列表的方法,实现客户和联系人的联动效果
  105. //if('' != o.inputid && 'undefined' != o.inputid){
  106. //getContacterList(ids, o);
  107. //}
  108. dialog.close();
  109. $(".l-dialog-win").remove();
  110. }
  111. }, {
  112. text : '取消',
  113. onclick : function(item, dialog) {
  114. dialog.close();
  115. $(".l-dialog-win").remove();
  116. }
  117. } ],
  118. name : "listDialog"
  119. });
  120. }
  121. //申请单号
  122. function chooseApplication(o) {
  123. o = $.extend({
  124. universalid : "universalid",
  125. application : "application",
  126. car_department : "car_department",
  127. car_people : "car_people",
  128. destination : "destination",
  129. out_car_time : "out_car_time",
  130. out_car_reason : "out_car_reason",
  131. predict_return_time : "predict_return_time",
  132. entourage : "entourage",
  133. remark :"remark",
  134. checkbox : true
  135. }, o);
  136. $.ligerDialog.open({
  137. url : 'carReturnCarAction.do?task=toReturnCarListOk2&lookup=lookup&checkbox='+o.checkbox,
  138. height : 350,
  139. width : 800,
  140. title : "审核通过的用车申请",
  141. buttons : [{text : '确定',
  142. onclick : function(item, dialog) {
  143. var rows = dialog.frame.f_select();
  144. if(rows.length == 0){
  145. $.ligerDialog.alert('请选择一个用车信息!', '提示', 'warn');
  146. return;
  147. }
  148. if(rows.length > 1){
  149. $.ligerDialog.alert('只能选择一个用车信息!', '提示', 'warn');
  150. return;
  151. }
  152. var universalids="",applications="",car_departments ="",car_peoples ="",destinations ="",out_car_times ="",out_car_reasons ="",predict_return_times="",entourages="",remarks="";
  153. if (rows) {
  154. for ( var i = 0; i < rows.length; i++) {
  155. universalids += ("," + rows[i].universalid);
  156. applications += ("," + rows[i].application);
  157. car_departments += ("," + rows[i].car_department_name);
  158. car_peoples += ("," + rows[i].car_people_name);
  159. destinations += ("," + rows[i].destination);
  160. out_car_times += ("," + rows[i].out_car_time);
  161. out_car_reasons += ("," + rows[i].out_car_reason);
  162. predict_return_times += ("," + rows[i].predict_return_time);
  163. entourages += ("," + rows[i].entourage);
  164. remarks += ("," + rows[i].remark);
  165. }
  166. universalid = universalids.substring(1, universalids.length);
  167. application = applications.substring(1, applications.length);
  168. car_department = car_departments.substring(1, car_departments.length);
  169. car_people = car_peoples.substring(1, car_peoples.length);
  170. destination = destinations.substring(1, destinations.length);
  171. out_car_time = out_car_times.substring(1, out_car_times.length);
  172. out_car_reason = out_car_reasons.substring(1, out_car_reasons.length);
  173. predict_return_time = predict_return_times.substring(1, predict_return_times.length);
  174. entourage = entourages.substring(1, entourages.length);
  175. remark = remarks.substring(1, remarks.length);
  176. }
  177. if ($("#" + o.universalid).length > 0){
  178. $("#" + o.universalid).val(universalid);
  179. }
  180. if ($("#" + o.application).length > 0){
  181. $("#" + o.application).val(application);
  182. }
  183. if ($("#" + o.application).length > 0){
  184. $("#" + o.application).val(application);
  185. }
  186. if ($("#" + o.car_department).length > 0){
  187. $("#" + o.car_department).val(car_department);
  188. }
  189. if ($("#" + o.car_people).length > 0){
  190. $("#" + o.car_people).val(car_people);
  191. }
  192. if ($("#" + o.destination).length > 0){
  193. $("#" + o.destination).val(destination);
  194. }
  195. if ($("#" + o.out_car_time).length > 0){
  196. $("#" + o.out_car_time).val(out_car_time);
  197. }
  198. if ($("#" + o.out_car_reason).length > 0){
  199. $("#" + o.out_car_reason).val(out_car_reason);
  200. }
  201. if ($("#" + o.predict_return_time).length > 0){
  202. if(predict_return_time == 'null'){
  203. $("#" + o.predict_return_time).val("");
  204. }else{
  205. $("#" + o.predict_return_time).val(predict_return_time);
  206. }
  207. }
  208. if ($("#" + o.entourage).length > 0){
  209. $("#" + o.entourage).val(entourage);
  210. }
  211. if ($("#" + o.remark).length > 0){
  212. $("#" + o.remark).val(remark);
  213. }
  214. dialog.close();
  215. $(".l-dialog-win").remove();
  216. }
  217. }, {
  218. text : '取消',
  219. onclick : function(item, dialog) {
  220. dialog.close();
  221. $(".l-dialog-win").remove();
  222. }} ],
  223. name : "listDialog"
  224. });
  225. }
  226. //选择驾驶员
  227. function chooseDriver(o){
  228. o = $.extend({
  229. driver_id : "driver_id",
  230. driver : "driver",
  231. checkbox : true
  232. }, o);
  233. $.ligerDialog.open({
  234. url : 'carDriverAction.do?task=toList2&lookup=lookup&checkbox='+o.checkbox,
  235. height : 350,
  236. width : 980,
  237. title : "驾驶员",
  238. buttons : [
  239. {
  240. text : '确定',
  241. onclick : function(item, dialog) {
  242. var rows = dialog.frame.f_select();
  243. if(rows.length == 0){
  244. $.ligerDialog.alert('请选择一个单位信息!', '提示', 'warn');
  245. return;
  246. }
  247. if(rows.length > 1){
  248. $.ligerDialog.alert('只能选择一个单位信息!', '提示', 'warn');
  249. return;
  250. }
  251. var universalids = "", driver_names = "";
  252. if (rows) {
  253. for ( var i = 0; i < rows.length; i++) {
  254. universalids += ("," + rows[i].universalid);
  255. driver_names += ("," + rows[i].driver_name);
  256. }
  257. universalid = universalids.substring(1, universalids.length);
  258. driver_name = driver_names.substring(1, driver_names.length);
  259. }
  260. if ($("#" + o.driver_id).length > 0){
  261. $("#" + o.driver_id).val(universalid);
  262. }
  263. if ($("#" + o.driver).length > 0){
  264. $("#" + o.driver).val(driver_name);
  265. }
  266. dialog.close();
  267. $(".l-dialog-win").remove();
  268. }
  269. }, {
  270. text : '取消',
  271. onclick : function(item, dialog) {
  272. dialog.close();
  273. $(".l-dialog-win").remove();
  274. }
  275. } ],
  276. name : "listDialog"
  277. });
  278. }
  279. /* function refresh(obj){
  280. if(obj == "1"){
  281. parent.location.reload();
  282. }
  283. } */
  284. //获得焦点事件
  285. function onFocusCheck(objValue){
  286. //var motorcade_numbers = $("#motorcade_numbers").val();
  287. if(objValue != "" && typeof (objValue) != "undefined"){
  288. $("#application").val("");
  289. $("#applications").val(objValue);
  290. return;
  291. }
  292. }
  293. //失去焦点事件
  294. function onBlurCheck(objValue){
  295. var applications = $("#applications").val();
  296. if(objValue != "" && typeof (objValue) != "undefined"){
  297. return;
  298. }else{
  299. $("#application").val(applications);
  300. }
  301. }
  302. function CloseWin(){
  303. window.parent.dialog.close();
  304. }
  305. function refresh(obj){
  306. if(obj == "1"){
  307. var tabIframe = window.parent.document.getElementsByName("${requestScope.tabid}");
  308. tabIframe[0].contentDocument.getElementsByName("content2")[0].contentWindow.closeDialog();
  309. tabIframe[0].contentDocument.getElementsByName("content2")[0].contentWindow.location.reload();
  310. //window.parent.submitItemName();
  311. //window.parent.obj.close();
  312. }
  313. }
  314. function closeW(){
  315. var tabIframe = window.parent.document.getElementsByName("${requestScope.tabid}");
  316. tabIframe[0].contentDocument.getElementsByName("content2")[0].contentWindow.closeDialog();
  317. }
  318. $(document).ready(function() {
  319. $("[name='destination']").focus();
  320. refresh('${msgEvent}');
  321. });
  322. </script>
  323. <style type="text/css">
  324. .file-style{
  325. width: 550px;
  326. }
  327. .file-style input[type='file'] {
  328. width:385px ;
  329. height:24px;
  330. line-height:22px;
  331. vertical-align: bottom;
  332. background-color: #fff;
  333. border: 1px solid #cccccc;
  334. margin-top: 2px;
  335. margin-bottom: 2px;
  336. }
  337. </style>
  338. </head>
  339. <body>
  340. <%@ include file="/include/message.jsp"%>
  341. <form id="requestForm" action="carOutCarAction.do" method="post">
  342. <div id="title" class="form-button">
  343. <input type="button" class="l-button" value="保存" onclick="checkForm()" />
  344. <c:if test="${type == null}">
  345. <input type="button" value="关闭" class="l-button" onclick="closeWindow();" />
  346. </c:if>
  347. <c:if test="${type == '1'}">
  348. <input type="button" value="关闭" class="l-button" onclick="closeW();" />
  349. </c:if>
  350. </div>
  351. <div class="container-layout">
  352. <div class="forum-container">
  353. <center>
  354. <table class="l-table-edit line">
  355. <tr>
  356. <th colspan="4">
  357. 出车登记信息
  358. </th>
  359. </tr>
  360. <tr>
  361. <td class="l-table-edit-text">车牌号<FONT COLOR="red">*</FONT>:</td>
  362. <td class="l-table-edit-td" colspan="3">
  363. <input type="text" id="plate_number" name="plate_number" value="${car.plate_number}" onfocus="this.blur()">
  364. <input type="hidden" id="plate_number_id" name="plate_number_id" value="${car.universalid}" readonly="readonly">
  365. <c:if test="${car.universalid == null }">
  366. <input type="button" class="l-button" value="选择"
  367. onclick="chooseCustomer({plate_number_id:'plate_number_id',plate_number:'plate_number',out_car_mileage:'out_car_mileage',motorcade:'motorcade'});" />
  368. </c:if>
  369. </td>
  370. </tr>
  371. <tr>
  372. <td class="l-table-edit-text">申请单号<FONT COLOR="red">*</FONT>:</td>
  373. <td class="l-table-edit-td" colspan="3">
  374. <input type="text" id="application" name="application" value="${application}" onfocus="this.blur()">
  375. <input type="hidden" id="applications" name="applications" value=""/>
  376. <input type="button" class="l-button" value="选择"
  377. onclick="chooseApplication({universalid:'universalid',application:'application',car_department:'car_department',car_people:'car_people',destination:'destination',out_car_time:'out_car_time',out_car_reason:'out_car_reason',predict_return_time : 'predict_return_time',entourage : 'entourage',remark :'remark'});" />
  378. <!-- onclick="chooseCustomer({car_department:'car_department',car_people:'car_people',out_car_time:'out_car_time',predict_return_time:'predict_return_time',destination:'destination',entourage:'entourage',out_car_reason:'out_car_reason',remark:'remark'});" /> -->
  379. </td>
  380. </tr>
  381. <tr>
  382. <td class="l-table-edit-text">驾驶员:</td>
  383. <td class="l-table-edit-td">
  384. <input type="text" id="driver" name="driver" value="" onfocus="this.blur()">
  385. <input type="hidden" id="driver_id" name="driver_id" value="">
  386. <input type="button" class="l-button" value="选择" id="select5"
  387. onclick="chooseDriver({driver_id:'driver_id',driver:'driver'});"/>
  388. </td>
  389. </tr>
  390. <tr>
  391. <!-- style="border: none;" onfocus="this.blur()" -->
  392. <td class="l-table-edit-text">用车部门:</td>
  393. <td class="l-table-edit-td" colspan="3">
  394. <input id="car_department" name="car_department" type="text" value="${group.groupName }" style="border: none;" onfocus="this.blur()">
  395. </td>
  396. </tr>
  397. <tr>
  398. <td class="l-table-edit-text">用车人:</td>
  399. <td class="l-table-edit-td" colspan="3">
  400. <input type="text" id="car_people" name="car_people" value="${name }" style="border: none;" onfocus="this.blur()">
  401. </td>
  402. </tr>
  403. <tr>
  404. <td class="l-table-edit-text">出车时间:</td>
  405. <td class="l-table-edit-td" colspan="3">
  406. <input type="text" id="out_car_time" name="out_car_time" value="" style="border: none;" onfocus="this.blur()">
  407. </td>
  408. </tr>
  409. <tr>
  410. <td class="l-table-edit-text">预计回车时间:</td>
  411. <td class="l-table-edit-td" colspan="3">
  412. <input type="text" id="predict_return_time" name="predict_return_time" value="" style="border: none;" onfocus="this.blur()">
  413. </td>
  414. </tr>
  415. <tr>
  416. <td class="l-table-edit-text">出车里程</td>
  417. <td class="l-table-edit-td">
  418. <input type="text" id="out_car_mileage" name="out_car_mileage" value="${car.initial_range }" style="border: none;" onfocus="this.blur()">
  419. </td>
  420. </tr>
  421. <tr>
  422. <td class="l-table-edit-text">目的地:</td>
  423. <td class="l-table-edit-td" colspan="3">
  424. <input type="text" id="destination" name="destination" value="" style="border: none;" onfocus="this.blur()">
  425. </td>
  426. </tr>
  427. <tr>
  428. <td class="l-table-edit-text">随行人员:</td>
  429. <td class="l-table-edit-td" colspan="3">
  430. <input type="text" id="entourage" name="entourage" value="" style="border: none;" onfocus="this.blur()">
  431. </td>
  432. </tr>
  433. <tr>
  434. <td class="l-table-edit-text">所属车队:</td>
  435. <td class="l-table-edit-td" colspan="3">
  436. <input type="text" id="motorcade" name="motorcade" value="${car.motorcade_name }" style="border: none;" onfocus="this.blur()">
  437. </td>
  438. </tr>
  439. <tr>
  440. <td class="l-table-edit-text">出车原因:</td>
  441. <td class="l-table-edit-td" colspan="3">
  442. <input type="text" id="out_car_reason" name="out_car_reason" value="" style="border: none;" onfocus="this.blur()" >
  443. <!-- <div style="float: left;">
  444. <textarea id="out_car_reason" name="out_car_reason" rows="3" cols="60"></textarea>
  445. </div> -->
  446. </td>
  447. </tr>
  448. <tr>
  449. <td class="l-table-edit-text">备注:</td>
  450. <td class="l-table-edit-td" colspan="3">
  451. <input type="text" id="remark" name="remark" value="" style="border: none;" onfocus="this.blur()">
  452. <!-- <div style="float: left;" >
  453. <textarea id="remark" name="remark" rows="3" cols="60"></textarea>
  454. </div> -->
  455. <!-- <input type="text" id="dev_remark" name="dev_remark" value="${requestScope.device.dev_remark }"> -->
  456. </td>
  457. </tr>
  458. </table>
  459. <input type="hidden" id="types" name="types" value="${requestScope.type }">
  460. <input type="hidden" id="dev_id" name="dev_id" value="">
  461. <input type="hidden" id="universalid" name="universalid" value="">
  462. <input type="hidden" id="task" name="task" value="doAddOutCarInto">
  463. <input type="hidden" id="tabid" name="tabid" value="${requestScope.tabid}">
  464. </center>
  465. </div>
  466. </div>
  467. </form>
  468. </body>
  469. </html>