CustomSearchBySimpleIframe.jsp 129 KB
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
<%@page import="weaver.workflow.request.ResourceConditionManager"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.servicefiles.DataSourceXML"%>
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.*" %>
<%@ page import="weaver.formmode.interfaces.ModeManageMenu" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.Map.Entry" %>
<%@ page import="java.math.BigDecimal" %>
<%@ page import="weaver.formmode.virtualform.VirtualFormHandler"%>
<%@ page import="weaver.formmode.service.CommonConstant"%>
<%@ page import="weaver.formmode.customjavacode.CustomJavaCodeRun"%>
<%@ page import="com.weaver.formmodel.util.StringHelper"%>
<%@ page import="weaver.interfaces.workflow.browser.Browser"%>
<%@ page import="weaver.interfaces.workflow.browser.BrowserBean"%>
<%@ page import="weaver.formmode.data.FieldInfo"%>
<%@ page import="weaver.formmode.setup.ExpandBaseRightInfo"%>
<%@ page import="weaver.formmode.tree.CustomTreeUtil"%>
<%@ page import="weaver.formmode.util.CustomSearchAnalyzeUtil"%>
<%@ page import="weaver.common.util.taglib.ShowColUtil"%>
<%@ page import="java.util.Map.Entry"%>
<%@ page import="weaver.formmode.search.editplugin.AbstractPluginElement"%>
<%@ page import="weaver.formmode.search.editplugin.PluginElementClassName"%>
<%@ page import="net.sf.json.JSONObject"%>
<%@ page import="weaver.formmode.excel.ModeCacheManager"%>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="selectRs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rsm" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="WorkflowComInfo" class="weaver.workflow.workflow.WorkflowComInfo" scope="page" />
<jsp:useBean id="BrowserComInfo" class="weaver.workflow.field.BrowserComInfo" scope="page"/>
<jsp:useBean id="ModeShareManager" class="weaver.formmode.view.ModeShareManager" scope="page" />
<jsp:useBean id="ModeRightInfo" class="weaver.formmode.setup.ModeRightInfo" scope="page" />
<jsp:useBean id="FormModeTransMethod" class="weaver.formmode.search.FormModeTransMethod" scope="page" />
<jsp:useBean id="DeleteData" class="weaver.formmode.search.batchoperate.DeleteData" scope="page" />
<jsp:useBean id="FormModeRightInfo" class="weaver.formmode.search.FormModeRightInfo" scope="page" />
<jsp:useBean id="CustomSearchService" class="weaver.formmode.service.CustomSearchService" scope="page" />
<jsp:useBean id="FormModeConfig" class="weaver.formmode.FormModeConfig" scope="page" />
<jsp:useBean   id="xssUtil" class="weaver.filter.XssUtil" />
<jsp:useBean id="ExpandBaseRightInfo" class="weaver.formmode.setup.ExpandBaseRightInfo" scope="page" />
<jsp:useBean id="expandInfoService" class="weaver.formmode.service.ExpandInfoService" scope="page" />

<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ taglib uri="/browserTag" prefix="brow"%>

<!DOCTYPE html><HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<LINK href="/js/jquery/plugins/multiselect/jquery.multiselect_wev8.css" type=text/css rel=STYLESHEET>
<link href="/js/jquery/plugins/multiselect/style_wev8.css" type=text/css rel=STYLESHEET>
<link href="/formmode/js/jquery/jquery-ui-1.10.3/themes/base/jquery-ui_wev8.css" type=text/css rel=STYLESHEET>
<script type="text/javascript" src="/formmode/js/jquery/jquery-ui-1.10.3/ui/minified/jquery-ui.min_wev8.js"></script>
<script language="javascript" src="/js/jquery/plugins/multiselect/jquery.multiselect.min_wev8.js"></script>
<script language="javascript" src="/js/jquery-autocomplete/jquery.autocomplete_wev8.js"></script>
<script language="javascript" src="/formmode/js/customSearchOperate_wev8.js?v=7"></script>
<script type="text/javascript" language="javascript" src="/formmode/js/jquery/aop/jquery.aop.min_wev8.js"></script>
<script type="text/javascript" language="javascript" src="/formmode/js/json2_wev8.js"></script>
<script type="text/javascript" language="javascript" src="/formmode/js/FieldVerifyBatchModify_wev8.js"></script>
 <LINK href="/formmode/css/search_wev8.css" type=text/css rel=STYLESHEET>
 
<SCRIPT language="javascript" src="../../js/weaver_wev8.js"></script>
<script language=javascript src="/js/ecology8/docs/docExt_wev8.js"></script>
<script language=javascript src="/js/ecology8/docs/docSearchInit_wev8.js"></script>
<script language=javascript src="/formmode/js/modebrow_wev8.js"></script>
</head>
<%
//重定向到E9
response.sendRedirect("/spa/cube/index.html#/main/cube/search?hidetop=1&"+request.getQueryString());
String customid=Util.null2String(request.getParameter("customid"));
//先加载下缓存
ModeCacheManager.getInstance().loadCacheNow("", customid, "");

int viewtype=Util.getIntValue(request.getParameter("viewtype"),0);
String treesqlwhere = Util.null2String(request.getParameter("treesqlwhere"));
String treesqlwhere1 = Util.null2String(request.getParameter("treesqlwhere1"));
int templateid = Util.getIntValue(request.getParameter("templateid"),0);
String searchMethod=Util.null2String(request.getParameter("searchMethod"),"0");//查询方式,0-搜索查询,1-模板查询
int mainid = Util.getIntValue(request.getParameter("mainid"),0);
String datasqlwhere = Util.null2String(request.getParameter("datasqlwhere"));
datasqlwhere = xssUtil.get(datasqlwhere);
String fromadvanced = Util.null2String(request.getParameter("fromadvanced"),"0");
String fromgroup = Util.null2String(request.getParameter("fromgroup"),"0");
String customTreeDataId = Util.null2String(request.getParameter("customTreeDataId"),"");
//============================================快捷搜索====================================

//快捷搜索 1本周,2本月,3本季,4本年
String thisdate=Util.null2String(request.getParameter("thisdate"));
//快捷搜索 1本部门,2本部门(包含下级部门),3本分部,4本分部(包含下级分部)
String thisorg=Util.null2String(request.getParameter("thisorg"));
//获得快捷搜索的sql
String quickSql = FormModeTransMethod.getQuickSearch(user,thisdate,thisorg);
//分组条件
String groupby=Util.null2String(xssUtil.get(request.getParameter("groupby")));
//是否开启列表未读,反馈标识功能,1未读、2反馈和3已读
boolean isEnabled = FormModeConfig.isEnabled();
String enabled = Util.null2String(request.getParameter("enabled"),"0");

//============================================查询列表基础数据====================================
boolean issimple= true;
int isresearch=1;
String isbill="1";
String formID="0";
String customname="";
String titlename ="";
String tablename="";
String modeid = "0";
String disQuickSearch = "";
String defaultsql = "";
String norightlist = "";
int iscustom = 0;
int opentype = 0;

String searchconditiontype = "1";
String javafilename = "";
int perpage=10;
String detailtable="";
String detailkeyfield="";
String maintableAlias="t1";
String detailtableAlias="d1";
String detailfieldAlias="d_";
int isShowQueryCondition=0;

rs.execute("select a.*,b.tablename,b.detailkeyfield from mode_customsearch a left join workflow_bill b on a.formid=b.id where a.id="+StringHelper.empty2Null(customid));
if(rs.next()){
    formID=Util.null2String(rs.getString("formid"));
    customname=Util.null2String(rs.getString("customname"));
    titlename = SystemEnv.getHtmlLabelName(197,user.getLanguage())+":"+customname;
    modeid=""+Util.getIntValue(rs.getString("modeid"),0);
    
    disQuickSearch = "" + Util.toScreenToEdit(rs.getString("disQuickSearch"),user.getLanguage());
    defaultsql = "" + Util.toScreenToEdit(rs.getString("defaultsql"),user.getLanguage()).trim();
    defaultsql = FormModeTransMethod.getDefaultSql(user,thisdate,thisorg,defaultsql);
    norightlist = Util.null2String(rs.getString("norightlist"));
	iscustom = Util.getIntValue(rs.getString("iscustom"),1);
	isShowQueryCondition = Util.getIntValue(rs.getString("isShowQueryCondition"),0);
    opentype = Util.getIntValue(rs.getString("opentype"),0);//0 弹出,1当前窗口
    
    searchconditiontype = Util.null2String(rs.getString("searchconditiontype"));
	searchconditiontype = searchconditiontype.equals("") ? "1" : searchconditiontype;
	javafilename = Util.null2String(rs.getString("javafilename"));
	perpage = Util.getIntValue(Util.null2String(rs.getString("pagenumber")),10);
	detailtable=Util.null2String(rs.getString("detailtable"));
	tablename = rs.getString("tablename");
	detailkeyfield=Util.null2String(rs.getString("detailkeyfield"));
}

//============================================虚拟表基础数据====================================
String vdatasource = "";	//虚拟表单数据源
String vprimarykey = "";	//虚拟表单主键列名称
String vdatasourceDBtype = "";	//数据库类型
boolean isVirtualForm = VirtualFormHandler.isVirtualForm(formID);	//是否是虚拟表单
Map<String, Object> vFormInfo = new HashMap<String, Object>();
if(isVirtualForm){
	vFormInfo = VirtualFormHandler.getVFormInfo(formID);
	vdatasource = Util.null2String(vFormInfo.get("vdatasource"));	//虚拟表单数据源
	vprimarykey = Util.null2String(vFormInfo.get("vprimarykey"));	//虚拟表单主键列名称
	DataSourceXML dataSourceXML = new DataSourceXML();
	vdatasourceDBtype = dataSourceXML.getDataSourceDBType(vdatasource);
}else{
	vdatasourceDBtype = RecordSet.getDBType();
}

//============================================权限判断====================================
boolean isRight = false;
boolean isDel = false;
boolean isBatchEdit = false;
if(viewtype == 3){//监控权限判断
	boolean isHavepageRight = FormModeRightInfo.isHavePageRigth(Util.getIntValue(customid),4);
	if(isHavepageRight){
		FormModeRightInfo.setUser(user);
		isRight = FormModeRightInfo.checkUserRight(Util.getIntValue(customid),4);
	}
	else{  //如果自定义查询页面无监控权限,则检查全局监控权限
		ModeRightInfo.setModeId(Util.getIntValue(modeid));
		ModeRightInfo.setType(viewtype);
		ModeRightInfo.setUser(user);
		
		isRight = ModeRightInfo.checkUserRight(viewtype);
	}
	ModeRightInfo.setModeId(Util.getIntValue(modeid));
	ModeRightInfo.setType(viewtype);
	ModeRightInfo.setUser(user);
	if(ModeRightInfo.checkUserRight(viewtype)){
		isDel = true;
	}
}else{
	isDel = true;
	//批量修改权限
	rs.executeSql("select * from mode_searchPageshareinfo where righttype=2 and pageid = " + StringHelper.empty2Null(customid));
	if(rs.next()){  
		FormModeRightInfo.setUser(user);
		isBatchEdit = FormModeRightInfo.checkUserRight(Util.getIntValue(customid),2);
	}
	if(isBatchEdit){
		isRight = true;
	}else{
		//自定义页面查看权限
		rs.executeSql("select * from mode_searchPageshareinfo where righttype=1 and pageid = " + StringHelper.empty2Null(customid));
		if(rs.next()){  
			FormModeRightInfo.setUser(user);
			isRight = FormModeRightInfo.checkUserRight(Util.getIntValue(customid),1);
		}else{  //没有设置任何查看权限数据,则认为有权限查看
			isRight = true;
		}
	}
}

if(!isRight || (viewtype==2 && !isBatchEdit)){
	//response.sendRedirect("/notice/noright.jsp");
	out.println("<script>window.location.href='/notice/noright.jsp';</script>");
	return;
}

boolean isBatchEditPage = (viewtype==2 && !isVirtualForm && !"1".equals(norightlist));
boolean showBatchEditButton = (isBatchEdit && viewtype==0 && !isVirtualForm && !"1".equals(fromadvanced) && !"1".equals(norightlist));
boolean CreateRight = false;//新建权限
boolean BatchImportRight = false;//批量导入权限
boolean DelRight = false;//删除权限

ModeRightInfo.setModeId(Util.getIntValue(modeid));
ModeRightInfo.setType(1);//新建
ModeRightInfo.setUser(user);
CreateRight = ModeRightInfo.checkUserRight(1);

ModeRightInfo.setType(4);//批量导入
if(isVirtualForm){//虚拟表单不能批量导入
    BatchImportRight = false;
}else{
	BatchImportRight = ModeRightInfo.checkUserRight(4);
	if(!BatchImportRight){
		BatchImportRight = HrmUserVarify.checkUserRight("ModeSetting:All", user);
	}
}
String treenodeid = Util.null2String(request.getParameter("treenodeid"));
String treeconid = Util.null2String(request.getParameter("treeconid"));
String treeconvalue = "";
if(!treeconid.equals("")){
	treeconvalue = Util.null2String(request.getParameter("treecon"+treeconid+"_value"));
}
//============================================链接地址参数应用====================================
String createurl = "";
String tempquerystring = Util.null2String(request.getQueryString()); 
if (tempquerystring.indexOf("&flag") > -1) {
	tempquerystring = tempquerystring.substring(0,tempquerystring.indexOf("&flag"));
}
int splitIndex = tempquerystring.indexOf("&splitFlag=-999");
if(splitIndex!=-1){
	tempquerystring = tempquerystring.substring(0,splitIndex);
	//把treesqlwhere转换为了实际参数
	String removeStr = "&treesqlwhere=";//要移除的参数
	int index = tempquerystring.indexOf(removeStr);
	if(index!=-1){
		String tempStr = tempquerystring.substring(0,index);
		String aftStr = tempquerystring.substring(index+removeStr.length());
		if(aftStr.indexOf("&")!=-1){
			tempStr = tempStr + aftStr.substring(aftStr.indexOf("&"));
		}
		tempquerystring = tempStr;
	}
	
	removeStr = "&treenodeid=";//要移除的参数
	index = tempquerystring.indexOf(removeStr);
	if(index!=-1){
		String tempStr = tempquerystring.substring(0,index);
		String aftStr = tempquerystring.substring(index+removeStr.length());
		if(aftStr.indexOf("&")!=-1){
			tempStr = tempStr + aftStr.substring(aftStr.indexOf("&"));
		}
		tempquerystring = tempStr;
	}
}

String tempquerystrings[] = tempquerystring.split("&");
for(int i=0;i<tempquerystrings.length;i++){
	String tempquery = tempquerystrings[i];
	if(tempquery.toLowerCase().startsWith("field")){
		createurl += "&"+tempquery;
	}
}


//替换查询url,request传参字段
if(defaultsql.indexOf("PARM(")>-1){
	int beginIndex = defaultsql.indexOf("PARM(");
	while(beginIndex>-1){
		int endIndex = defaultsql.indexOf(")",beginIndex+5);
		int nextIndex = 0;
		if(endIndex>-1){
			String substring = defaultsql.substring(beginIndex+5, endIndex);
			if(request.getParameter(substring)==null){
				beginIndex = defaultsql.indexOf("PARM(",endIndex-nextIndex+1);
			}else{
				String paramvalue = Util.null2String(request.getParameter(substring));
				defaultsql = defaultsql.replace("PARM("+substring+")", paramvalue);
				if(paramvalue.length()<substring.length()){
					nextIndex = substring.length()-paramvalue.length();
				}
				beginIndex = defaultsql.indexOf("PARM(",endIndex-nextIndex+1);
			}
		}else{
			break;
		}
	}
}

//============================================删除数据====================================
String method=Util.null2String(request.getParameter("method"));
int pageexpandid = Util.getIntValue(request.getParameter("pageexpandid"),0);
String deletebillid=Util.null2String(request.getParameter("deletebillid"));
if(method.equals("del")){//删除数据
	DeleteData.setClientaddress(request.getRemoteAddr());
	DeleteData.setDeletebillid(deletebillid);
	DeleteData.setFormid(Util.getIntValue(formID));
	DeleteData.setModeid(Util.getIntValue(modeid));
	DeleteData.setTablename(tablename);
	DeleteData.setUser(user);
	DeleteData.setViewtype(viewtype);
	DeleteData.setPageexpandid(pageexpandid);
	String delMsg = DeleteData.DelData();
	if(delMsg != null && !delMsg.equals("")) {
		out.print("<script>top.Dialog.alert('"+delMsg+"');</script>");
	}
	%>
    <script>
        if(parent.parent.frames['leftframe']){
            if(typeof(parent.parent.frames['leftframe'].delRefresh) == "function"){
                parent.parent.frames['leftframe'].delRefresh();
            }
        }
        parent.loadGroup();
    </script>
    <%
}

