|
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
|
|
<%@ page isELIgnored="false"%>
|
|
|
<%
|
|
|
String path = request.getContextPath();
|
|
|
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
|
|
%>
|
|
|
<!doctype html>
|
|
|
<html lang="zh">
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
<title>落装改配修改</title>
|
|
|
<%-- <link href="<%=basePath %>static/css/login.css" rel="stylesheet"> --%>
|
|
|
<link href="<%=basePath %>static/layui2.4.5/css/layui.css" rel="stylesheet">
|
|
|
<style type="text/css">
|
|
|
.layui-input-b1ock {
|
|
|
margin-left: 25px;
|
|
|
min-height: 36px;
|
|
|
}
|
|
|
</style>
|
|
|
<script src="<%=basePath %>static/easyui/jquery.min.js"></script>
|
|
|
<script src="<%=basePath %>static/layui2.4.5/layui.js"></script>
|
|
|
<script type="text/javascript" src="<%=basePath %>static/layer-v3.0.3/layer/layer.js"></script>
|
|
|
<script>
|
|
|
function child(d) {
|
|
|
$("#id").val(d.id)
|
|
|
$("#flightno").val(d.flightno);
|
|
|
$("#cflightno").val(d.cflightno);
|
|
|
$("#flightdate").val(d.flightdate.substring(0,10));
|
|
|
$("#cflightdate").val(d.cflightdate.substring(0,10));
|
|
|
$("#waybillnomaster").val(d.waybillnomaster);
|
|
|
$("#cwaybillnomaster").val(d.cwaybillnomaster);
|
|
|
$("#waybillnosecondary").val(d.waybillnosecondary);
|
|
|
$("#cwaybillnosecondary").val(d.cwaybillnosecondary);
|
|
|
}
|
|
|
</script>
|
|
|
<script>
|
|
|
layui.use(['form','laydate'], function(){
|
|
|
var form = layui.form
|
|
|
,laydate = layui.laydate;
|
|
|
//监听提交
|
|
|
form.on('submit(demo1)', function(data){
|
|
|
if(check()){
|
|
|
editForm(data.field);
|
|
|
}
|
|
|
return false;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
function editForm(data){
|
|
|
var billNo = $("#waybillnomaster").val();
|
|
|
data.waybillnomaster=billNo;
|
|
|
$.ajax({
|
|
|
type : "post",
|
|
|
url : "<%=basePath %>/lost/change/editForm",
|
|
|
data : data,
|
|
|
success: function(data){
|
|
|
if(data.success){
|
|
|
layer.alert( data.msg, function () {
|
|
|
window.parent.location.reload(); //刷新父页面
|
|
|
parent.layer.close(index); //关闭当前弹窗
|
|
|
});
|
|
|
}else{
|
|
|
layer.alert( data.msg, function () {
|
|
|
window.parent.location.reload(); //刷新父页面
|
|
|
parent.layer.close(index); //关闭当前弹窗
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
error: function() {
|
|
|
layer.alert("保存失败,请重试");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
</head >
|
|
|
|
|
|
<body align="center">
|
|
|
<blockquote class="layui-elem-quote">原始信息</blockquote>
|
|
|
<hr>
|
|
|
<form class="layui-form" action="" lay-filter="example">
|
|
|
<input type="hidden" id="id" name="id" autocomplete="off" class="layui-input" >
|
|
|
<div class="layui-form-item">
|
|
|
<div class="layui-inline">
|
|
|
<label class="layui-form-label">航班号</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="text" id="flightno" placeholder="此项为必填项" style="text-transform:uppercase;" name="flightno" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-inline">
|
|
|
<label class="layui-form-label">航班日期</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="text" id="flightdate" placeholder="此项为必填项" name="flightdate" autocomplete="off" class="layui-input">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<div class="layui-inline">
|
|
|
<label class="layui-form-label">主单号</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="text" id="waybillnomaster" placeholder="此项为必填项" name="waybillnomaster" value="${waybillnomaster}" autocomplete="off" class="layui-input">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-inline">
|
|
|
<label class="layui-form-label">分单号</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="text" id="waybillnosecondary" style="text-transform:uppercase;" name="waybillnosecondary" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<blockquote class="layui-elem-quote">改配后信息</blockquote>
|
|
|
<div class="layui-form-item">
|
|
|
<div class="layui-inline">
|
|
|
<label class="layui-form-label">航班号</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="text" id="cflightno" style="text-transform:uppercase;" placeholder="此项为必填项" name="cflightno" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-inline">
|
|
|
<label class="layui-form-label">航班日期</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="text" id="cflightdate" placeholder="此项为必填项" name="cflightdate" autocomplete="off" class="layui-input">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<div class="layui-inline">
|
|
|
<label class="layui-form-label">主单号</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="text" id="cwaybillnomaster" name="cwaybillnomaster" autocomplete="off" class="layui-input">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-inline">
|
|
|
<label class="layui-form-label">分单号</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="text" id="cwaybillnosecondary" style="text-transform:uppercase;" name="cwaybillnosecondary" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<blockquote class="layui-elem-quote">商品项信息 <a style="margin-left:450px" class="layui-btn layui-btn-xs" onclick="add()">新增</a></blockquote>
|
|
|
|
|
|
<div class="layui-inline" >
|
|
|
<table class="layui-hide" id="flightItem" lay-filter="flightItem" style="width:99%; text-align="center"></table>
|
|
|
</div>
|
|
|
<hr>
|
|
|
<div class="layui-form-item" >
|
|
|
<div class="layui-input-b1ock">
|
|
|
<button class="layui-btn" lay-submit="" lay-filter="demo1">
|
|
|
<c:if test="${empty ftId }">保存</c:if>
|
|
|
<c:if test="${not empty ftId}">修改</c:if>
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</form>
|
|
|
<script type="text/javascript">
|
|
|
layui.use(['form', 'laydate'], function(){
|
|
|
var form = layui.form
|
|
|
,laydate = layui.laydate
|
|
|
|
|
|
//日期
|
|
|
laydate.render({
|
|
|
elem: '#flightdate'
|
|
|
});
|
|
|
laydate.render({
|
|
|
elem: '#cflightdate'
|
|
|
});
|
|
|
});
|
|
|
|
|
|
function add(){
|
|
|
var waybillnomaster =$("#waybillnomaster").val();
|
|
|
parent.layer.open({
|
|
|
type: 2,
|
|
|
title: "商品信息新增",
|
|
|
shade: 0.8,
|
|
|
id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748
|
|
|
moveType: 1, //拖拽模式,0或者1
|
|
|
type: 2,
|
|
|
skin: 'layui-layer-rim', //加上边框
|
|
|
/* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */
|
|
|
area: ['700px', '386px'],
|
|
|
maxmin: true, //开启最大化最小化按钮
|
|
|
content: "<%=basePath %>/lost/change/editItem?waybillnomaster="+waybillnomaster,
|
|
|
zIndex: parent.layer.zIndex,
|
|
|
success: function (layero, index) {
|
|
|
// 获取子页面的iframe
|
|
|
var frameId = $(layero).find("iframe").attr('id');//父页面获取子页面的iframe
|
|
|
var iframe = parent.window['layui-layer-iframe' + index];
|
|
|
var iframeWin = parent.window[layero.find('iframe')[0]['name']];
|
|
|
parent.layer.setTop(layero);
|
|
|
// 向子页面的全局函数child传参
|
|
|
//iframe.child(data);
|
|
|
}
|
|
|
,end : function(){
|
|
|
layui.table.reload('flightItem')
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
function check(){
|
|
|
var billNo = $("#waybillnomaster").val();
|
|
|
var cbillNo = $("#cwaybillnomaster").val();
|
|
|
var flightno = $("#flightno").val();
|
|
|
var cflightno = $("#cflightno").val();
|
|
|
var flightdate = $("#flightdate").val();
|
|
|
var cflightdate = $("#cflightdate").val();
|
|
|
var regs = /[a-z]/i;
|
|
|
if(flightno==''){
|
|
|
$("#flightno").focus();
|
|
|
layer.tips('请输入航班号', '#flightno', {
|
|
|
tips: [1, '#0FA6D8'] //还可配置颜色
|
|
|
});
|
|
|
return false;
|
|
|
}else if(flightdate==''){
|
|
|
$("#flightdate").focus();
|
|
|
layer.tips('请输入航班日期', '#flightdate', {
|
|
|
tips: [1, '#0FA6D8'] //还可配置颜色
|
|
|
});
|
|
|
return false;
|
|
|
}else if(billNo==''){
|
|
|
$("#waybillnomaster").focus();
|
|
|
layer.tips('请输入主单号', '#waybillnomaster', {
|
|
|
tips: [1, '#0FA6D8'] //还可配置颜色
|
|
|
});
|
|
|
return false;
|
|
|
}else if(billNo.indexOf("-") != -1){
|
|
|
billNo=billNo;
|
|
|
if(billNo.length!=12){
|
|
|
$("#waybillnomaster").focus();
|
|
|
layer.tips('主单号必须为11位', '#waybillnomaster', {
|
|
|
tips: [1, '#0FA6D8'] //还可配置颜色
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
}else if(regs.test(billNo)){
|
|
|
$("#waybillnomaster").focus();
|
|
|
layer.tips('主单号必须为数字', '#waybillnomaster', {
|
|
|
tips: [1, '#0FA6D8'] //还可配置颜色
|
|
|
});
|
|
|
return false;
|
|
|
}else if(billNo.length!=11){
|
|
|
$("#waybillnomaster").focus();
|
|
|
layer.tips('主单号必须为11位', '#waybillnomaster', {
|
|
|
tips: [1, '#0FA6D8'] //还可配置颜色
|
|
|
});
|
|
|
return false;
|
|
|
}else if(cflightno==''){
|
|
|
$("#cflightno").focus();
|
|
|
layer.tips('请输入改配后航班号', '#cflightno', {
|
|
|
tips: [1, '#0FA6D8'] //还可配置颜色
|
|
|
});
|
|
|
return false;
|
|
|
}else if(cflightdate==''){
|
|
|
$("#cflightdate").focus();
|
|
|
layer.tips('请输入改配后航班日期', '#cflightdate', {
|
|
|
tips: [1, '#0FA6D8'] //还可配置颜色
|
|
|
});
|
|
|
return false;
|
|
|
}else if(regs.test(cbillNo)){
|
|
|
$("#cwaybillnomaster").focus();
|
|
|
layer.tips('主单号必须为数字', 'c#waybillnomaster', {
|
|
|
tips: [1, '#0FA6D8'] //还可配置颜色
|
|
|
});
|
|
|
return false;
|
|
|
}else if(cbillNo==''){
|
|
|
return true;
|
|
|
}else if(cbillNo.indexOf("-") != -1){
|
|
|
cbillNo=cbillNo;
|
|
|
if(cbillNo.length!=12){
|
|
|
$("#cwaybillnomaster").focus();
|
|
|
layer.tips('主单号必须为11位', '#cwaybillnomaster', {
|
|
|
tips: [1, '#0FA6D8'] //还可配置颜色
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
}else if(cbillNo.length!=11){
|
|
|
$("#cwaybillnomaster").focus();
|
|
|
layer.tips('主单号必须为11位', '#cwaybillnomaster', {
|
|
|
tips: [1, '#0FA6D8'] //还可配置颜色
|
|
|
});
|
|
|
return false;
|
|
|
}else {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
layui.use('table', function(){
|
|
|
var table = layui.table;
|
|
|
var waybillnomaster = $("#waybillnomaster").val();
|
|
|
table.render({
|
|
|
elem: '#flightItem'
|
|
|
,url:'<%=basePath %>/lost/change/getIteamList?waybillnomaster='+waybillnomaster
|
|
|
/* ,toolbar: '#toolbar' */
|
|
|
,page: false //开启分页
|
|
|
,cols: [[
|
|
|
{field:'orderNumber', align:'center',title:'序号', width:130, sort: true}
|
|
|
,{field:'description', align:'center',title:'简要描述', width:150}
|
|
|
,{field:'piece', title:'件数',align:'center', width:130,}
|
|
|
,{field:'weight', title:'重量',align:'center', width:100,}
|
|
|
,{fixed: 'right', title:'操作',align:'center', toolbar: '#barDemo', width:135}
|
|
|
]]
|
|
|
})
|
|
|
|
|
|
table.on('tool(flightItem)', function(obj){
|
|
|
var data = obj.data;
|
|
|
console.log(obj)
|
|
|
if(obj.event === 'edit'){
|
|
|
var data = obj.data;
|
|
|
var id = data.id;
|
|
|
parent.layer.open({
|
|
|
type: 2,
|
|
|
title: "商品信息编辑",
|
|
|
shade: 0.8,
|
|
|
id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748
|
|
|
moveType: 1, //拖拽模式,0或者1
|
|
|
type: 2,
|
|
|
skin: 'layui-layer-rim', //加上边框
|
|
|
/* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */
|
|
|
area: ['700px', '386px'],
|
|
|
maxmin: true, //开启最大化最小化按钮
|
|
|
content: "<%=basePath %>/lost/change/editItem?id="+id,
|
|
|
zIndex: parent.layer.zIndex,
|
|
|
success: function (layero, index) {
|
|
|
debugger;
|
|
|
var layer = layui.layer;
|
|
|
// 获取子页面的iframe
|
|
|
var iframe = parent.window['layui-layer-iframe' + index];
|
|
|
parent.layer.setTop(layero);
|
|
|
// 向子页面的全局函数child传参
|
|
|
iframe.child(data);
|
|
|
}
|
|
|
,end : function(){
|
|
|
layui.table.reload('flightItem')
|
|
|
}
|
|
|
})
|
|
|
}else if(obj.event === 'del'){
|
|
|
var data = obj.data;
|
|
|
var id = data.id;
|
|
|
layer.confirm('您确定要删除吗', function(index){
|
|
|
$.ajax({
|
|
|
type : "post",
|
|
|
url : "<%=basePath %>/lost/change/delItem?id="+id,
|
|
|
data : data,
|
|
|
success: function(data){
|
|
|
if(data.success){
|
|
|
layer.alert( data.msg, function (index) {
|
|
|
layer.close(index); //关闭当前弹窗
|
|
|
layui.table.reload('flightItem')
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
error: function() {
|
|
|
layer.alert("删除失败,请重试");
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
})
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
<script type="text/html" id="barDemo">
|
|
|
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
|
|
<a class="layui-btn layui-btn-xs" lay-event="del">删除</a>
|
|
|
</script>
|
|
|
</body >
|
|
|
</html > |
|
|
\ No newline at end of file |
...
|
...
|
|