<!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>
|
.lableCls{
|
width: 60px;
|
}
|
</style>
|
</head>
|
<body>
|
|
<div class="layui-fluid">
|
<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 lableCls">单据号</label>
|
<div class="layui-input-inline">
|
<input type="text" id="BillCode" name="BillCode" placeholder="单据号" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label lableCls">类型</label>
|
<div class="layui-input-inline">
|
<select name="SingleType" id="SingleType" lay-filter="ImportExecuteFlag"
|
lay-search>
|
<option value=""></option>
|
<option value="1">入库</option>
|
<option value="2">出库</option>
|
<option value="3">编辑</option>
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label lableCls">储位编码</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 lableCls">托盘码</label>
|
<div class="layui-input-inline">
|
<input type="text" id="Lpn" name="Lpn" placeholder="托盘码" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label lableCls">批次号</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">
|
<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="padding-bottom: 5px; display: flex; flex-direction: row-reverse;">
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-list layui-btn-normal" data-type="edit" id="edit">
|
<i class="layui-icon layui-icon-edit"></i>编辑
|
</button>
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-list" style="margin-right: 10px;" data-type="sync" id="sync">
|
<i class="layui-icon "></i>同步
|
</button>
|
</div>
|
<table id="LAY-app-content-list" lay-filter="LAY-app-content-list" style="margin:0 auto;"></table>
|
|
</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', 'table', 'laypage', 'layer'], function() {
|
var table = layui.table,
|
form = layui.form,
|
laypage = layui.laypage,
|
layer = layui.layer;
|
var $ = layui.$;
|
var tableIns;
|
var param = {
|
billCode: $("#BillCode").val(),
|
syncType: $("#SingleType").val(),
|
slotCode: $("#SlotCode").val(),
|
lpn: $("#Lpn").val(),
|
lotNo: $("#LotNo").val(),
|
};
|
|
var url = IP + "/Equipment/GetSingleSyncList";
|
|
var tableIns=table.render({
|
elem: '#LAY-app-content-list',
|
url: url,
|
method: 'POST',
|
height: 'full-140',
|
id: 'LAY-app-content-list',
|
where: param,
|
contentType: 'application/json',
|
page: true,
|
limit: pageCnt,
|
limits: pageLimits,
|
cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
response: {
|
statusCode: 1 //规定成功的状态码,默认:0
|
},
|
cols: [
|
[{
|
title: '序号',
|
type: 'numbers',
|
width: 60,
|
fixed: 'left'
|
}, {
|
field: 'BillCode',
|
title: '单据号',
|
align: 'center',
|
fixed: 'left',
|
width: 180,
|
}, {
|
field: 'SyncType',
|
title: '类型',
|
align: 'center',
|
width: 100,
|
templet: function (d) {
|
switch (d.SyncType) {
|
case 1:
|
return "入库";
|
break;
|
case 2:
|
return "出库";
|
break;
|
case 3:
|
return "编辑";
|
break;
|
default:
|
return "";
|
break;
|
}
|
},
|
}, {
|
field: 'SlotCode',
|
title: '储位编码',
|
align: 'center',
|
width: 110,
|
}, {
|
field: 'TargetSlotCode',
|
title: '目标储位',
|
align: 'center',
|
width: 110,
|
}, {
|
field: 'StockCode',
|
title: '托盘码',
|
align: 'center',
|
width: 140,
|
}, {
|
field: 'GoodCode',
|
title: '物料名称',
|
align: 'center',
|
}, {
|
field: 'LotNo',
|
align: 'center',
|
title: '批次号',
|
width: 140
|
}, {
|
field: 'Qty',
|
title: '数量',
|
align: 'center',
|
width: 120,
|
}, {
|
field: 'UserName',
|
align: 'center',
|
title: '创建人',
|
width: 160,
|
}, {
|
field: 'CreateTime',
|
title: '创建时间',
|
align: 'center',
|
width: 160,
|
templet: function (d) {
|
return formatDate(d.CreateTime);
|
},
|
}]
|
]
|
});
|
|
//监听搜索
|
form.on('submit(LAY-app-contlist-search)', function (data) {
|
tableIns.reload({
|
where: param
|
,page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
});
|
});
|
|
var doing = true;
|
var active = {
|
edit: function() {
|
// var checkStatus = table.checkStatus('LAY-app-content-list'),
|
// checkData = checkStatus.data; //得到选中的数据
|
layer.open({
|
type: 2,
|
title: '编辑单机同步信息',
|
content: 'SingleSyncEdit.html',
|
maxmin: true,
|
area: ['1500px', '90%'],
|
|
});
|
},
|
sync: function() {
|
layer.open({
|
type: 2,
|
title: '同步数据信息',
|
content: 'SingleSyncAdd.html',
|
maxmin: true,
|
area: ['640px', '580px'],
|
btn: ['确定', '取消'],
|
yes: function(index, layero) {
|
var iframeWindow = window['layui-layer-iframe' + index],
|
submitID = 'layuiadmin-app-form-submit',
|
submit = layero.find('iframe').contents().find('#' + submitID);
|
//监听提交
|
iframeWindow.layui.form.on('submit(' + submitID + ')', function(
|
data) {
|
var field = data.field; //获取提交的字段
|
console.log(field);
|
|
if (!$.cookie('userId')) {
|
layer.msg('登陆失效,请重新登陆', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
location.href = "Login.html";
|
});
|
}
|
//提交 Ajax 成功后,静态更新表格中的数据
|
var param = {
|
billCode: field.BillCode,
|
syncType: field.SingleType,
|
slotCode: field.SlotCode,
|
targetSlotCode: field.TargetSlotCode,
|
lpn: field.Lpn,
|
goodCode: field.GoodCode,
|
lotNo: field.LotNo,
|
qty: field.Qty,
|
userId: $.cookie('userId') //当前登录人
|
};
|
console.log(param);
|
if(doing){
|
doing = false;
|
sendData(IP + "/Equipment/AddSingleSync", param, 'post', function(res) {
|
if (res.code == 1) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
tableIns.reload({
|
where: {
|
billCode: $("#BillCode").val(),
|
syncType: $("#SingleType").val(),
|
slotCode: $("#SlotCode").val(),
|
lpn: $("#Lpn").val(),
|
lotNo: $("#LotNo").val(),
|
}
|
,page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
});
|
layer.close(index); //关闭弹层
|
doing = true;
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
doing = true;
|
});
|
}
|
});
|
}
|
else{
|
layer.msg('请勿重复点击', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {});
|
}
|
|
});
|
submit.trigger('click');
|
}
|
});
|
}
|
};
|
$('.layui-btn.layuiadmin-btn-list').on('click', function() {
|
var type = $(this).data('type');
|
active[type] ? active[type].call(this) : '';
|
});
|
});
|
</script>
|
</body>
|
</html>
|