//============================================关键字搜索====================================

String searchkeyname = Util.null2String(request.getParameter("searchkeyname"));
String isusersearchkey=Util.null2String(request.getParameter("isusersearchkey"));
String quicksqlwhere = "";
String quickTitle = "";
int searchKeyNum = 0;
String parfield = "";
String keyfieldSql = "select workflow_billfield.id,workflow_billfield.fieldname,viewtype,(select indexdesc from HtmlLabelIndex where id=workflow_billfield.fieldlabel) as indexdesc  from Mode_CustomDspField,workflow_billfield where Mode_CustomDspField.fieldid=workflow_billfield.id and " + 
   					 " Mode_CustomDspField.customid="+StringHelper.empty2Null(customid)+" and iskey=1";
RecordSet.execute(keyfieldSql);
while(RecordSet.next()){
	searchKeyNum++;
	parfield = RecordSet.getString("id");
	String fieldname = RecordSet.getString("fieldname");
	String indexdesc = RecordSet.getString("indexdesc");
	int field_viewtype=RecordSet.getInt("viewtype");
	String tableAlias=maintableAlias;
	if(field_viewtype==1){
		tableAlias=detailtableAlias;
	}
	quicksqlwhere += " LOWER("+tableAlias+"."+fieldname+") like LOWER('%"+searchkeyname.replace("'", "''")+"%') or";
	quickTitle += " "+indexdesc+" or";
}
if(quicksqlwhere.length()>2){
	quicksqlwhere ="("+quicksqlwhere.substring(0,quicksqlwhere.length()-2)+")";
}
if(quickTitle.length()>2){
	quickTitle = quickTitle.substring(0,quickTitle.length()-2);
}
if ("".equals(searchkeyname)||"0".equals(isusersearchkey)) {
	quicksqlwhere="";
}

//============================================自定义查询条件====================================
boolean isoracle = vdatasourceDBtype.equals("oracle") ;
boolean isdb2 = vdatasourceDBtype.equals("db2") ;

//下面开始自定义查询条件
String[] checkcons = request.getParameterValues("check_con");
String sqlwhere_con="";
ArrayList ids = new ArrayList();
ArrayList colnames = new ArrayList();
ArrayList opts = new ArrayList();
ArrayList values = new ArrayList();
ArrayList names = new ArrayList();
ArrayList opt1s = new ArrayList();
ArrayList value1s = new ArrayList();
ids.clear();
colnames.clear();
opt1s.clear();
names.clear();
value1s.clear();
opts.clear();
values.clear();
Hashtable conht=new Hashtable();

String consql = "select b.id,b.fieldname,b.fielddbtype,b.fieldhtmltype,b.type,b.viewtype,c.searchparaname,c.searchparaname1,c.conditionTransition from mode_customsearch a,workflow_billfield b,mode_CustomDspField c where b.id=c.fieldid and a.id=c.customid and c.isquery=1 and a.id="+StringHelper.empty2Null(customid)
	+" union select fieldid as id,'' as fieldname,'' as fielddbtype,'' as fieldhtmltype,0 as type,0 as viewtype ,searchparaname,searchparaname1,conditionTransition from mode_CustomDspField where isquery='1' and fieldid in(-1,-2,-3,-4,-5,-6,-7,-8,-9) and customid="+StringHelper.empty2Null(customid);
rs.executeSql(consql);

//获取conht,sqlwhere_con逻辑放在FormModeTransMethod中,是因为该jsp在weblogic环境中编译超过最大字节数63535
FormModeTransMethod.setIsTemplate("true");
Map map = FormModeTransMethod.customsearch(request,rs,customid,maintableAlias,detailtableAlias,isoracle,isdb2,vdatasourceDBtype,user,isbill,modeid,formID,viewtype,conht,sqlwhere_con);
conht = (Hashtable)map.get("conht");
sqlwhere_con = (String)map.get("sqlwhere_con");

String _sql = "";
//如果没有查询条件传递过来,且当前模板没有,则查询模板用默认模板
if (templateid == 0 && checkcons == null) { 
	rs.execute("select id from mode_TemplateInfo where customid="+StringHelper.empty2Null(customid)+" and isdefault=1 and sourcetype=2 and createrid='"+user.getUID()+"'");
	if (rs.next()) {
		templateid = rs.getInt("id");
	}
}
String castSql = "";
if(RecordSet.getDBType().equals("oracle")){
	castSql = "to_char(workflow_billfield.fieldlabel) as label";
}else if(RecordSet.getDBType().equals("mysql")){
	castSql = "CONCAT(workflow_billfield.fieldlabel,'') as label";
}else{
	castSql = "convert(varchar,workflow_billfield.fieldlabel) as label";
}
if (templateid > 0) { //如果有模板,则获取模板信息,传过来的值直接覆盖默认模板
		_sql = "select workflow_billfield.id as id"+
		",workflow_billfield.fieldname as name,"+castSql+",workflow_billfield.fielddbtype as dbtype,workflow_billfield.selectitem as selectitem,workflow_billfield.linkfield as linkfield"+
		",workflow_billfield.fieldhtmltype as httype,workflow_billfield.childfieldid as childfieldid, workflow_billfield.type as type,viewtype,"+
		" topt,topt1,tvalue,tvalue1,tname" + 
		" from workflow_billfield,mode_TemplateDspField,mode_TemplateInfo where mode_TemplateDspField.templateid=mode_TemplateInfo.id and workflow_billfield.id=mode_TemplateDspField.fieldid and mode_TemplateInfo.customid="+StringHelper.empty2Null(customid);
		_sql += " AND mode_TemplateDspField.templateid="+templateid+" order by fieldorder";
	RecordSet.executeSql(_sql);
	if (checkcons==null) { //有默认模板,且没有页面传输值的,则searchMethod为模板查询
		searchMethod = "1";
	}
}
if (RecordSet.getColCounts() > 0 && "1".equals(searchMethod)) {//有模板信息,且是模板查询
	//获取conht,sqlwhere_con逻辑放在FormModeTransMethod中,是因为该jsp在weblogic环境中编译超过最大字节数63535
	Map map1 = FormModeTransMethod.customsearch1(RecordSet,customid,maintableAlias,detailtableAlias,isoracle,isdb2,vdatasourceDBtype,conht,sqlwhere_con);
	conht = (Hashtable)map1.get("conht");
	sqlwhere_con = (String)map1.get("sqlwhere_con");
} else {
	if (!"1".equals(searchMethod)) { // 不是空模板,且不是模板查询
		//获取conht,sqlwhere_con逻辑放在FormModeTransMethod中,是因为该jsp在weblogic环境中编译超过最大字节数63535
		Map map2 = FormModeTransMethod.customsearch2(request,checkcons,maintableAlias,detailtableAlias,isoracle,isdb2,vdatasourceDBtype,conht,sqlwhere_con);
		conht = (Hashtable)map2.get("conht");
		sqlwhere_con = (String)map2.get("sqlwhere_con");
	}
} 
//查询条件有默认值,则去掉URL中默认值 ---- begin
String deltempquerystrings[] = tempquerystring.split("&");
String filedsql="";
filedsql = "select * from (select mode_CustomDspField.queryorder ,mode_CustomDspField.showorder ,workflow_billfield.id as id"+
		",workflow_billfield.fieldname as name,"+castSql+",workflow_billfield.fielddbtype as dbtype"+
		",workflow_billfield.fieldhtmltype as httype,workflow_billfield.childfieldid as childfieldid, workflow_billfield.type as type,viewtype"+
		" from workflow_billfield,mode_CustomDspField,mode_CustomSearch"+
		" where mode_CustomDspField.customid=mode_Customsearch.id and mode_CustomSearch.id="+StringHelper.empty2Null(customid)+" and mode_CustomDspField.isquery='1'"+
		" and workflow_billfield.billid="+StringHelper.empty2Null(formID)+" and workflow_billfield.id=mode_CustomDspField.fieldid ";

filedsql+=" union select queryorder,showorder,fieldid as id,'' as name,'' as label,'' as dbtype,'' as httype,0 as childfieldid,0 as type,0 as viewtype"+
	" from mode_CustomDspField where isquery='1' and fieldid in(-1,-2,-3,-4,-5,-6,-7,-8,-9) and customid="+StringHelper.empty2Null(customid);
filedsql+=") a order by a.queryorder,a.showorder,a.id";
if (templateid == 0) { //如果没有模板,则获取默认模板信息
	rs.execute("select id from mode_TemplateInfo where customid="+StringHelper.empty2Null(customid)+" and isdefault=1 and sourcetype=2 and createrid='"+user.getUID()+"'");
	if (rs.next()) {
		templateid = rs.getInt("id");
	}
}
if (templateid > 0) { //如果有模板,则获取模板信息
		filedsql = "select workflow_billfield.id as id"+
		",workflow_billfield.fieldname as name,"+castSql+",workflow_billfield.fielddbtype as dbtype,workflow_billfield.selectitem as selectitem,workflow_billfield.linkfield as linkfield"+
		",workflow_billfield.fieldhtmltype as httype,workflow_billfield.childfieldid as childfieldid, workflow_billfield.type as type,viewtype,"+
		" topt,topt1,tvalue,tvalue1,tname" + 
		" from workflow_billfield,mode_TemplateDspField,mode_TemplateInfo where mode_TemplateDspField.templateid=mode_TemplateInfo.id and workflow_billfield.id=mode_TemplateDspField.fieldid and mode_TemplateInfo.customid="+StringHelper.empty2Null(customid);
		filedsql += " AND mode_TemplateDspField.templateid="+templateid+" order by fieldorder";
}
RecordSet.execute(filedsql);
while (RecordSet.next()){
	String tmpid = RecordSet.getString("id");
	for(int j=0;j<deltempquerystrings.length;j++){
		String tempquery = deltempquerystrings[j].toLowerCase();
		if(("check_con="+tmpid).equals(tempquery)||tempquery.startsWith("con"+tmpid+"_colname")||tempquery.startsWith("con"+tmpid+"_htmltype")
			||tempquery.startsWith("con"+tmpid+"_type")||tempquery.startsWith("con"+tmpid+"_opt")||tempquery.startsWith("con"+tmpid+"_value")
			||tempquery.startsWith("con"+tmpid+"_name")||tempquery.startsWith("con"+tmpid+"_opt1")||tempquery.startsWith("con"+tmpid+"_value1")){
				deltempquerystrings[j] = "";
		}
	}
}

String newtempquerystring = "";
for(int i=0;i<deltempquerystrings.length;i++){
	String tempquery = deltempquerystrings[i];
	if(!"".equals(tempquery)){
		newtempquerystring +=tempquery+"&";
	}
}
if(newtempquerystring.length() > 2) {
	newtempquerystring = newtempquerystring.substring(0, newtempquerystring.length()-1);
}
tempquerystring = newtempquerystring;
//去掉查询条件默认值-----end

//去掉条件参数---- begin
String searchparmstrings[] = tempquerystring.split("&");
filedsql = "select b.id,b.fieldname,b.fielddbtype,b.fieldhtmltype,b.type,c.searchparaname,c.searchparaname1 from mode_customsearch a,workflow_billfield b,mode_CustomDspField c where b.id=c.fieldid and a.id=c.customid and c.isquery=1 and a.id="+StringHelper.empty2Null(customid)
	+" union select fieldid as id,'' as fieldname,'' as fielddbtype,'' as fieldhtmltype,0 as type,searchparaname,searchparaname1 from mode_CustomDspField where isquery='1' and fieldid in(-1,-2,-3,-4,-5,-6,-7,-8,-9) and customid="+StringHelper.empty2Null(customid);
RecordSet.execute(filedsql);
while (RecordSet.next()){
	String searchparaname = RecordSet.getString("searchparaname");
	String searchparaname1 = RecordSet.getString("searchparaname1");
	for(int j=0;j<searchparmstrings.length;j++){
		String tempquery = searchparmstrings[j];
		if((tempquery).startsWith(searchparaname+"=")||(tempquery).startsWith(searchparaname1+"=")){
				searchparmstrings[j] = "";
		}
	}
}

String newsearchparmstring = "";
for(int i=0;i<searchparmstrings.length;i++){
	String tempquery = searchparmstrings[i];
	if(!"".equals(tempquery)){
		newsearchparmstring +=tempquery+"&";
	}
}
if (newsearchparmstring.length() > 2) {
	newsearchparmstring = newsearchparmstring.substring(0, newsearchparmstring.length()-1);
}
tempquerystring = newsearchparmstring;
//去掉条件参数-----end
//去掉searchkeyname条件参数
if (tempquerystring.indexOf("searchkeyname") > -1) {
	String tempquerystringpre = tempquerystring.split("searchkeyname")[0];
	String tempquerystringaft = tempquerystring.split("searchkeyname")[1];
	if (tempquerystringaft.indexOf("&") > -1) {
		tempquerystringaft = tempquerystringaft.substring(1);
	}
	tempquerystring = tempquerystringpre + tempquerystringaft;
}

//如果点击的是关键字搜索,则自定义查询条件失效
if("1".equals(isusersearchkey)){
	//sqlwhere_con="";
}

//============================================数据属于哪个模块条件====================================
String whereclause=" where t1.formmodeid = " + modeid + " ";
if(isVirtualForm){
	whereclause = " where 1=1 ";
}else if(modeid.equals("")||modeid.equals("0")){//没有设置模块
	if(norightlist.equals("1")){
		whereclause = " where 1=1 ";
	}else{
		String sqlStr1 = "select id,modename from modeinfo where formid="+StringHelper.empty2Null(formID)+" order by id";
		rsm.executeSql(sqlStr1);
		whereclause = "";
		String modeStr = "";
		while(rsm.next()){
			String mid = rsm.getString("id");
			if(modeStr.equals("")){
				modeStr += mid;
			}else{
				modeStr += ","+mid;
			}
		}
		if(!modeStr.isEmpty()){
			whereclause = " where t1.formmodeid  in ("+modeStr+") ";
		}else{
			whereclause = " where 1=1 ";
		}
	}
}
String sqlwhere = whereclause + sqlwhere_con + datasqlwhere;
String formmodeid=modeid;
String orderby = "";
String sql="";
String initselectfield = "";
List iframeList = new ArrayList();
String multiselectid="";
ArrayList<String> ldselectfieldid=new ArrayList<String>();
boolean isCleanColWidth =false;
rs.executeSql("select 1 from user_default_col where pageid = 'mode_customsearch:"+StringHelper.empty2Null(customid)+"' and userid = "+user.getUID());
if(rs.next()){
	isCleanColWidth = true;
}
%>
<%
String modeFormVerifyCss = "";
RecordSet modeFormVerifyCssRs = new RecordSet();
modeFormVerifyCss = " <style type=\"text/css\"> ";
modeFormVerifyCssRs.executeQuery(" select id, color from modeformverify where formid = ? ", formID);
while(modeFormVerifyCssRs.next()) {
	String id = Util.null2String(modeFormVerifyCssRs.getString("id"));
	String color = Util.null2String(modeFormVerifyCssRs.getString("color"));
	modeFormVerifyCss+="td.verifyFail_"+id+" { background-color:"+color+" !important; } ";
}	
modeFormVerifyCss+="</style>";
out.println(modeFormVerifyCss);
%>
<BODY>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>

