1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
| layui.use(['table','laydate', 'form'], function() {
| var table = layui.table;
| var $ = layui.jquery;
| var layer = layui.layer;
| var layDate = layui.laydate;
| var form = layui.form;
|
| tableIns = table.render({
| elem: '#chooseData',
| data: [],
| even: true,
| limit: 500,
| cellMinWidth: 50,
| toolbar: '#toolbar',
| cols: [[
| {type: 'checkbox'},
| {field: 'matNo', align: 'center', title: '物料编码', sort: 'true'},
| {field: 'barcode', align: 'center', title: '条码'},
| {field: 'matName', align: 'center', title: '物料名称'},
| {field: 'str1', align: 'center', title: '物料单位'},
| {field: 'str2', align: 'center', title: '物料规格'},
| {field: 'count', title: '数量', align: 'center', edit:'text', width: 100}
| ]],
| done: function (res, curr, count) {
| }
| });
|
| // 监听排序事件
| table.on('sort(chooseData)', function (obj) {
| var searchData = {};
| $.each($('#search-box [name]').serializeArray(), function() {
| searchData[this.name] = this.value;
| });
| searchData['orderByField'] = obj.field;
| searchData['orderByType'] = obj.type;
| matQueryTable.reload({
| where: searchData,
| page: {
| curr: 1
| },
| done: function (res, curr, count) {
| if (res.code === 403) {
| top.location.href = baseUrl+"/";
| }
| pageCurr=curr;
| limit();
| }
| });
| });
|
| // 监听头工具栏事件
| table.on('toolbar(chooseData)', function (obj) {
| var checkStatus = table.checkStatus(obj.config.id);
| var data = checkStatus.data;
| switch(obj.event) {
| case 'comb':
| if (data.length === 0){
| layer.msg('请选择数据');
| } else {
| layer.open({
| type: 1,
| title: '组盘',
| maxmin: true,
| shadeClose: true,
| content: $('#combDiv'),
| success: function (layero, index) {
|
| }
| })
| }
| break;
| }
| });
| });
|
|
| // 提取物料
| var matCodeLayerIdx;
| function getMat() {
| tableIns.reload({data: []});
| matCodeLayerIdx = layer.open({
| type: 2,
| title: '库位物料',
| maxmin: true,
| area: [top.detailWidth, top.detailHeight],
| shadeClose: true,
| content: 'matQuery.html',
| success: function(layero, index){
| }
| });
| }
|
|