<!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">
|
</head>
|
<body>
|
<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list"
|
style="padding: 20px 30px 0 0;">
|
<div class="layui-form-item">
|
<div class="layui-card">
|
<div class="layui-card-body">
|
<table id="LAY-app-content-list" name="LAY-app-content-list" lay-filter="LAY-app-content-list">
|
</table>
|
<script type="text/html" id="table-content-list">
|
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="get"> <i
|
class="layui-icon layui-icon-search"></i>详情</a>
|
</script>
|
</div>
|
</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', 'laydate', 'table'], function() {
|
var $ = layui.$,
|
form = layui.form,
|
laydate = layui.laydate,
|
table = layui.table,
|
layer = layui.layer;
|
var pCode = getQueryString('pCode');
|
var stockCodeId = getQueryString('id')
|
|
function refreshTable() {
|
var param = {
|
msg: pCode,
|
id: stockCodeId,
|
status: 0
|
};
|
sendData(IP + "/Stock/GetStockInfoList", param, 'post', function(res) {
|
console.log(res);
|
if (res.code == 1) { //成功
|
var list = res.data;
|
$.extend(infoOptions, {
|
data: list
|
});
|
infoOptions.page = {
|
curr: 1
|
}
|
tableIns = table.render(infoOptions);
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {});
|
}
|
});
|
}
|
var infoOptions = {
|
elem: '#LAY-app-content-list',
|
height: 'full-80',
|
id: 'LAY-app-content-list',
|
page: true,
|
limit: pageCnt,
|
limits: pageLimits,
|
cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
cols: [
|
[{
|
field: 'ParentCode',
|
title: '托盘条码',
|
align: 'center',
|
}, {
|
field: 'BoxCode',
|
title: '箱码',
|
align: 'center',
|
}, {
|
field: 'Qty',
|
title: '箱内数量',
|
align: 'center',
|
}, {
|
field: 'aaa',
|
title: '操作',
|
align: 'center',
|
templet: '#table-content-list',
|
width: 80,
|
}]
|
],
|
};
|
var tableIns;
|
refreshTable();
|
var $ = layui.$;
|
$('.layui-btn.layuiadmin-btn-list').on('click', function() {
|
var type = $(this).data('type');
|
active[type] ? active[type].call(this) : '';
|
});
|
var ImportId = 0;
|
table.on('tool(LAY-app-content-list)', function(obj) {
|
var data = obj.data;
|
if (obj.event === 'get') {
|
layer.open({
|
type: 2,
|
title: '库存详情',
|
content: 'StockInfoForm.html?pCode=' + data.BoxCode + '&id=' + stockCodeId,
|
maxmin: true,
|
area: ['800px', '750px'],
|
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);
|
//提交 Ajax 成功后,静态更新表格中的数据
|
var param = {
|
Id: 0,
|
BillTypeCode: field.BillTypeCode,
|
BillTypeName: field.BillTypeName,
|
BillTypeType: field.BillTypeType,
|
BillTypeRemark: field.BillTypeRemark
|
};
|
sendData(IP + "/Interface/AddBillType", param, 'post',
|
function(res) {
|
console.log(res);
|
if (res.code == 1) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
refreshTable($("#Msg")
|
.val());
|
// table.reload('LAY-app-content-list'); //数据刷新
|
layer.close(index); //关闭弹层
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {});
|
}
|
});
|
//$.ajax({});
|
});
|
submit.trigger('click');
|
}
|
});
|
}
|
});
|
//获取浏览器参数
|
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>
|