<%
//鼠标右键
ModeManageMenu ModeManageMenu = new ModeManageMenu();
ModeManageMenu.setCustomid(Util.getIntValue(customid,0));
ModeManageMenu.setModeId(Util.getIntValue(modeid,0));
ModeManageMenu.setRCMenuHeightStep(RCMenuHeightStep);
ModeManageMenu.setUser(user);
ModeManageMenu.setCreateRight(CreateRight);
ModeManageMenu.setBatchImportRight(BatchImportRight);
ModeManageMenu.setVirtualForm(isVirtualForm);
ModeManageMenu.getSearchMenu();
HashMap urlMap = ModeManageMenu.getUrlMap();
RCMenu += ModeManageMenu.getRCMenu() ;
RCMenuHeight += ModeManageMenu.getRCMenuHeight() ;
if(isCleanColWidth){
	RCMenu += "{"+SystemEnv.getHtmlLabelNames("20873,19509",user.getLanguage())+",javascript:customSearchOperate.cleanColWidth(),_self} " ;//清除列宽
	RCMenuHeight += RCMenuHeightStep;
}
if(showBatchEditButton){
	RCMenu += "{"+SystemEnv.getHtmlLabelNames("25465",user.getLanguage())+",javascript:customSearchOperate.doBatchEdit(),_self} " ;//批量修改
	RCMenuHeight += RCMenuHeightStep;
}
if(isBatchEditPage){
	RCMenu = "{"+SystemEnv.getHtmlLabelNames("20839,86",user.getLanguage())+",javascript:customSearchOperate.batchEditSave(),_self} " ;//批量保存
	RCMenuHeight += RCMenuHeightStep;
	RCMenu += "{"+SystemEnv.getHtmlLabelNames("197",user.getLanguage())+",javascript:submitData(),_self} " ;//搜索
	RCMenuHeight = RCMenuHeightStep;
	RCMenu += "{"+SystemEnv.getHtmlLabelNames("1290",user.getLanguage())+",javascript:customSearchOperate.batchEditGoBack(),_self} " ;//返回
	RCMenuHeight += RCMenuHeightStep;
}

//页面扩展或批量操作设置是否显示或是否启用新建按钮
ModeManageMenu.isShowCreateInBox();
boolean isCreateBox = ModeManageMenu.isCreateRight();

//新建按钮通过拓展页面获取
String isShowCreateBtn = "1";
String isVirtualFormFilterSql = "";
if(isVirtualForm){
	isVirtualFormFilterSql = " and (a.issystemflag not in(103,104) or a.issystemflag  is null) ";
}
String nullStr = CommonConstant.DB_ISNULL_FUN;
sql = "select a.id,b.listbatchname expendname,a.expenddesc,b.isuse,a.issystem,a.isshow,a.issystemflag,a.defaultenable,a.hreftarget,a.hreftype,a.hrefid,a.opentype,b.listbatchname from mode_pageexpand a left join mode_batchset b on a.id = b.expandid and b.customsearchid = "+StringHelper.empty2Null(customid)+" where a.isbatch in(1,2) "+isVirtualFormFilterSql+" and a.modeid = " + modeid + " and "+nullStr+"(b.isshortcutbutton,0)=1 and a.isshow=1 order by b.showorder asc,a.issystem desc,a.id asc";
RecordSet.executeSql(sql);
// 增加判断页面扩展权
ExpandBaseRightInfo.setUser(user);
ArrayList<Map<String,String>> expandbuttonList = new ArrayList<Map<String,String>>();
while (RecordSet.next()) {
	if(!ExpandBaseRightInfo.checkExpandRight(Util.null2String(RecordSet.getString("id")), modeid)){
		continue;
	}
	Map<String,String> expandbuttonMap = new HashMap<String,String>();
	String detailid = Util.null2String(RecordSet.getString("id"));
	String issystem = Util.null2String(RecordSet.getString("issystem"));
	String issystemflag = Util.null2String(RecordSet.getString("issystemflag"));
	String isuse = Util.null2String(RecordSet.getString("isuse"));
	String defaultenable = Util.null2String(RecordSet.getString("defaultenable"));
	String hreftarget = Util.null2String(RecordSet.getString("hreftarget"));
	String _opentype = Util.null2String(RecordSet.getString("opentype"));
	String expendname = Util.null2String(RecordSet.getString("expendname"));
	String hreftype = Util.null2String(RecordSet.getString("hreftype"));
	String hrefid = Util.null2String(RecordSet.getString("hrefid"));
	String createname = Util.null2String(RecordSet.getString("listbatchname"));
	String methodStr = "";

	if(isBatchEditPage && !"1".equals(issystemflag) && !"100".equals(issystemflag))continue;
	if(issystemflag.equals("")){
		issystemflag = "0";
	}
	if(issystem.equals("1")){
		if(isuse.equals("")){
			isuse = defaultenable;
		}
		if(isuse.equals("0")){
			//continue;
		}
		else{
			if(issystemflag.equals("100")){
				if(createname.equals("")){
					createname = SystemEnv.getHtmlLabelName(197,user.getLanguage());
				}
				methodStr = "submitData()";
			}
			if(CreateRight&&issystemflag.equals("101")){
				if(createname.equals("")){
					createname = SystemEnv.getHtmlLabelName(82,user.getLanguage());
				}
				methodStr = "Add()";
				isShowCreateBtn = RecordSet.getString("isshow");
			}
			if(BatchImportRight&&issystemflag.equals("103")){
				if(createname.equals("")){
					createname = SystemEnv.getHtmlLabelName(26601,user.getLanguage());
				}
				methodStr = "BatchImport("+detailid+")";
			}
			if(issystemflag.equals("102")){
				if(createname.equals("")){
					createname = SystemEnv.getHtmlLabelName(91,user.getLanguage());
				}
				methodStr = "Del("+detailid+")";
			}
			if(issystemflag.equals("8")){
				if(createname.equals("")){
					createname = SystemEnv.getHtmlLabelName(33418,user.getLanguage());
				}
				methodStr = "resetSearch()";
			}
			if(issystemflag.equals("12")){ //批量生成二维码
				if(createname.equals("")){
					createname = SystemEnv.getHtmlLabelName(125512,user.getLanguage());
				}
				methodStr = "batchCreateQRCode()";
			}
			if(issystemflag.equals("171")){ //批量生成条形码
				if(createname.equals("")){
					createname = SystemEnv.getHtmlLabelName(126684,user.getLanguage());
				}
				methodStr = "batchCreateBARCode()";
			}
			if(!isVirtualForm&&issystemflag.equals("104")){//虚拟表单能用批量共享
				if(createname.equals("")){
					createname = SystemEnv.getHtmlLabelName(18037,user.getLanguage());
				}
				methodStr = "batchShare()";
			}
			if(issystemflag.equals("105")){
				if(createname.equals("")){
					createname = SystemEnv.getHtmlLabelName(17416,user.getLanguage());
				}
				methodStr = "getAllExcelOut()";
			}
			if(issystemflag.equals("106")){//显示定制列
				if(createname.equals("")){
					createname = SystemEnv.getHtmlLabelName(32535,user.getLanguage());
				}
				methodStr = "columnMake()";
			}
			if(issystemflag.equals("110")){
				if(createname.equals("")){
					createname = SystemEnv.getHtmlLabelName(82639,user.getLanguage())+SystemEnv.getHtmlLabelName(22967,user.getLanguage());
				}
				methodStr = "showMapPage()";
			}
		}
	}else{
		if(isuse.equals("0")||isuse.equals("")){
			//continue;
		}else{
			createname = expendname;
			if(_opentype.equals("1")){//默认窗口,当前窗口
				methodStr = "windowOpenOnSelf("+detailid+")";
		   	}else if(_opentype.equals("2")){//弹出窗口
		   		methodStr = "windowOpenOnNew("+detailid+")";
		   	}else if(_opentype.equals("3")){//其它
		   		methodStr = "doCustomFunction("+detailid+")";
		   	}
		   	if("4".equals(hreftype)){
		   		methodStr = "batchmodifyfeildvalue("+detailid+","+hrefid+")";
		   	}
		}
	}
	expandbuttonMap.put("createname",createname);
	expandbuttonMap.put("methodStr",methodStr);
	expandbuttonList.add(expandbuttonMap);
	
}

boolean isbatchsetnew = true;
RecordSet.executeSql("select 1 from mode_batchset where customsearchid="+StringHelper.empty2Null(customid));
if(RecordSet.next()){
	isbatchsetnew = false;
}
%>

	<table id="topTitle" cellpadding="0" cellspacing="0">
		<tr>
			<td>
			</td>
			<td class="rightSearchSpan" style="text-align:right;">
				<%if (isbatchsetnew) {
					if (CreateRight && isCreateBox && "1".equals(isShowCreateBtn) && !isBatchEditPage) {%><!-- 新建 -->
						<input type="button" name="zh" class="e8_btn_top" value="<%=SystemEnv.getHtmlLabelName(82,user.getLanguage()) %>" onclick="javascript:Add()"/>				
				<%  }
				  } else {%><!-- 有查询批量操作的,都按照 查询批量操作获取-->
                <%      
                		for (int i = 0 ; i < expandbuttonList.size() ; i++) {
                			Map<String,String> expandbuttonMap = expandbuttonList.get(i);
                			String createname = (String)expandbuttonMap.get("createname");
                			String methodStr = (String)expandbuttonMap.get("methodStr");
                			if (!methodStr.isEmpty()) {%>
								<input type="button" name="zh" class="e8_btn_top" value="<%=createname %>" onclick="javascript:<%=methodStr %>"/>
				<%      	} 
                		}
				  }
				%>
				<%if(searchKeyNum==0){%>
				<input type="hidden" id="searchName" name="searchName"/>
				<%}else{%>
				<input type="text" class="searchInput" id="searchName" name="searchName" value="<%=searchkeyname%>" title="<%=quickTitle %>"/>
				<%}%><!-- 高级搜索 -->
				<span id="advancedSearch" class="advancedSearch"><%=SystemEnv.getHtmlLabelName(21995,user.getLanguage())%></span>
				<span title="<%=SystemEnv.getHtmlLabelName(81804,user.getLanguage())%>" class="cornerMenu"></span><!-- 菜单 -->
			</td>
		</tr>
	</table>
	
<div class="advancedSearchDiv" id="advancedSearchDiv" style="display:hide;overflow: auto" >
<form id="frmmain" name="frmmain" method="post" action="/formmode/search/CustomSearchBySimpleIframe.jsp?<%=tempquerystring%>">
<iframe id="selectChange" frameborder=0 scrolling=no src=""  style="display:none"></iframe>
<input id="customid" name=customid type=hidden value="<%=customid%>"/>
<input id="isDel" name="isDel" type=hidden value="<%=isDel%>"/>
<input name=viewtype type=hidden value="<%=viewtype%>"/>
<input name=issimple type=hidden value="<%=issimple%>"/>
<input name=templateid id="templateid" type=hidden value="<%=templateid%>"/>
<input name="deletebillid" id="deletebillid" type=hidden value=""/>
<input name="method" id="method" type=hidden value=""/>
<input name="searchMethod" id="searchMethod" type=hidden value=""/>
<input type=hidden name="pageexpandid" id="pageexpandid" value="">
<input name="treesqlwhere" id="treesqlwhere" type=hidden value=""/>
<input name="treesqlwhere1" id="treesqlwhere1" type=hidden value="<%=treesqlwhere1 %>"/>
<input name="formmodeid" id="formmodeid" type="hidden" value="<%=modeid %>"/>
<input type=hidden name=formid id="formid" value="<%=formID %>"/>
<input type=hidden name=groupby id="groupby" value="<%=groupby %>"/>
<input type=hidden name=searchkeyname id="searchkeyname" value="<%=searchkeyname%>"/>
<input type=hidden name="isusersearchkey" id="isusersearchkey" value="0"/>
<input type=hidden name="treenodeid" id="treenodeid" value="<%=treenodeid %>"/>
<input type=hidden name="treeconid" id="treeconid" value="<%=treeconid %>"/>
<input type=hidden name="<%="treecon"+treeconid+"_value" %>" id="<%="treecon"+treeconid+"_value" %>" value="<%=treeconvalue %>"/>
<wea:layout type="4col">
	<wea:group context='<%=SystemEnv.getHtmlLabelName(20331,user.getLanguage()) %>' attributes=""><!-- 自定义查询条件 -->
		<wea:item type="groupHead">
		 	<div style="margin-top:-2px;width:219px;" class="templatecls">
		    	<select name="template" id="template" onChange="onChangeTemplate(this);" style="width: 135px;">
		    		<option value="-1"></option>
		    		<%
		    		rs.executeSql("select id,templatename from mode_templateinfo where customid="+StringHelper.empty2Null(customid)+" and (sourcetype=1 or sourcetype=2) and createrid='"+user.getUID()+"' order by displayorder");
		    		while (rs.next()) {
		    			int t_id = rs.getInt("id");
		    			String t_name = rs.getString("templatename");
		    			String selectedstr = "";
		    			if (t_id == templateid) {
		    				selectedstr = " selected ";
		    			}
		    		%>
		    		<option value="<%=t_id %>"<%=selectedstr %>><%=t_name %></option>
		    		<%
		    		}
		    		%>
		    	</select>
		    	<a href="javascript:void(0)"  onclick="templateManage(2)"><%=SystemEnv.getHtmlLabelName(17857,user.getLanguage()) %><!-- 模板管理 --></a>
	    	</div>
	    </wea:item>
		<% if(!disQuickSearch.equals("1") && !isVirtualForm) {%>
			<wea:item>
				<%=SystemEnv.getHtmlLabelName(81449,user.getLanguage())%><!-- 创建日期属于 -->
			</wea:item>
			<wea:item>
				<input type="checkbox" id="thisdate" name="thisdate" value="1" onclick="clickThisDate(this)" <%if(thisdate.equals("1")){out.println("checked");}%>>
				<span style="font-size:12px;TEXT-DECORATION:none;color:<%if("1".equals(thisdate)){%>#0000FF<%}else{%>#6A9EE6<%}%>;cursor:hand" onclick="quickSearchDate('1')">[<%=SystemEnv.getHtmlLabelName(15539,user.getLanguage())%>]</span><!-- 本周 -->
				<input type="checkbox" id="thisdate" name="thisdate" value="2" onclick="clickThisDate(this)" <%if(thisdate.equals("2")){out.println("checked");}%>>
				<span style="font-size:12px;TEXT-DECORATION:none;color:<%if("2".equals(thisdate)){%>#0000FF<%}else{%>#6A9EE6<%}%>;cursor:hand" onclick="quickSearchDate('2')">[<%=SystemEnv.getHtmlLabelName(15541,user.getLanguage())%>]</span><!-- 本月 -->
				<br/>
				<input type="checkbox" id="thisdate" name="thisdate" value="3" onclick="clickThisDate(this)" <%if(thisdate.equals("3")){out.println("checked");}%>>
				<span style="font-size:12px;TEXT-DECORATION:none;color:<%if("3".equals(thisdate)){%>#0000FF<%}else{%>#6A9EE6<%}%>;cursor:hand" onclick="quickSearchDate('3')">[<%=SystemEnv.getHtmlLabelName(21904,user.getLanguage())%>]</span><!-- 本季 -->
				<input type="checkbox" id="thisdate" name="thisdate" value="4" onclick="clickThisDate(this)" <%if(thisdate.equals("4")){out.println("checked");}%>>
				<span style="font-size:12px;TEXT-DECORATION:none;color:<%if("4".equals(thisdate)){%>#0000FF<%}else{%>#6A9EE6<%}%>;cursor:hand" onclick="quickSearchDate('4')">[<%=SystemEnv.getHtmlLabelName(15384,user.getLanguage())%>]</span><!-- 本年 -->
			</wea:item>

			<wea:item><%=SystemEnv.getHtmlLabelName(81448,user.getLanguage())%></wea:item><!-- 创建人属于 -->
			<wea:item>
				<input type="checkbox" id="thisorg" name="thisorg" value="1" onclick="clickThisOrg(this)" <%if(thisorg.equals("1")){out.println("checked");}%>>
				<span style="font-size:12px;TEXT-DECORATION:none;color:<%if("1".equals(thisorg)){%>#0000FF<%}else{%>#6A9EE6<%}%>;cursor:hand" onclick="quickSearchOrg('1')">[<%=SystemEnv.getHtmlLabelName(21837,user.getLanguage())%>]</span><!-- 本部门 -->
				<input type="checkbox" id="thisorg" name="thisorg" value="2" onclick="clickThisOrg(this)" <%if(thisorg.equals("2")){out.println("checked");}%>>
				<span style="font-size:12px;TEXT-DECORATION:none;color:<%if("2".equals(thisorg)){%>#0000FF<%}else{%>#6A9EE6<%}%>;cursor:hand" onclick="quickSearchOrg('2')">[<%=SystemEnv.getHtmlLabelName(81362,user.getLanguage())%>]</span><!-- 本部门(包含下级部门) -->
				<br/>
				<input type="checkbox" id="thisorg" name="thisorg" value="3" onclick="clickThisOrg(this)" <%if(thisorg.equals("3")){out.println("checked");}%>>
				<span style="font-size:12px;TEXT-DECORATION:none;color:<%if("3".equals(thisorg)){%>#0000FF<%}else{%>#6A9EE6<%}%>;cursor:hand" onclick="quickSearchOrg('3')">[<%=SystemEnv.getHtmlLabelName(30792,user.getLanguage())%>]</span><!-- 本分部 -->
				<input type="checkbox" id="thisorg" name="thisorg" value="4" onclick="clickThisOrg(this)" <%if(thisorg.equals("4")){out.println("checked");}%>>
				<span style="font-size:12px;TEXT-DECORATION:none;color:<%if("4".equals(thisorg)){%>#0000FF<%}else{%>#6A9EE6<%}%>;cursor:hand" onclick="quickSearchOrg('4')">[<%=SystemEnv.getHtmlLabelName(81363,user.getLanguage())%>]</span><!-- 本分部(包含下级分部) -->
			</wea:item>
		<%}%>
		<%if(isEnabled&&viewtype!=3&&!isVirtualForm){%>
			<wea:item><%=SystemEnv.getHtmlLabelName(82439,user.getLanguage())%></wea:item><!-- 数据状态 -->
			<wea:item>
				<input type="checkbox" id="enabled" name="enabled" value="1" onclick="clickEnabled(this)" <%if(enabled.equals("1")){out.println("checked");}%>>
				<span style="font-size:12px;TEXT-DECORATION:none;color:<%if("1".equals(enabled)){%>#0000FF<%}else{%>#6A9EE6<%}%>" ><%=SystemEnv.getHtmlLabelName(25426,user.getLanguage())%></span><!-- 未读 -->
				<input type="checkbox" id="enabled" name="enabled" value="2" onclick="clickEnabled(this)" <%if(enabled.equals("2")){out.println("checked");}%>>
				<span style="font-size:12px;TEXT-DECORATION:none;color:<%if("2".equals(enabled)){%>#0000FF<%}else{%>#6A9EE6<%}%>" ><%=SystemEnv.getHtmlLabelName(21950,user.getLanguage())%></span><!-- 反馈 -->
				<input type="checkbox" id="enabled" name="enabled" value="3" onclick="clickEnabled(this)" <%if(enabled.equals("3")){out.println("checked");}%>>
				<span style="font-size:12px;TEXT-DECORATION:none;color:<%if("3".equals(enabled)){%>#0000FF<%}else{%>#6A9EE6<%}%>" ><%=SystemEnv.getHtmlLabelName(25425,user.getLanguage())%></span><!-- 已读-->
			</wea:item>
		<%}%>

