...
|
...
|
@@ -14,9 +14,9 @@ |
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
<title><spring:message code="menu.consignee_info_set" /></title>
|
|
|
<script type="text/javascript" src="<%=basePath%>resource/easyui/jquery.min.js"></script>
|
|
|
<script type="text/javascript" src="<%=basePath%>resource/validate/jquery.validate.js"></script>
|
|
|
<script type="text/javascript" src="<%=basePath%>resource/validate/validate-extends.js"></script>
|
|
|
<script type="text/javascript" src="<%=basePath%>resource/easyui/jquery.min.js?version=${version}"></script>
|
|
|
<script type="text/javascript" src="<%=basePath%>resource/validate/jquery.validate.js?version=${version}"></script>
|
|
|
<script type="text/javascript" src="<%=basePath%>resource/validate/validate-extends.js?version=${version}"></script>
|
|
|
<!-- validate 验证中英文 -->
|
|
|
<script type="text/javascript"
|
|
|
src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js?version=${version}"></script>
|
...
|
...
|
@@ -29,11 +29,11 @@ |
|
|
<link rel="stylesheet" href="<%=basePath%>resource/easyui/uimaker/easyui.css?version=${version}">
|
|
|
|
|
|
<style type="text/css">
|
|
|
.required_span {
|
|
|
color: red;
|
|
|
margin-left: 10px;
|
|
|
font-size: 20px;
|
|
|
}
|
|
|
.required_span {
|
|
|
color: red;
|
|
|
margin-left: 10px;
|
|
|
font-size: 20px;
|
|
|
}
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
...
|
...
|
@@ -45,38 +45,28 @@ |
|
|
<tbody>
|
|
|
<tr>
|
|
|
<td><spring:message code="manifest.company" /><span class="required_span">*</span></td>
|
|
|
<td colspan="5">
|
|
|
<input type="text" name="name" id="name" maxlength="70" lay-verify="required"
|
|
|
value="${consignee.name}" autocomplete="off" class="layui-input" required
|
|
|
oninput="onInputChange(event,'name','oninput')" lay-verify="required"
|
|
|
onpropertychange="onInputChange(event,'name','onpropertychange')">
|
|
|
</td>
|
|
|
<td colspan="5"><input type="text" name="name" id="name" maxlength="70"
|
|
|
value="${consignee.name}" autocomplete="off" class="layui-input" required lay-verify="required"
|
|
|
oninput="onInputChange(event,'name','oninput')"
|
|
|
onpropertychange="onInputChange(event,'name','onpropertychange')"></td>
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
<td><spring:message code="manifest.shr.name" /><span class="required_span">*</span></td>
|
|
|
<td>
|
|
|
<input type="text" name="code" id="code" value="${consignee.code}"
|
|
|
maxlength="70" autocomplete="off" class="layui-input" required lay-verify="required"
|
|
|
<td><input type="text" id="code" name="code" value="${consignee.code}" maxlength="70"
|
|
|
autocomplete="off" class="layui-input" required lay-verify="required"
|
|
|
oninput="onInputChange(event,'code','oninput')"
|
|
|
onpropertychange="onInputChange(event,'code','onpropertychange')">
|
|
|
</td>
|
|
|
|
|
|
onpropertychange="onInputChange(event,'code','onpropertychange')"></td>
|
|
|
<td><spring:message code="manifest.telephone" /></td>
|
|
|
<td>
|
|
|
<input type="text" name="tel" id="tel" value="${consignee.tel}"
|
|
|
autocomplete="off" class="layui-input" maxlength="50"
|
|
|
oninput="onInputChange(event,'tel','oninput')"
|
|
|
onpropertychange="onInputChange(event,'tel','onpropertychange')">
|
|
|
</td>
|
|
|
|
|
|
<td><input type="text" name="tel" id="tel"
|
|
|
oninput="onInputChange(event,'tel','oninput')"
|
|
|
onpropertychange="onInputChange(event,'tel','onpropertychange')"
|
|
|
value="${consignee.tel}" autocomplete="off" class="layui-input" maxlength="50"></td>
|
|
|
<td><spring:message code="manifest.fax" /></td>
|
|
|
<td>
|
|
|
<input type="text" name="fax" id="fax" value="${consignee.fax}"
|
|
|
oninput="onInputChange(event,'fax','oninput')"
|
|
|
onpropertychange="onInputChange(event,'fax','onpropertychange')"
|
|
|
autocomplete="off" class="layui-input" maxlength="50">
|
|
|
</td>
|
|
|
<td><input type="text" name="fax" id="fax" value="${consignee.fax}"
|
|
|
autocomplete="off" class="layui-input" maxlength="50"
|
|
|
oninput="onInputChange(event,'fax','oninput')"
|
|
|
onpropertychange="onInputChange(event,'fax','onpropertychange')"></td>
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
...
|
...
|
@@ -84,65 +74,46 @@ |
|
|
<td>
|
|
|
<input required lay-verify="required" class="layui-input"
|
|
|
id="country" name="country" maxlength="2" type="text"
|
|
|
<c:if test="${empty consignee.country}">value=""</c:if>
|
|
|
<c:if test="${empty consignee.country}">value="CN"</c:if>
|
|
|
<c:if test="${not empty consignee.country}">value="${consignee.country}"</c:if>
|
|
|
oninput="onInputChange(event,'country','oninput')"
|
|
|
onpropertychange="onInputChange(event,'country','onpropertychange')">
|
|
|
onpropertychange="onInputChange(event,'country','onpropertychange')">
|
|
|
</td>
|
|
|
|
|
|
<td><spring:message code="manifest.city" /><span class="required_span">*</span></td>
|
|
|
<td>
|
|
|
<input required type="text" name="city" id="city" value="${consignee.city}"
|
|
|
autocomplete="off" class="layui-input" required lay-verify="required" maxlength="70"
|
|
|
oninput="onInputChange(event,'city','oninput')"
|
|
|
onpropertychange="onInputChange(event,'city','onpropertychange')">
|
|
|
<input type="text" name="city" id="city" value="${consignee.city}"
|
|
|
autocomplete="off" class="layui-input" required maxlength="35" lay-verify="required"
|
|
|
oninput="onInputChange(event,'city','oninput')"
|
|
|
onpropertychange="onInputChange(event,'city','onpropertychange')">
|
|
|
</td>
|
|
|
|
|
|
<td><spring:message code="manifest.zip.code" /></td>
|
|
|
<td>
|
|
|
<input type="text" name="zipcode" id="zipcode" value="${consignee.zipcode}"
|
|
|
oninput="onInputChange(event,'zipcode','oninput')"
|
|
|
onpropertychange="onInputChange(event,'zipcode','onpropertychange')"
|
|
|
autocomplete="off" class="layui-input" maxlength="9">
|
|
|
</td>
|
|
|
<td><input type="text" name="zipcode" id="zipcode" value="${consignee.zipcode}"
|
|
|
oninput="onInputChange(event,'zipcode','oninput')"
|
|
|
onpropertychange="onInputChange(event,'zipcode','onpropertychange')"
|
|
|
autocomplete="off" class="layui-input" maxlength="9"></td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td><spring:message code="manifest.address" /><span class="required_span">*</span></td>
|
|
|
<td colspan="2">
|
|
|
<input required type="text" name="address" id="address" value="${consignee.address}"
|
|
|
autocomplete="off" class="layui-input" maxlength="70" lay-verify="required"
|
|
|
<td colspan="2"><input id="address" required type="text" name="address" lay-verify="required"
|
|
|
value="${consignee.address}" autocomplete="off" class="layui-input" maxlength="70"
|
|
|
oninput="onInputChange(event,'address','oninput')"
|
|
|
onpropertychange="onInputChange(event,'address','onpropertychange')">
|
|
|
</td>
|
|
|
|
|
|
onpropertychange="onInputChange(event,'address','onpropertychange')"></td>
|
|
|
<td><spring:message code="manifest.shr.cneaeo" /></td>
|
|
|
<td colspan="2">
|
|
|
<input type="text" name="aeo" id="cneaeo"
|
|
|
<td colspan="2"><input type="text" name="aeo" id="aeo"
|
|
|
value="${consignee.aeo}" autocomplete="off" class="layui-input" maxlength="20"
|
|
|
oninput="onInputChange(event,'cneaeo','oninput')"
|
|
|
onpropertychange="onInputChange(event,'cneaeo','onpropertychange')">
|
|
|
</td>
|
|
|
oninput="onInputChange(event,'aeo','oninput')"
|
|
|
onpropertychange="onInputChange(event,'aeo','onpropertychange')"></td>
|
|
|
</tr>
|
|
|
|
|
|
<%-- <tr>
|
|
|
<td><spring:message code="manifest.enterprise.code" /><span class="required_span">*</span></td>
|
|
|
<td>
|
|
|
<input required id="cnecusid" type="text" name="cusid" value="${consignee.cusid}"
|
|
|
autocomplete="off" class="layui-input" maxlength="128" lay-verify="required"
|
|
|
oninput="onInputChange(event,'cnecusid','oninput')"
|
|
|
onpropertychange="onInputChange(event,'cnecusid','onpropertychange')">
|
|
|
</td>
|
|
|
</tr> --%>
|
|
|
|
|
|
<tr>
|
|
|
<td colspan="6">
|
|
|
<div class="layui-row">
|
|
|
<div class="layui-col-md2">
|
|
|
<select id="cne_cusid" required lay-verify="required">
|
|
|
<select id="co_cusid" required lay-verify="required">
|
|
|
<c:if test="${not empty consignee.cusid}">
|
|
|
<c:set var="tempCneType" value='${fn:split(consignee.cusid,"+")[0]}' />
|
|
|
<option value="${tempCneType}">${tempCneType}</option>
|
|
|
<c:set var="tempShpType" value='${fn:split(consignee.cusid,"+")[0]}' />
|
|
|
<option value="${tempShpType}">${tempShpType}</option>
|
|
|
</c:if>
|
|
|
|
|
|
<c:if test="${empty consignee.cusid}">
|
...
|
...
|
@@ -154,19 +125,20 @@ |
|
|
<span style="color: black; font-size: 16px;">+</span>
|
|
|
</div>
|
|
|
<div class="layui-col-md5">
|
|
|
<input id="cnecusid" type="text" maxlength="100" class="layui-input" required lay-verify="required"
|
|
|
<input id="cusid" type="text" maxlength="100" class="layui-input" required lay-verify="required"
|
|
|
<c:if test="${not empty consignee.cusid}">
|
|
|
<c:set var="tempCneValue" value='${fn:split(consignee.cusid,"+")[1]}' />
|
|
|
value="${tempCneValue}"
|
|
|
<c:set var="tempShpValue" value='${fn:split(consignee.cusid,"+")[1]}' />
|
|
|
value="${tempShpValue}"
|
|
|
</c:if>
|
|
|
|
|
|
placeholder="<spring:message code='manifest.enterprise.code' />"
|
|
|
oninput="onInputChange(event,'cnecusid','oninput')"
|
|
|
onpropertychange="onInputChange(event,'cnecusid','onpropertychange')">
|
|
|
oninput="onInputChange(event,'cusid','oninput')"
|
|
|
onpropertychange="onInputChange(event,'cusid','onpropertychange')">
|
|
|
</div>
|
|
|
</div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
...
|
...
|
@@ -181,7 +153,7 @@ |
|
|
</div>
|
|
|
|
|
|
<script>
|
|
|
var api = "<%=basePath %>enterprise/search";
|
|
|
var api = "<%=basePath %>enterprise/search";
|
|
|
$('#country').combogrid({
|
|
|
panelWidth:260,
|
|
|
url: api,
|
...
|
...
|
@@ -196,7 +168,7 @@ |
|
|
$('#country').combogrid('setValue',upper);
|
|
|
parm.start = upper;
|
|
|
|
|
|
onGetData('cne_cusid','country');
|
|
|
onGetData('co_cusid','country');
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
...
|
...
|
@@ -205,7 +177,7 @@ |
|
|
//当用户选择一个列表项时触发。
|
|
|
$('#country').combogrid('setValue',rowData.country_code);
|
|
|
|
|
|
onGetData('cne_cusid','country');
|
|
|
onGetData('co_cusid','country');
|
|
|
},
|
|
|
columns:[[
|
|
|
{field:'name_cn',title:'名称',width:106},
|
...
|
...
|
@@ -214,18 +186,18 @@ |
|
|
});
|
|
|
|
|
|
function onGetData(selectId,inputId) {
|
|
|
var cneType = "";
|
|
|
var cne_cusid = "${consignee.cusid}";
|
|
|
if(notEmpty(cne_cusid)){
|
|
|
cneType = cne_cusid.split("+")[0];
|
|
|
var shpType = "";
|
|
|
var shp_cusid = "${consignee.cusid}";
|
|
|
if(notEmpty(shp_cusid)){
|
|
|
shpType = shp_cusid.split("+")[0];
|
|
|
}
|
|
|
|
|
|
var select = $("#"+selectId);
|
|
|
select.html("");
|
|
|
select.append("<option value=''><spring:message code='manifest.enterprise.code.type' /></option>");
|
|
|
|
|
|
var countryCode = $('#'+inputId).combobox('getValue');
|
|
|
|
|
|
var countryCode = $('#'+inputId).combobox('getValue');
|
|
|
|
|
|
$.ajax({
|
|
|
url:"<%=basePath%>/enterprise/list?countryCode="+countryCode,
|
|
|
success:function(data){
|
...
|
...
|
@@ -233,7 +205,7 @@ |
|
|
if(data.data){
|
|
|
for(var i = 0; i < data.data.length; i++){
|
|
|
var type = data.data[i].enterprise_type;
|
|
|
if(notEmpty(cneType)&&type&&(type==cneType)){
|
|
|
if(notEmpty(shpType)&&type&&(type==shpType)){
|
|
|
select.append("<option selected value='"+type+"'>"+type+"</option>");
|
|
|
}else{
|
|
|
select.append("<option value='"+type+"'>"+type+"</option>");
|
...
|
...
|
@@ -248,19 +220,29 @@ |
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
var layer;
|
|
|
layui.use('layer', function() {
|
|
|
layer = layui.layer;
|
|
|
});
|
|
|
|
|
|
$(window).load(function() {
|
|
|
});
|
|
|
|
|
|
layui.use('form', function() {
|
|
|
var form = layui.form;
|
|
|
|
|
|
form.on('submit(formDemo)', function(data){
|
|
|
var phone = data.field.tel;
|
|
|
var fax = data.field.fax;
|
|
|
if(isEmpty(phone)&&isEmpty(fax)){
|
|
|
layer.msg("电话和传真必须填写一项!");
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
var country = data.field.country;
|
|
|
if(isEmpty(country)){
|
|
|
layer.msg("请选择国家");
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
save(data.field);
|
|
|
return false;
|
|
|
});
|
...
|
...
|
@@ -274,15 +256,12 @@ |
|
|
if (data.id) {
|
|
|
params += "&id=" + data.id;
|
|
|
}
|
|
|
if (data.cusid) {
|
|
|
params += "&cusid=" + data.cusid;
|
|
|
}
|
|
|
|
|
|
var cusid_type = getSelectedValue("cne_cusid");
|
|
|
var cusid = $("#cnecusid").val();
|
|
|
var shp_cusid_type = getSelectedValue("co_cusid");
|
|
|
var sh_cusid = $("#cusid").val();
|
|
|
|
|
|
if(notEmpty(cusid_type)&¬Empty(cusid)){
|
|
|
cusid = cusid_type+"+"+cusid;
|
|
|
if(notEmpty(shp_cusid_type)&¬Empty(sh_cusid)){
|
|
|
cusid = shp_cusid_type+"+"+sh_cusid;
|
|
|
params+="&cusid="+encodeURIComponent(cusid);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -304,15 +283,15 @@ |
|
|
if (data.country) {
|
|
|
params += "&country=" + data.country;
|
|
|
}
|
|
|
if (data.provincecode) {
|
|
|
params += "&provincecode=" + data.provincecode;
|
|
|
}
|
|
|
if (data.tel) {
|
|
|
params += "&tel=" + data.tel;
|
|
|
}
|
|
|
if (data.fax) {
|
|
|
params += "&fax=" + data.fax;
|
|
|
}
|
|
|
if (data.provincecode) {
|
|
|
params += "&provincecode=" + data.provincecode;
|
|
|
}
|
|
|
|
|
|
$.post(url, params, function(response, status) {
|
|
|
if (response.status == 200) {
|
...
|
...
|
|