wtt
2025-03-17 980207d432914dce2d63a4358db2a5fcdcc7434f
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
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <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, maximum-scale=1">
    <title>工序单品返修台</title>
    <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>-->
    <script type="text/javascript" src="../../../layuiadmin/lib/extend/echarts.min.js"></script>
    <script src="../../CreateControl.js"></script>
    <style>
        .tr1-1 {
            /*  margin-left: 3%;
            margin-top: 4%;*/
            height: 360px;
            /*background-color: #99f6a733;*/
            border: 1px solid rgb(0 0 0 / 10%);
            /*width: 95%;*/
        }
    </style>
</head>
<body>
    <div class="layui-fluid" style="padding: 0;">
        <div class="layui-card" style="padding: 2px;background-color: #efefef;">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
                    <div style="padding: 2px; ">
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnPrint" id="btnPrint">打印</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnAdd" id="btnAdd">新增</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnCancel" id="btnCancel">退出</button>
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill" style="width: 49.5%; float: left; background-color: white;height:450px;">
                        <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">
                                    <div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">生产订单</label>
                                                <div class="layui-input-block" style="margin-left: 120px;">
                                                    <input type="text" class="layui-input" lay-verify="HICMOBillNo" name="HICMOBillNo" id="HICMOBillNo" style="background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HICMOInterID" id="HICMOInterID" lay-verify="HICMOInterID" value="0">
                                                    <input type="hidden" name="HICMOEntryID" id="HICMOEntryID" lay-verify="HICMOEntryID" value="0">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">工序流转卡</label>
                                                <div class="layui-input-block" style="margin-left: 120px;">
                                                    <input type="text" class="layui-input" lay-verify="HProcExchBillNo" name="HProcExchBillNo" id="HProcExchBillNo" style="background-color:#efefef4d;" readonly>
                                                </div>
                                            </div>
 
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">产品代码</label>
                                                <div class="layui-input-block" style="margin-left: 120px;">
                                                    <input type="text" class="layui-input" lay-verify="HMaterNumber" name="HMaterNumber" id="HMaterNumber" style="background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HMaterID" id="HMaterID" lay-verify="HMaterID" value="0">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">产品名称</label>
                                                <div class="layui-input-block" style="margin-left: 120px;">
                                                    <input type="text" class="layui-input" lay-verify="HMaterName" name="HMaterName" id="HMaterName" style="background-color:#efefef4d;" readonly>
                                                </div>
                                            </div>
 
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">规格型号</label>
                                                <div class="layui-input-block" style="margin-left: 120px;">
                                                    <input type="text" class="layui-input" lay-verify="HMaterModel" name="HMaterModel" id="HMaterModel" style="background-color:#efefef4d;" readonly>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">计量单位</label>
                                                <div class="layui-input-block" style="margin-left: 120px;">
                                                    <input type="text" class="layui-input" lay-verify="HUnitName" name="HUnitName" id="HUnitName" style="background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HUnitID" id="HUnitID" lay-verify="HUnitID" value="0">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px; padding: 9px 18px;">生产资源</label>
                                                <div class="layui-input-block" style="margin-left: 77px;">
                                                    <input type="text" class="layui-input" name="HSourceName" id="HSourceName" lay-verify="HSourceName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                    <input type="hidden" class="layui-input" name="HSourceID" lay-verify="HSourceID" id="HSourceID" value="0">
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHSource" id="btnHSource" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">日期</label>
                                                <div class="layui-input-block" style="margin-left: 120px; width:180px;">
                                                    <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 80px;">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">维修工位</label>
                                                <div class="layui-input-block" style="margin-left: 120px;">
                                                    <input type="text" class="layui-input" lay-verify="HWorkStationName" name="HWorkStationName" id="HWorkStationName" style="background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HWorkStationID" id="HWorkStationID" lay-verify="HWorkStationID" value="0">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px; padding: 9px 18px;">维修工序</label>
                                                <div class="layui-input-block" style="margin-left: 77px;">
                                                    <input type="text" class="layui-input" name="HProName" id="HProName" lay-verify="HProName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                    <input type="hidden" class="layui-input" name="HProcess" lay-verify="HProcess" id="HProcess" value="0">
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHProcess" id="btnHProcess" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px; padding: 9px 18px;">不良工序</label>
                                                <div class="layui-input-block" style="margin-left: 77px;">
                                                    <input type="text" class="layui-input" name="HBadProcName" id="HBadProcName" lay-verify="HBadProcName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                    <input type="hidden" class="layui-input" name="HBadProcID" lay-verify="HBadProcID" id="HBadProcID" value="0">
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHBadProc" id="btnHBadProc" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">生产组织<label style="color:red"> * </label></label>
                                                <div class="layui-input-block" style="margin-left: 120px;width:501px;">
                                                    <input type="text" class="layui-input" lay-verify="HOrgName" name="HOrgName" id="HOrgName" style="background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HProdOrgID" id="HProdOrgID" lay-verify="HProdOrgID" value="0">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">维修部门</label>
                                                <div class="layui-input-block" style="margin-left: 120px;width:501px;">
                                                    <input type="text" class="layui-input" lay-verify="HDeptName" name="HDeptName" id="HDeptName" style="background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;"></label>
                                                <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
                                                    <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="ChangeMater" id="ChangeMater"> 换&nbsp;&nbsp;配&nbsp;&nbsp;件</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab" style="width: 50%; float: left; background-color: white; margin-left: 0.5%; height: 450px;">
                        <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" style="padding-top: 10px;">
                                    <div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">条形码</label>
                                                <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
                                                    <input type="text" class="layui-input" lay-verify="HBarCodeSN" autocomplete="off" name="HBarCodeSN" id="HBarCodeSN">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">单据号</label>
                                                <div class="layui-input-block" style="margin-left: 120px;">
                                                    <input type="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID">
                                                    <input type="hidden" name="HEntryID" id="HEntryID" lay-verify="HEntryID" value="0">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">维修人</label>
                                                <div class="layui-input-block" style="margin-left: 77px;">
                                                    <input type="text" class="layui-input" lay-verify="HEmpName" name="HEmpName" id="HEmpName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                    <input type="hidden" name="HEmpID" id="HEmpID" lay-verify="HEmpID" value="0">
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHEmp" id="btnSearchHEmp" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">不良原因</label>
                                                <div class="layui-input-block" style="margin-left: 77px;">
                                                    <input type="text" class="layui-input" lay-verify="HBadReasonName" name="HBadReasonName" id="HBadReasonName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                    <input type="hidden" name="HBadReasonID" id="HBadReasonID" lay-verify="HBadReasonID" value="0">
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHBadReason" id="btnSearchHBadReason" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">不良类型</label>
                                                <div class="layui-input-block" style="margin-left: 77px;">
                                                    <input type="text" class="layui-input" lay-verify="HBadTypeName" name="HBadTypeName" id="HBadTypeName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                    <input type="hidden" name="HBadTypeID" id="HBadTypeID" lay-verify="HBadTypeID" value="0">
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHBadTypeID" id="btnHBadTypeID" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">不良后果</label>
                                                <div class="layui-input-block" style="margin-left: 77px;">
                                                    <input type="text" class="layui-input" lay-verify="HBadResultName" name="HBadResultName" id="HBadResultName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                    <input type="hidden" name="HBadResultID" id="HBadResultID" lay-verify="HBadResultID" value="0">
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHBadResult" id="btnHBadResult" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <!--<div class="layui-inline" style="width:300px;">
                                                <label class="layui-form-label" style="width: 85px;">维修结果</label>
                                                <div class="layui-input-block" style="margin-left: 120px; width: 180px;">
                                                    <select name="HRepairResult" id="HRepairResult" lay-filter="HRepairResult" style="width: 180px;">
                                                        <option style="color:blue;" selected="selected" value="OK">OK</option>
                                                        <option style="color:blue;" value="NG">NG</option>
                                                    </select>
                                                </div>
                                            </div>-->
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">产品MAC</label>
                                                <div class="layui-input-block" style="margin-left: 120px;">
                                                    <input type="text" class="layui-input" lay-verify="HProdMac" name="HProdMac" id="HProdMac" style="background-color:#efefef4d;" readonly>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">产品SN</label>
                                                <div class="layui-input-block" style="margin-left: 120px;">
                                                    <input type="text" class="layui-input" lay-verify="HBarCode" name="HBarCode" id="HBarCode" style="background-color:#efefef4d;" readonly>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">备注</label>
                                                <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
                                                    <input type="text" class="layui-input" lay-verify="HRemark" name="HRemark" id="HRemark">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <div>
                                                    <input type="hidden" name="HCreator" id="HCreator" lay-verify="HCreator">
                                                    <input type="hidden" name="HCreateDate" id="HCreateDate" lay-verify="HCreateDate">
 
                                                    <input type="hidden" name="HProcExchInterID" id="HProcExchInterID" lay-verify="HProcExchInterID" value="0">
                                                    <input type="hidden" name="HProcExchEntryID" id="HProcExchEntryID" lay-verify="HProcExchEntryID" value="0">
                                                    <input type="hidden" name="HSourceInterID" id="HSourceInterID" lay-verify="HSourceInterID" value="0">
                                                    <input type="hidden" name="HSourceEntryID" id="HSourceEntryID" lay-verify="HSourceEntryID" value="0">
                                                    <input type="hidden" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" value="">
                                                    <input type="hidden" name="HSourceBillType" id="HSourceBillType" lay-verify="HSourceBillType" value="">
                                                    <input type="hidden" name="HRelationQty" id="HRelationQty" lay-verify="HRelationQty" value="0">
                                                    <input type="hidden" name="HRelationMoney" id="HRelationMoney" lay-verify="HRelationMoney" value="0">
 
                                                    <input type="hidden" name="HMacAddr" id="HMacAddr" lay-verify="HMacAddr">
                                                    <input type="hidden" name="HIPAddr" id="HIPAddr" lay-verify="HIPAddr">
 
                                                    <!--记录子页面(更换配件)子表的临时数据-->
                                                    <input type="hidden" name="subMaterList_Temp" id="subMaterList_Temp" lay-verify="subMaterList_Temp">
 
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;"></label>
                                                <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
                                                    <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="NGSave" id="NGSave">NG保存</button>
                                                    <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="OKSave" id="OKSave">OK保存</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab" style="width: 49.5%; float: left; background-color: white;margin-top:0.5%;">
                        <div class="layui-row">
                            <div class="tr1-1" id="mychart1"> </div>
                        </div>
                    </div>
                    <div class="layui-tab" style="width: 50%; float: left; margin-left: 0.5%; margin-top: 0.5%; background-color: white; ">
                        <ul class="layui-tab-title">
                            <li class="layui-this">返修记录</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                <!--返修记录-->
                                <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</body>