<%//以下开始列出自定义查询条件
sql = "select * from (select mode_CustomDspField.conditionTransition,mode_CustomDspField.queryorder ,mode_CustomDspField.showorder ,workflow_billfield.id as id"+
    		",workflow_billfield.fieldname as name,"+castSql+",workflow_billfield.fielddbtype as dbtype,workflow_billfield.selectitem as selectitem,workflow_billfield.linkfield as linkfield"+
    		",workflow_billfield.fieldhtmltype as httype,workflow_billfield.childfieldid as childfieldid, workflow_billfield.type as type,viewtype,mode_CustomDspField.shownamelabel"+
    		" from workflow_billfield,mode_CustomDspField,mode_CustomSearch"+
    		" where mode_CustomDspField.customid=mode_Customsearch.id and mode_CustomSearch.id="+StringHelper.empty2Null(customid)+" and mode_CustomDspField.isquery='1'"+
    		" and workflow_billfield.billid='"+StringHelper.empty2Null(formID)+"' and workflow_billfield.id=mode_CustomDspField.fieldid ";

sql+=" union select conditionTransition,queryorder,showorder,fieldid as id,'' as name,'' as label,'' as dbtype,0 as selectitem,0 as linkfield,'' as httype,0 as childfieldid,0 as type,0 as viewtype,shownamelabel"+
	" from mode_CustomDspField where isquery='1' and fieldid in(-1,-2,-3,-4,-5,-6,-7,-8,-9) and customid="+StringHelper.empty2Null(customid);
sql+=") a order by a.queryorder,a.showorder,a.id";
if (templateid == 0) { //如果没有模板,则获取默认模板信息
	rs.execute("select id from mode_TemplateInfo where customid="+StringHelper.empty2Null(customid)+" and isdefault=1 and sourcetype=2 and createrid='"+user.getUID()+"'");
	if (rs.next()) {
		templateid = rs.getInt("id");
	}
}
if (templateid > 0) { //如果有模板,则获取模板信息
	sql = "select workflow_billfield.id as id"+
		",workflow_billfield.fieldname as name,"+castSql+",workflow_billfield.fielddbtype as dbtype,workflow_billfield.selectitem as selectitem,workflow_billfield.linkfield as linkfield"+
		",workflow_billfield.fieldhtmltype as httype,workflow_billfield.childfieldid as childfieldid, workflow_billfield.type as type,viewtype,"+
		" topt,topt1,tvalue,tvalue1,tname,(select max(shownamelabel) from mode_CustomDspField where fieldid=workflow_billfield.id and customid=mode_TemplateInfo.customid) as shownamelabel" + 
		" from workflow_billfield,mode_TemplateDspField,mode_TemplateInfo where mode_TemplateDspField.templateid=mode_TemplateInfo.id and workflow_billfield.id=mode_TemplateDspField.fieldid and mode_TemplateInfo.customid="+StringHelper.empty2Null(customid);
		sql += " AND mode_TemplateDspField.templateid="+templateid+" order by fieldorder";
}
int i=0;
RecordSet.execute(sql);
while (RecordSet.next())
{
i++;
String name = RecordSet.getString("name");
String label = RecordSet.getString("label");
int shownamelabel = Util.getIntValue(RecordSet.getString("shownamelabel"),0);
if(shownamelabel!=0){
	label = shownamelabel+"";
}
String htmltype = RecordSet.getString("httype");
String type = RecordSet.getString("type");
String id = RecordSet.getString("id");
String dbtype = Util.null2String(RecordSet.getString("dbtype"));
int selectitem =Util.getIntValue(Util.null2String(RecordSet.getString("selectitem")),0);
int linkfield = 0;
rs.execute("select id from workflow_billfield where linkfield="+id);
if(rs.next()){
	linkfield = Util.getIntValue(rs.getString("id"), 0);
}
label = SystemEnv.getHtmlLabelName(Util.getIntValue(label),user.getLanguage());
String childfieldid = Util.null2String(RecordSet.getString("childfieldid"));
int field_viewtype=RecordSet.getInt("viewtype");

String browsertype = type;
if (type.equals("0")) browsertype = "";
String completeUrl = "javascript:getajaxurl('"+browsertype+"','"+dbtype+"','"+id+"','1')";
int conditionTransition = Util.getIntValue(Util.null2String(RecordSet.getString("conditionTransition")),0);
/*
*/
if(id.equals("-1")){
    id="_3";
    name="modedatacreatedate";
    if(shownamelabel==0){
    	label=SystemEnv.getHtmlLabelName(722,user.getLanguage());//创建日期
    }
    htmltype="3";
    type="2";
}else if(id.equals("-2")){
    id="_4";
    name="modedatacreater";
    if(shownamelabel==0){
    	label=SystemEnv.getHtmlLabelName(882,user.getLanguage());// 创建人
    }
    htmltype="3";
    type="1";
}
String namestr = "con"+id+"_value";
String display="display:'';";
if(issimple) display="display:none;";
String checkstr="checked";
String tmpvalue="";
String tmpvalue1="";
String tmpname="";
if(isresearch==1){
    tmpvalue=Util.null2String((String)conht.get("con_"+id+"_value"));
    tmpvalue1=Util.null2String((String)conht.get("con_"+id+"_value1"));
    tmpname=Util.null2String((String)conht.get("con_"+id+"_name"));
}
%>
		<wea:item><!-- 是否作为查询条件 -->
			<input type='checkbox' name='check_con' title="<%=SystemEnv.getHtmlLabelName(20778,user.getLanguage())%>" value="<%=id%>" style="display:none" <%=checkstr%>> <%=label%>
			<input type=hidden name="con<%=id%>_htmltype" value="<%=htmltype%>">
			<input type=hidden name="con<%=id%>_type" value="<%=type%>">
			<input type=hidden name="con<%=id%>_colname" value="<%=name%>">
			<input type=hidden name="con<%=id%>_viewtype" value="<%=field_viewtype%>">
		</wea:item>
		<wea:item>
<%
if("3".equals(htmltype) && !"".equals(tmpvalue)){
	FieldInfo fieldInfo = new FieldInfo();
	tmpname = fieldInfo.getFieldName(tmpvalue, Util.getIntValue(type), dbtype);
}
//=========================================================================================文本框
if((htmltype.equals("1")&& type.equals("1"))||htmltype.equals("2")){
    int tmpopt=3;
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),3);
%>
		<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
		<%if(!htmltype.equals("2")){//TD9319 屏蔽掉多行文本框的“等于”和“不等于”操作,text数据库类型不支持该判断%>
		<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(327,user.getLanguage())%></option>     <!--等于-->
		<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15506,user.getLanguage())%></option>   <!--不等于-->
		<%}%>
		<option value="3" <%if(tmpopt==3){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(346,user.getLanguage())%></option>   <!--包含-->
		<option value="4" <%if(tmpopt==4){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15507,user.getLanguage())%></option>   <!--不包含-->

		</select>
		<input type=text class=InputStyle style="width:50%" name="con<%=id%>_value" value="<%=tmpvalue%>">
		<SPAN id=remind style='cursor:hand' title='<%=SystemEnv.getHtmlLabelName(82346,user.getLanguage())%>&#10;<%=SystemEnv.getHtmlLabelName(82347,user.getLanguage())%>&#10;<%=SystemEnv.getHtmlLabelName(82348,user.getLanguage())%>&#10;<%=SystemEnv.getHtmlLabelName(82349,user.getLanguage())%>'>
		<IMG src='/images/remind_wev8.png' align=absMiddle>
		</SPAN>
<%
//=========================================================================================数字   <!--大于,大于或等于,小于,小于或等于,等于,不等于-->
}else if(htmltype.equals("1")&& !type.equals("1")){  
    int tmpopt=2;
    int tmpopt1=4;
    if(isresearch==1) {
        tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),2);
        tmpopt1=Util.getIntValue((String)conht.get("con_"+id+"_opt1"),4);
    }
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15508,user.getLanguage())%></option><!-- 大于 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(325,user.getLanguage())%></option><!-- 大于或等于 -->
<option value="3" <%if(tmpopt==3){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15509,user.getLanguage())%></option><!-- 小于 -->
<option value="4" <%if(tmpopt==4){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(326,user.getLanguage())%></option><!-- 小于或等于 -->
<option value="5" <%if(tmpopt==5){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(327,user.getLanguage())%></option><!-- 等于 -->
<option value="6" <%if(tmpopt==6){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15506,user.getLanguage())%></option><!-- 不等于 -->
</select>
<%if(issimple){%><%=SystemEnv.getHtmlLabelName(325,user.getLanguage())%><%}%>
<input type=text class=InputStyle size=10 name="con<%=id%>_value" onblur="checknumber('con<%=id%>_value');" value="<%=tmpvalue%>" style="width:75px;">
<select class=inputstyle  name="con<%=id%>_opt1" style="<%=display%>width:90"  >
<option value="1" <%if(tmpopt1==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15508,user.getLanguage())%></option><!-- 大于 -->
<option value="2" <%if(tmpopt1==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(325,user.getLanguage())%></option><!-- 大于或等于 -->
<option value="3" <%if(tmpopt1==3){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15509,user.getLanguage())%></option><!-- 小于 -->
<option value="4" <%if(tmpopt1==4){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(326,user.getLanguage())%></option><!-- 小于或等于 -->
<option value="5" <%if(tmpopt1==5){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(327,user.getLanguage())%></option><!-- 等于 -->
<option value="6" <%if(tmpopt1==6){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15506,user.getLanguage())%></option><!-- 不等于 -->
</select>
<%if(issimple){%><%=SystemEnv.getHtmlLabelName(326,user.getLanguage())%><%}%>
<input type=text class=InputStyle size=10 name="con<%=id%>_value1"  onblur="checknumber('con<%=id%>_value1');" value="<%=tmpvalue1%>" style="width:75px;">
<%
//=========================================================================================check类型
}
else if(htmltype.equals("4")){   
%>
<input type=checkbox value=1 name="con<%=id%>_value" <%if(tmpvalue.equals("1")){%>checked<%}%>>
<%
//=========================================================================================选择框	
}
else if(htmltype.equals("5")){  //
    int tmpopt=1;
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(327,user.getLanguage())%></option><!-- 等于 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15506,user.getLanguage())%></option><!-- 不等于 -->
</select>
<%


String selectchange = "";
if(!childfieldid.equals("")&&!childfieldid.equals("0")){//子字段联动
	selectchange = "changeChildField(this,'"+id+"','"+childfieldid+"');";
	initselectfield += "changeChildField(jQuery('#con"+id+"_value')[0],'"+id+"','"+childfieldid+"');";
	ldselectfieldid.add(id+"");
}
//下拉框查询条件多选
String multiselect="";
String multiselectvalue="";
if (templateid > 0) { //如果有模板,则获取模板信息
	RecordSet  multiselectRs = new RecordSet();
    multiselectRs.executeSql("select conditionTransition from mode_CustomDspField where fieldid="+id+" and customid="+StringHelper.empty2Null(customid));
	if(multiselectRs.next()){
		conditionTransition = multiselectRs.getInt("conditionTransition");
	}
}
if(conditionTransition==1){
	multiselect="multiple=\"multiple\"";
	multiselectid+="con"+id+"_value,";
	multiselectvalue = Util.null2String(conht.get("multiselectValue_con_"+id+"_value"));
}else{
	multiselectvalue = tmpvalue;
}
%>
<input type="hidden" name="multiselectValue_con<%=id%>_value" id="multiselectValue_con<%=id%>_value" value="<%=multiselectvalue %>" />
<select notBeauty=true class=inputstyle <%=multiselect %> value="<%=multiselectvalue %>"  name="con<%=id%>_value" id="con<%=id%>_value"  onchange="<%=selectchange%>;change_multiselectValue_con_value('<%=id%>',this.value)" >
<%
if(conditionTransition!=1){
 %>
<option value="" ></option>
<%
}
char flag=2;
rs.executeProc("workflow_SelectItemSelectByid",""+id+flag+isbill);
while(rs.next()){
	int tmpselectvalue = rs.getInt("selectvalue");
	String tmpselectname = rs.getString("selectname");
	String tempcancel = rs.getString("cancel");
	if("1".equals(tempcancel)){
		continue;
	}
%>
<option value="<%=tmpselectvalue%>" <%if (tmpvalue.equals(""+tmpselectvalue)) {%>selected<%}%>><%=Util.toScreen(tmpselectname,user.getLanguage())%></option>
<%} %>
</select>

<%
//=========================================================================================浏览框单人力资源  条件为多人力 (like not lik)
} else if(htmltype.equals("3") && type.equals("1")){////浏览框单人力资源 
    int tmpopt=1;
    //String browserOnClick = "onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp')";
    String browserUrl = "/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90">
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18987,user.getLanguage())%></option><!-- 被包含于 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18988,user.getLanguage())%></option><!-- 不被包含于 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
//=========================================================================================浏览框单文挡  条件为多文挡 (like not lik)
} else if(htmltype.equals("3") && type.equals("9")){//浏览框单文挡  
    int tmpopt=1;
    //String browserOnClick = "onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/docs/docs/DocBrowser.jsp')";
    String browserUrl = "/systeminfo/BrowserMain.jsp?url=/docs/docs/DocBrowser.jsp";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18987,user.getLanguage())%></option><!-- 被包含于 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18988,user.getLanguage())%></option><!-- 不被包含于 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
