yusijie
2024-08-07 be3ff32c503649df66933a3f625cdf9b0925f62e
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
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <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/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/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/grwebapp.js"></script>
    <script src="../../../layuiadmin/HideButton.js"></script>
    <script src="../../../layuiadmin/soulTable.slim.js"></script>
    <script src="../../../layuiadmin/echarts.min.js"></script>
    <script src="../../../layuiadmin/PlateBinding.js"></script>
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-col-md12">
            <div class="layui-card" style="padding: 1px">
                <div class="layui-card-body" style="padding: 1px;">
                    <form class="layui-form" action="" lay-filter="component-form-group">
                        <div style="width: 65%; height: calc(135vh); float: left; background-color: rgb(255 255 255) ">
                            <div id="top" style="width:100%;height:calc(60vh);">
                                <div id="top-left" style="width: 30%; height: calc(40vh); float: left;">
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 30px;"><span style="font-weight:bolder">设备</span></label>
                                    </div>
                                    <div>
                                        <img src="../../../layuiadmin/layui/images/device.png" onerror="javascript:this.src='../../../layuiadmin/layui/images/erro.png';this.onerror = null" style="width:40%;height:calc(15vh);float:left" />
                                        <div style="float:left;margin-left:5%;">
                                            <dl>
                                                <dd>
                                                    <h2><span style="margin-left:10px;" id="HEquipName"></span></h2>
                                                    <h3><span>设备编号:<span style="margin-left:10px;" id="HEquipCode"></span></span></h3>
                                                    <h3><span>设备状态:<span style="margin-left:10px;" id="HEquipStatus"></span></span></h3>
                                                    <h3><span>运行时间:<span style="margin-left:10px;" id="HWorkTime"></span></span></h3>
                                                    <h3><span>当日点检时间:<span style="margin-left:10px;" id="HDotCheckDate"></span></span></h3>
                                                    <h3><span>最后保养时间:<span style="margin-left:10px;" id="HMaintainDate"></span></span></h3>
                                                </dd>
                                            </dl>
                                        </div>
                                    </div>
                                </div>
                                <div id="center-center" style="width: 15%; height: calc(40vh); float: left; margin-left: 0.2%;">
                                    <div id="chart1" style="width: 75%; height: calc(40vh); left: 2%; float: left;"></div>
                                </div>
                                <div id="center-right" style="width: 500px; height: calc(40vh); float: left;margin-top:5%;">
                                    <div class="layui-row" style="margin-bottom: 30px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">条形码:</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HBarCodeSN" value="" lay-verify="HBarCodeSN" autocomplete="off" placeholder="请键入后回车" id="HBarCodeSN" style="width: 240px;">
                                                <input type="hidden" name="HBarCode" id="HBarCode" value="">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">工序:</label>
                                            <div class="layui-input-block" style="margin-left: 9px;">
                                                <input type="text" class="layui-input" name="HProcName" value="" lay-verify="HProcName" id="HProcName" style="background-color: #efefef4d; width: 43%; display: inline-block;" readonly>
                                                <input type="hidden" name="HProcID" id="HProcID" lay-verify="HProcID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHProcID" id="btnHProcID" 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: 65px;">流水号:</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HProcNo" value="" lay-verify="HProcNo" id="HProcNo" style="width: 150px; background-color: #efefef4d; " readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">合格数量:</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HQty" value="0" lay-verify="HQty" id="HQty" style="width: 150px;">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">生产资源:</label>
                                            <div class="layui-input-block" style="margin-left: 9px;">
                                                <input type="text" class="layui-input" name="HSourceName" value="" lay-verify="HSourceName" id="HSourceName" style="background-color: #efefef4d; width: 43%; display: inline-block;" readonly>
                                                <input type="hidden" name="HSourceID" id="HSourceID" lay-verify="HSourceID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHSourceID" id="btnHSourceID" 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" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">工作中心:</label>
                                            <div class="layui-input-block" style="margin-left: 9px;">
                                                <input type="text" class="layui-input" name="HCenterName" value="" lay-verify="HCenterName" id="HCenterName" style="background-color: #efefef4d; width: 43%; display: inline-block;" readonly>
                                                <input type="hidden" name="HCenterID" id="HCenterID" lay-verify="HCenterID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHCenterID" id="btnHCenterID" 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: 65px;">生产班组:</label>
                                            <div class="layui-input-block" style="margin-left: 9px;">
                                                <input type="text" class="layui-input" name="HGroupName" value="" lay-verify="HGroupName" id="HGroupName" style="background-color: #efefef4d; width: 43%; display: inline-block;" readonly>
                                                <input type="hidden" name="HGroupID" id="HGroupID" lay-verify="HGroupID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHGroupID" id="btnHGroupID" 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" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">操作员:</label>
                                            <div class="layui-input-block" style="margin-left: 9px;">
                                                <input type="text" class="layui-input" name="HEmpName" value="" lay-verify="HEmpName" id="HEmpName" style="background-color: #efefef4d; width: 43%; 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="btnHEmpID" id="btnHEmpID" 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: 65px;">工时</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HWorkTimes" id="HWorkTimes" value="0" style="width: 150px;">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">单据日期:</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="date" class="layui-input" name="HDate" lay-verify="HDate" style="width: 150px;" autocomplete="off" id="HDate">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">单据号:</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HBillNo" value="" lay-verify="HBillNo" style="width: 150px; background-color: #efefef4d; font-size: 12.5px;" autocomplete="off" id="HBillNo" readonly>
                                                <input type="hidden" name="HInterID" id="HInterID">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">生产订单:</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HICMOBillNo" value="" lay-verify="HICMOBillNo" style="width: 150px; background-color: #efefef4d; font-size: 13px;" autocomplete="off" id="HICMOBillNo" readonly>
                                                <input type="hidden" name="HICMOInterID" id="HICMOInterID">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">流转卡:</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HProcExchBillNo" value="" lay-verify="HProcExchBillNo" style="width: 150px; background-color: #efefef4d; font-size: 13px;" autocomplete="off" id="HProcExchBillNo" readonly>
                                                <input type="hidden" class="layui-input" name="lngBillKey" id="lngBillKey">
                                                <input type="hidden" class="layui-input" name="lngBillSubKey" id="lngBillSubKey">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">物料代码:</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HMaterNumber" value="" lay-verify="HMaterNumber" style="width: 150px; background-color: #efefef4d; font-size: 13px;" autocomplete="off" id="HMaterNumber" readonly>
                                                <input type="hidden" class="layui-input" name="HMaterID" id="HMaterID">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">物料名称:</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HMaterName" value="" lay-verify="HMaterName" style="width: 150px; background-color: #efefef4d; font-size: 13px;" autocomplete="off" id="HMaterName" readonly>
 
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">规格型号:</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HMaterModel" value="" lay-verify="HMaterModel" style="width: 150px; background-color: #efefef4d; font-size: 13px;" autocomplete="off" id="HMaterModel" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">计量单位:</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HUnitName" value="" lay-verify="HUnitName" style="width: 150px; background-color: #efefef4d;" autocomplete="off" id="HUnitName" readonly>
                                                <input type="hidden" name="HUnitID" id="HUnitID">
                                                <input type="hidden" name="eventType" id="eventType" value="Add">
                                                <input type="hidden" name="HPRDOrgID" id="HPRDOrgID" value="0">
                                                <input type="hidden" name="HICMOQty" id="HICMOQty" value="0">
                                                <input type="hidden" name="HPlanQty" id="HPlanQty" value="0">
                                                <input type="hidden" name="HLastSubProc" id="HLastSubProc" value="true">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">穴号</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HMouldNum" id="HMouldNum" style="width: 150px;">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">不良数量</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HBadCount" id="HBadCount" value="0" style="width: 150px;">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">遗失数量</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HLossQty" id="HLossQty" value="0" style="width: 150px;">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">取样数量</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HToCheckQty" id="HToCheckQty" value="0" style="width: 150px;">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">报废数量</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HWasterQty" id="HWasterQty" value="0" style="width: 150px;">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">返工数量</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HBackWorkQty" id="HBackWorkQty" value="0" style="width: 150px;">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">工废数量</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HWasterQty_Work" id="HWasterQty_Work" value="0" style="width: 150px;">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">料废数量</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HWasterQty_Mater" id="HWasterQty_Mater" value="0" style="width: 150px;">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">模具编号</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HMouldNo" id="HMouldNo" value="" style="width: 150px;" readonly>
                                                <input type="hidden" class="layui-input" name="HMouldID" id="HMouldID" value="0">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">模具名称</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HMouldName" id="HMouldName" value="" style="width: 150px;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-bottom: 15px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 65px;">模具型号</label>
                                            <div class="layui-input-block" style="margin-left: 95px;">
                                                <input type="text" class="layui-input" name="HModel" id="HModel" value="" style="width: 150px;" readonly>
                                            </div>
                                        </div>                                       
                                    </div>
                                </div>
                            </div>
                            <div id="center" style="width: 100%; height: calc(55vh); margin-top: 1%;">
                                <div id="center-left" style="width: 30%; height: calc(40vh); float: left;">
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 30px;"><span style="font-weight:bolder">人员</span></label>
                                    </div>
                                    <div style="margin-left:25%;">
                                        <dl>
                                            <dd>
                                                <h2><span>部门:<span style="margin-left:10px;" id="HDepName"></span></span></h2>
                                                <h3><span>班组:<span style="margin-left:10px;" id="HGroupName"></span></span></h3>
                                                <h3><span>操作员:<span style="margin-left:10px;" id="HEmpName"></span></span></h3>
                                                <h3><span>负责人:<span style="margin-left:10px;" id="HManagerName"></span></span></h3>
                                            </dd>
                                        </dl>
                                    </div>
                                </div>
                                <div id="center-right" style="width: 15%; height: calc(40vh); float: left; margin-left: 0.2%; ">
                                    <div id="chart2" style="width: 75%; height: calc(40vh); left: 2%; float: left;"></div>
                                </div>
                            </div>
                            <div id="bottom" style="width: 100%; height: calc(10vh);">
                                <div id="bottom-left" style="width: 100%; height: calc(10vh);">
                                    <div style="text-align: left; width: 100%; height: calc(10vh); ">
                                        <button type="button" lay-submit="" lay-filter="tg" class="layui-btn layui-btn-radius " style="margin-left: 15%;" id="tg">停工挂起</button>
                                        <button type="button" lay-submit="" lay-filter="kg" class="layui-btn layui-btn-radius " style="margin-left: 5%; " id="kg">开工</button>
                                        <button type="button" lay-submit="" lay-filter="Add" class="layui-btn layui-btn-radius " style="margin-left: 20%;" id="Add">新增</button>
                                        <button type="button" lay-submit="" lay-filter="Saver" class="layui-btn layui-btn-radius " style="margin-left: 5%; " id="Saver">保存</button>
                                        <button type="button" lay-submit="" lay-filter="Exit" class="layui-btn layui-btn-radius " style="margin-left: 5%; " id="Exit">退出</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div id="center-right-maintable" style="width: 34%; height: calc(135vh); float: left; margin-left: 0.2%; background-color: rgb(255 255 255) ">
                            <div class="layui-tab" lay-filter="tab-POStockInBill">
                                <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="" id="mainTable" style="width:110%;" lay-filter="mainTable"></table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                         
                        </div>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill" id="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>删除</button>
                            </div>
                        </script>
                    </form>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>
    //获取参数
    var HBillType = "";  //单据类型
    var HSourceInterID = ""; //源单主内码
    var HSourceEntryID = "";  //源单子内码
    var HSourceBillNo = "";   //源单单号
    var HSourceBillType = "";  //源单类型
    var HEquipName = ""; //设备名称
    var HEquipCode = ""; //设备编号
    var HEmpName = ""; //操作员
    var HManagerName = ""; //负责人
    var HGroupName = ""; //班组
 
    var edit = function (data) {
        HBillType = data[0].HBillType;
        HSourceInterID = data[0].HSourceInterID;
        HSourceEntryID = data[0].HSourceEntryID;
        HSourceBillNo = data[0].HSourceBillNo;
        HSourceBillType = data[0].HSourceBillType;
        HEquipName = data[0].HEquipName;//设备名称
        HEquipCode = data[0].HEquipCode;//设备编号
        HICMOBillNo = data[0].HICMOBillNo;//生产订单单号
        HICMOInterID = data[0].HICMOInterID;//生产订单主内码
        HICMOEntryID = data[0].HICMOEntryID;//生产订单子内码
        HSourceID = data[0].HSourceID;//生产资源id
        HEmpName = data[0].HEmpName;//操作员
        HManagerName = data[0].HManagerName;//负责人
        HGroupName = data[0].HGroupName;//班组
    }
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
    }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate', 'soulTable'], 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
            , util = layui.util
            , soulTable = layui.soulTable
        var sWhere = "";
        var options = [];
        //#endregion
 
        //#region 进入页面即加载
 
        var HModName = "Cj_StationOutBill_CurrentWork";
        //不需要显示的字段 可扩展
        var titleData = ["HInterID", "HEntryID", "HSourceID", "HMaterID", "HDeptID", "源单子内码", "源单类型", "单据类型"];
        var HFinishRate = 0; //完成率
        var HQualifiedRate = 0;  //合格率
        //初始化界面
        set_ClearBill();
 
        $("#HEquipName").text(HEquipName);//设备名称
        $("#HEquipCode").text(HEquipCode);//设备编号
        $("#HEmpName").text(HEmpName);//操作员
        $("#HManagerName").text(HManagerName);//负责人
        $("#HGroupName").text(HGroupName);//班组
        //#endregion
 
        //#region 【仪表盘】
        var chart1 = echarts.init(document.getElementById("chart1"));
 
        var colorTemplate1 = [[0.2, "rgba(255,0,0,0.8)"], [0.8, "rgba(0,255,255,0.8)"], [1, "rgba(0,255,0,0.8)"]];
 
        var data1 = [{
            name: "完成率",
            value: HFinishRate.toFixed(2),
        }];
 
        // 指定图表的配置项和数据
        var option = {
            //backgroundColor: "#000",
            tooltip: {                // 本系列特定的 tooltip 设定。
                show: true,
                formatter: "{b}:{c}%",
                backgroundColor: "rgba(50,50,50,0.7)",    // 提示框浮层的背景颜色。注意:series.tooltip 仅在 tooltip.trigger 为 'item' 时有效。
                borderColor: "#333",        // 提示框浮层的边框颜色。...
                borderWidth: 0,                // 提示框浮层的边框宽。...
                padding: 5,                    // 提示框浮层内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距。...
                textStyle: {                // 提示框浮层的文本样式。...
                    // color ,fontStyle ,fontWeight ,fontFamily ,fontSize ,lineHeight ,.......
                },
            },
            series: [
                {
                    name: "单仪表盘示例",        // 系列名称,用于tooltip的显示,legend 的图例筛选,在 setOption 更新数据和配置项时用于指定对应的系列。
                    type: "gauge",            // 系列类型
                    progress: {
                        show: true
                    },
                    radius: "100%",            // 参数:number, string。 仪表盘半径,默认 75% ,可以是相对于容器高宽中较小的一项的一半的百分比,也可以是绝对的数值。
                    center: ["50%", "50%"],    // 仪表盘位置(圆心坐标)
                    startAngle: 225,        // 仪表盘起始角度,默认 225。圆心 正右手侧为0度,正上方为90度,正左手侧为180度。
                    endAngle: -45,            // 仪表盘结束角度,默认 -45
                    clockwise: true,        // 仪表盘刻度是否是顺时针增长,默认 true。
                    min: 0,                    // 最小的数据值,默认 0 。映射到 minAngle。
                    max: 100,                // 最大的数据值,默认 100 。映射到 maxAngle。
                    splitNumber: 10,        // 仪表盘刻度的分割段数,默认 10。
                    axisLine: {                // 仪表盘轴线(轮廓线)相关配置。
                        show: true,                // 是否显示仪表盘轴线(轮廓线),默认 true。
                        lineStyle: {            // 仪表盘轴线样式。
                            color: colorTemplate1,     //仪表盘的轴线可以被分成不同颜色的多段。每段的  结束位置(范围是[0,1]) 和  颜色  可以通过一个数组来表示。默认取值:[[0.2, '#91c7ae'], [0.8, '#63869e'], [1, '#c23531']]
                            opacity: 1,                    //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
                            width: 5,                    //轴线宽度,默认 30。
                            shadowBlur: 20,                //(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
                            shadowColor: "#fff",        //阴影颜色。支持的格式同color。
                        }
                    },
                    splitLine: {            // 分隔线样式。
                        show: true,                // 是否显示分隔线,默认 true。
                        length: 0,                // 分隔线线长。支持相对半径的百分比,默认 30。
                        lineStyle: {            // 分隔线样式。
                            color: "#eee",                //线的颜色,默认 #eee。
                            opacity: 1,                    //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
                            width: 2,                    //线度,默认 2。
                            type: "solid",                //线的类型,默认 solid。 此外还有 dashed,dotted
                            shadowBlur: 10,                //(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
                            shadowColor: "#fff",        //阴影颜色。支持的格式同color。
                        }
                    },
                    axisTick: {                // 刻度(线)样式。
                        show: false,                // 是否显示刻度(线),默认 true。
                        splitNumber: 5,            // 分隔线之间分割的刻度数,默认 5。
                        length: 8,                // 刻度线长。支持相对半径的百分比,默认 8。
                        lineStyle: {            // 刻度线样式。
                            color: "#eee",                //线的颜色,默认 #eee。
                            opacity: 1,                    //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
                            width: 1,                    //线度,默认 1。
                            type: "solid",                //线的类型,默认 solid。 此外还有 dashed,dotted
                            shadowBlur: 10,                //(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
                            shadowColor: "#fff",        //阴影颜色。支持的格式同color。
                        },
                    },
                    axisLabel: {            // 刻度标签。
                        show: false,                // 是否显示标签,默认 true。
                        distance: 5,            // 标签与刻度线的距离,默认 5。
                        color: "#1E1E1E",            // 文字的颜色,默认 #fff。
                        fontSize: 9,            // 文字的字体大小,默认 5。
                        formatter: "{value}",    // 刻度标签的内容格式器,支持字符串模板和回调函数两种形式。 示例:// 使用字符串模板,模板变量为刻度默认标签 {value},如:formatter: '{value} kg'; // 使用函数模板,函数参数分别为刻度数值,如formatter: function (value) {return value + 'km/h';}
                    },
                    pointer: {                // 仪表盘指针。
                        show: true,                // 是否显示指针,默认 true。
                        length: "70%",            // 指针长度,可以是绝对数值,也可以是相对于半径的百分比,默认 80%。
                        width: 5,                // 指针宽度,默认 8。
                    },
                    itemStyle: {            // 仪表盘指针样式。
                        color: "auto",            // 指针颜色,默认(auto)取数值所在的区间的颜色
                        opacity: 1,                // 图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
                        borderWidth: 0,            // 描边线宽,默认 0。为 0 时无描边。
                        borderType: "solid",    // 柱条的描边类型,默认为实线,支持 'solid', 'dashed', 'dotted'。
                        borderColor: "#000",    // 图形的描边颜色,默认 "#000"。支持的颜色格式同 color,不支持回调函数。
                        shadowBlur: 10,            // (发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
                        shadowColor: "#fff",    // 阴影颜色。支持的格式同color。
                    },
                    emphasis: {                // 高亮的 仪表盘指针样式
                        itemStyle: {
                            //高亮 和正常  两者具有同样的配置项,只是在不同状态下配置项的值不同。
                        }
                    },
                    title: {                // 仪表盘标题。
                        show: true,                // 是否显示标题,默认 true。
                        offsetCenter: [0, "120%"],//相对于仪表盘中心的偏移位置,数组第一项是水平方向的偏移,第二项是垂直方向的偏移。可以是绝对的数值,也可以是相对于仪表盘半径的百分比。
                        color: "#1E1E1E",            // 文字的颜色,默认 #333。
                        fontSize: 20,            // 文字的字体大小,默认 15。
                    },
                    detail: {                // 仪表盘详情,用于显示数据。
                        show: true,                // 是否显示详情,默认 true。
                        offsetCenter: [0, "70%"],// 相对于仪表盘中心的偏移位置,数组第一项是水平方向的偏移,第二项是垂直方向的偏移。可以是绝对的数值,也可以是相对于仪表盘半径的百分比。
                        color: "auto",            // 文字的颜色,默认 auto。
                        fontSize: 30,            // 文字的字体大小,默认 15。
                        formatter: "{value}%",    // 格式化函数或者字符串
                    },
                    data: data1
                }
            ]
        };
        // 使用刚指定的配置项和数据显示图表
        chart1.setOption(option);
 
 
        var chart2 = echarts.init(document.getElementById("chart2"));
 
        var data2 = [{
            name: "合格率",
            value: HQualifiedRate.toFixed(2),
        }];
 
        // 指定图表的配置项和数据
        var option2 = {
            //backgroundColor: "#000",
            tooltip: {                // 本系列特定的 tooltip 设定。
                show: true,
                formatter: "{b}:{c}%",
                backgroundColor: "rgba(50,50,50,0.7)",    // 提示框浮层的背景颜色。注意:series.tooltip 仅在 tooltip.trigger 为 'item' 时有效。
                borderColor: "#333",        // 提示框浮层的边框颜色。...
                borderWidth: 0,                // 提示框浮层的边框宽。...
                padding: 5,                    // 提示框浮层内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距。...
                textStyle: {                // 提示框浮层的文本样式。...
                    // color ,fontStyle ,fontWeight ,fontFamily ,fontSize ,lineHeight ,.......
                },
            },
            series: [
                {
                    name: "单仪表盘示例",        // 系列名称,用于tooltip的显示,legend 的图例筛选,在 setOption 更新数据和配置项时用于指定对应的系列。
                    type: "gauge",            // 系列类型
                    radius: "100%",            // 参数:number, string。 仪表盘半径,默认 75% ,可以是相对于容器高宽中较小的一项的一半的百分比,也可以是绝对的数值。
                    center: ["50%", "50%"],    // 仪表盘位置(圆心坐标)
                    startAngle: 225,        // 仪表盘起始角度,默认 225。圆心 正右手侧为0度,正上方为90度,正左手侧为180度。
                    endAngle: -45,            // 仪表盘结束角度,默认 -45
                    clockwise: true,        // 仪表盘刻度是否是顺时针增长,默认 true。
                    min: 0,                    // 最小的数据值,默认 0 。映射到 minAngle。
                    max: 100,                // 最大的数据值,默认 100 。映射到 maxAngle。
                    splitNumber: 10,        // 仪表盘刻度的分割段数,默认 10。
                    axisLine: {                // 仪表盘轴线(轮廓线)相关配置。
                        show: true,                // 是否显示仪表盘轴线(轮廓线),默认 true。
                        lineStyle: {            // 仪表盘轴线样式。
                            color: colorTemplate1,     //仪表盘的轴线可以被分成不同颜色的多段。每段的  结束位置(范围是[0,1]) 和  颜色  可以通过一个数组来表示。默认取值:[[0.2, '#91c7ae'], [0.8, '#63869e'], [1, '#c23531']]
                            opacity: 1,                    //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
                            width: 5,                    //轴线宽度,默认 30。
                            shadowBlur: 20,                //(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
                            shadowColor: "#fff",        //阴影颜色。支持的格式同color。
                        }
                    },
                    splitLine: {            // 分隔线样式。
                        show: true,                // 是否显示分隔线,默认 true。
                        length: 0,                // 分隔线线长。支持相对半径的百分比,默认 30。
                        lineStyle: {            // 分隔线样式。
                            color: "#eee",                //线的颜色,默认 #eee。
                            opacity: 1,                    //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
                            width: 2,                    //线度,默认 2。
                            type: "solid",                //线的类型,默认 solid。 此外还有 dashed,dotted
                            shadowBlur: 10,                //(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
                            shadowColor: "#fff",        //阴影颜色。支持的格式同color。
                        }
                    },
                    axisTick: {                // 刻度(线)样式。
                        show: false,                // 是否显示刻度(线),默认 true。
                        splitNumber: 5,            // 分隔线之间分割的刻度数,默认 5。
                        length: 8,                // 刻度线长。支持相对半径的百分比,默认 8。
                        lineStyle: {            // 刻度线样式。
                            color: "#eee",                //线的颜色,默认 #eee。
                            opacity: 1,                    //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
                            width: 1,                    //线度,默认 1。
                            type: "solid",                //线的类型,默认 solid。 此外还有 dashed,dotted
                            shadowBlur: 10,                //(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
                            shadowColor: "#fff",        //阴影颜色。支持的格式同color。
                        },
                    },
                    axisLabel: {            // 刻度标签。
                        show: false,                // 是否显示标签,默认 true。
                        distance: 5,            // 标签与刻度线的距离,默认 5。
                        color: "#1E1E1E",            // 文字的颜色,默认 #fff。
                        fontSize: 9,            // 文字的字体大小,默认 5。
                        formatter: "{value}",    // 刻度标签的内容格式器,支持字符串模板和回调函数两种形式。 示例:// 使用字符串模板,模板变量为刻度默认标签 {value},如:formatter: '{value} kg'; // 使用函数模板,函数参数分别为刻度数值,如formatter: function (value) {return value + 'km/h';}
                    },
                    pointer: {                // 仪表盘指针。
                        show: true,                // 是否显示指针,默认 true。
                        length: "70%",            // 指针长度,可以是绝对数值,也可以是相对于半径的百分比,默认 80%。
                        width: 5,                // 指针宽度,默认 8。
                    },
                    itemStyle: {            // 仪表盘指针样式。
                        color: "auto",            // 指针颜色,默认(auto)取数值所在的区间的颜色
                        opacity: 1,                // 图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
                        borderWidth: 0,            // 描边线宽,默认 0。为 0 时无描边。
                        borderType: "solid",    // 柱条的描边类型,默认为实线,支持 'solid', 'dashed', 'dotted'。
                        borderColor: "#000",    // 图形的描边颜色,默认 "#000"。支持的颜色格式同 color,不支持回调函数。
                        shadowBlur: 10,            // (发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
                        shadowColor: "#fff",    // 阴影颜色。支持的格式同color。
                    },
                    emphasis: {                // 高亮的 仪表盘指针样式
                        itemStyle: {
                            //高亮 和正常  两者具有同样的配置项,只是在不同状态下配置项的值不同。
                        }
                    },
                    title: {                // 仪表盘标题。
                        show: true,                // 是否显示标题,默认 true。
                        offsetCenter: [0, "120%"],//相对于仪表盘中心的偏移位置,数组第一项是水平方向的偏移,第二项是垂直方向的偏移。可以是绝对的数值,也可以是相对于仪表盘半径的百分比。
                        color: "#1E1E1E",            // 文字的颜色,默认 #333。
                        fontSize: 20,            // 文字的字体大小,默认 15。
                    },
                    detail: {                // 仪表盘详情,用于显示数据。
                        show: true,                // 是否显示详情,默认 true。
                        offsetCenter: [0, "70%"],// 相对于仪表盘中心的偏移位置,数组第一项是水平方向的偏移,第二项是垂直方向的偏移。可以是绝对的数值,也可以是相对于仪表盘半径的百分比。
                        color: "auto",            // 文字的颜色,默认 auto。
                        fontSize: 30,            // 文字的字体大小,默认 15。
                        formatter: "{value}%",    // 格式化函数或者字符串
                    },
                    data: data2
                }
            ]
        };
        // 使用刚指定的配置项和数据显示图表
        chart2.setOption(option2);
 
        //#endregion
 
        //#region 头工具栏事件
 
        //条形码回车方法
        $('#HBarCodeSN').on('keydown', function (event) {
            var HBarCode = $('#HBarCodeSN').val();
            if (event.keyCode == 13) {
                HBarCode = HBarCode.toUpperCase();
                if (!HBarCode) {
                    layer.msg("条形码不能为空!")
                    return;
                }
                txtHBarCode_KeyDown(HBarCode);
            }
        });
 
        //头工具栏事件
        table.on('toolbar(mainTable)', function (obj) {
            switch (obj.event) {
                //删除
                case 'set_DeleteBill': set_DeleteBill();
                    break;
            };
        });
 
 
        //生产资源
        form.on('submit(btnHSourceID)', function () {
            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].生产资源名称);
 
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
                , btn2: function (index, layero) { }
            })
        });
 
        //工序
        form.on('submit(btnHProcID)', function () {
            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 === 0) {
                        return layer.msg('请选择数据');
                    }
                    //获取数据
                    $("#HProcID").val(checkStatus.data[0].HItemID);
                    $("#HProcName").val(checkStatus.data[0].工序名称);
 
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
                , btn2: function (index, layero) { }
            })
        });
        
 
        //工作中心
        form.on('submit(btnHCenterID)', function () {
            layer.open({
                type: 2//弹窗类型
                , skin: 'layui-layer-rim' //加上边框
                , area: ['90%', '90%']//大小
                , title: "工作中心列表"  //标题
                , shift: 2//弹出动画
                , content: ["../../基础资料/公用基础资料/Gy_WorkCenter.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('请选择数据');
                    }
                    //获取数据
                    $("#HCenterID").val(checkStatus.data[0].HItemID);
                    $("#HCenterName").val(checkStatus.data[0].工作中心名称);
 
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
                , btn2: function (index, layero) { }
            })
        });
 
        //生产班组
        form.on('submit(btnHGroupID)', function () {
            layer.open({
                type: 2//弹窗类型
                , skin: 'layui-layer-rim' //加上边框
                , area: ['90%', '90%']//大小
                , title: "生产班组列表"  //标题
                , shift: 2//弹出动画
                , content: ["../../基础资料/工资基础资料/Gy_Group.html?type=HGroup", "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('请选择数据');
                    }
                    //获取数据
                    $("#HGroupID").val(checkStatus.data[0].HItemID);
                    $("#HGroupName").val(checkStatus.data[0].班组名称);
 
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
                , btn2: function (index, layero) { }
            })
        });
 
        //操作员
        form.on('submit(btnHEmpID)', function () {
            layer.open({
                type: 2//弹窗类型
                , skin: 'layui-layer-rim' //加上边框
                , area: ['90%', '90%']//大小
                , title: "操作员列表"  //标题
                , shift: 2//弹出动画
                , content: ["../../基础资料/公用基础资料/Gy_EmployeeList.html?type=HEmp", "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('请选择数据');
                    }
                    //获取数据
                    $("#HEmpID").val(checkStatus.data[0].HItemID);
                    $("#HEmpName").val(checkStatus.data[0].职员名称);
 
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
                , btn2: function (index, layero) { }
            })
        });
 
        //保存
        form.on('submit(Saver)', function (data) {//提交
            Saver(data);
        })
 
        //退出
        form.on('submit(Exit)', function (data) {//提交
            Pub_Close(1);
        })
 
        
        //新增
        form.on('submit(Add)', function (data) {
            layer.confirm('新增后页面数据将消失?', { icon: 3, title: '提示' }, function (index) {
                location.replace('Cj_StationOutBill_CurrentWork.html');
            });
        })
 
 
        //#endregion
 
        //#region 本页面所有被调用的方法
        function set_ClearBill() {
            get_CriticalPartsList();
            $("#HPRDOrgID").val(sessionStorage["OrganizationID"]);
            $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
            $('#Add').addClass("layui-btn-disabled").attr("disabled", true);//新增按钮禁用
            //get_Display();
            get_Display_OutBillList();
            get_Display_UserList();
            get_ConfigFileInfo_EquipFile();
            MaxBillNO();
            //查询
            get_FastQuery();
        }
 
        //获取最大单据号
        function MaxBillNO() {
            $("#HInterID").val("0");
            $("#HBillNo").val("");
            //获取最大单据号
            $.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(d.data[0].HBillNo);
                }
            });
        }
 
        //初始化表格
        function get_CriticalPartsList() {
            options = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , page: false
                , totalRow: true
                //, cellMinWidth: 120
                , data: []
                , height: 780
                , limit: Number.MAX_VALUE
                , cols: [[
                    { type: 'checkbox', fixed: 'left' }
                    , { type: 'numbers', title: '序号' }
                    , { field: '制单日期', title: '日期', width: 100 }
                    , { field: '物料代码', title: '产品代码', width: 100 }
                    , { field: '物料名称', title: '产品名称', width: 100 }
                    , { field: '条码', title: '条码', width: 100 }
                    , { field: '出站数量', title: '数量', width: 100 }
                    , { field: '生产订单号', title: '订单号', width: 100 }
                ]]
            }
 
            table.render(options);
 
        }
 
        //删除单据
        function set_DeleteBill() {
            var checkStatus = table.checkStatus('mainTable')
                , data = checkStatus.data;
            if (checkStatus.data.length === 1) {
                layer.confirm('确定删除' + data[0].条码 + '吗?', function (index) {
                    var ajaxLoad = layer.load();
                    //逻辑删除方法
                    $.ajax({
                        url: GetWEBURL() + '/Cj_StationOutBill_CurrentWork/get_PanelDisplay',
                        type: "GET",
                        data: { "HInterID": data[0].hmainid, "HDeleteMan": sessionStorage["HUserName"], "HBillSubType": "3791" },
                        success: function (result) {
                            if (result.count == 1) {
                                get_Display_OutBillList();
                                layer.close(ajaxLoad);
                            } else {
                                layer.close(ajaxLoad);
                                layer.alert(result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.close(ajaxLoad);
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                    layer.close(index);
                });
            } else {
                layer.msg('请选择一行数据编辑!');
            }
        }
 
        //#region 快速过滤
        function get_FastQuery() {
            get_Display(sWhere);
            sWhere = "";//调用接口后清空sWhere缓存
        }
        //#endregion
 
 
        function get_Display(sWhere) {
            sWhere = " and HInterID='" + HSourceInterID + "' and 源单子内码='" + HSourceEntryID + "'";
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/CheckBill/GetICMOBillStatusList',
                type: "GET",
                async: false,
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (result) {
                    if (result.count == 1) {
                        $("#HProcName").val(result.data[0]["工序"]);
                        $("#HProcID").val(result.data[0]["HProcID"]);
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(result.code + result.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
 
        }
 
        //#region 查询
        function get_PanelDisplay(sWhere) {
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Cj_StationOutBill_CurrentWork/get_PanelDisplay',
                type: "GET",
                async: false,
                data: { "HSourceID": HSourceID, "HICMOInterID": HICMOInterID, "HICMOEntryID": HICMOEntryID, "HSourceInterID": HSourceInterID, "user": sessionStorage["HUserName"] },
                success: function (result) {
                    if (result.count == 1) {
                        var data = result.data.h_p_JIT_GetCurrentTicketInfo[0];
                        $("#HICMOBillNo").text(data.HSourceBillNo);//工单号
                        $("#HICMOBillStatus").text('');//当前状态
                        $("#HMaterNumber").text(data.HMaterNumber);//产品代码
                        $("#HMaterName").text(data.HMaterName);//产品名称
                        $("#HMaterModel").text(data.HModel);//规格型号
                        $("#HPlanQty").text(data.HPlanQty);//计划数量
                        $("#HReportQty").text(data.HRelationQty);//汇报总数
                        $("#HPickMtrlStatus").text('');//领料状态
                        $("#HFCheckNum").text(data.首检次数);//首检次数
                        $("#HPrCheckNum").text(data.过程检次数);//过程检次数
                        $("#HPPCheckNum").text(data.巡检次数);//巡检次数
                        HFinishRate = data.完成率;//完成率
                        HQualifiedRate = data.合格率;//合格率
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(result.code + result.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
 
        }
        //#endregion
 
        //查询用户关联信息
        function get_Display_UserList() {
            var sWhere = " and 编码='" + sessionStorage["Czybm"] + "'";
            var ajaxLoad = layer.load();
            //进入页面显示的缓存列表
            $.ajax({
                url: GetWEBURL() + '/Cj_SingleStation/Cj_CollectionOfSingleProductDefectsUserList',
                type: "GET",
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
 
                        $("#HDeptID").val(data1.data[0]["HDeptID"]);
                        $("#HDeptName").val(data1.data[0]["车间"]);
                        //$("#HProcName").val(data1.data[0]["工序"]);
                        //$("#HProcID").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]["质检员"]);
                        $("#HGroupID").val(data1.data[0]["HGroupID"]);
                        $("#HGroupName").val(data1.data[0]["生产班组"]);
                        $("#HCenterID").val(data1.data[0]["HWorkCenterID"]);
                        $("#HCenterName").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 });
                }
 
            });
        }
 
        //#region 根据平板绑定,自动带出基础资料信息
        function get_ConfigFileInfo_EquipFile() {
            var objdata = get_ConfigFileInfo();
            //$("#HProcID").val(objdata.HProcID); //工序ID
            //$("#HProcName").val(objdata.HProcName); //工序名称
            //$("#HEquipID").val(objdata.HEquipID); //设备ID
            $("#HEquipCode").text(objdata.HEquipName); //设备名称
            //$("#HSourceID").val(objdata.HSourceID); //生产资源ID
            //$("#HSourceName").val(objdata.HSourceName); //生产资源名称
            //$("#HGroupID").val(objdata.HGroupID); //班组ID
            //$("#HGroupName").val(objdata.HGroupName); //班组名称
            //$("#HCenterID").val(objdata.HWorkCenterID); //工作中心ID
            //$("#HCenterName").val(objdata.HWorkCenterName); //工作中心名称
          
        }
        //#endregion
 
        //查询当前用户今天的出站单的数据
        function get_Display_OutBillList() {
            sWhere = " and 制单人='" + sessionStorage["HUserName"] + "' and CONVERT(varchar(10),制单日期,20)=CONVERT(varchar(10),GETDATE(),20) ";
            //进入页面显示的缓存列表
            var wait = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Cj_StationOutBill_CurrentWork/get_Out_Display',
                type: "GET",
                async: false,
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "HBillSubType": "3791" },
                success: function (data1) {
                    if (data1.count == 1) {
                        options.data = data1.data;
                        table.render(options);
                    } else {
                        layer.alert(data1.Message, { icon: 5 });
                    }
 
                    layer.close(wait);
                }, error: function () {
                    layer.close(wait);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
            layer.close(wait);
        }
 
        //条码回车查询
        function txtHBarCode_KeyDown(HBarCode) {
 
            var indexs = layer.load();
            $.ajax({
                type: "GET",
                url: GetWEBURL() + "/Cj_StationOutBill_CurrentWork/SNHBardCodeList",
                async: false,
                data: { "HBarCode": HBarCode, "HProcID": $("#HProcID").val(), "HOrgID": sessionStorage["OrganizationID"] },
                dataType: "json",
                success: function (data1) {
                    if (data1.count == 1) {
                        layer.close(indexs);
                        $("#HProcNo").val(data1.data[0]["工序号"]);
                        $("#HICMOBillNo").val(data1.data[0]["生产订单号"]);
                        $("#HICMOInterID").val(data1.data[0]["hicmointerid"]);
                        $("#HProcExchBillNo").val(data1.data[0]["单据号"]);
                        $("#lngBillKey").val(data1.data[0]["hmainid"]);
                        $("#lngBillSubKey").val(data1.data[0]["hsubid"]);
                        $("#HMaterNumber").val(data1.data[0]["产品代码"]);
                        $("#HMaterName").val(data1.data[0]["产品"]);
                        $("#HMaterModel").val(data1.data[0]["规格型号"]);
                        $("#HMaterID").val(data1.data[0]["HMaterID"]);
                        $("#HUnitName").val(data1.data[0]["单位"]);
                        $("#HUnitID").val(data1.data[0]["HUnitID"]);
                        $("#HQty").val(data1.data[0]["最小包装数量"]);
                        $("#HICMOQty").val(data1.data[0]["生产数量"]);
                        $("#HPlanQty").val(data1.data[0]["流转卡数量"]);
                        $("#HBarCode").val(HBarCode);
                        getHModel(data1.data[0]["hmainid"], data1.data[0]["hsubid"], data1.data[0]["单据号"]);
                    }
                    else {
                        layer.close(indexs);
                        layer.msg(data1.Message);
                    }
                    //光标跳转到SN条码文本框上
                    //$("#HBarCodeSN").focus();
                    $("#HBarCodeSN").val("");
                },
                error: function (err) {
                    layer.close(indexs);
                    layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                }
            });
        }
 
        //根据条形码的查出的流转卡主子id+流转卡 找出对应的模具
        function getHModel(HInterID, HEntryID, HBillNo) {
            $.ajax({
                type: "GET",
                url: GetWEBURL() + "/Cj_StationOutBill_CurrentWork/getHModelList",
                async: false,
                data: { "HInterID": HInterID, "HEntryID": HEntryID, "HBillNo": HBillNo},
                dataType: "json",
                success: function (data1) {
                    if (data1.count == 1) {
                        $("#HMouldID").val(data1.data[0]["HMouldID"]);
                        $("#HMouldNo").val(data1.data[0]["模具编码"]);
                        $("#HMouldName").val(data1.data[0]["模具名称"]);
                        $("#HModel").val(data1.data[0]["模具型号"]);                    
                    }
                    else {
                        layer.close(indexs);
                        layer.msg(data1.Message);
                    }                   
                },
                error: function (err) {
                    layer.close(indexs);
                    layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                }
            });
        }
 
        //保存
        function Saver(data) {
            if ($("#HProcExchBillNo").val() == "") {
                layer.msg("请扫流转卡!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return;
            }
            if ($("#HQty").val() == 0 && $("#HBadCount").val() == 0) {
 
                layer.msg("不良和合格数量不能同时为0!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return;
            }
 
            var oMain = JSON.stringify(data.field) + ";" + sessionStorage["HUserName"] + ";Add";
            var index = layer.load();
            $.ajax({
                type: "POST",
                url: GetWEBURL() + "/Cj_StationOutBill/AddBill",
                async: false,
                data: { "oMain": oMain },
                dataType: "json",
                success: function (data) {
                    if (data.count == 1) {
                        layer.close(index);
                        SaverSub(oMain);
                        //layer.msg("提交成功");
                        //$('#Saver').addClass("layui-btn-disabled").attr("disabled", true);//保存按钮禁用
                        //$('#Add').removeClass("layui-btn-disabled").attr("disabled", false);//新增按钮启用
                    }
                    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 SaverSub(data) {
            var oMain = data;
            var index = layer.load();
            $.ajax({
                type: "POST",
                url: GetWEBURL() + "/Cj_StationOutBill_CurrentWork/AddBillSub",
                async: false,
                data: { "oMain": oMain },
                dataType: "json",
                success: function (data) {
                    if (data.count == 1) {
                        layer.close(index);
                        layer.msg("提交成功");
                        $('#Saver').addClass("layui-btn-disabled").attr("disabled", true);//保存按钮禁用
                        $('#Add').removeClass("layui-btn-disabled").attr("disabled", false);//新增按钮启用
                        get_Display_OutBillList();
                    }
                    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: "温馨提示" });
                }
            });
        }
 
        //以上是layui模块
    });
 
 
    //生产资源
    function GetGySource(obj) {
        $("#HSourceID").val(obj.HItemID);
        $("#HSourceName").val(obj.生产资源名称);
    }
 
    //工作中心
    function GetWorkCenterValue(obj) {
        $("#HCenterID").val(obj[0].HItemID);
        $("#HCenterName").val(obj[0].工作中心名称);
    }
 
    //生产班组
    function GetHGroupValue(obj) {
        $("#HGroupName").val(obj[0].班组名称);
        $("#HGroupID").val(obj[0].HItemID);
    }
 
    //操作员
    function GetHEmpValue(obj) {
        $("#HEmpID").val(obj[0].HItemID);
        $("#HEmpName").val(obj[0].职员名称);
    }
</script>