chenhaozhe
2025-07-02 dfd4d114395ce69b51bccd746b02e336873b8088
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>设备点检记录单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <!--引用layui样式文件-->
    <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
    <!--引用layui js文件-->
    <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 src="../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <!--自定义样式-->
    <style>       
        .layui-form-label {
            font-size: 14px;
            width: 85px;
            text-align: inherit;
        }
        /*全局设置输入框高度*/
        .LineHeight {
            height: 30px;
        }
        /*设置表头输入框*/
        .t1_input {
            padding: 1%;
        }
        /*本站信息td*/
        .bz_td {
            display: -webkit-box; /*设置按钮不换行*/
            padding: 1%; /*设置输入框边距*/
        }
        /*设置本站信息按钮高度*/
        .bz_btu {
            height: 30px;
            width: 60px;
            line-height: 30px;
        }
 
        th {
            width: 70px;
            text-align: center;
        }
 
        /* 防止下拉框的下拉列表被隐藏---必须设置--- */
        .layui-table-cell {
            overflow: visible !important;
        }
        /* 使得下拉框与单元格刚好合适 */
        td .layui-form-select {
            margin-top: -10px;
            margin-left: -15px;
            margin-right: -15px;
        }
 
        .layui-form-item .layui-inline {
            margin-top: 0px;
            margin-bottom: 5px;
            margin-right: 0px;
        }
 
        .layui-form-label {
            width: 25%;
        }
        /*明细行复选框居中*/
        .layui-table-cell .layui-form-checkbox[lay-skin="primary"] {
            margin-left: 15%;
        }
    </style>
</head>
 
