| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469 |
- <%@ 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 src="${pageContext.request.contextPath}/liger/lib/json2.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.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">
- $(function() {
- loadTypeTree("selectbutton1", {type : "singleuser",backId : "dev_buy_person",backName : "dev_buy_person_name",tab : 1});
- loadTypeTree("selectbutton2", {type : "detpusersingle",backId : "dev_useman",backName : "dev_useman_name",tab : 1});
- $("#return_time").ligerDateEditor({showTime : true,width:160,labelAlign : 'left'});
- $("#stop_place").ligerComboBox();
- });
-
- function checkForm(){
- var rs = $.validate({
- name : "plate_number",
- model : [ {type : "require",msg : "车牌号不能为空!"}, {type : "len",min : 1,max : 20,msg : "设备编号长度不能超过20个字!"
- } ]
- });
- /* rs = $.validate({
- name : "car_department",
- model : [ {type : "require",msg : "用车部门不能为空!"} ]
- }) && rs;
- rs = $.validate({
- name : "car_people",model : [ {type : "require",msg : "用车人不能为空!"} ]
- }) && rs;
- rs = $.validate({
- name : "destination",model : [ {type : "require",msg : "目的地不能为空!"}]
- }) && rs;
- rs = $.validate({
- name : "out_car_mileage",model : [ {type : "require",msg : "出车里程不能为空!"}]
- }) && rs;*/
- /* rs = $.validate({
- name : "out_car_reason",model : [ {type : "require",msg : "出车原因不能为空!"}]
- }) && rs; */
- rs = $.validate({
- name : "return_mileage",model :[{type : "require",msg : "回车里程不能为空!"},
- {type : "isNumber",msg : "请输入数字!"},
- {type : "regex",regex: new RegExp("^[0-9]*[1-9][0-9]*$"),msg : "请输入正整数!"},
- {type : "len",min : 0,max : 10,msg : "回车里程不能超过10个字符!"}]
- }) && rs;
- rs = $.validate({
- name : "journey",model : [ {type : "require",msg : "本次行程不能为空!"}]
- }) && rs;
- rs = $.validate({
- name : "return_time",model : [ {type : "require",msg : "回车时间不能为空!"}]
- }) && rs;
- /* rs = $.validate({
- name : "stop_place",model : [ {type : "require",msg : "停放位置不能为空!"}]
- }) && rs; */
- rs = $.validate({
- name : "freight_income",model : [ {type : "isNumber",msg : "请输入数字!"},{type : "len",min : 0,max : 10,msg : "运费收入不能超过10个字符!"}]
- }) && rs;
- rs = $.validate({
- name : "road_toll",model : [ {type : "isNumber",msg : "请输入数字!"},{type : "len",min : 0,max : 10,msg : "过路费不能超过10个字符!"}]
- }) && rs;
- rs = $.validate({
- name : "car_washing_fee",model : [ {type : "isNumber",msg : "请输入数字!"},{type : "len",min : 0,max : 10,msg : "洗车费不能超过10个字符!"}]
- }) && rs;
- rs = $.validate({
- name : "parking_fee",model : [ {type : "isNumber",msg : "请输入数字!"},{type : "len",min : 0,max : 10,msg : "停车费不能超过10个字符!"}]
- }) && rs;
- rs = $.validate({
- name : "water_fee",model : [ {type : "isNumber",msg : "请输入数字!"},{type : "len",min : 0,max : 10,msg : "加油费不能超过10个字符!"}]
- }) && rs;
- rs = $.validate({
- name : "other_fee",model : [ {type : "isNumber",msg : "请输入数字!"},{type : "len",min : 0,max : 10,msg : "其它费用不能超过10个字符!"}]
- }) && rs;
- if (rs) {
- var out_car_time= document.getElementById("out_car_time");
- var return_time= document.getElementById("return_time");
- if(out_car_time.value != "" && typeof (out_car_time.value) != "undefined"){
- if(return_time.value != "" && typeof (return_time.value) != "undefined"){
- var a = $("#out_car_time").val();
- var b = $("#return_time").val();
- a = a.replace(" ", "-").replace(":", "-").replace(":", "-");
- var arr = a.split("-");
- var fisrtTime = Date.UTC(arr[0], (arr[1] - 1), arr[2], arr[3], arr[4], 0);
- b = b.replace(" ", "-").replace(":", "-");
- var arrs = b.split("-");
- var secondTime = Date.UTC(arrs[0], (arrs[1] - 1), arrs[2], arrs[3], arrs[4], 0);
- if (fisrtTime >= secondTime) {
- $.ligerDialog.alert('回车日期不能小于出车日期!', '提示', 'warn');
- $("#return_time").val("");
- $("#out_day_number").val("");
- return false;
- }
- fisrtTime = Date.UTC(arr[0], (arr[1] - 1), arr[2]);
- secondTime = Date.UTC(arrs[0], (arrs[1] - 1), arrs[2]);
- var dif = secondTime - fisrtTime;
- var days = dif/ 3600000 / 24;
- document.getElementById("out_day_number").value = days;
- }
- }
- var out_car_mileage = $("#out_car_mileage").val();
- var return_mileage = $("#return_mileage").val();
- if(!isNaN(return_mileage)) {
- if(Number(return_mileage) < Number(out_car_mileage)){
- $.ligerDialog.alert('回车里程不能小于出车里程!', '提示', 'warn');
- return false;
- }
- if(return_mileage != null){
- var journey = Number(return_mileage) - Number(out_car_mileage);
- $("#journey").val(journey);
- }
- }else{
- $("#journey").val("");
- }
- return true;
- }else{
- return false;
- }
- }
- /**
- * 选择车牌号函数
- */
- function chooseCustomer(o) {
- o = $.extend({
- plate_number_id : "plate_number_id",
- out_car_id : "out_car_id",
- plate_number : "plate_number",
- car_department : "car_department",
- car_people : "car_people",
- destination : "destination",
- out_car_mileage : "out_car_mileage",
- motorcade : "motorcade",
- out_car_time : "out_car_time",
- out_car_reason : "out_car_reason",
- checkbox : true
- }, o);
- $.ligerDialog.open({
- url : 'carReturnCarAction.do?task=toReturnCarListOk2&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_number_ids = "", plate_numbers = "" ,car_departments = "" ,car_people_types = "" ,car_peoples = "" ,destinations = "" ,out_car_mileages = "" ,motorcades = "" ,out_car_times = "" ,out_car_reasons = "";
- if (rows) {
- for ( var i = 0; i < rows.length; i++) {
- universalids += ("," + rows[i].universalid);
- plate_number_ids += ("," + rows[i].car_id);
- plate_numbers += ("," + rows[i].plate_number);
- car_departments += ("," + rows[i].car_department_name);
- car_peoples += ("," + rows[i].car_people_name);
- destinations += ("," + rows[i].destination);
- out_car_mileages += ("," + rows[i].out_car_mileage);
- motorcades += ("," + rows[i].motorcade);
- out_car_times += ("," + rows[i].out_car_time);
- out_car_reasons += ("," + rows[i].out_car_reason);
- }
- universalid = universalids.substring(1, universalids.length);
- plate_number_id = plate_number_ids.substring(1, plate_number_ids.length);
- plate_number = plate_numbers.substring(1, plate_numbers.length);
- car_department = car_departments.substring(1, car_departments.length);
- car_people = car_peoples.substring(1, car_peoples.length);
- destination = destinations.substring(1, destinations.length);
- out_car_mileage = out_car_mileages.substring(1, out_car_mileages.length);
- motorcade = motorcades.substring(1, motorcades.length);
- out_car_time = out_car_times.substring(1, out_car_times.length);
- out_car_reason = out_car_reasons.substring(1, out_car_reasons.length);
- }
- if ($("#" + o.out_car_id).length > 0){
- $("#" + o.out_car_id).val(universalid);
- }
- if ($("#" + o.plate_number_id).length > 0){
- $("#" + o.plate_number_id).val(plate_number_id);
- }
- if ($("#" + o.plate_number).length > 0){
- $("#" + o.plate_number).val(plate_number);
- }
- if ($("#" + o.car_department).length > 0){
- $("#" + o.car_department).val(car_department);
- }
- if ($("#" + o.car_people).length > 0){
- $("#" + o.car_people).val(car_people);
- }
- if ($("#" + o.destination).length > 0){
- $("#" + o.destination).val(destination);
- }
- if ($("#" + o.out_car_mileage).length > 0){
- $("#" + o.out_car_mileage).val(out_car_mileage);
- }
- if ($("#" + o.motorcade).length > 0){
- $("#" + o.motorcade).val(motorcade);
- }
- if ($("#" + o.out_car_time).length > 0){
- $("#" + o.out_car_time).val(out_car_time);
- }
- if ($("#" + o.out_car_reason).length > 0){
- $("#" + o.out_car_reason).val(out_car_reason);
- }
- dialog.close();
- $(".l-dialog-win").remove();
- }
- }, {
- text : '取消',
- onclick : function(item, dialog) {
- dialog.close();
- $(".l-dialog-win").remove();
- }} ],
- name : "listDialog"
- });
- }
- function mileage(a){
- var out_car_mileage = $("#out_car_mileage").val();
- var return_mileage = $("#return_mileage").val();
- if(!isNaN(return_mileage)) {
- if(Number(return_mileage) < Number(out_car_mileage)){
- $.ligerDialog.alert('回车里程不能小于出车里程!', '提示', 'warn');
- }
- if(return_mileage != null){
- var journey = Number(return_mileage) - Number(out_car_mileage);
- $("#journey").val(journey);
- }
- }else{
- $("#journey").val("");
- }
- }
- function days(a){
- var out_car_time= document.getElementById("out_car_time");
- var return_time= document.getElementById("return_time");
- if(out_car_time.value != "" && typeof (out_car_time.value) != "undefined"){
- if(return_time.value != "" && typeof (return_time.value) != "undefined"){
- var a = $("#out_car_time").val();
- var b = $("#return_time").val();
- a = a.replace(" ", "-").replace(":", "-").replace(":", "-");
- var arr = a.split("-");
- var fisrtTime = Date.UTC(arr[0], (arr[1] - 1), arr[2], arr[3], arr[4], 0);
- b = b.replace(" ", "-").replace(":", "-");
- var arrs = b.split("-");
- var secondTime = Date.UTC(arrs[0], (arrs[1] - 1), arrs[2], arrs[3], arrs[4], 0);
- if (fisrtTime >= secondTime) {
- $.ligerDialog.alert('回车日期不能小于出车日期!', '提示', 'warn');
- $("#return_time").val("");
- $("#out_day_number").val("");
- return false;
- }
- fisrtTime = Date.UTC(arr[0], (arr[1] - 1), arr[2]);
- secondTime = Date.UTC(arrs[0], (arrs[1] - 1), arrs[2]);
- var dif = secondTime - fisrtTime;
- var days = dif/ 3600000 / 24;
- document.getElementById("out_day_number").value = days;
- }
- }
- }
- function closeW(){
- var tabIframe = window.parent.document.getElementsByName("${requestScope.tabid}");
- tabIframe[0].contentDocument.getElementsByName("content2")[0].contentWindow.closeDialog();
- }
- function refresh(obj){
- if(obj == "1"){
- var tabIframe = window.parent.document.getElementsByName("${requestScope.tabid}");
- tabIframe[0].contentDocument.getElementsByName("content2")[0].contentWindow.closeDialog();
- tabIframe[0].contentDocument.getElementsByName("content2")[0].contentWindow.location.reload();
- //window.parent.submitItemName();
- //window.parent.obj.close();
- }
- }
- $(document).ready(function() {
- $("[name='plate_number']").focus();
- refresh('${msgEvent}');
- });
- </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="carReturnCarAction.do" method="post" onsubmit="return checkForm()">
- <div id="title" class="form-button">
- <input type="submit" class="l-button" value="保存" />
- <c:if test="${type == null }">
- <input type="button" value="关闭" class="l-button" onclick="closeWindow();" />
- </c:if>
- <c:if test="${type == '1' }">
- <input type="button" value="关闭" class="l-button" onclick="closeW();" />
- </c:if>
- </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">车牌号<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td" colspan="3">
- <input type="text" id="plate_number" name="plate_number" value="${outCar.plate_number }" onfocus="this.blur()">
- <input type="hidden" id="plate_number_id" name="plate_number_id" value="${outCar.car_id }">
- <!-- <input type="button" class="l-button" value="选择"
- onclick="chooseCustomer({plate_number_id:'plate_number_id',out_car_id:'out_car_id',out_car_time:'out_car_time',plate_number:'plate_number',car_department:'car_department',car_people_type:'car_people_type',car_people:'car_people',destination:'destination',out_car_mileage:'out_car_mileage',motorcade:'motorcade',out_car_reason:'out_car_reason'});" /> -->
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">回车时间<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td">
- <input type="text" id="return_time" name="return_time" value="" onblur="days(this)">
- <input type="hidden" id="return_time" name="return_time" value="">
- </td>
- <td class="l-table-edit-text">回车里程<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td">
- <input type="text" id="return_mileage" name="return_mileage" value="" onblur="mileage(this)">
- </td>
- </tr>
- <tr>
- <tr>
- <td class="l-table-edit-text">出车天数<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td">
- <input type="text" id="out_day_number" name="out_day_number" value="" onfocus="this.blur()">
- </td>
- <td class="l-table-edit-text">本次行程<FONT COLOR="red">*</FONT></td>
- <td class="l-table-edit-td">
- <input type="text" id="journey" name="journey" value="" onfocus="this.blur()">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">停放位置</td>
- <td class="l-table-edit-td">
- <select id="stop_place" name="stop_place">
- <option value="">-选择-</option>
- <c:forEach items="${dictionaries }" var="dictionaries">
- <option value="${dictionaries.universalid }">${dictionaries.dictionary_name }</option>
- </c:forEach>
- </select>
- </td>
- <td class="l-table-edit-text">出车里程:</td>
- <td class="l-table-edit-td">
- <input type="text" id="out_car_mileage" name="out_car_mileage" value="${outCar.out_car_mileage}" style="border: none;" onfocus="this.blur()">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">用车部门:</td>
- <td class="l-table-edit-td">
- <input type="text" id="car_department" name="car_department" value="${outCar.car_department_name}" style="border: none;" onfocus="this.blur()">
- </td>
- <td class="l-table-edit-text">用车人:</td>
- <td class="l-table-edit-td" width="35%">
- <input type="text" id="car_people" name="car_people" value="${outCar.car_people_name}" style="border: none;" onfocus="this.blur()">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">出车时间:</td>
- <td class="l-table-edit-td">
- <input type="text" id="out_car_time" name="out_car_time" value="${out_car_time}" style="border: none;" onfocus="this.blur()">
- </td>
- <td class="l-table-edit-text">目的地:</td>
- <td class="l-table-edit-td">
- <input type="text" id="destination" name="destination" value="${outCar.destination}" style="border: none;" onfocus="this.blur()">
- </td>
- </tr>
- </tr>
- <tr>
- <td class="l-table-edit-text">出车原因:</td>
- <td class="l-table-edit-td" colspan="3">
- <input type="text" id="out_car_reason" name="out_car_reason" value="${outCar.out_car_reason}" style="border: none;" onfocus="this.blur()">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">备注:</td>
- <td class="l-table-edit-td" colspan="3">
- <input type="text" id="remark" name="remark" value="${outCar.remark}" style="border: none;" onfocus="this.blur()">
- <!-- <div style="float: left;">
- <textarea id="remark" name="remark" rows="3" cols="60"></textarea>
- </div> -->
- </td>
- </tr>
- <tr>
- <th colspan="4">
- 费用信息
- </th>
- </tr>
- <tr>
- <td class="l-table-edit-text">运费收入:</td>
- <td class="l-table-edit-td">
- <input type="text" id="freight_income" name="freight_income" value="">
- </td>
- <td class="l-table-edit-text">过路费:</td>
- <td class="l-table-edit-td">
- <input type="text" id="road_toll" name="road_toll" value="">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">洗车费:</td>
- <td class="l-table-edit-td">
- <input type="text" id="car_washing_fee" name="car_washing_fee" value="">
- </td>
- <td class="l-table-edit-text">停车费</td>
- <td class="l-table-edit-td">
- <input type="text" id="parking_fee" name="parking_fee" value="">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">加水费:</td>
- <td class="l-table-edit-td">
- <input type="text" id="water_fee" name="water_fee" value="">
- </td>
- <td class="l-table-edit-text">其它费用:</td>
- <td class="l-table-edit-td">
- <input type="text" id="other_fee" name="other_fee" value="">
- </td>
- </tr>
- </table>
- <input type="hidden" id="types" name="types" value="${requestScope.type }">
- <input type="hidden" id="out_car_id" name="out_car_id" value="${outCar.universalid }">
- <input type="hidden" id="task" name="task" value="doAddReturnCar">
- <input type="hidden" id="tabid" name="tabid" value="${requestScope.tabid}">
- </center>
- </div>
- </div>
- </form>
- </body>
- </html>
|