<!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-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">关键字</label>
|
<div class="layui-input-inline">
|
<input type="text" id="Msg" name="Msg" placeholder="编码/名称/规格" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">单据类型</label>
|
<div class="layui-input-inline">
|
<select name="Type" id="Type" lay-filter="Type" disabled="disabled" lay-search>
|
<option value="0">成品入库</option>
|
<option value="1">采购入库</option>
|
<option value="2">中间品入库</option>
|
<option value="3">退货入库</option>
|
<option value="4">车间余料退回入库</option>
|
<option value="5">其它入库</option>
|
<option value="6">代储入库</option>
|
<option value="7">寄存入库</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>
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-list" data-type="setParent">确定</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-card-body">
|
<table id="goods-list" lay-filter="goods-list"></table>
|
</div>
|
</div>
|
</div>
|
|
<script src="../../layuiadmin/layui/layui.js"></script>
|
<script src="../../js/jquery-3.5.1.min.js"></script>
|
<script src="../../js/jquery.cookie.js"></script>
|
<script src="../../js/public.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,
|
index1 = parent.layer.getFrameIndex(window.name),
|
layer = layui.layer;
|
|
|
// 获取上游页面的传值
|
getQueryString('type');
|
|
|
function getQueryString(name) {
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
var r = window.location.search.substr(1).match(reg);
|
|
if (r != null) {
|
// $("#Type").empty();
|
// if (unescape(r[2]) == 0)
|
// {
|
// $("#Type").append('<option value ="0" Selected >标准物料</option>');
|
// $("#Type").append('<option value ="1">非标物料</option>');
|
// }
|
// if (unescape(r[2]) == 1)
|
// {
|
// $("#Type").append('<option value ="0">标准物料</option>');
|
// $("#Type").append('<option value ="1" Selected >非标物料</option>');
|
// }
|
|
|
$("#Type").val(unescape(r[2])); // "optionValue"为需要被选中的选项的value属性值
|
form.render('select');
|
}
|
|
//return null;
|
}
|
|
|
refreshTable();
|
|
var active = {
|
setParent: function () {
|
var checkStatus = table.checkStatus('goods-list');
|
var id = '#LAY-app-content-list', goods = $('#goods-list');
|
if (checkStatus.data.length == 0) {
|
parent.layer.msg('请选择待入库的物料!');
|
return true;
|
}
|
window.parent.success(checkStatus.data);
|
parent.layer.close(index1);
|
}
|
};
|
$('.layui-inline .layui-btn').on('click', function () {
|
var othis = $(this)
|
, type = othis.data('type');
|
active[type] && active[type].call(this);
|
});
|
|
|
var tableIns;
|
function refreshTable() {
|
var param = {
|
SkuNo: $("#Msg").val(),
|
Type: $("#Type").val()
|
};
|
|
sendData(IP + "/BllAsn/GetMaterialsList", param, 'post', function (res) {
|
if (res.code == 0) { //成功
|
var list = res.data;
|
$.extend(infoOptions, {
|
data: list
|
});
|
infoOptions.page = {
|
curr: 1
|
}
|
tableIns = table.render(infoOptions);
|
} else { //不成功
|
layer.msg('获取物料信息失败!', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
|
}
|
// 表单需要的变量
|
var infoOptions = {
|
elem: '#goods-list',
|
height: 'full-100',
|
id: 'goods-list',
|
page: true,
|
limit: pageCnt,
|
limits: pageLimits,
|
cellMinWidth: 80, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
cols: [
|
[{
|
field: 'SkuId',
|
title: 'Id',
|
type: 'checkbox',
|
width: 100,
|
sort: true,
|
fixed: 'left'
|
}, {
|
field: 'SkuNo',
|
title: '物料编码',
|
width: 100,
|
fixed: 'left'
|
}, {
|
field: 'SkuName',
|
title: '物料名称',
|
width: 180,
|
}, {
|
field: 'Standard',
|
title: '规格',
|
align: 'center',
|
width: 180
|
}, {
|
field: 'Type',
|
title: '类型',
|
width: 100,
|
templet: function (d) {
|
switch (d.Type) {
|
case "0": return "原料";
|
case "1": return "包材";
|
case "2": return "成品";
|
case "3": return "耗材";
|
case "4": return "半成品";
|
default: return "";
|
}
|
}
|
},
|
|
{
|
field: 'IsControlled',
|
title: '是否标准',
|
// JC08 title: '是否受控',
|
width: 100,
|
// JC09
|
templet: function (d) {
|
switch (d.IsControlled) {
|
case "0": return "标准";
|
case "1": return "非标";
|
default: return "";
|
}
|
},
|
}, {
|
field: 'IsInspect',
|
title: '是否免检',
|
width: 100,
|
templet: function (d) {
|
switch (d.IsInspect) {
|
case "0": return "否";
|
case "1": return "是";
|
default: return "";
|
}
|
},
|
}, {
|
field: 'Origin',
|
title: '来源',
|
width: 120
|
}, {
|
field: 'UnitName',
|
title: '计量单位',
|
width: 100,
|
}, {
|
field: 'PackagName',
|
title: '包装名称',
|
width: 120
|
}, {
|
field: 'Environment',
|
title: '存储环境',
|
width: 120,
|
templet: function (d) {
|
switch (d.Environment) {
|
case "0": return "常温";
|
case "1": return "低温";
|
case "3": return "干燥通风";
|
default: return "";
|
}
|
},
|
}, {
|
field: 'GoodsRemark',
|
title: '备注',
|
width: 160
|
}
|
]
|
],
|
|
};
|
|
//监听搜索
|
form.on('submit(LAY-app-contlist-search)', function (data) {
|
refreshTable();
|
});
|
});
|
</script>
|
</body>
|
|
</html>
|