+
@@ -54,6 +66,18 @@
form = layui.form,
table = layui.table;
+ $('#openSonByDepository').on('click', function(){
+ layer.open({
+ type: 2,
+ title: '弹窗内容',
+ skin: 'layui-layer-rim',
+ maxmin: true,
+ shadeClose: true, //点击遮罩关闭层
+ area : ['800px' , '500px'],
+ content: '/selectDepository?type=2',
+ });
+ });
+
table.render({
elem: "#currentTableId",
url: '/material/material',
@@ -77,19 +101,24 @@
,dataName: 'data' //规定数据列表的字段名称,默认:data
},
toolbar: ['filter', 'exports', 'print'],
- cols: [ [
+ cols: [
+ [
+ {type: "checkbox", width: 50},
{field: 'id', width: '10%', title: '材料编号'},
{field: 'mname', width: '10%', title: '材料名称'},
{field: 'version',width: 200,title: '规格型号',sort: false},
{field: 'code',width: 200,title: '存货编码',sort: true},
{field: 'typeName', width: '10%', title: '材料类型'},
{field: 'depositoryName', width: '12%', title: '仓库名称', sort: true},
+ {field: 'depositoryCode', width: '12%', title: '仓库编号', sort: true},
{field: 'quantity', width: '10%', title: '数量', sort: true},
{field: 'price', title: '单价', width: '8%', sort: true},
{field: 'amounts', title: '总金额', minWidth: 150, sort: true},
{field: 'unit',width: '10%',title: '计量单位',sort: true},
{field: 'texture',width: '8%',title: '材质',sort: true},
- ]],
+ {title: '操作', minWidth: 250, toolbar: '#currentTableBar', align: "center"}
+ ]
+ ],
limits: [10, 15, 20, 25, 50],
limit: 10,
page: true,
@@ -99,6 +128,11 @@
}
});
+ //监听表格复选框选择
+ table.on('checkbox(currentTableFilter)', function (obj) {
+ console.log(obj)
+ });
+
// 监听搜索操作
form.on('submit(data-search-btn)', function (data) {
var req={};
@@ -109,7 +143,9 @@
if (data.depositoryId!==''){
req.depositoryId=data.depositoryId;
}
-
+ if(data.code !==''){
+ req.code =data.code;
+ }
//执行搜索重载
table.reload('currentTableId', {
url: '/material/material',
@@ -120,6 +156,29 @@
}, 'data');
return false;
});
+
+ table.on('tool(currentTableFilter)', function (obj) {
+ let data = obj.data;
+ if (obj.event === 'applicationIn') {
+ // 入库申请
+ var index = layer.open({
+ title: '入库申请',
+ type: 2,
+ shade: 0.2,
+ maxmin: true,
+ shadeClose: true,
+ area: ['100%', '100%'],
+ content: '/application_in_back?mid='+data.id+"&depositoryId="+data.depositoryId
+ });
+ $(window).on("resize", function () {
+ layer.full(index);
+ });
+ return false;
+ }else{
+ // 出库申请
+ console.log(data)
+ }
+ });
});
diff --git a/src/main/resources/templates/pages/material/material-add.html b/src/main/resources/templates/pages/material/material-add.html
index 7d1b9cde..a14cfa87 100644
--- a/src/main/resources/templates/pages/material/material-add.html
+++ b/src/main/resources/templates/pages/material/material-add.html
@@ -48,8 +48,9 @@
-->
-
+