//=========================================================================================
} else if(htmltype.equals("3") && type.equals("4")){//浏览框单部门 
    int tmpopt=1;
    //String browserOnClick = "onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp')";
    String browserUrl = "/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18987,user.getLanguage())%></option><!-- 被包含于 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18988,user.getLanguage())%></option><!-- 不被包含于 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
	<%
	
//=========================================================================================
} else if(htmltype.equals("3") && type.equals("7")){//浏览框单客户 
        int tmpopt=1;
        //String browserOnClick = "onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/CRM/data/CustomerBrowser.jsp')";
        String browserUrl = "/systeminfo/BrowserMain.jsp?url=/CRM/data/CustomerBrowser.jsp";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90"  >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18987,user.getLanguage())%></option><!-- 被包含于 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18988,user.getLanguage())%></option><!-- 不被包含于 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
//=========================================================================================	
} else if(htmltype.equals("3") && type.equals("8")){//浏览框单项目
    int tmpopt=1;
    //String browserOnClick="onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/proj/data/ProjectBrowser.jsp')";
    String browserUrl = "/systeminfo/BrowserMain.jsp?url=/proj/data/ProjectBrowser.jsp";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18987,user.getLanguage())%></option><!-- 被包含于 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18988,user.getLanguage())%></option><!-- 不被包含于 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
	
//=========================================================================================
} else if(htmltype.equals("3") && type.equals("16")){//浏览框单请求
    int tmpopt=1;
    //String browserOnClick="onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/workflow/request/RequestBrowser.jsp')";
    String browserUrl = "/systeminfo/BrowserMain.jsp?url=/workflow/request/RequestBrowser.jsp";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18987,user.getLanguage())%></option><!-- 被包含于 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18988,user.getLanguage())%></option><!-- 不被包含于 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
	
//=========================================================================================
}else if(htmltype.equals("3") && type.equals("24")){//职位
    int tmpopt=5;
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="5" <%if(tmpopt==5){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18987,user.getLanguage())%></option><!-- 被包含于 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(18988,user.getLanguage())%></option><!-- 不被包含于 -->
</select>
<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='/systeminfo/BrowserMain.jsp?url=/hrm/jobtitles/JobTitlesBrowser.jsp'
	hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
//=========================================================================================	
}//职位end

else if(htmltype.equals("3") &&( type.equals("2") || type.equals("19"))){    //日期
	
	int tmpopt=2;
    int tmpopt1=4;
    String classStr = "";
	if(type.equals("2")){ //日期
		display = "display:none;";
		String datetype_opt_span_display = "display:none;";
		classStr = "calendar";
		int datetype_opt = Util.getIntValue(Util.null2String(request.getParameter("datetype_"+id+"_opt")),0);
		if(datetype_opt==0){
			datetype_opt = Util.getIntValue(Util.null2String((String)conht.get("datetype_"+id+"_opt")),6);
		}
		if(datetype_opt == 6){
			datetype_opt_span_display = "display:inline;";
		}
		%>
		<select name="datetype_<%=id%>_opt" id="datetype_<%=id%>_opt" style="display: block;" onchange="changeDateType(this,'datetype_<%=id%>_opt_span','con<%=id%>_value','con<%=id%>_valuespan','con<%=id%>_value1','con<%=id%>_value1span')">
		<option value="1" <%if(datetype_opt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15537,user.getLanguage())%></option><!-- 今天 -->
		<option value="2" <%if(datetype_opt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15539,user.getLanguage())%></option><!-- 本周 -->
		<option value="3" <%if(datetype_opt==3){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15541,user.getLanguage())%></option><!-- 本月 -->
		<option value="7" <%if(datetype_opt==7){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(27347,user.getLanguage())%></option><!-- 上个月 -->
		<option value="4" <%if(datetype_opt==4){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(21904,user.getLanguage())%></option><!-- 本季 -->
		<option value="5" <%if(datetype_opt==5){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15384,user.getLanguage())%></option><!-- 本年 -->
		<option value="8" <%if(datetype_opt==8){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(31276,user.getLanguage())+SystemEnv.getHtmlLabelName(25201,user.getLanguage())%></option><!-- 上一年 -->
		<option value="6" <%if(datetype_opt==6){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(32530,user.getLanguage())%></option><!-- 指定日期范围 -->
		</select>
		<span name="datetype_<%=id%>_opt_span" id="datetype_<%=id%>_opt_span" style="<%=datetype_opt_span_display%>">
			<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90">
			<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15508,user.getLanguage())%></option><!-- 大于 -->
			<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(325,user.getLanguage())%></option><!-- 大于或等于 -->
			<option value="3" <%if(tmpopt==3){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15509,user.getLanguage())%></option><!-- 小于 -->
			<option value="4" <%if(tmpopt==4){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(326,user.getLanguage())%></option><!-- 小于或等于 -->
			<option value="5" <%if(tmpopt==5){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(327,user.getLanguage())%></option><!-- 等于 -->
			<option value="6" <%if(tmpopt==6){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15506,user.getLanguage())%></option><!-- 不等于 -->
			</select>
			<%if(issimple){%><%=SystemEnv.getHtmlLabelName(348,user.getLanguage())%><%}%><!-- 从 -->
			<button type=button  class="<%=classStr %>" onclick="onSearchWFQTDate(con<%=id%>_valuespan,con<%=id%>_value,con<%=id%>_value1)" ></button>
			<input type=hidden name="con<%=id%>_value" id="con<%=id%>_value" value="<%=tmpvalue%>">
			<span name="con<%=id%>_valuespan" id="con<%=id%>_valuespan"><%=tmpvalue%></span>
			<select class=inputstyle  name="con<%=id%>_opt1" style="<%=display%>width:90"  >
			<option value="1" <%if(tmpopt1==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15508,user.getLanguage())%></option><!-- 大于 -->
			<option value="2" <%if(tmpopt1==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(325,user.getLanguage())%></option><!-- 大于或等于 -->
			<option value="3" <%if(tmpopt1==3){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15509,user.getLanguage())%></option><!-- 小于 -->
			<option value="4" <%if(tmpopt1==4){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(326,user.getLanguage())%></option><!-- 小于或等于 -->
			<option value="5" <%if(tmpopt1==5){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(327,user.getLanguage())%></option><!-- 等于 -->
			<option value="6" <%if(tmpopt1==6){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15506,user.getLanguage())%></option><!-- 不等于 -->
			</select>
			<%if(issimple){%><%=SystemEnv.getHtmlLabelName(349,user.getLanguage())%><%}%><!-- 到 -->
			<button type=button  class="<%=classStr %>" onclick="onSearchWFQTDate(con<%=id%>_value1span,con<%=id%>_value1,con<%=id%>_value)" ></button>
			<input type=hidden name="con<%=id%>_value1" id="con<%=id%>_value1" value="<%=tmpvalue1%>">
			<span name="con<%=id%>_value1span" id="con<%=id%>_value1span"><%=tmpvalue1%></span>
		</span>
		<%
	}else{ //时间
		if(isresearch==1) {
	        tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),2);
	        tmpopt1=Util.getIntValue((String)conht.get("con_"+id+"_opt1"),4);
	    }
		classStr = "Clock";
		%>
		<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90">
		<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15508,user.getLanguage())%></option><!-- 大于 -->
		<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(325,user.getLanguage())%></option><!-- 大于或等于 -->
		<option value="3" <%if(tmpopt==3){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15509,user.getLanguage())%></option><!-- 小于 -->
		<option value="4" <%if(tmpopt==4){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(326,user.getLanguage())%></option><!-- 小于或等于 -->
		<option value="5" <%if(tmpopt==5){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(327,user.getLanguage())%></option><!-- 等于 -->
		<option value="6" <%if(tmpopt==6){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15506,user.getLanguage())%></option><!-- 不等于 -->
		</select>
		<%if(issimple){%><%=SystemEnv.getHtmlLabelName(348,user.getLanguage())%><%}%><!-- 从 -->
		<button type=button  class="<%=classStr %>" onclick ="onSearchWFQTTime(con<%=id%>_valuespan,con<%=id%>_value,con<%=id%>_value1)" ></button>
		<input type=hidden name="con<%=id%>_value" id="con<%=id%>_value" value="<%=tmpvalue%>">
		<span name="con<%=id%>_valuespan" id="con<%=id%>_valuespan"><%=tmpvalue%></span>
		<select class=inputstyle  name="con<%=id%>_opt1" style="<%=display%>width:90"  >
		<option value="1" <%if(tmpopt1==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15508,user.getLanguage())%></option><!-- 大于 -->
		<option value="2" <%if(tmpopt1==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(325,user.getLanguage())%></option><!-- 大于或等于 -->
		<option value="3" <%if(tmpopt1==3){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15509,user.getLanguage())%></option><!-- 小于 -->
		<option value="4" <%if(tmpopt1==4){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(326,user.getLanguage())%></option><!-- 小于或等于 -->
		<option value="5" <%if(tmpopt1==5){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(327,user.getLanguage())%></option><!-- 等于 -->
		<option value="6" <%if(tmpopt1==6){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15506,user.getLanguage())%></option><!-- 不等于 -->
		</select>
		<%if(issimple){%><%=SystemEnv.getHtmlLabelName(349,user.getLanguage())%><%}%><!-- 到 -->
		<button type=button  class="<%=classStr %>" onclick ="onSearchWFQTTime(con<%=id%>_value1span,con<%=id%>_value1,con<%=id%>_value)" ></button>
		<input type=hidden name="con<%=id%>_value1" id="con<%=id%>_value1" value="<%=tmpvalue1%>">
		<span name="con<%=id%>_value1span" id="con<%=id%>_value1span"><%=tmpvalue1%></span>
		<%
	}

//=========================================================================================	
} else if(htmltype.equals("3") && type.equals("17")){ //人力资源 多选框
    int tmpopt=1;
    String browserOnClick="onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/hrm/resource/MutiResourceBrowser.jsp')";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(346,user.getLanguage())%></option><!-- 包含 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15507,user.getLanguage())%></option><!-- 不包含 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/resource/MutiResourceBrowser.jsp"
	hasInput="true" isSingle="false" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
//=========================================================================================	
} else if(htmltype.equals("3") && type.equals("37")){//浏览框 (多文挡)
    int tmpopt=1;
    //String browserOnClick="onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/docs/docs/MutiDocBrowser.jsp?isworkflow=1')";
    String browserUrl = "/systeminfo/BrowserMain.jsp?url=/docs/docs/MutiDocBrowser.jsp?isworkflow=1";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(346,user.getLanguage())%></option><!-- 包含 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15507,user.getLanguage())%></option><!-- 不包含 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="false" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
//=========================================================================================	
} else if(htmltype.equals("3") && type.equals("57")){//浏览框(多部门)
    int tmpopt=1;
    //String browserOnClick="onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/hrm/company/MultiDepartmentBrowserByOrder.jsp')";
    String browserUrl = "/systeminfo/BrowserMain.jsp?url=/hrm/company/MultiDepartmentBrowserByOrder.jsp";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(346,user.getLanguage())%></option><!-- 包含 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15507,user.getLanguage())%></option><!-- 不包含 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="false" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
//=========================================================================================	
} else if(htmltype.equals("3") && type.equals("135")){//浏览框(多项目 )
    int tmpopt=1;
    //String browserOnClick="onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/proj/data/MultiProjectBrowser.jsp')";
    String browserUrl = "/systeminfo/BrowserMain.jsp?url=/proj/data/MultiProjectBrowser.jsp";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(346,user.getLanguage())%></option><!-- 包含 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15507,user.getLanguage())%></option><!-- 不包含 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="false" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
//=========================================================================================	
} else if(htmltype.equals("3") && type.equals("152")){//浏览框(多请求 )
    int tmpopt=1;
    //String browserOnClick="onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/workflow/request/MultiRequestBrowser.jsp')";
    String browserUrl = "/systeminfo/BrowserMain.jsp?url=/workflow/request/MultiRequestBrowser.jsp";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(346,user.getLanguage())%></option><!-- 包含 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15507,user.getLanguage())%></option><!-- 不包含 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="false" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
//=========================================================================================	
} else if(htmltype.equals("3") && type.equals("18")){//浏览框  多选筐条件为单选筐
    int tmpopt=1;
    //String browserOnClick="onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/CRM/data/MutiCustomerBrowser.jsp')";
    String browserUrl = "/systeminfo/BrowserMain.jsp?url=/CRM/data/MutiCustomerBrowser.jsp";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(346,user.getLanguage())%></option><!-- 包含 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15507,user.getLanguage())%></option><!-- 不包含 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
//=========================================================================================	
}
else if(htmltype.equals("3") && type.equals("160")){//浏览框  多选筐条件为单选筐
    int tmpopt=1;
    //String browserOnClick="onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp')";
    String browserUrl = "/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90"  >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(346,user.getLanguage())%></option><!-- 包含 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15507,user.getLanguage())%></option><!-- 不包含 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>'
	_callback="change_con_name"
	_callbackParams="<%=id%>" 
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
//=========================================================================================	
} else if(htmltype.equals("3") && type.equals("142")){//浏览框多收发文单位
String urls = "/systeminfo/BrowserMain.jsp?url=/docs/sendDoc/DocReceiveUnitBrowserMulti.jsp?selectids=";
    int tmpopt=1;
    //String browserOnClick="onShowBrowser('"+id+"','"+urls+"')";
    String browserUrl = urls;
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(327,user.getLanguage())%></option><!-- 等于 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15506,user.getLanguage())%></option><!-- 不等于 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="false" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px"
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
//=========================================================================================	
}
else if(htmltype.equals("3") && (type.equals("56")||type.equals("27")||type.equals("118")||type.equals("65")||type.equals("64")||type.equals("137"))){//浏览框
String urls=BrowserComInfo.getBrowserurl(type);     // 浏览按钮弹出页面的url
    int tmpopt=1;
    //String browserOnClick="onShowBrowser('"+id+"','"+urls+"')";
    String browserUrl = urls;
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90"  >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(346,user.getLanguage())%></option><!-- 包含 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15507,user.getLanguage())%></option><!-- 不包含 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= browserUrl %>'
	hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%
//=========================================================================================	
}else if("3".equals(htmltype) && "141".equals(type)){
	String url = "/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceConditionBrowser.jsp";
	String browserOnClick = "onShowResourceConditionBrowserForCondition('"+namestr+"','"+url+"','','141',0)";
    int tmpopt=1;
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
	%>
	<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90"  >
	<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(346,user.getLanguage())%></option><!-- 包含 -->
	<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15507,user.getLanguage())%></option><!-- 不包含 -->
	</select>
	<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
		_callback="change_con_name"
		_callbackParams="<%=id%>"
		browserOnClick='<%=browserOnClick%>'
		hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
		completeUrl='<%=completeUrl%>' width="135px" 
		browserSpanValue='<%=tmpname%>'>
	</brow:browser>
	<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
	<%
}
else if(htmltype.equals("3") && id.equals("_5")){//工作流浏览框
    tmpname="";
    ArrayList tempvalues=Util.TokenizerString(tmpvalue,",");
    for(int k=0;k<tempvalues.size();k++){
        if(tmpname.equals("")){
            tmpname=WorkflowComInfo.getWorkflowname((String)tempvalues.get(k));
        }else{
            tmpname+=","+WorkflowComInfo.getWorkflowname((String)tempvalues.get(k));
        }
    }
%>
<input type=hidden  name="con<%=id%>_opt" value="1">
<%if(customid.equals("")){
String browserOnClick="onShowWorkFlowSerach('workflowid','workflowspan')";
%>
<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	browserOnClick='<%=browserOnClick%>'
	hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<span id=workflowspan></span>
<%}else{
String browserOnClick="onShowCQWorkFlow('con"+id+"_value','con"+id+"_valuespan')";
%>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserOnClick='<%=browserOnClick%>'
	hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%}%>
<%
//=========================================================================================	
} else if (htmltype.equals("3") && (type.equals("161") || type.equals("162") || type.equals("278"))){
	String urls=BrowserComInfo.getBrowserurl(type)+"?type="+dbtype;     // 浏览按钮弹出页面的url
	String browserOnClick = "onShowBrowserCustomNew('"+id+"','"+urls+"','"+type+"')";
	String method2 = "setName('"+id+"')";
    int tmpopt=1;
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
    String isSignle = "true";
    String width = "135px";
    if (type.equals("162")) {
    	isSignle = "false";
    	width = "270px";
    }
    try{
	    Browser browser=(Browser)StaticObj.getServiceByFullname(dbtype, Browser.class);
	    if(!tmpvalue.equals("")){
		    tmpname = "";
		    String[] tmpvalueArr = tmpvalue.split(",");
		    for(int m=0;m<tmpvalueArr.length;m++){
		    	if(!tmpvalueArr[m].equals("")){
			    	BrowserBean bb=browser.searchById(tmpvalueArr[m]);
					String tname=Util.null2String(bb.getName());
					String href=Util.null2String(bb.getHref());
					String hrefStr="";
					if(!href.equals("")){
						hrefStr="href='"+href+"' target='_blank'";
					}
					tmpname += "<a "+hrefStr+">"+tname+"</a>&nbsp;&nbsp;";
		    	}
		    }
	    }
    }catch(Exception e){}
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(327,user.getLanguage())%></option><!-- 等于 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15506,user.getLanguage())%></option><!-- 不等于 -->
</select>
<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserOnClick='<%=browserOnClick %>' browserUrl='<%=urls%>' onPropertyChange='<%=method2%>' 
	hasInput="true" isSingle='<%=isSignle%>' hasBrowser="true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width='<%=width%>' 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value=''>
<%
//=========================================================================================	
}  else if (htmltype.equals("3") && (type.equals("256") || type.equals("257"))){
	String urls=BrowserComInfo.getBrowserurl(type)+"?type="+dbtype+"_"+type;     // 浏览按钮弹出页面的url
    int tmpopt=1;
	String isSingle = "";
    String browserOnClick="onShowBrowserCustomNew('"+id+"','"+urls+"','"+type+"')";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
    if(type.equals("256")){
    	isSingle = "true";
    }else{
    	isSingle = "false";
    }
    CustomTreeUtil customTreeUtil = new CustomTreeUtil();
    tmpname = customTreeUtil.getTreeFieldShowName(tmpvalue,dbtype);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(327,user.getLanguage())%></option><!-- 等于 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15506,user.getLanguage())%></option><!-- 不等于 -->
