zhangyanpeng
2024-05-29 1f227a1cf627526701c652ba84bae3e430bba8d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <title>经销商MS</title>
    <link href="../css/main.css?v=2024052301" rel="stylesheet">
    <link href="../../../css/control.css?v=2024052301" rel="stylesheet">
    <link href="../../../css/page.css?v=2024052301" rel="stylesheet">
    <link href="../../../css/icon/iconfont.css?v=2024052301" rel="stylesheet">
    <link href="../../../js/vue/element-ui/lib/theme-chalk/index.css" rel="stylesheet">
    <link href="../../../img/org/head.png" rel="shortcut icon" type="image/x-icon">
    <link href="../../../css/myelement.css?v=2024052301" rel="stylesheet">
    
    <script src="../../../js/jquery-3.5.1.min.js"></script>
    <script src="../../../js/vue/vue.js"></script>
    
    <script src="../../../js/config.js?v=2024052301"></script>
    <script src="../../../data/data.js"></script>
    <script src="../../../js/vue/elementDefault.js"></script>
    <script src="../../../js/vue/element-ui/lib/index.js"></script>
    <script src="../../../js/Sortable.js"></script>
    <script src="../../../js/vue/page.js?v=2024052301"></script>
    <script src="../../../js/foundation.js?v=2024052301"></script>
    <script src="../../../js/control.js?v=2024052301"></script>
    <script src="../../../js/loadJsCss.js"></script>
    <script src="../../../js/myelement.js?v=2024052301"></script>
    
</head>
    
