xinyb
2022-11-29 e156a0189d712b619cdde1aec10efd223ab982c2
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
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
var panMain = {};// 存放多个面板集合键为panIndx
var panIndex = "0";// 面板索引,作为全局变量 已确定执行哪一个面板
var gridToPanel = true;// 解决grid之后不触发事件
var getBackBool = true;// 解决面板带值之后不触发带出值事件
var getBackElse = false;// 不是回车或tab键也触发
var openTree = true;
var musChoies = false;// 是否为多选
var setPanel301 = false;// 值发生改变时
var hasShezhiZiduan = true;
var pbId = "";
var hasButton = false;// 是否有通过驳回按钮
var isAddLong = true;
var no_load_first = false;//只有加载时触发此事件,表明其为加载时,防止程序未知处把其值改了
var gtss="0";
var panelFormId="0";//当前面板的功能号
var isInspection = false;//是否禁止必录检查。
var seltboo=false;
var pandex496="0";//解决496多个面板正在执行的那个面板panIndex
var maxCols=[];//默认面板有4列
var select2Options=[];//43控件调用31控件查询值存放的集合
var fileupload_config={};
var qrCode;//单据二维码
var OAButonEvnt=null;//新的OA审核界面用到
fileupload_config.browseOnZoneClick=false;
//----------------------------------------
( function() {// 处理json 待处理
    String.prototype.Trim = function() {
        return this.replace(/(^\s*)|(\s*$)/g, "");
    }
    String.prototype.LTrim = function() {
        return this.replace(/(^\s*)/g, "");
    }
    String.prototype.RTrim = function() {
        return this.replace(/(\s*$)/g, "");
    }
    pbjson = {
            toJson : function(jsonStr, fen) {
                jsonStr = jsonStr.Trim();
                if (jsonStr.indexOf("{") == 0) {
                    jsonStr = jsonStr.substring(1, jsonStr.length - 1);
                }
                var vsd = jsonStr.split(fen);
                var map = {};
                var vs = (":").split(":");
                for ( var i = 0; i < vsd.length; i++) {
                    vs[0] = vsd[i].substring(0, vsd[i].indexOf(":"));
                    vs[1] = vsd[i].substring(vsd[i].indexOf(":") + 1);
                    if (vs[0].indexOf("\"") == 0 || vs[0].indexOf("'") == 0) {
                        vs[0] = vs[0].substring(1, vs[0].length - 1);
                    }
                    if (vs[1].indexOf("\"") == 0 || vs[1].indexOf("'") == 0) {
                        vs[1] = vs[1].substring(1, vs[1].length - 1);
                    }
                    map[vs[0]] = vs[1];
                }
                return map;
            }
    };
    pb = {
            json :pbjson
    };
    sortObj=function (obj) {
        const keys = Object.keys(obj).sort(function(a, b) {   return (obj[a]> obj[b]?1:-1) })
        // const keysss = keys.sort(function(a, b) {   return (obj[a]> obj[b]?1:-1) })
        var newObj = {}
        for (var i = 0; i < keys.length; i++) {
            const key = keys[i]
            newObj[key] = obj[key]
        }
        return newObj
    };
    //EasyUI Tabs 标签页/选项卡(496窗体用的多 ,没用 需要删除)
    getTabs = function(id,falg,isp,creates,num){
 
    }
    //EasyUI Tabs 标签页/选项卡(496窗体用的多)     xin 2019-10-8 15:50:10
    Tabs = function(falg,isp){
        try{
            var only={};//选中集合
            $('.istabs').each(function(){//遍历面板上的tabs    
                var evn=this;
                $(this).tabs({
                    width:top.tabWidth,//这里获取外层tab的宽度,如果不设置有时候会出现页卡宽度为0。
                    onSelect:function(title,index){//当用户选择一个标签页面板(tab panel)时触发。
                        var id= $(this).tabs('getSelected').attr('id');//获取选中的标签页面板;
                        if(only[id]) return;
                        if(id.indexOf('create')!=-1){//页卡里面是格线
                            eval(id+'("'+js_where[id]+'",falg,iscp)');
                        }
                        if(id.indexOf('panl')!=-1){//面板
                            //panIndex=id.split('-')[1];//当前面板索引
                        }
                        only[id]=true;//已经被选中返回true
                        //页卡里带有下拉菜单按钮
                        try{
                            if($('#mb'+id).html().Trim()!=''){
                                var mb = $(this).tabs('tabs')[index].panel('options').tab.find('a.tabs-inner');
                                mb.menubutton({
                                        menu:'#mb'+id
//                                        iconCls:''//带图标
                                }).click(function(){//单击
                                    $(evn).tabs('select',index);
                                });
                             }
                        }catch(e){$.messager.alert('子功能号超链接获取出错:'+e);}
                    }
                });
            });
            //这里是为了页卡有格线但是第一次加载一次也没选中到 
            for(var w in js_where){//格线条件结合
                if(only[w]==null){//选中集合里没有格线,js_where里有值。这时候需要加载一个,不加载会导致保存时候grid获取不到数据。
                    eval(w+'("'+js_where[w]+'",falg,iscp)');
                }else{
                    break;
                }
            }
        }catch(e){
            $.messager.alert("操作提示","选项卡加载格线数据出现了错误,尝试重新生成!"+e,"warning");
        }
    }
    //旧的单据信息
    showInfo=function(){
 
    }
 
    /**
     * 复制链接 2018-9-4 17:51:14 xin
     */
    copyLink=function(){
        var oInput = document.createElement('input');
        oInput.value = top.copyLink[top.tabindex];
        document.body.appendChild(oInput);oInput.select(); // 选择对象
        document.execCommand("Copy"); // 执行浏览器复制命令 oInput.className =
        // 'oInput';
        oInput.style.display='none';
        $.messager.show({
            height:60,
            msg:'<div align=\"center\"><span style=\"color:green;\"><b>链接复制成功?</b></span></div>',
            showType:'fade',
            timeout:2000,
            style:{}
        });
    }
 
    //31控件新的加载方式 xin 2020-9-18 16:45:00
    getSelect31=function(id){//id为面板上的控件id
        var initial = panIndex;
        for (var p in panMain) {//多面板的情况需要遍历(496窗体)
            var json = panMain[p].select;//得到有关联的字段集合
            if (json[id] != null) {
                var filed = json[id].split(";");
                for (var i = 0; i < filed.length; i++) {
                    panPar.getControlValue(filed[i], 31, filed[i], 0, p);
                }
            }
        }
        panIndex = initial;
    }
 
    $doc = function(id) {
        var d = {
            doc :$('#panIndex' + panIndex).find('#' + id)[0],
            onPropertyChange : function(v) {
                let to = ((v == null) ? false : ((v == "value") ? true : false));
                if ($.browser != null && !$.browser.msie && to) {// 不是IE浏览器 js赋值也触发函数
                    pro = $(this.doc).attr("onPropertyChange");
                    if (typeof pro != "undefined") {
                        eval(pro.replace("event", "null"));
                    }
                }
            },
            css : function(style, v) {
                $(this.doc).css(style, v);
            },
            src : function(v){//40控件类型 -xin 2020-6-15 17:19:20
                if (v == null) {
                    let value = $(this.doc).data('value');
                    if (value == null) {
                        value = $(this.doc).val();
                    }
                    return value || '';//$(this.doc)[0].src;
                }
                // if (!v.toLowerCase().startsWith('https:') && !v.toLowerCase().startsWith('http:')) {
                //     $(this.doc).attr('src', '/getImage.do?type=1&uuid=' + v);
                // } else {
                //     $(this.doc).attr('src', v);
                // }
            },
            attr : function(attr, v) {
                $(this.doc).attr(attr, v);
                this.onPropertyChange(attr);
            },
            disabled:function(v){
                if (this.doc == null) {//加载多表类型时候有可能获取不到控件对象导致获取不到控件状态值(加载时候多表的panIndex值是最后一个值) xin 2022-6-30 09:49:23
                    this.doc = $("#" + id)[0];
                }
                if (v == null) {
                    return ($(this.doc).is(":disabled") ? 1 : 0);
                } else {
                    $(this.doc).prop("disabled", v);
                }
            },
            html : function(v) {
                if (v == null) {
                    return $(this.doc).html();
                } else {
                    $(this.doc).html(v);
                }
            },
            val : function(v) {
                if (v == null) {
                    return $(this.doc).val();
                } else {
                    $(this.doc).val(v);
                    this.onPropertyChange("value");
                }
            },
            optionsAdd : function(text, value) {
                if (this.doc.options != null) {
                    this.doc.options.add(new Option(text, value));
                }
            }
        };
        return d;
    }
})();
 