</select>
<brow:browser viewType="0" name="<%=namestr%>" browserValue="<%=tmpvalue %>" 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserOnClick='<%=browserOnClick %>' browserUrl='<%=urls%>' nameSplitFlag="&nbsp"
	hasInput="true" isSingle="<%=isSingle%>" hasBrowser = "true" isMustInput='1'
	completeUrl="<%=completeUrl%>" width="135px" 
	browserSpanValue="<%=tmpname%>">
</brow:browser>
<input type=hidden name="con<%=id%>_name" value=''>
<%} else if (htmltype.equals("3")){
	String urls=BrowserComInfo.getBrowserurl(type);     // 浏览按钮弹出页面的url
	String sapbrowser_name = "";
	if(type.equals("224") || type.equals("225")||type.equals("226") || type.equals("227")){
		urls += "?type="+dbtype+"|"+id;
		sapbrowser_name = "sapbrowser_name";
	}
    int tmpopt=1;
    String browserOnClick="onShowBrowser('"+id+"','"+urls+"')";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90" >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(327,user.getLanguage())%></option><!-- 等于 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15506,user.getLanguage())%></option><!-- 不等于 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserUrl='<%= urls %>'
	hasInput="true" isSingle='<%=type.equals("194")?"false":"true" %>' hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" class="<%=sapbrowser_name %>" cid='<%=id %>' value='<%=tmpname%>'>
<%
//=========================================================================================	
} else if (htmltype.equals("6")){   //附件上传同多文挡
	String urls=BrowserComInfo.getBrowserurl(type);     // 浏览按钮弹出页面的url
    int tmpopt=1;
    String browserOnClick="onShowBrowser('"+id+"','/systeminfo/BrowserMain.jsp?url=/docs/docs/DocBrowser.jsp?isworkflow=1')";
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
%>
<select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90"   >
<option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(346,user.getLanguage())%></option><!-- 包含 -->
<option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15507,user.getLanguage())%></option><!-- 不包含 -->
</select>

<brow:browser viewType="0" name='<%=namestr%>' browserValue='<%=tmpvalue %>' 
	_callback="change_con_name"
	_callbackParams="<%=id%>"
	browserOnClick='<%=browserOnClick%>'
	hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
	completeUrl='<%=completeUrl%>' width="135px" 
	browserSpanValue='<%=tmpname%>'>
</brow:browser>
<input type=hidden name="con<%=id%>_name" value='<%=tmpname%>'>
<%}else if (htmltype.equals("8")){
	int tmpopt=1;
    if(isresearch==1) tmpopt=Util.getIntValue((String)conht.get("con_"+id+"_opt"),1);
    %>
    <select class=inputstyle  name="con<%=id%>_opt" style="<%=display%>width:90"  >
    <option value="1" <%if(tmpopt==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(327,user.getLanguage())%></option><!-- 等于 -->
    <option value="2" <%if(tmpopt==2){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15506,user.getLanguage())%></option><!-- 不等于 -->
    </select>
    <%
    String selectchange = "";
    if(linkfield!=0){//公共子字段联动
    	if(!iframeList.contains(id)){
    		iframeList.add(id);
    	}
    	selectchange = "changeChildSelectItemField(this,'"+id+"','"+linkfield+"');";
   	  	int selflinkfieldid = 1;
   		String selfSql = "select linkfield from workflow_billfield where id="+id;
   		selectRs.executeSql(selfSql);
   		if(selectRs.next()){
   			selflinkfieldid = selectRs.getInt("linkfield");
   			if(selflinkfieldid<1){
		    	initselectfield += "changeChildSelectItemField(0,'"+id+"','"+linkfield+"',1); \n ";
   			} 
   		}
    }
  
	
    %>
    <select initvalue="<%=tmpvalue %>" childsel="<%=linkfield %>" notBeauty=true class=inputstyle style="width:175px;"  name="con<%=id%>_value" id="con<%=id%>_value"  onchange="<%=selectchange%>" >
    <option value="" ></option>
   <%
	char flag=2;
	rs.executeSql("select id,name,defaultvalue from mode_selectitempagedetail where mainid = "+selectitem+" and statelev = 1  and (cancel=0 or cancel is null)  order by disorder asc,id asc");
	while(rs.next()){
		int tmpselectvalue = rs.getInt("id");
		String tmpselectname = rs.getString("name");
		String isdefault = rs.getString("defaultvalue");
		%>
		<option value="<%=tmpselectvalue%>" <%if (tmpvalue.equals(""+tmpselectvalue)) {%>selected<%}%>><%=Util.toScreen(tmpselectname,user.getLanguage())%></option>
		<%
	}%>
	</select>
	<%
}%>
</wea:item>
<%}%>
	</wea:group>
	<wea:group context="">
		<wea:item type="toolbar"><!-- 搜索 -->
			<input type="submit" class="e8_btn_submit" value="<%=SystemEnv.getHtmlLabelName(197,user.getLanguage())%>" id="searchBtn" onclick="setSearchName(parent)"/>
			<!-- 重置 -->
			<input type="button" value="<%=SystemEnv.getHtmlLabelName(2022,user.getLanguage())%>" class="e8_btn_cancel" onclick="clearSearchName();resetSearch();resetMultiselect();resetDate();"/>
			<% if (templateid > 0) { %>
				<!-- 保存 -->
				<input type="button" value="<%=SystemEnv.getHtmlLabelName(86,user.getLanguage())%>"" class="e8_btn_cancel" onclick="onSaveTempalte2();"/>
			<% } else { %>
				<!-- 存为模板 -->
				<input type="button" value="<%=SystemEnv.getHtmlLabelName(18418,user.getLanguage())%>"" class="e8_btn_cancel" onclick="onSaveTempalte();"/>
			<% } %>
			<!-- 取消 -->
			<input type="button" value="<%=SystemEnv.getHtmlLabelName(201,user.getLanguage())%>" class="e8_btn_cancel" id="cancel"/>
		</wea:item>
	</wea:group>
</wea:layout>
<%for(int i=0;i<iframeList.size();i++){%>
<iframe id="selectChange_<%=iframeList.get(i) %>" frameborder=0 scrolling=no src=""  style="display:none"></iframe>
<%} %>
<%for(int i=0;i<ldselectfieldid.size();i++){%>
<iframe id="selectChange_<%=ldselectfieldid.get(i) %>" frameborder=0 scrolling=no src=""  style="display:none"></iframe>
<%} %>
</form>
</div>
<div>
  <input id="formmodeFlag" name="formmodeFlag" type="hidden" value="1">
</div>

<!-- 显示查询结果 -->    
<div id="splitPageContiner">  
<input type="hidden" name="pageWidthUnit" id="pageWidthUnit" value="px"/>
<input type="hidden" name="pageWidth" id="pageWidth" value=""/> 
<input type="hidden" name="pageId" id="pageId" value="mode_customsearch:<%=customid %>" _showCol="false"/>   
<%
String tableString = "";
if(perpage <1) perpage=10;
String backfields = " t1.id,t1.formmodeid,t1.modedatacreater,t1.modedatacreatertype,t1.modedatacreatedate,t1.modedatacreatetime ";
//判断表单中是否有创建人、创建日期字段。(流程表)
if(isVirtualForm){
	RecordSet.executeSql("select * from "+VirtualFormHandler.getRealFromName(tablename)+" where 1=2",vdatasource);
}else{
	RecordSet.executeSql("select * from "+tablename+" where 1=2");	
}
String colfieldname[] =RecordSet.getColumnName();
if(!StringHelper.containsIgnoreCase(colfieldname, "modedatacreater")&&!StringHelper.containsIgnoreCase(colfieldname, "modedatacreatedate")){
	backfields = " t1.id ";
}
if(!"".equals(detailtable)){
	backfields+=","+detailtableAlias+".id as "+detailfieldAlias+"id";
}
if(isVirtualForm){	//虚拟表单
	backfields = " t1." + vprimarykey + " ";
}
//加上自定以字段
String showfield="";
//加入设置了列自定义过滤
String columnMakeSql = ""; String columnMakeSql1 = ""; String columnMakeSql2 = "";
List<Map<String,String>> user_col_list = ShowColUtil.getUserDefaultColList("mode_customsearch:"+customid, user);
RecordSet colrs = new RecordSet();
colrs.executeSql("select id,fieldname,detailtable from workflow_billfield where billid="+StringHelper.empty2Null(formID)+" and (detailtable is null or detailtable ='' or detailtable ='"+detailtable+"')");
Map<String,Integer> _col_map = new HashMap<String,Integer>();
Map<Integer,String> col_map = new HashMap<Integer,String>();
while(colrs.next()){
	if(!"".equals(colrs.getString(3))){
		_col_map.put("d_"+colrs.getString(2),colrs.getInt(1));
		col_map.put(colrs.getInt(1),"d_"+colrs.getString(2));
	}else{
		_col_map.put(colrs.getString(2),colrs.getInt(1));
		col_map.put(colrs.getInt(1),colrs.getString(2));
	}
}
boolean is_user_column = false;
if(user_col_list!=null&&user_col_list.size()>0){
	is_user_column = true;
	col_map.clear();
	for(Map<String,String> user_col : user_col_list){
		String user_column_name = user_col.get("column");
		if(_col_map.containsKey(user_column_name)){
			col_map.put(_col_map.get(user_column_name), user_column_name);
		}else{
			if(user_column_name.equals("modedatacreater")){
				col_map.put(-2, user_column_name);
			}else if(user_column_name.equals("modedatacreatedate")){
				col_map.put(-1, user_column_name);
			}else if(user_column_name.equals("id")){
				col_map.put(-3, user_column_name);
			}
		}
	}
}
sql = "select isorder,ColWidth,workflow_billfield.id as id,workflow_billfield.fieldname as name,workflow_billfield.fieldlabel as label"+
		",workflow_billfield.fielddbtype as dbtype ,workflow_billfield.fieldhtmltype as httype, workflow_billfield.type as type,workflow_billfield.qfws as qfws"+
		",Mode_CustomDspField.showorder,Mode_CustomDspField.istitle,Mode_CustomDspField.isstat,Mode_CustomDspField.showmethod"+
		",viewtype,workflow_billfield.detailtable,Mode_CustomDspField.ismaplocation,Mode_CustomDspField.shownamelabel,Mode_CustomDspField.editable" +
		" from workflow_billfield,Mode_CustomDspField,Mode_CustomSearch "+
		" where Mode_CustomDspField.customid=Mode_CustomSearch.id and Mode_CustomSearch.id="+StringHelper.empty2Null(customid)+
		" and Mode_CustomDspField.isshow='1' and workflow_billfield.billid="+StringHelper.empty2Null(formID)+"  and   workflow_billfield.id=Mode_CustomDspField.fieldid" +
		" union select isorder,ColWidth,Mode_CustomDspField.fieldid as id,'1' as name,2 as label,'3' as dbtype, '4' as httype,5 as type,'6' as qfws "+
		",Mode_CustomDspField.showorder,Mode_CustomDspField.istitle,Mode_CustomDspField.isstat,Mode_CustomDspField.showmethod" +
		",0 as viewtype,'' as detailtable,Mode_CustomDspField.ismaplocation,Mode_CustomDspField.shownamelabel,Mode_CustomDspField.editable"+
		" from Mode_CustomDspField ,Mode_CustomSearch"+
		" where Mode_CustomDspField.customid=Mode_CustomSearch.id and Mode_CustomSearch.id="+StringHelper.empty2Null(customid)+
		" and Mode_CustomDspField.isshow='1'  and Mode_CustomDspField.fieldid<0" +
		" order by showorder,id asc";
RecordSet.execute(sql);
int real_col_count = 0;
while (RecordSet.next()){
	int col_id = RecordSet.getInt("id");
	if(col_map.containsKey(col_id)||!is_user_column){
		real_col_count ++;
	}
	if (RecordSet.getInt("id")>0){
		String tempname=Util.null2String(RecordSet.getString("name"));
		String dbtype=Util.null2String(RecordSet.getString("dbtype"));
		String fieldAlias=tempname;
		String tableAlias=maintableAlias;
		int field_viewtype=RecordSet.getInt("viewtype");
		if(field_viewtype==1){
			tableAlias=detailtableAlias;
			fieldAlias=detailfieldAlias+tempname;
		}
		String showfield_tmp=","+showfield.toLowerCase()+",";
		String currfield_tmp=","+tableAlias+"."+tempname.toLowerCase()+",";
		String backfield_tmp=","+backfields.trim().toLowerCase()+",";
		if(showfield_tmp.indexOf(currfield_tmp)>-1||backfield_tmp.indexOf(currfield_tmp)>-1)continue;
		
		if(dbtype.toLowerCase().equals("text")){
			if(vdatasourceDBtype.equals("oracle")){
				showfield=showfield+","+"to_char("+tableAlias+"."+tempname+") as "+fieldAlias;
			}else if(vdatasourceDBtype.equals("mysql")){
				showfield=showfield+","+"CONCAT("+tableAlias+"."+tempname+",'') as "+fieldAlias;
			}else{
				showfield=showfield+","+"convert(varchar(4000),"+tableAlias+"."+tempname+") as "+fieldAlias;
			}
		}else{
			if(field_viewtype==1){
				showfield=showfield+","+tableAlias+"."+tempname+" as "+fieldAlias;
			}else{
				showfield=showfield+","+tableAlias+"."+tempname;
			}
		}
	}
}
RecordSet.beforFirst();
backfields=backfields+showfield;


List<User> lsUser = ModeRightInfo.getAllUserCountList(user);
//未配置模块时重新解析权限
String rightsql = "";
if(!isVirtualForm){
	if(formmodeid.equals("")||formmodeid.equals("0")){//查询中没有设置模块
		String sqlStr1 = "select id,modename from modeinfo where formid="+formID+" order by id";
		rsm.executeSql(sqlStr1);
		while(rsm.next()){
			String mid = rsm.getString("id");
			ModeShareManager.setModeId(Util.getIntValue(mid,0));
			for(int i=0;i<lsUser.size();i++){
				User tempUser = lsUser.get(i);
				String tempRightStr = ModeShareManager.getShareDetailTableByUser("formmode",tempUser);
				if(rightsql.isEmpty()){
					rightsql += tempRightStr;
				}else {
					rightsql += " union  all "+ tempRightStr;
				}
			}
		}
		if(!rightsql.isEmpty()){
			rightsql = " (SELECT  sourceid,MAX(sharelevel) AS sharelevel from ( "+rightsql+" ) temptable group by temptable.sourceid) ";
		}
	}else{
		ModeShareManager.setModeId(Util.getIntValue(formmodeid,0));
		for(int i=0;i<lsUser.size();i++){
			User tempUser = (User)lsUser.get(i);
			String tempRightStr = ModeShareManager.getShareDetailTableByUser("formmode",tempUser);
			if(rightsql.isEmpty()){
				rightsql += tempRightStr;
			}else {
				rightsql += " union  all "+ tempRightStr;
			}
		}
		if(!rightsql.isEmpty()){
			rightsql = " (SELECT  sourceid,MAX(sharelevel) AS sharelevel from ( "+rightsql+" ) temptable group by temptable.sourceid) ";
		}
	}
}
String fromSql = "";
if(isVirtualForm){
	fromSql = " from "+VirtualFormHandler.getRealFromName(tablename)+" t1 " ;
}else{
	fromSql = " from "+tablename+" t1 " ;
}

