<!DOCTYPE html>
|
<html>
|
|
<head>
|
<meta charset="utf-8">
|
<title>入库任务信息列表1</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="TaskNo" name="TaskNo" 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" style="">
|
<select name="Sender" id="Sender" lay-filter="Sender" lay-search>
|
<option value=""></option>
|
<option value="WCS">WCS</option>
|
<option value="WMS">WMS</option>
|
<option value="ERP">ERP</option>
|
<option value="其他">其他</option>
|
</select>
|
</div> -->
|
<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" style="">
|
<select name="Receiver" id="Receiver" lay-filter="Receiver" lay-search>
|
<option value=""></option>
|
<option value="WCS">WCS</option>
|
<option value="WMS">WMS</option>
|
<option value="ERP">ERP</option>
|
<option value="其他">其他</option>
|
</select>
|
</div> -->
|
<label class="layui-form-label" style="width: 70px;">巷道入库口</label>
|
<div class="layui-input-inline">
|
<input type="text" id="LanWayWarehousingMouth" name="LanWayWarehousingMouth"
|
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" style="">
|
<select name="IsSuccess" id="IsSuccess" lay-filter="IsSuccess" lay-search>
|
<option value="-1">请选择</option>
|
<option value="0">已成功</option>
|
<option value="1">未成功</option>
|
</select>
|
</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">
|
<table id="LAY-app-content-list" lay-filter="LAY-app-content-list"></table>
|
<script type="text/html" id="buttonTpl">
|
{{# if(d.IsSuccess=='0'){ }}
|
<button class="layui-btn layui-btn-radius layui-btn-xs">已成功</button>
|
{{# } else { }}
|
<button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs">未成功</button>
|
{{# } }}
|
</script>
|
<!-- <script type="text/html" id="table-content-list">
|
{{# if(d.IsCancel=='0'){ }}
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="cancel"><i
|
class="layui-icon layui-icon-refresh"></i>取消</a>
|
{{# } }}
|
{{# if(d.IsSend=='0'){ }}
|
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="send"><i
|
class="layui-icon layui-icon-ok"></i>下发</a>
|
|
{{# } }}
|
{{# if(d.IsFinish=='0'){ }}
|
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="finish"><i
|
class="layui-icon layui-icon-ok"></i>完成</a>
|
{{# } }}
|
</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>
|
var uid = $.cookie('userId');
|
if (uid == null) {
|
alert('请登录后操作');
|
window.parent.location.href = '../Login.html'
|
}
|
layui.config({
|
base: '../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'table', 'laypage', 'layer'], function () {
|
var table = layui.table,
|
form = layui.form,
|
laypage = layui.laypage,
|
layer = layui.layer,
|
$ = layui.$;
|
// 表单需要的变量
|
|
var url = IP + "/Task/GetTaskList1"
|
|
|
var where = {
|
stockCodeId: $("#StockCodeId").val(),
|
taskNo: $("#TaskNo").val(),
|
SlotCode: $("#SlotCode").val(),
|
LanWayWarehousingMouth: $("#LanWayWarehousingMouth").val(),
|
IsSuccess: $("#IsSuccess").val(),
|
};
|
var tableIns = table.render({
|
elem: '#LAY-app-content-list',
|
height: 'full-95',
|
id: 'LAY-app-content-list',
|
url: url,
|
method: 'post',
|
where: where,
|
contentType: 'application/json',
|
page: true,
|
even: true,
|
limit: pageCnt, //默认多少页
|
limits: pageLimits, //默认数组[10,20,30,40,50]
|
cellMinWidth: 80,
|
cols: [
|
[
|
{
|
title: '序号',
|
type: 'numbers',
|
width: 60,
|
fixed: 'left'
|
}, {
|
field: 'TaskNo',
|
title: '任务号',
|
width: 170,
|
align: 'center',
|
fixed: 'left'
|
}, {
|
field: 'StockCode',
|
title: '托盘码',
|
//width: 94,
|
align: 'center',
|
}, {
|
field: 'SlotCode',
|
title: '储位地址',
|
//width: 200,
|
align: 'center',
|
}, {
|
field: 'LanWayWarehousingMouth',
|
title: '巷道入库口',
|
//width: 90,
|
align: 'center',
|
}, {
|
field: 'IsSuccess',
|
title: '是否成功',
|
templet: '#buttonTpl',
|
//width: 120,
|
align: 'center',
|
}, {
|
field: 'MessageDate',
|
title: '报文描述',
|
//width: 195,
|
align: 'center',
|
}, {
|
field: 'CreateTime',
|
title: '发送时间',
|
//width: 160,
|
align: 'center',
|
templet: function (d) {
|
return formatDate(d.CreateTime);
|
},
|
}
|
//, {
|
// field: 'BackDate',
|
// title: '返回时间',
|
// //width: 160,
|
// align: 'center',
|
// templet: function (d) {
|
// return formatDate(d.BackDate);
|
// },
|
//},
|
// {
|
// title: '操作',
|
// fixed: 'right',
|
// width: 250,
|
// align: 'left',
|
// toolbar: '#table-content-list'
|
// }
|
]
|
],
|
})
|
//监听搜索
|
form.on('submit(LAY-app-contlist-search)', function (data) {
|
tableIns.reload({
|
where: { //设定异步数据接口的额外参数,任意设
|
stockCodeId: $("#StockCodeId").val(),
|
taskNo: $("#TaskNo").val(),
|
SlotCode: $("#SlotCode").val(),
|
LanWayWarehousingMouth: $("#LanWayWarehousingMouth").val(),
|
IsSuccess: $("#IsSuccess").val(),
|
},
|
page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
});
|
});
|
|
|
|
|
table.on('tool(LAY-app-content-list)', function (obj) {
|
var data = obj.data;
|
if (obj.event === 'cancel') {
|
layer.confirm('确定取消选中的入库任务?', function (index) {
|
var param = {
|
Id: data.Id,
|
UserId: $.cookie('userId')
|
};
|
sendData(IP + "/Task/CancelImportTask2", param, 'post', function (res) {
|
console.log(res);
|
if (res.code == 1) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
tableIns.reload({
|
page: {
|
curr: 1
|
}
|
});
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
});
|
} else if (obj.event === 'finish') {
|
layer.confirm('确定完成选中的入库任务?', function (index) {
|
var param = {
|
code: "01",
|
stockCode: data.StockCodeId,
|
taskId: data.TaskNo,
|
UserId: $.cookie('userId')
|
};
|
sendData(IP + "/ImportOrder/ReceiveSuccess", param, 'post', function (res) {
|
console.log(res);
|
if (res.code == 1) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
tableIns.reload({
|
page: {
|
curr: 1
|
}
|
});
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
});
|
} else if (obj.event === 'send') {
|
layer.confirm('确定要下发选中的入库任务?', function (index) {
|
var param = {
|
Id: data.Id,
|
UserId: $.cookie('userId')
|
};
|
sendData(IP + "/Task/ExecuteTask2", param, 'post', function (res) {
|
console.log(res);
|
if (res.code == 1) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
refreshTable();
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
});
|
}
|
})
|
var param = {
|
id: $.cookie('userId'),
|
};
|
//获取仓库下拉框
|
sendData(IP + "/Interface/GetWareHouseList", param, 'post', function (
|
res) {
|
if (res.code == 1) { //成功
|
// console.log(res.data);
|
for (var i = 0; i < res.data.length; i++) {
|
$("#WarehouseId").append('<option value =' + res
|
.data[i]
|
.WarehouseId + '>' + res
|
.data[i].WarehouseName +
|
'</option>');
|
}
|
form.render('select');
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
var param = {
|
id: $.cookie('userId'),
|
};
|
//获取 区域下拉框
|
sendData(IP + "/Equipment/GetLanewayList", param, 'post', function (
|
res) {
|
|
|
if (res.code == 1) { //成功
|
$("#LanewayId").append('<option value =""></option>');
|
for (var i = 0; i < res.data.length; i++) {
|
var name = res.data[i].LanewayName;
|
var id = res.data[i].Id;
|
$("#LanewayId").append('<option value =' + id + '>' +
|
name +
|
'</option>');
|
|
}
|
form.render('select');
|
} else { //不成功
|
layer.msg('获取巷道信息失败', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
//回调
|
form.render('select');
|
});
|
|
}
|
});
|
// $('.layui-btn.layuiadmin-btn-list').on('click', function() {
|
// var type = $(this).data('type');
|
// active[type] ? active[type].call(this) : '';
|
// });
|
// refreshTable();
|
});
|
</script>
|
</body>
|
|
</html>
|