wxw
2025-05-12 c7c2f7aa20427204944ba80a2704232b2f281582
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!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">
                                <input type="text" id="LotNo" name="LotNo" 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="SkuNo" id="SkuNo" lay-verify="" lay-search>
                                    <option value=""></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/public.js"></script>
        <script src="../../js/jquery-3.5.1.min.js"></script>
        <script src="../../js/jquery.cookie.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;
                
                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);
                });  
 
                //获取物料信息
                sendData(IP + "/basis/GetMateList", {}, 'get', function(res) {
                    var html = '';
                    if (res.code == 0) //成功
                    {
                        var list = res.data;
                        for (var i = 0; i < list.length; i++) {
                            //判断空托盘
                            if (list[i].SkuNo != "100099" && list[i].SkuNo != "100098" && list[i].SkuNo != "100097" && list[i].SkuNo != "100096" && list[i].SkuNo != "100095")
                            {
                                html += '<option value = "' + list[i].SkuNo + '">' + list[i].SkuName + '</option>';
                            }
                        }
                        $("#SkuNo").append(html);
                        form.render('select');
                    }
                    else //不成功
                    {
                        layer.msg('获取物料信息失败!', {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                    }
                });
 
                function refreshTable() {
                    var param = {
                        WareHouseNo:getQueryString('houseId'),
                        Type:getQueryString('Type'),
                        LotNo: $("#LotNo").val(),
                        SkuNo: $("#SkuNo").val(),
                    };
                    table.render({
                        elem: '#goods-list',
                        height: 'full-100',
                        id: 'goods-list',
                        url: IP + "/BllSo/GetStockGroupList",
                        method: 'POST',
                        where: param,
                        contentType: 'application/json',
                        headers:{ToKen:$.cookie('token')},
                        page: true,
                        limit: pageCnt,
                        limits: pageLimits,
                        cellMinWidth: 80, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
                        cols: [
                            [{
                                type: 'checkbox',
                                width: 50,
                                fixed: 'left'
                            }, {
                                field: 'SkuNo',
                                title: '物品编码',
                                width: 100,
                                align: 'center',
                                fixed: 'left'
                            }, {
                                field: 'SkuName',
                                title: '物品名称',
                                align: 'center',
                                width: 250,
                            }, {
                                field: 'LotNo',
                                align: 'center',
                                title: '批次',
                                minWidth: 100
                            }, {
                                field: 'Standard',
                                title: '物品规格',
                                align: 'center',
                                width: 100
                            }, {
                                field: 'Qty',
                                title: '库存数量',
                                width: 100,
                                align: 'center', 
                            }]
                        ],
 
                    }); 
                }
                // table.reload()
                // 表单需要的变量
                
                //监听搜索
                form.on('submit(LAY-app-contlist-search)', function(data) {
                    
                    refreshTable();
                });
                refreshTable();
                
                // var param = {};
                // sendData(IP + "/Export/GetAllSelect", param, 'post', function(res) {
                //     if (res.code == 1) { //成功
                    
                //         for (var i = 0; i < res.Customerdata.length; i++) {
                //             $("#ExportCustomerName").append('<option value =' + res.Customerdata[i].CustomerCode +
                //                 '>' + res.Customerdata[i].CustomerName +
                //                 '</option>');
                //         }
                        
                //         form.render('select');
                //     } else { //不成功
                //         layer.msg(res.msg, {
                //             icon: 2,
                //             time: 2000 //2秒关闭(如果不配置,默认是3秒)
                //         }, function() {});
                //     }
                // });
                //获取浏览器参数
                function getQueryString(name) {
                    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
                    var r = window.location.search.substr(1).match(reg);
                    if (r != null) return unescape(r[2]);
                    return null;
                }
            });
        </script>
    </body>
</html>