<body style="margin: 0px;">
    <div id="app">
        <!-- 开发工具栏  -->
        <div v-if="isshowtools" v-drag class="editor_popup">
            <el-card class="box-card" ref="msgSpan">
                <div class="tools-top" >
                  <span>工具栏</span>
                </div>
                <div class="tools-news" ref="msgtop" align="center">
                    <iframe style="width: 100%; height: 100%;" frameborder="0" :src="editor_url"></iframe>
                </div>
            </el-card>
        </div>
        
        <div class="client">
            <!-- 右侧顶部 -->
            <div id="pnl_header" class="header">
                <!-- 顶部菜单的收起展开 -->
                <div v-show="cardtablist.length > 1" id="btn_toggle" class="but_toggle">
                    <el-popover v-model="showTopMenu" placement="bottom-start"  trigger="hover" popper-class="h_top_menu ">
                      <template v-for="pageno in cardlist_pagesize">
                          <div v-if="cardtablist[(cardlist_pagesize * (pagenum - 1)) + (pageno - 1)]" 
                          :class="['h_card', selectCard.id == cardtablist[(cardlist_pagesize * (pagenum - 1)) + (pageno - 1)].id ? 'active_card' : '']" 
                          style="">
                              <el-card shadow="always" style="width: 100%; height: 100%; position: relative;">
                                  <div class="h_card_menu" 
                                  @click="tabCardClick(cardtablist[(cardlist_pagesize * (pagenum - 1)) + (pageno - 1)])">
                                    <div v-if="cardtablist[(cardlist_pagesize * (pagenum - 1)) + (pageno - 1)].icon" class="h_card_img">
                                        <i :class="cardtablist[(cardlist_pagesize * (pagenum - 1)) + (pageno - 1)].icon"></i>
                                    </div>
                                    <div class="h_card_title">
                                          <div class="card_name">
                                              <span>{{cardtablist[(cardlist_pagesize * (pagenum - 1)) + (pageno - 1)].title}}</span>
                                          </div>
                                      </div>
                                  </div>
                              </el-card>
                          </div>
                      </template>
                      <div slot="reference" style="height: 52px; line-height: normal; padding-top: 13px;box-sizing: border-box;">
                          <span class="el-icon-s-grid h_top_button" style=""></span>
                      </div>
                    </el-popover>
                </div>
                <div v-show="cardtablist.length > 1" style="float: left; color: #fff; margin-left: 10px; height: 100%; line-height: 52px;">
                    {{selectCard.title}}
                </div>
                
                <!-- 顶部菜单 -->
                <div id="topMenu" style="float: left; margin-left: 20px; height: 100%; line-height: 52px;">
                    <span style="color: #fff; font-family: cursive;">欢迎进入 {{lbl_title}}{{servertype}}</span>
                </div>
                
                <!-- 顶部右侧工具栏 -->
                <div style="float: right; margin-left: 10px; height: 52px; line-height: 52px; overflow: hidden; font-size: 14px; color: #fff;">
                    <!-- 通知提醒 -->
                    <div v-if="!isCustomer && !isSale" class="main_message" style="float: left; padding: 0px 5px" @click="openApproval">
                        <div style="float: left; width: 90px; position: relative;" >
                            <span id="SH_message_ld" class="">
                                <span class="iconfont icon-tongzhi bar_btn_icon" style="font-size: 24px; vertical-align: middle;"></span>
                                <span style="font-size: 12px; vertical-align: middle;">待审批</span>
                            </span>
                            <div v-if="noticeObj.cnt" class="alert-num">{{noticeObj.cnt && noticeObj.cnt > 99 ? "99+" : noticeObj.cnt}}</div>
                        </div>
                    </div>
                    <!-- 分隔符 -->
                    <div v-if="!isCustomer && !isSale" style="float: left;">
                        <el-divider direction="vertical"></el-divider>
                    </div>
                    <!-- 用户信息 -->
                    <div class="main_user" style="float: left; padding: 0px 5px" > <!-- @click="onshowAccount" -->
                        <!-- 所属公司 -->
                        <div v-if="roleselect.company_name" style="float: left; position: relative;" >
                            <span class="">
                                <span style="font-size: 12px;vertical-align: middle;">{{roleselect.company_name}}</span>
                                <span style="font-size: 12px;vertical-align: middle;">{{roleselect.bu_name}}</span>
                            </span>
                        </div>
                    </div>
                    <!-- 分隔符 -->
                    <div v-if="roleselect.company_name" style="float: left;">
                        <el-divider direction="vertical"></el-divider>
                    </div>
                    <!-- 角色信息 -->
                    <div v-if="userinfo.actors && userinfo.actors.length" class="main_sysrole" style="float: right; height: 52px; line-height: 52px; padding: 0px 5px; font-size: 14px; color: #fff;">
                        <div class="h_role_list" style="display: table-cell; vertical-align: middle;">
                            <!-- 切换角色/岗位 -->
                            <el-popover v-model="showCapacitys" placement="bottom-start" width="430" trigger="click" popper-class="h_capacitys" @show="top_popup_background = true">
                                <div class="h_sysrole">
                                    <div style="border-bottom: 1px solid #999; padding: 3px 10px;">
                                        <div style="margin-right: 10px; float: left; height: 20px;">
                                            <img src="../../../img/org/head.png" style="height: 100%; width: auto; border-radius: 50%"/>
                                        </div>
                                        <div style="text-align: center; display: inline-block;">
                                            <span v-if="userinfo.employee"  class="aaa1">
                                                {{userinfo.employee.code}} {{userinfo.employee.name}}
                                            </span>
                                            <span v-else-if="userinfo.org && userinfo.org.code"  class="aaa2">
                                                {{userinfo.org.code}} {{userinfo.org.name}}
                                            </span>
                                            <span v-else class="aaa3">
                                                {{userinfo.name}}
                                            </span>
                                        </div>
                                    </div>
                                    <div v-for="(role, k) in userinfo.actors" :key="'c' + k" class="h_row_capacitys" @click="setRole(role.id)">
                                        <div style="width: 330px; text-align: center; display: inline-block;">
                                            <div style="text-align: left; line-height: 20px;">{{role.name}}<span style="float: right;">{{role.position}}</span></div>
                                            <div style="text-align: left;line-height: 20px;">{{role.company_name}} {{role.bu_name}}</div>
                                        </div>
                                        <div style="width: 50px; text-align: center; line-height: 40px;float: right;">
                                            <i v-if="roleselect.id == role.id" class="el-icon-circle-check" style="color: #67c23a;"></i>
                                            <i v-else class="el-icon-circle-check" style="color: #fff0;"></i>
                                        </div>
                                    </div>
                                </div>
                                
                                <div v-if="buttonsconfig.id" class="h_sysrole_menu">
                                    <!-- 主题设置 -->
                                    <!-- <el-button type="default" :icon="buttonsconfig.theme.icon" @click="onThemeConfig">{{buttonsconfig.theme.name}}</el-button> -->
                                    <el-button type="primary" plain :icon="buttonsconfig.editpassword.icon" @click="changePw()">{{buttonsconfig.editpassword.name}}</el-button>
                                    <el-button type="warning"  :icon="buttonsconfig.goout.icon" @click="againLogout()" style="float: right;">{{buttonsconfig.goout.name}}</el-button>
                                </div>
                                
                                <div slot="reference" style="height: 52px; box-sizing: border-box;">
                                    <span style="font-size: 12px;">
                                        <img src="../../../img/org/head.png" style="height: 30px; border-radius: 50%; vertical-align: middle; display: inline-block;"/>
                                        <span>&nbsp;&nbsp;</span>
                                        <span v-if="roleselect.source == 'Org'">{{userinfo.org.name}}</span>
                                        <span v-else>{{roleselect.username}}</span>
                                        <span>&nbsp;&nbsp;</span>
                                        {{roleselect.name}} <i class="el-icon-caret-bottom"></i>
                                    </span>
                                </div>
                            </el-popover>
                        </div>
                    </div>
                </div>
                
                <div v-if="userinfo.org && userinfo.org.isfreeze" style="float: right; margin-left: 10px; line-height: 52px; font-size: 14px; color: #fff;">
                    <el-popover
                        placement="bottom"
                        title="说明"
                        width="200"
                        trigger="hover"
                        content="重要提醒:贵司资质处于冻结状态中,在未完成最新资质证照审批前,只能进行订单查询、收货、植入上报、库存管理相关功能操作">
                        <el-tag slot="reference" size="small" type="danger">冻结状态</el-tag>
                    </el-popover>
                </div>
            </div>
            
            <!-- 左侧 -->
            <aside id="leftbar" class="left">
                <!-- 标题或Logo -->
                <div class="logoArea" >
                    <div class="logoText" style="overflow: hidden; line-height: 52px;" align="center">
                        <span class="close_logo">{{simplify_title}}</span>
                        <div style="height: 52px; display: flex; justify-content: center; align-items: center;">
                               <img src="../../../img/org/logo.png" style="height: 75%">
                            <!-- style="height: 34px" -->
                        </div>
                    </div>
                </div>
                <!-- 左侧展开菜单 -->
                <div id="leftExpand" @click="btnToggleClick" 
                :class="[isshowmenu ?  'el-icon-d-arrow-left left-expand_right' : 'el-icon-d-arrow-right left-expand_left', 'left-expand', 'scroll']"></div>
                <div id="leftMenu" class="leftMenu scroll"></div>
                
                <!-- 当前日期 -->
                <div class="left-bottom">
                    <span class="period-icon iconfont icon-date"></span>
                    <span>当前期间&nbsp;:&nbsp;</span><span id="time">{{yearmonth}}</span>
                </div>
            </aside>
            
            <!-- 左侧收缩菜单 -->
            <div id="leftRetract" @click="btnToggleClick" 
            :class="[isshowmenu ?  'el-icon-d-arrow-left left-expand_right' : 'el-icon-d-arrow-right left-expand_left', 'left-expand', 'scroll']"></div>
            <div class="left-menu-expand" v-if="!isshowmenu">
                <el-menu
                    background-color="#2a2f35"
                    class="el-menu-vertical-demo"
                    :collapse="!isshowmenu"
                    @select="selectMenu"
                    >
                    <template v-for="m_ in leftMenuLsit">
                        <el-submenu :index="m_.id" v-if="m_.children" popper-class="v_menu_p">
                          <template slot="title">
                              <i :class="m_.icon"></i>
                              <span slot="title">{{m_.title}}</span>
                          </template>
                          <template v-for="m_c in m_.children">
                              <el-submenu :index="m_c.id" v-if="m_c.children" popper-class="v_menu_p">
                                <template slot="title">
                                    <i :class="m_c.icon"></i>
                                    <span slot="title">{{m_c.title}}</span>
                                </template>
                                <el-menu-item v-for="m_cc in m_c.children" :key="m_cc.id" :index="m_cc.id" >
                                    <i :class="m_cc.icon"></i>
                                    <span slot="title">{{m_cc.title}}</span>
                                </el-menu-item>
                              </el-submenu>
                              <el-menu-item v-else :index="m_c.id">
                                  <i :class="m_c.icon"></i>
                                  <span slot="title">{{m_c.title}}</span>
                              </el-menu-item>
                          </template>
                        </el-submenu>
                        <el-menu-item v-else :index="m_.id">
                            <i :class="m_.icon"></i>
                            <span slot="title">{{m_.title}}</span>
                        </el-menu-item>
                    </template>
                </el-menu>
            </div>
            
            <!-- 右侧主体容器 pointer-events-->
            <div id="content" class="content"></div>
        </div>
        
        <!-- 主题设置弹窗 -->
        <div v-if="isshowthemeconfig" class="my-theme">
            <div class="pnl-header">主题设置</div>
            <div class="pnl-board">
                <h-form
                    ref="form1"
                    :form-attr="formAttr"
                    :table-fields="formFields"
                    :form-data="formData"
                    :table-field-click="formfieldClick"
                >
                </h-form>
            </div>
        </div>
        
        <!-- 背景阴影 -->
        <div v-if="top_popup_background" @click="onContentClick" style="background-color: #eeeeee00; position: absolute; width: 100vw; height: 100vh; z-index: 2000;">
            
        </div>
    </div>
    
