| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423 |
- <%@ 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>
- <script type="text/javascript" src="/shares/js/jquery-1.3.2.min.js"></script>
- <script type="text/javascript" src="/shares/js/file.js"></script>
- <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">
- //焦点
- $(document).ready(function() {
- $("input[type='text']:first").focus();
- $("#contributions_way").ligerComboBox();
- $("#cost_name").ligerComboBox();
- });
-
- function checkForm(){
- var rs = $.validate({
- name : "plate_number",
- model : [ {
- type : "require",
- msg : "车牌号不能为空!"
- }, {
- type : "len",
- min : 1,
- max : 50,
- msg : "车牌号长度不能超过50个字!"
- } ]
- });
- rs = $.validate({
- name : "cost_name",
- model : [ {
- type : "require",
- msg : "费用名称不能为空!"
- } ]
- }) && rs;
- rs = $.validate({
- name : "contributions_date",
- model : [ {
- type : "require",
- msg : "交费日期不能为空!"
- } ]
- }) && rs;
- if($("#contributions_money").val() != ''){
- rs = $.validate({
- name : "contributions_money",
- model : [{
- type : "isNumber",
- msg : "请输入数字!"
- },{
- type : "regex",
- regex: new RegExp("^[0-9].*$"),
- msg : "金额不能小于0!"
- },{type : "len",min : 0,max : 10,msg : "交费金额不能超过10个字符!"}]
- }) && rs;
- }
- /* rs = $.validate({
- name : "charge_unit",
- model : [ {
- type : "require",
- msg : "收费单位不能为空!"
- }]
- }) && rs; */
- if($("#contributions_way").val() != '1'){
- if($("#period_month").val() != ''){
- rs = $.validate({
- name : "period_month",
- model : [ {
- type : "require",
- msg : "周期{月}不能为空!"
- }, {
- type : "isNumber",
- msg : "请输入数字!"
- },{
- type : "regex",
- regex: new RegExp("^[0-9]*[1-9][0-9]*$"),
- 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);
- return true;
- }else{
- return false;
- }
- }
- $(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
- });
- $("#contributions_date").ligerDateEditor({
- labelAlign : 'left'
- //initValue : '${requestScope.device.dev_buy_date }'
- });
- });
- /**
- * 选择车牌号函数
- */
- function chooseCustomer(o) {
- o = $.extend({
- plate_number_id : "plate_number_id",
- plate_number : "plate_number",
- out_car_mileage : "out_car_mileage",
- motorcade : "motorcade",
- checkbox : true
- }, o);
- $.ligerDialog.open({
- url : 'carMotorcadeCarAction.do?task=carList2&state=3&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 = "" ,initial_ranges = "" ,motorcades = "";
- if (rows) {
- for ( var i = 0; i < rows.length; i++) {
- universalids += ("," + rows[i].universalid);
- plate_numbers += ("," + rows[i].plate_number);
- initial_ranges += ("," + rows[i].initial_range);
- motorcades += ("," + rows[i].motorcade_name);
- }
- universalid = universalids.substring(1, universalids.length);
- plate_number = plate_numbers.substring(1, plate_numbers.length);
- initial_range = initial_ranges.substring(1, initial_ranges.length);
- motorcade = motorcades.substring(1, motorcades.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.out_car_mileage).length > 0){
- $("#" + o.out_car_mileage).val(initial_range);
- }
- if ($("#" + o.motorcade).length > 0){
- $("#" + o.motorcade).val(motorcade);
- }
- //加一个获取联系列表的方法,实现客户和联系人的联动效果
- //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 chooseUnit(o){
- o = $.extend({
- charge_unit_id : "charge_unit_id",
- charge_unit : "charge_unit",
- checkbox : true
- }, o);
- $.ligerDialog.open({
- url : 'carDealingsUnitAction.do?task=toList1&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 = "", unit_names = "";
- if (rows) {
- for ( var i = 0; i < rows.length; i++) {
- universalids += ("," + rows[i].universalid);
- unit_names += ("," + rows[i].unit_name);
- }
- universalid = universalids.substring(1, universalids.length);
- unit_name = unit_names.substring(1, unit_names.length);
- }
- if ($("#" + o.charge_unit_id).length > 0){
- $("#" + o.charge_unit_id).val(universalid);
- }
- if ($("#" + o.charge_unit).length > 0){
- $("#" + o.charge_unit).val(unit_name);
- }
- dialog.close();
- $(".l-dialog-win").remove();
- }
- }, {
- text : '取消',
- onclick : function(item, dialog) {
- dialog.close();
- $(".l-dialog-win").remove();
- }
- } ],
- name : "listDialog"
- });
- }
- //付款方式选择
- function select() {
- if(($("#contributions_way").val()) == '2'){
- document.getElementById("period_month2").style.display = "inline";
- }
- if(($("#contributions_way").val()) == '1'){
- document.getElementById("period_month2").style.display = "none";
- }
- }
- $(function(){
- if(($("#contributions_way").val()) == '1'){
- document.getElementById("period_month2").style.display = "none";
- }
- });
- 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="carCostAction.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();" />
- </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="${cost.plate_number }" readonly="readonly">
- <input type="hidden" id="plate_number_id" name="plate_number_id" value="${cost.car_id }">
- <input type="button" class="l-button" value="选择"
- onclick="chooseCustomer({plate_number_id:'plate_number_id',plate_number:'plate_number',out_car_mileage:'out_car_mileage',motorcade:'motorcade'});" />
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">费用名称<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td" colspan="3">
- <select id="cost_name" name="cost_name">
- <option value="${cost.cost_name }">${cost.dictionary_name }</option>
- <c:forEach items="${dictionaries }" var="dictionaries">
- <c:if test="${cost.cost_name != dictionaries.universalid }">
- <option value="${dictionaries.universalid }">${dictionaries.dictionary_name }</option>
- </c:if>
- </c:forEach>
- </select>
- </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="contributions_date" name="contributions_date" value="${cost.contributions_date }" readonly="readonly">
- <input type="hidden" id="contributions_date" name="contributions_date" value="">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">交费金额:</td>
- <td class="l-table-edit-td" colspan="3">
- <c:if test="${cost.contributions_money != 0 }">
- <input type="text" id="contributions_money" name="contributions_money" value="${cost.contributions_money }">
- </c:if>
- <c:if test="${cost.contributions_money == 0}">
- <input type="text" id="contributions_money" name="contributions_money" value="">
- </c:if>
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">收费单位:</td>
- <td class="l-table-edit-td" colspan="3">
- <input type="text" id="charge_unit" name="charge_unit" value="${cost.unit_name }">
- <input type="button" class="l-button" value="选择" id="select4"
- onclick="chooseUnit({universalid:'universalid',charge_unit:'charge_unit'});" />
- <input type="hidden" id="charge_unit_id" name="charge_unit_id" value="${cost.charge_unit }}">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">交费方式:</td>
- <td class="l-table-edit-td" colspan="3">
- <select id=contributions_way name="contributions_way" onchange="select()">
- <c:if test="${cost.contributions_way == 1 }">
- <option value="1">一次性</option>
- <option value="2">周期付</option>
- </c:if>
- <c:if test="${cost.contributions_way == 2 }">
- <option value="2">周期付</option>
- <option value="1">一次性</option>
- </c:if>
- </select>
- </td>
- </tr>
- <tr id="period_month2">
- <td class="l-table-edit-text">周期[月]:</td>
- <td class="l-table-edit-td" colspan="3">
- <c:if test="${cost.period_month != 0 }">
- <input type="text" id="period_month" name="period_month" value="${cost.period_month }">
- </c:if>
- <c:if test="${cost.period_month == 0}">
- <input type="text" id="period_month" name="period_month" value="">
- </c:if>
- </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="${cost.upload_id }"/>
- <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">${cost.remark }</textarea>
- </div>
- </td>
- </tr>
- </table>
- <input type="hidden" id="universalids" name="universalids" value="${cost.universalid}">
- <input type="hidden" id="uploadId" name="uploadId" value="${cost.upload_id}">
- <input type="hidden" id="task" name="task" value="doEditCost">
- <input type="hidden" id="tabid" name="tabid" value="${requestScope.tabid}">
- </center>
- </div>
- </div>
- </form>
- </body>
- </html>
|