if(!"".equals(detailtable)){
	fromSql+=" left join "+detailtable+" "+detailtableAlias+" on t1.id="+detailtableAlias+"."+detailkeyfield+" ";
}

if(viewtype!=3&&!norightlist.equals("1")&&!isVirtualForm){//不是监控、无权限列表、不是虚拟表单
	fromSql  = fromSql+","+rightsql+" t2 " ;
    sqlwhere += " and t1.id = t2.sourceid ";
    
    if(isBatchEditPage){
		sqlwhere += " and t2.sharelevel>1 ";
	}
}

if(!quickSql.equals("")){//快捷搜索,如果快捷搜索不为空
	if(sqlwhere.equals("")){
		sqlwhere = " 1=1 " + quickSql;
	}else{
		sqlwhere += quickSql;
	}
}

String sqlCondition = "";
if(searchconditiontype.equals("2")){	//java file
	if(!javafilename.equals("")){
		Map<String, String> sourceCodePackageNameMap = CommonConstant.SOURCECODE_PACKAGENAME_MAP;
		String sourceCodePackageName = sourceCodePackageNameMap.get("2");
		String classFullName = sourceCodePackageName + "." + javafilename;
		
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("user", user);
		
		Object result = CustomJavaCodeRun.run(classFullName, param);
		sqlCondition = Util.null2String(result);
	}
}else{
	sqlCondition = defaultsql;
}
if(!sqlCondition.equals("")){//默认搜索
	sqlCondition = "(" + sqlCondition + ")";
	if(sqlwhere.equals("")){
		sqlwhere = sqlCondition;
	}else{
		sqlwhere += " and "+sqlCondition;
	}
}

if(!quicksqlwhere.equals("")){//如果有关键字,则按关键字过滤
	if (sqlwhere.equals("")) {
		sqlwhere = quicksqlwhere;
	} else {
		sqlwhere += " and " + quicksqlwhere;
	}
}

if(splitIndex==-1){//未把treesqlwhere转换
    String[] sqlWhereArray =  treesqlwhere.split("and");
    for(int m=0;m<sqlWhereArray.length;m++){
	if(!treesqlwhere.equals("")){//来自树形关联字段
		int index1 = sqlWhereArray[m].indexOf("=");
		if(index1!=-1){
			String val = sqlWhereArray[m].substring(index1+1);
			val = "'"+val+"'";
			sqlWhereArray[m] = sqlWhereArray[m].substring(0,index1);
			sqlWhereArray[m] = " t1."+sqlWhereArray[m]+" = "+val;
		}
		if(sqlwhere.equals("")){
			sqlwhere = "" + sqlWhereArray[m];
		}else{
			sqlwhere += " and "+sqlWhereArray[m]+" ";
		}
	}
    }
}
if(!treesqlwhere1.equals("")){
	if(sqlwhere.equals("")){
		sqlwhere = " t1." + treesqlwhere1;
	}else{
		sqlwhere += " and t1."+treesqlwhere1+" ";
	}
}
String sqlconditionfieldname = "";
String sqlconditionvalue = "";
if(!groupby.equals("")){
    String paras[] = Util.TokenizerString2(groupby, "$");
    if(paras.length>1){
        sqlconditionfieldname= paras[0];
        sqlconditionvalue=paras[1];
    }
}
if(!"".equals(sqlconditionfieldname)){
	 if(sqlwhere.equals("")){
	 	   if("-1".equals(sqlconditionvalue)){
	 	   		sqlwhere = " t1." + sqlconditionfieldname+" is null ";
	 	   }else{
	 	   		sqlwhere = " t1." + sqlconditionfieldname+"='"+sqlconditionvalue+"' ";
	 	   }
	 }else{
	 		if("-1".equals(sqlconditionvalue)){
	 		 	sqlwhere += " and t1."+ sqlconditionfieldname+" is null ";
	 		}else{
	 			 sqlwhere += " and t1."+ sqlconditionfieldname+"='"+sqlconditionvalue+"' ";
	 		}
	 }
}															
            
if(!enabled.equals("0")){
	String enabledSql = FormModeTransMethod.getEnabledSql(user, enabled, modeid);
	if (sqlwhere.equals("")) {
		sqlwhere = enabledSql;
	} else {
		sqlwhere += " and " + enabledSql;
	}
}                               
//检查是否设置列宽
double sumColWidth = 0;
int zerocount = 0;
String allstatfield = "";
String decimalFormat = "";
Map<String, Integer> countColumnsDbType = new HashMap<String, Integer>();
Map<String,Object> fieldColWidthMap = new LinkedHashMap<String,Object>();
RecordSet.beforFirst();
while(RecordSet.next()){
	int col_id = RecordSet.getInt("id");
	if(!col_map.containsKey(col_id)&&is_user_column){
		continue;
	}
	int fieldColWidth = (int)Util.getDoubleValue(RecordSet.getString("ColWidth"),0);
	fieldColWidthMap.put(col_id+"", fieldColWidth);
	sumColWidth += fieldColWidth;
	if(Util.getDoubleValue(RecordSet.getString("ColWidth"),0)==0){
		zerocount++;
	}
	
	if(Util.getIntValue(RecordSet.getString("isstat"),0)==1&&Util.getIntValue(RecordSet.getString("httype"))==1){
		String name=Util.null2String(RecordSet.getString("name"));
		String qfws=Util.null2String(RecordSet.getString("qfws"));
		int field_viewtype=RecordSet.getInt("viewtype");
		if(field_viewtype==1){
			name=detailfieldAlias+name;
		}
		allstatfield+=name+",";
		String dbtype = Util.null2String(RecordSet.getString("dbtype"));
		int temptype = Util.getIntValue(RecordSet.getString("type"));
		if(temptype==5){
			countColumnsDbType.put(name,1);
		}else{
			countColumnsDbType.put(name,0);
		}
		int digitsIndex = dbtype.indexOf(",");
		int decimaldigits=2;
	 	if(digitsIndex > -1){
	 		decimaldigits = Util.getIntValue(dbtype.substring(digitsIndex+1, dbtype.length()-1), 2);
	 		decimalFormat +="%."+decimaldigits+"f|";
	 	}else{
	 		if(!qfws.equals("0")){
	 			decimalFormat +="%."+qfws+"f|";
	 		}else{
		 		decimalFormat +="%.0f|";	 			
	 		}
	 	}
	}
}
if(isBatchEditPage){
	allstatfield = "";
	decimalFormat = "";
}

int allSumWidthFix = CustomSearchAnalyzeUtil.calculateColWidth(fieldColWidthMap);
String sqlprimarykey = "t1.id";
if(isVirtualForm){	//虚拟表单
	sqlprimarykey = "t1." + vprimarykey;
	orderby = CustomSearchService.getOrderSQL(customid);
	if("".equals(orderby)){
		orderby += "t1." + vprimarykey+" desc ";
	}else{
		orderby += ",t1." + vprimarykey+" desc ";
	}
} else {
	orderby = CustomSearchService.getOrderSQL(customid);
	if("".equals(orderby)){
		orderby += "t1.id"+" desc ";
	}else{
		orderby += ",t1.id"+" desc ";
	}
}
if(!"".equals(detailtable)){
	orderby+=","+detailfieldAlias+"id";
}
if (iscustom == 1) {
	perpage = Util.getIntValue(PageIdConst.getPageSize("mode_customsearch:"+customid ,user.getUID(), "formmode:pagenumber"),perpage);
}
tableString =" <table instanceid=\"workflowRequestListTable\" tabletype=\"checkbox\" pagesize=\""+perpage+"\" isFromFromMode=\"true\" modeCustomid=\""+customid+"\" >"+
              "	   <sql backfields=\""+backfields+"\" sumColumns=\""+allstatfield+"\" decimalFormat=\""+decimalFormat;
if(!countColumnsDbType.isEmpty()){
	tableString+="\" countColumnsDbType=\""+countColumnsDbType;
}
tableString+="\" sqlform=\""+Util.toHtmlForSplitPage(fromSql)+"\" sqlwhere=\""+Util.toHtmlForSplitPage(sqlwhere)+"\"  sqlorderby=\""+orderby+"\"  sqlprimarykey=\""+sqlprimarykey+"\" sqlsortway=\"Desc\" poolname=\""+vdatasource+"\" />";

rsm.executeSql("select * from mode_customSearchButton where objid="+customid+" and isshow=1 order by showorder asc");
//添加自定义按钮
String btonBodyStr = "";
boolean haveOperates = false;
if(rsm.getCounts()>0 && !isBatchEditPage){
	haveOperates = true;
	String operateString= "";
	operateString = "<operates>";
	String para_=customid+"+"+user.getUID()+"+"+modeid+"+"+formID;
	operateString +=" <popedom  transmethod=\"weaver.formmode.search.FormModeTransMethod.getSearchResultOperation\" otherpara=\""+para_+"\" ></popedom> ";
	int index = 0;
	while(rsm.next()){
		index++;
		int pageExpandId = Util.getIntValue(rsm.getString("pageexpandid"),0);
		String buttonName = Util.null2String(rsm.getString("buttonname"));
		String hreftype = Util.null2String(rsm.getString("hreftype"));
		String hreftargetParid = Util.null2String(rsm.getString("hreftargetParid"));
		String hreftargetParval = Util.null2String(rsm.getString("hreftargetParval"));
		String hreftarget = Util.null2String(rsm.getString("hreftarget"));
		String jsmethodname = Util.null2String(rsm.getString("jsmethodname"));
		String jsParameter = Util.null2String(rsm.getString("jsParameter"));
		String jsmethodbody = Util.null2String(rsm.getString("jsmethodbody"));
		if("1".equals(hreftype)){
			btonBodyStr += jsmethodbody;
			String operate = "     <operate href=\""+jsmethodname+"\" text=\""+buttonName+"\" ";
			if(!StringHelper.isEmpty(jsParameter)){
				StringBuffer fieldBuf = new StringBuffer();
				ArrayList<String> fieldList = Util.TokenizerString(jsParameter, ",");
				for(int fieldIdx=0; fieldIdx<fieldList.size(); fieldIdx++){
					if(!StringHelper.isEmpty(fieldList.get(fieldIdx))){
						fieldBuf.append("column:"+fieldList.get(fieldIdx)+"+");
					}
				}
				if(!StringHelper.isEmpty(fieldBuf.toString())){
					jsParameter = fieldBuf.substring(0,fieldBuf.length()-1);
				}
				operate += "otherpara=\""+jsParameter+"\" ";
			}
			operate +=" index=\""+index+"\"/>";
			operateString +=operate;
		}else if("2".equals(hreftype)){
			String _blank = "_blank";
			if("2".equals(Util.null2String(rsm.getString("hreftargetOpenWay"))))
				_blank = "_fullwindow";
			hreftarget=hreftarget.replaceAll("&","&amp;");  //避免&符号在xml解析是报错
			operateString +="     <operate href=\""+hreftarget+"\" isalwaysshow=\"true\" text=\""+buttonName+"\" linkkey=\""+hreftargetParid+"\" linkvaluecolumn=\""+hreftargetParval+"\" target=\""+_blank+"\" index=\""+index+"\"/>";
		}else if("3".equals(hreftype)){
			String jsAction = expandInfoService.analyzePageExpandJsAction(pageExpandId);
			if("".equals(jsAction)){
				jsAction = "void(0)";
			}
			operateString +="<operate href=\"javascript:"+jsAction+"\" text=\""+buttonName+"\"  index=\""+index+"\"/>";
		}
	}
	operateString +="</operates>";
	tableString+=operateString;
}
	
tableString+="			<head>";

RecordSet.beforFirst();

