<!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">
|
<style>
|
.rightMargin{
|
margin-right:0px ;
|
}
|
</style>
|
</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;">
|
<select name="HouseId" id="HouseId" lay-filter="getHouseId" lay-search>
|
<option value=""></option>
|
</select>
|
</div>
|
</div>
|
<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;">
|
<select name="LaneWayId" id="LaneWayId" lay-filter="getLanwayId" lay-search>
|
<option value=""></option>
|
</select>
|
</div>
|
</div>
|
<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="number" id="Row" name="Row" placeholder="排" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
<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="number" id="Column" name="Column" placeholder="列"
|
autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<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="number" id="Layer" name="Layer" 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">
|
<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" lay-submit lay-filter="confirm">确定</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-card-body">
|
<table id="Slot-list" lay-filter="Slot-list"></table>
|
<script type="text/html" id="type">
|
{{# if(d.SlotStatus=='0'){ }}
|
<p>空储位</p>
|
{{# } else if(d.SlotStatus=='1'){ }}
|
<p>有物品</p>
|
{{# } else if(d.SlotStatus=='2'){ }}
|
<p>正在入库</p>
|
{{# } else if(d.SlotStatus=='3'){ }}
|
<p>正在出库</p>
|
{{# } else if(d.SlotStatus=='4'){ }}
|
<p>正在移入</p>
|
{{# } else if(d.SlotStatus=='5'){ }}
|
<p>正在移出</p>
|
{{# } else if(d.SlotStatus=='6'){ }}
|
<p>空托盘</p>
|
{{# }else { }}
|
<p>屏蔽</p>
|
{{# } }}
|
</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.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'layer','table'], function() {
|
var $ = layui.$,
|
form = layui.form,
|
table = layui.table,
|
layer = layui.layer;
|
var id = getQueryString('id');
|
console.log(id);
|
|
var url = IP + "/ImportOrder/GetSlotInEmpty"
|
var where = {
|
HouseId:$("#HouseId").val(),
|
LaneWayId:$("#LaneWayId").val(),
|
Row:$("#Row").val(),
|
Column:$("#Column").val(),
|
Layer:$("#Layer").val(),
|
SlotCode:$("#SlotCode").val()
|
};
|
// 流水详情
|
var tableIns =table.render({
|
elem: '#Slot-list',
|
height: 'full-135',
|
id: 'Slot-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: [
|
[{
|
type:'radio',
|
width: 60,
|
align: 'center',
|
fixed: 'left',
|
},{
|
title: '序号',
|
type:'numbers',
|
width: 60,
|
align: 'center',
|
fixed: 'left',
|
},{
|
field: 'WarehouseName',
|
title: '所属仓库',
|
fixed: 'left',
|
align: 'center',
|
width: 160,
|
},{
|
field: 'LanewayName',
|
title: '所属区域',
|
align: 'center',
|
width: 150,
|
},{
|
field: 'SlotCode',
|
title: '储位编码',
|
align: 'center',
|
|
},{
|
field: 'SlotRow',
|
title: '排',
|
align: 'center',
|
width: 100,
|
},{
|
field: 'SlotColumn',
|
title: '列',
|
align: 'center',
|
width: 100,
|
},{
|
field: 'SlotLayer',
|
title: '层',
|
align: 'center',
|
width: 100,
|
},{
|
field: 'SlotInout',
|
title: '储位深度',
|
align: 'center',
|
width: 105,
|
},{
|
field: 'SlotStatus',
|
title: '状态',
|
align: 'center',
|
width: 110,
|
templet: '#type',
|
}]
|
],
|
|
});
|
|
|
//获取仓库下拉框
|
sendData(IP + "/Export/GetWarehouseList", {}, 'post', function(res) {
|
if (res.code == 1) { //成功
|
console.log(res.WarehouseData);
|
for (var i = 0; i < res.WarehouseData.length; i++) {
|
$("#HouseId").append('<option value =' + res.WarehouseData[i].WarehouseId + '>' + res
|
.WarehouseData[i].WarehouseName +
|
'</option>');
|
}
|
form.render('select');
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {});
|
}
|
});
|
|
form.on('select(getHouseId)',function (data) {
|
var type = data.value;
|
var param = {
|
Id: type
|
};
|
|
sendData(IP + "/ImportOrder/GetLaneWayByHouse", param, 'post', function(res) {
|
if (res.code == 0) { //成功
|
console.log(res.data);
|
$("#LaneWayId").empty();
|
$("#LaneWayId").append("<option value =''></option>");
|
for (var i = 0; i < res.data.length; i++) {
|
$("#LaneWayId").append('<option value =' + res.data[i].Id + '>' + res.data[i].LanewayName +
|
'</option>');
|
}
|
form.render('select');
|
// $("select[name='LanewayCode']").val(Laneway);
|
// form.render('select');
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {});
|
}
|
});
|
});
|
|
//搜索事件
|
form.on('submit(LAY-app-contlist-search)', function(data) {
|
var houseId = data.field.HouseId;
|
var laneWayId = data.field.LaneWayId;
|
var row = data.field.Row;
|
var column = data.field.Column;
|
var layer = data.field.Layer;
|
var slotCode = data.field.SlotCode;
|
|
tableIns.reload({
|
where:{
|
HouseId:houseId,
|
LaneWayId:laneWayId,
|
Row:row,
|
Column:column,
|
Layer:layer,
|
SlotCode:slotCode
|
},
|
page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
})
|
|
});
|
var doing = true;
|
//确定按钮事件
|
form.on('submit(confirm)', function(data) {
|
if (doing) {
|
doing = false;
|
|
var checkStatus = table.checkStatus('Slot-list'), //idTest 即为基础参数 id 对应的值
|
checkData = checkStatus.data; //得到选中的数据
|
if (checkData.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
if (!$.cookie('userId')) {
|
layer.msg('登陆失效,请重新登陆', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
window.parent.location.href = "../Login.html";
|
});
|
}
|
|
var arr = checkData[0].Id;
|
console.log(arr);
|
var param = {
|
OrderId: id,
|
SlotId:arr,
|
UserId: $.cookie('userId') //当前登录人
|
};
|
sendData(IP + "/ImportOrder/SaveSlot", param, 'post', function(res) {
|
console.log(res);
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
var index = parent.layer.getFrameIndex(window.name)
|
parent.layer.close(index); //关闭弹层
|
parent.layui.table.reload('LAY-app-content-list');
|
doing = true;
|
});
|
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
},function(){doing = true;});
|
}
|
});
|
|
}else{
|
console.log("123");
|
}
|
return false;
|
|
});
|
|
|
//获取浏览器参数
|
function getQueryString(name) {
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
var r = window.location.search.substr(1).match(reg);
|
if (r != null) return unescape(r[2]);
|
return null;
|
}
|
})
|
</script>
|
</body>
|
</html>
|