</html>
<!--子表表:删除-->
<script type="text/html" id="barDemo">
    <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</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
                , element = layui.element
                , laypage = layui.laypage
                , laydate = layui.laydate
                , tree = layui.tree
            var titleData = ["HInterID", "HEntryID", "HBadReasonID", "HSourceInterID","HSourceEntryID"];//子表不需要显示的字段 可扩展
            var hpj =0;
            //#endregion
 
            //#region 进入页面即加载
            //初始化界面
            set_ClearBill();
            //#endregion
 
            //#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
 
            //条形码回车方法
            $('#HBarCodeSN').on('keydown', function (event) {
                var HBarCode = $('#HBarCodeSN').val();
                if (event.keyCode == 13) {
                    if ($("#HSourceID").val() == "0") {
                        layer.msg("生产资源不能为空!")
                        return;
                    }
                    if ($("#HProcess").val() == "0"){
                        layer.msg("维修工序不能为空!")
                        return;
                    }
                    if ($("#HBadProcID").val() == "0"){
                        layer.msg("不良工序不能为空!")
                        return;
                    }
 
                    if (!HBarCode) {
                        layer.msg("条形码不能为空!")
                        return;
                    } else {
                        if (HBarCode.length != 29 && HBarCode.length != 50) {
                            layer.alert("子件条码长度不为29位或50位!", { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                            return;
                        }
 
                        if (HBarCode.match(/[^\x00-\xff]/g) != null) {
                            layer.alert("必须是半角字符!", { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                            return;
                        }
                    }
                    txtHBarCode_KeyDown(HBarCode);
                    
                }
            });
 
            //选择不良原因按钮
            form.on('submit(btnSearchHBadReason)', function () {
                get_checkSearchHBadReason();
            });
 
            //选择不良类型按钮
            form.on('submit(btnHBadTypeID)', function () {
                get_btnHBadTypeID();
            });
 
            //选择不良后果按钮
            form.on('submit(btnHBadResult)', function () {
                btnHBadResult();
            });
 
 
            // 换配件
            form.on('submit(ChangeMater)', function (data) {
                get_checkSearchChangeMater();
            });
 
 
            //选择生产资源
            form.on('submit(btnHSource)', function () {
                btnHSource();
            });
 
            //选择维修工序按钮
            form.on('submit(btnHProcess)', function () {
                btnHProc(0);
            });
 
            //选择不良工序按钮
            form.on('submit(btnHBadProc)', function () {
                btnHProc(1);
            });
 
            //子表行内事件
            table.on('tool(mainTable)', function (obj) {
                set_GridDelete(obj);   //行内删除
            });
 
            // NG保存
            form.on('submit(NGSave)', function (data) {
                if (AllowLoadData()) {
                    get_Save(data, "NG");
                }
              
            });
 
            // OK保存
            form.on('submit(OKSave)', function (data) {
                if (AllowLoadData()) {
                    get_Save(data, "OK");
                }
            });
 
            //#endregion
 
            //#region 此页面所有的方法
            //初始化界面
            function set_ClearBill() {
                $('#btnAdd').addClass("layui-btn-disabled").attr("disabled", true);
                //初始化单据
                createBillNo();
                var mychart1 = echarts.init(document.getElementById('mychart1'));
                get_Display();
                get_Histogram1(mychart1);//柱状图1
                get_UsreList();
                get_ReadConfigFile();
            }
 
            // 生成单据号
            function createBillNo() {
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    async: false,
                    type: "GET",
                    data: { "HBillType": '3748' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                    }
                });
            }
 
            //柱状图1
            function get_Histogram1(mychart1) {
 
                //生产负荷
                var optionData = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
 
                //$.ajax({
                //    url: GetWEBURL() + "/loaddata/KB_scfh",
                //    dataType: "JSON",
                //    async: false,//使用同步的方式,true为异步方式
                //    type: "Get",
                //    data: { "LineCode": "1" },
                //    success: function (res) {
 
                //        for (var i = 0; i < res.data[0].length; i++) {
                //            if (res.data[0][i].HProcID == 191) {//缸厂
                //                optionData[0] = (res.data[0][i].HQty / 1000).toFixed(0);
                //            } else if (res.data[0][i].HProcID == 193) {//烘干定型
                //                optionData[1] = (res.data[0][i].HQty / 1000).toFixed(0);
                //            }
                //            else if (res.data[0][i].HProcID == 194) {//上浆定型
                //                optionData[2] = (res.data[0][i].HQty / 1000).toFixed(0);
                //            }
                //            else if (res.data[0][i].HProcID == 198) {//色坯烫光
                //                optionData[3] = (res.data[0][i].HQty / 1000).toFixed(0);
                //            }
                //            else if (res.data[0][i].HProcID == 204) {//预烫剪
                //                optionData[4] = (res.data[0][i].HQty / 1000).toFixed(0);
                //            }
                //            else if (res.data[0][i].HProcID == 197) {//补刷
                //                optionData[5] = (res.data[0][i].HQty / 1000).toFixed(0);
                //            }
                //            else if (res.data[0][i].HProcID == 201) {//印毛尖
                //                optionData[6] = (res.data[0][i].HQty / 1000).toFixed(0);
                //            }
                //            else if (res.data[0][i].HProcID == 200) {//拉幅定型
                //                optionData[7] = (res.data[0][i].HQty / 1000).toFixed(0);
                //            }
                //            else if (res.data[0][i].HProcID == 206) {//短线烫
                //                optionData[8] = (res.data[0][i].HQty / 1000).toFixed(0);
                //            }
                //            else if (res.data[0][i].HProcID == 205) {//长线烫
                //                optionData[9] = (res.data[0][i].HQty / 1000).toFixed(0);
                //            }
                //        }
                //    }
                //})
 
                var option = {
                    xAxis: {
                        type: 'category',
                        data: ['缸染', '烘干定型', '上浆定型', '色坯烫光', '预烫剪', '补刷', '印毛尖', '拉幅定型', '短线烫', '长线烫']
                    },
                    yAxis: {
                        type: 'value'
                    },
                    axisLabel: {
                        show: true,
                        interval: 0,
                        color: '#15b1fa',
                        formatter: function (value) {
                            var ret = "";//拼接加\n返回的类目项
                            var maxLength = 1;//每项显示文字个数
                            var valLength = value.length;//X轴类目项的文字个数
                            var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
                            if (rowN > 1)//如果类目项的文字大于3,
                            {
                                for (var i = 0; i < rowN; i++) {
                                    var temp = "";//每次截取的字符串
                                    var start = i * maxLength;//开始截取的位置
                                    var end = start + maxLength;//结束截取的位置
                                    //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
                                    temp = value.substring(start, end) + "\n";
                                    ret += temp; //凭借最终的字符串
                                }
                                return ret;
                            }
                            else {
                                return value;
                            }
                        }
                    },
                    series: [
                        {
                            //data: optionData,
                            data: [23, 14, 45, 56, 12, 35, 64, 34, 62, 75],
                            type: 'bar',
                            label: {
                                normal: {
                                    show: true,
                                    position: 'top',
                                    formatter: function (params) {
                                        return echarts.format.addCommas(params.value);
                                    }
                                }
                            }
                            , itemStyle: {
                                // 设置柱形的颜色
                                normal: {
                                    color: '#15b1fa',
                                    label: {
                                        show: true // 在折线拐点上显示数据
                                    }
                                },
                            }
                        }
                    ]
                };
                mychart1.setOption(option);
            }
 
            //查询列表数据
            function get_Display() {
                var HBarCode = $("#HBarCode").val();
                var sWhere = "";
                sWhere = " and SN码='" + HBarCode + "'";
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Cj_SingleStation/ProcessItemRepair",
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                           
                            var data = [];
                            var col = [];
                            //给空的数组赋值
                            for (var key in data1.list) {
                                data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                            }
                            //在列表左边添加勾选框
                            col.push({ type: 'checkbox', fixed: 'left' });
                            col.push({ type: 'numbers', title: '序号', style: 'background-color: #f9f9f9;' });
                            for (var i = 0; i < data.length; i++) {
                                // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                                if ($.inArray(data[i].name, titleData) > -1) {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                }
                                else {
                                    switch (data[i].Type) {
                                        //int
                                        case 'DateTime':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 110 });
                                            break;
                                        case 'long':
                                        case 'Int32':
                                        case 'Int64':
                                        case 'double':
                                        case 'Decimal':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
                                            break;
                                        default:
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 110 });
                                    }
                                }
                            }
                            col.push({ fixed: 'right', title: '操作', toolbar: '#barDemo' });
 
                            var option = {
                                elem: '#mainTable'
                                //, toolbar: '#toolbarDemo'
                                , page: false
                                //, totalRow: true
                                , cellMinWidth: 120
                                , limit: 50
                                , height: 300
                            }
 
                            option.cols = [col];
                            option.data = data1.data;
                            table.render(option);
                            //刷新表格数据
                            //DisPlay_HideColumn();
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                })
            }
 
            //读取配置文件
            function get_ReadConfigFile() {
                //获取本地存储的数据
                var data = localStorage.getItem("Cj_ProcessItemBGA");
                if (data != null) {
                    var data2 = JSON.parse(data);
                    $("#HSourceID").val(data2["HSourceID"]);
                    $("#HSourceName").val(data2["HSourceName"]);
                    $("#HBadProcID").val(data2["HBadProcID"]);
                    $("#HBadProcName").val(data2["HBadProcName"]);
                    $("#HBadReasonID").val(data2["HBadReasonID"]);
                    $("#HBadReasonName").val(data2["HBadReasonName"]);
                    $("#HBadTypeID").val(data2["HBadTypeID"]);
                    $("#HBadTypeName").val(data2["HBadTypeName"]);
                }
            }
 
            //存储配置文件
            function get_WriteConfigFile() {
                //清空本地存储的数据
                localStorage.removeItem("Cj_ProcessItemBGA");
                var data = {
                    HSourceID: $("#HSourceID").val()
                    , HSourceName: $("#HSourceName").val()
                    , HBadProcID: $("#HBadProcID").val()
                    , HBadProcName: $("#HBadProcName").val()
                    , HBadReasonID: $("#HBadReasonID").val()
                    , HBadReasonName: $("#HBadReasonName").val()
                    , HBadTypeID: $("#HBadTypeID").val()
                    , HBadTypeName: $("#HBadTypeName").val()
                }
                //本地存储
                localStorage.setItem("Cj_ProcessItemBGA", JSON.stringify(data));
            }
 
            //查询用户关联数据
            function get_UsreList() {
                var sWhere = " and 编码='" + sessionStorage["Czybm"] + "'";
                var ajaxLoad = layer.load();
                //进入页面显示的缓存列表
                $.ajax({
                    url: GetWEBURL() + '/Cj_SingleStation/Cj_CollectionOfSingleProductDefectsUserList',
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
 
                            $("#HDeptID").val(data1.data[0]["HDeptID"]);
                            $("#HDeptName").val(data1.data[0]["车间"]);
                            $("#HProName").val(data1.data[0]["工序"]);
                            $("#HProcess").val(data1.data[0]["HProcID"]);
                            $("#HSourceID").val(data1.data[0]["HSourceID"]);
                            $("#HSourceName").val(data1.data[0]["生产资源"]);
                            $("#HEmpID").val(data1.data[0]["HEmpID"]);
                            $("#HEmpName").val(data1.data[0]["质检员"]);
                            $("#HCreator").val(data1.data[0]["质检员"]);
                            //$("#HGroupID").val(data1.data[0]["HGroupID"]);
                            //$("#HGroupName").val(data1.data[0]["生产班组"]);
                            layer.close(ajaxLoad);
 
                            //layer.alert("查询成功", { icon: 1 });
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
 
                });
            }
 
            //条码回车查询
            function txtHBarCode_KeyDown(HBarCode) {
 
                var index = layer.load();
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Cj_SingleStation/HFBardCodeList",
                    async: false,
                    data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] },
                    dataType: "json",
                    success: function (data1) {
                        if (data1.count == 1) {
                            layer.close(index);
                            var numHProcess = 0;
                            for (var i = 0; i < data1.data.length; i++) {
                                if (data1.data[i]["HProcID"] == $("#HProcess").val()) {
                                    numHProcess = data1.data[i]["HProcExchEntryID"];
                                    break;
                                }
                            }
 
                            $("#HICMOBillNo").val(data1.data[0]["生产订单"]);
                            $("#HICMOInterID").val(data1.data[0]["HICMOInterID"]);
                            $("#HICMOEntryID").val(data1.data[0]["HICMOEntryID"]);
                            $("#HProcExchBillNo").val(data1.data[0]["工序流转卡"]);
                            $("#HProcExchInterID").val(data1.data[0]["HSourceInterID"]);
                            $("#HProcExchEntryID").val(numHProcess);
                            $("#HUnitID").val(data1.data[0]["HUnitID"]);
                            $("#HUnitName").val(data1.data[0]["单位"]);
                            $("#HOrgName").val(data1.data[0]["组织"]);
                            $("#HProdOrgID").val(data1.data[0]["HPRDORGID"]);
                            $("#HMaterNumber").val(data1.data[0]["物料编码"]);
                            $("#HMaterID").val(data1.data[0]["HMaterID"]);
                            $("#HMaterName").val(data1.data[0]["物料名称"]);
                            $("#HMaterModel").val(data1.data[0]["规格型号"]);
                            $("#HBarCode").val(data1.data[0]["条码"]);
                            if (data1.data[0]["HBadReasonID"] != "0") {
                                $("#HBadReasonID").val(data1.data[0]["HBadReasonID"]);
                                $("#HBadReasonName").val(data1.data[0]["不良原因"]);
                                $("#HBadTypeName").val(data1.data[0]["不良类型代码"]);
                                $("#HBadTypeID").val(data1.data[0]["不良类型"]);
                            } 
                          
                            if (data1.data.length != 0) {
                               
                                //$("#HBadTypeID").val();
                                //$("#HBadTypeName").val();
                                //$("#HBadResultID").val();
                                //$("#HBadResultName").val();
                            }
 
                            //查询返修记录
                            get_Display();
                        }
                        else {
                            layer.close(index);
                            layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                        $("#HBarCodeSN").val("");
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            }
 
            //删除方法
            function set_GridDelete(obj) {
                if (obj.event === 'del') {
                    layer.confirm('真的删除行吗?', function (index) {
                        var HInterID = obj.data.HInterID;
                        var HEntryID = obj.data.HEntryID;
 
                        var ajaxLoad = layer.load();
                        $.ajax({
                            url: GetWEBURL() + "/Cj_SingleStation/ProcessItemRepairDel",
                            type: "GET",
                            async: false,
                            data: { "HInterID": HInterID, "HEntryID": HEntryID, "user": sessionStorage["HUserName"],"HBill":"ZB" },
                            success: function (result) {
                                if (result.count == 1) {
                                    layer.msg("删除成功!");
                                    layer.close(ajaxLoad);
                                    //查询返修记录
                                    get_Display();
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                    layer.close(ajaxLoad);
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                                layer.close(ajaxLoad);
                            }
                        })
                    });
                }
            }
 
            //生产资源选择页面
            function btnHSource() {
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '生产资源列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/生产基础资料/Gy_Source.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('请选择数据');
                        }
                        //获取数据
                        $("#HSourceID").val(checkStatus.data[0].HItemID);
                        $("#HSourceName").val(checkStatus.data[0].生产资源名称);
                        get_WriteConfigFile();
 
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            }
 
            //工序选择页面
            function btnHProc(num) {
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '工序列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/生产基础资料/Gy_Process.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 != 1) {
                            return layer.msg('请选择一条数据');
                        }
                        if (num == 0) {
                            //获取数据
                            $("#HProcess").val(checkStatus.data[0].HItemID);//
                            $("#HProName").val(checkStatus.data[0].工序名称);//
                        } else if (num == 1) {
                            $("#HBadProcID").val(checkStatus.data[0].HItemID);//
                            $("#HBadProcName").val(checkStatus.data[0].工序名称);//
                            get_WriteConfigFile();
                        }
                       
 
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            }
 
            //不良原因选择页面
            function get_checkSearchHBadReason() {
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim"                           //加上边框
                    , title: "不良原因列表"                             //标题
                    , closeBtn: 1                                       //窗体右上角关闭 的 样式
                    , shift: 2                                          //弹出动画
                    , area: ["90%", "90%"]                              //窗体大小
                    , maxmin: true                                      //设置最大最小按钮是否显示
                    , content: ["../../../views/基础资料/生产基础资料/Gy_BadReason.html", "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //按钮一  的回调
                        var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
 
                        if (checkStatus.data.length != 1) {
                            return layer.msg("请选择一条数据");
                        }
 
                        $("#HBadReasonID").val(checkStatus.data[0].HItemID);//内码
                        $("#HBadReasonName").val(checkStatus.data[0].不良缺陷名称);//名称
                        $("#HBadTypeName").val(checkStatus.data[0].不良类型);
                        $("#HBadTypeID").val(checkStatus.data[0].不良类型代码);
                        get_WriteConfigFile();
                        layer.close(index);//关闭弹窗
                    }
                    , btn2: function (index, layero) { }
                })
            }
 
            //不良类型选择
            function get_btnHBadTypeID() {
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim"                           //加上边框
                    , title: "不良类型列表"                             //标题
                    , closeBtn: 1                                       //窗体右上角关闭 的 样式
                    , shift: 2                                          //弹出动画
                    , area: ["90%", "90%"]                              //窗体大小
                    , maxmin: true                                      //设置最大最小按钮是否显示
                    , content: ["../../../views/基础资料/生产基础资料/Gy_BadType.html", "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //按钮一  的回调
                        var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
 
                        if (checkStatus.data.length != 1) {
                            return layer.msg("请选择一条数据");
                        }
 
                        $("#HBadTypeID").val(checkStatus.data[0].HItemID);//内码
                        $("#HBadTypeName").val(checkStatus.data[0].不良类型名称);//名称
                        get_WriteConfigFile();
                        layer.close(index);//关闭弹窗
                    }
                    , btn2: function (index, layero) { }
                })
            }
 
            //不良后果选择
            function btnHBadResult() {
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim"                           //加上边框
                    , title: "不良后果列表"                             //标题
                    , closeBtn: 1                                       //窗体右上角关闭 的 样式
                    , shift: 2                                          //弹出动画
                    , area: ["90%", "90%"]                              //窗体大小
                    , maxmin: true                                      //设置最大最小按钮是否显示
                    , content: ["../../../views/基础资料/生产基础资料/Gy_BadResult.html", "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //按钮一  的回调
                        var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
 
                        if (checkStatus.data.length != 1) {
                            return layer.msg("请选择一条数据");
                        }
 
                        $("#HBadResultID").val(checkStatus.data[0].HItemID);//内码
                        $("#HBadResultName").val(checkStatus.data[0].不良后果名称);//名称
                        layer.close(index);//关闭弹窗
                    }
                    , btn2: function (index, layero) { }
                })
            }
 
            //换配件页面
            function get_checkSearchChangeMater() {
                var HBarCode = $("#HBarCode").val();
                if (HBarCode == "") {
                    return layer.msg("请先扫条码!");
                }
 
                if (hpj == 0) {
                    return layer.msg("请先保存返修记录!");
                }
 
                var HInterID = $("#HInterID").val();
                var HBillNo = $("#HBillNo").val();
                var HEmpName = $("#HEmpName").val();
                var HProdMac = $("#HProdMac").val();
                var HSourceInterID = $("#HSourceInterID").val();
                var HSourceEntryID = $("#HSourceEntryID").val();
                var HSourceBillNo = $("#HSourceBillNo").val();
                var HSourceBillType = $("#HSourceBillType").val();
                var HProcExchBillNo = $("#HProcExchBillNo").val();
                var HProcExchInterID = $("#HProcExchInterID").val();
                var HProcExchEntryID = $("#HProcExchEntryID").val();
                var HProcess = $("#HProcess").val();
                var HICMOInterID = $("#HICMOInterID").val();
                var HICMOBillNo = $("#HICMOBillNo").val();
                var HICMOEntryID = $("#HICMOEntryID").val();
 
                var dataParams = {
                    'OperationType': 1
                    , 'HInterID': HInterID
                    , 'HBillNo': HBillNo
                    , 'HMaterSN': HBarCode
                    , 'HEmpName': HEmpName
                    , 'HProdMac': HProdMac
                    , 'HSourceInterID': HSourceInterID
                    , 'HSourceEntryID': HSourceEntryID
                    , 'HSourceBillNo': HSourceBillNo
                    , 'HSourceBillType': HSourceBillType
                    , 'HBarCode': HBarCode
                    , 'HProcExchBillNo': HProcExchBillNo
                    , 'HProcExchInterID': HProcExchInterID
                    , 'HProcExchEntryID': HProcExchEntryID
                    , 'HProcess': HProcess
                    , 'HICMOInterID': HICMOInterID
                    , 'HICMOBillNo': HICMOBillNo
                    , 'HICMOEntryID': HICMOEntryID
                    , 'subMaterList_Temp': $("#subMaterList_Temp").val()
                }
                var datajson = JSON.stringify(dataParams);
                url = encodeURI('../../车间管理/单品过站/Cj_ProcessItemBGA_PJGH.html?OperationType=1&datajson=' + datajson);
 
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim"                           //加上边框
                    , title: "产线返修平台(更换配件)"                             //标题
                    , closeBtn: 1                                       //窗体右上角关闭 的 样式
                    , shift: 2                                          //弹出动画
                    , area: ["90%", "90%"]                              //窗体大小
                    , maxmin: true                                      //设置最大最小按钮是否显示
                    , content: [url, "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        layer.close(index);//关闭弹窗
                    }
                    , btn2: function (index, layero) { }
                })
            }
 
            //保存
            function get_Save(data, HResult) {
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache["mainTable"]);
                var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"] + ";" + HResult;
 
                var index = layer.load();
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "/Cj_SingleStation/HFXAddRepairBill",
                    async: false,
                    data: { "sMainSub": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) {
                            $('#NGSave').addClass("layui-btn-disabled").attr("disabled", true);
                            $('#OKSave').addClass("layui-btn-disabled").attr("disabled", true);
                            $('#btnAdd').removeClass("layui-btn-disabled").attr("disabled", false);
                            layer.close(index);
                            layer.msg("提交成功");
                            hpj = 1;
                            get_Display();
                            var mychart1 = echarts.init(document.getElementById('mychart1'));
                            get_Histogram1(mychart1);//柱状图1
                        }
                        else {
                            layer.close(index);
                            layer.msg(data.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: "温馨提示" });
                    }
                });
            }
 
            //非空验证
            function AllowLoadData(data) {
 
                //var HBarCode = $("#HBarCode").val();
                //if (HBarCode == "") {
                //    layer.msg("产品SN不能为空!")
                //    return false;
                //}
 
                var HBadReasonID = $("#HBadReasonID").val();
                if (HBadReasonID == 0) {
                    layer.msg("不良原因不能为空!")
                    return false;
                }
                return true;
            }
 
            //#endregion
 
        });
</script>