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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
<!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">
        <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    </head>
    <body>
 
        <div class="layui-fluid" style="padding-bottom: 0;">
            <div class="layui-card">
                <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                    <div class="layui-form-item">
                        <label class="layui-form-label">所属仓库</label>
                        <div class="layui-input-inline">
                            <select name="SlotWarehouseId" id="WarehouseId" lay-filter="getHouseId" lay-search>
                                <option value=""></option>
                            </select>
                        </div>
                        <label class="layui-form-label" style="margin-left: 12px;">所属区域</label>
                        <div class="layui-input-inline">
                            <select name="LanewayId" id="LanewayId" lay-filter="getLanwayId" lay-search>
                                <option value=""></option>
                            </select>
                        </div>
                        <label class="layui-form-label" style="margin-left: 44px;">储位属性</label>
                        <div class="layui-input-inline">
                            <select name="PropertyCode" id="PropertyCode" lay-verify="" lay-search>
                                <option value=""></option>
                            </select>
                        </div>
                        <label class="layui-form-label" style="margin-left: 17px;">储位环境</label>
                        <div class="layui-input-inline">
                            <select name="EnvironmentCode" id="EnvironmentCode" lay-verify="" lay-search>
                                <option value=""></option>
                            </select>
                        </div>
                        <br>
                        <div class="layui-inline">
                            <label class="layui-form-label">&emsp;&emsp;储列</label>
                            <div class="layui-input-inline">
                                <input type="number" id="SlotColumn" onkeyup="this.value=this.value.replace(/[, ]/g,'')"  name="SlotColumn" placeholder="列···"
                                    autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline" style="width: 20%;">
                            <label class="layui-form-label" style="float:left">&emsp;&emsp;储层</label>
                            <div class="layui-input-inline">
                                <input type="number" id="SlotLayer" onkeyup="this.value=this.value.replace(/[, ]/g,'')"  name="SlotLayer" placeholder="层···"
                                    autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">&emsp;&emsp;储排</label>
                            <div class="layui-input-inline">
                                <input type="number" id="SlotRow" onkeyup="this.value=this.value.replace(/[, ]/g,'')"  name="SlotRow" placeholder="排···" autocomplete="off"
                                    class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline" >
                            <label class="layui-form-label" style="margin-left: 3px;">储位编码</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">
                            <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>
                        </div>
                    </div>
                </div>
                <div class="layui-card-body">
                    <div style="padding-bottom: 5px;display: flex; flex-direction: row-reverse;">
                        <!-- <button class="layui-btn layuiadmin-btn-list" data-type="add">货位初始化</button> -->
                        <button class="inlock layui-btn layui-btn-sm layuiadmin-btn-list"data-type="edit0" style="margin-left: 10px;">入库锁定</button>
                        <button class="inlock layui-btn layui-btn-sm layuiadmin-btn-list"data-type="edit1">入库解锁</button>
                        <button class="tolock layui-btn layui-btn-sm layuiadmin-btn-list"data-type="edit2">出库锁定</button>
                        <button class="tolock layui-btn layui-btn-sm layuiadmin-btn-list" data-type="edit3">出库解锁</button>
                        <button class="shield layui-btn layui-btn-sm layuiadmin-btn-list" data-type="edit4">屏蔽</button>
                        <button class="shield layui-btn layui-btn-sm layuiadmin-btn-list"data-type="edit5" >解除屏蔽</button>
                    </div>
                    <table id="LAY-app-content-list" lay-filter="LAY-app-content-list" style="width: 100%;"></table>
                    <script type="text/html" id="buttonTpl">
                    {{# if(d.SlotCloseFlag=='1'){ }}
                        <button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs">屏蔽</button>
                        {{# } else { }}
                            <button class="layui-btn layui-btn-radius layui-btn-primary  layui-btn-xs">正常</button>
                            {{# } }}
                    </script>
                    <script type="text/html" id="buttonImp">
                    {{# if(d.SlotImlockFlag=='1'){ }}
                        <button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs">锁定</button>
                        {{# } else { }}
                            <button class="layui-btn layui-btn-radius layui-btn-primary  layui-btn-xs">正常</button>
                            {{# } }}
                    </script>
                    <script type="text/html" id="buttonExp">
                    {{# if(d.SlotExlockFlag=='1'){ }}
                        <button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs">锁定</button>
                        {{# } else { }}
                            <button class="layui-btn layui-btn-radius layui-btn-primary  layui-btn-xs">正常</button>
                            {{# } }}
                    </script>
                    <script type="text/html" id="type">
                    {{# if(d.SlotStatus=='0'){ }}
                        <p>空储位</p>
                        {{# } else if(d.SlotStatus=='1'){ }}
                            <p>有物品</p>
                            {{# } else if(d.SlotStatus=='2'){ }}
                                <p>正在入库</p>
                                {{# } else if(d.SlotStatus=='3'){ }}
                                    <p>正在出库</p>
                                    {{# } else if(d.SlotStatus=='4'){ }}
                                        <p>正在移入</p>
                                        {{# } else if(d.SlotStatus=='5'){ }}
                                            <p>正在移出</p>
                                            {{# } else if(d.SlotStatus=='6'){ }}
                                                <p>空托盘</p>
                                                {{# }else { }}
                                                    <p>屏蔽</p>{{# } }}
                    </script>
                    <script type="text/html" id="table-content-list">
                        <a class="editBtn layui-btn layui-btn-normal layui-btn-xs" style="display: none;" lay-event="update"><i
                                class="layui-icon layui-icon-edit"></i>编辑</a>
                    </script>
                </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>
            var uid = $.cookie('userId');
            if (uid == null) {
                alert('请登录后操作');
                window.parent.location.href = '../../Login.html'
            }
            layui.config({
                base: '../../../layuiadmin/' //静态资源所在路径
            }).extend({
                index: 'lib/index' //主入口模块
            }).use(['index', 'table', 'laypage', 'layer'], function() {
                var table = layui.table,
                    form = layui.form,
                    laypage = layui.laypage,
                    layer = layui.layer,
                    $ = layui.$;
                    var houseid = 0;
                // 表单需要的变量
 
                var url = IP + "/Equipment/GetSlotCodeViewList"
                var where = {
                    WarehouseId: $("#WarehouseId").val(),
                    LanewayId: $("#LanewayId").val(),
                    Property: $("#PropertyCode").val(),
                    EnvironmentCode: $("#EnvironmentCode").val(),
                    Msg: $("#Msg").val(),
                    Type: $("#SlotRow").val() + '-' + $("#SlotColumn").val() + '-' + $("#SlotLayer").val()
                };
                console.log($("#PropertyCode").val())
                var tableIns = table.render({
                    elem: '#LAY-app-content-list',
                    height: 'full-173',
                    id: 'LAY-app-content-list',
                    url: url,
                    method: 'post',
                    where: where,
                    contentType: 'application/json',
                    page: true,
                    even: true,
                    limit: pageCnt, //默认多少页
                    limits: pageLimits, //默认数组[10,20,30,40,50]
                    cellMinWidth: 80,
                    done: function() {
                        var param = {
                            id: $.cookie('userId'),
                        };
                        sendData(IP + "/Menu/GetPermission", param, 'post', function(res) {
 
                            if (res.code == 1) { //成功
 
                                for (var k = 0; k < res.data.length; k++) {
                                    if (res.data[k].ModuleId == "5923B5B7C15D4B74B71383BF7E530394") {
                                        $(function() {
 
                                            $(".editBtn").show();
                                        });
                                    }
 
 
                                }
                            } else { //不成功
                                console.log(3);
                                layer.msg('获取信息失败', {
                                    icon: 2,
                                    time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                }, function() {
                                    //回调
                                });
                            }
                        });
                    },
                    cols: [
                        [{
                                field: 'Id',
                                title: 'Id',
                                type: 'checkbox',
                                width: 50,
                                sort: true,
                                fixed: 'left'
                            },
                            {
                                field: 'WarehouseName',
                                title: '所属仓库',
                                align: 'center',
                                width: 150,
                                fixed: 'left'
                            }, {
                                field: 'LanewayName',
                                title: '所属区域',
                                align: 'center',
                                width: 150,
                            }, {
                                field: 'SlotRow',
                                title: '排',
                                align: 'center',
                                width: 100,
                            }, {
                                field: 'SlotColumn',
                                title: '列',
                                align: 'center',
                                width: 100,
                            }, {
                                field: 'SlotLayer',
                                title: '层',
                                align: 'center',
                                width: 100,
                            }, {
                                field: 'SlotInout',
                                title: '储位深度',
                                align: 'center',
                                width: 100,
                            }, {
                                field: 'SlotCode',
                                title: '储位编码',
                                align: 'center',
                                width: 150,
                            },
                            {
                                field: 'SlotStatus',
                                title: '储位状态',
                                align: 'center',
                                width: 100,
                                templet: '#type',
                            },
                            {
                                field: 'Makes',
                                title: '储位使用',
                                align: 'center',
                                width: 100,
                            },
                            {
                                field: 'Propertys',
                                title: '储位属性',
                                align: 'center',
                                width: 100,
                            }, {
                                field: 'Handles',
                                title: '储位处理',
                                align: 'center',
                                width: 100,
                            }, {
                                field: 'Environments',
                                title: '储位环境    ',
                                align: 'center',
                                width: 100,
                            }, {
                                field: 'SlotImlockFlag',
                                templet: '#buttonImp',
                                title: '入库锁定',
                                fixed: 'right',
                                align: 'center',
                                width: 100,
                            }, {
                                field: 'SlotExlockFlag',
                                templet: '#buttonExp',
                                title: '出库锁定',
                                align: 'center',
                                fixed: 'right',
                                width: 100,
                            }, {
                                field: 'SlotCloseFlag',
                                templet: '#buttonTpl',
                                title: '货位屏蔽',
                                fixed: 'right',
                                align: 'center',
                                width: 100,
                            }, {
                                title: '操作',
                                fixed: 'right',
                                width: 100,
                                align: 'center',
                                toolbar: '#table-content-list'
                            }
                        ]
                    ],
                })
                //监听搜索
                form.on('submit(LAY-app-contlist-search)', function(data) {
                    // var code = data.field.ComCode;//计量编码        
                    // var name = data.field.ComName;//计量名称        
                    // refreshTable();
                    tableIns.reload({
                        where: { //设定异步数据接口的额外参数,任意设
                            Property: $("#PropertyCode").val(),
                            WarehouseId: $("#WarehouseId").val(),
                            LanewayId: $("#LanewayId").val(),
                            Environment: $("#EnvironmentCode").val(),
                            Msg: $("#Msg").val(),
                            Type: $("#SlotRow").val() + '-' + $("#SlotColumn").val() + '-' + $(
                                "#SlotLayer").val()
                        },
                        page: {
                            curr: 1 //重新从第 1 页开始
                        }
                    });
                });
                var id = 0;
                table.on('tool(LAY-app-content-list)', function(obj) {
                    var data = obj.data;
                    if (obj.event === 'update') {
                        id = data.Id;
                        layer.open({
                            type: 2,
                            title: '储位信息管理',
                            content: 'slotInitForm.html?id=' + id,
                            maxmin: true,
                            area: ['40%', '70%'],
                            btn: ['确定', '取消'],
                            yes: function(index, layero) {
                                var iframeWindow = window['layui-layer-iframe' + index],
                                    submitID = 'layuiadmin-app-form-edit',
                                    submit = layero.find('iframe').contents().find('#' + submitID);
                                //监听提交
                                iframeWindow.layui.form.on('submit(' + submitID + ')', function(
                                    data) {
 
                                    var field = data.field; //获取提交的字段
                                    console.log(data)
                                    //提交 Ajax 成功后,静态更新表格中的数据
                                    var param = {
                                        Id: id,
                                        SlotCloseFlag: field.SlotCloseFlag,
                                        SlotCode: field.SlotCode,
                                        SlotCodeIndex: field.SlotCodeIndex,
                                        SlotColumn: field.SlotColumn,
                                        SlotExlockFlag: field.SlotExlockFlag,
                                        SlotImlockFlag: field.SlotImlockFlag,
                                        SlotInout: field.SlotInout,
                                        LanewayName: field.LanewayName,
                                        SlotLayer: field.SlotLayer,
                                        SlotRemark: field.SlotRemark,
                                        SlotRow: field.SlotRow,
                                        SlotStatus: field.SlotStatus,
                                        SlotType: field.SlotType,
                                        WarehouseName: field.WarehouseName,
                                        Environment: field.EnvironmentCode,
                                        Handle: field.HandleCode,
                                        Make: field.MakeCode,
                                        Property: field.PropertyCode,
                                        SlotLanewayId: data.field.LanewayId,
                                        SlotWarehouseId: data.field.houseId,
                                    };
                                    sendData(IP + "/Equipment/EditWmsBaseSlot", param,
                                        'post',
                                        function(res) {
                                            console.log(res);
                                            if (res.code == 1) { //成功
                                                layer.msg("修改成功", {
                                                    icon: 1,
                                                    time: 1000 //2秒关闭(如果不配置,默认是3秒)
                                                }, function() {
                                                    tableIns.reload({
                                                        page: {
                                                            curr: 1
                                                        }
                                                    });
                                                    layer.close(index); //关闭弹层
                                                });
                                            } else { //不成功
                                                layer.msg(res.msg, {
                                                    icon: 2,
                                                    time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                                }, function() {});
                                            }
                                        });
                                    //$.ajax({});
                                });
                                submit.trigger('click');
                            }
                        });
                    }
                });
                var param = {
                    id: $.cookie('userId'),
                };
                //环境下拉框
                sendData(IP + "/Equipment/GetEnvironmentList", param, 'post', function(res) {
                    if (res.code == 1) { //成功
                        // $("#EnvironmentCode").append('<option value =""></option>');
                        for (var i = 0; i < res.data.length; i++) {
                            $("#EnvironmentCode").append('<option value =' + res.data[i].Code + '>' + res.data[i]
                                .TypeName +
                                '</option>');
                        }
                        form.render('select');
                    } else { //不成功
                        layer.msg('获取环境信息失败', {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {
                            //回调
                            form.render('select');
                        });
                    }
                });
 
                var param = {
                    id: $.cookie('userId'),
                };
                //属性下拉框
                sendData(IP + "/Equipment/GetPropertyList", param, 'post', function(res) {
                    if (res.code == 1) { //成功
                        $("#PropertyCode").append('<option value =""></option>');
                        for (var i = 0; i < res.data.length; i++) {
                            var name = res.data[i].TypeName;
                            var id = res.data[i].Code;
                            $("#PropertyCode").append('<option value =' + id + '>' + name +
                                '</option>');
 
                        }
                        form.render('select');
                    } else { //不成功
                        layer.msg('获取属性信息失败', {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {
                            //回调
                            form.render('select');
                        });
                    }
                });
                var active = {
                    edit0: function() {
                        var checkStatus = table.checkStatus('LAY-app-content-list'),
                            checkData = checkStatus.data; //得到选中的数据
                        if (checkData.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        layer.confirm('确定要将选择的储位入库锁定吗?', function(index) {
                            console.log(checkData);
                            var ids = new Array();
                            for (var i = 0; i < checkData.length; i++) {
                                ids[i] = checkData[i].Id;
                            }
                            var param = {
                                idsist: ids,
                                Type: '1',
                                Flag: 1,
                            };
                            sendData(IP + "/Equipment/UpdateSLot", param, 'post', function(res) {
                                console.log(res);
                                if (res.code == 1) { //成功
                                    layer.msg(res.msg, {
                                        icon: 1,
                                        time: 1000 //1秒关闭(如果不配置,默认是3秒)
                                    }, function() {
                                        tableIns.reload({
                                            page: {
                                                curr: 1
                                            }
                                        });
                                    });
                                } else { //不成功
                                    layer.msg(res.msg, {
                                        icon: 2,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function() {});
                                }
                            });
                        });
                    },
                    edit1: function() {
                        var checkStatus = table.checkStatus('LAY-app-content-list'),
                            checkData = checkStatus.data; //得到选中的数据
                        if (checkData.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        layer.confirm('确定要将选择的储位解除入库锁定吗?', function(index) {
                            console.log(checkData);
                            var ids = new Array();
                            for (var i = 0; i < checkData.length; i++) {
                                ids[i] = checkData[i].Id;
                            }
                            var param = {
                                idsist: ids,
                                Type: '1',
                                Flag: 0,
                            };
                            sendData(IP + "/Equipment/UpdateSLot", param, 'post', function(res) {
                                console.log(res);
                                if (res.code == 1) { //成功
                                    layer.msg(res.msg, {
                                        icon: 1,
                                        time: 1000 //1秒关闭(如果不配置,默认是3秒)
                                    }, function() {
                                        tableIns.reload({
                                            page: {
                                                curr: 1
                                            }
                                        });
                                    });
                                } else { //不成功
                                    layer.msg(res.msg, {
                                        icon: 2,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function() {});
                                }
                            });
                        });
                    },
                    edit2: function() {
                        var checkStatus = table.checkStatus('LAY-app-content-list'),
                            checkData = checkStatus.data; //得到选中的数据
                        if (checkData.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        layer.confirm('确定要将选择的储位出库锁定吗?', function(index) {
                            console.log(checkData);
                            var ids = new Array();
                            for (var i = 0; i < checkData.length; i++) {
                                ids[i] = checkData[i].Id;
                            }
                            var param = {
                                idsist: ids,
                                Type: '2',
                                Flag: 1,
                            };
                            sendData(IP + "/Equipment/UpdateSLot", param, 'post', function(res) {
                                console.log(res);
                                if (res.code == 1) { //成功
                                    layer.msg(res.msg, {
                                        icon: 1,
                                        time: 1000 //1秒关闭(如果不配置,默认是3秒)
                                    }, function() {
                                        tableIns.reload({
                                            page: {
                                                curr: 1
                                            }
                                        });
                                    });
                                } else { //不成功
                                    layer.msg(res.msg, {
                                        icon: 2,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function() {});
                                }
                            });
                        });
                    },
                    edit3: function() {
                        var checkStatus = table.checkStatus('LAY-app-content-list'),
                            checkData = checkStatus.data; //得到选中的数据
                        if (checkData.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        layer.confirm('确定要将选择的储位解除出库锁定吗?', function(index) {
                            console.log(checkData);
                            var ids = new Array();
                            for (var i = 0; i < checkData.length; i++) {
                                ids[i] = checkData[i].Id;
                            }
                            var param = {
                                idsist: ids,
                                Type: '2',
                                Flag: 0,
                            };
                            sendData(IP + "/Equipment/UpdateSLot", param, 'post', function(res) {
                                console.log(res);
                                if (res.code == 1) { //成功
                                    layer.msg(res.msg, {
                                        icon: 1,
                                        time: 1000 //1秒关闭(如果不配置,默认是3秒)
                                    }, function() {
                                        tableIns.reload({
                                            page: {
                                                curr: 1
                                            }
                                        });
                                    });
                                } else { //不成功
                                    layer.msg(res.msg, {
                                        icon: 2,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function() {});
                                }
                            });
                        });
                    },
                    edit4: function() {
                        var checkStatus = table.checkStatus('LAY-app-content-list'),
                            checkData = checkStatus.data; //得到选中的数据
                        if (checkData.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        layer.confirm('确定要将选择的储位屏蔽吗?', function(index) {
                            console.log(checkData);
                            var ids = new Array();
                            for (var i = 0; i < checkData.length; i++) {
                                ids[i] = checkData[i].Id;
                            }
                            var param = {
                                idsist: ids,
                                Type: '3',
                                Flag: 1,
                            };
                            sendData(IP + "/Equipment/UpdateSLot", param, 'post', function(res) {
                                console.log(res);
                                if (res.code == 1) { //成功
                                    layer.msg(res.msg, {
                                        icon: 1,
                                        time: 1000 //1秒关闭(如果不配置,默认是3秒)
                                    }, function() {
                                        tableIns.reload({
                                            page: {
                                                curr: 1
                                            }
                                        });
                                    });
                                } else { //不成功
                                    layer.msg(res.msg, {
                                        icon: 2,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function() {});
                                }
                            });
                        });
                    },
                    edit5: function() {
                        var checkStatus = table.checkStatus('LAY-app-content-list'),
                            checkData = checkStatus.data; //得到选中的数据
                        if (checkData.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        layer.confirm('确定要将选择的储位解除屏蔽吗?', function(index) {
                            console.log(checkData);
                            var ids = new Array();
                            for (var i = 0; i < checkData.length; i++) {
                                ids[i] = checkData[i].Id;
                            }
                            var param = {
                                idsist: ids,
                                Type: '3',
                                Flag: 0,
                            };
                            sendData(IP + "/Equipment/UpdateSLot", param, 'post', function(res) {
                                console.log(res);
                                if (res.code == 1) { //成功
                                    layer.msg(res.msg, {
                                        icon: 1,
                                        time: 1000 //1秒关闭(如果不配置,默认是3秒)
                                    }, function() {
                                        tableIns.reload({
                                            page: {
                                                curr: 1
                                            }
                                        });
                                    });
                                } else { //不成功
                                    layer.msg(res.msg, {
                                        icon: 2,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function() {});
                                }
                            });
                        });
                    }
                };
                var param = {
                    id: $.cookie('userId'),
                };
                //获取仓库下拉框
                sendData(IP + "/Interface/GetWareHouseList", param, 'post', function(res) {
                    if (res.code == 1) { //成功
                        // console.log(res.data);
                        for (var i = 0; i < res.data.length; i++) {
                            $("#WarehouseId").append('<option value =' + res.data[i].WarehouseId + '>' + res
                                .data[i].WarehouseName +
                                '</option>');
                        }
                        form.render('select');
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                    }
                });
                    form.on('select(getHouseId)', function(data) {
                        getHouseId(data.value);
                    });
            function getHouseId(selectedvalue) {
                if (selectedvalue) {
                    houseid=selectedvalue;
                var param = {
                    id: $.cookie('userId'),
                    WarehouseId:houseid
                };
                //获取 区域下拉框
                sendData(IP + "/Equipment/GetLanewayList", param, 'post', function(res) {
            $("#LanewayId").empty();
                    if (res.code == 1) { //成功
                    $("#LanewayId").append('<option value =""></option>');
                        for (var i = 0; i < res.data.length; i++) {
                            var name = res.data[i].LanewayName;
                            var id = res.data[i].Id;
                            $("#LanewayId").append('<option value =' + id + '>' + name +
                                '</option>');
                        }
                        form.render('select');
                    } else { //不成功
                        layer.msg('获取巷道信息失败', {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {
                            //回调
                            form.render('select');
                        });
                    }
                });
                }else{
                    houseid = 0;
                    
                    $("#LanewayId").empty();
                    
                    form.render('select');
                }
            };
                $('.layui-btn.layuiadmin-btn-list').on('click', function() {
                    var type = $(this).data('type');
                    active[type] ? active[type].call(this) : '';
                });
                // refreshTable();
                $(function() {
                    $(".inlock").hide();
                });
                $(function() {
                    $(".tolock").hide();
                });
                $(function() {
                $(".shield").hide();
            });
            sendData(IP + "/Menu/GetPermission", param, 'post', function(res) {
            
            if (res.code == 1) { //成功
            
                for (var k = 0; k < res.data.length; k++) {
                    if (res.data[k].ModuleId == "2D3F1E3D26A84DDCA7199608EDB4B1B2") {
                        $(function() {
            
                            $(".inlock").show();
                        });
                    }
                    if (res.data[k].ModuleId == "CB1324D8DB2F47B8A3D82375DC655EA1") {
                        $(function() {
                            $(".tolock").show();
            
                        });
                    }
                    if (res.data[k].ModuleId == "CFE9F0EEFF524A368B31A0A15ADD6150") {
                        $(function() {
                            $(".shield").show();
            
                        });
                    }
                }
            } else { //不成功
                layer.msg('获取信息失败', {
                    icon: 2,
                    time: 2000 //2秒关闭(如果不配置,默认是3秒)
                }, function() {
                    //回调
                });
            }
            
            });
            });
        </script>
    </body>
</html>