ch
2022-09-01 8448827f9d0a620590f73ed0b4bafc417c655e77
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
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
<!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">
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <style>
        .layui-form-item .layui-inline {
            margin-right: 0;
        }
    </style>
</head>
<body>
    <div class="layui-fluid" style="padding: 0;">
        <div class="layui-card" style="padding: 15px;">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" lay-filter="component-form-group" action="">
                    <div class="layui-card-header">
                        <div class="layui-btn-group">
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Cancel">退出</button>
                            <button type="button" id="set_SaveBarCode" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_SaveBarCode" >汇报</button>
                        </div>
                    </div>
                    <div class="layui-form-item" style="padding-top: 10px;">
                        <div class="layui-row">
                            <div class="layui-col-xs4 layui-inline">
                                <h2>工序出站汇报单(批量)</h2>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs4 layui-inline">
                                <h2></h2>
                            </div>
                            <div class="layui-col-xs4 layui-inline">
                                <label class="layui-form-label"><span style="color:red;">*</span>物料</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" name="HMaterName" id="HMaterName" onmouseover="this.title=this.value" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                    <input type="hidden" name="HMaterID" id="HMaterID" value="0">
                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="get_checkMater" id="get_checkMater" style="width: 40px;">
                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                    </button>
                                </div>
                            </div>
                            <div class="layui-col-xs4 layui-inline">
                                <label class="layui-form-label"><span style="color:red;">*</span>主单据号</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" name="HMainBillNo" id="HMainBillNo" style="background-color:#efefef4d;" readonly>
                                    <input type="hidden" name="HMainInterID" id="HMainInterID" value="0">
                                </div>
                            </div>
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Serach">查询</button>
                        </div>
                        <div class="layui-tab" lay-filter="tab-POStockInBill">
                            <div class="layui-tab-content">
                                <!--其他信息-->
                                <div class="layui-tab-item layui-show">
                                    <div class="layui-form-item" style="padding-top: 10px;">
                                        <div class="layui-row">
                                            <div class="layui-col-xs3 layui-inline">
                                                <label class="layui-form-label">职员1</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" class="layui-input" name="HEmpName1" id="HEmpName1" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="HEmployeeID-BT1" id="HEmployeeID-BT1" style="width: 40px; padding: 0 10px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                    <input type="hidden" value="0" name="HEmpID1" id="HEmpID1">
                                                </div>
                                            </div>
                                            <div class="layui-col-xs3 layui-inline">
                                                <label class="layui-form-label">职员2</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" class="layui-input" name="HEmpName2" id="HEmpName2" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="HEmployeeID-BT2" id="HEmployeeID-BT2" style="width: 40px; padding: 0 10px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                    <input type="hidden" value="0" name="HEmpID2" id="HEmpID2">
                                                </div>
                                            </div>
                                            <div class="layui-col-xs3 layui-inline">
                                                <label class="layui-form-label">职员3</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" class="layui-input" name="HEmpName3" id="HEmpName3" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="HEmployeeID-BT3" id="HEmployeeID-BT3" style="width: 40px; padding: 0 10px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                    <input type="hidden" value="0" name="HEmpID3" id="HEmpID3">
                                                </div>
                                            </div>
                                            <div class="layui-col-xs3 layui-inline">
                                                <label class="layui-form-label">职员4</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" class="layui-input" name="HEmpName4" id="HEmpName4" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="HEmployeeID-BT4" id="HEmployeeID-BT4" style="width: 40px; padding: 0 10px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                    <input type="hidden" value="0" name="HEmpID4" id="HEmpID4">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-col-xs3 layui-inline">
                                                <label class="layui-form-label">职员5</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" class="layui-input" name="HEmpName5" id="HEmpName5" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="HEmployeeID-BT5" id="HEmployeeID-BT5" style="width: 40px; padding: 0 10px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                    <input type="hidden" value="0" name="HEmpID5" id="HEmpID5">
                                                </div>
                                            </div>
                                            <div class="layui-col-xs3 layui-inline">
                                                <label class="layui-form-label">职员6</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" class="layui-input" name="HEmpName6" id="HEmpName6" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="HEmployeeID-BT6" id="HEmployeeID-BT6" style="width: 40px; padding: 0 10px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                    <input type="hidden" value="0" name="HEmpID6" id="HEmpID6">
                                                </div>
                                            </div>
                                            <div class="layui-col-xs3 layui-inline">
                                                <label class="layui-form-label">职员7</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" class="layui-input" name="HEmpName7" id="HEmpName7" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="HEmployeeID-BT7" id="HEmployeeID-BT7" style="width: 40px; padding: 0 10px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                    <input type="hidden" value="0" name="HEmpID7" id="HEmpID7">
                                                </div>
                                            </div>
                                            <div class="layui-col-xs3 layui-inline">
                                                <label class="layui-form-label">职员8</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" class="layui-input" name="HEmpName8" id="HEmpName8" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="HEmployeeID-BT8" id="HEmployeeID-BT8" style="width: 40px; padding: 0 10px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                    <input type="hidden" value="0" name="HEmpID8" id="HEmpID8">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab" lay-filter="">
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1" style="padding:1px;" class="layui-this">流转卡列表</li>
                        </ul>
                        <div class="layui-tab-content">
                            <!--明细信息-->
                            <div class="layui-tab-item layui-show">
                                <div class="layui-form-item">
                                    <table class="layui-hide" id="mainTable1" lay-filter="mainTable1"></table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab" lay-filter="">
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1" style="padding:1px;" class="layui-this">明细信息</li>
                        </ul>
                        <div class="layui-tab-content">
                            <!--明细信息-->
                            <div class="layui-tab-item layui-show">
                                <div class="layui-form-item">
                                    <table class="layui-hide" id="mainTable2" lay-filter="mainTable2"></table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <input type="hidden" name="HMaterID" id="HMaterID" value="0">
                </form>
            </div>
        </div>
    </div>
    <script type="text/html" id="barDemo1">
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
        <a class="layui-btn layui-btn-xs" lay-event="edit">明细</a>
    </script>
    <script>
 
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
 
            //#region 公用变量
 
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element
                , util = layui.util;
            var HMainEntryRow = 1;//单据号后缀
            var HqtyBill = 0;//进站单据数量
 
          
 
            //初始表格数据
            var option1 = {
                elem: '#mainTable1'
                //, toolbar: '#toolbarDemo1'
                , limit: 500 //每页默认显示的数量
                , height: 300
                , cellMinWidth: 110
                , totalRow: true
                , cols: [[ //表头
                    { type: 'checkbox', totalRowText: '合计行' }
                    //, { type: 'numbers', title: '序号', totalRow: true }
                    , { field: '单据号', title: '单据号' }
                    , { field: '名称', title: '名称', hide: true }
                    , { field: '代码', title: '代码' }
                    , { field: '批号', title: '批号' }
                    , { field: '结存数量', title: '结存数量' }
                    , { field: '工序名称', title: '工序名称' }
                    , { field: 'HPriceQty', title: 'HPriceQty', hide: true }
                    , { field: 'HPlanQty', title: 'HPlanQty', hide: true }
                    , { field: 'HProcExchBillNo', title: 'HProcExchBillNo', hide: true }
                    , { field: 'HICMOInterID', title: 'HICMOInterID', hide: true }
                    , { field: 'HICMOBillNo', title: 'HICMOBillNo', hide: true }
                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
                    , { field: 'HMaterName', title: 'HMaterName', hide: true }
                    , { field: 'HMaterNumber', title: 'HMaterNumber', hide: true }
                    , { field: 'HMaterModel', title: 'HMaterModel', hide: true }
                    , { field: 'HICMOQty', title: 'HICMOQty', hide: true }
                    , { field: 'HOrderProcNO', title: 'HOrderProcNO', hide: true }
                    , { field: 'HQCCheckID', title: 'HQCCheckID', hide: true }
                    , { field: 'hdate', title: 'hdate', hide: true }
                    , { field: 'HMakeDate', title: 'HMakeDate', hide: true }
                    , { field: 'HBarCodeMakeDate', title: 'HBarCodeMakeDate', hide: true }
                    , { field: 'HStationOutTime', title: 'HStationOutTime', hide: true }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo1' }
                ]]
                , text: {
                    none: '无数据!'
                }
            };
            var option2 = {
                elem: '#mainTable2'
                //, toolbar: '#toolbarDemo1'
                , limit: 500 //每页默认显示的数量
                , height: 300
                , cellMinWidth: 110
                , totalRow: true
                , cols: [[ //表头
                    { type: 'checkbox', totalRowText: '合计行' }
                    //, { type: 'numbers', title: '序号', totalRow: true }
                    , { field: '状态', title: '状态' }
                    , { field: '工序号', title: '工序号' }
                    , { field: '工序名称', title: '工序名称' }
                    , { field: '操作员', title: '操作员' }
                    , { field: '结转数量', title: '结转数量' }
                    , { field: '完工数量', title: '完工数量' }
                    , { field: '完工日期', title: '完工日期' }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo1' }
                ]]
                , text: {
                    none: '无数据!'
                }
            };
 
 
            //初始加载表格
            option1.data = [];
            table.render(option1);
            option2.data = [];
            table.render(option2);
 
            //#endregion
 
 
            //#region 进入页面即加载
 
            //判断是否登录 未登录则跳到登录页
            get_LoginIs();
 
            //获取页面跳转参数
            var params = get_UrlVars();
            if (typeof (params[params[0]]) == "undefined") {
                var OperationType = 1;//操作类型
            } else {
                var OperationType = params[params[0]];//操作类型
                var linterid = params[params[1]];//源单id
                var HSouceBillType = params[params[2]];//源单类型
            }
            //判断操作类型
            if (OperationType == 1) {//无源单新增
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '3791' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HMainInterID").val(d.data[0].HInterID);
                        $("#HMainBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                        $("#HMakeDate").val(Pub_Format(new Date(), "yyyy-MM-dd hh:mm:ss"));
                        $("#HMaker").val(sessionStorage["HUserName"]);
                        layer.close(ajaxLoad);
                    }
                });
            }
            else if (OperationType == 2) {//有源单新增
 
            }
            else if (OperationType == 3) {//编辑
 
            }
            else if (OperationType == 4) {//浏览
 
            }
            else {
                layer.alert("未知操作类型!", { icon: 5 });
            }
 
            //#endregion
 
 
            //#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
 
            //#region 选择生产资源按钮
            form.on('submit(get_checkSource)', function () {
                get_checkSource();
            });
            //#endregion
 
            //#region 选择班组按钮
            form.on('submit(get_checkGroup)', function () {
                get_checkGroup();
            });
            //#endregion
 
            //#region 选择操作员按钮
            form.on('submit(get_checkEmp)', function () {
                get_checkEmp();
            });
            //#endregion
 
            //#region 选择检验员按钮
            form.on('submit(get_checkEmp2)', function () {
                get_checkEmp2();
            });
            //#endregion
 
 
 
            //行内事件
            table.on('tool(mainTable1)', function (obj) {
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                    layer.confirm('真的删除行吗?', function (index) {
                            obj.del();
                            option1.data = table.cache["mainTable1"];//将数据绑定到data上
                            table.reload(option1);
                            layer.close(index);
                    });
                }
            })
 
 
 
            form.on('submit(HEmployeeID-BT1)', function () {
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            form.on('submit(HEmployeeID-BT2)', function () {
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker2', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            form.on('submit(HEmployeeID-BT3)', function () {
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker3', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            form.on('submit(HEmployeeID-BT4)', function () {
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker4', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            form.on('submit(HEmployeeID-BT5)', function () {
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker5', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            form.on('submit(HEmployeeID-BT6)', function () {
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker6', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            form.on('submit(HEmployeeID-BT7)', function () {
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker7', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            form.on('submit(HEmployeeID-BT8)', function () {
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker8', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
                    
 
            //#region 扫条形码(流转卡)
            $('#HBarCode').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    if ($("#HProcNo").val() == "") {
                        layer.msg("请输入流水号!", { icon: 7 });
                        $("#HBarCode").val("");
                        return;
                    }
                    if ($("#HEmpID").val() == 0) {
                        layer.msg("请选择操作员!", { icon: 7 });
                        $("#HBarCode").val("");
                        return;
                    }
                    if ($("#HQty").val() == "") {
                        layer.msg("请先填写合格数量!", { icon: 7 });
                        $("#HBarCode").val("");
                        return;
                    }
                    if ($("#HQCCheckID").val() == 0) {
                        layer.msg("请选择检验员!", { icon: 7 });
                        $("#HBarCode").val("");
                        return;
                    }
                    if ($("#HGroupID").val() == 0) {
                        layer.msg("请选择班组!", { icon: 7 });
                        $("#HBarCode").val("");
                        return;
                    }
                    if ($("#HSourceID").val() == 0) {
                        layer.msg("请选择生产资源!", { icon: 7 });
                        $("#HBarCode").val("");
                        return;
                    }
                    txtHBarCode_KeyDown($("#HBarCode").val());
                }
            });
            //#endregion
 
            form.on('submit(Serach)', function (data) {
                var HMaterName = $("#HMaterName").val();
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/LEMS/Sc_StationOutBill_Mul_RYQ',
                    type: "GET",
                    data: { "HMaterName": HMaterName, "HOrgID": sessionStorage["OrganizationID"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option1.data = data1.data;
                            table.render(option1);
                            layer.close(ajaxLoad);
                            //layer.alert("查询成功", { icon: 1 });
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            });
 
 
 
            form.on('submit(Serach)', function (data) {
                var HMaterName = $("#HMaterName").val();
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/LEMS/Sc_StationOutBill_Mul_RYQ',
                    type: "GET",
                    data: { "HMaterName": HMaterName, "HOrgID": sessionStorage["OrganizationID"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option1.data = data1.data;
                            table.render(option1);
                            layer.close(ajaxLoad);
                            //layer.alert("查询成功", { icon: 1 });
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            });
 
 
            //#region 提交按钮(保存)
            form.on('submit(set_SaveBarCode)', function (data) {//提交
 
                var HBillNo = $("#HMainBillNo").val();
                sSubStr = table.cache["mainTable1"];
                var sSubStr = JSON.stringify(sSubStr);
                var sSubStr = sSubStr + ';' + HBillNo;
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "/Cj_StationOutBill/AddBill_Mul",
                    async: true,
                    data: { "oMain": sSubStr },
                    dataType: "json",
                    success: function (result)
                    {
                        if (result.count == 1)
                        {
                            layer.close(index);
                            layer.msg("扫码出站成功!", { icon: 6 });
                        }
                        else
                        {
                            layer.close(index);
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err)
                    {
                        layer.close(index);
                        layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            });
            //#endregion
 
            //#region 退出按钮
            form.on('submit(Cancel)', function () {
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    if (OperationType == 1) {
                        Pub_Close(2);
                    } else if (OperationType == 2) {
                        Pub_Close(1);
                    }
                });
            })
            //#endregion
 
            //#region 行内事件
            //table.on('tool(mainTable1)', function (obj) {
            //    var rowData = obj.data;
            //    //删除单据
            //    if (obj.event === 'del') {
            //        layer.confirm('确定删除' + rowData.HBillNo + '吗?', function (index) {
            //            var ajaxLoad = layer.load();
            //            //逻辑删除方法
            //            $.ajax({
            //                url: GetWEBURL() + '/Cj_StationOutBill/del_StationOutBill',
            //                type: "GET",
            //                data: { "HInterID": rowData.HInterID, "HDeleteMan": sessionStorage["HUserName"] },
            //                success: function (result) {
            //                    if (result.count == 1) {
            //                        get_BarCodeDetail();
            //                        HqtyBill--;
            //                        $("#HqtyBill").val(HqtyBill);
            //                        layer.close(ajaxLoad);
            //                        layer.alert(result.Message, { icon: 6 });
            //                    } else {
            //                        layer.close(ajaxLoad);
            //                        layer.alert(result.Message, { icon: 5 });
            //                    }
            //                }, error: function () {
            //                    layer.close(ajaxLoad);
            //                    layer.alert("接口请求失败!", { icon: 5 });
            //                }
            //            });
            //            layer.close(index);
            //        });
            //    }
            //});
            //#endregion
 
            //#region 流水号回车方法
            //$('#HProcNo').on('keydown', function (event) {
            //    if (event.keyCode == 13) {
            //        $("#HProcNo").attr("readonly", "readonly");
            //        $("#HProcNo").css("background-color", "#efefef4d");
            //        $("#HBarCode").focus();
            //    }
            //});
            //#endregion
 
            //#endregion
 
 
            //#region 本页面所有被调用的方法
 
            //#region 判断是否登录 未登录则跳到登录页
            function get_LoginIs() {
                if (sessionStorage.login != "login") {
                    layer.confirm("登录失效,请重新登录!", {
                        icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
                    }, function () { window.location.href = "../../user/login.html"; });
                }
            }
            //#endregion
 
            //#region 选择生产资源方法
            //function get_checkSource() {
            //    layer.open({
            //        type: 2//弹窗类型
            //        , skin: 'layui-layer-rim' //加上边框
            //        , area: ['90%', '90%']//大小
            //        , title: '生产资源列表'//标题
            //        , shift: 2//弹出动画
            //        , content: ['../../PublicPage/SourceInformation.html', 'yes']
            //        , btn: ['确定', '取消']
            //        , btn1: function (index, layero) {//按钮【按钮一】的回调
            //            var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
            //            var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
            //            if (checkStatus.data.length === 0) {
            //                return layer.msg('请选择数据');
            //            }
            //            $("#HSourceName").val(checkStatus.data[0].HName);
            //            $("#HSourceID").val(checkStatus.data[0].HItemID);
            //            layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
            //        }
            //        , btn2: function (index, layero) { }
            //    });
            //}
            //#endregion
 
            //#region 选择班组方法
            //function get_checkGroup() {
            //    layer.open({
            //        type: 2//弹窗类型
            //        , skin: 'layui-layer-rim' //加上边框
            //        , area: ['90%', '90%']//大小
            //        , title: '班组列表'//标题
            //        , shift: 2//弹出动画
            //        , content: ['../../PublicPage/GroupInformation.html', 'yes']
            //        , btn: ['确定', '取消']
            //        , btn1: function (index, layero) {//按钮【按钮一】的回调
            //            var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
            //            var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
            //            if (checkStatus.data.length === 0) {
            //                return layer.msg('请选择数据');
            //            }
            //            $("#HGroupName").val(checkStatus.data[0].HName);
            //            $("#HGroupID").val(checkStatus.data[0].HItemID);
            //            layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
            //        }
            //        , btn2: function (index, layero) { }
            //    })
            //}
            //#endregion
 
            //#region 选择操作员方法
            //function get_checkEmp() {
            //    layer.open({
            //        type: 2//弹窗类型
            //        , skin: 'layui-layer-rim' //加上边框
            //        , area: ['90%', '90%']//大小
            //        , title: '操作员列表'//标题
            //        , shift: 2//弹出动画
            //        , content: ['../../PublicPage/UserInformation.html', 'yes']
            //        , btn: ['确定', '取消']
            //        , btn1: function (index, layero) {//按钮【按钮一】的回调
            //            var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
            //            var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
            //            if (checkStatus.data.length === 0) {
            //                return layer.msg('请选择数据');
            //            }
            //            $("#HEmpName").val(checkStatus.data[0].HName);
            //            $("#HEmpID").val(checkStatus.data[0].HItemID);
            //            layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
            //        }
            //        , btn2: function (index, layero) { }
            //    })
            //}
            //#endregion
 
            //#region 选择检验员方法
            //function get_checkEmp2() {
            //    layer.open({
            //        type: 2//弹窗类型
            //        , skin: 'layui-layer-rim' //加上边框
            //        , area: ['90%', '90%']//大小
            //        , title: '检验员列表'//标题
            //        , shift: 2//弹出动画
            //        , content: ['../../PublicPage/UserInformation.html', 'yes']
            //        , btn: ['确定', '取消']
            //        , btn1: function (index, layero) {//按钮【按钮一】的回调
            //            var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
            //            var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
            //            if (checkStatus.data.length === 0) {
            //                return layer.msg('请选择数据');
            //            }
            //            $("#HQCCheckName").val(checkStatus.data[0].HName);
            //            $("#HQCCheckID").val(checkStatus.data[0].HItemID);
            //            layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
            //        }
            //        , btn2: function (index, layero) { }
            //    })
            //}
            //#endregion
 
            //#region 扫码保存后调用的显示明细信息方法
            function get_BarCodeDetail() {
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Cj_StationOutBill/get_BarCodeDetail',
                    type: "GET",
                    data: { "HMainInterID": $("#HMainInterID").val()},
                    success: function (data1) {
                        if (data1.count == 1) {
                            option1.data = data1.data;
                            table.render(option1);
                            layer.close(ajaxLoad);
                        } else {
                            option1.data = [];
                            table.render(option1);
                            layer.close(ajaxLoad);
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //#endregion
 
 
            //选择产品弹窗
            form.on('submit(get_checkMater)', function () {//产品
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '物料'
                    , shade: 0.6 //遮罩透明度
                    //, maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_MaterialList.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {
 
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HMaterName").val(checkStatus.data[0].HNumber);
                        $("#HMaterID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    },
                    end: function () {
 
                    },
                    success: function (layero, index) {
 
                    }
                })
            });
 
            //#region 获取流转卡信息
            function txtHBarCode_KeyDown(HBarCode) {
                var index = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Cj_StationEntrustInBill/txtHBarCode_KeyDown",
                    type: "GET",
                    data: { "HBarCode": HBarCode },
                    success: function (result) {
                        if (result.count == 1) {
                            var data = result.data[0];
                            $("#HICMOInterID").val(data.hicmointerid);
                            $("#HICMOBillNo").val(data.任务单号);
                            $("#HMaterID").val(data.HMaterID);
                            $("#HMaterName").val(data.产品);
                            $("#HMaterNumber").val(data.产品代码);
                            $("#HMaterModel").val(data.规格型号);
                            $("#HPieceQty").val(data.流转卡数量);
                            $("#HPlanQty").val(data.流转卡数量);
                            $("#HProcExchBillNo").val(data.单据号);
                            $("#HICMOQty").val(data.任务单数量);
                            $("#lngBillKey").val(data.hmainid);
                            $("#HOrderProcNO").val(data.订单跟踪号);
                            layer.close(index);
                            $("#HProcNo").attr("readonly", "readonly");
                            $("#HProcNo").css("background-color", "#efefef4d");
                            txtHProcNo_KeyDown(HBarCode, $("#HProcNo").val());
                        }
                        else {
                            layer.close(index);
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            }
            //#endregion
 
 
 
            table.on('tool(mainTable1)', function (obj) {
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'edit') {
                    var HBillNo = data.单据号;
                    var HProcName = data.工序名称;
                    $.ajax({
                        url: GetWEBURL() + '/LEMS/Mul_RYQ_DisPlayBillList',
                        type: "GET",
                        data: { "HBillNo": HBillNo, "HProcName": HBillNo},
                        success: function (data1) {
                            if (data1.count == 1) {
                                option2.data = data1.data;
                                table.render(option2);
                                layer.close(ajaxLoad);
                                //layer.alert("查询成功", { icon: 1 });
                            } else {
                                layer.close(ajaxLoad);
                                layer.alert(data1.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.close(ajaxLoad);
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
            })
 
            //#region 获取流水号信息
            function txtHProcNo_KeyDown(sBillNo, sProcNo) {
                var index = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Cj_StationInBill/txtHProcNo_KeyDown",
                    type: "GET",
                    data: { "sBillNo": sBillNo, "sProcNo": sProcNo },
                    success: function (result) {
                        if (result.count == 1) {
                            var data = result.data[0];
                            $("#lngBillSubKey").val(data.hsubid);
                            $("#HProcName").val(data.工序);
                            $("#HProcID").val(data.HProcID);
                            $("#HCenterName").val(data.工作中心);
                            $("#HCenterID").val(data.HCenterID);
                            layer.close(index);
                            //获取单据ID
                            var ajaxLoad = layer.load();
                            $.ajax({
                                url: GetWEBURL() + "/Web/GetMAXNum",
                                type: "GET",
                                data: { "HBillType": '3791' },
                                success: function (d) {
                                    //console.log(d.data);
                                    $("#HInterID").val(d.data[0].HInterID);
                                    $("#HBillNo").val($("#HMainBillNo").val() + "-" + HMainEntryRow);
                                    layer.close(ajaxLoad);
                                    //保存
                                    $("#set_SaveBarCode").click();
                                }
                            });
                        }
                        else {
                            layer.close(index);
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            }
            //#endregion
 
            //#endregion
 
           
            //以上为layui模块
        });
        function GetHWorkerValue(obj) {
            $("#HEmpName1").val(obj[0].HName);
            $("#HEmpID1").val(obj[0].HItemID);
        }
        function GetHWorkerValue2(obj) {
            $("#HEmpName2").val(obj[0].HName);
            $("#HEmpID2").val(obj[0].HItemID);
        }
        function GetHWorkerValue3(obj) {
            $("#HEmpName3").val(obj[0].HName);
            $("#HEmpID3").val(obj[0].HItemID);
        }
        function GetHWorkerValue4(obj) {
            $("#HEmpName4").val(obj[0].HName);
            $("#HEmpID4").val(obj[0].HItemID);
        }
        function GetHWorkerValue5(obj) {
            $("#HEmpName5").val(obj[0].HName);
            $("#HEmpID5").val(obj[0].HItemID);
        }
        function GetHWorkerValue6(obj) {
            $("#HEmpName6").val(obj[0].HName);
            $("#HEmpID6").val(obj[0].HItemID);
        }
        function GetHWorkerValue7(obj) {
            $("#HEmpName7").val(obj[0].HName);
            $("#HEmpID7").val(obj[0].HItemID);
        }
        function GetHWorkerValue8(obj) {
            $("#HEmpName8").val(obj[0].HName);
            $("#HEmpID8").val(obj[0].HItemID);
        }
    </script>
</body>
</html>