<!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 type="text/css">
|
.layui-table-view .layui-table[lay-size=sm] .layui-table-cell {
|
height: auto;
|
line-height: 23px;
|
}
|
|
/* 表格下拉小箭头隐藏 */
|
.layui-table-grid-down {
|
display: none;
|
}
|
</style>
|
<script>
|
// 这里是需要在页面渲染之前执行的代码
|
document.addEventListener("DOMContentLoaded", function () {
|
//获取table默认显示数
|
pageCntFirst();
|
//判断是否开启table列表列宽调整功能。
|
GetIsSetColW();
|
});
|
</script>
|
</head>
|
|
<body id="body">
|
|
<div class="layui-fluid" style="padding-bottom: 0;">
|
<div class="layui-card">
|
<div class="layui-form layui-card-header layuiadmin-card-header-auto" id="top">
|
<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="ASNNo" name="ASNNo" 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="PalletNo" name="PalletNo" 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="LocatNo" name="LocatNo" 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="WareHouseNo" id="WareHouseNo" lay-filter="getWareHouseNo" lay-search>
|
<option value=""></option>
|
</select>
|
</div>
|
</div>
|
<!-- <div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">所属巷道</label>
|
<div class="layui-input-inline">
|
<select name="RoadwayNo" id="RoadwayNo" lay-search>
|
<option value=""></option>
|
</select>
|
</div>
|
</div> -
|
<!-- 执行状态都为入库完成不用作为查询条件 -->
|
<div class="layui-inline" style="display: none;">
|
<label class="layui-form-label" style="width: 60px;">执行状态</label>
|
<div class="layui-input-inline">
|
<select name="Status" id="Status" 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="SkuNo" name="SkuNo" 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="SkuName" name="SkuName" 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" id="divReason" style="display: none; padding-top: 10px;">
|
<label class="layui-form-label">撤销原因</label>
|
<div class="layui-input-inline">
|
<textarea id="Reason" name="Reason" placeholder="请输入内容" class="layui-textarea"></textarea>
|
|
</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 class="layui-card-body">
|
<div style="position: relative;">
|
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
<ul class="layui-tab-title" id="tab">
|
<li class="layui-this">托盘信息</li>
|
<!-- <li>箱码信息</li> -->
|
</ul>
|
|
<div id="center"></div>
|
|
<div class="layui-tab-content">
|
<div class="layui-tab-item layui-show">
|
<div class="position-relative"><!-- class="position-relative" --><!-- 自定义表头加上 -->
|
<table id="PalletBind" lay-filter="PalletBind"></table>
|
<!-- #region 自定义表头 -->
|
<div class="headerSetIcon">
|
<button class="layui-btn layui-btn-primary layui-btn-sm" data-type="customCols">
|
<i class="layui-icon"></i>
|
</button>
|
</div>
|
<!-- #endregion -->
|
</div>
|
</div>
|
<div class="layui-tab-item">
|
<div class="position-relative"><!-- class="position-relative" --><!-- 自定义表头加上 -->
|
<table id="BoxInfo" lay-filter="BoxInfo"></table>
|
<!-- #region 自定义表头 -->
|
<div class="headerSetIcon">
|
<button class="layui-btn layui-btn-primary layui-btn-sm"
|
data-type="customCols2">
|
<i class="layui-icon"></i>
|
</button>
|
</div>
|
<!-- #endregion -->
|
</div>
|
|
</div>
|
</div>
|
</div>
|
<button style="margin-right: 5px;position: absolute; top: 5px; right: 10px;"
|
class="layui-btn layuiadmin-btn-list layui-btn-sm addClass" data-type="add">
|
<i class="layui-icon"></i>添加
|
</button>
|
</div>
|
<!-- <a class="layui-btn layui-btn-normal layui-btn-xs editClass" lay-event="edit">
|
<i class="layui-icon layui-icon-edit"></i>指定储位</a> -->
|
<script type="text/html" id="PalletBindDemoList">
|
{{# function GetPalletBindBtn(d){
|
var html = '';
|
if((d.LocatNo == "" || d.LocatNo == null) && d.Type =="0")&& //(d.RoadwayNo=="" || d.RoadwayNo == null)
|
{
|
html += `<a class="layui-btn layui-btn-danger layui-btn-xs delClass" lay-event="del">
|
<i class="layui-icon layui-icon-delete"></i>删除</a> `;
|
}
|
|
return html;
|
}
|
}}
|
{{ GetPalletBindBtn(d) }}
|
</script>
|
<script type="text/html" id="BoxInfoDemoList">
|
{{# function GetBoxInfoBtn(d){
|
var html = '';
|
if(d.SkuNo!="100099"){
|
html += `<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="sel">
|
<i class="layui-icon layui-icon-edit"></i>详情</a>`;
|
if(d.BindStatus == "0"){
|
html += `<a class="layui-btn layui-btn-danger layui-btn-xs delMxClass" lay-event="del">
|
<i class="layui-icon layui-icon-delete"></i>删除</a>`;
|
}
|
}
|
|
|
|
return html;
|
}
|
}}
|
{{ GetBoxInfoBtn(d) }}
|
</script>
|
|
<!-- #region 自定义表头 -->
|
<script type="text/html" id="templetStatus">
|
{{# function GetBtn3(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-danger layui-btn-xs">入库中</button>';
|
case "2": return '<button class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs">入库完成</button>';
|
default: return "";
|
}
|
}
|
}}
|
{{ GetBtn3(d) }}
|
</script>
|
|
<script type="text/html" id="templetBitPalletMark">
|
{{# function GetBtn4(d){
|
switch (d.BitPalletMark) {
|
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-xs layui-btn-danger ">是</button>';
|
default: return "";
|
}
|
}
|
}}
|
{{ GetBtn4(d) }}
|
</script>
|
|
<script type="text/html" id="templetBitPalletMark">
|
{{#
|
switch (d.InspectMark) {
|
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-xs layui-btn-danger ">是</button>';
|
default: return "";
|
}
|
|
}}
|
</script>
|
|
<script type="text/html" id="templetCompleteTime">
|
{{# function GetBtn5(d){
|
return formatDate(d.CompleteTime);
|
}
|
}}
|
{{ GetBtn5(d) }}
|
</script>
|
|
<script type="text/html" id="templetCreateTime">
|
{{# function GetBtn6(d){
|
return formatDate(d.CreateTime);
|
}
|
}}
|
{{ GetBtn6(d) }}
|
</script>
|
|
<script type="text/html" id="templetProductionTime">
|
{{# function GetBtn7(d){
|
return formatDate2(d.ProductionTime);
|
}
|
}}
|
{{ GetBtn7(d) }}
|
</script>
|
|
<script type="text/html" id="templetExpirationTime">
|
{{# function GetBtn8(d){
|
return formatDate2(d.ExpirationTime);
|
}
|
}}
|
{{ GetBtn8(d) }}
|
</script>
|
|
<script type="text/html" id="templetInspectMark">
|
{{# function GetBtn9(d){
|
switch (d.InspectMark) {
|
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-xs layui-btn-danger ">是</button>';
|
default: return "";
|
}
|
}
|
}}
|
{{ GetBtn9(d) }}
|
</script>
|
|
<script type="text/html" id="templetBitBoxMark">
|
{{# function GetBtn10(d){
|
switch (d.BitBoxMark) {
|
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-xs layui-btn-danger ">是</button>';
|
default: return "";
|
}
|
}
|
}}
|
{{ GetBtn10(d) }}
|
</script>
|
|
<script type="text/html" id="templetInspectStatus">
|
{{# function GetBtn11(d){
|
switch (d.InspectStatus) {
|
case "0": return '待检验';
|
case "1": return '检验合格';
|
case "2": return '不合格';
|
case "3": return '放置期';
|
default: return "";
|
}
|
}
|
}}
|
{{ GetBtn11(d) }}
|
</script>
|
|
<script type="text/html" id="WareHouseButton">
|
{{#
|
switch (d.WareHouseNo) {
|
case "W01": return '力诺立体库';
|
case "W02": return '力诺平库';
|
default: return "";
|
}
|
|
}}
|
</script>
|
|
<!-- <script type="text/html" id="RoadwayButton">
|
{{#
|
switch (d.RoadwayNo) {
|
case "R01": return '01巷道';
|
case "R02": return '02巷道';
|
case "R03": return '03巷道';
|
case "R04": return '04巷道';
|
case "R05": return '05巷道';
|
case "R06": return '06巷道';
|
case "R07": return '07巷道';
|
case "R08": return '08巷道';
|
case "R09": return '09巷道';
|
case "R10": return '10巷道';
|
default: return "";
|
}
|
|
}} -->
|
</script>
|
<!-- #endregion -->
|
</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', 'element', 'layer', 'laydate'], function () {
|
var table = layui.table,
|
form = layui.form,
|
element = layui.element;
|
laypage = layui.laypage,
|
layer = layui.layer;
|
laydate = layui.laydate;
|
var h1 = GetTableTabHeight();
|
laydate.render({
|
elem: '#StartTime'
|
, format: 'yyyy-MM-dd' //可任意组合
|
});
|
laydate.render({
|
elem: '#EndTime'
|
, format: 'yyyy-MM-dd' //可任意组合
|
});
|
//tab切换判断值
|
var yemianid = 0;
|
//接受全局变量
|
let quanSkuNo = 0;
|
// 获取table高度
|
// var h1 = GetTableTopHeight();
|
// var h2 = GetTableBottomHeight();
|
// console.log(h1);
|
// console.log(h2);
|
|
|
bindPalletBind();
|
//bindBoxInfo("0");
|
|
//获取仓库下拉框信息
|
synData(IP + "/Sys/GetWarehouseDic", {}, 'get', function (res) {
|
if (res.code == 0) { //成功
|
for (var i = 0; i < res.data.length; i++) {
|
|
$("#WareHouseNo").append('<option value =' + res.data[i].WareHouseNo + '>' + res.data[i].WareHouseNo + '-' +
|
res.data[i].WareHouseName + '</option>');
|
}
|
// $("#WareHouseNo option[value='" + res.data[0].WareHouseNo + "']").attr("selected", "selected")
|
form.render('select');
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
|
// 查询事件
|
form.on('select(getWareHouseNo)', function (data) {
|
if ($("#WareHouseNo").val() == "W01") {
|
//获取巷道下拉框信息
|
synData(IP + "/Sys/GetRoadwayList", {}, 'get', function (res) {
|
if (res.code == 0) { //成功
|
for (var i = 0; i < res.data.length; i++) {
|
|
$("#RoadwayNo").append('<option value =' + res.data[i].RoadwayNo + '>' + res.data[i].RoadwayNo + '-' +
|
res.data[i].RoadwayName + '</option>');
|
}
|
// $("#RoadwayNo option[value='" + res.data[0].RoadwayNo + "']").attr("selected", "selected")
|
form.render('select');
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
}
|
else {
|
$("#RoadwayNo").html('');
|
$("#RoadwayNo").append('<option value=""></option>');
|
form.render('select');
|
}
|
|
});
|
|
// 渲染总表
|
//#region 自定义表头
|
var TotalColsArr = [[
|
{ field: '', title: '序号', type: 'numbers', width: 60, align: 'center', fixed: 'left', "disabled": true },
|
{ field: 'ASNNo', title: '入库单号', align: 'center', width: 180, "disabled": true },
|
{ field: 'ASNDetailNo', title: '入库明细号', align: 'center' },
|
{ field: 'PalletNo', title: '托盘号', align: 'center', width: 100 },
|
{ field: 'PalletNo2', title: '托盘号LV2', align: 'center' },
|
{ field: 'PalletNo3', title: '托盘号LV3', align: 'center' },
|
{ field: 'LocatNo', title: '储位地址', align: 'center', width: 90 },
|
//{ field: 'RoadwayNo', title: '所属巷道', align: 'center', width: 90, templet: '#RoadwayButton' },
|
{ field: 'WareHouseNo', title: '所属仓库', align: 'center', width: 90, templet: '#WareHouseButton' },
|
{ field: 'SkuNo', title: '物料编码', align: 'center', width: 110 },
|
{ field: 'SkuName', title: '物料名称', align: 'center' },
|
{ field: 'Qty', title: '数量', align: 'center', width: 90 },
|
{ field: 'FullQty', title: '整托数量', align: 'center', width: 90 },
|
{ field: 'SamplingQty', title: '取样数量', align: 'center', width: 90 },
|
{ field: 'InspectMark', title: '抽检标记', align: 'center', width: 90, templet: '#templetInspectMark' },
|
//{ field: 'Status', title: '执行状态', align: 'center', width: 90, templet: '#templetStatus' }, // 都是入库完成
|
{ field: 'BitPalletMark', title: '零托标记', align: 'center', width: 90, templet: '#templetBitPalletMark' },
|
{ field: 'CompleteTime', title: '完成时间', align: 'center', width: 165, templet: '#templetCompleteTime' },
|
{ field: 'CreateTime', title: '创建时间', align: 'center', width: 165, templet: '#templetCreateTime' },
|
{ field: 'caozuo', title: '操作', fixed: 'right', width: 180, align: 'center', toolbar: '#PalletBindDemoList', "disabled": true }
|
]];
|
var TotalColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码
|
//#endregion
|
function bindPalletBind() {
|
//#region 自定义表头
|
var colsJson
|
var param1 = {
|
Href: 'BllAsn/GetPalletBindList'
|
};
|
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 = {
|
ASNNo: $("#ASNNo").val(),
|
PalletNo: $("#PalletNo").val(),
|
LocatNo: $("#LocatNo").val(),
|
RoadwayNo: '',
|
WareHouseNo: $("#WareHouseNo").val(),
|
Status: $("#Status").val(),
|
SkuNo: $("#SkuNo").val(),
|
SkuName: $("#SkuName").val(),
|
LotNo: $("#LotNo").val(),
|
StartTime: $("#StartTime").val(),
|
EndTime: $("#EndTime").val()
|
};
|
table.render({
|
id: 'PalletBind',
|
elem: '#PalletBind',
|
height: h1,
|
url: IP + "/BllAsn/GetPalletBindList",
|
method: 'post',
|
contentType: 'application/json',
|
headers: { ToKen: $.cookie('token') },
|
where: param,
|
page: true,
|
even: true,
|
limit: pageCnt, // 默认多少页
|
limits: pageLimits, // 默认数组[10,20,30,40,50]
|
cellMinWidth: 60, // 全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
done: function () {
|
setRight()
|
//bindBoxInfo(res.data[0].BindNo);
|
//自定义列宽
|
SetTableColW('PalletBind', 'BllAsn/GetPalletBindList', TotalColsSysArr);
|
},
|
cols: colsJson
|
});
|
});
|
//#endregion
|
|
var aaa = $(".layui-table-body.layui-table-main tr");
|
|
}
|
|
// 渲染明细表
|
//#region 自定义表头
|
var DetailColsArr = [[
|
{ field: '', title: '序号', type: 'numbers', width: 60, align: 'center', fixed: 'left', "disabled": true },
|
{ field: 'PalletNo', title: '托盘号', align: 'center', width: 95 },
|
{ field: 'PalletNo2', title: '托盘编号LV2', align: 'center', width: 120 },
|
{ field: 'PalletNo3', title: '托盘编号LV3', align: 'center', width: 120 },
|
{ field: 'BoxNo', title: '箱号', align: 'center', width: 220 },
|
{ field: 'BoxNo2', title: '盒号', align: 'center', width: 220 },
|
{ field: 'BoxNo3', title: '支号', align: 'center', width: 220 },
|
{ field: 'SkuNo', title: '物料编码', align: 'center', width: 150 },
|
{ field: 'SkuName', title: '物料名称', align: 'center', align: 'center', width: 226 },
|
{ field: 'LotNo', title: '批次号', align: 'center', width: 150, },
|
{ field: 'Qty', title: '数量', align: 'center', width: 105, },
|
{ field: 'FullQty', title: '整箱数量', align: 'center', width: 105, },
|
{ field: 'SamplingQty', title: '取样数量', align: 'center', width: 105, },
|
{ field: 'ProductionTime', title: '生产日期', align: 'center', width: 160, templet: '#templetProductionTime' },
|
{ field: 'ExpirationTime', title: '过期日期', align: 'center', width: 180, templet: '#templetExpirationTime' },
|
{ field: 'LotText', title: '批次描述', align: 'center', width: 150, },
|
{ field: 'SupplierLot', title: '供货批次', align: 'center', width: 150, },
|
{ field: 'InspectMark', title: '抽检标记', align: 'center', width: 95, templet: '#templetInspectMark' },
|
{ field: 'BitBoxMark', title: '零箱标记', align: 'center', width: 95, templet: '#templetBitBoxMark' },
|
{ field: 'InspectStatus', title: '质量状态', align: 'center', width: 95, templet: '#templetInspectStatus' },
|
{ field: 'caozuo', title: '操作', fixed: 'right', width: 155, align: 'center', toolbar: '#BoxInfoDemoList', "disabled": true }
|
]];
|
var DetailColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(DetailColsArr)))//将表头数据进行url编码
|
//#endregion
|
function bindBoxInfo(BindNo) {
|
|
//#region 自定义表头
|
var colsJson2
|
var param1 = {
|
Href: 'BllAsn/GetBoxInfoList'
|
};
|
sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function (res) {
|
if (res.code == 0) {
|
if (res.data == '' || res.data == undefined || res.data == null) {
|
colsJson2 = DetailColsArr
|
} else {
|
colsJson2 = eval(res.data);
|
}
|
} else {
|
colsJson2 = DetailColsArr
|
}
|
var param = {
|
BindNo: parseInt(BindNo),
|
ASNNo: $("#ASNNo").val(),
|
PalletNo: $("#PalletNo").val(),
|
SkuNo: $("#SkuNo").val(),
|
SkuName: $("#SkuName").val(),
|
LotNo: $("#LotNo").val(),
|
};
|
table.render({
|
id: 'BoxInfo',
|
elem: '#BoxInfo',
|
height: h1,
|
url: IP + "/BllAsn/GetBoxInfoList",
|
method: 'post',
|
contentType: 'application/json',
|
headers: { ToKen: $.cookie('token') },
|
where: param,
|
// toolbar: '#BoxInfoDemo',
|
// defaultToolbar: ['filter'], //'print', 'exports'
|
page: true,
|
limit: pageCnt, // 默认多少页
|
limits: pageLimits, // 默认数组[10,20,30,40,50]
|
cellMinWidth: 60, // 全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
even: true,
|
done: function () {
|
setRight()
|
//自定义列宽
|
SetTableColW('BoxInfo', 'BllAsn/GetBoxInfoList', DetailColsSysArr);
|
},
|
cols: colsJson2
|
});
|
});
|
//#endregion
|
}
|
|
// 页面监控,点击查询加载入库总单
|
form.on('submit(LAY-app-contlist-search)', function (data) {
|
|
if (yemianid == 0) {
|
bindPalletBind();
|
} else if (yemianid == 1) {
|
bindBoxInfo(quanSkuNo);
|
}
|
});
|
|
// 入库单table单机事件
|
// table.on('row(PalletBind)', function (obj) {
|
// bindBoxInfo(parseInt(obj.data.Id));
|
// });
|
//触发行双击事件
|
table.on('rowDouble(PalletBind)', function (obj) {
|
$(".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')
|
|
quanSkuNo = parseInt(obj.data.Id);
|
bindBoxInfo(parseInt(obj.data.Id));
|
yemianid = 1;
|
});
|
|
// 添加托盘绑定信息
|
var doing = true;
|
//添加
|
var active = {
|
add: function () {
|
layer.open({
|
type: 2,
|
title: '添加托盘绑定',
|
content: 'PalletBindFrom.html',
|
maxmin: true,
|
area: ['1200px', '90%']
|
});
|
},
|
//#region 自定义表头
|
customCols: function () {
|
layer.open({
|
type: 2,
|
title: '自定义列',
|
content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetPalletBindList&ColsSysArr=' + TotalColsSysArr,
|
maxmin: false,
|
resize: false,
|
area: ['970px', '650px']
|
});
|
},
|
customCols2: function () {
|
layer.open({
|
type: 2,
|
title: '自定义列',
|
content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetBoxInfoList&ColsSysArr=' + DetailColsSysArr,
|
maxmin: false,
|
resize: false,
|
area: ['970px', '650px']
|
});
|
}
|
//#endregion
|
};
|
$(".layui-btn").on("click", function () {
|
var type = $(this).data("type");
|
active[type] ? active[type].call(this) : "";
|
});
|
|
// 删除托盘绑定信息
|
table.on('tool(PalletBind)', function (obj) {
|
var data = obj.data;
|
switch (obj.event) {
|
case "del":
|
layer.confirm('确定删除此条信息吗?', function (index) {
|
// 代码区域
|
var param = {
|
Id: parseInt(data.Id),
|
};
|
sendData(IP + "/BllAsn/DelPalletBind", param, 'post', function (res) {
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
bindPalletBind();
|
});
|
|
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
}
|
});
|
});
|
break;
|
case "edit":
|
cusId = data.Id;
|
layer.open({
|
type: 2,
|
title: '指定库位',
|
content: 'AppointSlot.html?id=' + cusId,
|
maxmin: true,
|
area: ['1162px', '90%'],
|
|
});
|
break;
|
case "chexiao":
|
layer.open({
|
type: 1,
|
title: '撤销申请',
|
content: $('#divReason'),
|
maxmin: true,
|
area: ['300px', '265px'],
|
btn: ['确定', '取消'],
|
yes: function (index, layero) {
|
var pa = $('#Reason').val();
|
if (doing == true) {
|
doing = false;
|
|
var param = {
|
Id: data.Id,
|
Reason: pa,
|
};
|
console.log(param);
|
sendData(IP + "/BllAsn/CancelPalletBind", param, 'get', function (res) {
|
console.log(res);
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 3000 //1秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
bindPalletBind();
|
bindBoxInfo("0");
|
doing = true;
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 3000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
bindPalletBind();
|
bindBoxInfo("0");
|
doing = true;
|
});
|
}
|
layer.close(index);
|
});
|
} else {
|
layer.msg("请勿重复点击", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
}
|
|
}
|
});
|
|
break;
|
default: break;
|
}
|
});
|
|
|
// 删除箱支关系信息
|
table.on('tool(BoxInfo)', function (obj) {
|
var data = obj.data;
|
switch (obj.event) {
|
case "del":
|
layer.confirm('确定删除此箱支信息吗?', function (index) {
|
// 代码区域
|
var param = {
|
boxNo: data.BoxNo,
|
};
|
sendData(IP + "/BllAsn/DelBindBoxInfo", param, 'get', function (res) {
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
bindPalletBind();
|
bindBoxInfo(quanSkuNo);
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
});
|
break;
|
case "sel":
|
BoxNo = data.BoxNo;
|
layer.open({
|
type: 2,
|
title: '箱支详情信息',
|
content: 'BindBoxInfo.html?BoxNo=' + BoxNo+'&BindNo='+data.BindNo,
|
maxmin: true,
|
area: ['80%', '85%'],
|
btn: ['关闭'],
|
yes: function (index, layero) {
|
var iframeWindow = window['layui-layer-iframe' + index],
|
submitID = 'layuiadmin-app-form-edit',
|
submit = layero.find('iframe').contents().find('#' + submitID);
|
if (doing) {
|
doing = false;
|
|
layer.close(index); //关闭弹层
|
// refreshTable();
|
doing = true;
|
|
|
}
|
}
|
});
|
break;
|
default: break;
|
}
|
});
|
|
// 设置按钮权限
|
function setRight() {
|
$(function () {
|
$(".addClass").hide();
|
$(".editClass").hide();
|
$(".delClass").hide();
|
$(".delMxClass").hide();
|
$(".chexiaoClass").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 () {
|
$(".addClass").show();
|
});
|
}
|
if (res.data[k].MenuName == "编辑托盘绑定") {
|
$(function () {
|
$(".editClass").show();
|
});
|
}
|
if (res.data[k].MenuName == "删除托盘绑定") {
|
$(function () {
|
$(".delClass").show();
|
$(".delMxClass").show();
|
});
|
}
|
if (res.data[k].MenuName == "撤销托盘绑定") {
|
$(function () {
|
$(".chexiaoClass").show();
|
});
|
}
|
}
|
} else { //不成功
|
layer.msg('获取权限信息失败', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
}
|
|
//监听Tab切换,以改变地址hash值
|
element.on('tab(docDemoTabBrief)', function (data) {
|
yemianid = data.index
|
if (yemianid == 0) {
|
bindPalletBind();
|
} else if (yemianid == 1) {
|
bindBoxInfo(quanSkuNo);
|
}
|
});
|
|
});
|
</script>
|
|
</body>
|
|
</html>
|