AbstractPluginElement pluginElement = null;
StringBuffer pluginJS = new StringBuffer();
StringBuffer pluginLoadedJS = new StringBuffer();
boolean hasSetMaintableEditable = false;
boolean hasSetDetailtableEditable = false;
while (RecordSet.next()) {
	String fieldid = Util.null2String(RecordSet.getString("id"));
	int temocolwidth = Util.getIntValue(Util.null2String(fieldColWidthMap.get(fieldid)), 0);
	int shownamelabel = Util.getIntValue(RecordSet.getString("shownamelabel"),0);
	String hideAttribute = "";
	int col_id = Util.getIntValue(fieldid, 0);
	if(!col_map.containsKey(col_id)&&is_user_column){
		temocolwidth = 1;
		hideAttribute = "display=\"false\"";
	}
	if(RecordSet.getString("id").equals("-1")){
		String orderkey = "orderkey=\"t1.modedatacreatedate,t1.modedatacreatetime\"";
		String isorder = RecordSet.getString("isorder");
		String showmethod = Util.null2o(RecordSet.getString("showmethod"));
		String para3="column:modedatacreatetime+"+customid+"+"+showmethod+"+column:"+(isVirtualForm?vprimarykey:"id")+"+"+formID;
		if(!"1".equals(isorder)){
			orderkey = "";
		}
		if(shownamelabel==0){
			shownamelabel = 722;
		}
		tableString+="				<col width=\""+temocolwidth+"%\" "+hideAttribute+" text=\""+Util.toHtmlForSplitPage(SystemEnv.getHtmlLabelName(shownamelabel,user.getLanguage()))+"\" column=\"modedatacreatedate\" "+orderkey+"  otherpara=\""+para3+"\" transmethod=\"weaver.formmode.search.FormModeTransMethod.getSearchResultCreateTime\" />";
	}else if(RecordSet.getString("id").equals("-2")){
		String orderkey = "orderkey=\"t1.modedatacreater\"";
		String isorder = RecordSet.getString("isorder");
		if(!"1".equals(isorder)){
			orderkey = "";
		}
		if(shownamelabel==0){
			shownamelabel = 882;
		}
		tableString+="				<col width=\""+temocolwidth+"%\" "+hideAttribute+" text=\""+Util.toHtmlForSplitPage(SystemEnv.getHtmlLabelName(shownamelabel,user.getLanguage()))+"\" column=\"modedatacreater\" "+orderkey+"  otherpara=\"column:modedatacreatertype\" transmethod=\"weaver.formmode.search.FormModeTransMethod.getSearchResultName\" />";
	}else if(RecordSet.getString("id").equals("-3")){
		String orderkey = "orderkey=\"t1.id\"";
		String isorder = RecordSet.getString("isorder");
		if(!"1".equals(isorder)){
			orderkey = "";
		}
		if(shownamelabel==0){
			shownamelabel = 81287;
		}
		tableString+="				<col width=\""+temocolwidth+"%\" "+hideAttribute+" text=\""+Util.toHtmlForSplitPage(SystemEnv.getHtmlLabelName(shownamelabel,user.getLanguage()))+"\" column=\"id\" "+orderkey+" otherpara=\"column:dataid\" transmethod=\"weaver.formmode.search.FormModeTransMethod.getDataId\" />";
	}else{
		String name = RecordSet.getString("name");
		String label = RecordSet.getString("label");
		if(shownamelabel!=0){
			label = shownamelabel+"";
		}
		String htmltype = RecordSet.getString("httype");
		String type = RecordSet.getString("type");
		String id = RecordSet.getString("id");
		String dbtype=RecordSet.getString("dbtype");
		String istitle = RecordSet.getString("istitle");
		String showmethod = Util.null2o(RecordSet.getString("showmethod"));
		String isorder = RecordSet.getString("isorder");
		String ismaplocation = Util.getIntValue(RecordSet.getString("ismaplocation"),0)+"";
		int field_viewtype=RecordSet.getInt("viewtype");
		String editable = Util.null2String(RecordSet.getString("editable"),"0");
		if("1".equals(editable)){
			hasSetMaintableEditable = true;
			if(field_viewtype==1){
				hasSetDetailtableEditable = true;
			}
		}
		String fieldAlias=name;
		String tableAlias=maintableAlias;
		String orderkey="orderkey=\""+tableAlias+"."+name+"\"";
		if(field_viewtype==1){
			tableAlias=detailtableAlias;
			fieldAlias=detailfieldAlias+name;
			orderkey="orderkey=\""+fieldAlias+"\"";
		}
		if(!"1".equals(isorder)){
			orderkey = "";
		}
		
		if(isVirtualForm){
		    if(formmodeid.equals("0")){
		    	formmodeid = "virtual";
		    }
		}
		String para3="";
		if(viewtype==3){
		  para3="column:"+(isVirtualForm?vprimarykey:"id")+"+"+id+"+"+htmltype+"+"+type+"+"+user.getLanguage()+"+"+isbill+"+"+dbtype+"+"+istitle+"+"+formmodeid+"+"+formID+"+"+viewtype+"+"+ismaplocation+"+"+opentype+"+"+customid+"+fromsearchlist"+"+"+showmethod+(detailtable.equals("")?"":("'+column:d_id+"+detailtable+"'"));
		}else{
	      para3="column:"+(isVirtualForm?vprimarykey:"id")+"+"+id+"+"+htmltype+"+"+type+"+"+user.getLanguage()+"+"+isbill+"+"+dbtype+"+"+istitle+"+"+formmodeid+"+"+formID+"+"+viewtype+"+"+ismaplocation+"+"+opentype+"+"+customid+"+fromsearchlist"+"+"+showmethod+"+"+user.getUID()+"+"+enabled+(detailtable.equals("")?"":("'+column:d_id+"+detailtable+"'"));
		}
		label = SystemEnv.getHtmlLabelName(Util.getIntValue(label),user.getLanguage());
		String editPlugin = "";
		String transmethod = "transmethod=\"weaver.formmode.search.FormModeTransMethod.getOthers\"";
		if("1".equals(editable) && isBatchEditPage){
			String elementClassName = PluginElementClassName.getElementClassName(htmltype,type);
			pluginElement = (AbstractPluginElement)Class.forName(elementClassName).newInstance();
			String pluginName = pluginElement.getEditPluginName(Util.getIntValue(id));
			editPlugin = "editPlugin=\""+pluginName+"\"";
			
			JSONObject pluginJSObject = pluginElement.getEditPluginJS(Util.getIntValue(id), name, Util.getIntValue(htmltype), Util.getIntValue(type), dbtype, user);
			pluginJS.append(pluginJSObject.get("pluginJS"));
			pluginLoadedJS.append(pluginJSObject.get("pluginLoadedJS"));
			String pluginTransmethod = Util.null2String(pluginElement.getTransmethod());
			if(!"".equals(pluginTransmethod)){
				transmethod = "transmethod=\""+pluginTransmethod+"\"";
			}else{
				transmethod = "";
			}
			JSONObject paraObject = new JSONObject();
			paraObject.put("fieldid",id);
			paraObject.put("fieldhtmltype",htmltype);
			paraObject.put("type",type);
			para3 = "{mainid:+column:id+,fieldid:"+id+",fieldhtmltype:"+htmltype+",fieldtype:"+type+",fielddbtype:'"+dbtype+"',languageid:"+user.getLanguage()+"}";
		}
		tableString+="			    <col "+editPlugin+" width=\""+temocolwidth+"%\" "+hideAttribute+" text=\""+Util.toHtmlForSplitPage(label)+"\"  column=\""+fieldAlias+"\"  otherpara=\""+para3+"\" "+orderkey+" "+transmethod+" />";
	}
}
if(hasSetMaintableEditable && isBatchEditPage){
	String elementClassName = PluginElementClassName.getPrimaryKeyElementClassName();
	pluginElement = (AbstractPluginElement)Class.forName(elementClassName).newInstance();
	String primaryKeyName = isVirtualForm?vprimarykey:"id";
	String primaryKeyPluginName = pluginElement.getEditPluginName(primaryKeyName);
	JSONObject pluginJSObject = pluginElement.getEditPluginJS(0, primaryKeyName, 0, 0, "", user);
	pluginJS.append(pluginJSObject.getString("pluginJS"));
	tableString+="<col hide=\"true\" editPlugin=\""+primaryKeyPluginName+"\" text=\"\" column=\""+primaryKeyName+"\"  />";
	if(hasSetDetailtableEditable){
		primaryKeyName = detailfieldAlias+"id";
		primaryKeyPluginName = pluginElement.getEditPluginName(primaryKeyName);
		pluginJSObject = pluginElement.getEditPluginJS(0, primaryKeyName, 0, 0, "", user);
		pluginJS.append(pluginJSObject.getString("pluginJS"));
		tableString+="<col hide=\"true\" editPlugin=\""+primaryKeyPluginName+"\" text=\"\" column=\""+primaryKeyName+"\"  />";
	}
}
tableString+="			</head>"+ "</table>";
%>
<form id="batcheditForm" name="batcheditForm" method="post" action="/formmode/setup/customSearchActionForFront.jsp" target="batcheditIframe">
<input type="hidden" id="action" name="action" value="batchEdit" />
<input type="hidden" id="batcheditCustomid" name="batcheditCustomid" value="<%=customid%>" />
<input type="hidden" id="tableMax" name="tableMax" value="0" />
<textarea id="modifiedRows" name="modifiedRows" style="display:none;"></textarea>
<wea:SplitPageTag  tableString='<%=tableString%>'  mode="run" />
</form>
<iframe id="batcheditIframe" name="batcheditIframe" style="display:none;"></iframe>
</div> 
<!-- 显示查询结果 -->

<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>

<jsp:include page="/formmode/search/pageExpandJs.jsp">
	<jsp:param name="modeid" value="<%=modeid%>" />
	<jsp:param name="formid" value="<%=formID %>" />
	<jsp:param name="customid" value="<%=customid %>" />
	<jsp:param name="viewtype" value="<%=viewtype %>" />
</jsp:include>

<script language="javascript" src="/js/browser/WorkFlowBrowser_wev8.js"></script>
<script language=javascript src="/wui/common/jquery/plugin/Listener_wev8.js"></script>
<script language=javascript src="/formmode/js/jquery/aop/jquery.aop.min_wev8.js"></script>
<script>
chromeOnPropListener = null;
//加载监听器
function loadListener(){
	if(chromeOnPropListener==null){
		chromeOnPropListener = new Listener();
	}else{
		chromeOnPropListener.stop();
	}
	chromeOnPropListener.load("[_listener][_listener!='']");
	chromeOnPropListener.start(500,"_listener");
}
</script>
<script>
var fromgroup = <%="1".equals(fromgroup)%>;
var hasSetMaintableEditable = <%=hasSetMaintableEditable%>;
var hasSetDetailtableEditable = <%=hasSetDetailtableEditable%>;
<%=pluginJS%>
function afterDoWhenLoaded(){
	<%=pluginLoadedJS%>
	<%if(isBatchEditPage){%>
		loadListener();
		customSearchOperate.changeEmptyTRMessage();
	<%}%>
}
</script>
<script language=javascript src="/formmode/js/search_wev8.js"></script>
<script language="javaScript">

jQuery(document).ready(function(){
	resetSplitPageWidth();
	<%=initselectfield%>;
	<%
	String[] multiselectidArray = multiselectid.split(",");
	for(int m=0;m<multiselectidArray.length;m++){
		if(Util.null2String(multiselectidArray[m]).trim().equals(""))
			continue;
	%>
		jQuery("#<%=multiselectidArray[m]%>").multiselect({
			multiple: true,
			noneSelectedText: '',
			checkAllText: "<%=SystemEnv.getHtmlLabelName(556,user.getLanguage())%>",
	        uncheckAllText: "<%=SystemEnv.getHtmlLabelName(84355,user.getLanguage())%>",
	        selectedList:100,
	        close: function(){
				var tmpmsv = jQuery("#<%=multiselectidArray[m]%>").multiselect("getChecked").map(function(){return this.value;}).get();
	  			jQuery("#multiselectValue_<%=multiselectidArray[m]%>").val(tmpmsv.join(","));
	  			var selectObj = jQuery("#<%=multiselectidArray[m]%>");
				var onchangeStr = selectObj.attr('onchange');
				if(onchangeStr&&onchangeStr!=""){
					var selObj = selectObj.get(0);
					if (selObj.fireEvent){
						selObj.fireEvent('onchange');
					}else{
						selObj.onchange();
					}
				}
			}
			
	  	});
	  	jQuery("#<%=multiselectidArray[m]%>").val(jQuery("#multiselectValue_<%=multiselectidArray[m]%>").val().split(","));
	  	jQuery("#<%=multiselectidArray[m]%>").multiselect("refresh");
	<%}%>
	jQuery("#rightMenu").css("position","fixed");
	<%if(isBatchEditPage){%>
		jQuery.aop.around( {target: XTableHandler, method: "jumpTo"},customSearchOperate.jumpToAroundFun);
		jQuery.aop.around( {target: XTableHandler, method: "nextPage"},customSearchOperate.jumpToAroundFun);
		jQuery.aop.around( {target: XTableHandler, method: "prePage"},customSearchOperate.jumpToAroundFun);
		jQuery.aop.around( {target: XTableHandler, method: "goPage"},customSearchOperate.jumpToAroundFun);
	<%}%>
});


function resetMultiselect(){
    <%
	for(int m=0;m<multiselectidArray.length;m++){
		if(Util.null2String(multiselectidArray[m]).trim().equals(""))
			continue;
	%>
	  jQuery("#<%=multiselectidArray[m]%>").multiselect("refresh");
	<%}%>
}

//多选下拉框赋值
function multselectSetValue(){
	var tmpmsv="";
    <%
	for(int m=0;m<multiselectidArray.length;m++){
		if(Util.null2String(multiselectidArray[m]).trim().equals(""))
			continue;
	%>
	  tmpmsv = jQuery("#<%=multiselectidArray[m]%>").multiselect("getChecked").map(function(){return this.value;}).get();
	  
	  jQuery("#multiselectValue_<%=multiselectidArray[m]%>").val(tmpmsv.join(","));
	<%}%>

}

<%
Iterator it = urlMap.entrySet().iterator();
while (it.hasNext()) {
	Entry entry = (Entry) it.next();
	String detailid = Util.null2String((String)entry.getKey());
	String hreftarget = Util.null2String((String)entry.getValue());
	hreftarget = hreftarget.replace("\"","\\\"");
	hreftarget = hreftarget.replaceAll("\r\n","");
	out.println("var url_id_"+detailid + " = \"" +hreftarget+"\";");
}
%>

//初始化数据,用在search_wev8.js中

var dataArray = new Array();
dataArray["20149"] = "<%=SystemEnv.getHtmlLabelName(20149,user.getLanguage())%>";
dataArray["32535"] = "<%=SystemEnv.getHtmlLabelName(32535,user.getLanguage())%>";
dataArray["32530"] = "<%=SystemEnv.getHtmlLabelName(32530,user.getLanguage())%>";
dataArray["7"] = "<%=SystemEnv.getHtmlNoteName(7,user.getLanguage())%>";
dataArray["sumColWidth"] = <%=sumColWidth%>;
dataArray["allSumWidthFix"] = <%=allSumWidthFix%>;
dataArray["mainid"] = <%=mainid%>;
dataArray["customTreeDataId"] = "<%=customTreeDataId%>";
dataArray["18214"] = "<%=SystemEnv.getHtmlLabelName(18214,user.getLanguage())%>";
dataArray["tempquerystring"] = "<%=tempquerystring%>";
dataArray["16388"] = "<%=SystemEnv.getHtmlLabelName(16388 ,user.getLanguage()) %>";
dataArray["127295"] = "<%=SystemEnv.getHtmlLabelName(127295 ,user.getLanguage()) %>";
dataArray["searchKeyNum"] = <%=searchKeyNum %>;
dataArray["isShowQueryCondition"] = <%=isShowQueryCondition %>;
dataArray["parfield"] = "<%=parfield %>";
dataArray["multiselectid"] = "<%=multiselectid %>";

<%
int isUseMap = 1;
String sqlquery = "select * from mode_CustomDspField where ismaplocation=1 and isshow=1 and customid="+StringHelper.empty2Null(customid);
rs.executeSql(sqlquery);
if(!rs.next()){
	isUseMap = 0;
}
%>
dataArray["isUseMap"] = <%=isUseMap %>;

//批量生成二维码
function batchCreateQRCode() {
	<%
	int qrIsuse = 0;//二维码是否启用
	RecordSet.executeSql("select isuse from ModeQRCode where modeid="+modeid);
	if (RecordSet.next()) {
		qrIsuse = RecordSet.getInt("isuse");
	}
	%>
	if(<%=qrIsuse==0%>) {
		alert("<%=SystemEnv.getHtmlLabelName(125710 ,user.getLanguage()) %>"); //二维码功能尚未开启,请在后台开启二维码功能
   	 	return;
	}
    var billids = _xtable_CheckedCheckboxId();
    if(billids==""){
    	alert('<%=SystemEnv.getHtmlLabelName(20149,user.getLanguage())%>');///请至少选择一条记录。
        return;
    }
	window.open("/formmode/view/QRCodeViewIframe.jsp?modeId=<%=modeid%>&customid=<%=customid%>&formId=<%=formID%>&billid="+billids);
}

//批量生成条形码
function batchCreateBARCode() {
	<%
	int barIsused = 0;//条形码是否启用
	RecordSet.executeSql("select isused from mode_barcode where modeid="+StringHelper.empty2Null(modeid));
	if (RecordSet.next()) {
		barIsused = Util.getIntValue(RecordSet.getInt("isused")+"",-1);
	}
	%>
	if(<%=barIsused==-1%> || <%=barIsused==0%>) {
		alert("<%=SystemEnv.getHtmlLabelName(127216 ,user.getLanguage()) %>"); //条形码功能尚未开启,请在后台开启条形码功能
   	 	return;
	}
    var billids = _xtable_CheckedCheckboxId();
    if(billids==""){
    	alert('<%=SystemEnv.getHtmlLabelName(20149,user.getLanguage())%>');///请至少选择一条记录。
        return;
    }
	window.open("/formmode/view/BARCodeViewIframe.jsp?modeId=<%=modeid%>&customId=<%=customid%>&formId=<%=formID%>&billId="+billids);
}

function Add(){
	<%
	String treeFieldStr = "";
	if(!treenodeid.equals("")){
		String treeFieldSql = "select d.id,d.fieldname from mode_customtreedetail a ,mode_customsearch b,modeinfo c,workflow_billfield d where a.id='"+treenodeid+"' and a.hreftype=3 and a.hrefid=b.id and b.modeid=c.id and c.formid=d.billid and UPPER(a.hrefrelatefield)=UPPER(d.fieldname) and (d.detailtable is null or d.detailtable='')";
		RecordSet.executeSql(treeFieldSql);
		if(RecordSet.next()){
			String fieldid = RecordSet.getString("id");
			if(!StringHelper.isEmpty(treeconvalue)){
				treeFieldStr = "&field"+fieldid+"="+treeconvalue;
			}
		}
	}%>
	var url = "/formmode/view/AddFormMode.jsp?customTreeDataId=<%=customTreeDataId%>&mainid=<%=mainid%>&modeId=<%=modeid%>&formId=<%=formID%>&type=1<%=createurl+treeFieldStr%>";
	var refurl= window.document.referrer;//地址中带有p_开头的参数要带到新建页面中去
    var reg = /[&?]p_([^&]+)?=([^&]+)?/g; 
    var parms=refurl.match(reg);
    if(parms!=null){
        url += parms.toString().replace(/,/g,'').replace('?','');
    }
	window.open(url);
}


<%=btonBodyStr%>

<%--
weaverTable.prototype.loadOver = function(){
	var message_table_Div  = document.getElementById("message_table_Div");	 	
	//message_table_Div.style.display="none";	
	jQuery(message_table_Div).css("display", "none");	
	if(jQuery(".mapimage").length>0){
		pingmap();
	}
}
--%>
</script>
<%if(isUseMap==1){%>
		<script type="text/javascript" src="http://api.map.baidu.com/api?v=<%=Prop.getPropValue("map", "baidumapversion") %>&ak=<%=Prop.getPropValue("map", "baidumapak")%>"></script>
<% 	}%>
</body>
<SCRIPT language="javascript" src="/js/datetime_wev8.js"></script>
<SCRIPT language="javascript" src="/js/selectDateTime_wev8.js"></script>
<SCRIPT language="javascript" src="/js/JSDateTime/WdatePicker_wev8.js"></script>

<!-- browser 相关 -->
<script type="text/javascript" src="/formmode/js/modebrow_wev8.js?v=1"></script>
<script language=javascript src="/js/ecology8/request/e8.browser_wev8.js"></script>
</html>