提交 | 用户 | 时间
|
71e81e
|
1 |
|
懒 |
2 |
layui.use(['table','form', 'admin', 'ax','laydate','upload','formSelects'], function () { |
|
3 |
var $ = layui.jquery; |
|
4 |
var $ax = layui.ax; |
|
5 |
var form = layui.form; |
|
6 |
var admin = layui.admin; |
|
7 |
var table = layui.table; |
|
8 |
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引 |
|
9 |
|
|
10 |
/** |
|
11 |
* bom信息管理 |
|
12 |
*/ |
|
13 |
var MaterialShortage = { |
|
14 |
tableId: "materialShortageTable2" |
|
15 |
}; |
|
16 |
|
|
17 |
$('#serch').click(function(){ |
|
18 |
var queryData = {}; |
|
19 |
queryData['customerCode'] = $("#customerCode").val(); |
|
20 |
queryData['customerName'] = $("#customerName").val(); |
|
21 |
queryData['customerType'] = $("#customerType").val(); |
|
22 |
|
|
23 |
table.reload(MaterialShortage.tableId, { |
|
24 |
where: queryData, page: {curr: 1} |
|
25 |
}); |
|
26 |
}); |
|
27 |
/** |
|
28 |
* 缺料报警初始化表格的列 |
|
29 |
*/ |
|
30 |
MaterialShortage.initColumn = function () { |
|
31 |
return [[ |
|
32 |
{type: 'radio'}, |
|
33 |
{field: 'id', hide: true, title: 'id'}, |
|
34 |
{field: 'customerCode', sort: true, title: '客户编号'}, |
|
35 |
{field: 'customerName', sort: true, title: '客户名称'}, |
|
36 |
{field: 'customerType', sort: true, title: '客户类型'}, |
|
37 |
{field: 'contact', sort: true, title: '联系方式'}, |
|
38 |
{field: 'remarks', sort: true, title: '备注'}, |
|
39 |
]]; |
|
40 |
}; |
|
41 |
|
|
42 |
table = $.extend(table, {config: {checkName: 'checked'}}); |
|
43 |
var tableResult = table.render({ |
|
44 |
elem: '#' + MaterialShortage.tableId, |
|
45 |
url: Feng.ctxPath + '/customInfo/list', |
|
46 |
page: true, |
|
47 |
cellMinWidth: 80, |
|
48 |
cols: MaterialShortage.initColumn() |
|
49 |
}); |
|
50 |
let Msg=''; |
|
51 |
table.on('row(materialShortageTable2)',function (data) { |
|
52 |
Msg = data.data; |
|
53 |
}) |
|
54 |
$('#btnSubmit').click(function(){ |
|
55 |
if (Msg !=='' ){ |
|
56 |
// 判断是否点击的是确定 |
|
57 |
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引 |
|
58 |
window.localStorage.setItem('message',JSON.stringify(Msg)); |
|
59 |
parent.layer.close(index); |
|
60 |
} |
|
61 |
else { |
|
62 |
Feng.error("请选择一条数据!") |
|
63 |
} |
|
64 |
}); |
|
65 |
|
|
66 |
|
|
67 |
}); |