zrg
2024-08-06 310d7435e49c17bd759e4e115a13d4a367c440a7
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
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>SPC检验单分析</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">
    <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/PubCustom.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src='../../../layuiadmin/lib/extend/echarts.min.js'></script>
    <script src="../../../layuiadmin/soulTable.slim.js"></script>
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
        }
    </style>
</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 class="layui-collapse">
                            <div class="layui-colla-item">
                                <div class="layui-colla-title layui-inline">
                                    <div class="layui-inline">
                                        <span>更多</span>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">开始日期</label>
                                    <div class="layui-input-block">
                                        <input type="date" class="layui-input" id="HBeginDate" style="width:160px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">结束日期</label>
                                    <div class="layui-input-block">
                                        <input type="date" class="layui-input" id="HEndDate" style="width:160px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">部门</label>
                                    <div class="layui-input-block">
                                        <select name="HDeptName" id="HDeptName" lay-verify="required" lay-search class="layui-input">
                                            <!--动态渲染车间-->
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">样本数</label>
                                    <div class="layui-input-block">
                                        <select name="limit" id="limit" lay-verify="required" lay-search class="layui-input">
                                            <!--动态渲染车间-->
                                        </select>
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                </button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
 
                                <div class="layui-colla-content" style="padding: 0px; margin-left: 6%;">
                                    <div class="layui-row" style="margin-top:10px;">
                                        <!--其他条件-->
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">物料代码</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="hidden" class="layui-input" lay-verify="HMaterID" name="HMaterID" id="HMaterID" value="0">
                                                <input type="text" class="layui-input" name="HMaterNumber" id="HMaterNumber" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHMaterID" id="btnHMaterID" style="padding: 0 10px; margin-right: 3px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">物料名称</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterName" id="HMaterName" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">规格型号</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterModel" id="HMaterModel" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">上限</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HUpLimit" id="HUpLimit" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-top:5px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">检验项目</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="hidden" class="layui-input" lay-verify="HQCCheckItemID" name="HQCCheckItemID" id="HQCCheckItemID" value="0">
                                                <input type="text" class="layui-input" name="HQCCheckItemNumber" id="HQCCheckItemNumber" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHQCCheckItemID" id="btnHQCCheckItemID" style="padding: 0 10px;margin-right: 3px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">穴号</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" id="HMouldNum" name="HMouldNum">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">标准值</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HTargetVal" id="HTargetVal">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">下限</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HDownLimit" id="HDownLimit" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-top:5px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">控制上限</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HControlUpperLimit_X" id="HControlUpperLimit_X">
                                            </div>
                                        </div>
                                        <div class="layui-inline" style="margin-left: 48px;">
                                            <label class="layui-form-label" style="width: 85px;">控制下限</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HControlLowerLimit_X" id="HControlLowerLimit_X">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">X中心线</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCenterline_X" id="HCenterline_X">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">PPK</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HPPK" id="HPPK" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-top:5px;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">控制上限</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HControlUpperLimit_S" id="HControlUpperLimit_S">
                                            </div>
                                        </div>
                                        <div class="layui-inline" style="margin-left: 48px;">
                                            <label class="layui-form-label" style="width: 85px;">控制下限</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HControlLowerLimit_S" id="HControlLowerLimit_S">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">S中心线</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCenterline_S" id="HCenterline_S">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">C P K</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" id="HCPK" name="HCPK" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div>
                            <table class="" id="mainTable" lay-filter="mainTable"></table>
                            <div id="histogram_Avg" style="width:99.5%;height:calc(100vh);margin-top:5px;">
 
                            </div>
                            <div id="histogram_Diff" style="width:99.5%;height:calc(100vh);margin-top:15px;">
 
                            </div>
                        </div>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="HideColumn"><i class="layui-icon layui-icon-form"></i>隐藏列设置</button>
                            </div>
                        </script>
                    </form>
                </div>
            </div>
        </div>
    </div>
 
    <script>
        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 option = [];
            var HModName = "QC_InspectionFormReport";
            var optionAVG = [];
            var optionS = [];
            //#endregion
 
            //#region 进入页面既加载
 
            //初始化界面
            set_ClearBill();
 
            //#endregion
 
          
 
            //#region 点击事件包括on form事件等
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                switch (obj.event) {
                    //退出
                    case 'btn-exit': Pub_Close(2);
                        break;
                    //隐藏列设置
                    case 'HideColumn':
                        get_HideColumn();
                        break;
                };
            });
 
            //#region 产品编码
            form.on('submit(btnHMaterID)', function (data) {
                btnHMaterID();
            });
        //#endregion
 
            //#region 检验项目
            form.on('submit(btnHQCCheckItemID)', function (data) {
                btnHQCCheckItemID();
            });
        //#endregion
 
            //重置按钮
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
            });
            //查询按钮
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery();
            });
 
            //车间弹窗
            form.on('submit(HWorkShopList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '车间列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/公用基础资料/Gy_DepartmentList.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('请选择数据');
                        }
                        $("#HWorkShopName").val(checkStatus.data[0].部门名称);
                        $("#HWorkShopID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    },
                    end: function () {
 
                    },
                    success: function (layero, index) {
 
                    }
                });
            });
          
            //#endregion
 
            //#region 此页面所有的方法
 
            //初始化界面
            function set_ClearBill() {
                get_Dept();
                get_Limit();
                //初始化时间
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 10), "yyyy-MM-dd"));//开始日期
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));//结束日期
                //初始化表格
                set_InitGrid();
                //get_FastQuery();
                DisPlay_HideColumn();
                set_Line();
            }
 
            //初始化表格
            function set_InitGrid() {
                var columns = [];
 
                //columns.push({ type: 'numbers', title: '序号' });
                columns.push({ field:"Id", title: "序号", width: 70 });
            
                //获取两个月期之间的相差
                var time1 = Date.parse(new Date($("#HBeginDate").val()));//开始时间
                var time2 = Date.parse(new Date($("#HEndDate").val()));//结束时间
                var Days = Math.abs(parseInt((time2 - time1) / 1000 / 3600 / 24));
                //获取年
                var yyyy = new Date($("#HBeginDate").val()).getFullYear();
                //获取月份
                var MM = new Date($("#HBeginDate").val()).getMonth() + 1;
                //获取开始月份的最大天数
                var SumMonth = new Date(yyyy, MM, 0).getDate(); //动态两月之差
                //获取开始日期的天数
                var HBEGINDATE = new Date(new Date($("#HBeginDate").val())).getDate(); //获取开始日期天数
 
                var k = 0;//收集循环次数
                for (var j = 0; j <= (Days - k); j++) {
                    columns.push({ field: Format(yyyy + '/' + MM + '/' + (HBEGINDATE + j), 'yyyy-MM-dd'), title: Format(yyyy + '/' + MM + '/' + (HBEGINDATE + j), 'MM.dd'), width: 120 })
                    //跨年的话 会从一月一号开始
                    if (MM == 12 && (HBEGINDATE + j) == 31) {
                        yyyy += 1;
                        MM = 1;
                        SumMonth = new Date(yyyy, MM, 0).getDate();
                        HBEGINDATE = 0;
                        k += j;
                        j = 0;
                    } else if ((HBEGINDATE + j) == SumMonth) { //跨月 月数加一  天数从一开始
                        HBEGINDATE = 0;
                        MM += 1;
                        SumMonth = new Date(yyyy, MM, 0).getDate();
                        k += j;
                        j = 0;
                    }
                }
 
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , cellMinWidth: 90
                    , limit: 500
                    , loading: false
                    , cols: [columns]
                    , done: function (res, curr, count) {
                        soulTable.render(this);
                    }
                };
                table.render(option);
            }
 
            //加载网格
            function get_Display(sWhere) {
                var wait = layer.load();//遮罩
                $.ajax({
                    url: GetWEBURL() + '/QC_CustomerAppealReport/QC_InspectionFormReport',
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            layer.close(wait);
                            var limit = parseInt($("#limit").val());//样本数
                            if (limit > data1.data.length - 3) {
                                layer.msg("取样数量超过实际数量!", { icon: 5 });
                            } else {
                                var data = [];//列字段数据
                                var col = [];
                                var totalArray = [];
                                //给空的数组赋值
                                for (var key in data1.list) {//循序遍历数组
                                    data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });//从每个对象中提取数据
                                }
                                for (var i = 0; i < data.length; i++) {//遍历data数组重的数据
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120 });
                                }
 
                                option.cols = [col];
                                option.data = data1.data;
                                optionAVG[0] = data1.data[limit + 1];
                                optionS[0] = data1.data[limit + 2];
                                table.render(option);
                                set_Line();
                                set_PPK();
                                set_CPK();
                            }
                          
                        } else {
                            layer.close(wait);
                            layer.alert(data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(wait);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
 
            //PPK计算 x
            function set_PPK() {
                var x_AVG =0;
                var x_SUM = 0;
                var x_PPK = 0;
                var numCount = 0
                var c4 = [0.7979, 0.8862, 0.9213, 0.9400, 0.9515, 0.9594, 0.9650, 0.9693, 0.9727, 0.9754, 0.9776, 0.9794, 0.9810, 0.9823, 0.9835, 0.9845, 0.9854, 0.9862, 0.9869, 0.9876, 0.9882, 0.9887, 0.9892, 0.9896];
 
                for (var j = 1; j < option.cols[0].length; j++) {
                    if (optionAVG.length != 0 || optionS.length != 0) {
                        x_AVG = calc(x_AVG, parseFloat(optionAVG[0][option.cols[0][j].field]), "+");
                    }
                }
                x_AVG = calc(x_AVG, (option.cols[0].length - 1), "/");
                x_AVG = $("#HCenterline_X").val() == "" ? x_AVG : parseFloat($("#HCenterline_X").val());
                $("#HCenterline_X").val(x_AVG);
 
                for (var i = 1; i < option.cols[0].length; i++) {
                    for (var j = 0; j < option.data.length - 3; j++) {
                        numCount += 1;
                        x_SUM = calc(x_SUM, parseFloat(((parseFloat(option.data[j][option.cols[0][i].field]) - x_AVG) ** 2).toFixed(6)), "+")
                       
                    }
                }
 
                x_PPK = Math.sqrt(calc(x_SUM, (numCount - 1), "/"));
 
                var limit = $("#limit").val();
                if (parseInt(limit) >= 9) {
                    $("#HCenterline_S").val(x_PPK.toFixed(4));
                }
 
 
                //上限
                if ($("#HUpLimit").val() != "" && $("#HDownLimit").val() == "") {
                    var HUpLimit = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()), "+"), x_AVG, "-"), calc(calc(3, x_PPK, "*"), c4[option.data.length - 4], "/"), "/");
                    $("#HPPK").val(HUpLimit.toFixed(4));
                }
                //下限
                else if ($("#HDownLimit").val() != "" && $("#HUpLimit").val() == "") {
                    var HDownLimit = calc(calc(x_AVG, calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+"), "-"), calc(calc(3, x_PPK, "*"), c4[option.data.length - 4], "/"), "/");
                    $("#HPPK").val(HDownLimit.toFixed(4));
                } else {
                    var HUpLimit = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()), "+"), x_AVG, "-"), calc(calc(3, x_PPK, "*"), c4[option.data.length - 4], "/"), "/");
                    var HDownLimit = (x_AVG - calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+")) / ((3 * x_PPK) / c4[option.data.length - 4]);
                    $("#HPPK").val(HUpLimit > HDownLimit ? HDownLimit.toFixed(4) : HUpLimit.toFixed(4));
                }
            }
 
             //CPK计算 s
            function set_CPK() {
                var x_AVG = 0;
                var s_AVG = 0;
                var s_CPK = 0;
                var d2 = [1.128, 1.693, 2.059, 2.326, 2.534, 2.704, 2.847, 3.078, 3.173, 3.258, 3.336, 3.407, 3.472, 3.532, 3.588, 3.640, 3.689, 3.735, 3.778, 3.819, 3.858, 3.895, 3.931];
 
                for (var j = 1; j < option.cols[0].length; j++) {
                    if (optionAVG.length != 0 || optionS.length != 0) {
                        s_AVG = calc(s_AVG, parseFloat(optionS[0][option.cols[0][j].field]), "+");
                    }
                }
                s_AVG = calc(s_AVG, (option.cols[0].length - 1), "/")
                s_AVG = $("#HCenterline_S").val() == "" || "0" ? s_AVG : parseFloat($("#HCenterline_S").val());
                $("#HCenterline_S").val(s_AVG);
 
                var limit = $("#limit").val();
                if (parseInt(limit) < 9) {
                    $("#HCenterline_S").val(s_AVG.toFixed(4));
                }
 
                for (var j = 1; j < option.cols[0].length; j++) {
                    if (optionAVG.length != 0 || optionS.length != 0) {
                        x_AVG = calc(x_AVG, parseFloat(optionAVG[0][option.cols[0][j].field]), "+");
                    }
                }
                x_AVG = calc(x_AVG, (option.cols[0].length - 1), "/");
                x_AVG = $("#HCenterline_X").val() == "" ? x_AVG : parseFloat($("#HCenterline_X").val());
                $("#HCenterline_X").val(x_AVG);
 
                s_CPK = calc(s_AVG, d2[option.data.length - 4], "/");
 
                //上限
                if ($("#HUpLimit").val() != "" && $("#HDownLimit").val() == "") {
                    var HUpLimit = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()),"+"), s_AVG, "-"), (3 * s_CPK), "/");
                    $("#HCPK").val(HUpLimit.toFixed(4));
                }
                //下限
                else if ($("#HDownLimit").val() != "" && $("#HUpLimit").val() == "") {
                    var HDownLimit = calc(calc(s_AVG, calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+"), "-"), (3 * s_CPK), "/");
                    $("#HCPK").val(HDownLimit.toFixed(4));
                } else {
                    var HUpLimit = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()), "+"), s_AVG, "-"), (3 * s_CPK), "/");
                    var HDownLimit = calc(calc(s_AVG, calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+"), "-"), (3 * s_CPK), "/");
                    if (s_CPK == 0) {
                        $("#HCPK").val(0);
                    } else {
                        $("#HCPK").val(HUpLimit > HDownLimit ? HDownLimit.toFixed(4) : HUpLimit.toFixed(4));
                    }
 
                }
            }
 
            function calc(num1, num2, calcStr) {
                var str1, // 转换为字符串的数字
                    str2,
                    ws1 = 0,// ws1,ws2 用来存储传入的num的小数点后的数字的位数
                    ws2 = 0,// 赋默认值,解决当整数和小数运算时倍数计算错误导致的结果误差 
                    bigger,// bigger和smaller用于加,减,除法找出小的那个数字,给后面补0,解决位数不对从而造成的计算错误的问题;乘法需要将结果除两个数字的倍数之和
                    smaller,// 例如:加减除法中1.001 + 2.03 ,如果不给2.03进行补0,最后会变成1001+203,数字错位导致结果错误;乘法中1.12*1.1会放大为112*11,所以结果需要除以1000才会是正确的结果,112*11/1000=1.232
                    zeroCount, // 需要补充0的个数
                    isExistDot1, // 传入的数字是否存在小数点
                    isExistDot2,
                    sum,
                    beishu = 1;
                // 将数字转换为字符串
                str1 = num1.toString();
                str2 = num2.toString();
                // 是否存在小数点(判断需要计算的数字是不是包含小数)
                isExistDot1 = str1.indexOf('.') != -1 ? true : false;
                isExistDot2 = str2.indexOf('.') != -1 ? true : false;
                // 取小数点后面的位数
                if (isExistDot1) {
                    ws1 = str1.split('.')[1].length;
                }
 
                if (isExistDot2) {
                    ws2 = str2.split('.')[1].length;
                }
                // 如ws1 和 ws2 无默认值,如果num1 或 num2 不是小数的话则 ws1 或 ws2 的值将为 undefined 
                // bigger 和 smaller 的值会和预期不符
                bigger = ws1 > ws2 ? ws1 : ws2;
                smaller = ws1 < ws2 ? ws1 : ws2;
 
                switch (calcStr) {
                    // 加减法找出小的那个数字,给后面补0,解决位数不对从而造成的计算错误的问题
                    // 例如:1.001 + 2.03 ,如果不给2.03进行补0,最后会变成1001+203,数字错位导致结果错误
                    case "+":
                    case "-":
                    case "/":
                        zeroCount = bigger - smaller;
                        for (var i = 0; i < zeroCount; i++) {
                            if (ws1 == smaller) {
                                str1 += "0";
                            }
                            else {
                                str2 += "0";
                            }
                        }
                        break;
                    case "*":
                        // 乘法需要将结果除两个数字的倍数之和
                        bigger = bigger + smaller;
                        break;
                    default:
                        return "暂不支持的计算类型,现已支持的有加法、减法、乘法、除法";
                        break;
                }
 
                // 去除数字中的小数点
                str1 = str1.replace('.', '');
                str2 = str2.replace('.', '');
 
                // 计算倍数,例如:1.001小数点后有三位,则需要乘 1000 变成 1001,变成整数后精度丢失问题则不会存在
                for (var i = 0; i < bigger; i++) {
                    beishu *= 10; // 等价于beishu = beishu * 10;
                }
                num1 = parseInt(str1);
                num2 = parseInt(str2);
                // 进行最终计算并除相应倍数
                switch (calcStr) {
                    case "+":
                        sum = (num1 + num2) / beishu;
                        break;
                    case "-":
                        sum = (num1 - num2) / beishu;
                        break;
                    case "*":
                        sum = (num1 * num2) / beishu;
                        break;
                    case "/":
                        sum = num1 / num2;
                        /* 除数与被除数同时放大一定倍数,不影响结果,
                        所以对数字进行放大对应倍数并进行补0操作后不用另对倍数做处理 */
                        break;
                    default:
                        return "暂不支持的计算类型,现已支持的有加法、减法、乘法、除法";
                }
 
                return sum;
            }
 
            //折线图
            function set_Line() {
                //#region【折线图】
                //平均值
                var chartDom = document.getElementById('histogram_Avg');
                var myChart = echarts.init(chartDom);
                var option_ZXT_Avg;
 
                let H_X = [];//x轴标题
                let HAvg = [];//平均值
                let HDifference = [];//差值
 
                for (var j = 1; j < option.cols[0].length; j++) {
                    if (optionAVG.length != 0 || optionS.length != 0) {
                        HAvg.push(optionAVG[0][option.cols[0][j].field]);
                        HDifference.push(optionS[0][option.cols[0][j].field]);
                    } else {
                        HAvg.push(0);
                        HDifference.push(0);
                    }
                }
 
                for (let i = 1; i < option.cols[0].length; i++) {
                    H_X.push(option.cols[0][i].field);
                }
 
                option_ZXT_Avg = {
                    title: {
                        text: '平均值',
                        left: 'center'
                    }, 
                    grid: {
                        x: '3%', //相当于距离左边效果:padding-left
                        //y: '5%',  //相当于距离上边效果:padding-top
                        bottom: '5%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'category',
                        data: H_X
                    },
                    yAxis: {
                        type: 'value',
                        min: parseFloat($("#HDownLimit").val()) != 0 ? calc((parseFloat($("#HTargetVal").val()), calc(parseFloat($("#HDownLimit").val()), 1.3), "*"), "+") : 0, // 设置最小值
                        max: calc(parseFloat($("#HTargetVal").val()), calc(parseFloat($("#HUpLimit").val()), 1.3, "*"), "+"), // 设置最大值
                        interval: calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HDownLimit").val()), "-"), 10, "/"), // 设置间距
                    },
                    series: [
                        {
                            data: HAvg,
                            type: 'line',
                            areaStyle: {//填充的颜色
                                color: {//线性渐变前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置
                                    type: 'linear',
                                    x: 0,
                                    y: 1,
                                    x2: 0,
                                    y2: 0,
                                    colorStops: [{
                                        offset: 0, color: 'rgba(232,247,247)' // 0% 处的颜色
                                    }, {
                                        offset: 1, color: 'rgba(183,252,252)' // 100% 处的颜色
                                    }],
                                    globalCoord: false// 缺省为 false
                                }
                            },
                            itemStyle: { normal: { label: { show: true } } },
                            markLine: {
                                symbol: 'none',//去掉箭头
                                data: [
                                    { yAxis: parseFloat($("#HTargetVal").val()) + parseFloat($("#HUpLimit").val()), lineStyle: { color: '#FF1D00' }, label: { color: '#FF1D00', fontSize: 10 } },
                                    {
                                        yAxis: parseFloat($("#HTargetVal").val()) + parseFloat($("#HDownLimit").val()), lineStyle: { color: '#FF1D00' }, label: { color: '#FF1D00', fontSize: 10 }
                                    },
                                    {
                                        yAxis: parseFloat($("#HControlUpperLimit_X").val()), lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }
                                    },
                                    {
                                        yAxis: parseFloat($("#HControlLowerLimit_X").val()), lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }
                                    }
                                    ,
                                    {
                                        yAxis: parseFloat($("#HCenterline_X").val()), lineStyle: { color: '#6dadf0' }, label: { color: '#6dadf0', fontSize: 10 }
                                    }
                                ]
                            },
                        }
                    ]
                };
                option_ZXT_Avg && myChart.setOption(option_ZXT_Avg);
 
                //差值
                var chartDom = document.getElementById('histogram_Diff');
                var myChart = echarts.init(chartDom);
                var option_ZXT_Diff;
 
                option_ZXT_Diff = {
                    title: {
                        text: '差值',
                        left: 'center'
                    },
                    grid: {
                        x: '3%', //相当于距离左边效果:padding-left
                        //y: '5%',  //相当于距离上边效果:padding-top
                        bottom: '5%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'category',
                        data: H_X
                    },
                    yAxis: {
                        type: 'value'
                    },
                    series: [
                        {
                            data: HDifference,
                            type: 'line',
                            areaStyle: {//填充的颜色
                                color: {//线性渐变前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置
                                    type: 'linear',
                                    x: 0,
                                    y: 1,
                                    x2: 0,
                                    y2: 0,
                                    colorStops: [{
                                        offset: 0, color: 'rgba(255,240,170,0)' // 0% 处的颜色
                                    }, {
                                        offset: 1, color: 'rgba(255,240,170,1)' // 100% 处的颜色
                                    }],
                                    globalCoord: false// 缺省为 false
                                }
                            },
                            itemStyle: { normal: { label: { show: true } } },
                            markLine: {
                                symbol: 'none',//去掉箭头
                                data: [
                                    {
                                        yAxis: parseFloat($("#HControlUpperLimit_S").val()) , lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }
                                    },
                                    {
                                        yAxis: parseFloat($("#HControlLowerLimit_S").val()), lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }
                                    }
                                    ,
                                    {
                                        yAxis: parseFloat($("#HCenterline_S").val()), lineStyle: { color: '#6dadf0' }, label: { color: '#6dadf0', fontSize: 10 }
                                    }
                                ]
                            },
                        }
                    ]
                };
                option_ZXT_Diff && myChart.setOption(option_ZXT_Diff);
 
            //#endregion
 
            }
 
            //生产车间
            function get_Dept() {
                //获取车间列
                var HDeptName = '<option value="0" style="color:red;" selected>全部车间</option>';
                $.ajax({
                    type: "get",
                    url: GetWEBURL() + "/Sc_ICMOBill/GetHDeptList",
                    async: false,
                    data: { "HOrgID": sessionStorage["OrganizationID"] },
                    success: function (result) {
                        if (result.count == 1) { // 说明验证成功了,
                            var data = result.data;
                            for (var i = 0; i < data.length; i++) {
                                HDeptName += '<option  style="color:blue;"  value="' + data[i].HItemID + '" >' + data[i].HName + '</option>';
                            }
 
                            $("#HDeptName").append(HDeptName);
                            form.render('select');
                        }
                        layer.closeAll("loading");
                    }
                })
            }
 
            //样本数量
            function get_Limit() {
                var limit = "";
                for (var i = 1; i <= 50; i++) {
                    limit += '<option  style="color:blue;"  value="' + i + '" >' + i + '</option>';
                }
                $("#limit").append(limit);
                form.render('select');
            }
 
            //快速过滤
            function get_FastQuery() {
                var HBeginDate = $("#HBeginDate").val();//下达日期 开始日期
                var HEndDate = $("#HEndDate").val();//结束日期
                var HDeptID = $("#HDeptName").val();//车间
                var limit = $("#limit").val();//样本数
                var HMaterID = $("#HMaterID").val();//物料
                var HQCCheckItemID = $("#HQCCheckItemID").val();//检验项目
                var HMouldNum = $("#HMouldNum").val();//穴号
 
                if (limit == 0) {
                    return layer.msg("样本数量不能为0!");
                }
 
                if (HMaterID == 0) {
                    return layer.msg("物料不能为空!");
                }
 
                if (HQCCheckItemID == 0) {
                    return layer.msg("检验项目不能为空!");
                }
 
                sWhere = {
                    HBeginDate: HBeginDate
                    , HEndDate: HEndDate
                    , HDeptID: HDeptID
                    , limit: limit
                    , HMaterID: HMaterID
                    , HQCCheckItemID: HQCCheckItemID
                    , HMouldNum: HMouldNum
                }
                //初始化表格
                set_InitGrid();
                get_Display(JSON.stringify(sWhere));
                //调用接口后清空sWhere缓存
                sWhere = "";
            }
 
            //物料列表
            function btnHMaterID() {
                layer.open({
                    type: 2 //类型
                    , skin: 'layui-layer-rim'//加上边框
                    , area: ['90%', '90%']//大小
                    , title: '物料列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_Material.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('请选择数据');
                        }
                        //获取数据
                        $("#HMaterID").val(checkStatus.data[0].HItemID);
                        $("#HMaterNumber").val(checkStatus.data[0].物料代码);
                        $("#HMaterName").val(checkStatus.data[0].物料名称);
                        $("#HMaterModel").val(checkStatus.data[0].规格型号);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            }
 
            //检验项目列表
            function btnHQCCheckItemID() {
                layer.open({
                    type: 2 //类型
                    , skin: 'layui-layer-rim'//加上边框
                    , area: ['90%', '90%']//大小
                    , title: '检验项目列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_CheckItem.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('请选择数据');
                        }
                        //获取数据
                        $("#HQCCheckItemID").val(checkStatus.data[0].HItemID);
                        $("#HQCCheckItemNumber").val(checkStatus.data[0].代码);
 
                        btnCheckProjectList();
                     
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            }
 
            //检验方案
            function btnCheckProjectList() {
                var sWheres = " and 检验项目代码='" + $("#HQCCheckItemNumber").val() + "'";
                var wait = layer.load();//遮罩
                $.ajax({
                    url: GetWEBURL() + '/QC_Management/MES_QC_CheckProjectListProjectDetaiList',
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWheres, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            layer.close(wait);
                            $("#HUpLimit").val(data1.data[0].上限值);
                            $("#HDownLimit").val(data1.data[0].下限值);
                            $("#HTargetVal").val(data1.data[0].目标值);
                            //$("#HControlUpperLimit").val(data1.data[0].控制上限);
                            //$("#HControlLowerLimit").val(data1.data[0].控制下限);
                        } else {
                            layer.close(wait);
                            layer.alert(data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(wait);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
 
            //重置过滤条件
            function set_ClearQuery() {
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 10), "yyyy-MM-dd"));//开始日期
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));//结束日期
                $("#HICMOBillNo").val("");
                $("#HProcExchBillNo").val("");
                $("#HName").val("");
                $("#HBillNo").val("");
                $("#HMaterNumber").val("");
                $("#F_BSV_WYID").val("");
                $("#HState").val("0")
                $("#ColContent").val("");
                $("#ColName").val("0");
                $("#Comparator").val("0");
                $("input[name='checkWRuku']").prop("checked", false);
                form.render()
                sWhere = "";
            }
 
            //隐藏列设置
            function get_HideColumn() {
                var colName = "";
                for (var i = 1; i < option.cols[0].length - 1; i++) {
                    colName += option.cols[0][i]["title"] + ",";
                }
 
                colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim" //加上边框
                    , title: "隐藏列设置"  //标题
                    , closeBtn: 1  //窗体右上角关闭 的 样式
                    , shift: 2 //弹出动画
                    , area: ["50%", "90%"] //窗体大小
                    , maxmin: true //设置最大最小按钮是否显示
                    , content: ['../../基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //刷新表格数据
                        DisPlay_HideColumn();
                        //更新表格缓存的数据
                        layer.close(index);//关闭弹窗
                    }
                })
            }
 
            //显示列数据
            function DisPlay_HideColumn() {
                $.ajax({
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                    type: "GET",
                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.data.length != 0) {
 
                            var dataCol = [];//数据库查询出的列数据
                            var titleData = [];//不需要显示的字段 可扩展
 
                            dataCol = data1.data[0].HGridString.split(',');
 
                            for (var i = 0; i < option.cols[0].length - 2; i++) {
                                if (dataCol[i]) {
                                    var dataCols = dataCol[i].split('|');
                                }
                                //隐藏列
                                if (dataCols[1] == 1) {
                                    option.cols[0][i + 1]["hide"] = true;
                                }
                                //设置内容字体大小
                                if (data1.data[0].HFontSize != 0) {
                                    option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
                                } else {
                                    option.cols[0][i + 1]["style"] = "font-size:100%";
                                }
                                //设置列宽
                                if (dataCols[3] > 0) {
                                    option.cols[0][i + 1]["width"] = dataCols[3];
                                }
                                //显示列
                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
                                    option.cols[0][i + 1]["hide"] = false;
                                }
                                //字体所在位置(左 居中 右)
                                switch (dataCols[2]) {
                                    case "L":
                                        option.cols[0][i + 1]["align"] = "left";
                                        break;
                                    case "M":
                                        option.cols[0][i + 1]["align"] = "center";
                                        break;
                                    case "R":
                                        option.cols[0][i + 1]["align"] = "right";
                                        break;
                                }
                            }
 
                            //取消冻结列
                            for (var i = 1; i < option.cols[0].length - 1; i++) {
                                if (option.cols[0][i]["fixed"] != null) {
                                    option.cols[0][i]["fixed"] = null;
                                }
                                else {
                                    break;
                                }
                            }
                            //冻结列
                            if (data1.data[0].HFixCols != 0) {
                                for (var i = 0; i < data1.data[0].HFixCols; i++) {
                                    if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
                                        data1.data[0].HFixCols += 1;
                                    }
                                    option.cols[0][i + 1]["fixed"] = "left";
                                }
                            }
                            table.render(option);
                        } else {
                            table.render(option);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                })
            }
 
            //列明显示下拉框
            function ColFilter() {
                var Organization = '<option  value="0" selected="selected" ></option>';
                for (var i = 1; i < option.cols[0].length; i++) {
                    if (option.cols[0][i].hide != true) {
                        Organization += '<option  style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>';
                    }
                }
                $("#ColName").empty();
                $("#ColName").append(Organization);
                form.render('select');
            }
 
 
            //#endregion
        });
    </script>
</body>
</html>