| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=GBK">
- <title>新增报废信息</title>
- <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
- <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script src="/shares/xheditor/xheditor-1.1.14/xheditor-1.1.14-zh-cn.min.js" type="text/javascript"></script>
- <script type="text/javascript" src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"></script>
- <script type="text/javascript" src="/shares/js/file.js"></script>
- <script type="text/javascript">
- //焦点
- $(document).ready(function() {
- $("input[type='text']:first").focus();
- });
-
- function checkForm(){
- var rs = $.validate({
- name : "plate_number",
- model : [ {
- type : "require",
- msg : "车牌号不能为空!"
- }, {
- type : "len",
- min : 1,
- max : 50,
- msg : "车牌号长度不能超过50个字!"
- } ]
- });
- rs = $.validate({
- name : "car_type",
- model : [ {
- type : "require",
- msg : "车辆类型不能为空!"
- } ]
- }) && rs;
- /* rs = $.validate({
- name : "car_brand",
- model : [ {
- type : "require",
- msg : "车辆品牌不能为空!"
- }]
- }) && rs; */
- rs = $.validate({
- name : "scrap_date",
- model : [ {
- type : "require",
- msg : "报废时间不能为空!"
- }]
- }) && rs;
- rs = $.validate({
- name : "scrap_reason",
- model : [ {
- type : "require",
- msg : "报废原因不能为空!"
- }]
- }) && rs;
- if (rs) {
- //上传附件
- var e = document.getElementsByName("documentId");
- var evalue = "";
- for(var i=0;i<e.length;i++){
- if(""!=e[i].value){
- evalue=evalue + e[i].value +",";
- }
- }
- $("#upload_id").val(evalue);
- if (confirm("确定要报废该车吗?")) {
- return true;
- }else{
- return false;
- }
- }else{
- return false;
- }
- }
- $(function() {
- $("#scrap_date").ligerDateEditor({labelAlign : 'left'});
- loadTypeTree("selectUserButton1",{type:"singleuser",tab:"1",backId:"give_people_name",backName:"give_people"});
- loadTypeTree("selectUserButton2",{type:"singleuser",tab:"1",backId:"receive_people_name",backName:"receive_people"});
- });
- /**
- * 选择车牌号函数
- */
- function chooseCar(o) {
- o = $.extend({
- 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",
- checkbox : true
- }, o);
- $.ligerDialog.open({
- url : 'carMotorcadeCarAction.do?task=carList2&car_state=1&state=4&lookup=lookup&checkbox='+o.checkbox,
- height : 350,
- width : 800,
- title : "车辆信息(空闲状态)",
- buttons : [
- {
- text : '确定',
- onclick : function(item, dialog) {
- var rows = dialog.frame.f_select();
- if(rows.length == 0){
- $.ligerDialog.alert('请选择一个车辆信息!', '提示', 'warn');
- return;
- }
- if(rows.length > 1){
- $.ligerDialog.alert('只能选择一个车辆信息!', '提示', 'warn');
- return;
- }
- var universalids = "", plate_numbers = "" ,car_brands = "" ,car_models = "" ,engine_numbers = "" ,initial_ranges = "";
- if (rows) {
- for ( var i = 0; i < rows.length; i++) {
- universalids += ("," + rows[i].universalid);
- plate_numbers += ("," + rows[i].plate_number);
- car_brands += ("," + rows[i].car_brand);
- $(function() {
- var a = rows[i].car_type;
- if(null !=rows[i].car_type){
- var place = "";
- $.ajax({
- url:'carMotorcadeCarAction.do?task=tolookCarType',
- async: false,
- type: 'post',
- data: {"car_type":rows[i].car_type},
- cache: false,
- error: function(obj){
- },
- success: function(obj){
- if(obj!=""){
- $("#carType").val(obj);
- }
- }
- });
- }
- });
- car_models += ("," + $("#carType").val());
- engine_numbers += ("," + rows[i].engine_number);
- initial_ranges += ("," + rows[i].initial_range);
- }
- universalid = universalids.substring(1, universalids.length);
- plate_number = plate_numbers.substring(1, plate_numbers.length);
- car_brand = car_brands.substring(1, car_brands.length);
- car_model = car_models.substring(1, car_models.length);
- engine_number = engine_numbers.substring(1, engine_numbers.length);
- initial_range = initial_ranges.substring(1, initial_ranges.length);
- }
- if ($("#" + o.plate_number_id).length > 0){
- $("#" + o.plate_number_id).val(universalid);
- }
- if ($("#" + o.plate_number).length > 0){
- $("#" + o.plate_number).val(plate_number);
- }
- /* if ($("#" + o.car_brand).length > 0){
- $("#" + o.car_brand).val(car_brand);
- } */
- if ($("#" + o.car_type).length > 0){
- $("#" + o.car_type).val(car_model);
- }
- if ($("#" + o.engine_number).length > 0){
- $("#" + o.engine_number).val(engine_number);
- }
- if ($("#" + o.run_mileage).length){
- $("#" + o.run_mileage).val(initial_range);
- }
- //加一个获取联系列表的方法,实现客户和联系人的联动效果
- //if('' != o.inputid && 'undefined' != o.inputid){
- //getContacterList(ids, o);
- //}
- dialog.close();
- $(".l-dialog-win").remove();
- }
- }, {
- text : '取消',
- onclick : function(item, dialog) {
- dialog.close();
- $(".l-dialog-win").remove();
- }
- } ],
- name : "listDialog"
- });
- }
- function refresh(obj){
- if(obj == "1"){
- parent.location.reload();
- }
- }
- </script>
- <style type="text/css">
- .file-style{
- width: 550px;
- }
- .file-style input[type='file'] {
- width:385px ;
- height:24px;
- line-height:22px;
- vertical-align: bottom;
- background-color: #fff;
- border: 1px solid #cccccc;
- margin-top: 2px;
- margin-bottom: 2px;
- }
- </style>
- </head>
- <body>
- <%@ include file="/include/message.jsp"%>
- <form action="carScrapAction.do" method="post" onsubmit="return checkForm()">
- <div id="title" class="form-button">
- <input type="submit" class="l-button" value="保存" />
- <input type="button" value="关闭" class="l-button" onclick="closeWindow();" />
- <input type="hidden" id="carType" name="carType" value="">
- </div>
- <div class="container-layout">
- <div class="forum-container">
- <center>
- <table class="l-table-edit line">
- <tr>
- <th colspan="4">
- 车辆报废信息
- </th>
- </tr>
- <tr>
- <td class="l-table-edit-text" width="15%">车牌号<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td" width="85%" colspan="3">
- <input type="text" id="plate_number" name="plate_number" value="" readonly="readonly">
- <input type="hidden" id="plate_number_id" name="plate_number_id" value="">
- <input type="button" class="l-button" value="选择"
- 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'});" />
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">车辆类型:</td>
- <td class="l-table-edit-td" colspan="3">
- <input type="text" id="car_type" name="car_type" value="" readonly="readonly">
- </td>
- </tr>
- <!-- <tr>
- <td class="l-table-edit-text">车辆品牌:</td>
- <td class="l-table-edit-td" colspan="3">
- <input type="text" id="car_brand" name="car_brand" value="" readonly="readonly">
- </td>
- </tr> -->
- <tr>
- <td class="l-table-edit-text">报废时间<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td" colspan="3">
- <input type="text" id="scrap_date" name="scrap_date" value="">
- <input type="hidden" id="scrap_date" name="scrap_date" value="">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">报废原因<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td" colspan="3">
- <div style="float: left;">
- <textarea id="scrap_reason" name="scrap_reason" rows="3" cols="61"></textarea>
- </div>
- </td>
- </tr>
- <tr style="height: 35px;">
- <td class="l-table-edit-text">上传附件:</td>
- <td class="l-table-edit-td" colspan="3">
- <input type="hidden" name="upload_id" id="upload_id">
- <jsp:include page="/include/file.jsp">
- <jsp:param name="fieldName" value="documentId"/>
- <jsp:param name="folder" value="car"/>
- <jsp:param name="documentId" value=""/>
- <jsp:param name="size" value="5" />
- <jsp:param name="isDelFile" value="2" />
- <jsp:param name="definedCss" value="file-style" />
- <jsp:param name="isCrypt" value="1" />
- </jsp:include>
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">备注:</td>
- <td class="l-table-edit-td" colspan="3">
- <div style="float: left;">
- <textarea id="remark" name="remark" rows="3" cols="61"></textarea>
- </div>
- </td>
- </tr>
- </table>
- <input type="hidden" id="universalid" name="universalid" value="">
- <input type="hidden" id="task" name="task" value="doAddScrap">
- <input type="hidden" id="tabid" name="tabid" value="${requestScope.tabid}">
- </center>
- </div>
- </div>
- </form>
- </body>
- </html>
|