//--------------------【panPar】
//包含面板信息,与必要函数
var panPar = {
        getOrder : function(id) {// 得到本来应该的字段,单独为10类型增加
            var col_ = id;
            if(typeof(gridInt)!='undefined'){
                if (gridInt != null && gridInt.InitValue != '') {
                    var cols_ = gridInt.InitValue;
                    var cols = cols_.split("&p&");
                    var c = null;// 当前字段信息
                    for ( var i = 0; i < cols.length; i++) {
                        c = cols[i].split("#");
                        if (c[1] != "" && c[1].toLowerCase() == id.toLowerCase()) {
                            col_ = c[0];
                            gridInt.mastercode += id + ',' + col_ + ':'
                            break;
                        }
                    }
                }
            }
            return col_;
        },
        id :"",
        value :"",
        noCopy : function(col) {// 不要复制的字段
            col += ";EnterCode;EnterName;EnterDate;ModifyName;ModifyDate;PostName;PostDate;CreateUsercode;CreateUsername";// 添加默认去除的字段
            col = col.toLowerCase();
            var cols = col.split(";");
            for (i = 0; i < cols.length; i++) { // 字段为空需排除,不然报错
                if (cols[i] != "" && cols[i] != 'docstatus') {
                    if (getDoc(cols[i], '') != null) { // 添加默认字段的屏蔽措施
                        setDoc(cols[i], ".value='"
                            + this.panInfo[cols[i]].initValue + "'");
                    }
                }
                var link = getDoc(cols[i] + '_show_link', '');
                if (link != null) {
                    var vvv = getDoc(cols[i], '.value');
                    $('#' + cols[i] + '_Link').html(vvv);
                    $('#' + cols[i] + '_show_link').hide();
                    $('#' + cols[i] + '_show_type').show();
                }
            }
            setInvDate();
        },
        // SQL参数控件,获得动态控件(31类型控件和43类型控件调用)
        getControlValue : function(field, fieldtype, targetControl, callback, pindex) {
            url = document.URL;
            url = url.substring(0, url.lastIndexOf("/") + 1);
            try{
                var params=panPar.getParameter()//获取面板控件所有值
                var state=$doc(field).disabled();//当前控件的状态 如:1只读 ,0可编辑
                let fieldName='';
                let isSuppressBlankLineForDropDown=0;
                panIndex=pindex;//还原当前控件所在的索引
                if(panMain[panIndex].panInfo[field]!=null){
                    fieldName=panMain[panIndex].panInfo[field].title;
                    isSuppressBlankLineForDropDown=panMain[panIndex].panInfo[field].isSuppressBlankLineForDropDown;
                }
                // 执行返回31,2类型控件的数据集合
                $.ajax({url:url + panMain[panIndex].controlUrl,// 跳转到对应功能号的panelControlxxxxxx.jsp
                    data:{
                        'field' :field,//控件ID
                        'fieldname':fieldName || '',//控件名称
                        'fieldtype' :fieldtype,//控件类型
                        'callback' :callback,//是否需要 <<新增>> 下拉进入((是31控件||2控件)&&不是空值&&不是1)添加 xin 2022-7-13 16:57:58
                        'params' :params,//页面控件值(全部)
                        'state':state//当前状态值
                    },
                    type:"POST",
                    async:false,
                    dataType:'json',
                    success:function(data) {
                        if (data.status == 0) {
                            var cols;
                            var panl;
                            var option=data.info;
                            switch (fieldtype) {
                                case 35:
                                case 31:
                                case 2:
                                    field=(fieldtype==35?field+'_35':field);
                                    var Evn=$doc(field);//获取控件对象
                                    // 原先的值 2019-4-2 14:50:53
                                    var original=$doc(field+'text').val();
                                    if(original=='' || original==null){
                                        //有值的情况赋值
                                        original=$(Evn.doc).val();
                                        //针对38特殊窗体 xin 2019-11-21 09:38:05
                                        if(original=='' && formType==38){
                                            original=panMain[panIndex].SpecialType[field];
                                        }
                                    }
                                    Evn.doc.length=0;
                                    if(isSuppressBlankLineForDropDown != 1){
                                        // 添加一个空值
                                        Evn.optionsAdd('','');
                                    }
                                    // 下拉控件赋值 xin 2019-5-24 17:55:31
                                    var isEm=false;
                                    let isempty=true;//这属性用来判断是否匹配到下拉值,没有那个就清空
                                    for(var o=0;o<option.length;o++){
                                        Evn.optionsAdd(option[o].text, option[o].id);
                                        //匹配key 和value
                                        if (original == option[o].id ){//|| original == option[o].text) {
                                            original = option[o].id;
                                            $doc(field+'text').val(original);
                                            isempty=false;//匹配到时候改为false
                                        }
                                        if (option[o].id == '') {
                                            isEm = true;
                                        }
                                    }
                                    if (isEm && isSuppressBlankLineForDropDown != 1){
                                        document.getElementById(field).options.remove(0);
                                    }
                                    if(option.length == 0 || isempty){//如果下拉都没有或匹配不到下拉值,那么field+'text'隐藏的字段值也清空去 xin 2022-11-29 10:17:16
                                        $doc(field+'text').val('');
                                    }
                                    //选中之前的值
                                    $(Evn.doc).val(original);
                                    // 取得浏览器的userAgent字符串 xin 2018-12-18 09:49:53
                                    var userAgent = navigator.userAgent;
                                    if (userAgent.indexOf("Chrome") > -1){// 针对谷歌浏览器
                                        Evn.doc.blur();
                                    }
                                    break;
                                case 43://返回给43控件处理
                                    select2Options=option;
                                    break;
                            }
                            //getSelect31(field);//递归,看是否还有和这字段级联的控件
                        } else if (data.status == 1) {
                            if (data.info != "") {
                                $.messager.alert("操作提示",data.info,"warning");
                            }
                        }
                    }
                });
            }catch(e){
                $.messager.alert("操作提示","获取31控件下拉数据出错!"+e,"warning");
            }
        },
        //43控件加载数据-xin 2017-11-2 14:59:44
        getSelect2 : function(field, fieldtype, targetControl, callback, pindex,css){
            panIndex=pindex;//还原当前控件所在的索引
            try{
                var Evn=$doc(field);//获取控件对象
                //调用31控件查询值
                getControlValue(field, fieldtype, targetControl, callback, pindex);
                //43控件初始化
                $(Evn.doc).select2({
                    placeholder: "---请选择---" ,
                    allowClear: true,
                    language: "zh-CN",
                    tags: true,//这个参数的效果应该是,自定义内容选项卡
                    closeOnSelect: false,
                    multiple:true,
                    containerCssClass: css,    //自定义css
                    data:select2Options,// 加载到的数据赋值
                    minimumResultsForSearch: 3//当下拉数量大于等于10时显示刷选框,设置了multiple=true无效
                }).on('select2:open',function(e){//43控件单击事件
                    //调用31控件查询值
                    getControlValue(field, fieldtype, targetControl, callback, pindex);
                    // 原先的值 2019-4-2 14:50:53
                    var original=$(this).select2('val');
                    $(this).empty();//清空之前的option值
                    //循环option赋值
                    for(var i=0;i<select2Options.length;i++){
                        $(this).append('<option value="'+select2Options[i].id+'">'+select2Options[i].text+'</option>');
                    }
                    //选中之前的值
                    $(this).val(original).trigger('change');
                }).on("select2:select", function (evt) {
                      var element = evt.params.data.element;
                      var $element = $(element);
                      $element.detach();
                      $(this).append($element);
                      $(this).trigger("change");
                      getSelect31(field);//43控件关联31控件 xin 2022-4-1 17:06:04
                      panMain[panIndex].isChange=1;
                }).on("select2:unselect", function (evt) {
                        var element = evt.params.data.element;
                        var $element = $(element);
                        $element.remove();
                        panMain[panIndex].isChange=1;
                });
                //有值的情况赋值
                var valt=$doc(field+'text').val();
                if(valt=='' && formType==38){
                    valt = panMain[panIndex].SpecialType[field] != null ? panMain[panIndex].SpecialType[field] : '';
                }
                if(valt!=''){
                    valt=valt.replace(/,/g,";").split(';');
                }
                $(Evn.doc).val(valt).trigger('change');
            }catch(e){
                $.messager.alert("操作提示","获取43控件下拉数据出错!"+e,"warning");
            }
        },
        getColors46:function(filed){
              let evnt=$("#"+filed);
              evnt.css("background-color",evnt.val());
              evnt.css("color",evnt.val());
        },
        // 针对多面板情况进行获取参数值
        getParameter : function(){
            var item={};
            var info=[];
            try{
                // 循环页面面板
                for(var p in panMain ){
                    panIndex=p;
                    this.panInfo=panMain[p].panInfo;//获取每一个面板控件集合
                    info.push(this.getPanMap_All());
                }
                // 有相同的属性则略过
                if(info.length>1){
                    for (var i = 0; i < info.length; i++) {
                        for (var k in info[i]) {
                            if (item.hasOwnProperty(k)) {
                                continue;
                            }
                            item[k] = info[i][k];
                        }
                    }
                }else{
                    item=info[0];
                }
                return obj2str(item);
            }catch(e){
                $.messager.alert("操作提示","31控件下拉查询参数出错"+e,"warning");
                return;
            }
        },
        getWhere : function(ben, wai, zi, g, p, id) {
            var where = this.getOutWhere(ben, wai, zi, ' and ', id, true);
            var where2 = "";
            if (where.indexOf("|") == -1 && openTree) {
                where2 = this.getOutWhere(g, p, '', ' and ', id, false);
            }
            where += where2;
            return where;
        },
        // 条件(本身,外表,自定义,连接符,是否强制录入)
        getOutWhere : function(ben, wai, zi, addFuHao, id, qianzhi) {
            openTree = true;
            var bens = ben.split(";");
            var wais = wai.split(";");
            var where = "";
            var col = "";
            var value = "";
            var colDan = "";
            for (i = 0; i < bens.length; i++) {
                col = bens[i].toLowerCase();
                if (col.Trim() != "") {
                    value = getDoc(col, ".value");
                    // 针对 300029 资金帐户
                    if (value == null) {
                        value = col;
                    }
                    if (qianzhi) { // 强制判断
                        if (id != col) {
                            if (value != "") {
                                where += wais[i] + " like '" + "@~"+ value + "@~'"
                                    + addFuHao;// and
                            } else {
                                $.messager.alert("操作提示", this.panInfo[col].title + "没有录入!","warning");
                                openTree = false;
                                break;
                            }
                        } else {
                            // by danaus 2017-7-21 替换^
                            colDan = "@G@" + wais[i] + " like '" + "@~"+ value + "@~'";
                        }
                    } else {
                        if (id == col && value != "" && value != "pb_xinzen") { // 是当前字段且不为空才操作
                            colDan = "@G@" + wais[i].toLowerCase() + " like '"+ "@~"+ value + "@~'";
                        }
                    }
                }
            }
            if (zi.Trim() != "") {
                where += zi + addFuHao;// 追加自定义条件
            }
            where = where.substring(0, where.length - addFuHao.length);
            where += colDan;
            return where;
        },
        //38;238;18;7;19;77窗体进入where条件取值查询
        keyWhere : function(boo, cols, colsInDate) {
            var where = "";//组装语句
            var fieldId=null;//字段Id
            var value = null;//字段值
            var fieldType=0;//控件类型 xin 2019-12-9 16:54:53
            try{
                for (var i = 0; i < cols.length; i++) {
                    if (cols[i] != "") {
                        fieldId = cols[i];
                        if (panMain[panIndex] != null && panMain[panIndex].panInfo[fieldId] != null) {
                            fieldType = panMain[panIndex].panInfo[fieldId].controltype;//获取类型
                        }
                        value = doc(fieldId).value.Trim();//获取值
 
                        // 43控件获值
                        if (fieldType == 43) {
                            value = $("#" + fieldId).val();
                            if (value != null && value != "") {
                                if (value instanceof Array) {
                                    value = value.join(";");
                                }
                            }
                        }
                        //19窗体xxxDate获值
                        if (parent.form_type == 19) {
                            if (doc(fieldId + "Date") != null) {
                                value = value.split(" ")[0] + " 00:00:00";
                            }
                        }
                        where += colsInDate[i] + "='" + value + "' and ";
                    }
                }
                try{
                    //窗体18设置外条件 xin 2022-7-27 15:51:54
                    if (typeof where18 != 'undefined' && where18 != null && where18 != 'null') {
                        where = where.substring(0, where.lastIndexOf("and"));
                        where += "!" + where18 + " and ";
                    }
                }catch (e) {
                    console.log(e);
                }
            }catch(e){
                $.messager.alert("操作提示", "字段:"+fieldId+"在获取值进行查询的时候出现了错误。检查页面是否存在这个字段或检查设置是否出现控件位置重叠。","warning");
            }
            return where;
        },
        // 获得sql参数    这个函数应该是为了31,43等类型控件获取动态sql调用的,但好像又不调用这个函数反而调用下面面板的了。
        getSqlMap : function() {//获取是496窗体这里获取不到全部面板控件的值 调用getPanMap_All比较好
            var value = "";
            var item = {};
            var inMap = null;
            var noCol = "";
            var panInfo = this.panInfo;
            for ( var i = 0; i < panMain[panIndex].sqlParam.length; i++) {
                inMap = panInfo[panMain[panIndex].sqlParam[i]];
                switch (parseInt(inMap.controltype)) {// 针对不同类型有不同的货值方法?赋值方法!
                    case 37:
                        value = get37Value(key);
                        // 添加触发空间值
                        set_37ckChang(key);
                        break;
                    case 34:
                    case 38:
                        value = "******";// 借助这个值不保存
                        break;
                    case 43:
                        value=$("#"+key).val();
                        if(value!=null && value!=""){
                            if(value instanceof Array){
                                value=value.join(";");
                            }
                        }
                        break;
                    default:
                        value = getDoc(key, '.value');
                        break;
                }
                if (typeof value == 'undefined') {
                    noCol += key + ","
                }
                value = (value != null) ? value.Trim() : null;
                item[key] = value;
                // 权限控制是否能修改 xin 2018-12-9 11:23:32
                if($('#'+key+'_expr').length>0 && $('#'+key+'_expr').val()=='0'){
                    delete item[key];
                }
            }
            if (noCol != "") {
                $.messager.alert("操作提示", noCol + "这些字段在页面上没有,区分大小写,请检查!","warning");
            }
            return item;
        },
        // 获得面板集合  参数获取面板值都在这里执行
        getPanMap_All : function() {
            var value = "";
            var item = {};
            var inMap = null;
            var noCol = "";
            var panInfo =this.panInfo;
            try{
                for ( var key in panInfo) {
                    inMap = panInfo[key];
                    switch (parseInt(inMap.controltype)) {// 针对不同类型有不同的货值方法
                        case 6://复选框
                            value=$('#'+key).val();
                            break;
                        case 37:
                            value = get37Value(key);
                            // 添加触发空间值
                            set_37ckChang(key);
                            break;
                        case 34:
                        case 38:
                            value = "******";// 借助这个值不保存
                            break;
                        case 40://图片浏览控件获取值 -xin 2020-6-15 17:25:30
                            value = $doc(key).src();
                            break;
                        case 41:
                            continue;
                        case 43:
                            value=$("#"+key).val();
                            if(value!=null && value!=""){
                                if(value instanceof Array){
                                    value=value.join(";");
                                }
                            }else{
                                value="";
                            }
                            break;
                        default:
                            //有索引是1表示为多表的情况
                            if(panMain[1] != undefined){
                                value = $doc(key).val();// 根据索引控件来取值
                                if (value == '' && key != 'docversion') {//把子功能面板的版本号字段排除 xin 2022-5-30 09:56:24
                                    value = getDoc(key, '.value');
                                }
                            } else {
                                value = getDoc(key, '.value');
                                if (typeof value == 'undefined') {//上面的取值如果出现两个相同的key但不相同的标签时候就会导致获取失败,用JQ方法在获取一次 xin 2022-6-1 09:35:23
                                    // value = $("#" + key).val();
                                    value = $doc(key).val();
                                }
                            }
                            break;
                    }
                    if (typeof value == 'undefined') {
                        noCol += key + ","
                    }
                    value = (value != null) ? value.Trim() : null;
                    item[key] = value;
                    //感应字段或特殊字段不需要提交到后台的处理 xin 2021-3-10 09:40:42
                    this.specialInductionFields(item,key,inMap.datalink);
                }
            }catch(e){
                $.messager.alert("操作提示", '获得面板集合出现字段获取错误:'+e,"warning");
                return;
            }
            if (noCol != "") {
                $.messager.alert("操作提示", noCol + "这些字段在页面上未能发现,检查是否区分大小写或检查是否重叠了控件位置!","warning");
            }
            return item;
        },
        //这个函数对单据类型窗体的一些感应字段或特殊字段不需要提交到后台的处理;xin 2021-3-10 09:28:52
        specialInductionFields : function(item,key,datalink){
            try {
                //处理不勾选感应的字段(个别窗体如:22类型 10类型需要排除)
                // 0表示不需要对该字段进行提交处理
                // 1表示需要提交该字段。
                if (datalink != null && datalink == 0 && formType != 22 && formType != 10) {
                    delete item[key];
                }
                // 权限控制是否能修改 xin 2018-12-9 11:23:32
                if ($('#' + key + '_expr').length > 0 && $('#' + key + '_expr').val() == '0') {
                    delete item[key];
                }
                //是单据类型窗体进入(特殊字段处理)xin 2021-3-10 10:00:26
                if (';5;8;16;496;'.indexOf(';' + formType + ';') != -1) {
                    key = key.toLowerCase();//转小写
                    switch (key) {
                        case 'qrcode' ://特殊字段,如果还有其他字段则在这个下面添加
                        // case 'xxx' :
                            delete item[key];
                            break;
                        default:
                            break;
                    }
                }
            } catch (e) {
                $.messager.alert("操作提示", key + "字段进行感应过滤时出现问题。", "warning");
            }
        },
        getBack : function(e, id) {
            if (getBackBool) {
                var pi = this.panInfo[id];
                var biao = pi.ft;
                var col = id;
                var waiziduan = pi.fk;
                var benziduan = pi.seekgroupid.toLowerCase();
                var tjz = pi.spremissfield;
                var tjw = pi.dpremissfield;
                var tjd = pi.efilter;
                var event = $.event.fix(e);
                var v_ = getDoc(col, '.value');
                if (this.id != id || this.value != v_ || event.keyCode ==13 ) {
                    this.id = id;
                    this.value = v_;
                    if ((";8;".indexOf(";" + event.keyCode + ";") == -1)) {// 不是退格键
                        if ((getBackElse && v_ != "")
                            || (";13;9;".indexOf(";" + event.keyCode + ";") != -1)) {// 是三点弹出,非MASTERCODE只有这两种情况触发
                            var tiaojian = this.getWhere(tjz, tjw, tjd, benziduan,
                                waiziduan, col);
                            var url = "/inv.do?id=" + biao + "&where="
                                + replacePageValue(tiaojian) + "&sel="
                                + waiziduan + "&get=" + benziduan;
                            // 添加event.keyCode==13是为了防止三点弹出进入两次页卡。-2017-4-26 -xin
                            if (openTree && event.keyCode ==13) {
                                url = encodeURI(encodeURI(url));// 必须两次
                                $.post(url, '', function(date) {
                                    getBackElse = false;
                                    callBack(col, date);
                                });
                            }
                        }
                    }
                    getBackElse = false;
                }
            }
        },
        getBackAll : function(e, id) {
            if (getBackBool) {
                var pi = this.panInfo[id];
                var biao = pi.ft;
                var col = id;
                var waiziduan = pi.fk;
                var benziduan = pi.seekgroupid;
                var tjz = pi.spremissfield;
                var tjw = pi.dpremissfield;
                var tjd = pi.efilter;
                var event = $.event.fix(e);
                var v_ = getDoc(col, '.value');
                if (this.id != id || this.value != v_) {
                    this.id = id;
                    this.value = v_;
                    if ((";8;".indexOf(";" + event.keyCode + ";") == -1)) {// 不是退格键
                        if ((getBackElse && v_ != "")
                            || (";13;9;".indexOf(";" + event.keyCode + ";") != -1)) {// 是MASTERCODE可以让其多出一种方式带出值
                            var tiaojian = this.getWhere(tjz, tjw, tjd, benziduan,
                                waiziduan, col);
                            var url = "/invAll.do?id=" + biao + "&where="
                                + replacePageValue(tiaojian);
                            if (openTree) {
                                url = encodeURI(encodeURI(url));// 必须两次
                                $.post(url, '', function(date) {
                                    getBackElse = false;
                                    callBack(col, date,waiziduan,benziduan);
                                    if(panMain[panIndex].formtypeOne==10 && event.keyCode ==13){//针对10窗体个别操作不保存 xin 2020-10-13 14:38:01
                                        panMain[panIndex].isChange=0;
                                    }
                                    if(event.keyCode ==13){
                                        getSelect31(id);
                                    }
                                });
                            }
                        }
                    }
                    getBackElse = false;
                }
            }
        },
        // 非加载才进入//,colStr,guanColStr
        ////每一个控件的onChang事件进入
        set_upSub : function(op) {
            var pi = this.panInfo[op];
            if(pi==undefined){
                pi=panMain[gtss].panInfo[op];
            }
            shx=true;
            top.myFresh.panel[top.tabindex+'-t']=true;// 页卡关闭获取面板是否有内容改变。
            var xinzen_v = $doc(op).val();
            if (xinzen_v == "pb_xinzen") {// 为下拉控件的<<新增>>处理 (2控件或31控件)
                if (pi.ft < 0) {
                    parent.addTab("", 9815, 10, "wherePan=dictid=" + pi.ft);
                } else {
                    this.windowOpen(pi, true);// 三点回带值
                }
            } else {//
                if (no_load_first) {
                    this.isChange = 1;// 分为两个面板,可有是在另个面板赋值给第个面板(已经加载完) 则会触发
                                        // 要不让起触发
                    var value = "";
                    var pi = this.panInfo[op];
                    if(pi==undefined){
                        pi=panMain[gtss].panInfo[op];
                    }
                    var guanCol = "";
                    if(pi!=undefined){
                        guanCol= pi.emptyrefdata.toLowerCase();
                        if(pi.controltype==31){//31类型特殊处理。
                            value=$doc(op).val();
                            $doc(op+'text').val(value);
                        }
                        if(pi.controltype==2){//处理2类型关联字段问题 xin 2021-4-19 15:52:10
                            if (this.select[op]!=null){//有关联字段
                                getSelect31(op);
                            }
                        }
                    }
                    var szc = null;
                    // 后添加与表格的处理
                    var hasB = null;
                    value = getDoc(op, ".value");
                    if (this.formtypeOne == 1) {
                        setPanel301 = true;
                    }
                    if (setPanel301 && gridToPanel) {
                        var st = [];
                        var val = [];
                        st.push(op);
                        val.push(value);
                        if (Grids.length > 0) {
                            mygrid.recalPanel301(st, val);
                        }
                        setPanel301 = false;
                    }
                    if (guanCol != "") {
                        if (guanCol.indexOf('|') != -1) {// 后加
                            hasB = guanCol.split('|');
                            if (hasB[0] == 'recalcuitem' && gridToPanel) {
                                // mygrid.recalcuitem(cols[i],value);//改变时调用
                            }
                            szc = hasB[1].split(";"); // 多加判断
                        } else {
                            if (guanCol == 'recalcuitem#' && gridToPanel) {// #号是特别加
                                // 的,以此判断页面是否有这个变量
                                // mygrid.recalcuitem(cols[i],value);//改变时调用
                                szc = "".split(";");
                            } else {
                                szc = guanCol.split(";");
                            }
                        }
                        if (value == "") {
                            for ( var j = 0; j < szc.length; j++) {
                                if (szc[j].indexOf("#") == -1) {// 是3类型控件才执行
                                    no_load_first = false;// 不要让底下赋值再进入此方法,避免死循环
                                    if(formType != 496)// 这条件是如果496的其他页卡文本框填写信息后,光标离开导致主面板42类型控件的信息清空。
                                        setDoc(szc[j], ".value=''");// 解决三点弹出清空关联
                                } else {
                                    $.messager.alert("操作提示", cols[i]
                                        + "字段的清空关联字段"
                                        + szc[j]
                                            .substring(0, szc[j].length - 1)
                                        + "在页面上没有!","warning");
                                }
                            }
                            no_load_first = true;// 但还是还原,以被后面程序使用
                        }
                    }
                }
            }
        },
        // 设置只读,加载用
        set_read_load : function(readList, docstatePan, isnew, db, info) {
            // reads拆分0:【0不是只读;pb#用docstatus控制是否可编辑|多值用分号(;)隔开;pb#字段Id;pb#是否设置了按钮;pb#控件类型
            // 】
            // redds拆分1:【1是只读;pb#字段Id;pb#控件类型】
            // redds拆分2:【2是OA审核按钮;pb#有按钮的字段Id;pb#buttonID按钮的Id;pb#OA审核按钮设置用docstatus控制是否可显示|多值用分号(;)隔开】
            // var readList = reads;//reads.split(";fen#");
            var readIs = null;
            var buttonHid = false;// 按钮隐藏
            var pan = false;
            var buttonId = "";
            var oacopy="";
            var getBool = no_load_first;
            no_load_first = false;// 只有加载时触发此事件,表明其为加载时,防止程序未知处把其值改了
            var filedIs = null;
            var bzc = true;
            var sto = true;// 检查用到
            //如果是496类型的话,docstatePan有可能在子表的时候获取不到值,导致状态值不对,所以在这样获取主表里的docstaePan值 xin 2021-12-20 10:22:33
            docstatePan=getDoc("docstatus",".value");// 获取单据的单据状态
            docstatePan=(docstatePan==""?0:docstatePan);
            if (readList != null && readList.length > 0) {
                for ( var i = 0; i < readList.length; i++) {
                    sto = true;
                    if (readList[i] != "") {
                        readIs = readList[i];// .split(";pb#");
                        // readIs[0]:0不是只读 ,1是只读,2有OA审核按钮设置
                        switch (parseInt(readIs[0])) {
                            case 0:
                                if (this.formtypeOne != 1) {
                                    if (getDoc(readIs[2] + '_expr', '') != null
                                        && getDoc(readIs[2] + '_expr', '.value') != ""// 少了==1会导致9902设置权限得不到控制。
                                        && (panMain[panIndex].bolCopy !=1 ||(getDoc(readIs[2] + '_expr', '.value') == 0))) {// panMain[panIndex].bolCopy检查是否是复单,是就不进入。
                                        sto = false;
                                    }
                                    if (getDoc(readIs[2] + '_expr', '') != null
                                        && getDoc(readIs[2] + '_expr', '.value') != ""
                                        && getDoc(readIs[2] + '_expr', '.value') == 2) {
                                        break;
                                    }
                                    if (sto) {
                                        this.setRead(readIs[1], docstatePan, isnew,
                                            readIs[2], readIs[3], 'curchecker', db,
                                            parseInt(readIs[4]));
                                    }else{
                                        // if(getDoc(readIs[2] + '_expr',
                                        // '.value') != 1){
                                        this.setReadOnly(readIs[2],parseInt(readIs[4]));// readIs[3]
                                        // setDoc(readIs[2],
                                        // ".disabled=disabled");// 不能进行操作
                                        // }
                                    }
                                    this.hasStyleCss(readIs[2]);//stylecss处理
                                }
                                break;
                            case 1:// 只读设置
                                this.setReadOnly(readIs[1],readIs[2]);
                                this.hasStyleCss(readIs[1]);//stylecss处理
                                break;
                            case 2:// 逐一按钮设置
                                // 增加info信息判断按钮,为1继续,否则隐藏跳开
                                filedIs = readIs[2];// readIs[1]+readIs[2]+'Button';
                                if (info != null && info.length > 0) {
                                    for ( var j = 0; j < info.length; j++) {
                                        if (info[j].filed == filedIs) {// 查看此按钮的设置
                                            bzc = (info[j].value == "1") ? true : false;
                                            if (info[j].value == "1") {//这里判断把,放在下面bzc判断有问题。xin 2021-11-20 11:19:03
                                                //显示审核按钮 xin 2021-10-21 17:23:17
                                                $(".OAVerify").css("display", "inline-block");
                                                //显示下一单按钮 xin 2022-7-30 11:47:49
                                                $(".nextDocIco").css("display", "inline-block");
                                            }
                                            break;
                                        }
                                    }
                                }
                                if (bzc) {
                                    // pan = this.zhuYi(filedIs, readIs[3],
                                    // docstatePan,
                                    // 'curchecked', db);
                                } else {
                                    bzc = true;
                                    pan = true;// 则为隐藏
                                    setDoc(filedIs, ".style.display='none'");
                                }
                                if (buttonId == readIs[1]) {// 第一个判断按钮是不会进入的
                                    buttonHid = buttonHid ? pan : false;// 当有一个按钮显示,则控件为原长
                                } else {
                                    set_buttonHid(buttonHid, buttonId);// 进入这为第二个控件按钮了
                                    buttonId = readIs[1];
                                    buttonHid = pan;// 这总为是控件的第一个按钮
                                }
                                // 处理不是审核人 这个id还是显示的是可编辑状态
                                // 。不是审核人,有OA审核的控件应该是只读状态
                                if(!isNaN(readIs[2])){
                                    if(readIs[1]!=oacopy){
                                        // 查找面板在这个id里面是否有审核按钮ID没有说明这个id在这个账号没权限编辑 只能是只读状态
                                        if(doc(readIs[2]) == null){
                                            setDoc(readIs[1], ".readOnly =true");// 设置为只读
                                            setDoc(readIs[1], ".style.backgroundColor ='#CCC'");
                                        }else{
                                            setDoc(readIs[1], ".readOnly =false");
                                            setDoc(readIs[1], ".style.backgroundColor ='#FFFFFF'");
                                            oacopy=readIs[1];
                                            //审核按钮过长情况,设置控件宽度
                                            var widthId=$("#"+readIs[1]).width();
                                            if(widthId!=null && widthId>0){
                                                $("#"+readIs[1]).width(widthId/2+200);
                                            }
                                        }
                                    }
                                }
                                break;
                        }
                    }
                }
                set_buttonHid(buttonHid, buttonId);// 按钮全隐藏的
                                                    // 这可能是最后一个有按钮的控件没有判断到
            }
            //31控件新的加载方式 xin 2020-9-18 16:45:00
            try{
                var panc = panMain[panIndex].panInfo;
                if (panc != undefined) {
                    for (var k in panc) {//遍历每一个控件是否关联有下拉需要到的替换值
                        //if(panc[k].controltype==31 || panc[k].controltype==2){
                        var v = $doc(k).val();
                        if (v != null) {
                            getSelect31(k);
                        }
                        //}
                    }
                }
            }catch(e){}
            if(top.myFresh!=null){
                top.myFresh.panel[top.tabindex+'-t']=false;// 页卡关闭获取面板是否有内容改变。
            }
            no_load_first = getBool;// 当然事情完了,还是还原其本来值
        },
        hasStyleCss:function(id){//处理stylecss
            if (getDoc(id + '_css', '') != null && getDoc(id + '_css', '.value') != "") {// css样式
                let css = getDoc(id, ".style");// 控件样式
                let cssz = "";
                for (var r = 0; r < css.length; r++) {
                    cssz += css[r] + ":" + css[css[r]] + ";";// 组装
                }
                cssz += getDoc(id + '_css', '.value');// 获取9802设置的控件样式
                setDoc(id, ".style='" + cssz + "'");// 赋值最新的控件样式css
            }
        },
        hasIn : function(str, strs) {
            var strti;
            for ( var j = 0; j < strs.length; j++) {
                strti = strs[j].toLowerCase().Trim();// alert(strti+"----"+usercode);
                if (strti != "" && strti == str) {
                    return true;
                }
            }
            return false;
        },
        zhuYi : function(id, statepan, docstatePan, idpan, usercode) {// ,NeedRelease,CurChecked,CurChecker
            var states = statepan.split(";");
            var may = true;
            var mayHas = this.isHasTo(idpan, usercode, false);// 是否检查过
            var curHas = false;// 是否是检查人
            if (getDoc('curchecker', '.value') == "all") {
                curHas = true;
            } else {
                // curHas = this.isHasTo('curchecker', usercode, false);//
                // 是否是检查人 注释时间:2014-6-12 10:13:03
            }
            for ( var i = 0; i < states.length; i++) {// isNewOpen参数已经没有作用,程序未改动(保留)
                if (states[i] != "" && docstatePan == parseInt(states[i])) {// 符合一个状态就进入
                    var isZhu = (getDoc('needrelease', "") == null || getDoc(
                        'needrelease', ".value") == "1") ? true : false;
                    var cured = (getDoc('curchecked', "") == null) ? "" : getDoc(
                        'curchecked', ".value");
                    var cur = (getDoc('curchecker', "") == null) ? "" : getDoc(
                        'curchecker', ".value");
                    if (isZhu && curHas) {// 如果是逐一审核,并且是检查人
                        var shenS = cur.split(',');
                        for ( var i = 0; i < shenS.length; i++) {
                            if (cured.indexOf(shenS[i]) == -1) {// 需审核人在已审核人中不存在则未全部审核
                                may = false;// 返回假停留,显示按钮
                                // setDoc(id,".style.display = 'block'");//
                                break;
                            }
                        }
                    } else {// 不是逐一审核默认就可以吧
                        // 后加让当前状态,属于可以检查的人时的按钮显示
                        if (curHas) {// 是检查人
                            may = false;
                            // setDoc(id,".style.display = 'block'");//
                        }
                    }
                    break;// 有一个符合就可了,不跳出可能又把它隐藏了
                }
            }
            if (id != '') {
                if (may) {// 不符合还是把它隐藏
                    setDoc(id, ".style.display = 'none'");//
                } else {
                    setDoc(id, ".style.display = 'block'");
                }
            } else {
                if (statepan == "") {
                    may = false;
                }
            }
            return may;
        },
        // 1,登陆人状态2为控件状态3是否新单4是否有按钮
        setRead : function(statepan, docstatePan, isNewOpen, id, hasbutton, idpan,
                           usercode, type) {// 判断按钮以及是否可以输入状态(301101)
            hasButton = hasbutton;
            var states = statepan.split(";");
            var may = false;// false就执行匹配
            if (getDoc('curchecker', '.value') == "all") {
                may = true;
            } else {
                may = this.isHasTo(idpan, usercode, false);//审核填写审核信息。
            }
            // var creater = this.isHasTo('createusercode', usercode, false);
            // false就执行匹配 //注释掉是因为已经没了那个字段。
            for ( var i = 0; i < states.length; i++) {// isNewOpen参数已经没有作用,程序未改动(保留)
                if (docstatePan == states[i]) {
                    this.setNotReadOnly(id, type);// 不为只读
                    setDoc(id, ".disabled =false");// 没有被设置就启用
                    if (docstatePan != 0 && !may) {// 这等于已经还原按钮之后,看看当前人是否为可以使用按钮
                        seltboo=true;// 修改权限 2015-5-19 18:05:41 --- xin
                        this.setReadOnly(id, type);// 这中无审核权力的也为只读
                        if (doc('tpSave') != null) {
                            doc('tpSave').style.display = 'none';// 保存按钮隐藏
                        }
                    }
                    break;
                } else {
                    this.setReadOnly(id, type); // 设置只读,里面包含控制按钮
                }
            }
            if (docstatePan < 0) {// 驳回时,隐藏保存按钮
                if (document.getElementById('tpSave') != null) {
                    document.getElementById('tpSave').style.display = 'none';// 保存按钮隐藏
                }
            }
            hasButton = false;// 还原,这样写这是为在生成静态页面避免传太多参数
        },// id 与控件类型 只读
        setReadOnly : function(id, type) {// 添加一个在生成静态页面时的只读,(很多在生成页面考虑不完全,直接到js中添加吧)
            this.setReadOK(id, type, true)
        },// id 与控件类型 反过来设置为不为只读
        setNotReadOnly : function(id, type) {// 添加一个在生成静态页面时的只读,(很多在生成页面考虑不完全,直接到js中添加吧)
            this.setReadOK(id, type, false)
        },
        checkDocStatus : function(id,boo,type) {
            if(formType&&(formType==5||formType==9
                ||formType==15||formType==8
                ||formType==496||formType==497
                ||formType==16||formType==17)){
                docstatePan=getDoc("docstatus",".value");// 获取单据的单据状态
 
                var stats = panMain[panIndex].picState[id];
                if(stats) {
                    var temp=stats.split("pb#");
 
                    if ((";" + temp[1] + ";").indexOf(";" + docstatePan + ";") > -1)
                        boo = false;
                    else
                        boo = true;
                }
            }
            if(boo){
                try{
                    fileupload_config.browseOnZoneClick=false; // true为只读状态
                }catch(e){alert(e);}
                $("#"+id).attr("data-readonly",boo);//是否只读
            }
            if(type==19){
                var container = $("#"+id + "_dynamic");   // 隐藏上传浏览框
                var uploadDiv = container.find(".file-caption-main");
                if (uploadDiv != null && uploadDiv != undefined){
                    uploadDiv.hide();
                }
            }
            return boo;
        },
        setReadOK : function(id, type, boo) {
            // 后加把 *****显示的变只读
            // boo = (getDoc(id, '.value') == "******") ? true :
            // boo;//如果值就是******的话这写法不成立。 xin 2019-5-25 14:30:54
            switch (parseInt(type)) {
                case 6:// 复选框
                    this.setNotReadOnly(id + "CheckBox", "");
                    setDoc(id + "CheckBox", ".disabled =" + boo);// 没办法只能用这个了
                    break;
                case 2:// 下拉
                case 31:// 下拉
                    var setl=getDoc(id, '.readOnly');
                    if(typeof setl =='undefined'){        // 修改权限 2015-5-19
                                                        // 18:05:41 ---
                        // xin
                        if(boo && !seltboo){setDoc(id, ".disabled =true");
                        }else{setDoc(id, ".disabled =false");seltboo=false;
                        }
                    }else{
                        setDoc(id, ".disabled =" + boo);
                    }
                    break;
                case 3:// 三点弹出
                    setDoc(id + "Tree", ".value = " + (boo ? "0" : "1"));
                    break;
                case 5:// 日期控件
                    setDoc(id + "Date", ".value = " + (boo ? "0" : "1"));
                    break;
                case 7:// 多文本控件
                    setDoc(id + "Text", ".value = " + (boo ? "0" : "1"));
                    break;
                case 9:// 图片类型
                    seltboo=this.checkDocStatus(id,boo,9);
 
                    break;
                case 19:// 上传附件
                    seltboo=this.checkDocStatus(id,boo,19);
                    break;
                case 30:// 多选复选框
                    setDoc(id + "Span", ".disabled = " + boo);
                    checkboxDisabled(id,boo);
                    break;
                case 32:// 单选按钮组
                    var radios = document.getElementsByName(id + 'Radio');
                    for ( var i = 0; i < radios.length; i++) {
                        setDoc(radios[i].id, ".disabled = " + boo);
                    }
                    break;
                case 35:// 下拉加可输入
                    setDoc(id + "_35", ".disabled = " + boo);
                    break;
                case 37:// 富文本
                    setDoc(id + "_spanHid2", ".style.display=" + boo ? "'none'"
                        : "'block'");
                    // setHidOrNot(id+'_hid',id+'_spanHid');
                    break;
                case 42://
                    setDoc(id, ".disabled = " + boo);
                    break;
                case 43://
                    $(".js-"+id).prop("disabled", boo);
                    break;
                case 46://
                    setDoc(id, ".disabled = " + boo);
                    break;
                default:
                    break;
            }
            if(getDoc(id, '.style.backgroundColor')=="" && parseInt(type) !=46){
                setDoc(id, ".style.backgroundColor =" + (boo ? "'#CCC'" : "'#FFFFFF'")); // 设置背景色
            }
            setDoc(id, ".style.color ='#000000'");// 设置字体颜色
            setDoc(id, ".readOnly = " + boo);// 设置为只读
            if(seltboo){
                setDoc(id, ".readOnly =false");// 设置为只读 特殊 前人是否为可以使用按钮2015-5-20
                // 10:50:26 --xin
                if(parseInt(type) !=46) {
                    setDoc(id, ".style.backgroundColor ='#FFFFFF'");
                }
                seltboo=false;
            }
            if (boo) {
                setDoc(id, ".style.backgroundColor ='#CCC'"); // 设置背景色 xin 2022-6-8 16:49:40
                setDoc(id+"_click",".style.display='none'");// 设置控件只读的时候右边图标隐藏
                var link = getDoc(id + '_show_link', '');
                if (link != null) {
                    var vvv = getDoc(id, '.value');
                    if (vvv != "") {
                        $doc(id + '_Link').html(vvv);
                        $('#' + id + '_show_link').show();
                        $('#' + id + '_show_type').hide();
                    }
                }
            }else{
                setDoc(id+"_click",".style.display='inline'");// 复单的时候右边图标显示
                if(parseInt(type) !=46){
                    setDoc(id, ".style.backgroundColor ='#FFFFFF'"); // 不是只读状态,设置背景色 xin 2022-6-8 16:49:40
                }
            }
        },// 设置读者域:1.读者域(按个人)2.读者域(按角色)3.读者域(按组织架构)4.登录usercode
        isReadTo : function(ReaderUsercodes, ReaderRoles, ReaderOrganizations) {
            if (isNew != 1 && ";" == panMain[panIndex].upDoc
                && ";" == panMain[panIndex].nextDoc) {// 不为新开单,且无数据为无权限
                // closeme("抱歉您没有权限查看该单据!");
                return;
            }
            var mayOpen = false;
            // 检查注释时间 2014-7-4 10:37:46
            mayOpen = this.isHasTo('readerusercodes', ReaderUsercodes, mayOpen);
            // 注释时间 2014-7-4 10:37:46
            mayOpen = this.isHasTo('readerroles', ReaderRoles, mayOpen);
            // 检查注释时间 2014-7-4 10:37:46
            mayOpen = this.isHasTo('readerorganizations', ReaderOrganizations,mayOpen);
            if (hasShezhiZiduan) {
                var reUsercode = getDoc('readerusercodes', ".value");
                var reRol = getDoc('readerroles', ".value");
                var regan = getDoc('readerorganizations', ".value");
                if (reUsercode == "" && reRol == "" && regan == "") {
                    mayOpen = true;
                }
            } else {// 无权限设置字段默认也可看此文档
                mayOpen = true;
            }
            if (isSuperUser!=null){//超级管理员
                mayOpen = (isSuperUser=='1'?true:mayOpen);
            }
            if (!mayOpen) {// 没有权限看的人直接关闭当前页面,不再提示
                hasShezhiZiduan = true;
                Close = true;// 让页面可以直接关闭
                document.getElementById("scroller").style.display="none";// 隐藏
                $.messager.alert('提示','你没有权限查看!','info',function(){
                    // 返回
                    top.$('#home-tabs').tabs('close',top.tabindex);
                });
                $(".panel-tool-close").css("display","none");
            }
            return mayOpen;
        },
        //加载初始值 新单进入
        setDefaultAll : function() {
            var info =panMain[panIndex].panInfo;//this.panInfo;注释:多表情况
            var hcol = this.html_Col;//复单后字段
            var colid = null;
            var type = null;
            var initv = "";
            var dat=[];
            var typ=[];
            var t=0;
            var d=0;
            let format="";
            for ( var i = 0; i < hcol.length; i++) {
                colid = hcol[i].fileid;
                type = info[colid].controltype;
                if (info[colid].initValue != "") {
                    initv = info[colid].initValue;
                }
                format = info[colid].format;
                format = format == null ? "" : format;
                if(initv.indexOf("!")!=-1){
                    dat[t]=colid;
                    typ[t]=type;
                    t++;
                    // by danaus 2018-4-22 修改提交方式,适应新tomcat
                    $.ajax({
                        url:"/gtGrid.do",
                        type:"post",
                        async:false,
                        data:"m=heand&_pop_json={"+"'parm':\"" + encodeText(initv.replace(/\\/g,"").replace("!",""))+"\"}" +
                            "&controltype="+type+"&format="+format,
                        dataType:'text',
                        success :function(data){
                            if (data.indexOf("error")!=-1 ) {
                                $.messager.alert("操作提示", data,"warning");
                            } else {
                                if(data==null){data="";}
                                if($doc(colid).val()==''){//解决18窗体传31控件值过来,被有!号的初始值替换了的问题。xin 2020-3-11 14:52:31
                                  setDoc(dat[d], ".value='" + data + "'");
                                }
                                if(parseInt(typ[d])==31 || parseInt(typ[d])==2){
                                    if($("#"+colid).find("option:selected").val()==undefined){
                                        setDoc(dat[d], ".value='" + data + "'");
                                    }
                                }
                                if(type==43){
                                    $("#"+dat[d]).val(eval('('+data+')')).trigger('change');
                                    panMain[panIndex].panInfo[colid].initValue=eval('('+data+')');
                                }
                                setLoadEven(dat[d], parseInt(typ[d]));
                                d++;
                            }
                        }});
                }else{
                    switch(parseInt(type)) {
                    case 2:
                    case 31:
                        if (getDoc(colid, ".length") == 0) {
                            setDoc(colid, ".length=0");
                            $doc(colid).optionsAdd(initv,initv);
                        }
                        if (getDoc(colid, ".value") == "") {
                            select_toValue(initv, colid)
                            setLoadEven(colid, parseInt(type));
                        }
                        if($doc(colid+'text').val()==''){//多表
                                $doc(colid+'text').val(initv);
                        }
                        break;
                    case  41:
                        if($doc(colid).html()==''){
                            $doc(colid).html(initv);
                        }
                        break;
                    case 43:
                        if($doc(colid+'text').val()==''){
                            $doc(colid + 'text').val(initv);
                            if (initv != null && initv != "") {
                                try {
                                    let value = "";
                                    if (initv.indexOf(";") != -1) {
                                        value = initv.split(";");
                                    } else {
                                        value = eval('(' + initv + ')');
                                    }
                                    $("#" + colid).val(value).trigger('change');//43控件初始值的赋值 xin 2021-10-19 11:40:30
                                } catch (e) {
                                    break;
                                }
                            }
                        }
                        break;
                    default:
                        if(panMain[1] != undefined){//多表
                            if($doc(colid).val()==''){
                                $doc(colid).val(initv);
                                setLoadEven(colid, parseInt(type));
                            }
                        }else{
                            if (getDoc(colid, ".value") == "") {
                                setDoc(colid, ".value='" + initv + "'");
                                setLoadEven(colid, parseInt(type));
                            }
                        }
                        break;
                    }
                }
                initv='';//清空
            }
        },
        htmlGet : function(id) {
            var valCol = null;
            var hc = this.html_Col;
            if (hc != "") {
                var col = null;
                for ( var i = 0; i < hc.length; i++) {
                    col = hc[i].fileid;
                    if (id == col) {
                        if (doc(col) != null) {
                            valCol = doc(col).value;
                        }
                        break;
                    }
                }
            }
            return valCol;
        },
        panInfoSet : function(c, vS, boo) {
            var p = this.panInfo;
            if (c != "") {
                var valueS = vS;
                if (boo) {
                    valueS = vS.split(";pb#");
                }
                var v_ = "";
                var col = "";
                var type = null;
                var colCom = null;
                for ( var i = 0; i < c.length; i++) {
                    col = c[i].fileid;
                    type = p[col].controltype
                    if (boo) {
                        v_ = valueS[i];
                    } else {
                        v_ = valueS[col].toString();
                    }
                    v_ = v_.replace(/'+/g, "\\'").Trim();
                    if ((type == "2" || type == "31") && getDoc(col, ".length") == 0) {
                        setDoc(col, ".length=0");
                        $doc(col).optionsAdd(v_, v_);
                    }
                    setDoc(col, ".value='" + v_ + "'");
                    setLoadEven(col, type);
                }
            }
        },
        windowLink : function(id) {
            id = id.toLowerCase();
            var pm =this.panInfo[id];
            if(pm==undefined){
                // 循环p是针对选项卡嵌套多个面板里面的值。
                for(var p=1;p<7;p++){
                    pm=panMain[p].panInfo[id];
                    if(pm!=undefined){break; }
                }
            }
            var bh = pm.hyperlinkft;
            var bx = pm.hyperlinkftformtype;
            var bb = pm.hyperlinkspremissfield.split(';');
            var wb = pm.hyperlinkdpremissfield.split(';');
            var linkmode=pm.Hyperlinkmode;//操作模式
            var isAutoRefresh=pm.isAutoRefresh;//执行后刷新
            var zd = pm.hyperlinkefilter;
            var paUs = parent.document.URL.split("/");
            // by danaus 2016-3-29
            if(bh==""||bh==undefined){$.messager.alert("操作提示", "9802的超链接|外表功能号不能为空","warning");return;};
            bh = isNaN(bh) ? getDoc(bh.toLowerCase(), '.value') : bh;
            bx = isNaN(bx) ? getDoc(bx.toLowerCase(), '.value') : bx;
            var no1=new Array();
            // by danaus 2019-7-4,解决bb[n].toLowerCase()不是字段名,而是值的情况
            for(var n=0;n<bb.length;n++){
                try {
                    if ($("#" + bb[n].toLowerCase()).length > 0) {
                        no1[n] = getDoc(bb[n].toLowerCase(), '.value');
                    } else {// 不存在表示传原值
                        no1[n] = bb[n].toLowerCase();
                    }
                }catch (e) {
                    no1[n] = bb[n].toLowerCase();
                }
            }
            if(linkmode==1){//直接执行
                ///execProc.do
                $.post('/execProcV2.do',{'formid':bh,'param':no1.join(';'),'disableDuplicateSubmitUUID':systemUuid.uuid },function(data){
                    if(data.state!=null && data.state==0){
                        let info = data.data;
                        let doc = info.linkdocinfo;
                        let msg = info.memo;
                        if (doc == null || doc == '') {
                            $.messager.show({
                                title: '提示',
                                msg: '<div align="center">' + (msg || '执行完毕!') + '</div>',
                                showType: 'fade',
                                timeout: 1000,
                                style: {
                                    right: '',
                                    bottom: ''
                                }
                            });
                            return;
                        }
                        $.messager.alert("操作提示", msg, "warning");
                    }else if(data.state!=null && data.state==-1){
                        let msg = data.error || data.msg;
                        $.messager.alert('提示', msg || '出现错误', "info");
                    }else{
                        $.messager.alert('提示', data.msg || '状态无法识别:' + data.state, "info");
                    }
                    // if(data == null || data == ""){
                    //     $.messager.show({
                    //         title: '提示',
                    //         msg: '<div align="center">' + msg + '</div>',
                    //         showType: 'fade',
                    //         timeout: 1000,
                    //         style: {
                    //             right: '',
                    //             bottom: ''
                    //         }
                    //     });
                    // }else{
                    //     if (data.error != null && data.error != '') {
                    //         $.messager.alert("操作提示", data.error, "warning");
                    //         return;
                    //     }
                    //     let ts = data.data.memo || msg;
                    //     $.messager.alert("操作提示", ts, "warning");
                    //     return;
                    // }
                    if(isAutoRefresh){
                        setTimeout(function(){location.reload();}, 3000);//三秒后自动刷新
                    }
                })
                return;
            }
            if(wb!=""){
                var wh_ = "wherePan=" + wb[0] + "='" + no1[0] + "' and " + (wb[1]!=null?wb[1]:wb[0]) + "='" + (no1[1]!=null?no1[1]:no1[0]) + "'";
            }
            if(zd!=""){
                wh_+=" and ("+zd+")";
            }
            if(linkmode==3){//弹出执行界面
                var url = "/app" + spellPath + bh + "/" + bx + "/index.jsp?"+encodeURL(wh_);
                showLayerGrid(url,null);
                return;
            }
            //跳转页面
            // by danaus 2016-3-29
            if(bh==""||bh==null||bh==undefined){$.messager.alert("操作提示", "页面找不到"+pm.hyperlinkft+",请查看它所在9802中的[加载到页面]选项是否已选上","warning");return;};
            parent.formNum(getDoc(bb[0].toLowerCase(),'.value'));
            parent.addTab("", bh, bx, wh_);
        },
        // 3类型弹出框
        windowOpen : function(obj, showBoo,onlyOne) {
            var pi = null;
            var id = "";
            shx=true;
            top.myFresh.panel[top.tabindex+'-t']=true;// 页卡关闭获取面板是否有内容改变。
            var flag = checkSession();// session失效后弹出登录框,flag为true时表示已经失效
            if(flag){
                return;
            }
            if(typeof obj =='string'){
            var flcode=$('#'+obj).data('flcode');
            var flag=$('#'+obj).data('flag');
            // 是否有会计科目设置
            if(flcode!=undefined && flag!=undefined){
                var code=$('#'+flcode).val();
                if(code==undefined || code == ''){
                    $.messager.alert("操作提示", panMain[panIndex].panInfo[flcode].title+",不能为空!","warning");
                    return false;
                }
                $.post('/gtGrid.do?m=gl',{'_pop_json':JSON.stringify({'parm':code,'flag':flag})},function(data){
                    if(data!=undefined && data!=''){
                        var st=data.split(",");
                        var sf="";
                        if(st[3]!=""&&st[3]!="null" && st[2]!=""&&st[2]!="null"){
                            var fk=st[2].split(";");
                            var sd=st[3].split(";");
                            for(var i=0;i<fk.length;i++){
                                if(sd[i]!=undefined){
                                    var v=$("#"+fk[i]).val();
                                    sf+=sd[i]+"="+(v!=undefined?v:"");
                                    if((i+1)<fk.length){
                                        sf+=" or ";
                                    }
                                }
                            }
                        }
                        sf=sf!=''?"?"+encodeText("where="+sf):"";
                        var path="/app" + spellPath +st[0]+"/"+st[1]+"/index.jsp";
                        parent.addTab("",st[0],st[1],"",path+sf);
                }else{
                    $.messager.alert("操作提示", panMain[panIndex].panInfo[flcode].title+",找不到此辅助核算项","warning");
                }
              },'text');
                return false;
            }
            }
            if (typeof (obj) == "object") {
                pi = obj;
            } else {
                id = obj;
                pi = panMain[showBoo].panInfo[id];// this.panInfo[id];
            }
            var mU = "";
            var p = pi.fk;
            var g = pi.seekgroupid;
            var ben = pi.spremissfield;
            var wai = pi.dpremissfield;
            var zi = pi.efilter;
            g = g.toLowerCase();// 必须小写形式
            if (p.split(';').length != g.split(';').length) {
                $.messager.alert("操作提示", "自身字段和外表字段设置的个数不同,请检查设置","warning");
                return;
            }
            if (id != "") {// 如果不为空则为三点弹出
                var isShow = getDoc(id + "Tree", ".value");
                openTree = (isShow == "1") ? true : false;// 处理三点弹出控件的只读设置,禁止点击事件
            }
            if (showBoo != null) {
                openTree = showBoo;
            }
            if (openTree) {
                var where = this.getWhere(ben, wai, zi, g, p, id);
                where = replacePageValue(where);
                var fidt=getDoc(id,".value");
                if(fidt!=null && fidt !="" && where == "" && fidt !="pb_xinzen"){
                    where+=id+"='"+fidt+"'";
                }
                mU += "wherePan=" + where;
                var r = Math.round(Math.random() * 10000);
                mU = mU + "&r=" + r;
                if (pi.ftformtype == '18' && zi != '') {//针对18窗体的外表条件 xin 2022-7-27 14:19:06
                    zi=this.regexp(zi);
                    mU = mU + "&where18=" + zi;
                }
                mU = mU.replace(/%+/g, "@~");
                if (openTree) {// 决定是否打开窗,这个必须,虽然上面有一个,但意义不同
                    // parent.panelToPost = p;
                    // parent.postToThis = g;
                    // parent.panel_onlyOne = onlyOne;
                    // parent.changFrame = inThisFrame;
                    //by danaus 2022/8/1 11:25 用新方法取当前页面的frameid,全局变量在未完全加载就马上切换到其他页面再切换回来会有问题
                    var panelObj={};
                    panelObj.panelToPost = p;
                    panelObj.postToThis = g;
                    panelObj.panel_onlyOne = onlyOne;
                    panelObj.frameName=parent.jQuery(parent.jQuery(parent.jQuery('#home-tabs').tabs('getSelected'))).attr("id");
                    parent.addTab("", pi.ft, pi.ftformtype, mU,null,null,null,null,panelObj);
                }
            }
            openTree = true;
            return false;
        },
        regexp:function(w){
            let str = w;
            let reg = "&\\b.*?\\b&";
            let v = str.match(reg);
            if (v != null && v.length > 0) {
                let id = v[0].replaceAll("&", "").toLowerCase();
                let value = getDoc(id, ".value");
                str = str.replaceAll(v[0], value);
                str = this.regexp(str);
            }
            return str;
        },
        isHasTo : function(id, usercode, toIs) {// id内容中含有usercode就为true,tois进行判断是否匹配
            var mayOpen = toIs;// 要执行就传false,为true就没必要执行了
            if (!toIs) {
                usercode = usercode.toLowerCase();
                var dbi = "";
                if (getDoc(id, '') != null) {// 确定有无此控件
                    dbi = getDoc(id, ".value");
                } else {
                    if (hasShezhiZiduan && (id!="readerusercodes" && id!="readerroles" && id!="readerorganizations" && id!="curchecker")) {// 只弹出第一次筛选出的字段错误。部分字段已经不需要,在这里做判断处理。
                        $.messager.alert("操作提示", "没有设置" + id + "这个字段!","warning");
                    }
                    hasShezhiZiduan = false;
                }
                var no = dbi.indexOf(";");
                if (no != -1 && (pbId.indexOf("[" + id + "]") == -1)) {
                    pbId = pbId + "[" + id + "]";
                    $.messager.alert("操作提示", pbId + "的设置不要以;分割!要以,分割。","warning");
                } else {
                    var str = dbi.split(",");
                    var strs = usercode.split(";");// 后加以分号分隔
                    var strti;
                    for (i = 0; i < str.length; i++) {
                        strti = str[i].toLowerCase().Trim();// alert(strti+"----"+usercode);
                        if (strti != "" && this.hasIn(strti, strs)) {// strti
                                                                        // ==
                            // usercode
                            mayOpen = true;
                            break;
                        }
                    }
                }
            }
            return mayOpen;
        },
        //每一个控件的onChang事件进入(公式处理)
        upSub_gongsi : function(op, gongSiCo, gongSi) {
            var gongcols = gongSiCo.split(";");
            if (no_load_first) {
                for ( var i = 0; i < gongcols.length; i++) {
                    if (gongcols[i] != "" && op.toLowerCase() == gongcols[i].toLowerCase()) {
                        var gongshiS = gongSi.split(";");
                        var RPolishArray = null;
                        var val = "";
                        var chuFa = false;
                        var qiIj = 0;
                        for ( var j = 0; j < gongshiS.length; j++) {
                            qiIj = 0;
                            val = "";// 为空
                            chuFa = false;
                            if (gongshiS[j] != "") {
                                var vSet = gongshiS[j].split("=");
                                rpA = vSet[1].split(" ");
                                if (rpA.length % 2 == 0) {
                                    qiIj = 1;
                                }
                                RPolishArray = new Array(rpA.length - qiIj);
                                for ( var ij = qiIj; ij < rpA.length; ij++) {
                                    var col = rpA[ij].Trim();
                                    if (col != "") {
                                        if (("*+-/").indexOf(col) == -1) {
                                            val = getDoc(col.toLowerCase(),'.value');
                                            RPolishArray[ij - qiIj] = val;
                                            if (op.toLowerCase() == col.toLowerCase()) {
                                                chuFa = true;
                                            }
                                        } else {
                                            RPolishArray[ij - qiIj] = col;
                                        }
                                    }
                                }
                                // val = eval(gongcols[i] + "(" +
                                // ((col.replace("!","")).split("|"))[0] + ");")
                                if (chuFa) {
                                    val = RPolish(RPolishArray);
                                    if (qiIj == 1) {
                                        if (rpA[0].indexOf("!") != -1) {// 格式化
                                            val = val.toFixed(rpA[0].replace("!",
                                                "").replace("format", "")
                                                .Trim())
                                        } else {// 函数处理
                                            val = eval(rpA[0] + "(" + val + ");")
                                        }
                                    }
                                    if (val != "" && !isNaN(val)) {
                                        setDoc(vSet[0].Trim(), ".value='" + val
                                            + "'");
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        // 必须录入检查colsd:
        mustCheck : function(colsd, miaoshu, statu) {
            if(!isInspection){// 是否禁止必录检查
                var revoke=false;
                if(typeof (isrevokeProc) != 'undefined'){
                    revoke=isrevokeProc;
                    if(!revoke && typeof (mygrid) != 'undefined'){
                        try {
                            revoke=mygrid.isrevokeProc;
                        } catch (e) {
                            // TODO: handle exception
                        }
 
                    }
                    isInspection=revoke;// 撤回用到
                }else{
 
                    if(!revoke && typeof (mygrid) != 'undefined'){
                        try {
                            revoke=mygrid.isrevokeProc;
                        } catch (e) {
                            // TODO: handle exception
                        }
 
                    }
                    isInspection=revoke;// 撤回用到
                }
                if(!revoke){// 禁止撤回
                    if (colsd == "")
                        return true;
                    var sta_ = getDoc('docstatus', '.value');
                    statu = ((statu != sta_) ? sta_ : statu);
                    var col = "";
                    var cols = colsd.split(";pb#");
                    var cms = miaoshu.split(";pb#");
                    var hasSta = true;
                    for ( var i = 0; i < cols.length; i++) {
                        if (cols[i] != "") {
                            col = cols[i].split(";sta#");
                            hasSta = (col.length > 1) ? true : false;
                            // 解决多面板如496多个分页存在相同input标签ID的控件
                            if(panMain[1]!=undefined){//表示多表情况
                                value = $doc(col[0]).val();// 根据索引控件来取值
                            }else{
                                value = getDoc(col[0], '.value');
                            }
                            if(this.panInfo[col[0]]!=null ){
                                var type = this.panInfo[col[0]].controltype;//控件类型
                                if (type == 37) {
                                    value = get37Value(col[0]);
                                }
                                if (value == "") {
                                    if (type == 43) {
                                        value = ($("#" + col[0]).val() == null || $("#" + col[0]).val() == "") ? ""
                                            : (($("#" + col[0]).val() instanceof Array) ? $("#" + col[0]).val().join(";") : $("#" + col[0]).val());// 43控件集合
                                    }
                                }
                            }
                            if ((value == "" || value == "null" || value == null || value=="pb_xinzen")) {
                                // 在编辑状态下必录
                                if ((hasSta && isHasValue(col[1], "" + statu + "", ";")) || !hasSta) {
                                    try{
                                        layer.msg(this.panInfo[col[0]].title +'--不能为空!');
                                    }catch (e) {
                                        $.messager.alert(this.panInfo[col[0]].title +'--不能为空!');
                                    }
                                    // try{
                                    //     $.messager.show({
                                    //         height:50,
                                    //         msg:'<div align=\"center\"><span style=\"color:red;\"><b>'+this.panInfo[col[0]].title +'--不能为空!</b></span></div>',
                                    //         showType:'fade',
                                    //         timeout:2000,
                                    //         style:{}
                                    //     });
                                    // }catch(e){
                                    //     $.messager.alert('设置了'+col[0]+'必录,但是没有在panInfo(设置加载到页面)里找到'+col[0]);
                                    // }
                                    return false;
                                }
                            }
                        }
                    }
                }
            }
            return true;
        },
        upImage : function(id, el) { // 图片控件处理
            var url = "";
            var th = id + "_UpImage";
            if(el==3){
                var bol=window.confirm("是否真的删除?");
                if(!bol){return;}
            }
            switch (el) {
                case 1:
                    url = "/general/picupload.jsp";
                    break;
                case 2:
                    url = "/general/picupdate.jsp";
                    break;
                case 3:
                    url = "/picDelete.do";
                    break;
                case 4:
                    url = "/general/picshow.jsp";
                    break;
            }
            var open = true;
            var formid = getDoc('formid', '.value');
            if (formid == "" || formid==null) {
                formid = getDoc('formIdHid', '.value');
            }
            if(pandex496 !=0){
                if(isNaN(pandex496)){
                    pandex496=0;
                }
                var bolpan=false;
                for(var p in panMain ){
                    if(bolpan)break;
                    for(var c in panMain[p].html_Col ){
                        bolpan=panMain[p].html_Col[c].fileid==id;
                        pandex496=(bolpan?p:pandex496);
                        if(bolpan)break;
                    }
                }
                formid = panMain[pandex496].tableIs.split(";")[0];
            }
            var doccode = getDoc('doccode', '.value');
            var entercode = getDoc('entercode', '.value');
            var usercode = getDoc('createusercode', '.value');
            var rowId=getDoc('rowid', '.value');
            rowId=((el==4||el==2)?getDoc(id, '.value'):rowId);// 4类型的页面是查看大图片。只需要对应id值
                                                                // 不需要rowid.
            var code = entercode;
            if (code == "")
                code = usercode;
            var bens ="";
            try{
                bens= this.panInfo[id].seekgroupid.split(";");
            }catch(e){
                if(pandex496!=0){// 496特殊有多个面板 pandex496为当前执行的面板
                    try{
                        bens=panMain[pandex496].panInfo[id].seekgroupid.split(";");
                    }catch(e1){
                        bens="";
                    }
                }
            }
            var where = "";
            var col = "";
            var value = "";
            for (i = 0; i < bens.length; i++) {
                col = bens[i].toLowerCase();
                if (col != "") {
                    where += getDoc(col, '.value') + ";";
                }
            }
            where = where.substring(0, where.length - 1);
            url += "?ishd=" + this.isPrimaryPan + "&fieldid=" + id + "&formid="
                + formid + "&doccode=" + doccode + "&usercode=" + code+"&rowid="+rowId;
 
            showWindow_Grid(url, '', function(obj) {
                if (obj != "" && obj != undefined) {
                    setDoc(id, ".value='" + obj + "'");// 赋字段值
                    setDoc(th, ".src='" + obj + "'");
                }
            }, {
                dialogWidth :375,
                dialogHeight :375
            },null,{pid:id,th:id + "_UpImage"});
        },
        loadingSelect2Data:function () {//加载31控件数据和控件 xin 2022-7-18 14:59:17
            let option = {
                jsonId: {},
                loading: function () {
                    let ent = this;
                    $(".isSelect-31").each(function () {
                        let index = $(this).data("index");//获取面板索引
                        if (index == null || isNaN(index)) {
                            index = 0;
                        }
                        ent.select2(this, index);
                        ent.ajax(this, index);
                        ent.jsonId[this.id] = this;
                    })
                },
                select2: function (thant, index) {
                    let ent = this;
                    $(thant).select2({
                        language: "zh-CN",
                        tags: true,//这个参数的效果应该是,自定义内容选项卡
                        containerCssClass: $doc(thant.id).disabled() == 1 ? "isdisabled31" : "",    //自定义css
                    }).on('select2:select', function (e) {//43控件单击事件
                        let array = ent.jiLian(thant.id, index);
                        if (array.length > 0) {
                            ent.reset(array);
                        }
                    })
                },
                ajax: function (thant, index) {
                    $(thant).empty();
                    let id = thant.id;
                    let url = document.URL;
                    url = url.substring(0, url.lastIndexOf("/") + 1);
                    $.ajax({
                        url: url + panMain[index].controlUrl,
                        data: this.parm(id),
                        type: "POST",
                        async: false,
                        dataType: 'json',
                        success: function (data) {
                            let json = data;//'(' + data + ')');
                            if (json != null && json.info != null) {
                                data = json.info;
                                $(thant).append(new Option("", "", "", ""));//空值
                                let val = $("#" + id + 'text').val();
                                $.each(data, function (i) {
                                    let isSelect = false;
                                    isSelect = (val == data[i].id ? true : isSelect);
                                    var option = new Option(data[i].text, data[i].id, isSelect, isSelect);//后面两个true分别表示默认被选中和有效!
                                    $(thant).append(option);
                                });
                                panIndex=index;
                                $(thant).trigger("change");
                            }
 
                        }
                    })
                },
                parm: function (id) {
                    let data = {
                        'field': id,//控件ID
                        'fieldname': '',//控件名称
                        'fieldtype': 31,//控件类型
                        'callback': 0,//是否需要 <<新增>> 下拉进入((是31控件||2控件)&&不是空值&&不是1)添加 xin 2022-7-13 16:57:58
                        'params': panPar.getParameter(),//页面控件值(全部)
                        'state': $doc(id).disabled()//当前状态值
                    }
                    return data;
                },
                reset: function (array) {
                    let ent = this;
                    for (let i = 0; i < array.length; i++) {
                        let id = array[i];
                        let thant = ent.jsonId[id];
                        let index = 0;
                        if (thant != null) {//是31控件内
                            index = $(thant).data("index");//获取面板索引
                            if (index == null || isNaN(index)) {
                                index = 0;
                            }
                            ent.ajax(thant, index);
                        } else {//不是31控件内
 
                        }
                        let ar = ent.jiLian(id, index)
                        if (ar.length > 0) {
                            ent.reset(ar);
                        }
                    }
                },
                jiLian: function (id, index) {
                    let array = [];
                    let jilian = panMain[index].select;
                    if (jilian[id] != null) {//有级联
                        array = jilian[id].split(";");
                    }
                    return array;
                }
            }
            return option;
       },
       nextDocIco:function (callback) {//审核下一单 xin 2022-7-30 11:47:23
           let thant = this;
           let docCode = $("#doccode").val() || "";//当前单号
           if (docCode == "") {
               layer.msg("获取不到这张被排除的单据单号");
               return;
           }
           let formIds = $("#formid").val() || 0;
           let excludeDoc = top.approvedDoc.excludeDocs || "";
           let parm = "excludeSelectNextDocument=" + excludeDoc;
           if (docCode != "") {
               if (excludeDoc != "") {
                   parm += ";" + docCode;
                   // parm += excludeDoc.indexOf(docCode) != -1 ? "" : ";" + docCode;
               } else {
                   parm += docCode;
               }
           }
           parm += "&formid=" + (formIds == 0 ? formId : formIds) + "&docCode=" + docCode;
           $.get("/app/v2/nextDoc.do?" + parm, function (data) {
               if (data != null && data.msg == "success") {
                   let value = data.data;
                   if (value == null || value == "") {
                       callback("没有更多的待审核单据");//回调提示
                       return;
                   }
                   if (excludeDoc != "") {
                       let docs = excludeDoc.split(";");
                       if ($.inArray(docCode, docs) == -1) {//不存在就添加进去
                           docs.push(docCode);
                           top.approvedDoc.excludeDocs = docs.join(";");
                       }
                   } else {
                       top.approvedDoc.excludeDocs = docCode;
                   }
                   thant.nextDocLink(value);//刷新连接
               }
           })
       }, nextDocLink: function (value,isCode) {//组装功能号单据连接数据 xin 2022-7-30 17:03:40
            if(isCode){//isCode是经过编码需要解析
                value=value.replaceAll("%2B", "+").replaceAll("%2F", "/").replaceAll("%3D", "=");
                value=new Base64().decode(value);
            }
            var formInfo = value.split(";");//formid;formtype;doccode;formName
            var pageUrl = document.URL.split("/");
            for (var i = 0; i < pageUrl.length; i++) {
                if (i == pageUrl.length - 3) {
                   pageUrl[i] = formInfo[0];
                } else if (i == pageUrl.length - 2) {
                   pageUrl[i] = formInfo[1];
                } else if (i == pageUrl.length - 1) {
                   pageUrl[i] = "index.jsp?" + (new Base64().encode("where=doccode='" + formInfo[2] + "'"));
                }
            }
            parent.jQuery(parent.jQuery("#home-tabs").find("li.tabs-selected > a > span.tabs-title")).html(formInfo[3] + "-" + formInfo[0] + "-" + formInfo[2]);
            location.href = pageUrl.join("/");
       }
};
panPar.isChange = 0;
//--------------------【panPar】 
//--------------------------------------------------------------------function---------------------------------------------------------------------
 
function closeme(fun) {
    document.body.style.display = "none";
    parent.closeTab(fun); // 添加关页卡
}
function setHidOrNot(hidId, notId) {// 这个放最前吧 //添加注释时间:2012-07-04 曾文杰 显示/隐藏指定控件.
    setDoc(hidId, ".style.display='none'");
    setDoc(notId, ".style.display='block'");
}
 
//9802 style css样式字段设置
function stylecss(v,d,t,dat,typ,col,type){
    if(v!=undefined&&v.indexOf("!")!=-1){
        if(v.indexOf("&")!=-1){// 判断是否存在&xxx&
            var vv="";
            var v2="";
            while (v.indexOf("&") != -1) {// 循环v中的&xxx&会话值进行替换。
                vv=v.substring(0,v.indexOf("&"));// 第一个&前面的信息
                v = v.substring(v.indexOf("&") + 1);// 第一个&后面的信息
                if (v.indexOf("&") != -1) {// 第二个&判断
                    // 获取两个&中间的字段名 &xxx&中的xxx
                    v2 = v.substring(0, v.indexOf("&"));
                    if (v2!="") {
                        var vVal;
                        try{
                            vVal = getValue(v2);// 获取页面值,面板没有到格线获取。
                        }catch(e){// 当找不到getValue()方法时直接用getDoc获取值。
                            vVal= getDoc(v2.toLowerCase(), '.value');// 获取页面值。
                        }
                        if(typeof (vVal) !='undefined'){
                            if(isNaN(vVal) && vVal!=null){
                                vVal="'"+vVal+"'";// 判断不是数字值的处理。
                            }
                            v = vv+vVal+v.substring(v.indexOf("&") + 1);
                            // 重新把第一个&前面的信息+字段获取值(xxx的页面值)+第二个&后面的信息组装起来
                            // 然后再次while寻找v是否还有第二个&xxx&的会话值。
                        }else{
                            $.messager.alert("操作提示", "该界面没有发现你写的会话字段"+v2+",请检查9802是否设置了该字段。","warning");
                            return;
                        }
                    }
                }
            }
        }else{
            v=v.substring(1,v.length);// 没有会话值就直接传
        }
        dat[t]=col;
        typ[t]=type;
        var D = "{";
        D +="'parm':\"" + encodeText(v.replace(/\\/g,"").replace("!",""))+"\"}";
        var cur="/gtGrid.do?m=heand&_pop_json="+D;
        // $.post()方法调用不能同步所以改成了$.ajax()来执行。async: false时作为同步 2014-9-15
        $.ajax({url:cur,type:"POST",async:false,dataType:'text',success :function(data){
                if (data.indexOf("error")!=-1 ) {
                    $.messager.alert("操作提示", data,"warning");
                } else {
                    if(data==null){data="";}
                    var wdcss="width:"+getDoc(dat[d],".style.width")+";";
                    var htcss="height:"+getDoc(dat[d],".style.height")+";";
                    if(data.indexOf(";")!=-1){}else{data=data+";";}
                    data=data+wdcss+htcss;
                    setDoc(dat[d], ".style='" + data+"'");
                }
            }
        });
    }
}
 
function getImage(id) {//9类型上传图片显示事件
    var UpImage=doc(id+'_UpImage');
    if(typeof (UpImage) != 'undefined'){
        var uuid=getDoc(id,'.value');
        if(typeof (uuid) != 'undefined'&& uuid!=""){
            if(uuid.indexOf('uploads')!=-1){
                document.getElementById(id+'_UpImage').src =uuid;
            }else{
                document.getElementById(id+'_UpImage').src ="/getImage.do?type=0&uuid="+uuid;    //小图片
            }
        }else{
            document.getElementById(id+'_UpImage').src ="";
        }
        UpImage.onerror=null; //控制不要一直跳动
    }
}
 
function clone(myObj) {
    if (typeof (myObj) != 'object')
        return myObj;
    if (myObj == null)
        return myObj;
    var myNewObj = new Object();
    for ( var i in myObj)
        myNewObj[i] = clone(myObj[i]);
    return myNewObj;
}
//对象 xin 2019-11-15 10:58:00
function doc(id) {
    return document.getElementById(id);
}
// 获得对象值 xin 2019-11-15 10:58:08
function getDoc(id, property) {
    var rv_ = null;
    try{
        if (doc(id) != null) {
            rv_ = eval("document.getElementById('" + id + "')" + property);
        }
    }catch (e) {
        //ipad上不兼容eval和 document.get..(id)+property(property是需要获取的属性值如:.value或.style.color等)。所以用到下面的方法取值
        //循环控件对象获取属性值 ,针对ipad上获值的问题
        if(property!=""){
            var prop=property.split(".");
            try{
                for(var s in doc(id)){
                    if(property.indexOf(s)!=-1){
                        rv_=doc(id)[s];
                        if(prop.length>2){
                            rv_=rv_[prop[2]];
                        }
                        break;                    }
                }
            }catch(e){
                rv_="";
            }
        }else{
            rv_=doc(id);
        }
    }
    return rv_;
}
// 赋值对象 xin 2019-11-15 10:58:44
function setDoc(id, property) {
    if (doc(id) != null) {
        var s = "";
        var v = null;
        var p = property.split("=");
        var t = p[0].substring(1, p[0].length).split(".");
        var v_ = "";
        //=========lqc=======
        for ( var i = 1; i < p.length; i++) {
            if (i == p.length - 1) {
                let pv = p[i].Trim();
                if (pv.indexOf("'") == 0 && pv.lastIndexOf("'") == pv.length - 1) {//在第一个位置
                    pv = pv.substring(1, pv.length);
                    pv = pv.substring(0, pv.length - 1);
                    if (pv.indexOf("'") == 0 && pv.lastIndexOf("'") == pv.length - 1) {//去掉后还在第一个位置
                        pv = pv.substring(1, pv.length);
                        pv = pv.substring(0, pv.length - 1);
                    }
                    // v_ += pv;
                    // } else {
                    //     v_ += pv;//.replace(/'+/g, "");
                }
                //处理值里有”=“的情况
                if (v_ != "" && v_.indexOf("=") != -1 && pv.lastIndexOf("'") == pv.length - 1) {
                    pv = pv.substring(0, pv.length - 1);
                }
                v_ += pv;
            } else {
                v_ += p[i].Trim().replace(/'+/g, "") + "=";
            }
        }//==========end========
        //var v_ = p[1].Trim().replace(/'+/g, "");
        if (t.length > 1) {
            s = t[1];
            v = v_;
            try{
                $('#panIndex' + panIndex).find('#' + id).css($.trim(s), v);
            }catch(e){
                $.messager.alert("操作提示", id+"字段样式出错:"+e,"warning");
            }
        } else {
            s = t[0];
            if (v_ == "false" || v_ == "true") {
                v = eval(v_)
            } else {
                v = v_;
            }
            try{
                $('#panIndex' + panIndex).find('#' + id).attr($.trim(s), v);
            }catch(e){
                $.messager.alert("操作提示", id+"字段赋值出错:"+e,"warning");
            }
        }
 
        if ($.browser!=null && !$.browser.msie && property.indexOf(".value") != -1) { // 不是IE浏览器
            pro = $("#" + id, document).attr("onPropertyChange");
            if (typeof pro != "undefined"&& pro.indexOf("event")!=-1) { // && pro.indexOf("event")!=-1
                eval(pro.replace("event", "null"));
            }
        }
    }
}
 
var set_buttonHid = function(buttonHid, buttonId) {
    if (buttonHid) {// 按钮全隐藏的
        if (!no_load_first && isAddLong) {
            // var chan=getDoc(buttonId,".style.width");
            // if(chan!=""){//居然有上下面板都没有的,多做个判断吧
            // //topIs=topIsTi;
            // //setDoc(buttonId,".style.width="+(parseInt(chan)+110)+";");
            // // topIs=2;
            // }
        }
    }
}
function RPolish(RPolishArray) {// 计算逆波兰表达式的值
    var result = 0;
    var tempArray = new Array(100);
    var tempNum = -1;
    for (i = 0; i < RPolishArray.length; i++) {
        if (RPolishArray[i].match(/\d/)) {
            tempNum++;
            tempArray[tempNum] = RPolishArray[i];
        } else {
            switch (RPolishArray[i]) {
                case '+':
                    result = (tempArray[tempNum - 1] * 1)
                        + (tempArray[tempNum] * 1);
                    tempNum--;
                    tempArray[tempNum] = result;
                    break;
                case '-':
                    result = (tempArray[tempNum - 1] * 1)
                        - (tempArray[tempNum] * 1);
                    tempNum--;
                    tempArray[tempNum] = result;
                    break;
                case '*':
                    result = (tempArray[tempNum - 1] * 1)
                        * (tempArray[tempNum] * 1);
                    tempNum--;
                    tempArray[tempNum] = result;
                    break;
                case '/':
                    result = (tempArray[tempNum - 1] * 1)
                        / (tempArray[tempNum] * 1);
                    tempNum--;
                    tempArray[tempNum] = result;
                    break;
            }
        }
    }
    result = tempArray[tempNum];
    return result;
}
function callBack(col, data,waiziduan,benziduan) {
    if (data == "many") {
        var pro = null;
        if (getDoc(col, '') != null) {
            pro = $("#" + col + "_click", document).click();
        }
    } else {
        getBackBool = false;// 改为假先,避免触发
        var strs = data.split(";pb#");
        var colVal = getDoc(col, '.value');
        var xinxi;
        for (i = 0; i < strs.length; i++) {
            xinxi = strs[i].split(";fen#"); // 必须用特殊的
            if (xinxi[0] != "") {
                if (xinxi[0] == col && xinxi[1] == "") {
                    setDoc(xinxi[0], ".value= '" + colVal + "'");// 当触发列无值时,必须还原啊,(如用户还没输入完就触发没了)
                } else {
                    setDoc(xinxi[0], ".value= '" + xinxi[1] + "'");
                }
                panMain[panIndex].isChange=1;
            }
            if( waiziduan!=undefined && benziduan!=undefined){//自身字段和外表字段不相同的时候进行判断赋值 2015-6-2 17:55:15 --xin
                if(waiziduan!=benziduan){
                    var ben10=benziduan.split(";");
                    var bwai10=waiziduan.split(";");
                    if(ben10.length==bwai10.length){
                        for(j = 0; j < ben10.length; j++){
                            if(xinxi[0] == bwai10[j] && xinxi[1] != ""){
                                setDoc(ben10[j], ".value= '" + xinxi[1] + "'");
                            }
                        }
                    }else{//抛出提示
                        $.messager.alert("操作提示", "9082的接收数据里【外表字段】和【自身字段】不对应或缺少 请检查修改。","warning");
                        return
                    }
                }
            }
        }
        getBackBool = true;// 还原让程序继续运作
    }
}
//触发相应控件事件,js赋值时不触发,直接调用一次
function setLoadEven(id, type) {
    if (type == null) {// 考虑对方不知道type的情况 可以不用
        pi = panMain[panIndex].panInfo[id];
        type = pi.controltype;
    }
    switch (parseInt(type)) {
        case 6:// 复选框单选
            cheeckValueChan(id);// 以初始值控制复选框的勾选
            break;
        case 9:// 图片占位显示
        //    upImageChange(id);
            break;
        case 30:// 复选框多选
            cheeckSValueChan(id);// 以初始值控制复选框的勾选
            break;
        case 32:// 单选按钮
            radioValueChan(id);// 以初始值控制单选按钮的勾选
            break;
        case 35:
            toSelect35(id);//
            break;
        case 37:// 富文本
            set_37ck(id);
            break;
        default:
            break;
    }
}
function get37Value(id) {
    try{
        var ck_html =CKEDITOR.instances[id].getData();
        ck_html = ck_html.replace(/(\r|\n|\r\n)+/g, '').replace(new RegExp( '&amp;' , 'g' ),'&');// 替换换行
    }catch(e){
        ck_html=null;
    }
    return ck_html;
}
function set_37ckChang(id) {
    var v = get37Value(id);
    $doc(id + '_spanHid').html(v);
    $doc(id).val(v);
}
function set_37ck(id) {// 给富文本框赋值
    try {
        if (no_load_first) {
            panMain[panIndex].isChange = 1;
        }
        setHidOrNot(id + '_spanHid', id + '_hid');
        var ck_html = $doc(id).val();
        ck_html=ck_html.replace(/<img/g,"<img class=\"thumbnail contentImg\" ");// by danaus 15-1-19
        var ck_html_text = ck_html;
        $doc(id + '_spanHid').html(ck_html_text);
        eval(id + '_ck').setData(ck_html);
        if (docstatuPan != parseInt(predocstatus)) {
            setHidOrNot(id + '_hid', id + '_spanHid');
        }
    } catch (e) {
    }
}
// 分页面板显示
function showPan(qz, hz, siz) {
    for ( var i = 1; i <= siz; i++) {
        doc(qz + i).style.display = 'none';
    }
    doc(qz + hz).style.display = 'block';
}
//31控件设置值进入。避免出错,转接一个函数
function seletMorenOrValue(value, id) {
    //是否新单
    if (value == "" && panMain[panIndex].isNew!=null && panMain[panIndex].isNew==1) {
        select_toValue(panMain[panIndex].panInfo[id].initValue, id);
    } else {
        select_toValue(value, id);
    }
}
// 类型函数
// 判断下拉控件的选择项(value/text)
function select_toValue(value, id) {
    var sel_options ;
    //多表情况防止出现相同ID
    if(panMain[1]!=undefined){
        sel_options =  $doc(id).options;
    }else{
        sel_options =  getDoc(id, ".options");
    }
    var sel_value = value.toLowerCase().Trim();
    var notHas = true;
    if (typeof sel_options != "undefined" && sel_options != null) {
        for ( var i = 0; i < sel_options.length; i++) {
            if (sel_options[i].value.toLowerCase() == sel_value
                || sel_options[i].text.toLowerCase() == sel_value) {
                sel_options[i].selected = true;
                notHas = false;
                if(panMain[panIndex].panInfo[id].controltype==46){
                    setDoc(id, ".value='" + value + "'");
                    setDoc(id, ".style.backgroundColor ='" + value + "'");
                }
                break;
            }
        }
    }
    if (notHas) {
        setDoc(id, ".selectedIndex=-1");
        let envt = $("#" + id).prop("type")//拿到控件属性 hidden的话就赋值 xin 2022-10-26 11:47:13
        if (envt == "hidden" || typeof sel_options == "undefined") {
            setDoc(id, ".value='" + value + "'");
        } else {
            setDoc(id, ".value=''");//如果notHas是true并且envt的值不是hidden说明上面的匹配不到下拉的值,这个value就不是在下拉值范围里,不需要添加进去 直接空值 xin 2022-10-25 17:09:47
        }
    }
}
 
function key_Delete_Selete(e, id) {// 下拉del键清除
    var event = $.event.fix(e);
    if (event.keyCode == 46) {
        setDoc(id, ".selectedIndex = -1");
        upSub(id);
    }
}
// 判断确定状态,因为不知道所有的窗体是否判断状态一样,顾多加个窗体类型参数,可以后随时更改
// 1.状态值2.确认前状态值3.窗体类型值
function getStatu(sta, preSta, formType) {
    if (sta == "") {
        sta = 0;
    }
    if (sta != preSta && preSta!="") {
        if (doc('tpConfirm') != null) {
            doc('tpConfirm').style.display = 'none';// 隐藏确定按钮
        }
        if((sta==100 || sta==200)){
            $('#importXls').hide();//已确定的单据 隐藏导入按钮 100是确定状态,200是关闭订单状态,都是不能再操作修改单据的状态
        }
        setDocStatuInfo('已确定');
    } else {
        setDocStatuInfo('未确定');
    }
    // 在有新的做法时,为:
    if (typeof (panMain[panIndex].stas) != "undefined") {// stas在生成页面中有
        setDocStatuInfo(panMain[panIndex].stas[sta]);
    }else{
        if(typeof (panMain[0].stas) != "undefined"){
            setDocStatuInfo(panMain[0].stas[sta]);    // 496多个panIndex时状态值出错问题。
        }
    }
}
// 单选按钮组
function getRad(id) {// pan1.jsp中getRadid(id)区分开此为赋值
    var rads = document.getElementsByName(id + "Radio");
    for (i = 0; i < rads.length; i++) {
        if (rads[i].checked) {
            setDoc(id, ".value='" + rads[i].value + "'");
            break;
        }
    }
}
//function upImageChange(id) {// 显示头像等
//    var value = getDoc(id, ".value");
//    if (value != "") {
//        setDoc(id + "UpImage", ".src='" + value + "'");
//        // setDoc(id + "Upload", ".style.display='none'");//上传后显示更新按钮 2015-4-29
//        // 18:26:37
//        // setDoc(id + "Upload", ".value = '更新'");
//        setDoc(id + "Upload", ".style.display='none'");
//        setDoc(id + "Update", ".style.display='block'");
//        setDoc(id + "Delete", ".style.display='block'");
//    } else {
//        setDoc(id + "UpImage", ".src=''");// uploads/moren.png
//        setDoc(id + "Upload", ".style.display='block'");
//        setDoc(id + "Update", ".style.display='none'");
//        setDoc(id + "Delete", ".style.display='none'");
//    }
//    if(typeof(predocstatus)!="undefined"){// 判断是否是空指针 不然会报错误
//        if (docstatuPan != predocstatus) {// 已经确认
//            setDoc(id + "Delete", ".style.display='none'");
//            setDoc(id + "Update", ".style.display='none'");
//        } else {
//            if (value != "") {// 字段id没值 删除字段必须隐藏 否则显示出来
//                setDoc(id + "Delete", ".style.display='block'");
//            }
//        }
//    }
//}
// 日期控件显示
function showDate(id, shWeek, frmat) {// 显示选择日期控件
    var isShow = (getDoc(id + "Date", ".value") == "1") ? true : false;
    if (isShow) {
        if (frmat == '') {
            WdatePicker( {
                el:id,
                isShowWeek :shWeek
            });
        } else {
            WdatePicker( {
                el:id,
                isShowWeek :shWeek,
                dateFmt :frmat
            });
        }
    }
}
// 7类型
function show(id,max) {
    if (parent.errShow != null) {
        parent.errShow.frame = parent.frames[inThisFrame];
        parent.errShow.show(id, max);
    } else {
        //弹出层时候有调用 xin 2022-9-26 16:29:56
        top.parent.errShow.frame = parent.frames[1];//inThisFrame;
        top.parent.errShow.show(id, max || 400);
    }
}
// 35
function set35(id) {
    var val = getDoc(id + "_35", ".value");
    if (val != "") {
        setDoc(id, ".value='" + val + "'");
    }
}
function toSelect35(id) {
    var val = getDoc(id, ".value");
    setDoc(id + "_35", ".value='" + val + "'")
}
// 复选框单选初始值
function cheeckValueChan(id) {
    var checkTrue = (getDoc(id, ".value") == "1") ? true : false;
    setDoc(id + "CheckBox", ".checked = " + checkTrue);
}
// 多选框初始值------至显示
function cheeckSValueChan(id) {
    var checks = document.getElementsByName(id + "Check");
    var values = getDoc(id, ".value");
    var vaS = values.split(',');
    var vaIs = "";
    for (i = 0; i < checks.length; i++) {// 先默认为未勾上
        checks[i].checked = false;
    }
    for (j = 0; j < vaS.length; j++) {// 含有的初始值
        vaIs = vaS[j];
        for (i = 0; i < checks.length; i++) {
            if (checks[i].value == vaIs) {// 将该勾上的先勾上
                checks[i].checked = true;
            }
        }
    }
}
//多选框设置状态 xin 2018-10-24 14:41:31
function checkboxDisabled (id,boo){
    var checks = document.getElementsByName(id + "Check");
    for (var c = 0; c < checks.length; c++) {
        if (boo) {// 只读
            checks[c].onclick=function(){return false;};
            //checks[c].disabled = boo;
        }
    }
}
// 多选框显示(勾选情况)----至插入值(进数据库信息)
function cheeckSToValue(id) {
    var checks = document.getElementsByName(id + "Check");
    var vaIs = "";
    for (i = 0; i < checks.length; i++) {
        if (checks[i].checked) {
            vaIs += checks[i].value + ",";
        }
    }
    vaIs = vaIs.substring(0, vaIs.length - 1);
    setDoc(id, ".value='" + vaIs + "'");
}
function radioValueChan(id) {// 设置选择按钮事件
    var value = getDoc(id, ".value");
    var rads = document.getElementsByName(id + "Radio");
    for (i = 0; i < rads.length; i++) {
        if (rads[i].value == value) {
            rads[i].checked = true;// 要重新考虑了
            break;
        }
    }
}
// 1. 值集合2.匹配值3.值集合分割符
function isHasValue(inValue, value, fen) {// 看看值中是否已经含有当前value,有则不追加,返回true
    var boolreturn = false;
    var strs = inValue.toLowerCase().split(fen);
    value = value.toLowerCase();
    for (i = 0; i < strs.length; i++) {
        if (strs[i] == value) {
            boolreturn = true;
            break;
        }
    }
    return boolreturn;
}
// 1.数组2.自身字段(数组值与自身字段一一匹配)3true替换,反之则为追加
function openSetValue(st, get, boo) {
    var col;
    if (st != undefined && st != null) {
        for ( var n = 0; n < st.length; n++) {
            if (getDoc(get[n], "") == null) {
                $.messager.alert("操作提示", "返回字段设置" + get[n] + "在页面上没有!","error");
            } else {
                st[n] = st[n] != undefined ? st[n] : "";
                getBackElse = true;// 允许触发带出值
                if (boo) {
                    var pi = panMain[panIndex].panInfo[get[n]];
                    if(pi==undefined){
                        pi=panMain[gtss].panInfo[get[n]];
                    }
                    if (typeof(pi)!='undefined') {// 是否是31控件
                        if(pi.controltype == 31){
                            var options = document.getElementById(get[n]).options;
                            var hasSel = false;
                            if (options != null) {
                                hasSel = true;
                                for ( var i = 0; i < options.length; i++) {
                                    if (st[n] == options[i].value) {
                                        hasSel = false;
                                    }
                                }
                            }
                            if (hasSel) {
                                document.getElementById(get[n]).options.add(new Option(st[n+1], st[n]));
                            }
                        }
                    }
                    setDoc(get[n], ".value ='" +(st[n]=="undefined"?"":st[n])+ "'");
                } else {
                    col = getDoc(get[n], ".value");
                    if (!isHasValue(col, st[n], ",")) {// 在有的情况下不追加
                        setDoc(get[n], ".value = '" + (col + "," + st[n]) + "'");
                    }
                }
                if(st[n]!=''){//针对31控件级联
                    getSelect31(get[n]);
                }
                getBackElse = false;// 禁止触发带出值
            }
        }
        panMain[panIndex].isChange=1;
        top.myFresh.Type=panMain[panIndex].formtypeOne;
        if(panMain[panIndex].formtypeOne==10){//10类型
            panMain[panIndex].keyDown('123','');//三点弹出返回后 再次出发回车事件 组装where条件。2014-11-14
            panMain[panIndex].isChange=0;//10窗体返回的值不在保存防范,所以isChange改为0
        }
    } else {
        $.messager.alert("操作提示", "是否设置接收字段!","question");
    }
    excOABtnFunction();
}
// 上传
//function upLoad(http, fild, el, th) {
//    th.disabled = true;
//    var formid = getDoc('formid', ".value");
//    var doccode = getDoc('doccode', ".value");
//    var uuid = getDoc(fild, ".value");
//    var fildat=getDoc(fild+'Up',".disabled");//attchmentShow.jsp界面控制 上传附件 按钮问题
//    if (doccode == "") {
//        $.messager.alert("操作提示", "请先保存,然后再上传附件。","warning");
//        th.disabled = false;
//        return;
//    }
//    $.post("/uprand.do", "", function(data) {
//        var toSend = (el == 1) ? "/general/attaUpload.jsp" : "/general/attchmentShow.jsp";
//        var url = http + toSend + "?formid=" + formid + "&doccode=" + doccode + "&fieldid=" + fild +
//            "&uuid="+uuid+ "&r=" + data+((el==2)?"&di="+fildat:"");//el如果进入的是attchmentShow.jsp就传di这个参数过去
//        url = encodeURI(url);
//        url = encodeURI(url);// 必须两次
//        var st;
//        if (el == 1) {
//            showWindow(url, '', function(t) {
//                st = t;
//            }, {
//                fieldid:fild,
//                dialogWidth :720,
//                dialogHeight :430
//            });
//        } else {
//            var s = getDoc("docstatus", ".value");
//            var f = $("title", document).html();
//            url += "&docstatus=" + s;
//            parent.addTab(f + ':' + doccode, '', '', '', url, '', {
//                isFlowChart :true
//            });
//        }
//        th.disabled = false;
//    });
//}
 
// 验证函数
// 正则表达式 比较的内容的id 弹出的消息 这三个数
function math(regular, testId, message) {
    var filter = regular;
    var testValue = getDoc(testId, ".value");
    if (!filter.test(testValue)) {
        $.messager.alert("操作提示", message,"warning");
        setDoc(testId, ".value=''");
        return false;
    }
    return true;
}
function obj2str(o) {
    var r = [];
    if (typeof o == "string")
        return "\""
            + o.replace(/([\'\"\\])/g, "\\$1").replace(/(\n)/g, " \\n")
                .replace(/(\r)/g, "\\r").replace(/(\t)/g, "\\t") + "\"";
    if (typeof o == "undefined")
        return "";
    if (typeof o == "object") {
        if (o === null)
            return "null";
        else if (!o.sort) {
            for ( var i in o){
                if(i==''){
                    $.messager.alert("操作提示", "字段名不能设置为空,查看9802是否加载了一个空的字段名。","warning");
                    return;
                }
                r.push(i + ":" + obj2str(o[i]))
            }
            r = "{" + r.join() + "}"
        } else {
            for ( var i = 0; i < o.length; i++)
                r.push(obj2str(o[i]))
            r = "[" + r.join() + "]"
        }
        return r;
    }
    return o.toString();
}
/**
 *
 * 通过,驳回
 */
var this_id = null;
var External=false;
function getBtn(hasPaw, formid, url, th,isi,ExternalURL,UrlShowLocation,buttonID) {
    if (th != null) {
        //th.disabled = true;//注释原因 如果disabled禁止 前台输入好了的话需要刷新才能再次通过 不方法 ,所以注释了该参数  或者写成false;
        btnId = th.id;
        this_id = th;
    }// 禁用
    btnSave = false;// 还原上面的变量
    panelHasSave = false;// 还原面板状态为未保存
    External=(ExternalURL==""?false:true);
    typeof isi=='undefined'?false:isi;//判断是否有值 防止错误
    isInspection =isi;//是否禁止必录检查,这个isi是OA设置里面的一个字段值  通过后台生成审核按钮时传送过来
    if (checkUp()) {
        // 添加按钮检查
        if(External && UrlShowLocation==0){
            if(this.getExternalURL(ExternalURL,buttonID,formid)){
                return;
            }
        }
        if (hasPaw) {// 是否要弹出密码框
            centerPopup(3, function() {
                save(2);
            }, url);
        } else {// 回调
            save(2);
        }
        if(External && UrlShowLocation==1){
            if(this.getExternalURL(ExternalURL,buttonID,formid)){
                return;
            }
        }
    } else {
        if (th != null) {
            th.disabled = false;
        }
        btnId = null;
    }
    //这里是新OA审核界面用到 xin 2021-2-23 15:48:07
    if(OAButonEvnt!=null){
        //关闭
        layer.close(OAButonEvnt);
        $("body").removeClass("bodyScrollOA");
    }
}
 
/**
 * 通过或者驳回前后执行的xxxx.do程序
 * @param External
 * @returns
 */
function getExternalURL(External,buttonID,formid){
    var doccode = getDoc('doccode', ".value");
    var docstatus= getDoc('docstatus', ".value");
    var bool=false;
    if(External.indexOf('?') != -1) {
        if(External.match(/&.*?&/)){
            var rep=External.match(/&.*?&/);
            for(var r=0;r<rep.length;r++){
                var val=rep[r].replace(/&/g,"");
                External=External.replace(rep[r],getDoc(val,".value"));
            }
        }
        External=External+"&buttonID="+buttonID+"&doccode='"+doccode+"'&formid="+formid+"&docstatus="+docstatus;
    }else{
        External=External+"?buttonID="+buttonID+"&doccode='"+doccode+"'&formid="+formid+"&docstatus="+docstatus;
    }
    $.ajax({url:External,//跳转到External
        type:"POST",
        async:false,
        dataType:'text',
        success:function(data) {
            if(data.indexOf('error')!=-1){
                $.messager.alert("操作提示", data,"warning");
                bool=true;
            }
 
            //--------Start  Added by Johns Wang,2020-04-04 ------------------
            try {
                var obj = JSON.parse(data);
                if (obj["state"]!=undefined && obj["state"]==-1 && obj["msg"] !=undefined && obj["msg"] && obj["msg"] != "") {
                    //$.messager.alert("操作提示", obj.msg,"warning");
                    alert(obj["msg"]) ;
                    bool=true;
                }
                if (obj["state"] !=undefined && obj["state"] == 0 && obj["msg"] !=undefined && obj["msg"] && obj["msg"] != "") {
                    alert(obj["msg"] ) ;
                    bool=true;
                }
            }catch(e) {
                console.log(e);
            }
            //-----------  end  Added by Johns Wang,2020-04-04 -----------------------
 
        }
//           error:function (XMLHttpRequest, textStatus, errorThrown) {
//               alert(textStatus);
//                bool=true;
//           }
    });
    return bool;
//       data:{//参数
//    'field' :field,
//    'fieldtype' :fieldtype,
//    'callback' :callback,
//    'params' :params
//  },
}
 
 
function btn_OK(op) {// 启用被禁用的按钮
    if (op != 'ok' && this_id != null) {
        this_id.disabled = false;
        this_id = null;
    }
}
// huicode:回填到页面上审核人code的ID;huiname:回填到页面审核人name的ID;getPaw:true 则为通过驳回,值是替换
function popupSet(leaderHRcode, name, huicode, huiname, getPaw) {
    // 执行赋值
    huicode = huicode.toLowerCase();
    huiname = huiname.toLowerCase();
    var value = "";
    if (huicode != "") {// 如果未设置其中一个,这样处理免得报错
        value = getDoc(huicode, ".value");
        if (!isHasValue(value, leaderHRcode, ',')) {// 让其不要追加相同的
            value = value.substring(0, value.length - 1);
            if (getPaw) {
                setDoc(huicode, ".value = '" + leaderHRcode + "'");// 替换
            } else {
                setDoc(huicode, ".value = '" + (value + "," + leaderHRcode + ",") + "'");// 追加
            }
        }
    }
    if (huiname != "") {
        value = getDoc(huiname, ".value");
        if (!isHasValue(value, name, ',')) {// 让其不要追加相同的
            value = value.substring(0, value.length - 1);// 却掉最后一个,号
            if (getPaw) {
                setDoc(huiname, ".value = '" + name + "'");// 替换
            } else {
                setDoc(huiname, ".value = '" + (value + "," + name + ",") + "'");// 更改以上值,底下会做保存
            }
        }
    }
    // 执行密码按钮操作
    if (getPaw) {// 这个后加必须
        getBtn(hasPawBtn, formidBtn, urlBtn, null,false);
    }
    if (selBtnOk) {// 默认不进入
        selBtnOk = false;
        // 添加按钮检查
        save(3);
    }
}
var topPan = {
    h :0,
    ref : function() {
        this.h = parseInt(getDoc('panel_' + formId, '.style.height'))
            + parseInt(doc('h_top').style.height);
        if (isNaN(this.h)) {// 没设置的帮处理下
            var tits=document.getElementById("title_top");
            if(tits){//判断是否有大标题  根据大标题修改top高度
                this.h = 105;
                doc('h_top').style.height ="68px";
            }else{
                this.h=105;
            }
        }
        doc('h_all').style.height = this.h + "px";
    }
}
var setOa = function(op) {// 保存前处理信息,如通过按钮的取得条件
    if (typeof mygrid != "undefined" && mygrid != null) {
        mygrid.setOA(op);
    } else {
        OA = op;
    }
}
$(document).ready( function() {
    no_load_first = true;
});
var timeStart = null;
function start_dibang(op) {
    var v_ = "";
    if (parent.ActiveXDrive) {
        v_ = parent.ActiveXDrive.getDiBangValue();
    }
    setDoc(op, ".value='" + v_ + "'")
    // timeStart=setInterval(start_dibang(op),1000);
    timeStart = setTimeout("start_dibang('" + op + "')", 200);
 
}
function stopOrStartBegin(th, op) {
    stopOrStart(th, op);
}
function stopOrStart(th, op) {
    var v_ = th.value;
    if (v_ == "解锁") {
        start_dibang(op);
    } else {
        stop_dibang();
    }
    th.value = (v_ == "解锁") ? "锁定" : "解锁";
}
function stop_dibang() {
    clearTimeout(timeStart);
}
var panFiled = {
    replace : function(fieldformid, tiformid) {
        var filedHtmlId = 'panel_' + fieldformid + '_' + tiformid;
        var tiHtmlId = tiformid + '_panel';
        var pan_ = $('#' + filedHtmlId).html();
        $('#' + filedHtmlId).html('');
        $('#' + tiHtmlId).html(pan_);
    }
}
var btnCall;// 按钮回调
function excOABtnFunction() {
    if (typeof btnCall == "function") {// 在有的情况回调
        btnCall();
        btnCall = null;// 清楚函数
    }
    if (typeof (excBtnOkCall) == "function") {// 当 确定按钮触发选择部门必须执行里面函数
        excBtnOkCall();// 执行确定按钮为执行的事件
    }
}
// 面板按钮 旧项目移过了的方法
function mulChoice2(linkField, selfField, ben, wai, zi, url1, hasPaw, formid,
                    url, th,ExternalURL,UrlShowLocation) {
    musChoies = true;
    th.disabled = true;
    if (checkUp()) {
        windowOpenOld(url1, linkField, selfField, ben, wai, zi, '');
        btnCall = function() {
            btnId = th.id;
            getBtn(hasPaw, formid, url, th,false);// 按钮执行存储过程 必须在执行上面操作后才允许执行 暂没法做到
            musChoies = false;
        }
    } else {
        th.disabled = false;
        btnId = null;
    }
    //这里是新OA审核界面用到 xin 2021-2-23 15:48:07
    if(OAButonEvnt!=null){
        //关闭
        layer.close(OAButonEvnt);
        $("body").removeClass("bodyScrollOA");
    }
}
function windowOpenOld(url, p, g, ben, wai, zi, id) {
    g = g.toLowerCase();// 必须小写形式
    if (p.split(';').length != g.split(';').length) {
        parent.message('请检查外表字段与自身字段是否设置正确。', '<%=URL%>');
        return;
    }
    if (id != "") {// 如果不为空则为三点弹出
        var isShow = getDoc(id + "Tree", ".value");
        openTree = (isShow == "1") ? true : false;// 处理三点弹出控件的只读设置,禁止点击事件
    }
    if (openTree) {
        var where = getWhere(ben, wai, zi, g, p, id);
        if (url.indexOf('?') != -1) {
            url = url + "&wherePan=" + where;
        } else {
            url = url + "?wherePan=" + where;
        }
        var r = Math.round(Math.random() * 10000);
        url = url + "&r=" + r;
        url = url.replace(/%+/g, "@~");
        url = encodeURI(url);
        url = encodeURI(url);// 必须两次
        if (openTree) {// 决定是否打开窗,这个必须,虽然上面有一个,但意义不同
            // parent.panelToPost = p;
            // parent.postToThis = g;
            // parent.changFrame = inThisFrame;
            //by danaus 2022/8/1 11:25 用新方法取当前页面的frameid,全局变量在未完全加载就马上切换到其他页面再切换回来会有问题
            var panelObj={};
            panelObj.panelToPost = p;
            panelObj.postToThis = g;
            panelObj.frameName=parent.jQuery(parent.jQuery(parent.jQuery('#home-tabs').tabs('getSelected'))).attr("id");
            parent.addTab('按钮事件', '', '', '', url, '', {
                isFlowChart :true
            },null,panelObj);
        }
    }
    openTree = true;
}
 
 
var urlBtn;
// huicode:回填到页面上审核人code的ID;huiname:回填到页面审核人name的ID,hasPaw
// :是否包含按钮;formid:功能号IDurl:项目路径
function createPopSelect(huicode, huiname, hasPaw, formid, url, th,ExternalURL,UrlShowLocation) {// 这里包含要弹出密码,解决执行速度需要提出全局参数
    hasPawBtn = hasPaw;
    formidBtn = formid;
    // execSqlBtn = execSql;
    th.disabled = true;
    urlBtn = url;
    var formID1 = getDoc('formid', ".value");
    var doccode = getDoc('doccode', ".value");
    createPopSelect(formID1, formid, doccode, function(leaderHRcode, name) {
        parent.btnId = th.id;
        popupSet(leaderHRcode, name, huicode, huiname, true);
        th.disabled = false;
    }, url);
    //这里是新OA审核界面用到 xin 2021-2-23 15:48:07
    if(OAButonEvnt!=null){
        //关闭
        layer.close(OAButonEvnt);
        $("body").removeClass("bodyScrollOA");
    }
}
 
//审计功能处理       操作时间:2014-3-26 15:52:04 ——辛煜波
function shenji(panIndex,plane,doc,type){// panindex为面板元素,plane为面板信息,doc为单号,type参数针对2类型考虑的(具体看2类型js里面的simple.tree.js)
    var oldValue = panMain[panIndex].panelAuditValue;// 原始字段值(没改过前的字段值)
    if (this.formType == 496) {
        oldValue = [];
    }
    var newValue = [];// 需要审计的字段 修改后的值
    if (oldValue != null) {// 处理是否是审计的字段 。操作时间: 2014-3-25 :辛煜波
        var auditField = panMain[panIndex].auditFiled;// 9802设置需要审计的字段名
        try {
            for (var i = 0; i < auditField.length; i++) {
                var name = auditField[i][0];//字段名
                var old = (oldValue[name] != null ? oldValue[name] : '');//旧值
                var news = (plane[name] != null ? plane[name] : '');//新值
                if (old != news) {
                    var auditJson = {};
                    auditJson.fieldname = name;
                    auditJson.oldvalue = old;
                    auditJson.newvalue = news;
                    auditJson.usercode = '';
                    auditJson.username = '';
                    auditJson.auditType = (typeof (type) == 'undefined' ? ((isNew == 1 && doc == "") ? "add" : "update") : (type == "2add" ? "add" : "update"));
                    auditJson.formid = formId;
                    auditJson.doccode = doc;
                    auditJson.auditIndex = ',' + news + ',' + old + ',';
                    auditJson.fielddescr = auditField[i][2];
                    newValue.push(auditJson);
                }
            }
        } catch (e) {
            $.messager.alert("操作提示", "审计出现异常,审计字段未能记录", "warning");
        }
        return newValue;
    }
}
 
//9810面板大图标控件的选择按钮界面
function bigimages(){
    var url="/FangYuanAdmin/myImagejsp/bigImage.jsp";
    parent.deskTopShow('大图标图片',url,500,520,function(obj){
        if(!obj)return;
        if(obj.code=="error"){
            $.messager.alert("操作提示", obj.info,"warning");return;
        }
    })
}
 
//解决面板控件自适应宽度问题
function autoColWidthByTable(rightWidth, leftWidth) {
    try{
        // rightWidth, leftWidth 适用于2,20类型窗体的左边和右边的宽度
        var width = document.body.clientWidth - 50 - (leftWidth > 0?leftWidth:0);  //网页可见区域宽
        width=(rightWidth > 0)?rightWidth:width;//针对2,20窗体
        width=(maxCols.length>1?width-20:width);//针对多面板。
        var maxColss=Math.max.apply(null, maxCols);
        for(var i=0;i<maxColss;i++) {
            //计算每列的宽度公式: 屏幕宽度/ 总列数 - 标签宽度 - 必录标志宽度 - td padding 宽度 + 合并占用padding
            var componentLength = Math.floor(width / maxColss) * (i+1) - 116 - 12 - 6 + (i * 3) ;//var colsWidth = width / maxCols * (i+1) - 116 - 12 - 10 + i * 6 ;
            $(".controlsc"+(i+1)).css("width", componentLength+"px");
            $(".controlsm"+(i+1)).css("width", componentLength+116+"px");
            $(".controls38c"+(i+1)).css("width", componentLength+126+"px");
            $(".controlszh"+(i+1)).css("width", componentLength-20+"px");
        }
    }catch(e){}
}
 
// 解决项目更改,且要兼容前项目 为前项目的方法
function checkUp() {
    return panMain[panIndex].checkUp();
}
function keyDown(a, b) {
    panMain[panIndex].keyDown(a, b);
    if(panMain[panIndex].formtypeOne==10 && event.keyCode ==13){//针对10窗体个别操作不保存 xin 2020-10-13 14:38:01
        panMain[panIndex].isChange=0;
    }
}
function upSub(a) {
    panMain[panIndex].upSub(a);
    if (doc(a+"-img44") != null) {//是44静态图标控件 xin 2022-1-24 15:32:21
        let path=getDoc(a,".value");
        setDoc(a+"-img44",".src='"+path+"'");
    }
}
function getBackAll(a, b) {
    panMain[panIndex].getBackAll(a, b);
}
function getBack(a, b,c) {
    if(c>0&&c!=undefined){
        gtss=c;
        panMain[c].getBack(a, b);
    }else{
        panMain[panIndex].getBack(a, b);
    }
}
function windowOpen(a,panindex,onlyOne) {
    return panMain[panindex].windowOpen(a,panindex,onlyOne);
}
function copy() {
    panMain[panIndex].copy();
}
function loadSet(a) {
    panMain[panIndex].loadSet(a);
}
function windowLink(a) {
    panMain[panIndex].windowLink(a);
}
function htmlGet(a) {
    panMain[panIndex].htmlGet(a);
}
function upImage(id, el) {
    panMain[panIndex].upImage(id, el);
}
function getControlValue(field, fieldtype, targetControl, callback, pindex) {
    panMain[panIndex].getControlValue(field, fieldtype, targetControl, callback, pindex);
};
function getSelect2(field, fieldtype, targetControl, callback, pindex, css) {
    panMain[panIndex].getSelect2(field, fieldtype, targetControl, callback, pindex, css);
};
function getColors46(field) {
    panMain[panIndex].getColors46(field);
}
function getWhere(ben, wai, zi, g, p, id) {
    return panMain[panIndex].getWhere(ben, wai, zi, g, p, id);
}
 
//新增的44控件:静态图标控件 xin 2022-1-24 17:11:20
function openIcon(id){
    $.getScript("/layui/layui.js").done(function() {
        layer.open({
            type: 2,
            area :['calc(100% - 400px)','calc(100% - 80px)'],
            title: false,
            content: '/general/bigIconControl.jsp?id='+id,
            cancel :function(index, layero){
                layer.close(index);
            }
        });
    }).fail(function() {
        $.messager.alert("操作提示","界面没找到","warning");
    });
}
 
//新的OA审核按钮 xin 2021-1-30 10:01:56
function OAVerifyMethod(formId,docstate,doccode){
    $.getScript("/layui/layui.js").done(function() {
     OAButonEvnt=layer.open({
            type: 2,
            area :['calc(100% - 400px)','calc(100% - 80px)'],
            title: false,
            content: '/general/approval.jsp?formId='+formId+'&docstate='+docstate+'&doccode='+doccode,
            success :function(){
              $("body").addClass("bodyScrollOA");
            },
            cancel :function(index, layero){
              layer.close(index);
              $("body").removeClass("bodyScrollOA");
            }
          });
    }).fail(function() {
        $.messager.alert("操作提示","OA审核界面没找到","warning");
    });
}
 
$(function(){
    // panPar.loadingSelect2Data().loading();
    if(panMain[panIndex]!=null) {
        var panelValue = panMain[panIndex].panelAuditValue;
        if (panelValue != null) {
            var shippercode = panelValue.shippercode;
            var logisticscode = panelValue.logisticscode;
            if (shippercode != null && shippercode != '' && logisticscode != null && logisticscode != '') {
                $('#Traces').css('display', 'inline-block');//显示物流信息图标
                var shipperName = panelValue.shippername;
                var receiptertelephone = panelValue.receiptertelephone;
                receiptertelephone = (receiptertelephone != null ? receiptertelephone : "");
                var logisticsstate = panelValue.logisticsstate;
                logisticsstate = (logisticsstate != null ? logisticsstate : "");
                var doccode = panelValue.doccode;
                var formid = panelValue.formid;
                var parm = 'shippercode=' + shippercode + '&logisticscode=' + logisticscode + '&shippername=' + shipperName +
                    '&receiptertelephone=' + receiptertelephone + '&logisticsstate=' + logisticsstate + '&doccode=' + doccode + '&formid=' + formid;
                $('#Traces').on('click', function () {//点击事件
                    layer.open({
                        type: 2,
                        area: ['800px', '500px'],
                        title: false,
                        content: '/general/LogisticsDetails.jsp?' + encodeURL(parm),
                        cancel: function (index) {
                            layer.close(index);
                        }
                    });
                })
            }
        }
    }
    if(qrCode!=null && qrCode!=''){
        $.get('/qr/showQrCode.do?qrCode=' + qrCode, function (res) {
            let ent = $('#tpqrCodeDoc');
            if (ent.length > 0) {
                try{
                    //bootstrap5版本
                    new bootstrap.Popover(ent[0], {
                        trigger: 'hover focus',//focus,click 触发方式
                        placement: 'bottom',//显示方向
                        html: true,
                        title: '',//设置 弹出框 的标题
                        customClass: 'qrCode-class',
                        content: '<img src="' + res.data + '" style="width:200px;height:200px;">'
                    })
                }catch (e) {
                    ent.popover({
                        trigger: 'hover focus',//focus,click 触发方式
                        placement: 'bottom',//显示方向
                        html:true,
                        //title:'单据二维码',//设置 弹出框 的标题
                        content: '<img src="' + res.data + '" style="width:200px;height:200px;">'
                    });
                }
            }
        }, 'json');
    }else{
        $('#tpqrCodeDoc').hide();
    }
 
    //top页面info按钮执行函数
    try{
        $.ajax({
            url: '/showInfo.do',
            data: {'formid': panelFormId, 'doccode': getDoc('doccode', '.value')},
            type: "POST", async: true, dataType: 'text',
            success: function (mes) {
                if (mes == "") {
                    $("#tpinfoDoc").hide();
                    return;
                }
                let ent = $('#tpinfoDoc');
                if (ent.length > 0) {
                    try{
                        //bootstrap5版本
                        new bootstrap.Popover(ent[0], {
                            trigger: 'hover focus',//manual,click 触发方式
                            placement: 'bottom',//显示方向
                            html: true,
                            customClass: 'info-class-panle',
                            title: '单据信息',//设置 弹出框 的标题
                            content: mes
                        })
                    }catch (e) {
                        ent.popover({
                            trigger: 'hover focus',//manual,click 触发方式
                            placement: 'bottom',//显示方向
                            html:true,
                            title: '单据信息',//设置 弹出框 的标题
                            content: mes
                        });
                    }finally {
                        //复制链接用到 xin
                        ent.on('shown.bs.popover', function () {
                            $('.info-class-panle .popover-body ul li a').on('click', function () {
                                copyLink();
                            });
                            $('#tpUpDownDoc .popover-content ul li a').on('click', function () {
                                copyLink();
                            });
                        })
                    }
                }
            }
        });
    }catch(e){
        //options.content='加载信息失败【失败原因:'+e+'】';
    }
    //处理40控件浏览图片,遍历40控件
    $('.isViewer40').each(function(){
        var that = this;
        var v = $(this).data('value');
        var path = '/images/help/fenlei_right.png';
        if (v != null && v != '') {
            if (v.toLowerCase().startsWith('https:') && v.toLowerCase().startsWith('http:')) {
                $(that).append('<li style="width:auto;display: inline-block; margin: 1%;">' +
                    '<img src="' + v + '" alt="" style="width: 100%;height: 150px"/></li>');
                new Viewer(that, {
                    title: false,
                    // url: 'src',
                    shown: function () {
                        $('.viewer-container').css('margin-top', '70');
                    }
                });
                return;
            }
            var type = 9;
            type = (v.split(';') != null ? (v.split(';').length > 2 ? 19 : type) : type);
            var data = {
                unid: v,
                controltype: type,
                fieldid: this.id,
                formid: formId,
                doccode: $("#doccode").val(),
                headflag: 0
            }
            $.post('/attachment/getAttachmentList.do', {'pant': JSON.stringify(data)}, function (data) {
                if (data != null) {
                    var width = '97%';
                    width = (data.length > 1 ? '150px' : width);
                    for (var i = 0; i < data.length; i++) {
                        path = data[i].domain + "/uploads/attachment/" + data[i].dbid + "/" + data[i].formid + "/" + data[i].unid + "@p@" + data[i].seq + "." + data[i].orgFileType;
                        $(that).append('<li style="width:' + width + ';display: inline-block; margin: 1%;"><img src="' + path + '" alt="" style="width: 100%;height: 150px"/></li>');
                    }
                    new Viewer(that, {
                        title: false,
                        // url: 'src',
                        shown: function () {
                            $('.viewer-container').css('margin-top', '70');
                        }
                    });
                } else {
                    $(that).append('<li><img src="' + path + '" alt="" style="width: 100%;height: 150px"/></li>');
                }
            });
        } else {
            $(that).append('<li><img src="' + path + '" alt="" style="width: 100%;height: 150px"/></li>');
        }
    })
    $(".nextDocIco a").on("click", function () {//下一单点击事件 xin 2022-7-29 10:19:30
        panPar.nextDocIco(function (msg) {
            layer.msg(msg || "没有更多的待审核单据");
        })
    })
})