</body>
    <script type="text/javascript">
        var toolbar, treeMenu, tab;
        var alertnum_ = 3;
    </script>
    
    <script type="text/javascript">
        vue = new Vue({
            el: "#app",
            data: {
                isshowtools: false,
                editor_url: "./page_editor/page_editor.html",
                token: "",
                urlParam: {},
                userId: "",
                userinfo: {},
                user: {},
                
                /* 通知的选项 */
                activeName: '0',
                noticeObj: {
                    cnt: 0,
                    list: []
                },
                reminds: [
                    {name: "证件到期提醒", type:"remind_zj", children: [{name: "客户名称有限公司资质证已到期", state: "待办"}]},
                    {name: "协议到期提醒", type:"remind_xy", children: [{name: "客户名称有限公司佣金协议", state: "待办"}, {name: "兰州西城药业集团有限责任公司佣金协议", state: "待办"}]},
                    {name: "资信超额提醒", type:"remind_zx", children: [{name: "客户名称有限公司资信剩余100", state: "待办"}, {name: "兰州西城药业集团有限责任公司资信剩余50", state: "待办"}]},
                    {name: "待办审批提醒", type:"remind_sp", children: [{name: "客户名称有限公司开户审批", state: "待办"}, {name: "兰州西城药业集团有限责任公司开户审批", state: "待办"}]},
                    {name: "回款逾期提醒", type:"remind_hk", children: [{name: "客户名称有限公司回款已逾期", state: "待办"}, {name: "兰州西城药业集团有限责任公司回款已逾期", state: "待办"}]},
                ],
                alert_num: 0,
                yearmonth: "",
                lbl_title: "",
                simplify_title: "DMS",
                
                rolemap:{},
                roleselect: {},
                isshowmenu: true,
                cardtablist: [],
                menusobj: {},
                
                isAdmin: false,
                isBusiness: false,
                isSale: false,
                isCustomer: false,
                
                remind: "",
                servertype: "",
                isRefreshNotice: true,
                message_show: false,
                div_message_show: false,
                
                pagenum: 1,
                cardlist_pagesize: 15,
                selectCard: {},
                showTopMenu: false,
                leftMenuLsit: [],
                
                formAttr: {
                    istitle: false,
                    title: "表单名称",
                    columnnumber: 1,
                    labelwidth: "240px",
                    labelposition: "top",//"left",// right//top
                    size: "mini",
                    border: "10px solid #c6c6c600"
                },
                
                formFields: [
                    {isshow: "T", field: "tab_isrefresh", name: "1、导航栏中的标签切换是否刷新页面", type: "switch", switch_false:"不刷新",switch_true:"刷新", notvalunit: true},
                    {isshow: "T", field: "page_title", name: "2、列表页的标题和按键位置设置", type: "switchbyval", switch_false:"标题在左侧", inactivevalue:"left",switch_true:"标题在右侧", activevalue:"right",  notvalunit: true},
                ],
                formData: {
                    page_title: window.top.config.system_config.whole_config.theme_config.page_title,
                    tab_isrefresh: window.top.config.tab_isrefresh
                },
                formfieldClick: {},
                showCapacitys: false, // 角色列表
                
                isshowaccount: false,
                isshowmessage: false,
                isshowthemeconfig: false,
                top_popup_background: false, // 主页弹窗的背景,点击时收起弹窗。
                buttonsconfig: {
                    id: false
                },
                urlParam: {}
            },
            
            directives: {
                drag(el){
                    let oDiv = el; //当前元素
                    let self = this; //上下文
                    //禁止选择网页上的文字
                    document.onselectstart = function() {
                        return false;
                    };
                    oDiv.onmousedown = function(e){
                        //鼠标按下,计算当前元素距离可视区的距离
                        let disX = e.clientX - oDiv.offsetLeft;
                        let disY = e.clientY - oDiv.offsetTop;
                        document.onmousemove = function(e){
                            //通过事件委托,计算移动的距离
                            let l = e.clientX - disX;
                            let t = e.clientY - disY;
                            //移动当前元素
                            oDiv.style.left = l + "px";
                            oDiv.style.top = t + "px";
                        }
                        document.onmouseup = function(e){
                            document.onmousemove = null;
                            document.onmouseup = null;
                        };
                        //return false不加的话可能导致黏连,就是拖到一个地方时div粘在鼠标上不下来,相当于onmouseup失效
                        return false;
                    };
                }
            },
            
            created() {
                var url = window.location.href;
                this.urlParam = getGetParamsByUrl(url, true);
                // strToMuddleStr();
                // this.token = clone(localStorage.getItem("hdtoken"));
                if (this.urlParam.db && localStorage.getItem("HDU" + this.urlParam.db)) {
                    this.token = clone(localStorage.getItem("HDU" + this.urlParam.db));
                }
                // return
                setTopConfig();
                this.servertype = config.servertype;
                
                setTopButtonsConfig();
                buttonsconfig.id = true;
                this.buttonsconfig = buttonsconfig;
                
                // this.token = clone(localStorage.getItem("hdtoken"));
                
                if (!this.token) {
                    util.pageTo("../../../login.html");
                }
                //当前日期
                this.yearmonth =  dateFormat(new Date(), "yyyy年MM月");
                this.lbl_title = config.title;
                // this.alert_num = this.reminds.length;
            },
            
            mounted() {
                this.isshowtools = config.isshowtools;
                // var url = window.location.href;
                // this.urlParam = getGetParamsByUrl(url);
                
                //打开的菜单导航及容器定义
                // tab = new Tab({
                //     element: "content"
                // });
                
                // //未找到声明的变量Root
                // Root = new RootClass({
                //     userInfo: {
                //         name: this.urlParam.db,
                //         token: this.token
                //     },
                //     "tab": tab
                // });
                
                this.getUserById(this.token);
                this.tableFieldClick();
            },
            
            methods:{
                tableFieldClick() {
                    var me = this;
                    //表单字段事件设置
                    this.formfieldClick = {
                        page_title: {//字段事件设置
                            val: {
                                onchange: function(obj) {//输入更改事件
                                    window.top.config.system_config.whole_config.theme_config.page_title = obj.data.page_title;
                                    
                                    // 获取当前打开的tab,刷新tab
                                    if (window.top.config.tab_isrefresh){
                                        if (window.top.tab.selected.option.isRefresh) { // 如果当前tab页面需要刷新
                                            window.top.tab.selected.itemBody.bodyFrame[0].contentWindow.location.reload(true);
                                        }
                                    }
                                    
                                    // tab点击时刷新当前页面
                                }
                            },
                        },
                        tab_isrefresh: {//字段事件设置
                            val: {
                                onchange: function(obj) {//输入更改事件
                                    window.top.config.tab_isrefresh = obj.data.tab_isrefresh;
                                }
                            },
                        },
                        
                    };
                },
                
                //获取用户信息
                getUserById() {
                    var me = this;
                    
                    document.getElementById("leftMenu").innerHTML = "";
                    document.getElementById("content").innerHTML = "";
                    
                    //打开的菜单导航及容器定义
                    tab = new Tab({
                        element: "content"
                    });
                    
                    //未找到声明的变量Root
                    Root = new RootClass({
                        userInfo: {
                            name: this.urlParam.db,
                            token: this.token
                        },
                        "tab": tab
                    });
                    
                    var url = "root/client/getUser";
                    
                    var param = {}
                    // alert("123");
                    Server.call(url, param, function(result) {
                        if (result.data && result.data.user && result.data.user.org) {
                            result.data.user.org.isfreeze = result.data.user.org.is_frozen
                        }
                        me.userinfo = result.data.user || {};
                        if (!me.userinfo.token) {
                            me.userinfo.token = me.token;
                        }
                        if (!me.userinfo.org) {
                            me.userinfo.org = {}
                        }
                        if (me.userinfo.currentactor && !me.userinfo.currentactor.code) { // 角色id
                            me.userinfo.currentactor.code = me.userinfo.currentactor.actor_id;
                        }
                        if (me.userinfo.currentactor && me.userinfo.currentactor.position_duty) { // 职务编码
                        }
                        
                        if (window.top.vue.userinfo && window.top.vue.userinfo.org && window.top.vue.userinfo.org.is_account) {
                            me.isCustomer = true;
                        }
                        if (window.top.vue.userinfo && window.top.vue.userinfo.currentactor && window.top.vue.userinfo.currentactor.actor_type) {
                            if (window.top.vue.userinfo.currentactor.actor_type == "Customer") { // 经销商
                                me.isCustomer = true;
                            }
                            else if (window.top.vue.userinfo.currentactor.actor_type == "Sales") { // 销售
                                me.isSale = true;
                            }
                            else if (window.top.vue.userinfo.currentactor.actor_type == "Business") { // 商务、运营
                                me.isBusiness = true;
                            }
                            else if (window.top.vue.userinfo.currentactor.actor_type == "Admin") { // Admin
                                me.isAdmin = true;
                            }
                        }
                        
                        if (me.userinfo.employee && me.userinfo.employee.positions.length && me.userinfo.employee.positions[0].department) {
                            var department_name_ = "";
                            me.userinfo.employee.positions.map(p=>{
                                if (p.department && p.department.name) {
                                    department_name_ += p.department.name
                                }
                            })
                            me.userinfo.department_name = department_name_;//me.userinfo.employee.positions[0].department.name;
                            $("#lbl_department").html(department_name_);
                        }
                        
                        Root.setUserInfo(me.userinfo);
                        me.showUserInfo(me.userinfo);
                        //首次密码修改
                        // if (me.userinfo.pass_need_change && config.url_page == "http:// /") {
                        //     me.changePw()
                        // }
                    });
                },
                
                //显示用户信息
                showUserInfo(userinfo) {
                    let me = this;
                    if (!userinfo) {
                        return;
                    }
                    
                    var employeeObj = userinfo.employee || {};
                    var orgObj = userinfo.org || {};
                    
                    var lbl_role_ = "";
                    me.rolemap = {};
                    
                    if (userinfo.currentactor && !userinfo.currentactor.username) {
                        userinfo.currentactor.username = this.userinfo.name;
                        // userinfo.currentactor.org_short_name = "所有公司";
                    }
                    if (userinfo.currentactor && !userinfo.currentactor.org_short_name) {
                        userinfo.currentactor.org_short_name = "所有公司";
                    }
                    
                    me.roleselect = userinfo.currentactor ? userinfo.currentactor : {};
                    
                    if(userinfo.actors && userinfo.actors.length) {
                        userinfo.actors.map(e=>{
                            if (!e.username) {
                                e.username = this.userinfo.name;
                            }
                            if (!e.org_short_name) {
                                e.org_short_name = "所有公司";
                            }
                            if (!e.code) {
                                e.code = e.actor_id;
                            }
                            lbl_role_ += e.name + " "; 
                            me.rolemap[e.id] = e;
                            // if (!me.roleselect.name) {
                            //     me.roleselect = e;
                            // }
                        });
                    }
                    $("#lbl_role").html(lbl_role_);
                    $("#lbl_employeeCode").html(employeeObj.code);
                    $("#lbl_employeeName").html(employeeObj.name);
                    $("#lbl_user").attr("title", userinfo.name);
                    
                    /* 公司 */
                    // localStorage.setItem("orgid", orgObj.id);//经销商id
                    // localStorage.setItem("orgcode", orgObj.code);//经销商编码
                    // localStorage.setItem("org_short_name", orgObj.name);//经销商名称
                    // localStorage.setItem("orgtype", orgObj.type);//dealer(经销商)、business(商务)
                    // //经销商冻结
                    // localStorage.setItem("orgfreeze", orgObj.isfreeze);
                    
                    if(userinfo.actors && userinfo.actors.length) {
                        if (userinfo.org && userinfo.org.is_account) {//经销商
                            this.iscustomer = true
                            // var aa = 100
                            // me.remind = "营业执照到期剩余天数:" + aa + "      ";
                            // me.remind += "器械许可证到期剩余天数:" + aa;
                            $("#lbl_employeeCode").html(orgObj.code);
                            me.getCustomerTerm(userinfo);
                        }
                        me.ready_();
                    }
                    else {
                        this.$alert('没有配置权限,请联系管理员', '缺少权限', {
                            confirmButtonText: '登出',
                            callback: action => {
                                util.pageTo("../../../login.html");
                            }
                        });
                        
                    }
                },
                
                getCustomerTerm(userinfo) {  
                    var me = this;
                    var url = "root/client/getUser";
                    
                    var param = {
                        "dataname": "sys_licence_remind",
                        "attachMeta":true,
                        "filter": [
                            {
                                "field": "code", 
                                "value": userinfo.org.code,
                            }
                        ],
                        // "orderby":"certificate_day,  instrument_day",
                        // "page":{
                        //     "pageno":1,
                        //     "pagesize":10
                        // }
                    }
                    Server.call("root/data/getEntitySet", param, function(result) {
                        if (result.data && result.data.entityset) {
                            var org_ = result.data.entityset[0];
                            if (org_ && org_.certificate_remind) {
                                var remind_ = "<div style='color: red;'>营业执照到期剩余天数:" + org_.certificate_day + "天</div>";
                                if(org_.certificate_day * 1 < 0) {
                                    remind_ = "<div style='color: red;'>营业执照已过期" + (org_.certificate_day * -1) + "天</div>";
                                }
                                
                                me.remind = remind_;
                            }
                            if (org_ && org_.instrument_remind) {
                                var remind_qx_ = "<div style='color: red;'>器械许可证到期剩余天数:" + org_.instrument_day + "天</div>"
                                if(org_.instrument_day * 1 < 0) {
                                    remind_qx_ = "<div style='color: red;'>器械许可证已过期" + (org_.instrument_day * -1) + "天</div>";
                                }
                                me.remind += remind_qx_;
                            }
                            
                            if (me.remind) {
                                me.$alert("<div>" + me.remind + "</div>", '到期提醒', {
                                    confirmButtonText: '确定',
                                    dangerouslyUseHTMLString: true
                                });
                            }
                            
                        }
                    });
                },
                
                ready_() {
                    var me = this;
                    toolbar = null;
                    treeMenu = null;
                    //顶部菜单初始化
                    // toolbar = new Toolbar({
                    //     element: "topMenu",
                    //     css: { 
                    //         item: "main-menu",
                    //         itemSelected: "main-menu-selected",
                    //         itemIcon: "main-menu-icon",
                    //         itemText: "main-menu-text"
                    //     },
                    //     style: "C",
                    //     selectable: true
                    // });
                    
                    //左侧菜单的初始化
                    treeMenu = new TreeMenu({
                        element: "leftMenu",
                        css: {
                            item: "left-menu",
                            openItem: "left-menu-active",
                            itemArrow: "el-icon-arrow-down",
                            openItemArrow: "el-icon-arrow-up"
                        },
                        onSelect: function(item, option_) {
                            let option = clone(option_);
                            if (option.url) {
                                // 在切换已打开导航时是否需要刷新
                                // option.isRefresh = true;
                                option.menutitle = clone(option).title;
                                if (option.title.length > 4) {
                                    option.title = option.title.substr(0, 4) + "...";
                                }
                                // if (RootSetting.isClientMode && !option.isURLParsed) {
                                //     option.url = toClientURL(option.url);
                                // } 
                                tab.open(option);
                            }
                        }
                    });
                    
                    //加载字典数据
                    Server.call("root/client/getDictionarys", {isClientMode: false}, function(result) {
                        dataRoot.database.dictList = result.data.dictionarys;
                        
                        var data_ = [];
                        if (result.data.dictionarys) {
                            data_ = result.data.dictionarys;
                        }
                        Dictionary.load(data_);
                        
                        //其余数据添加到字典
                        me.loadDataToDictionary();
                    });
                    
                    //加载菜单
                    me.getMenu();
                    
                    //定义弹出的提示框
                    Root.init_vue();
                    
                    if (me.userinfo.org && me.userinfo.org.actor == "Master") {//中心公司的待办列表
                        me.getNoticeList()
                    }
                },
                
                loadDataToDictionary() {
                    var me = this;
                    
                    // 各业务的状态
                    var param = {
                        dataname: "sys_state_machine_state",
                    }
                    Server.call("root/data/getEntitySet", param, function(result) {
                        if (result.data && result.data.entityset) {
                            var dictionaryGroup = listTODictionaryGroup(result.data.entityset, "category_code", "code", "name", "states");
                            dictionaryGroup.map(dg=>{
                                Dictionary.addDictionary(dg.dictionarycode, dg.children);
                            })
                        }
                    })
                    
                },
                
                onContentClick() {
                    var me = this;
                    // 用户悬浮
                    this.isshowaccount = false;
                    // 通知悬浮
                    this.isshowmessage = false;
                    // 主题设置
                    this.isshowthemeconfig = false;
                    
                    this.message_show = false;
                    this.div_message_show = false;
                    this.top_popup_background = false;
                },
                showmessage() {
                    if (!this.top_popup_background) {
                        this.top_popup_background = true;
                        this.isshowmessage = true;
                    }
                },
                
                onshowAccount() {
                    var me = this;
                    if (!this.top_popup_background) {
                        this.top_popup_background = true;
                        this.isshowaccount = true;
                    }
                },
                
                //获取待办通知列表
                getNoticeList(callback) {
                    var me = this;
                    if (this.message_show) {
                        return
                    }
                    var param_ = {
                        filter: "rolecode like '%|" + me.userinfo.currentactor.code + "|%'"
                    }
                    var cnt_ = 0
                    if (this.noticeObj.cnt) {
                        cnt_ = this.noticeObj.cnt
                    }
                    this.noticeObj = {
                        cnt: cnt_,
                        list: []
                    }
                    
                    Server.call("root/workflow/getOutline", param_, function(result) {
                        var noticeObj_ = {};
                        var cnt_ = 0;
                        var list_ = [];
                        let md_approval_ = me.ArrayToTree(clone(result.data), "name", "parent_id");
                        md_approval_.map(nodes=>{
                            if (nodes.children) {
                                var p_cnt_ = 0;
                                var isBadge_ = false;
                                nodes.children.map(node=>{
                                    if (node.cnt) {
                                        isBadge_ = true;
                                        node.badgeval = node.cnt;
                                        p_cnt_ += node.cnt;
                                        cnt_ += node.cnt;
                                    }
                                })
                                nodes.cnt = p_cnt_;
                                // nodes.isBadge = isBadge_;
                                list_.push(nodes);
                            }
                        })
                        noticeObj_.cnt = cnt_;
                        noticeObj_.list = list_;
                        
                        me.noticeObj = noticeObj_;
                        
                        if (callback) {
                            callback();
                        }
                    })
                },
                refreshNoticeList() {
                    var me = this;
                    this.showmessage();
                    this.getNoticeList(function() {
                        
                    })
                },
                
                //刷新经销商信息
                refreshOrg(me, tabid) {
                    var me1 = this;
                    
                    var me = this;
                    let param_ = {
                        dataname: "md_org",
                        id: window.top.vue.userinfo.org.id
                    }
                    
                    Server.call("root/data/getEntity", param_, function(result) {
                        if (result && result.data && result.data.md_org) {
                            //刷新经销商信息
                            window.top.vue.userinfo.org.isfreeze = result.data.md_org.is_frozen;
                            // window.top.vue.userinfo.org.isfreeze = true;
                            //清空tab导航栏
                            window.top.tab.removeItemOther(tabid)
                        }
                    });
                },
                
                btnToggleClick() {
                    this.isshowmenu = !this.isshowmenu;
                    
                    if (this.isshowmenu) {
                        //控制菜单显示
                        $("#leftbar").css("width", "13%");
                        $("#pnl_header").css("left", "13%");
                        $("#content").css("left", "13%");
                        
                        $("#leftExpand").css("width", "100%");
                    }
                    else {
                        $("#leftRetract").css("width", "64px");
                        
                        //控制菜单隐藏overflow: hidden;
                        $("#leftbar").css("width", "0px");
                        $("#leftbar").css("overflow", "hidden");
                        $("#pnl_header").css("left", "0px");
                        $("#content").css("left", "64px");
                    }
                },
                
                //接口定义菜单
                getMenu() {
                    var me = this;
                    var params = {}
                    
                    Server.call("root/client/getMenuTree", params, function(result) {
                        if (result && result.data.menus && result.data.menus.length) {
                            let entitytree = result.data.menus;
                            me.menusobj = {};
                            me.menuToPageTree(clone(entitytree));
                            
                            me.cardtablist = clone(entitytree);
                            me.tabCardClick(me.cardtablist[0]);
                        }
                    });
                },
                tabCardClick(option_) {
                    var me =this;
                    this.selectCard = clone(option_);
                    this.leftMenuLsit = [];
                    let option = this.selectCard;
                    var leftMenu_ = [];
                    
                    if (option && option.url) {
                        leftMenu_ = [option];
                    }
                    else {
                        leftMenu_ = option.children;
                    }
                    this.leftMenuLsit = clone(leftMenu_);
                    
                    var item_ = treeMenu.load(leftMenu_);
                    if (item_ && this.isshowmenu) {
                        this.openOneMenuPage(item_[0].childNodes[0], leftMenu_[0]);//item_.childNodes
                    }
                    else {
                        this.openOneMenuPage2(leftMenu_[0], function(option){
                            option.text = option.title;
                            if (option.text.length > 4) {
                                option.title = clone(option.text);
                                option.text = option.text.substr(0, 4) + "...";
                            }
                            tab.open(option);
                            me.showTopMenu = false;
                        })
                    }
                },
                
                tabCardClick2(option_) {
                    var me =this;
                    
                    this.selectCard = clone(option_);
                    this.leftMenuLsit = [];
                    let option = this.selectCard;
                    if (option && option.url) {
                        if (this.isshowmenu) {
                            this.btnToggleClick();
                        }
                        option.text = option.title;
                        if (option.text.length > 4) {
                            option.title = clone(option.text);
                            option.text = option.text.substr(0, 4) + "...";
                        }
                        // if (RootSetting.isClientMode && !option.isURLParsed) {
                        //     option.url = toClientURL(option.url);
                        // } 
                        tab.open(option);
                        this.showTopMenu = false;
                    }
                    else {
                        if (!this.isshowmenu) {
                            this.btnToggleClick();
                        }
                        this.leftMenuLsit = clone(option.children);
                        
                        var item_ = treeMenu.load(option.children);
                        if (item_ && this.isshowmenu) {
                            this.openOneMenuPage(item_[0].childNodes[0], option.children[0]);//item_.childNodes
                        }
                        else {
                            this.openOneMenuPage2(option.children[0], function(option){
                                option.text = option.title;
                                if (option.text.length > 4) {
                                    option.title = clone(option.text);
                                    option.text = option.text.substr(0, 4) + "...";
                                }
                                tab.open(option);
                                me.showTopMenu = false;
                            })
                        }
                    }
                },
                
                selectMenu(key, keyPath) {
                    console.log(key, keyPath);
                    var me = this;
                    this.openOneMenuPage2(this.menusobj[key], function(option){
                        option.text = option.title;
                        if (option.text.length > 4) {
                            option.title = clone(option.text);
                            option.text = option.text.substr(0, 4) + "...";
                        }
                        tab.open(option);
                        me.showTopMenu = false;
                    })
                },
                
                menuToPageTree(oldmenus) {
                    var me = this;
                    oldmenus.map(om=>{
                        if (om.children) {
                            me.menuToPageTree(om.children);
                        }
                        else if (om.page_id) {
                            me.menusobj[om.id] = om;
                        }
                    })
                },
                
                openOneMenuPage(item_, option) {
                    item_.click();
                    if (option.children && option.children.length) {
                        var item = item_.parentNode.getElementsByClassName("left-menu");
                        if (item.length) {
                            this.openOneMenuPage(item[1], option.children[0]);
                        }
                    }
                },
                openOneMenuPage2(option, callback) {
                    if (option.children && option.children.length) {
                        var item = item_.parentNode.getElementsByClassName("left-menu");
                        if (item.length) {
                            this.openOneMenuPage2(option.children[0], callback);
                        }
                    }
                    else {
                        callback(option)
                    }
                },
                capacitysVisibleChange(isvisible) {
                    // 角色下拉展开
                    if (isvisible) {
                        this.top_popup_background = true;
                    }
                    else { // 角色下拉收起
                        this.top_popup_background = false;
                    }
                },
                setRole(val) {
                    var me = this;
                    if (this.rolemap[val].id == this.roleselect.id) {
                        this.showCapacitys = false;
                        return
                    }
                    
                    this.$confirm('切换信息将清空当前编辑数据,确定切换吗?', '切换提示', {
                      confirmButtonText: '切换',
                      cancelButtonText: '取消',
                      type: 'warning'
                    }).then(() => {
                        me.doSetRole(val);
                    }).catch(() => {
                        Root.message({
                            type: 'info',
                            message: '已取消切换'
                        });
                    });
                },
                
                doSetRole(val) {
                    var me = this;
                    
                    this.roleselect = clone(this.rolemap[val]);
                    this.showCapacitys = false;
                    this.top_popup_background = false;
                    // 根据角色获取不同的页面
                    var params = {
                        actor_target_id: this.roleselect.id
                    }
                    
                    Server.call("root/client/changeCurrentActor", params, function(result) {
                        // me.refreshMenu();
                        me.getUserById();
                    })
                },
                
                onThemeConfig() { // 系统主题设置
                    var me = this;
                    // if (!this.top_popup_background) {
                        this.top_popup_background = true;
                        this.isshowthemeconfig = true;
                        this.showCapacitys = false;
                    // }
                },
                
                refreshMenu() {
                    // document.getElementById("topMenu").innerHTML = "";
                    document.getElementById("leftMenu").innerHTML = "";
                    
                    document.getElementById("content").innerHTML = "";
                    // document.getElementById("bodyArea").innerHTML = "";
                    
                    //打开的菜单导航及容器定义
                    tab = new Tab({
                        element: "content"
                    });
                    
                    //未找到声明的变量Root
                    Root = new RootClass({
                        userInfo: {
                            name: this.urlParam.db,
                            token: this.token
                        },
                        "tab": tab
                    });
                    
                    this.ready_();
                },
                
                //修改密码
                changePw() {
                    Root.popupParames = {};
                    Root.popupParames.url = "module/system/page/password.html";
                    Root.popupParames.data = {
                        pass_need_change: this.userinfo.pass_need_change
                    }
                    Root.popupParames.hide_close = true
                    Root.showPopup(Root.popupParames);
                    this.showCapacitys = false;
                    this.top_popup_background = false;
                },
                //修改头像
                changePicture() {
                    
                },
                //退出到登录页面
                againLogout() {
                    util.pageTo("../../../login.html");
                },
                
                ArrayToTree(array_, name, parentId, parId, disabled_field, isencode) {
                    if(!parId) {
                        parId = "";
                    }
                    
                    let obj = {};
                    let result = [];
                    let list_old = JSON.parse(JSON.stringify(array_));
                    let list = []
                    list_old.map(el => {
                        if ((el.parent_id && el.cnt) || !el.parent_id) {//先过滤一次,满足要求的留下
                            list.push(el);
                            obj[el.id] = el;
                        }
                    })
                    let openId = "";
                    for (let i = 0, len = list.length; i < len; i++) {
                        let parentId_ = list[i][parentId];
                        //如果存在判断只读字段,并且该字段有值则设置该节点为只读
                        if (disabled_field) {
                            if(list[i][disabled_field]) {
                                list[i].disabled = true;
                            }
                        }
                        
                        //设置显示字段
                        var node_r_ = "";
                        var names_ = name.split("|");
                        names_.map(n=>{
                            if (list[i][n] && !node_r_) {
                                node_r_ = list[i][n];
                            }
                        });
                          
                        if (isencode) {
                           list[i].label = decodeURI(encodeURI( node_r_));//数据如果带“%”的需要编码再解码,否则会存在格式错误
                           list[i].name = decodeURI(encodeURI( node_r_));
                        }
                        else {
                           list[i].label = decodeURI(node_r_);
                           list[i].name = decodeURI(node_r_);
                        }
                        if (parentId_ == parId || !parentId_ || parentId_ == "null") {
                            if(!obj[list[i].id].children) {
                                obj[list[i].id].children = null;
                            }
                            result.push(list[i]);
                            continue;
                        } else if (obj[parentId_]) {
                            if (!obj[parentId_].children) {
                                obj[parentId_].children = [];
                            }
                            obj[parentId_].children.push(list[i]);
                        }
                    }
                    return result;
                },
                
                remindListClick(type) {
                    this.openPage(type);
                },
                
                remindClick(type, row) {
                    this.openPage(type, row);
                },
                
                openPage(type, row) {
                    let me = this;
                    Root.popupParames = {
                        totab: false, //true: 以Tab导航的方式打开
                        width: "1100px",
                        height: "520px",
                        icon: "icon-product",
                        text: row.name + "_待审批列表",
                        id: "approval_list",//totab: true时需设置,用于判断是否已打开此页面
                        url: "module/approval/page/popup/approval_list.html",
                        data: row,
                        delta: {},
                        sceneCode: "browse",//"refuseedit",//"approval", //"add"//"browse",
                        callback: function(obj, callback) {
                            me.getNoticeList()
                            if (callback) {
                                callback();
                            }
                        }
                    };
                    Root.showPopup(Root.popupParames);
                },
                openApproval(){
                    let me = this;
                    var row = {};
                    Root.popupParames = {
                        totab: true, //true: 以Tab导航的方式打开
                        icon: "el-icon-document",
                        text: "我的审批",
                        page_id: "daishenpi",
                        // parent_id: "M-A",
                        // type_code: "A",
                        id: "daishenpi",//totab: true时需设置,用于判断是否已打开此页面
                        url: "module/approval/page/my_approval_list.html",
                    };    
                    tab.open(Root.popupParames)
                },
                
                downloadFormByErrorsData(params) { // 数据文件错误文件流下载
                    this.customAlert('文件下载中,请稍后');
                    let form = document.createElement('form');
                    form.id = 'form_download';
                    form.name = 'form_download';
                    document.body.appendChild(form);
                    //循环创建input框
                    for (let obj in params) {
                        if (params.hasOwnProperty(obj)) {
                            let input = document.createElement('input')
                            input.type = 'hidden'
                            input.name = obj;
                            input.value = params[obj]
                            form.appendChild(input)
                        }
                    };
                    form.method = 'get'; //请求方式
                    form.action = window.top.config.url_root + "root/io/downloadImportErrors";
                    form.submit(); // form表单提交
                    document.body.removeChild(form); // 移除创建的元素
                },
                textdownloadForm(params) { // post文件流下载
                    this.customAlert('文件下载中,请稍后');
                    let form = document.createElement('form');
                    form.id = 'form_download';
                    form.name = 'form_download';
                    document.body.appendChild(form);
                    //循环创建input框
                    for (let obj in params) {
                        if (params.hasOwnProperty(obj)) {
                            let input = document.createElement('input')
                            input.type = 'hidden'
                            input.name = obj;
                            input.value = params[obj]
                            form.appendChild(input)
                        }
                    };
                    form.method = 'get'; //请求方式
                    // form.action = window.top.config.url_root + "root/exports/exportSheetsExcel?token=" + Root.getToken();
                    // form.action = window.top.config.url_root + "root/io/exportData?token=" + Root.getToken() + "&ioname=" + params.ioname; //export-md-account
                    form.action = window.top.config.url_root + "root/io/exportData";
                    
                    form.submit(); // form表单提交
                    
                    document.body.removeChild(form); // 移除创建的元素
                },
                onDownload(params) { //get文件流下载,没有过滤
                    var elemIF = document.createElement('iframe');
                    //无法文件过滤
                    // var url = window.top.config.url_root + "root/io/exportData?token=" + Root.getToken() + "&ioname=" + params.ioname + "&filter=" + params.filter; 
                    var url = window.top.config.url_root + "root/io/exportData?token=" + Root.getToken() + "&ioname=" + params.ioname; 
                    elemIF.src = url;
                    elemIF.style.display = 'none';
                    // elemIF.download = params.fileName //文件命名无法生效
                    document.body.appendChild(elemIF);
                },
                
                customAlert(message) {
                    // 创建对话框的背景
                    var overlay = document.createElement('div');
                    overlay.style.position = 'fixed';
                    overlay.style.top = '0';
                    overlay.style.left = '0';
                    overlay.style.width = '100%';
                    overlay.style.height = '100%';
                    overlay.style.background = 'rgba(0, 0, 0, 0.5)';
                    overlay.style.zIndex = '9999';
                
                    // 创建对话框的容器
                    var dialog = document.createElement('div');
                    dialog.style.position = 'fixed';
                    dialog.style.top = '50%';
                    dialog.style.left = '50%';
                    dialog.style.transform = 'translate(-50%, -50%)';
                    dialog.style.background = 'linear-gradient(#f2f2f2, #e6e6e6)';
                    dialog.style.padding = '20px';
                    dialog.style.borderRadius = '5px';
                    dialog.style.boxShadow = '0 2px 5px rgba(0, 0, 0, 0.3)';
                    dialog.style.zIndex = '10000';
                    dialog.style.display = 'flex';
                    dialog.style.flexDirection = 'column';
                    dialog.style.maxWidth = '400px'; // 限制对话框的最大宽度
                
                    // 创建提示文本
                    var messageElement = document.createElement('p');
                    messageElement.textContent = message;
                    messageElement.style.marginBottom = '15px'; // 添加下边距,与按钮分隔开
                
                    messageElement.style.fontSize = '15px';
                
                    // 创建关闭按钮容器
                    var closeButtonContainer = document.createElement('div');
                    closeButtonContainer.style.display = 'flex';
                    closeButtonContainer.style.justifyContent = 'flex-end'; // 将按钮容器置于右侧
                
                    // 创建关闭按钮
                    var closeButton = document.createElement('button');
                    closeButton.textContent = '关闭';
                    closeButton.style.padding = '6px 12px';
                    closeButton.style.background = '#007bff';
                    closeButton.style.color = 'white';
                    closeButton.style.border = 'none';
                    closeButton.style.borderRadius = '3px';
                    closeButton.style.cursor = 'pointer';
                    // closeButton.style.fontWeight = 'bold';
                    closeButton.style.fontSize = '12px';
                
                    closeButton.addEventListener('click', function () {
                        document.body.removeChild(overlay);
                    });
                
                     // 将关闭按钮添加到关闭按钮容器中
                     closeButtonContainer.appendChild(closeButton);
                
                    // 将元素添加到对话框中
                    dialog.appendChild(messageElement);
                    dialog.appendChild(closeButtonContainer);
                
                    // 将对话框添加到页面中
                    document.body.appendChild(overlay);
                    overlay.appendChild(dialog);
                
                    setTimeout(function(){
                        document.body.removeChild(overlay);
                    },2000);
                }
                
            }
        });    
    </script>
    
    <style>
        .editor_popup{ position: absolute; top: 70vh; min-width: 460px; z-index: 1000; left: 60vw;}
        .tools-news{ height: 140px;}
        .box-card{border: 1px solid #7d7d7d; border-radius: 10px;}
        .box-card .el-card__body{padding: 0px;}
        .tools-top{height: 24px; line-height: 24px; padding-left: 10px; background: #d6d6d6; border-bottom: 1px solid #ddd;z-index: 100;cursor: move;}
        .tools-top>span{margin-right: 10px;line-height: 26px;height: 30px;}
        .tools-top span{font-size: 12px; cursor: pointer; margin-right: 20px;} 
        .tools-top span>span:hover{color:#10709e;}
        
        .left-menu-expand .el-menu-item i{
            color: #fff;
            font-size: 16px;
            text-align: left !important
        }
        .left-menu-expand .el-menu-item.is-active {
            color: #fff;
            background-color: #636c7c !important
        }
        .left-menu-expand .el-menu-item:focus, .left-menu-expand .el-menu-item:hover {
            outline: 0;
            background-color: #636c7c !important
        }
        
        .el-submenu__title i {
            color: #fff;
            font-size: 16px !important;
        }
        .el-menu-item i{
            color: #fff;
            font-size: 16px !important;
            text-align: center !important;
        }
        
        .el-menu-item {
            color: #fff;
            font-size: 12px;
        }
        .el-menu-item.is-active {
            color: #fff;
            background-color: #636c7c !important
        }
        .el-menu-item:focus, .el-menu-item:hover {
            outline: 0;
            background-color: #636c7c !important
        }
        
        .el-menu-item, .el-submenu__title {
            height: 36px;
            line-height: 36px;
        }
        
        .h_card {
            display: inline-block;
            width: 100px;
            height: 100px;
            padding: 5px;
            cursor: pointer;
        }
        .h_card .el-card {
            border: 0px !important;
            border-radius: 0px !important;
        }
        .active_card {
            padding: 0px !important;
            border: 5px solid #ccc;
            /* box-shadow: 0px 2px 10px 0px rgb(18 227 48) !important; */
        }
        .h_card .el-card__body {
            padding: 0px;
        }
        .h_card .h_card_menu {
            height: 100px; 
            width: 100%;
            text-align: center;
            color: #fff;
        }
        .h_card .h_card_img{
            padding-top: 10px;
        }
        .h_card .h_card_img .iconfont{
            font-size: 28px;
        }
        .h_card .h_card_title {
            margin-top: 10px;
            font-size: 12px;
        }
        
        .h_top_menu {
            max-width: 550px;
            min-width: 100px;
        }
 
        .h_top_menu .h_card:nth-child(1) .el-card{
            background-color: #2a569f;
            
        }
        .h_top_menu .h_card:nth-child(2) .el-card{
            background-color: #8b3e86;
        }
        .h_top_menu .h_card:nth-child(3) .el-card{
            background-color: #8b3e86;
        }
        .h_top_menu .h_card:nth-child(4) .el-card{
            background-color: #df583a;
        }
        .h_top_menu .h_card:nth-child(5) .el-card{
            background-color: #008272;
        }
        .h_top_menu .h_card:nth-child(6) .el-card{
            background-color: #8b3e86;
        }
        .h_top_menu .h_card:nth-child(7) .el-card{
            background-color: #64e;
        }
        .h_top_menu .h_card:nth-child(8) .el-card{
            background-color: #1c83ce;
        }
        
        .h_top_menu .h_card:nth-child(9) .el-card{
            background-color: #008272;
        }
        .h_top_menu .h_card:nth-child(10) .el-card{
            background-color: #2c579b;
        }
        .h_top_menu .h_card:nth-child(11) .el-card{
            background-color: #8b3e86;
        }
        .h_top_menu .h_card:nth-child(12) .el-card{
            background-color: #df583a;
        }
        .h_top_menu .h_card:nth-child(13) .el-card{
            background-color: #64e;
        }
        .h_top_menu .h_card:nth-child(14) .el-card{
            background-color: #64e;
        }
        .h_top_menu .h_card:nth-child(15) .el-card{
            background-color: #df583a;
            
        }
        
        .h_role_list {
            cursor: pointer;
        }
        
        .h_role_list .el-dropdown {
            font-size: 12px;
        }
        
        .main_message:hover {
            cursor: pointer;
            background-color: #1c83ce;
        }
        .main_user:hover {
            cursor: default;
            /* background-color: #1c83ce; */
        }
        .main_sysrole:hover {
            cursor: pointer;
            background-color: #1c83ce;
        }
        .el-dropdown-menu {
            background-color: #0270c1;
            padding: 6px 10px;
        }
        .h_capacitys {
            border: 1px solid #0270c1;
            padding: 6px 10px;
        }
        .el-dropdown-menu--medium .el-dropdown-menu__item, .h_sysrole .h_row_capacitys {
            /* color: #fff; */
            color: #606266;
            border-bottom: 1px solid #ebebeb;
            /* margin-top: 3px; */
            padding: 0px 5px;
            font-size: 12px;
            margin-top: 3px;
            height: 42px;
            /* line-height: 48px; */
        }
        .h_sysrole .h_row_capacitys:hover {
            cursor: pointer;
            color: #fff;
            background-color: #1c83ce;
            border-radius: 5px;
        }
        .h_sysrole_menu {
            /* margin-top: 3px; */
            padding: 10px 3px;
            /* height: 48px; */
            /* line-height: 48px; */
        }
        .el-popper[x-placement^=bottom] .popper__arrow::after {
            border-bottom-color: #0270c1;
        }
    </style>
</html>