<!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">
|
<link rel="stylesheet" href="../../css/public.css" media="all">
|
<style>
|
.rightMargin {
|
margin-right: 0px;
|
}
|
|
.buJu {
|
margin-top: 10px;
|
display: flex;
|
flex-direction: row-reverse;
|
}
|
|
.beiJing {
|
background-color: #fafafa;
|
padding-top: 5px;
|
border-radius: 3px;
|
box-shadow: inset 0 0 3px 1px #ccc;
|
}
|
|
/* 表格下拉小箭头隐藏 */
|
.layui-table-grid-down {
|
display: none;
|
}
|
</style>
|
<script>
|
// 这里是需要在页面渲染之前执行的代码
|
document.addEventListener("DOMContentLoaded", function () {
|
|
//获取table默认显示数
|
pageCntFirst();
|
//判断是否开启table列表列宽调整功能。
|
GetIsSetColW();
|
});
|
</script>
|
</head>
|
|
|
<body>
|
|
<div class="layui-fluid" style="padding: 3px;">
|
<div class="layui-card">
|
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
<div class="layui-form-item">
|
<div class="layui-inline" style="margin-right: 0;">
|
<label class="layui-form-label" style="width: 60px;">波次单号</label>
|
<div class="layui-input-inline" style="margin-right: 0;">
|
<input type="text" id="WaveNo" name="WaveNo" placeholder="波次单号" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
|
<div class="layui-inline" style="margin-right: 0; display: none;">
|
<label class="layui-form-label" style="width: 60px;">批次号</label>
|
<div class="layui-input-inline" style="margin-right: 0;">
|
<div class="layui-input-inline" style="margin-right: 0;">
|
<input type="text" id="LotNo" name="LotNo" placeholder="批次号" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
</div>
|
<div class="layui-inline" style="margin-right: 0;">
|
<label class="layui-form-label" style="width: 60px;">承运商</label>
|
<div class="layui-input-inline">
|
<select name="LogisticsId" id="LogisticsId" lay-search>
|
<option value=""></option>
|
</select>
|
</div>
|
</div>
|
|
<div class="layui-inline" style="margin-right: 0;">
|
<label class="layui-form-label">状态</label>
|
<div class="layui-input-inline" style="margin-right: 0;">
|
<div class="layui-input-inline" style="margin-right: 0;">
|
<select name="Status" id="Status" lay-filter="Status" lay-search>
|
<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>
|
</div>
|
</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>
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-list addWaveClass" style="margin-left: 5px;" lay-event="addWave" id="addWave">
|
<i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>合并波次
|
</button>
|
|
</div>
|
<!-- 确认出库口弹窗 -->
|
<div class="layui-inline" id="divPickingArea" style="display: none; padding-top: 10px;">
|
<div class="layui-inline">
|
<label class="layui-form-label">拆垛方式</label>
|
<div class="layui-input-inline" style="width: 220px;">
|
<select name="UnstackWay" id="UnstackWay" lay-filter="UnstackWay" lay-search>
|
<option value="0" selected>机器人拆垛</option>
|
<option value="1">PDA拆垛</option>
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline DivLoadingArea" style="margin-top: 10px;">
|
<label class="layui-form-label">装车口</label>
|
<div class="layui-input-inline" style="width: 220px;">
|
<select name="LoadingArea" id="LoadingArea" lay-search>
|
<option value=""></option>
|
<option value="1">1</option>
|
<option value="2">2</option>
|
<option value="3">3</option>
|
<option value="4">4</option>
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline DivPickingArea2" style="margin-top: 10px;">
|
<label class="layui-form-label">出库口</label>
|
<div class="layui-input-inline" style="width: 220px;">
|
<select name="PickingArea" id="PickingArea" lay-search>
|
<option value=""></option>
|
<option value="1">1</option>
|
<option value="2">2</option>
|
<option value="3">3</option>
|
<option value="4">4</option>
|
</select>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-card-body">
|
<div class="position-relative">
|
<table id="Wave-list" lay-filter="Wave-list"></table>
|
|
<div class="headerSetIcon">
|
<button class="layui-btn layui-btn-primary layui-btn-sm" data-type="customCols">
|
<i class="layui-icon"></i>
|
</button>
|
</div>
|
|
<script type="text/html" id="templetStatus">
|
{{# function GetBtn7(d){
|
switch (d.Status) {
|
case "0":
|
return `<button class="layui-btn layui-btn-radius layui-btn-xs">等待执行</button>`;
|
case "1":
|
return `<button class="layui-btn layui-btn-radius layui-btn-warm layui-btn-xs">部分分配</button>`;
|
case "2":
|
return `<button class="layui-btn layui-btn-radius layui-btn-warm layui-btn-xs">已分配</button>`;
|
case "3":
|
return `<button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs">正在执行</button>`;
|
case "4":
|
return `<button class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs">执行完毕</button>`;
|
case "5":
|
return `<button class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs">订单关闭</button>`;
|
case "6":
|
return `<button class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs">上传完毕</button>`;
|
default:
|
return "";
|
}
|
}
|
}}
|
{{ GetBtn7(d) }}
|
</script>
|
|
<script type="text/html" id="templetCreateTime">
|
{{# function GetBtn8(d){
|
return formatDate(d.CreateTime);
|
}
|
}}
|
{{ GetBtn8(d) }}
|
</script>
|
</div>
|
|
<script type="text/html" id="toolbarDemoList">
|
{{# function GetBtn2(d){
|
var html = '';
|
|
|
if(d.Status == '0' || d.Status == '1' ){
|
|
html += `<a class="layui-btn layui-btn-normal layui-btn-xs zifenClass" lay-event="auto">
|
<i class="layui-icon layui-icon-ok"></i>自动分配
|
</a>`;
|
|
}
|
if(d.Status == '0' && d.Origin == 'WMS'){
|
html += `<a class="layui-btn layui-btn-danger layui-btn-xs delClass" lay-event="delete">
|
<i class="layui-icon layui-icon-delete"></i>删除
|
</a>`;
|
}
|
if(d.Status == '1' || d.Status == '2'){
|
html += `<a class="layui-btn layui-btn-danger layui-btn-xs qufenClass" lay-event="cancel">
|
<i class="layui-icon layui-icon-delete"></i>取消分配
|
</a>`;
|
}
|
if( d.Status == '2' || d.Status == '3' || d.Status == '0'){
|
html += `<a class="layui-btn layui-btn-normal layui-btn-xs outClass" lay-event="outKu">
|
<i class="layui-icon layui-icon-ok"></i>出库
|
</a>`;
|
}
|
|
return html;
|
}
|
}}
|
{{ GetBtn2(d) }}
|
</script>
|
</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>
|
layui.extend({
|
excel: '../../layuiadmin/layui/layui_exts/excel' // {/}的意思即代表采用自有路径,即不跟随 base 路径
|
})
|
|
layui.config({
|
base: '../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'layer', 'table', 'laydate', 'upload', 'excel'], function () {
|
var form = layui.form,
|
table = layui.table,
|
layer = layui.layer,
|
laydate = layui.laydate;
|
var upload = layui.upload;
|
|
laydate.render({
|
elem: '#ProductionTime'
|
, format: 'yyyy-MM-dd' //可任意组合
|
});
|
|
// 搜索方法
|
form.on('submit(LAY-app-contlist-search)', function (data) {
|
bindTable();
|
|
});
|
|
// 页面加载绑定Table
|
bindTable();
|
//获取承运商物流
|
sendData(IP + "/Basis/GetLogisticsInfoSelect", {}, 'get', function(res) {
|
if (res.code == 0) { //成功
|
$("#LogisticsId").empty();
|
$("#LogisticsId").append('<option value =""></option>');
|
for (var i = 0; i < res.data.length; i++) {
|
$("#LogisticsId").append('<option value =' + res.data[i].Id + '>' +
|
res.data[i].CarrierName + '</option>');
|
}
|
|
form.render('select');
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {});
|
}
|
});
|
|
//合并标签
|
$('#addWave').on('click', function () {
|
|
layer.open({
|
type: 2,
|
title: '合并波次',
|
content: 'WaveMageAddInfo.html',
|
maxmin: false,
|
area: ['1200px', '90%'],
|
});
|
});
|
var isChongFu = true;
|
table.on('tool(Wave-list)', function(obj) {
|
var data = obj.data;
|
console.log(data);
|
var Id = data.Id;
|
var waveNo = data.WaveNo;
|
if(obj.event === 'outKu'){
|
$("#UnstackWay").val(0)
|
$("#UnstackWay").attr("disabled",false);
|
$("#LoadingArea").val('')
|
$("#PickingArea").val('')
|
$('.DivLoadingArea').show()
|
form.render('select');
|
var param = {
|
waveNo: waveNo
|
};
|
// 判断是否需要拆箱,需要拆箱就需要选择出库口
|
sendData(IP + "/BllSo/WaveIsNeedUnpack", param, 'get', function(res) {
|
if (res.code == 0) { //成功
|
if(res.data=="1"){
|
isNeedUnpack='1'
|
$('.DivPickingArea2').show()
|
}else{
|
isNeedUnpack='0'
|
$('.DivPickingArea2').hide()
|
}
|
if($('#UnstackWay').val()=='1'){
|
$('.DivPickingArea2').show()
|
}
|
|
outFunction(data.WaveNo)
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
return;
|
});
|
}
|
});
|
}
|
else if(obj.event === 'auto'){
|
layer.confirm('确定要将选中的单据自动分配吗?', function() {
|
if (isChongFu== true) {
|
isChongFu = false;
|
var param = {
|
waveNo: waveNo,
|
};
|
sendData(IP + "/BllSo/WaveAutoAllot", param, 'get', function(res) {
|
console.log(res);
|
if (res.code == 0) { //成功
|
layer.msg("操作成功!", {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
bindTable();
|
isChongFu= true;
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
bindTable();
|
isChongFu= true;
|
});
|
}
|
});
|
}else{
|
layer.msg("请勿重复点击", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
}
|
|
});
|
}
|
else if(obj.event === 'cancel'){
|
layer.confirm('确定取消此单据已经分配的货物吗?', function(index) {
|
var param = {
|
waveNo: waveNo
|
};
|
sendData(IP + "/BllSo/WaveCancelAllot", param, 'get', function(res) {
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 1000 //1秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
bindTable();
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
bindTable();
|
});
|
}
|
});
|
});
|
|
}
|
else if(obj.event === 'delete') {
|
layer.confirm('确定删除此单据吗?', function(index) {
|
var param = {
|
Id: parseInt(Id),
|
};
|
sendData(IP + "/BllSo/DelWaveExportNotice", param, 'post', function(res) {
|
console.log(res);
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 1000 //1秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
bindTable();
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {});
|
}
|
});
|
});
|
}
|
})
|
//选择出库口弹窗方法
|
function outFunction(waveNo){
|
layer.open({
|
type: 1,
|
title: '确认出库口',
|
content: $('#divPickingArea'),
|
maxmin: true,
|
area: ['350px','285px'],
|
btn: ['确定', '取消'],
|
yes: function(index, layero) {
|
var pa = $('#PickingArea').val();
|
console.log(pa)
|
if (isChongFu== true) {
|
isChongFu= false;
|
if(pa == null)
|
{
|
layer.msg("请勿重复点击", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return;
|
}
|
if($('#UnstackWay').val()=='0'){
|
if($('#LoadingArea').val()==''){
|
layer.msg("请选择装车口", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
isChongFu= true;
|
return;
|
}
|
}
|
console.log($("#PickingArea").val())
|
if($("#PickingArea").val() == '')
|
{
|
layer.msg("请选择出库口", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
isChongFu= true;
|
return;
|
}
|
var param = {
|
WaveNo: waveNo,
|
unstackingMode:$('#UnstackWay').val(),
|
outMode: pa,
|
loadingAddre:$('#LoadingArea').val()
|
};
|
console.log(param);
|
sendData(IP + "/DownApi/WaveIssueOutHouse", param, 'get', function(res) {
|
console.log(res);
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 3000 //1秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
bindTable();
|
isChongFu= true;
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 3000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
bindTable();
|
isChongFu= true;
|
});
|
}
|
layer.close(index);
|
});
|
}else{
|
layer.msg("请勿重复点击", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
}
|
|
}
|
});
|
}
|
|
//#region 自定义表头
|
var TotalColsArr = [[
|
|
{ field: 'WaveNo', title: '波次单号', align: 'center',fixed: 'left', width: 180, "disabled": true },
|
{ field: 'CustomerName', title: '客户名称', align: 'center', width: 165 },
|
{ field: 'SupplierLot', title: '供货批次', align: 'center', width: 155 },
|
{ field: 'Status', title: '状态', align: 'center', templet: '#templetStatus', width: 90 },
|
|
{ field: 'LogisticsName', title: '承运商', align: 'center', width: 165 },
|
{ field: 'Address', title: '收货地址', align: 'center', },
|
{field: 'Origin',title: '来源',align: 'center',width: 90},
|
|
{ field: 'LotNo', title: '批次号', align: 'center', width: 155, },
|
{ field: 'LotText', title: '批次描述', align: 'center', width: 165 },
|
|
{ field: 'CreateUserName', title: '创建人', align: 'center', width: 100 },
|
{ field: 'CreateTime', title: '创建时间', align: 'center', width: 168, templet: '#templetCreateTime' },
|
{ field: 'caozuo', title: '操作', fixed: 'right', width: 200, align: 'center', toolbar: '#toolbarDemoList'}
|
]];
|
//url编码
|
var TotalColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码
|
//#endregion
|
function bindTable() {
|
|
|
//#region 自定义表头
|
var colsJson
|
var param1 = {
|
Href: 'BllSo/GetWaveMageList'
|
};
|
sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function (res) {
|
if (res.code == 0) {
|
if (res.data == '' || res.data == undefined || res.data == null) {
|
colsJson = TotalColsArr
|
} else {
|
colsJson = eval(res.data);
|
}
|
} else {
|
colsJson = TotalColsArr
|
}
|
var param = {
|
WaveNo:$("#WaveNo").val(),
|
LogisticsId: parseInt($("#LogisticsId").val()),
|
Status: $("#Status").val(),
|
LotNo: $("#LotNo").val(),
|
// ProductionTime: $("#ProductionTime").val(),
|
// SupplierLot: $("#SupplierLot").val(),
|
};
|
table.render({
|
elem: '#Wave-list',
|
url: IP + "/BllSo/GetWaveMageList",
|
method: 'POST',
|
height: 'full-136',
|
id: 'Wave-list',
|
where: param,
|
contentType: 'application/json',
|
defaultToolbar: [], //'filter','print', 'exports'
|
headers: { ToKen: $.cookie('token') },
|
page: true,
|
even: true,
|
limit: pageCnt,
|
limits: pageLimits,
|
cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
done: function (res) {
|
setRight();
|
//自定义列宽
|
SetTableColW('Wave-list', 'BllSo/GetWaveMageList', TotalColsSysArr);
|
},
|
cols: colsJson
|
});
|
});
|
//#endregion
|
}
|
|
// 权限设置
|
function setRight() {
|
$(function () {
|
$(".addWaveClass").hide();
|
$(".delWaveClass").hide();
|
});
|
sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function (res) {
|
if (res.code == 0) { //成功
|
for (var k = 0; k < res.data.length; k++) {
|
if (res.data[k].MenuName == "添加波次") {
|
$(function () {
|
$(".addWaveClass").show();
|
});
|
}
|
if (res.data[k].MenuName == "删除波次") {
|
$(function () {
|
$(".delWaveClass").show();
|
});
|
}
|
}
|
} else { //不成功
|
layer.msg('获取权限信息失败', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
}
|
|
|
//自定义表头
|
active = {
|
customCols: function () {
|
layer.open({
|
type: 2,
|
title: '自定义列',
|
content: '../SystemSettings/HeaderSetting.html?Href=BllSo/GetWaveMageList&ColsSysArr=' + TotalColsSysArr,
|
maxmin: false,
|
resize: false,
|
area: ['970px', '650px']
|
});
|
},
|
};
|
$('.layui-btn').on('click', function () {
|
var type = $(this).data('type');
|
active[type] ? active[type].call(this) : '';
|
});
|
})
|
</script>
|
</body>
|
|
</html>
|