<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<title>入库流水信息列表</title>
|
<meta name="renderer" content="webkit">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
|
</head>
|
|
<body>
|
|
<div class="layui-fluid" style="padding-bottom: 0;">
|
<div class="layui-card">
|
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">入库单号</label>
|
<div class="layui-input-inline">
|
<input type="text" id="ImportId" name="ImportId" placeholder="入库单号" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">托盘条码</label>
|
<div class="layui-input-inline">
|
<input type="text" id="StockCodeId" name="StockCodeId" placeholder="托盘条码" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">储位地址</label>
|
<div class="layui-input-inline">
|
<input type="text" id="SlotCode" name="SlotCode" placeholder="储位地址" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">执行状态</label>
|
<div class="layui-input-inline">
|
<select name="ImportExecuteFlag" id="ImportExecuteFlag" lay-filter="ImportExecuteFlag" lay-search>
|
<option value=""></option>
|
<option value="0">等待执行</option>
|
<option value="1">正在执行</option>
|
<option value="2">执行完毕</option>
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">物品编码</label>
|
<div class="layui-input-inline">
|
<input type="text" id="GoodCode" name="GoodCode" placeholder="物品编码" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">物品名称</label>
|
<div class="layui-input-inline">
|
<input type="text" id="GoodName" name="GoodName" placeholder="物品名称" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">箱码编号</label>
|
<div class="layui-input-inline">
|
<input type="text" id="BoxCode" name="BoxCode" placeholder="箱码编号" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">批次</label>
|
<div class="layui-input-inline">
|
<input type="text" id="LotNo" name="LotNo" placeholder="批次" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
|
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">开始时间</label>
|
<div class="layui-input-inline">
|
<input type="text" autocomplete="off" name="StartTime" id="StartTime" class="layui-input"
|
placeholder="开始日期">
|
</div>
|
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">结束时间</label>
|
<div class="layui-input-inline">
|
<input type="text" autocomplete="off" name="EndTime" id="EndTime" class="layui-input"
|
placeholder="结束时间">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit lay-filter="LAY-app-contlist-search">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索
|
</button>
|
|
</div>
|
</div>
|
</div>
|
|
<div style="position: relative;">
|
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
<ul class="layui-tab-title">
|
<li class="layui-this">总单</li>
|
<li>明细</li>
|
</ul>
|
<div class="layui-tab-content" >
|
<div class="layui-tab-item layui-show">
|
|
<table id="LAY-app-content-list" lay-filter="LAY-app-content-list"></table>
|
<script type="text/html" id="flag">
|
{{# if(d.ImportExecuteFlag=='0'){ }}
|
<button class="layui-btn layui-btn-radius layui-btn-xs">等待执行</button>
|
{{# } else if(d.ImportExecuteFlag=='1') { }}
|
<button class="layui-btn layui-btn-radius layui-btn-warm layui-btn-xs">正在执行</button>
|
{{# } else if(d.ImportExecuteFlag=='2') { }}
|
<button class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs">执行完毕</button>
|
{{# } else if(d.ImportExecuteFlag=='4') { }}
|
<button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-danger layui-btn-xs">已取消</button>
|
{{# } }}
|
</script>
|
|
<script type="text/html" id="table-content-list">
|
{{# if(d.ImportExecuteFlag=='0'){ }}
|
|
<a class="layui-btn layui-btn-normal layui-btn-xs fenPeiClass" lay-event="fenPei"><i class="layui-icon layui-icon-edit"></i>指定储位</a>
|
|
<a class="layui-btn layui-btn-danger layui-btn-xs delClass" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
|
{{# }}}
|
</script>
|
|
</div>
|
<div class="layui-tab-item">
|
<table id="LAY-app-content-lists" lay-filter="LAY-app-content-lists"></table>
|
|
<script type="text/html" id="table-content-list2">
|
{{# if(d.Status=='等待入库'){ }}
|
<a class="layui-btn layui-btn-normal layui-btn-xs editClass" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
|
<a class="layui-btn layui-btn-danger layui-btn-xs delClass" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
|
{{# } }}
|
</script>
|
</div>
|
</div>
|
</div>
|
<div style="height: 42px; line-height: 42px; position: absolute; top: 0; right: 16px;">
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit id="AddTray" lay-filter="AddTray">
|
组盘
|
</button>
|
</div>
|
</div>
|
|
</div>
|
</div>
|
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../js/public.js"></script>
|
<script src="../../../js/jquery-3.5.1.min.js"></script>
|
<script src="../../../js/jquery.cookie.js"></script>
|
<script type="text/javascript">
|
|
</script>
|
<script>
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'table', 'laypage', 'layer','laydate'], function() {
|
var table = layui.table,
|
form = layui.form,
|
laypage = layui.laypage,
|
layer = layui.layer;
|
laydate = layui.laydate;
|
laydate.render({
|
elem: '#StartTime'
|
,format: 'dd-MM-yyyy' //可任意组合
|
//,value: new Date()
|
});
|
laydate.render({
|
elem: '#EndTime'
|
,format: 'dd-MM-yyyy' //可任意组合
|
});
|
var param = {
|
Id: $.cookie('userId')
|
}
|
var importOrderId = "";//汇总数据中第一条数据的importId,默认给详情渲染
|
|
var url = IP + "/ImportOrder/GetImpostOrder"
|
var where = {
|
ImportId:$("#ImportId").val(),
|
StockCodeId:$("#StockCodeId").val(),
|
SlotCode:$("#SlotCode").val(),
|
ImportExecuteFlag:$("#ImportExecuteFlag").val(),
|
GoodName:$("#GoodName").val(),
|
StartTime:$("#StartTime").val().split("-").reverse().join("-"),
|
EndTime:$("#EndTime").val().split("-").reverse().join("-"),
|
};
|
// 流水汇总
|
var tableIns =table.render({
|
elem: '#LAY-app-content-list',
|
height: 'full-190',
|
id: 'LAY-app-content-list',
|
url: url,
|
method: 'post',
|
where: where,
|
contentType: 'application/json',
|
page: true,
|
limit: pageCnt, //默认多少页
|
limits: pageLimits, //默认数组[10,20,30,40,50]
|
cellMinWidth: 80, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
even:true,
|
cols: [
|
[{
|
|
title: '序号',
|
type:'numbers',
|
width: 60,
|
align: 'center',
|
fixed: 'left',
|
},{
|
field: 'ImportOrderNo',
|
title: '入库流水号',
|
align: 'center',
|
width: 160,
|
},{
|
field: 'ImportId',
|
title: '入库单号',
|
align: 'center',
|
width: 230,
|
},{
|
field: 'StockCode',
|
title: '托盘编号',
|
align: 'center',
|
},{
|
field: 'ImportSlotCode',
|
title: '储位地址',
|
align: 'center',
|
},{
|
field: 'ImportExecuteFlag',
|
title: '执行状态',//等待入库/正在入库/入库完成 --0/1/2
|
align: 'center',
|
templet: '#flag'
|
},{
|
field: 'CompleteDate',
|
title: '完成时间',
|
align: 'center',
|
width: 200,
|
templet: function(d) {
|
return formatDate(d.CompleteDate);
|
},
|
},{
|
field: 'CreateTime',
|
title: '创建时间',
|
align: 'center',
|
width: 200,
|
templet: function(d) {
|
return formatDate(d.CreateTime);
|
},
|
},{
|
title: '操作',
|
fixed: 'right',
|
width: 180,
|
align: 'center',
|
toolbar: '#table-content-list'
|
}]
|
],
|
done: function(){
|
|
$(function() {
|
$(".delClass").hide();
|
});
|
$(function() {
|
$(".fenPeiClass").hide();
|
});
|
sendData(IP + "/Menu/GetPermission", param, 'post', function(res) {
|
if (res.code == 1) { //成功
|
for (var k = 0; k < res.data.length; k++) {
|
|
if (res.data[k].ModuleId == "563a77418b984a19ab5becaa79d5813b") {
|
$(function() {
|
$(".delClass").show();
|
});
|
}
|
if (res.data[k].ModuleId == "563a77418b984a19ab5becaa79d5813b") {
|
$(function() {
|
$(".fenPeiClass").show();
|
});
|
}
|
}
|
} else { //不成功
|
layer.msg('获取信息失败', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
//回调
|
});
|
}
|
});
|
|
}
|
});
|
|
var url2 = IP + "/ImportOrder/GetImpostOrderById"
|
var where2 = {};
|
// 流水详情
|
var tableIns2 =table.render({
|
elem: '#LAY-app-content-lists',
|
height: 'full-190',
|
id: 'LAY-app-content-lists',
|
url: url2,
|
method: 'post',
|
where: where2,
|
contentType: 'application/json',
|
page: true,
|
limit: pageCnt, //默认多少页
|
limits: pageLimits, //默认数组[10,20,30,40,50]
|
cellMinWidth: 80, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
even:true,
|
done: function(){
|
$(function() {
|
$(".editClass").hide();
|
});
|
$(function() {
|
$(".delClass").hide();
|
});
|
|
sendData(IP + "/Menu/GetPermission", param, 'post', function(res) {
|
if (res.code == 1) { //成功
|
for (var k = 0; k < res.data.length; k++) {
|
if (res.data[k].ModuleId == "013799b1209849dbaa047fc77da9a3ff") {
|
$(function() {
|
$(".editClass").show();
|
});
|
}
|
if (res.data[k].ModuleId == "563a77418b984a19ab5becaa79d5813b") {
|
$(function() {
|
$(".delClass").show();
|
});
|
}
|
|
}
|
} else { //不成功
|
layer.msg('获取信息失败', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
//回调
|
});
|
}
|
});
|
|
},
|
cols: [
|
[{
|
|
title: '序号',
|
type:'numbers',
|
width: 60,
|
align: 'center',
|
fixed: 'left',
|
},{
|
field: 'BoxCode',
|
title: '箱码编号',
|
fixed: 'left',
|
align: 'center',
|
width: 180,
|
},{
|
field: 'GoodCode',
|
title: '物品编码',
|
align: 'center',
|
width: 150,
|
},{
|
field: 'GoodName',
|
title: '物品名称',
|
align: 'center',
|
|
},{
|
field: 'LotNo',
|
title: '批次',
|
align: 'center',
|
width: 150,
|
},{
|
field: 'FullBoxQty',
|
title: '满箱数量',
|
align: 'center',
|
width: 105,
|
},{
|
field: 'Qty',
|
title: '实际数量',
|
align: 'center',
|
width: 105,
|
},{
|
field: 'BulkTankName',
|
title: '零头箱标识',
|
align: 'center',
|
width: 110,
|
},{
|
field: 'Status',
|
title: '状态',
|
align: 'center',
|
width: 160,
|
},{
|
field: 'ProductionDate',
|
title: '生产日期',
|
align: 'center',
|
width: 160,
|
templet: function(d) {
|
return formatDate(d.ProductionDate);
|
},
|
},{
|
field: 'ValidateDay',
|
title: '保质期',
|
align: 'center',
|
width: 180,
|
templet: function(d) {
|
return formatDate(d.ValidateDay);
|
},
|
},{
|
title: '操作',
|
fixed: 'right',
|
width: 155,
|
align: 'center',
|
toolbar: '#table-content-list2'
|
}]
|
],
|
|
});
|
|
//监听搜索
|
form.on('submit(LAY-app-contlist-search)', function(data) {
|
var importId = data.field.ImportId;
|
var stockCodeId = data.field.StockCodeId;
|
var slotCode = data.field.SlotCode;
|
var importExecuteFlag = data.field.ImportExecuteFlag;
|
var goodCode = data.field.GoodCode;
|
var goodName = data.field.GoodName;
|
var boxCode = data.field.BoxCode;
|
var lotNo = data.field.LotNo;
|
var startTime = data.field.StartTime;
|
var endTime = data.field.EndTime;
|
|
if($(".layui-tab-title>li[class='layui-this']").html() == "总单"){
|
tableIns.reload({
|
where: { //设定异步数据接口的额外参数,任意设
|
ImportId:importId,
|
StockCodeId:stockCodeId,
|
SlotCode:slotCode,
|
ImportExecuteFlag:importExecuteFlag,
|
GoodName:goodName,
|
StartTime:startTime.split("-").reverse().join("-"),
|
EndTime:endTime.split("-").reverse().join("-")
|
}
|
,page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
});
|
}
|
if($(".layui-tab-title>li[class='layui-this']").html() == "明细"){
|
console.log("shang")
|
console.log(importOrderId == "")
|
console.log("xia")
|
|
tableIns2.reload({
|
where: { //设定异步数据接口的额外参数,任意设
|
// Id:importOrderId,
|
GoodCode:goodCode,
|
GoodName:goodName,
|
GoodName:goodName,
|
BoxCode:boxCode,
|
LotNo:lotNo
|
}
|
,page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
});
|
|
|
}
|
});
|
|
//触发行双击事件
|
table.on('rowDouble(LAY-app-content-list)', function(obj){
|
|
importOrderId = obj.data.Id;
|
$(".layui-tab-title>li").attr("class","");
|
$('.layui-tab-title>li').eq(1).attr('class', 'layui-this');
|
$('.layui-tab-content .layui-tab-item').attr('class', 'layui-tab-item')
|
$('.layui-tab-content .layui-tab-item').eq(1).attr('class', 'layui-tab-item layui-show')
|
tableIns2.reload({
|
where: { //设定异步数据接口的额外参数,任意设
|
Id:importOrderId,
|
},
|
page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
});
|
});
|
|
// ------------------------------------删除、编辑---------------------------------------------------
|
var doing = true;
|
table.on('tool(LAY-app-content-list)', function(obj) {
|
var data = obj.data;
|
// console.log(obj.event);
|
if (obj.event === 'del') {
|
layer.confirm('确定删除流水汇总信息?确认删除相关明细也将会删除!!!',{offset:['20%','35%']}, function(index) {
|
// console.log(data);
|
if (doing) {
|
doing = false;
|
|
cusid = data.Id;
|
if (!$.cookie('userId')) {
|
layer.msg('登陆失效,请重新登陆', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
window.parent.location.href = "../Login.html";
|
});
|
}
|
var param = {
|
ImportId:cusid,
|
UpdateUser:$.cookie('userId')
|
};
|
console.log(cusid)
|
sendData(IP + "/ImportOrder/DelOrderByImportId", param, 'post', function(res) {
|
console.log(res);
|
if (res.code == 1) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
tableIns.reload({
|
where: { //设定异步数据接口的额外参数,任意设
|
ImportId:$("#ImportId").val(),
|
StockCodeId:$("#StockCodeId").val(),
|
SlotCode:$("#SlotCode").val(),
|
ImportExecuteFlag:$("#ImportExecuteFlag").val(),
|
GoodName:$("#GoodName").val(),
|
}
|
,page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
});
|
doing = true;
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
},function(){ doing = true;});
|
}
|
});
|
}else{
|
console.log("123");
|
}
|
});
|
} else if (obj.event === 'fenPei') {
|
// console.log("点击分配了按钮");
|
cusId = data.Id;
|
layer.open({
|
type: 2,
|
title: '指定库位',
|
content: 'AppointSlot.html?id=' + cusId,
|
maxmin: true,
|
area: ['1162px', '800px'],
|
|
});
|
}
|
});
|
|
table.on('tool(LAY-app-content-lists)', function(obj) {
|
var data = obj.data;
|
// console.log(obj.event);
|
if (obj.event === 'del') {
|
layer.confirm('确定删除流水明细信息',{offset:['20%','35%']}, function(index) {
|
if(doing){
|
doing = false;
|
cusid = data.Id;
|
if (!$.cookie('userId')) {
|
layer.msg('登陆失效,请重新登陆', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
window.parent.location.href = "../Login.html";
|
});
|
}
|
|
var param = {
|
msg: cusid,
|
type: $.cookie('userId')
|
};
|
console.log(cusid)
|
sendData(IP + "/ImportOrder/DelOrder", param, 'post', function(res) {
|
console.log(res);
|
if (res.code == 1) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
tableIns2.reload({
|
where: { //设定异步数据接口的额外参数,任意设
|
//Id:importOrderId,
|
},
|
page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
});
|
doing = true;
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
},function(){ doing = true;});
|
}
|
});
|
}else{
|
console.log("123");
|
}
|
});
|
} else if (obj.event === 'edit') {
|
cusId = data.Id;
|
layer.open({
|
type: 2,
|
title: '编辑入库流水信息',
|
content: 'ImportOrderEditForm.html?id=' + cusId,
|
maxmin: true,
|
area: ['330px', '200px'],
|
btn: ['确定', '取消'],
|
yes: function(index, layero){
|
var iframeWindow = window['layui-layer-iframe'+ index]
|
,submitID = 'layuiadmin-app-form-edit'
|
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
//监听提交
|
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
if (doing) {
|
doing = false;
|
var field = data.field; //获取提交的字段
|
console.log(field);
|
if (!$.cookie('userId')) {
|
layer.msg('登陆失效,请重新登陆', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
window.parent.location.href = "../Login.html";
|
});
|
}
|
//提交 Ajax 成功后,静态更新表格中的数据
|
var param = {
|
Id: cusId,
|
Qty: field.Qty,
|
UpdateUser: $.cookie('userId') //当前登录人
|
};
|
sendData(IP + "/ImportOrder/EditBoxInfo", param, 'post', function(res) {
|
console.log(res);
|
if (res.code == 1) { //成功
|
layer.msg("修改成功", {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
tableIns2.reload({
|
where: { //设定异步数据接口的额外参数,任意设
|
//Id:importId,
|
},
|
page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
});
|
layer.close(index); //关闭弹层
|
doing = true;
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() { doing = true;});
|
}
|
});
|
}
|
});
|
submit.trigger('click');
|
}
|
});
|
}
|
});
|
|
//确定按钮事件
|
form.on('submit(AddTray)', function(data) {
|
|
layer.open({
|
type: 2,
|
title: '新增组盘信息',
|
content: 'AddBoxStock.html',
|
maxmin: true,
|
area: ['1260px', '750px'],
|
|
});
|
|
|
return false;
|
|
});
|
|
|
|
$(function() {
|
$("#AddTray").hide();
|
});
|
sendData(IP + "/Menu/GetPermission", param, 'post', function(res) {
|
|
if (res.code == 1) { //成功
|
for (var k = 0; k < res.data.length; k++) {
|
if (res.data[k].ModuleId == "c620b76abb3144b49f17fb42bd0004e5") {
|
$(function() {
|
|
$("#AddTray").show();
|
});
|
}
|
}
|
} else { //不成功
|
layer.msg('获取信息失败', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
//回调
|
});
|
}
|
});
|
|
|
});
|
</script>
|
|
</body>
|
</html>
|