<title>库存操作详情表</title>
|
<!--当前位置开始-->
|
<div class="layui-card layadmin-header">
|
<div class="layui-breadcrumb" lay-filter="breadcrumb">
|
<script type="text/html" template lay-done="layui.data.updateMainBreadcrumb();">
|
</script>
|
</div>
|
</div>
|
<!--当前位置结束-->
|
<style>
|
/* 重写样式 */
|
</style>
|
<script type="text/html" template lay-type="Post" lay-url="{{ layui.setter.apiUrl }}Api/CoreCmsStockLog/GetIndex" lay-done="layui.data.done(d);">
|
|
</script>
|
|
<script type="text/html" id="LAY-app-CoreCmsStockLog-toolbar">
|
<div class="layui-form coreshop-toolbar-search-form">
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="stockId" placeholder="请输入关联单号" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="sn" placeholder="请输入货品编码" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="bn" placeholder="请输入商品编码" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="goodsName" placeholder="请输入商品名称" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<div class="layui-input-inline">
|
<select name="type">
|
<option value="">请选择类型</option>
|
{{# layui.each(indexData.stockType, function(index, item){ }}
|
<option value="{{ item.value }}">{{ item.description }}</option>
|
{{# }); }}
|
</select>
|
</div>
|
</div>
|
|
<div class="layui-inline">
|
<div class="layui-input-inline core-time-input">
|
<input type="text" name="createTime" id="searchTime-CoreCmsStock-createTime" placeholder="请输入时间段" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-CoreCmsStockLog-search"><i class="layui-icon layui-icon-search"></i>筛选</button>
|
</div>
|
</div>
|
</div>
|
</script>
|
|
<div class="table-body">
|
<table id="LAY-app-CoreCmsStockLog-tableBox" lay-filter="LAY-app-CoreCmsStockLog-tableBox"></table>
|
</div>
|
|
<script>
|
var indexData;
|
var debug = layui.setter.debug;
|
layui.data.done = function (d) {
|
//开启调试情况下获取接口赋值数据
|
if (debug) { console.log(d); }
|
|
indexData = d.data;
|
layui.use(['index', 'table', 'laydate', 'util', 'coredropdown', 'coreHelper'],
|
function () {
|
var $ = layui.$
|
, admin = layui.admin
|
, table = layui.table
|
, form = layui.form
|
, laydate = layui.laydate
|
, setter = layui.setter
|
, coreHelper = layui.coreHelper
|
, util = layui.util
|
, view = layui.view;
|
|
|
//重载form
|
form.render();
|
var searchwhere;
|
//监听搜索
|
form.on('submit(LAY-app-CoreCmsStockLog-search)',
|
function (data) {
|
var field = data.field;
|
searchwhere = field;
|
//执行重载
|
table.reloadData('LAY-app-CoreCmsStockLog-tableBox', { where: field });
|
});
|
//数据绑定
|
table.render({
|
elem: '#LAY-app-CoreCmsStockLog-tableBox',
|
url: layui.setter.apiUrl + 'Api/CoreCmsStockLog/GetPageList',
|
method: 'POST',
|
toolbar: '#LAY-app-CoreCmsStockLog-toolbar',
|
defaultToolbar: ['filter', 'print', 'exports'],
|
height: 'full-127',//面包屑142px,搜索框4行172,3行137,2行102,1行67
|
page: true,
|
limit: 30,
|
limits: [10, 15, 20, 25, 30, 50, 100, 200],
|
text: { none: '暂无相关数据' },
|
cols: [
|
[
|
{ field: 'id', title: '序列', width: 40, sort: false },
|
{ field: 'stockId', title: '关联单号', sort: false, width: 150 },
|
{ field: 'memo', title: '备注', sort: false, width: 250 },
|
{ field: 'goodsName', title: '商品名称', sort: false },
|
{ field: 'spesDesc', title: '货品规格', sort: false },
|
//{ field: 'productId', title: '货品序列', sort: false, width: 105 },
|
//{ field: 'goodsId', title: '商品序列', sort: false, width: 105 },
|
{
|
field: 'type', title: '操作类型', sort: false, width: 105, templet: function (data) {
|
for (var i = 0; i < d.data.stockType.length; i++) {
|
if (data.type == d.data.stockType[i].value) {
|
return d.data.stockType[i].description;
|
}
|
}
|
return "";
|
}
|
},
|
{ field: 'sn', title: '货品编码', sort: false, width: 130 },
|
{ field: 'bn', title: '商品编码', sort: false, width: 130 },
|
{ field: 'nums', title: '数量', sort: false, width: 105 },
|
{ field: 'createTime', title: '时间', sort: false, width: 130 },
|
]
|
]
|
});
|
//监听排序事件
|
table.on('sort(LAY-app-CoreCmsStockLog-tableBox)', function (obj) {
|
table.reloadData('LAY-app-CoreCmsStockLog-tableBox', {
|
initSort: obj, //记录初始排序,如果不设的话,将无法标记表头的排序状态。
|
where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
|
orderField: obj.field, //排序字段
|
orderDirection: obj.type //排序方式
|
}
|
});
|
});
|
|
laydate.render({
|
elem: '#searchTime-CoreCmsStock-createTime',
|
type: 'datetime',
|
range: '到',
|
});
|
});
|
};
|
</script>
|