addScrap.jsp 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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 type="text/javascript" src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"></script>
  16. <script type="text/javascript" src="/shares/js/file.js"></script>
  17. <script type="text/javascript">
  18. //焦点
  19. $(document).ready(function() {
  20. $("input[type='text']:first").focus();
  21. });
  22. function checkForm(){
  23. var rs = $.validate({
  24. name : "plate_number",
  25. model : [ {
  26. type : "require",
  27. msg : "车牌号不能为空!"
  28. }, {
  29. type : "len",
  30. min : 1,
  31. max : 50,
  32. msg : "车牌号长度不能超过50个字!"
  33. } ]
  34. });
  35. rs = $.validate({
  36. name : "car_type",
  37. model : [ {
  38. type : "require",
  39. msg : "车辆类型不能为空!"
  40. } ]
  41. }) && rs;
  42. /* rs = $.validate({
  43. name : "car_brand",
  44. model : [ {
  45. type : "require",
  46. msg : "车辆品牌不能为空!"
  47. }]
  48. }) && rs; */
  49. rs = $.validate({
  50. name : "scrap_date",
  51. model : [ {
  52. type : "require",
  53. msg : "报废时间不能为空!"
  54. }]
  55. }) && rs;
  56. rs = $.validate({
  57. name : "scrap_reason",
  58. model : [ {
  59. type : "require",
  60. msg : "报废原因不能为空!"
  61. }]
  62. }) && rs;
  63. if (rs) {
  64. //上传附件
  65. var e = document.getElementsByName("documentId");
  66. var evalue = "";
  67. for(var i=0;i<e.length;i++){
  68. if(""!=e[i].value){
  69. evalue=evalue + e[i].value +",";
  70. }
  71. }
  72. $("#upload_id").val(evalue);
  73. if (confirm("确定要报废该车吗?")) {
  74. return true;
  75. }else{
  76. return false;
  77. }
  78. }else{
  79. return false;
  80. }
  81. }
  82. $(function() {
  83. $("#scrap_date").ligerDateEditor({labelAlign : 'left'});
  84. loadTypeTree("selectUserButton1",{type:"singleuser",tab:"1",backId:"give_people_name",backName:"give_people"});
  85. loadTypeTree("selectUserButton2",{type:"singleuser",tab:"1",backId:"receive_people_name",backName:"receive_people"});
  86. });
  87. /**
  88. * 选择车牌号函数
  89. */
  90. function chooseCar(o) {
  91. o = $.extend({
  92. plate_number_id : "plate_number_id",
  93. plate_number : "plate_number",
  94. car_brand : "car_brand",
  95. run_mileage : "run_mileage",
  96. car_type : "car_type",
  97. engine_number : "engine_number",
  98. checkbox : true
  99. }, o);
  100. $.ligerDialog.open({
  101. url : 'carMotorcadeCarAction.do?task=carList2&car_state=1&state=4&lookup=lookup&checkbox='+o.checkbox,
  102. height : 350,
  103. width : 800,
  104. title : "车辆信息(空闲状态)",
  105. buttons : [
  106. {
  107. text : '确定',
  108. onclick : function(item, dialog) {
  109. var rows = dialog.frame.f_select();
  110. if(rows.length == 0){
  111. $.ligerDialog.alert('请选择一个车辆信息!', '提示', 'warn');
  112. return;
  113. }
  114. if(rows.length > 1){
  115. $.ligerDialog.alert('只能选择一个车辆信息!', '提示', 'warn');
  116. return;
  117. }
  118. var universalids = "", plate_numbers = "" ,car_brands = "" ,car_models = "" ,engine_numbers = "" ,initial_ranges = "";
  119. if (rows) {
  120. for ( var i = 0; i < rows.length; i++) {
  121. universalids += ("," + rows[i].universalid);
  122. plate_numbers += ("," + rows[i].plate_number);
  123. car_brands += ("," + rows[i].car_brand);
  124. $(function() {
  125. var a = rows[i].car_type;
  126. if(null !=rows[i].car_type){
  127. var place = "";
  128. $.ajax({
  129. url:'carMotorcadeCarAction.do?task=tolookCarType',
  130. async: false,
  131. type: 'post',
  132. data: {"car_type":rows[i].car_type},
  133. cache: false,
  134. error: function(obj){
  135. },
  136. success: function(obj){
  137. if(obj!=""){
  138. $("#carType").val(obj);
  139. }
  140. }
  141. });
  142. }
  143. });
  144. car_models += ("," + $("#carType").val());
  145. engine_numbers += ("," + rows[i].engine_number);
  146. initial_ranges += ("," + rows[i].initial_range);
  147. }
  148. universalid = universalids.substring(1, universalids.length);
  149. plate_number = plate_numbers.substring(1, plate_numbers.length);
  150. car_brand = car_brands.substring(1, car_brands.length);
  151. car_model = car_models.substring(1, car_models.length);
  152. engine_number = engine_numbers.substring(1, engine_numbers.length);
  153. initial_range = initial_ranges.substring(1, initial_ranges.length);
  154. }
  155. if ($("#" + o.plate_number_id).length > 0){
  156. $("#" + o.plate_number_id).val(universalid);
  157. }
  158. if ($("#" + o.plate_number).length > 0){
  159. $("#" + o.plate_number).val(plate_number);
  160. }
  161. /* if ($("#" + o.car_brand).length > 0){
  162. $("#" + o.car_brand).val(car_brand);
  163. } */
  164. if ($("#" + o.car_type).length > 0){
  165. $("#" + o.car_type).val(car_model);
  166. }
  167. if ($("#" + o.engine_number).length > 0){
  168. $("#" + o.engine_number).val(engine_number);
  169. }
  170. if ($("#" + o.run_mileage).length){
  171. $("#" + o.run_mileage).val(initial_range);
  172. }
  173. //加一个获取联系列表的方法,实现客户和联系人的联动效果
  174. //if('' != o.inputid && 'undefined' != o.inputid){
  175. //getContacterList(ids, o);
  176. //}
  177. dialog.close();
  178. $(".l-dialog-win").remove();
  179. }
  180. }, {
  181. text : '取消',
  182. onclick : function(item, dialog) {
  183. dialog.close();
  184. $(".l-dialog-win").remove();
  185. }
  186. } ],
  187. name : "listDialog"
  188. });
  189. }
  190. function refresh(obj){
  191. if(obj == "1"){
  192. parent.location.reload();
  193. }
  194. }
  195. </script>
  196. <style type="text/css">
  197. .file-style{
  198. width: 550px;
  199. }
  200. .file-style input[type='file'] {
  201. width:385px ;
  202. height:24px;
  203. line-height:22px;
  204. vertical-align: bottom;
  205. background-color: #fff;
  206. border: 1px solid #cccccc;
  207. margin-top: 2px;
  208. margin-bottom: 2px;
  209. }
  210. </style>
  211. </head>
  212. <body>
  213. <%@ include file="/include/message.jsp"%>
  214. <form action="carScrapAction.do" method="post" onsubmit="return checkForm()">
  215. <div id="title" class="form-button">
  216. <input type="submit" class="l-button" value="保存" />
  217. <input type="button" value="关闭" class="l-button" onclick="closeWindow();" />
  218. <input type="hidden" id="carType" name="carType" value="">
  219. </div>
  220. <div class="container-layout">
  221. <div class="forum-container">
  222. <center>
  223. <table class="l-table-edit line">
  224. <tr>
  225. <th colspan="4">
  226. 车辆报废信息
  227. </th>
  228. </tr>
  229. <tr>
  230. <td class="l-table-edit-text" width="15%">车牌号<FONT COLOR="red">*</FONT>:</td>
  231. <td class="l-table-edit-td" width="85%" colspan="3">
  232. <input type="text" id="plate_number" name="plate_number" value="" readonly="readonly">
  233. <input type="hidden" id="plate_number_id" name="plate_number_id" value="">
  234. <input type="button" class="l-button" value="选择"
  235. onclick="chooseCar({plate_number_id:'plate_number_id',plate_number:'plate_number',car_brand:'car_brand',run_mileage:'run_mileage',car_type:'car_type',engine_number:'engine_number'});" />
  236. </td>
  237. </tr>
  238. <tr>
  239. <td class="l-table-edit-text">车辆类型:</td>
  240. <td class="l-table-edit-td" colspan="3">
  241. <input type="text" id="car_type" name="car_type" value="" readonly="readonly">
  242. </td>
  243. </tr>
  244. <!-- <tr>
  245. <td class="l-table-edit-text">车辆品牌:</td>
  246. <td class="l-table-edit-td" colspan="3">
  247. <input type="text" id="car_brand" name="car_brand" value="" readonly="readonly">
  248. </td>
  249. </tr> -->
  250. <tr>
  251. <td class="l-table-edit-text">报废时间<FONT COLOR="red">*</FONT>:</td>
  252. <td class="l-table-edit-td" colspan="3">
  253. <input type="text" id="scrap_date" name="scrap_date" value="">
  254. <input type="hidden" id="scrap_date" name="scrap_date" value="">
  255. </td>
  256. </tr>
  257. <tr>
  258. <td class="l-table-edit-text">报废原因<FONT COLOR="red">*</FONT>:</td>
  259. <td class="l-table-edit-td" colspan="3">
  260. <div style="float: left;">
  261. <textarea id="scrap_reason" name="scrap_reason" rows="3" cols="61"></textarea>
  262. </div>
  263. </td>
  264. </tr>
  265. <tr style="height: 35px;">
  266. <td class="l-table-edit-text">上传附件:</td>
  267. <td class="l-table-edit-td" colspan="3">
  268. <input type="hidden" name="upload_id" id="upload_id">
  269. <jsp:include page="/include/file.jsp">
  270. <jsp:param name="fieldName" value="documentId"/>
  271. <jsp:param name="folder" value="car"/>
  272. <jsp:param name="documentId" value=""/>
  273. <jsp:param name="size" value="5" />
  274. <jsp:param name="isDelFile" value="2" />
  275. <jsp:param name="definedCss" value="file-style" />
  276. <jsp:param name="isCrypt" value="1" />
  277. </jsp:include>
  278. </td>
  279. </tr>
  280. <tr>
  281. <td class="l-table-edit-text">备注:</td>
  282. <td class="l-table-edit-td" colspan="3">
  283. <div style="float: left;">
  284. <textarea id="remark" name="remark" rows="3" cols="61"></textarea>
  285. </div>
  286. </td>
  287. </tr>
  288. </table>
  289. <input type="hidden" id="universalid" name="universalid" value="">
  290. <input type="hidden" id="task" name="task" value="doAddScrap">
  291. <input type="hidden" id="tabid" name="tabid" value="${requestScope.tabid}">
  292. </center>
  293. </div>
  294. </div>
  295. </form>
  296. </body>
  297. </html>