提交 | 用户 | 时间
|
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 |
|
|
9 |
/** |
|
10 |
* bom信息管理 |
|
11 |
*/ |
|
12 |
var MaterialShortage = { |
|
13 |
tableId: "materialShortageTable2" |
|
14 |
}; |
|
15 |
var materialType = parent.materialType; |
|
16 |
console.log(materialType); |
|
17 |
|
|
18 |
var test; |
|
19 |
|
|
20 |
|
|
21 |
console.log(queryData); |
|
22 |
|
|
23 |
$('#serch').click(function(){ |
|
24 |
var queryData = {}; |
|
25 |
queryData['materialName'] = $("#materialName").val(); |
|
26 |
queryData['materialCode'] = $("#materialCode").val(); |
|
27 |
table.reload(MaterialShortage.tableId, { |
|
28 |
where: queryData, page: {curr: 1} |
|
29 |
}); |
|
30 |
}); |
|
31 |
/** |
|
32 |
* 缺料报警初始化表格的列 |
|
33 |
*/ |
|
34 |
MaterialShortage.initColumn = function () { |
|
35 |
return [[ |
|
36 |
{type: 'radio'}, |
|
37 |
{field: 'id', hide: true, title: '主键id'}, |
|
38 |
{field: 'materialCode', sort: true, title: '产品编号', width: 125}, |
|
39 |
{field: 'materialName', sort: true, title: '产品名称', width: 270}, |
|
40 |
{field: 'drawingNo', sort: true, title: '图号', width: 165}, |
|
41 |
{field: 'materialSpecs', sort: true, title: '规格', width: 215}, |
|
42 |
{field: 'unit', sort: true, title: '单位'}, |
|
43 |
{field: 'materialScience', sort: true, title: '材料'}, |
|
44 |
{field: 'materialType', sort: true, title: '物料类型'}, |
|
45 |
{field: 'materialAttribute', sort: true, title: '属性'}, |
|
46 |
]]; |
|
47 |
}; |
|
48 |
|
|
49 |
table = $.extend(table, {config: {checkName: 'checked'}}); |
|
50 |
var queryData = {}; |
|
51 |
var tableResult = table.render({ |
|
52 |
elem: '#' + MaterialShortage.tableId, |
|
53 |
url: Feng.ctxPath + '/materialInfo/list', |
|
54 |
page: true, |
|
55 |
where:queryData, |
|
56 |
cellMinWidth: 80, |
|
57 |
cols: MaterialShortage.initColumn() |
|
58 |
}); |
|
59 |
let Msg=''; |
|
60 |
table.on('row(materialShortageTable2)',function (data) { |
|
61 |
Msg = data.data; |
|
62 |
}) |
|
63 |
$('#btnSubmit').click(function(){ |
|
64 |
clearType(); |
|
65 |
if (Msg !=='' ){ |
|
66 |
// 判断是否点击的是确定 |
|
67 |
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引 |
|
68 |
window.localStorage.setItem('message',JSON.stringify(Msg)); |
|
69 |
parent.layer.close(index); |
|
70 |
} |
|
71 |
else { |
|
72 |
Feng.error("请选择一条数据!") |
|
73 |
} |
|
74 |
}); |
|
75 |
|
|
76 |
$('#reset').click(function(){ |
|
77 |
clearType(); |
|
78 |
}); |
|
79 |
|
|
80 |
function clearType(){ |
|
81 |
parent.materialType=""; |
|
82 |
} |
|
83 |
|
|
84 |
window.onunload = function () { |
|
85 |
console.log("11111111111") |
|
86 |
} |
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
}); |