button的用法
struts2 s:iterator 中按钮获得当前行数据,并跳转
<button id="submissionz" onclick="var wid=<s:property value="#column.id"/>;location.href='wbfbg/wayBillSubmission?wid='+wid">提交</button>
或
<button id="deletez" class="btn btn-default" onclick="deletez(<s:property value="#column.id"/>)">删除</button>
button中可以定义变量来获取值,并传递(分页)
转到<input id="pageJump" type="text" />页
<button id="pagejump" class="btn btn-default"
onclick="var p_pagenum = document.getElementById('pageJump').value;location.href='wbfbg/wayBillInfo?wbStatus=${pagen.aray[5]}&pageNum='+p_pagenum;">跳转</button>
页面操作json
<script type="text/javascript" src="ui/jquery.serializejson.min.js"></script>
//把表单数据转换成json对象
var formData = $('#searchForm').serializeJSON();
//把json对象转换成字符串
alert(JSON.stringify(formData));
hibernate query.setFirstResult的用法注意 hibernate分页查询
项目中发现数据库中总有一条数据取不到,最后发现是hibernate query.setFirstResult的问题:
注意从第一条数据开始要写成 query.setFirstResult(0)
否则总有一条数据查不出来
struts2中日期格式化标签
<s:date name="goods.canvassLatestTime" format="yyyy-MM-dd HH:mm:ss" />
form表单提交前校验
添加 οnsubmit=“return inputCheck()” 提交表单前会先去执行inputCheck()函数
<form method="post" id="addForm" action="wbfbg/wayBillInputAdd" onsubmit="return inputCheck()">
//运单录入表单的校验
function inputCheck(){
var corContacter = document.getElementById("corContacter").value;
var ceePhone = document.getElementById("ceePhone").value;//收货方手机
if(corContacter == null || corContacter == ''){
alert("发货方联系人不能为空");
return false;
}
var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
if (!myreg.test(ceePhone)) {
alert("请输入正确的手机号");
return false;
}
return true;
}
附上页面的全部代码
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>运单录入</title>
<link type="text/css" href="css/ui/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<link type="text/css" href="js/ui/bootstrap-datetimepicker.css" rel="stylesheet" />
<link type="text/css" href="css/base.css" rel="stylesheet" />
<link type="text/css" href="css/ui/patch.css" rel="stylesheet" />
<link type="text/css" href="css/ui/tag.css" rel="stylesheet"/>
<style>
form{
margin-top:10px;
}
td,th,label{
white-space:nowrap;
}
label{
font-weight:normal;
}
.search-more{
display:none;
}
.main-body td{
padding:6px 12px !important;
}
</style>
</head>
<body>
<div class="kl_searchOuter wp98">
<form id="searchForm" onsubmit="return false;">
<div class="row" style="margin-left:50px;">
<div>
<button id="wbinput" class="btn btn-default" >运单录入</button>
运单状态:
<!-- <button id="wbinput" class="btn btn-primary input-group" onclick="window.location.href='wbfbg/wayBillInput';">订单录入</button> -->
<select id="wbstatus" style="width:110px;height:30px">
<option value="-1">
--请选择--
</option>
<option value="1">
待提交运单
</option>
<option value="2">
已提交运单
</option>
<option value="3">
被打回运单
</option>
<option value="4">
审核通过订单
</option>
<option value="5">
全部订单
</option>
</select>
<button id="selectByStatus" class="btn btn-default" >查询</button>
</div>
</div>
</form>
</div>
<!-- 列表页面 -->
<span style="color:red"> 点击订单号显示审核日志</span>
<c:if test="${pagen.aray[5] == '1'}">
<span>已保存待提交运单:</span>
</c:if>
<c:if test="${pagen.aray[5] == '2'}">
<span>已提交待审核运单:</span>
</c:if>
<c:if test="${pagen.aray[5] == '3'}">
<span>审核未通过被打回运单:</span>
</c:if>
<c:if test="${pagen.aray[5] == '4'}">
<span>审核通过运单:</span>
</c:if>
<c:if test="${pagen.aray[5] == '5'}">
<span>全部运单:</span>
</c:if>
<table class="table table-bordered">
<thead class="kl-thead">
<tr>
<th>运单编号</th>
<th>出发地</th>
<th>目的地</th>
<th>发货方</th>
<th>发货方手机</th>
<th>收货方</th>
<th>收货方手机</th>
<th>货物名称</th>
<th>货物种类</th>
<th>是否回单</th>
<th>需要车型</th>
<th>是否投保</th>
<th>货物价值</th>
<th>总重量</th>
<th>总体积</th>
<th>最晚揽包时间</th>
<th>运单状态</th >
<th>操 作</th>
</tr>
</thead>
<s:iterator value="pagen.list" var="page" id="column" status="stuts">
<tr>
<td><s:property value="wbNo"/></td>
<td><s:property value="goods.froms"/></td>
<td><s:property value="goods.tos"/></td>
<td><s:property value="goods.sendName"/></td>
<td><s:property value="goods.sendPhone"/></td>
<td><s:property value="goods.receiveName"/></td>
<td><s:property value="goods.receivePhone"/></td>
<td><s:property value="goods.explains"/></td>
<!-- private int variety; // 货物种类 0:重货,1:轻货,2不规则货物,3易碎货物 int -->
<td> <s:if test="goods.variety==0">重货</s:if>
<s:if test="goods.variety==1">轻货</s:if>
<s:if test="goods.variety==2">不规则货物</s:if>
<s:if test="goods.variety==3">易碎货物</s:if>
</td>
<!-- 是否需要回单,0代表否,1代表是 -->
<td>
<s:if test="goods.ifOrderPic==1">是</s:if>
<s:if test="goods.ifOrderPic==0">否</s:if>
</td>
<!-- 需要车型 -->
<td>
<s:if test="goods.goodsCarType==0">高栏车</s:if>
<s:if test="goods.goodsCarType==1">低栏车</s:if>
<s:if test="goods.goodsCarType==2">平板车</s:if>
<s:if test="goods.goodsCarType==3">半挂车</s:if>
<s:if test="goods.goodsCarType==4">厢式车</s:if>
<s:if test="goods.goodsCarType==5">冷藏车</s:if>
<s:if test="goods.goodsCarType==6">其他</s:if>
</td>
<!-- 是否投保 是否投保 0:代表是;1:代表否 -->
<td>
<s:if test="goods.goodInsur==0">是</s:if>
<s:if test="goods.goodInsur==1">否</s:if>
</td>
<td><s:property value="goods.goodsValue"/>元</td>
<td><s:property value="goods.totalWeight"/>吨</td>
<td><s:property value="goods.totalVolume"/>立方米</td>
<td><s:date name="goods.canvassLatestTime" format="yyyy-MM-dd HH:mm:ss" /></td> <!-- 日期格式化 -->
<%-- <td><s:property value="goods.canvassLatestTime"/></td> --%>
<!-- 订单状态 默认:0 1:已保存 ,2:已提交 ,3:被打回 ,4:审核通过 -->
<td>
<s:if test="wbStatus==1">待提交</s:if>
<s:if test="wbStatus==2">已提交待审核</s:if>
<s:if test="wbStatus==3">被打回</s:if>
<s:if test="wbStatus==4">审核通过</s:if>
</td>
<td>
<s:if test="wbStatus==1">
<button id="submissionz" class="btn btn-default" onclick="submissionz(<s:property value="#column.id"/>)">提交</button>
<button id="modifyz" class="btn btn-default" onclick="modifyz(<s:property value="#column.id"/>)">修改</button>
<button id="deletez" class="btn btn-default" onclick="deletez(<s:property value="#column.id"/>)">删除</button>
<%-- <button id="submissionz" class="btn btn-primary input-group" onclick="var wid=<s:property value="#column.id"/>;location.href='wbfbg/wayBillSubmission?wid='+wid">提交</button> --%>
</s:if>
<s:if test="wbStatus==3">
<button id="submissionzz" class="btn btn-default" onclick="submissionzz(<s:property value="#column.id"/>)">提交</button>
<button id="modifyzz" class="btn btn-default" onclick="modifyzz(<s:property value="#column.id"/>)">修改</button>
<button id="deletezz" class="btn btn-default" onclick="deletezz(<s:property value="#column.id"/>)">删除</button>
</s:if>
<div></div>
</td>
</tr>
</s:iterator>
<tfoot>
<tr>
<td colspan="17" align="left">
<span class="f1">
<button id="exportExcel" class="btn btn-success m115" onclick="downLoadExl();">导出excel</button>
</span>
<span class="fn-nor ft14 fr" style="float:none;">
<a href="wbfbg/wayBillInfo?wbStatus=${pagen.aray[5]}&pageNum=1" class="btn btn-default">首页</a>
<span style="color:red;">${pagen.aray[0]}</span>/${pagen.aray[3]}
<c:if test="${ pagen.aray[0] > 1 }">
<a href="wbfbg/wayBillInfo?wbStatus=${pagen.aray[5]}&pageNum=${pagen.aray[0]-1}" class="btn btn-default">上一页</a>
</c:if>
<span class="ymSpan"></span>
<c:if test="${ pagen.aray[0] != pagen.aray[3] }">
<a href="wbfbg/wayBillInfo?wbStatus=${pagen.aray[5]}&pageNum=${pagen.aray[0]+1}" class="btn btn-default">下一页</a>
</c:if>
<a href="wbfbg/wayBillInfo?wbStatus=${pagen.aray[5]}&pageNum=${pagen.aray[3]}" class="btn btn-default">末页</a>
共<span>${pagen.aray[3]}</span>页
转到<input id="pageJump" type="text" />页
<button id="pagejump" class="btn btn-default"
onclick="var p_pagenum = document.getElementById('pageJump').value;location.href='wbfbg/wayBillInfo?wbStatus=${pagen.aray[5]}&pageNum='+p_pagenum;">跳转</button>
</span>
</td>
</tr>
</tfoot>
</table>
<!-- 运单录入弹框 -->
<div class="modal fade" id="fixModal" tabindex="-1" role="dialog" aria-labelledby="editText" aria-hidden="true" >
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 class="modal-title" id="myModalLabel">
运单录入
</h3>
</div>
<div class="modal-body">
<div class="s-wraper" style="width: 703px;">
<form method="post" id="addForm" action="wbfbg/wayBillInputAdd" onsubmit="return inputCheck()">
<div>
<div class="title">
<span class="b-t">发货方:</span>
<span class="c-999 ml15"> </span>
</div>
<div class="content f-s-14">
<table style="display: table;">
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>发货地:
</td>
<td>
<div id="city_4" name="goods.froms">
<select class="prov" id="fromprovince" name="fromprovince"></select>
<select class="city" id="fromcity" name="fromcity" disabled="disabled"></select>
<select class="dist" id="fromregion" name="fromregion" disabled="disabled"></select>
</div>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00"></span>街道:
</td>
<td>
<input type="text" name="goods.fromStreet" id="corDetailStreet" class="txt w250 ml10"/>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>联系人:
</td>
<td>
<input type="text" name="goods.sendName" id="corContacter"
class="txt w250 ml10" />
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>手机号:
</td>
<td>
<input type="text" id="corPhone" name="goods.sendPhone"
class="txt w250 ml10" />
</td>
</tr>
<tr>
<td class="w120 tr h35">
固定电话:
</td>
<td>
<input type="text" id="corAreaCode" class="txt w120 ml10" />
<%-- -
<input type="text" id="corTelephone" class="txt w150" />
-
<input type="text" id="corExtension" class="txt w150 " />
<span class="c-999">区号 - 电话号码 - 分机号</span> --%>
</td>
</tr>
</table>
</div>
</div>
<div class="f-s-14">
<div class="title">
<span class="b-t">收货方:</span>
<span class="c-999 ml15"> </spacn>
</div>
<div class="content">
<table style="display: table;">
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>收货地:
</td>
<td>
<div id="city_3" name="goods.tos">
<select class="prov" id="toprovince" name="toprovince"></select>
<select class="city" id="tocity" name="tocity" disabled="disabled"></select>
<select class="dist" id="toregion" name="toregion" disabled="disabled"></select>
</div>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00"></span>街道:
</td>
<td>
<input type="text" name="goods.tosStreet" id="ceeDetailStreet" class="txt w250 ml10"/>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<%-- <span class="c-f00">*</span> --%>联系人:
</td>
<td>
<input type="text" id="ceeContacter" name="goods.receiveName"
class="txt w250 ml10" />
</td>
</tr>
<tr>
<td class="w120 tr h35">
<%-- <span class="c-f00">*</span> --%>手机号:
</td>
<td>
<input type="text" id="ceePhone" name="goods.receivePhone"
class="txt w250 ml10" />
</td>
</tr>
<tr>
<td class="w120 tr h35">
固定电话:
</td>
<td>
<input type="text" id="ceeAreaCode" class="txt w120 ml10" />
<%-- -
<input type="text" id="ceeTelephone" class="txt w150" />
-
<input type="text" id="ceeExtension" class="txt w150" />
<span class="c-999">区号 - 电话号码 - 分机号</span> --%>
</td>
</tr>
</table>
</div>
</div>
<div class="f-s-14">
<div class="title">
<span class="b-t">货物信息:</span>
<span class="c-999 ml15"> </span>
</div>
<div class="content">
<table style="display: table;">
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>货品名称:
</td>
<td>
<input type="text" name="goods.explains" id="explains"
class="txt w250 ml10" />
<a href="javascript:void(0)" class="c-f00 ml20" id="jysm">禁运说明</a>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>最晚揽包时间:
</td>
<td>
<!-- <input name="lhTime" type="text" value="" maxlength="10"
id="txtBeginDatezz" onclick="SelectDate(this, 'yyyy-MM-dd hh:mm:ss');"
readonly="readonly" class="txt w250 ml10" autocomplete="off" /> -->
<input id="startTime" name="goods.canvassLatestTime" type="text" class="txt w250 ml10 form-control end_date" data-bind="value:stime" readonly="readonly"/>
<!-- <input id="endTime" name="endTime" type="text" class="form-control end_date" data-bind="value:etime" readonly="readonly"/> -->
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>货物种类:
</td>
<td>
<select id="variety" name="goods.variety"
class="txt w250 ml10">
<option value="0">
重货
</option>
<option value="1">
轻货
</option>
<option value="2">
不规则货物
</option>
<option value="3">
易碎货物
</option>
<!-- <option value="4">
化工类货物
</option> -->
</select>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>是否需要回单:
</td>
<td>
<input value="1" name="goods.ifOrderPic" type="radio">是</input>
<input value="0" name="goods.ifOrderPic" type="radio" checked="checked">否</input>
</td>
</tr>
<tr>
<td class="w120 tr h35">
需要车型:
</td>
<td>
<select name="goods.goodsCarType" class="txt w250 ml10">
<option value="0">
高栏车
</option>
<option value="1">
低栏车
</option>
<option value="2">
平板车
</option>
<option value="3">
半挂车
</option>
<option value="4">
厢式车
</option>
<option value="5">
冷藏车
</option>
<option value="6">
其他
</option>
</select>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<%-- <span class="c-f00">*</span> --%>是否全部投保:
</td>
<td>
<input id="yes" type="radio" name="goods.goodInsur" value="0"/>
是
<input type="radio" name="goods.goodInsur" value="1" checked="checked" />
否 <span id="premium"></span>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<%-- <span class="c-f00">*</span> --%>货物价值:
</td>
<td>
<input type="text" name="goods.goodsValue" id="goodsValue"
onchange="checkVal(this.value)" class="txt w250 ml10" />
元
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>
总重量:
</td>
<td>
<input type="text" id="totalWeight" name="goods.totalWeight" style="width:111px"/> 吨
<span class="c-f00">*</span>
总体积:<input type="text" id="totalVolume" name="goods.totalVolume" style="width:111px"/> 立方米
</td>
</tr>
</table>
</div>
</div>
<div class="s-wraper">
<div class="title">
</div>
<div class="content">
<center>
<br>
<br>
<input type="submit" id="selectBtn" name="selectBtn"
value="保存" class="btn btn-primary input-group" />
</center>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- 运单修改弹框 -->
<div class="modal fade" id="WayBillModify" tabindex="-1" role="dialog" aria-labelledby="editText" aria-hidden="true" >
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 class="modal-title" id="myModalLabel">
运单修改
</h3>
</div>
<div class="modal-body">
<div class="s-wraper" style="width: 903px;">
<form method="post" id="addForm" action="wbfbg/wayBillUpdate" onsubmit="return addGoods()">
<div>
<div class="title">
<span class="b-t">发货方:</span>
<span class="c-999 ml15"> </span>
</div>
<div class="content f-s-14">
<table style="display: table;">
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>发货地:
</td>
<td>
<div id="WayBillModify_goods_froms" name="goods.froms">
<select class="prov" id="fromprovince" name="fromprovince"></select>
<select class="city" id="fromcity" name="fromcity" disabled="disabled"></select>
<select class="dist" id="fromregion" name="fromregion" disabled="disabled"></select>
</div>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00"></span>街道:
</td>
<td>
<input type="text" name="goods.fromStreet" id="WayBillModify_goods_fromStreet" class="txt w250 ml10"/>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>联系人:
</td>
<td>
<input type="text" name="goods.sendName" id="WayBillModify_goods_sendName"
class="txt w250 ml10" />
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>手机号:
</td>
<td>
<input type="text" id="WayBillModify_goods_sendPhone" name="goods.sendPhone"
class="txt w250 ml10" />
</td>
</tr>
<tr>
<td class="w120 tr h35">
固定电话:
</td>
<td>
<input type="text" id="corAreaCode" class="txt w120 ml10" />
<%-- -
<input type="text" id="corTelephone" class="txt w150" />
-
<input type="text" id="corExtension" class="txt w150 " />
<span class="c-999">区号 - 电话号码 - 分机号</span> --%>
</td>
</tr>
</table>
</div>
</div>
<div class="f-s-14">
<div class="title">
<span class="b-t">收货方:</span>
<span class="c-999 ml15"> </spacn>
</div>
<div class="content">
<table style="display: table;">
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>收货地:
</td>
<td>
<div id="WayBillModify_goods_tos" name="goods.tos">
<select class="prov" id="toprovince" name="toprovince"></select>
<select class="city" id="tocity" name="tocity" disabled="disabled"></select>
<select class="dist" id="toregion" name="toregion" disabled="disabled"></select>
</div>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00"></span>街道:
</td>
<td>
<input type="text" name="goods.tosStreet" id="WayBillModify_goods_tosStreet" class="txt w250 ml10"/>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<%-- <span class="c-f00">*</span> --%>联系人:
</td>
<td>
<input type="text" id="WayBillModify_goods_receiveName" name="goods.receiveName"
class="txt w250 ml10" />
</td>
</tr>
<tr>
<td class="w120 tr h35">
<%-- <span class="c-f00">*</span> --%>手机号:
</td>
<td>
<input type="text" id="WayBillModify_goods_receivePhone" name="goods.receivePhone"
class="txt w250 ml10" />
</td>
</tr>
<tr>
<td class="w120 tr h35">
固定电话:
</td>
<td>
<input type="text" id="ceeAreaCode" class="txt w120 ml10" />
<%-- -
<input type="text" id="ceeTelephone" class="txt w150" />
-
<input type="text" id="ceeExtension" class="txt w150" />
<span class="c-999">区号 - 电话号码 - 分机号</span> --%>
</td>
</tr>
</table>
</div>
</div>
<div class="f-s-14">
<div class="title">
<span class="b-t">货物信息:</span>
<span class="c-999 ml15"> </span>
</div>
<div class="content">
<table style="display: table;">
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>货品名称:
</td>
<td>
<input type="text" name="goods.explains" id="WayBillModify_goods_explains"
class="txt w250 ml10" />
<a href="javascript:void(0)" class="c-f00 ml20" id="jysm">禁运说明</a>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>最晚揽包时间:
</td>
<td>
<!-- <input name="lhTime" type="text" value="" maxlength="10"
id="txtBeginDatezz" onclick="SelectDate(this, 'yyyy-MM-dd hh:mm:ss');"
readonly="readonly" class="txt w250 ml10" autocomplete="off" /> -->
<input id="WayBillModify_goods_canvassLatestTime" name="goods.canvassLatestTime" type="text" class="txt w250 ml10 form-control end_date" data-bind="value:stime" readonly="readonly"/>
<!-- <input id="endTime" name="endTime" type="text" class="form-control end_date" data-bind="value:etime" readonly="readonly"/> -->
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>货物种类:
</td>
<td>
<select id="WayBillModify_goods_variety" name="goods.variety"
class="txt w250 ml10">
<option value="0">
重货
</option>
<option value="1">
轻货
</option>
<option value="2">
不规则货物
</option>
<option value="3">
易碎货物
</option>
<!-- <option value="4">
化工类货物
</option> -->
</select>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>是否需要回单:
</td>
<td>
<input value="1" name="goods.ifOrderPic" type="radio" id="WayBillModify_goods_ifOrderPics">是</input>
<input value="0" name="goods.ifOrderPic" type="radio" id="WayBillModify_goods_ifOrderPicf">否</input>
</td>
</tr>
<tr>
<td class="w120 tr h35">
需要车型:
</td>
<td>
<select name="goods.goodsCarType" class="txt w250 ml10" id="WayBillModify_goods_goodsCarType">
<option value="0">
高栏车
</option>
<option value="1">
低栏车
</option>
<option value="2">
平板车
</option>
<option value="3">
半挂车
</option>
<option value="4">
厢式车
</option>
<option value="5">
冷藏车
</option>
<option value="6">
其他
</option>
</select>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<%-- <span class="c-f00">*</span> --%>是否全部投保:
</td>
<td>
<input type="radio" name="goods.goodInsur" value="0" id="WayBillModify_goods_goodInsurs"/>
是
<input type="radio" name="goods.goodInsur" value="1" id="WayBillModify_goods_goodInsurf"/>
否 <span id="premium"></span>
</td>
</tr>
<tr>
<td class="w120 tr h35">
<%-- <span class="c-f00">*</span> --%>货物价值:
</td>
<td>
<input type="text" name="goods.goodsValue" id="WayBillModify_goods_goodsValue"
onchange="checkVal(this.value)" class="txt w250 ml10" />
元
</td>
</tr>
<tr>
<td class="w120 tr h35">
<span class="c-f00">*</span>
总重量:
</td>
<td>
<input type="text" id="WayBillModify_goods_totalWeight" name="goods.totalWeight" style="width:111px"/> 吨
<span class="c-f00">*</span>
总体积:<input type="text" id="WayBillModify_goods_totalVolume" name="goods.totalVolume" style="width:111px"/> 立方米
</td>
</tr>
<tr>
<td>
<input type="text" style="display:none;" id="WayBillModify_goods_id" name="goods.id">
</td>
</tr>
</table>
</div>
</div>
<div class="s-wraper">
<div class="title">
</div>
<div class="content">
<center>
<br>
<br>
<input type="submit" id="selectBtn" name="selectBtn"
value="保存" class="btn btn-primary input-group" />
</center>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- 禁运说明详细 -->
<div
style="height: 450px; width: 400px; padding: 15px; border: 2px solid #dedede; background: #fff; color: #f00; z-index: 99999999; display: none; position: absolute; top: 20px; left: 10%;"
id="jysm-show">
<center>
<h2>
禁运原则
</h2>
</center>
<p
style="text-indent: 2em; color: #000; font-size: 14px; font-family: 'Microsoft YAHei';">
明令禁运的货物是指危险品,易于污染的,易损易碎无法控制的货物,承运上述货物造成后果无法计算,无法弥补,在无安全保证的前提下,坚决拒运的货物:
</p>
<p
style="text-indent: 2em; color: #000; font-size: 14px; font-family: 'Microsoft YAHei';">
如:酒精、煤油、汽柴油、油类、工艺品、烟草类、炸药及其它易燃易爆物品、易损易碎的家具、纸箱包装钢琴玻璃及陶瓷制品、鲜活物品、蔬菜、家禽、农药、胶类,国家明令禁运的军火、毒品、走私物品、电瓶、电板、电池、手提电脑、手机、数码摄(照)像机、MP3、涂料、染料、碳黑、不明白色粉末、不规则无包装货物等
</p>
<p
style="text-indent: 2em; color: #000; font-size: 14px; font-family: 'Microsoft YAHei';">
1、 难以估算价值的有价证券及易丢失的贵重物品;
如:提货单、核销单、护照、配额证、许可证、执照、私人证件、汇票、发票、本国或外国货币(现金)、金银饰物、人造首饰、手机等。
</p>
<p
style="text-indent: 2em; color: #000; font-size: 14px; font-family: 'Microsoft YAHei';">
2、易燃易爆物品(如烟花爆竹、起爆引信等);
</p>
<p
style="text-indent: 2em; color: #000; font-size: 14px; font-family: 'Microsoft YAHei';">
易燃液体:如油漆、汽油、酒精类、机油、樟脑油、发动机起动液、松节油、天拿水、胶水、香水等;
易燃固体:自燃物质,遇水释放易燃气体的物质,如活性碳、钛粉、椰肉干、蓖麻制品、橡胶碎屑、安全火柴(盒擦的或片擦的)、干燥的白磷、干燥的黄磷、镁粉等);
</p>
</div>
<!------------ javascript加载区域 ------------>
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/util/sykj_paging_2.0.js"></script>
<script type='text/javascript' src='js/knockout-3.3.0.js'></script>
<script type="text/javascript" src="js/knockout.validation.js"></script>
<script type="text/javascript" src="css/ui/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/ui/bootstrap-datetimepicker.js" charset="utf-8"></script>
<script type="text/javascript" src="js/ui/bootstrap-datetimepicker.zh-CN.js" charset="utf-8"></script>
<script type="text/javascript" src="js/Area.js" ></script>
<script type="text/javascript" src="js/AreaData_min.js" ></script>
<script type="text/javascript" src="js/jquery.cityselect.js"></script>
<script type="text/javascript">
//运单录入表单的校验
function inputCheck(){
var corContacter = document.getElementById("corContacter").value;
var corPhone = document.getElementById("corPhone").value;
var explains = document.getElementById("explains").value;
var startTime = document.getElementById("startTime").value;
var totalWeight = document.getElementById("totalWeight").value;
var totalVolume = document.getElementById("totalVolume").value;
var ceePhone = document.getElementById("ceePhone").value;//收货方手机
if(corContacter == null || corContacter == ''){
alert("发货方联系人不能为空");
return false;
}
if(corPhone == null || corPhone == ''){
alert("发货方手机号不能为空");
return false;
}
if(explains == null || explains == ''){
alert("货品名称不能为空");
return false;
}
if(startTime == null || startTime == ''){
alert("最晚包揽时间不能为空");
return false;
}
if(totalWeight == null || totalWeight == ''){
alert("货物总重量不能为空");
return false;
}
if(totalVolume == null || totalVolume == ''){
alert("货物总体积不能为空");
return false;
}
var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
if (!myreg.test(corPhone)) {
alert("请输入正确的手机号");
return false;
}
if (!myreg.test(ceePhone)) {
alert("请输入正确的手机号");
return false;
}
return true;
}
//禁运说明div的动画
$(function(){
show('jysm-show','jysm');
});
function show(picId,appId){
$('#'+picId).hide();
$('#'+appId).mouseenter(function(){
$('#'+picId).slideToggle('slow');
});
$('#'+appId).mouseleave(function(){
$('#'+picId).slideUp('slow');
});
}
/*查找对应状态的运单 */
$("#selectByStatus").click(function () {
var sel=document.getElementById("wbstatus");
var index = sel.selectedIndex; // 选中索引
var wbStatus = sel.options[index].value;
/* alert("索引:"+index+"text:"+qq+"value:"+qqq); */
/* window.open("wbfbg/wayBillInfo?wbStatus=" + wbStatus); */
if(-1 == wbStatus){
alert("请选择运单状态");
}else{
window.location.href = "wbfbg/wayBillInfo?wbStatus=" + wbStatus;
}
});
/*运单提交确认 */
function submissionz(id) {
if (confirm("确定提交么?")) {
$.getJSON('wbfbg/wayBillSubmission?wid=' + id, null, function (result, status, xhr) {
if(result){
alert('提交成功!');
}else{
alert("提交失败");
}
window.location.reload();
});
}
}
/*运单提交确认 */
function submissionzz(id) {
if (confirm("确定提交么?")) {
$.getJSON('wbfbg/wayBillSubmission?wid=' + id, null, function (result, status, xhr) {
if(result){
alert('提交成功!');
}else{
alert("提交失败");
}
window.location.reload();
});
}
}
/*运单修改 */
function modifyzz(id){
$.ajax({
typr:"GET",
url:"wbfbg/wayBillModify?wid="+id,
success:function(result){
//goodInsur;// 是否投保 0:代表是;1:代表否
if(result.goodInsur == 0){
document.getElementById("WayBillModify_goods_goodInsurs").checked = true;
}else if(result.goodInsur == 1){
document.getElementById("WayBillModify_goods_goodInsurf").checked = true;
}
//是否需要回单,0代表否,1代表是 ifOrderPic
if(result.ifOrderPic == 0){
document.getElementById("WayBillModify_goods_ifOrderPicf").checked = true;
}else if(result.ifOrderPic == 1){
document.getElementById("WayBillModify_goods_ifOrderPics").checked = true;
}
//省市
var strs= new Array(); //定义一数组
var strss= new Array(); //定义一数组
strs=result.froms.split(",");
strss=result.tos.split(",");
$("#WayBillModify_goods_froms").citySelect({
prov:strs[0],
city:strs[1],
dist:strs[2],
nodata:"none"
});
$("#WayBillModify_goods_tos").citySelect({
prov:strss[0],
city:strss[1],
dist:strss[2],
nodata:"none"
});
$("#WayBillModify_goods_froms").val(result.qq);//****
$("#WayBillModify_goods_fromStreet").val(result.fromStreet);
$("#WayBillModify_goods_sendName").val(result.sendName);
$("#WayBillModify_goods_sendPhone").val(result.sendPhone);
$("#WayBillModify_goods_tos").val(result.qq);//****
$("#WayBillModify_goods_tosStreet").val(result.tosStreet);
$("#WayBillModify_goods_receiveName").val(result.receiveName);
$("#WayBillModify_goods_receivePhone").val(result.receivePhone);
$("#WayBillModify_goods_explains").val(result.explains);
$("#WayBillModify_goods_canvassLatestTime").val(result.canvassLatestTime);
$("#WayBillModify_goods_variety").val(result.variety);
$("#WayBillModify_goods_goodsCarType").val(result.goodsCarType);
$("#WayBillModify_goods_goodsValue").val(result.goodsValue);
$("#WayBillModify_goods_totalWeight").val(result.totalWeight);
$("#WayBillModify_goods_totalVolume").val(result.totalVolume);
$("#WayBillModify_goods_id").val(result.id);
$("#WayBillModify").modal('show');
}
});
}
/*运单修改 */
function modifyz(id){
$.ajax({
typr:"GET",
url:"wbfbg/wayBillModify?wid="+id,
success:function(result){
// alert("111111111111111"+result.explains);
//goodInsur;// 是否投保 0:代表是;1:代表否
if(result.goodInsur == 0){
document.getElementById("WayBillModify_goods_goodInsurs").checked = true;
}else if(result.goodInsur == 1){
document.getElementById("WayBillModify_goods_goodInsurf").checked = true;
}
//是否需要回单,0代表否,1代表是 ifOrderPic
if(result.ifOrderPic == 0){
document.getElementById("WayBillModify_goods_ifOrderPicf").checked = true;
}else if(result.ifOrderPic == 1){
document.getElementById("WayBillModify_goods_ifOrderPics").checked = true;
}
//省市
var strs= new Array(); //定义一数组
var strss= new Array(); //定义一数组
strs=result.froms.split(",");
strss=result.tos.split(",");
$("#WayBillModify_goods_froms").citySelect({
prov:strs[0],
city:strs[1],
dist:strs[2],
nodata:"none"
});
$("#WayBillModify_goods_tos").citySelect({
prov:strss[0],
city:strss[1],
dist:strss[2],
nodata:"none"
});
$("#WayBillModify_goods_froms").val(result.qq);//****
$("#WayBillModify_goods_fromStreet").val(result.fromStreet);
$("#WayBillModify_goods_sendName").val(result.sendName);
$("#WayBillModify_goods_sendPhone").val(result.sendPhone);
$("#WayBillModify_goods_tos").val(result.qq);//****
$("#WayBillModify_goods_tosStreet").val(result.tosStreet);
$("#WayBillModify_goods_receiveName").val(result.receiveName);
$("#WayBillModify_goods_receivePhone").val(result.receivePhone);
$("#WayBillModify_goods_explains").val(result.explains);
$("#WayBillModify_goods_canvassLatestTime").val(result.canvassLatestTime);
$("#WayBillModify_goods_variety").val(result.variety);
$("#WayBillModify_goods_goodsCarType").val(result.goodsCarType);
$("#WayBillModify_goods_goodsValue").val(result.goodsValue);
$("#WayBillModify_goods_totalWeight").val(result.totalWeight);
$("#WayBillModify_goods_totalVolume").val(result.totalVolume);
$("#WayBillModify_goods_id").val(result.id);
$("#WayBillModify").modal('show');
}
});
}
/*运单删除 */
function deletez(id){
if (confirm("确定删除么?")) {
$.getJSON('wbfbg/wayBillDelete?wid=' + id, null, function (result, status, xhr) {
if(result){
alert('删除成功!');
}else{
alert("删除失败");
}
window.location.reload();
});
}
}
/*运单删除 */
function deletezz(id){
if (confirm("确定删除么?")) {
$.getJSON('wbfbg/wayBillDelete?wid=' + id, null, function (result, status, xhr) {
if(result){
alert('删除成功!');
}else{
alert("删除失败");
}
window.location.reload();
});
}
}
/*运单录入框*/
$("#wbinput").click(function () {
$("#fixModal").modal('show');
});
/*省市联动 */
$(function(){
$("#city_3").citySelect({
prov:"湖南",
city:"长沙",
dist:"岳麓区",
nodata:"none"
});
$("#city_4").citySelect({
prov:"河南",
city:"郑州",
dist:"中原区",
nodata:"none"
});
});
/*时间控件*/
$('.start_date, .end_date').datetimepicker({
language: 'zh-CN',
format: 'yyyy-mm-dd',
weekStart: 1,
todayBtn: true,
autoclose: true,
todayHighlight: true,
startView: 2,
minView: 2,
forceParse: 0,
});
</script>
</body>
</html>