<body>
    <div class="layui-fluid" style="padding: 0;">
        <div class="layui-card">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" id="formData" style="background-color:white;">
                    <div style="background-color:#0085E8;">
                        <span style="color: white;"><i class="layui-icon layui-icon-form"></i>设备点检记录单</span>
                    </div>
                    <div class="layui-form-item" style="margin: 1% 2%;text-align: right;">
                        <button type="button" lay-submit="" lay-filter="Add" class="layui-btn layui-btn-radius">新增</button>
                        <!--<button type="button" lay-submit="" lay-filter="" class="layui-btn layui-btn-radius">清空</button>-->
                        <button type="button" lay-submit="" lay-filter="Saver" id="Saver" class="layui-btn layui-btn-radius">保存</button>
                        <button type="button" lay-submit="" lay-filter="Cancel" class="layui-btn layui-btn-radius layui-btn-danger">退出</button>
                    </div>
                    <div class="layui-tab layui-tab-card" lay-filter="TabTest">
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                <table style="width:80%;">
                                    <tbody>
                                        <tr>
                                            <th>设备条码</th>
                                            <td class="bz_td">
                                                <input type="text" name="HBarCode" class="layui-input LineHeight" id="HBarCode" placeholder="请输入设备条码后回车" style="border-radius: 50px;">
                                                <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu layui-btn-radius" lay-filter="QueDin" style="line-height: 30px;">确定</button>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>点检开始</th>
                                            <td class="bz_td">
                                                <input type="datetime" name="HBeginDate" class="layui-input LineHeight" id="HBeginDate" placeholder="请选择日期" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>点检结束</th>
                                            <td class="bz_td">
                                                <input type="datetime" name="HEndDate" class="layui-input LineHeight" id="HEndDate" placeholder="请选择日期" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>数&ensp;&ensp;&ensp;&ensp;量</th>
                                            <td class="bz_td">
                                                <input type="text" name="HQty" class="layui-input LineHeight" id="HQty" value="0" placeholder="请输入数量" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>最终结论</th>
                                            <td class="bz_td">
                                                <input type="radio" name="HLastResult" value="OK" title="OK" checked="">
                                                <input type="radio" name="HLastResult" value="NG" title="NG">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>异常情况<br />记录</th>
                                            <td class="bz_td" style="margin-top:10px;">
                                                <input type="text" name="HErrNote" class="layui-input LineHeight" id="HErrNote" placeholder="请输入异常情况记录" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>重大安全<br />隐患记录</th>
                                            <td class="bz_td" style="margin-top:10px;">
                                                <input type="text" name="HBigSafeNote" class="layui-input LineHeight" id="HBigSafeNote" placeholder="请输入重大安全隐患记录" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>点检数据</th>
                                            <td class="bz_td">
                                                <input type="text" name="HDotCheckNote" class="layui-input LineHeight" id="HDotCheckNote" placeholder="请输入点检数据" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>生产班次</th>
                                            <td class="bz_td">
                                                <input type="text" name="HShiftsName" class="layui-input LineHeight" id="HShiftsName" placeholder="选择生产班次" style="background-color:#efefef4d;">
                                                <input type="hidden" name="HShiftsID" id="HShiftsID" value="0" autocomplete="off" class="layui-input">
                                                <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="btnShifts" id="btnShifts" style="font-weight:bolder">...</button>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>单&ensp;据&ensp;号</th>
                                            <td class="bz_td">
                                                <input type="text" name="HBillNo" class="layui-input LineHeight" id="HBillNo" placeholder="请输入单据号" style="border-radius: 50px;background-color:#EDEDED;" readonly>
                                                <input type="hidden" name="HInterID" id="HInterID" value="0" autocomplete="off" class="layui-input">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>单据日期</th>
                                            <td class="bz_td">
                                                <input type="datetime" name="HDate" class="layui-input LineHeight" id="HDate" placeholder="请选择日期" style="border-radius: 50px;background-color:#EDEDED;" readonly>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>部&ensp;&ensp;&ensp;&ensp;门</th>
                                            <td class="bz_td">
                                                <input type="text" name="HDeptName" class="layui-input LineHeight" id="HDeptName" placeholder="选择部门" style="background-color:#efefef4d;">
                                                <input type="hidden" name="HDeptID" id="HDeptID" value="0" autocomplete="off" class="layui-input">
                                                <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="Department" id="Department" style="font-weight:bolder">...</button>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>备&ensp;&ensp;&ensp;&ensp;注</th>
                                            <td class="bz_td">
                                                <input type="text" name="HRemark" class="layui-input LineHeight" id="HRemark" placeholder="请输入备注" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>设备名称</th>
                                            <td class="bz_td">
                                                <input type="text" name="HBarName" class="layui-input LineHeight" id="HBarName" style="border-radius: 50px;background-color:#EDEDED;" readonly>
                                                <input type="hidden" name="HEquipID" id="HEquipID" value="0" autocomplete="off" class="layui-input">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>设备规格</th>
                                            <td class="bz_td">
                                                <input type="text" name="HBarSpec" class="layui-input LineHeight" id="HBarSpec" style="border-radius: 50px;background-color:#EDEDED;" readonly>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>设备型号</th>
                                            <td class="bz_td">
                                                <input type="text" name="HBarModel" class="layui-input LineHeight" id="HBarModel" style="border-radius: 50px;background-color:#EDEDED;" readonly>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>点检计划</th>
                                            <td class="bz_td">
                                                <input type="text" name="HPlanNo" class="layui-input LineHeight" id="HPlanNo" style="border-radius: 50px;background-color:#EDEDED;" readonly>
                                                <input type="hidden" name="HPlanInterID" class="layui-input LineHeight" id="HPlanInterID" style="border-radius: 50px;background-color:#EDEDED;" value="0" readonly>
                                                <input type="hidden" name="HPlanEntryID" class="layui-input LineHeight" id="HPlanEntryID" style="border-radius: 50px;background-color:#EDEDED;" value="0" readonly>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="layui-tab-item">
                                <div class="layui-inline" style="margin-bottom:5px;">
                                    <label class="layui-form-label" style="width:100px;">设备点检规程</label>
                                    <div class="layui-input-inline">
                                        <input type="hidden" name="HEquipDotCheckRuleInterID" id="HEquipDotCheckRuleInterID" class="layui-input" value="0" style="float:left;width:150px;">
                                        <input type="text" name="HEquipDotCheckRuleInterNo" id="HEquipDotCheckRuleInterNo" class="layui-input" value="" style="float:left;width:180px;" readonly="readonly">
                                        <button type="button" lay-submit="" class="layui-btn layui-btn-primary" lay-filter="HEquipDotCheckRuleInterist" style="width:40px;">
                                            <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                        </button>
                                    </div>
                                </div>
                                <table class="" id="mainTable" lay-filter="mainTable"></table>
                                <script type="text/html" id="toolbarDemo">
                                    <div class="layui-btn-container">
                                        <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增行</button>
                                    </div>
                                </script>
                                <script type="text/html" id="xuhao">
                                    {{d.LAY_TABLE_INDEX+1}}
                                </script>
                                <script type="text/html" id="barDemo">
                                    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
                                </script>
                            </div>
                            <div class="layui-tab-item">
                                <table style="width:80%;">
                                    <tbody>
                                        <tr>
                                            <th>创建人</th>
                                            <td class="bz_td">
                                                <input type="text" name="HMaker" class="layui-input" id="HMaker" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>创建日期</th>
                                            <td class="bz_td">
                                                <input type="text" name="HMakeDate" class="layui-input" id="HMakeDate" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>修改人</th>
                                            <td class="bz_td">
                                                <input type="text" name="HUpDater" class="layui-input" id="HUpDater" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>修改日期</th>
                                            <td class="bz_td">
                                                <input type="text" name="HUpDateDate" class="layui-input" id="HUpDateDate" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>审核人</th>
                                            <td class="bz_td">
                                                <input type="text" name="HChecker" class="layui-input" id="HChecker" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>审核日期</th>
                                            <td class="bz_td">
                                                <input type="text" name="HCheckDate" class="layui-input" id="HCheckDate" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>作废人</th>
                                            <td class="bz_td">
                                                <input type="text" name="HDeleteMan" class="layui-input" id="HDeleteMan" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>作废日期</th>
                                            <td class="bz_td">
                                                <input type="text" name="HDeleteDate" class="layui-input" id="HDeleteDate" style="border-radius: 50px;">
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <!--附件信息-->
                            <div class="layui-tab-item">
                                <div class="layui-form-item" style="padding-top: 10px;min-height:calc(50vh);">
                                    <div class="layui-upload">
                                        <button type="button" class="layui-btn" id="testList"><i class="layui-icon"></i>选择文件</button>
                                        <!--<input class="layui-upload-file" type="file" accept="" name="file" multiple="">-->
                                        <!--<button type="button" class="layui-btn" id="camera" capture="user"><i class="layui-icon"></i>拍照上传</button>-->
                                        <div class="layui-upload-list">
                                            <table class="layui-table">
                                                <thead>
                                                    <tr>
                                                        <th>文件名</th>
                                                        <th>大小</th>
                                                        <th>状态</th>
                                                        <th>操作</th>
                                                    </tr>
                                                </thead>
                                                <tbody id="ProImgByList">
                                                </tbody>
                                            </table>
                                        </div>                                       
                                    </div>
                                </div>
                            </div>
                        </div>
                        <ul class="layui-tab-title">
                            <li class="layui-this">基本信息</li>
                            <li>明细信息</li>
                            <li>其他信息</li>
                            <li>附件信息</li>
                        </ul>
                    </div>
                    <!--隐藏字段-->
                    <input type="hidden" name="lngBillKey" id="lngBillKey">
                    <input type="hidden" name="lngBillSubKey" id="lngBillSubKey">
                </form>
            </div>
        </div>
    </div>
    <!--行下拉选择(点检结果)-->
    <!--<script type="text/html" id="HDotCheckResult">
        <select name="HDotCheckResult" lay-filter="HDotCheckResult" id="HDotCheckResult{{d.LAY_TABLE_INDEX+1}}" style="height:30px;">
            <option value="OK">OK</option>
            <option value="NG">NG</option>
        </select>
    </script>-->
    <!--复选框(点检结果)-->
    <script type="text/html" id="HDotCheckResult">
        <input type="checkbox" value="{{d.HDotCheckResult}}" lay-skin="primary" id="HDotCheckResult{{d.LAY_TABLE_INDEX+1}}" lay-filter="HDotCheckResult" {{ d.HDotCheckResult == 1 ? 'checked' : '' }}>
    </script>
    <!--行下拉选择(点检结果)-->
    <!--<script type="text/html" id="HDotCheckResult">
        <select name="HDotCheckResult" lay-filter="HDotCheckResult" id="HDotCheckResult{{d.LAY_TABLE_INDEX+1}}">-->
    <!--<option value="">请选择</option>-->
    <!--<option value="Y" selected>Y</option>
            <option value="X">X</option>
        </select>
    </script>-->
    <script>
        var u = navigator.userAgent, app = navigator.appVersion;
        var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器
        if (isAndroid) {
            $(":file").attr('capture', 'camera');
        }
    </script>
    <script>
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element', 'upload'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , upload = layui.upload
                , element = layui.element;
            var option = [];
 
            //#region 初始化页面
            laydate.render({
                elem: '#HBeginDate'
                , type: 'datetime'
            });
            laydate.render({
                elem: '#HEndDate'
                , type: 'datetime'
            });
            laydate.render({
                elem: '#HDate'
                , type: 'datetime'
            });
            laydate.render({
                elem: '#HMakeDate'
                , type: 'datetime'
            });
            laydate.render({
                elem: '#HUpDateDate'
                , type: 'datetime'
            });
            laydate.render({
                elem: '#HCheckDate'
                , type: 'datetime'
            });
            laydate.render({
                elem: '#HDeleteDate'
                , type: 'datetime'
            });
            //初始化表格
            set_InitGrid();
            //获取最大单据号
            $.ajax({
                url: GetWEBURL() + "/Web/GetMAXNum",
                type: "GET",
                data: { "HBillType": '3903' },
                success: function (d) {
                    //console.log(d.data);
                    $("#HInterID").val("0");
                    $("#HBillNo").val(d.data[0].HBillNo);
                    PicUpload(); //文件上传
                    PicUploads(); //拍照上传
                }
            });
 
            //当前所在页签
            var cur_title = "基本信息";
            var HCheckNum = 0;
            //监听当前处于哪一个页签,传 HModName 值
            element.on('tab(TabTest)', function (data) {
                cur_title = data.elem.context.innerText;
                if (cur_title == "明细信息") {
                    HCheckNum++;
                }
            })
 
            //#endregion
 
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                var NewRow = { "HDotCheckResult": false, "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "" };
 
                switch (obj.event) {
                    //新增一行
                    case 'btn-AddLine': btnAddLine(NewRow);
                        break;
                }
            });
            //行内事件
            table.on('tool(mainTable)', function (obj) {
                set_GridDelete(obj);   //行内删除
                set_GridCellCheck(obj); //行内快捷键筛选
            });
 
            //进入页面默认光标在条形码上
            $("#HBarCode").focus();
 
            //初始基本信息赋值
            $("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //点检开始时间
            $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));    //点检结束时间
            $("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));      //单据日期
            $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //创建日期
 
            $("#HDeptID").val(sessionStorage["HDeptID"]);            //部门ID
            $("#HDeptName").val(sessionStorage["HDept"]);            //部门
            $("#HManagerID").val(sessionStorage["HBillerID"]);       //负责人ID
            $("#HManagerName").val(sessionStorage["HUserName"]);     //负责人
            $("#HMaker").val(sessionStorage["HUserName"]);     //创建人
 
            //模治具条码是否扫描标记
            var HProcExchBillNoFlag = false;
 
            //条形码回车方法
            $('#HBarCode').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    GetMeesageByBarCode();
                }
            });
 
            //行选择处理(检验结果)
            //form.on('select(HDotCheckResult)', function (data) {
            //    //获取下拉框选中的值
            //    var elem = data.othis.parents('tr');
            //    var dataindex = elem.attr("data-index");
            //    $.each(option.data, function (index, value) {
            //        if (value.LAY_TABLE_INDEX == dataindex) {
            //            value.HDotCheckResult = data.value;//把选中下拉框id值赋值给表格缓存
            //        }
            //    });
            //});
 
            //是否合格
            form.on('checkbox(HDotCheckResult)', function (data) {
                //获取下拉框选中的值
                var elem = data.othis.parents('tr');
                var dataindex = elem.attr("data-index");
                $.each(option.data, function (index, value) {
                    if (value.LAY_TABLE_INDEX == dataindex) {
                        value.HDotCheckResult = data.elem.checked;//把选中下拉框id值赋值给表格缓存
                    }
                });
            });
 
            //确定
            form.on('submit(QueDin)', function (data) {
                GetMeesageByBarCode();
            });
 
            //退出-关闭页面方法
            $('#Cancel').on('click', function () {
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../views/index_Mobile.html";
                });
            })
 
            //提交
            form.on('submit(Saver)', function (data) {//提交
                data.field.HMaker = sessionStorage["HUserName"];//制单人
                var oMain = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sMainSub = oMain + ';' + sSubStr;
 
                if (AllowLoadData(sSubStr)) {
                    $('#Saver').addClass("layui-btn-disabled").attr("disabled", true);//保存按钮禁用
 
                    $.ajax({
                        type: "POST",
                        url: GetWEBURL() + "/Sb_PDA_EquipDotCheckBill/SaveGetEquipDotCheckBillList",
                        async: false,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) {
                                layer.msg("提交成功");
                                $('#Saver').removeClass("buttom_box_little");
                                $('#Saver').addClass("layui-btn-disabled").attr("disabled", true);
                                GetEquipDotCheck_Result();
                            }
                            else {
                                $('#Saver').removeClass("layui-btn-disabled").attr("disabled", false);//保存按钮启用
                                layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                        },
                        error: function (err) {
                            $('#Saver').removeClass("layui-btn-disabled").attr("disabled", false);//保存按钮启用
                            layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    });
                }
 
            });
 
            //新增
            form.on('submit(Add)', function (data) {
                layer.confirm('新增后页面数据将消失?', { icon: 3, title: '提示' }, function (index) {
                    $('#Saver').addClass("buttom_box_little");
                    $('#Saver').addClass("layui-btn-disabled").attr("disabled", false);
                    $("#HBarCode").removeAttr("readonly");//条形码清除只读
                    $("#HBarCode").removeAttr("background-color");//条形码清除背景色
 
                    // 清空表单 (“formData”是表单的id)
                    $("#formData")[0].reset();
                    layui.form.render();
                    option.data = [{ "HDotCheckResult": false, "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "" }];
                    table.render(option);
 
                    $("#HBarCode").focus();
                    //获取最大单据号
                    $.ajax({
                        url: GetWEBURL() + "/Web/GetMAXNum",
                        type: "GET",
                        data: { "HBillType": '3903' },
                        success: function (d) {
                            //console.log(d.data);
                            $("#HInterID").val("0");
                            $("#HBillNo").val(d.data[0].HBillNo);
                        }
                    });
                    $("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //点检开始时间
                    $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));    //点检结束时间
                    $("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));      //单据日期
                    $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //创建日期
                    $("#HMaker").val(sessionStorage["HUserName"]);     //创建人
 
                    layer.close(index);
                });
            })
 
            //#region 退出按钮
            form.on('submit(Cancel)', function () {
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../views/index_Mobile.html";
                });
            })
            //#endregion
 
            //部门弹窗
            form.on('submit(Department)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '部门列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../views/PublicPage/DeptInformation_PDA.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('请选择数据');
                        }
                        $("#HDeptName").val(checkStatus.data[0].HName);
                        $("#HDeptID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    },
                    end: function () {
 
                    },
                    success: function (layero, index) {
 
                    }
                });
            });
 
            //表头信息生产班次弹窗
            form.on('submit(btnShifts)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '生产班次列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true
                    , content: ['../Baseset/基础资料/Gy_Shifts.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('请选择数据');
                        }
                        $("#HShiftsID").val(checkStatus.data[0].HItemID);
                        $("#HShiftsName").val(checkStatus.data[0].班次名称);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
 
            //表头信息设备保养规程
            form.on('submit(HEquipDotCheckRuleInterist)', function () {
                if ($("#HEquipID").val() == 0 || $("#HEquipID").val() == null || $("#HEquipID").val() == "") {
                    layer.alert("请先扫描设备二维码带出设备信息");
                    return;
                }
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '设备点检规程列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../设备管理/设备规程单/Sb_EquipDotCheckRuleList_PDA.html?HEquipID=' + $("#HEquipID").val(), '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('请选择数据');
                        }
                        $("#HEquipDotCheckRuleInterNo").val(checkStatus.data[0].单据号);
                        $("#HEquipDotCheckRuleInterID").val(checkStatus.data[0].hmainid);
                        get_DocCheckItem2();
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            function get_DocCheckItem2() {
                $.ajax({
                    url: GetWEBURL() + "/Web/GetDotCheckRuleItemByDotCheckRuleID",
                    type: "GET",
                    data: { "HDotCheckRuleInterID": $("#HEquipDotCheckRuleInterID").val() },
                    success: function (result) {
                        if (result != null) {
                            if (result.count == 1) {
                                var data = result.data;
                                option.data = [{ "HDotCheckResult": false, "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "" }];
                                table.render(option);
 
                                if (data.length != 0)  //表体数据为空时
                                {
                                    buttonArr = [];//清空数组
 
                                    for (var i = 0; i < data.length; i++) {
                                        var checkrow = {
                                            "HDotCheckItemID": data[i].HDotCheckItemID, "HDotCheckCode": data[i].点检项目代码, "HDotCheckItem": data[i].点检项目,
                                            "HDotCheckPart": data[i].点检部位, "HClaim": data[i].具体要求, "HManagerID": data[i].负责人ID, "HManagerCode": data[i].负责人代码,
                                            "HManagerName": data[i].负责人名称, "HSourceInterID": data[i].点检计划ID == null ? 0 : data[i].点检计划ID, "HSourceEntryID": data[i].点检计划子ID == null ? 0 : data[i].点检计划子ID, "HSourceBillNo": data[i].点检计划单, "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": data[i].默认结论 == 1 ? true : false
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
                                    }
                                    table.reload("mainTable", {
                                        data: buttonArr    //将数据重新载入表格
                                    })
                                }
                            }
                            else {
                                option.data = [{ "HDotCheckResult": false, "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "" }];
                                table.render(option);
                                layer.alert("该设备暂无默认点检记录", { icon: 5 });
                            }
                        }
                    }
                })
            }
 
 
            //初始化表格
            function set_InitGrid() {
                //表头
                columns = [
                    //{ type: 'checkbox' }
                    { templet: '#xuhao', title: '序号', event: "qwe", width: 45 }
                    , { field: 'HDotCheckResult', title: '结果', templet: '#HDotCheckResult', width: 55, unresize: false }
                    , { field: 'HDotCheckItemID', title: '点检项目ID', edit: 'text', hide: true }
                    , { field: 'HDotCheckCode', title: '点检项目代码', edit: 'text', event: "HDotCheckCode", width: 115, hide: true }
                    , { field: 'HDotCheckItem', title: '点检项目', edit: 'text', event: "" }
                    , { field: 'HDotCheckItemClassID', title: '点检项目分类ID', edit: 'text', hide: true }
                    , { field: 'HDotCheckItemClassName', title: '点检项目分类', edit: 'text', event: 'HDotCheckItemClassName' }
                    , { field: 'HDotCheckItemMethodID', title: '点检方法ID', edit: 'text', hide: true }
                    , { field: 'HDotCheckItemMethodName', title: '点检方法', edit: 'text', event: 'HDotCheckItemMethodName' }
                    //, { field: 'HDotCheckResult', title: '点检结果', templet: '#HDotCheckResult', event: 'HDotCheckResult' }
                    , { field: 'HDotCheckPart', title: '点检部位', edit: 'text', event: "" }
                    , { field: 'HClaim', title: '具体要求', edit: 'text' }
                    , { field: 'HManagerID', title: '负责人代码', edit: 'text', hide: true }
                    , { field: 'HManagerCode', title: '负责人代码', edit: 'text', event: 'HManagerCode', width: 150, hide: true }
                    , { field: 'HManagerName', title: '负责人名称', edit: 'text' }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                    , { field: 'HSourceInterID', title: '源单内码', edit: 'text', hide: true }
                    , { field: 'HSourceEntryID', title: '源单子内码', edit: 'text', hide: true }
                    , { field: 'HSourceBillNo', title: '源单单号', edit: 'text', hide: true }
                    , { title: '操作', toolbar: '#barDemo', width: 80 }
                ];
                option = {
                    id: 'mainTable'
                    , elem: '#mainTable'
                    //, toolbar: '#toolbarDemo'
                    , page: false
                    , cellMinWidth: 100
                    , limit: 100
                    , height: 'full-205'
                    , cols: [columns]
                    , done: function (res, curr, count) {
                        option.data = res.data;
                        //去掉下拉框失焦事件否则在下拉框里输入值
                        $('.layui-form-select').find('input').unbind("blur");
                        //表格重载回显下拉框里的数据
                        $('tr').each(function (e) {
                            var $cr = $(this);
                            var dataIndex = $cr.attr("data-index");
                            $.each(option.data, function (index, value) {
                                if (value.LAY_TNDEX == dataIndex) {
                                    //$cr.find('input').val(value.HResult);
                                }
                            });
                        });
                    }
                };
 
                option.data = [{ "HDotCheckResult": false, "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "" }];
                table.render(option);
            }
            //增加一行
            function btnAddLine(NewRow) {
                var tableBak = table.cache["mainTable"]; //获取之前编辑过的表格数据
                buttonArr = [];//清空数组
                for (var i = 0; i < tableBak.length; i++) {
                    buttonArr.push(tableBak[i]);  //将之前的数据存储
                }
                buttonArr.push(NewRow);  //在尾部加一行
                table.reload("mainTable", {
                    data: buttonArr    //将数据重新载入表格
                })
            }
 
            // 表格行内事件删除
            function set_GridDelete(obj) {
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                    layer.confirm('真的删除行么', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            //obj.del();
                            //layer.close(index);
                            var oldData = table.cache["mainTable"];
                            oldData.splice(obj.tr.data('index'), 1);
                            table.reload('mainTable', { data: oldData });
                            layer.close(index);
                        }
                    });
                }
            }
 
            //数据验证
            function AllowLoadData(sSubStr) {
                if (HCheckNum < 1) {
                    layer.msg("请到 明细信息 页签中核对过一次信息后再点击保存按钮", { icon: 5, btn: ['确认'], time: 10000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
                }
 
                if ($("#HBarName").val() == '') {
                    layer.msg("设备没有选择", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
                }
 
                if ($("#HEquipDotCheckRuleInterID").val() == 0 || $("#HEquipDotCheckRuleInterNo").val() == '') {
                    layer.msg("点检规程为空", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
                }
                //判断明细项
                if (typeof (sSubStr) == "undefined" || sSubStr == "" || sSubStr == "[]") {
                    layer.msg("没有点检项目明细记录", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
                }
                if (typeof (sSubStr) != "undefined" && typeof (sSubStr) != "") {
                    sSubStr = JSON.parse(sSubStr);
                    for (var i = 0; i < sSubStr.length; i++) {
                        if (sSubStr[i].HDotCheckCode == "" || sSubStr[i].HDotCheckItemID == "") {
                            layer.msg("明细记录第" + (i + 1) + "行,点检项目代码信息为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            return false;
                        }
                        if (sSubStr[i].HManagerCode == "") {
                            layer.msg("明细记录第" + (i + 1) + "行,负责人代码信息为空!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            return false;
                        }
                        //if (sSubStr[i].HDotCheckResult != true) {
                        //    layer.msg("明细记录第" + (i + 1) + "行,结果信息为勾选!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        //    return false;
                        //}                       
                    }
                    return true;
                }
                else {
                    return true;
                }
            }
 
            //扫条码
            function GetMeesageByBarCode(obj) {  //返回工作中心
                var HBarCode = $('#HBarCode').val();//条形码(流转卡号)(数据库中为单据号)
                if (!HBarCode) {
                    layer.msg("条形码不能为空!")
                    return;
                }
                var index = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Gy_EquipFileBill/txtHBarCode_KeyDown",
                    type: "GET",
                    data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.data.length == 1) {
                            var data = result.data[0];
                            $("#HEquipID").val(data.HInterID);
                            $("#HBarName").val(data.设备名称);
                            $("#HBarSpec").val(data.设备规格);
                            $("#HBarModel").val(data.设备型号);
                            $("#HQty").val(1);
                            $("#HBarCode").attr("readonly", "readonly");//条形码只读
                            $("#HBarCode").css("background-color", "#efefef4d");
                            HProcExchBillNoFlag = true;
                            get_DocCheckItem();
                            layer.close(index);
                        }
                        else {
                            $("#HBarCode").val("");
                            layer.close(index);
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        $("#HBarCode").val("");
                        layer.close(index);
                        layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            }
 
            function get_DocCheckItem() {
                $.ajax({
                    url: GetWEBURL() + "/Web/GetItemByEquipFile",
                    type: "GET",
                    data: { "EquipProjectID": $("#HEquipID").val(), "Type": "DJ", "HDate": $("#HBeginDate").val() },
                    success: function (result) {
                        if (result.code == 1) {
                            var data = result.data;
                            $("#HEquipDotCheckRuleInterID").val(data[0].点检规程ID);
                            $("#HEquipDotCheckRuleInterNo").val(data[0].点检规程单号);
                            $("#HPlanNo").val(data[0].点检计划单);
                            $("#HPlanInterID").val((data[0].点检计划ID == null ? 0 : data[0].点检计划ID) == "" ? 0 : data[0].点检计划ID);
                            $("#HPlanEntryID").val((data[0].点检计划子ID == null ? 0 : data[0].点检计划子ID) == "" ? 0 : data[0].点检计划子ID);
                            var rowdata = [];
                            for (let i = 0; i < data.length; i++) {
                                rowdata.push(
                                    {
                                        "HDotCheckResult": data[i].默认结论 == 1 ? true : false, "HDotCheckItemID": data[i].点检项目ID, "HDotCheckCode": data[i].点检项目代码, "HDotCheckItem": data[i].点检项目名称,
                                        "HDotCheckPart": data[i].点检部位, "HClaim": data[i].具体要求, "HManagerID": data[i].负责人ID, "HManagerCode": data[i].负责人代码,
                                        "HManagerName": data[i].负责人名称, "HSourceInterID": data[i].点检计划ID, "HSourceEntryID": data[i].点检计划子ID, "HSourceBillNo": data[i].点检计划单, "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": ""
                                    }
                                );
                            }
                            option.data = rowdata;
                            table.render(option);
                        }
                        else {
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    }
                })
            }
 
            //表格行内事件快捷键筛选
            function set_GridCellCheck(obj) {
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    if (event.key == "F7") {
                        if (obj.event === 'HDotCheckItemClassName')  //点检项目分类
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '点检项目分类列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true
                                , content: ['../../基础资料/基础资料/Gy_DotCheckItemClassList.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('请选择数据');
                                    }
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HDotCheckItemClassID: checkStatus.data[0].HItemID,
                                        HDotCheckItemClassName: checkStatus.data[0].点检项目分类名称
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false 开启该代码可禁止点击该按钮关闭
                                }
                            });
                        }
                        if (obj.event === 'HDotCheckItemMethodName')  //点检方法
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '点检方法列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true
                                , content: ['../../基础资料/基础资料/Gy_DotCheckItemMethodList.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('请选择数据');
                                    }
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HDotCheckItemMethodID: checkStatus.data[0].HItemID,
                                        HDotCheckItemMethodName: checkStatus.data[0].点检方法名称
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false 开启该代码可禁止点击该按钮关闭
                                }
                            });
                        }
 
                        obj.event = "";
                        return false;
 
                    }
 
                })
            }
 
            upload.render({
                elem: '#cameraBtn', // 绑定元素
                url: GetWEBURL() + "/Sb_EquipDotCheckBill/UploadFile",
                accept: 'images', // 指定允许上传的文件类型
                type: 'camera', // 设置类型为camera,调用相机
                done: function (res) {
                    // 上传完毕回调
                    if (res.status === 200) {
                        // 假设后端返回的是图片地址
                        $('#cameraImg').append('<img src="' + res.data.src + '" alt=""/>');
                    }
                },
                error: function () {
                    // 上传出错的回调
                    console.log('上传出错');
                }
            });
 
            //文件上传
            function PicUpload() {
                //多图片上传
                //多文件列表示例
                var ProImgByList = $('#ProImgByList')
                    , uploadListIns = upload.render({
                        elem: '#testList'
                        , url: GetWEBURL() + "/Sb_EquipDotCheckBill/UploadFile"
                        , accept: 'file'
                        , multiple: true
                        , auto: false
                        , acceptMime: 'image/*'
                        //, bindAction: '#testListAction' //按扭绑定
                        , data: { "HBillNo": $("#HBillNo").val(), "HRemark": $("#HRemark").val(), "HUserName": sessionStorage["HUserName"] }
                        , choose: function (obj) {
                            var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
                            //读取本地文件
                            obj.preview(function (index, file, result) {
                                var tr = $(['<tr id="upload-' + index + '">'
                                    , '<td>' + file.name + '</td>'
                                    , '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
                                    , '<td>等待上传</td>'
                                    , '<td>'
                                    , '<button class="layui-btn layui-btn-xs demo-reload ">上传</button>'
                                    , '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
                                    , '</td>'
                                    , '</tr>'].join(''));
 
                                //单个重传
                                tr.find('.demo-reload').on('click', function () {
                                    obj.upload(index, file);
                                    return false;
                                });
 
                                //删除
                                tr.find('.demo-delete').on('click', function () {
                                    delete files[index]; //删除对应的文件
                                    tr.remove();
                                    uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
                                });
 
                                ProImgByList.append(tr);
                            });
                        }
                        , done: function (res, index, upload) {
                            if (res.code == 1) { //上传成功
                                var tr = ProImgByList.find('tr#upload-' + index)
                                    , tds = tr.children();
                                tds.eq(2).html('<span style="color: #5FB878;">上传成功</span>');
                                tds.eq(3).html(''); //清空操作
                                //tds.eq(3).find('.demo-reload').addClass('layui-hide'); //隐藏上传
                                return delete this.files[index]; //删除文件队列已经上传成功的文件
                            }
                            this.error(index, upload);
                        }
                        , error: function (index, upload) {
                            var tr = ProImgByList.find('tr#upload-' + index)
                                , tds = tr.children();
                            tds.eq(2).html('<span style="color: #FF5722;">上传失败[检查文件名及文件格式]</span>');
                            tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示上传
                        }
                    });
            }
 
            //拍照上传
            function PicUploads() {
                var ProImgByList = $('#ProImgByList')
                    , uploadListIns = upload.render({
                        elem: '#camera'
                        , url: GetWEBURL() + "/Sb_EquipDotCheckBill/UploadFile"
                        , accept: 'file'
                        , multiple: true
                        , acceptMime: 'image/*'
                        , auto: false
                        , data: { "HBillNo": $("#HBillNo").val(), "HRemark": $("#HRemark").val(), "HUserName": sessionStorage["HUserName"] }
                        , choose: function (obj) {
                            var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
                            //读取本地文件
                            obj.preview(function (index, file, result) {
                                var tr = $(['<tr id="upload-' + index + '">'
                                    , '<td>' + file.name + '</td>'
                                    , '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
                                    , '<td>等待上传</td>'
                                    , '<td>'
                                    , '<button class="layui-btn layui-btn-xs demo-reload ">上传</button>'
                                    , '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
                                    , '</td>'
                                    , '</tr>'].join(''));
 
                                //单个重传
                                tr.find('.demo-reload').on('click', function () {
                                    obj.upload(index, file);
                                    return false;
                                });
 
                                //删除
                                tr.find('.demo-delete').on('click', function () {
                                    delete files[index]; //删除对应的文件
                                    tr.remove();
                                    uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
                                });
 
                                ProImgByList.append(tr);
                            });
                        }
                        , done: function (res, index, upload) {
                            if (res.code == 1) { //上传成功
                                var tr = ProImgByList.find('tr#upload-' + index)
                                    , tds = tr.children();
                                tds.eq(2).html('<span style="color: #5FB878;">上传成功</span>');
                                tds.eq(3).html(''); //清空操作
                                //tds.eq(3).find('.demo-reload').addClass('layui-hide'); //隐藏上传
                                return delete this.files[index]; //删除文件队列已经上传成功的文件
                            }
                            this.error(index, upload);
                        }
                        , error: function (index, upload) {
                            var tr = ProImgByList.find('tr#upload-' + index)
                                , tds = tr.children();
                            tds.eq(2).html('<span style="color: #FF5722;">上传失败[检查文件名及文件格式]</span>');
                            tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示上传
                        }
 
                    });
            }
 
            function GetEquipDotCheck_Result() {
                $.ajax({
                    url: GetWEBURL() + "/Sb_EquipDotCheckBill/getbSB_EquipDotCheckBill_Result",
                    type: "GET",
                    data: { "HBillNO": $("#HBillNo").val(), "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.code == 1) {
                            var HLastResult = data1.data[0].最终结论;
                            if (HLastResult=="不合格") {
                                //页面层-自定义
                                layer.open({
                                    type: 2,
                                    skin: 'layui-layer-rim', //加上边框
                                    title: '异常反馈单',
                                    closeBtn: 1,
                                    shift: 2,
                                    area: ['100%', '100%'],
                                    maxmin: true,
                                    content: ['../质量管理/异常反馈/OA_ErrMsgBackBill_PDA.html?OperationType =4&linterid=' + $("#HEquipID").val() +'&HSouceBillType=&HBillNo=&closeType=2' , 'yes'],
                                    end: function () {
                                    },
                                    success: function (layero, index) {
                                    }
                                });
                            }
                        }
                    }
                });
            }
 
            //以上为layui模块
        });
    </script>
</body>
</html>