PlanView.jsp
104 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
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="/systeminfo/init_wev8.jsp"%>
<%@ page import="weaver.pr.util.RightUtil"%>
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page" />
<jsp:useBean id="SubComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page" />
<jsp:useBean id="cmutil" class="weaver.pr.util.TransUtil" scope="page" />
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rs2" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="OperateUtil" class="weaver.pr.util.OperateUtil" scope="page" />
<jsp:useBean id="SubCategoryComInfo" class="weaver.docs.category.SubCategoryComInfo" scope="page" />
<jsp:useBean id="SecCategoryComInfo" class="weaver.docs.category.SecCategoryComInfo" scope="page" />
<jsp:useBean id="DocImageManager" class="weaver.docs.docs.DocImageManager" scope="page" />
<%
//所有经理及计划报告确认人有权限查看
String userid = user.getUID()+"";
String year = Util.null2String(request.getParameter("year"));
String type1 = Util.null2String(request.getParameter("type1"));
String type2 = Util.null2String(request.getParameter("type2"));
String planid = Util.null2String(request.getParameter("planid"));
String resourceid = Util.null2String(request.getParameter("resourceid"));
String isrefresh = Util.null2String(request.getParameter("isrefresh"));
String planname = "";
String status = "";
String auditids = "";
String remark = "";
String fileids = "";
String s_enddate = "";
String shareids = "";
String pshareids = "";
String currentdate = TimeUtil.getCurrentDateString();
String msg = "";
String viewdate = "";
String sql = "";
if(!planid.equals("")){
sql = "select id,planname,status,userid,year,type1,type2,startdate,enddate,isupdate,auditids,remark,fileids,shareids"
+",(select top 1 operatedate+' '+operatetime from PR_PlanReportLog where PR_PlanReportLog.planid=PR_PlanReport.id and operator="+user.getUID()+" and operatetype=0 order by operatedate desc,operatetime desc) as viewdate"
+" from PR_PlanReport where isvalid=1 and id="+planid;
if("oracle".equals(rs.getDBType())){
sql = "select id,planname,status,userid,year,type1,type2,startdate,enddate,isupdate,auditids,remark,fileids,shareids"
+",(select v.viewdate from (select CONCAT(CONCAT(operatedate,' '),operatetime) as viewdate,planid from PR_PlanReportLog where operator="+user.getUID()+" and operatetype=0 order by operatedate desc,operatetime desc) v where v.planid=PR_PlanReport.id and rownum=1) as viewdate"
+" from PR_PlanReport where isvalid=1 and id="+planid;
}else if("mysql".equals(rs.getDBType())){
sql = "select id,planname,status,userid,year,type1,type2,startdate,enddate,isupdate,auditids,remark,fileids,shareids"
+",(select CONCAT(operatedate,' ',operatetime) from PR_PlanReportLog where PR_PlanReportLog.planid=PR_PlanReport.id and operator="+user.getUID()+" and operatetype=0 order by operatedate desc,operatetime desc limit 1) as viewdate"
+" from PR_PlanReport where isvalid=1 and id="+planid;
}
rs.executeSql(sql);
if(rs.next()){
resourceid = Util.null2String(rs.getString("userid"));
year = Util.null2String(rs.getString("year"));
type1 = Util.null2String(rs.getString("type1"));
type2 = Util.null2String(rs.getString("type2"));
planname = Util.null2String(rs.getString("planname"));
status = Util.null2String(rs.getString("status"));
auditids = Util.null2String(rs.getString("auditids"));
remark = Util.null2String(rs.getString("remark"));
s_enddate = Util.null2String(rs.getString("enddate"));
fileids = Util.null2String(rs.getString("fileids"));
viewdate = Util.null2String(rs.getString("viewdate"));
shareids = Util.null2String(rs.getString("shareids"));
}else{
response.sendRedirect("../util/Message.jsp?type=1") ;
return;
}
}else{
if(resourceid.equals("")){
resourceid = userid;
}
//年份、类型取默认值
if(year.equals("")){
year = Util.null2String((String)request.getSession().getAttribute("PR_PLANREPORT_YEAR"));
if(year.equals("")) year = currentdate.substring(0,4);
}
if(type1.equals("")){
type1 = Util.null2String((String)request.getSession().getAttribute("PR_PLANREPORT_TYPE1"));
}
if(type2.equals("")){
type2 = Util.null2String((String)request.getSession().getAttribute("PR_PLANREPORT_TYPE2_"+type1));
}
}
//判断是否能查看
boolean canview = false;
boolean canedit = false;
boolean canaudit = false;
boolean istime = false;
boolean editshare = false;
int isweek = 0;
int ismonth = 0;
String reportaudit = "";
String reportview = "";
int wstarttype = 0;
int wstartdays = 0;
int wendtype = 0;
int wenddays = 0;
int mstarttype = 0;
int mstartdays = 0;
int mendtype = 0;
int menddays = 0;
String docsecid = "";
rs.executeSql("select * from PR_BaseSetting where resourceid=" + ResourceComInfo.getDepartmentID(resourceid) + " and resourcetype=3");
if(rs.next()){
reportaudit = Util.null2String(rs.getString("reportaudit"));
reportview = Util.null2String(rs.getString("reportview"));
docsecid = Util.null2String(rs.getString("docsecid"));
rs2.executeSql("select * from PR_BaseSetting where resourceid=" + ResourceComInfo.getSubCompanyID(resourceid) + " and resourcetype=2");
if(rs2.next()){
isweek = Util.getIntValue(rs2.getString("isweek"),0);
ismonth = Util.getIntValue(rs2.getString("ismonth"),0);
wstarttype = Util.getIntValue(rs2.getString("wstarttype"),0);
wstartdays = Util.getIntValue(rs2.getString("wstartdays"),0);
wendtype = Util.getIntValue(rs2.getString("wendtype"),0);
wenddays = Util.getIntValue(rs2.getString("wenddays"),0);
mstarttype = Util.getIntValue(rs2.getString("mstarttype"),0);
mstartdays = Util.getIntValue(rs2.getString("mstartdays"),0);
mendtype = Util.getIntValue(rs2.getString("mendtype"),0);
menddays = Util.getIntValue(rs2.getString("menddays"),0);
if("".equals(docsecid) || "0".equals(docsecid)) docsecid = Util.null2String(rs2.getString("docsecid"));
}
}else{
rs.executeSql("select * from PR_BaseSetting where resourceid=" + ResourceComInfo.getSubCompanyID(resourceid) + " and resourcetype=2");
if(rs.next()){
isweek = Util.getIntValue(rs.getString("isweek"),0);
ismonth = Util.getIntValue(rs.getString("ismonth"),0);
reportaudit = Util.null2String(rs.getString("reportaudit"));
reportview = Util.null2String(rs.getString("reportview"));
wstarttype = Util.getIntValue(rs.getString("wstarttype"),0);
wstartdays = Util.getIntValue(rs.getString("wstartdays"),0);
wendtype = Util.getIntValue(rs.getString("wendtype"),0);
wenddays = Util.getIntValue(rs.getString("wenddays"),0);
mstarttype = Util.getIntValue(rs.getString("mstarttype"),0);
mstartdays = Util.getIntValue(rs.getString("mstartdays"),0);
mendtype = Util.getIntValue(rs.getString("mendtype"),0);
menddays = Util.getIntValue(rs.getString("menddays"),0);
docsecid = Util.null2String(rs.getString("docsecid"));
}
}
if(isweek!=1 && ismonth!=1) {
response.sendRedirect("../util/Message.jsp?type=2") ;
return;//未启用
}
if(ismonth!=1 && type1.equals("1")) type1 = "";
if(isweek!=1 && type1.equals("2")) type1 = "";
if(type1.equals("")){
if(isweek==1){ type1 = "2";}
if(ismonth==1){ type1 = "1";}
}
if(type2.equals("")){
if(type1.equals("2")) type2 = TimeUtil.getWeekOfYear(new Date())+"";
if(type1.equals("1")) type2 = currentdate.substring(5,7);
rs.executeSql("select count(id) from PR_PlanReport where userid="+resourceid+" and year="+year+" and type1="+type1+" and type2="+type2);
if(rs.next() && rs.getInt(1)==0){
if(type1.equals("1")){
if(Integer.parseInt(type2)==1){
year = (Integer.parseInt(year)-1)+"";
type2 = "12";
}else{
type2 = (Integer.parseInt(type2)-1)+"";
}
}else if(type1.equals("2")){
if(Integer.parseInt(type2)==1){
year = (Integer.parseInt(year)-1)+"";
type2 = TimeUtil.getMaxWeekNumOfYear(Integer.parseInt(year))+"";
}else{
type2 = (Integer.parseInt(type2)-1)+"";
}
}
}
}
if(resourceid.equals(userid)){
canview = true;
canedit = true;
editshare = true;//本人可编辑共享
}else if(ResourceComInfo.isManager(user.getUID(),resourceid)){
canview = true;
editshare = true;//上级可编辑共享
}else if((","+reportaudit+",").indexOf(","+userid+",")>-1){
canview = true;
editshare = true;//后台定义的审批人可编辑共享
}else if((","+reportview+",").indexOf(","+userid+",")>-1){
canview = true;
}
//判断考核起止时间, 考核开始之前,不能查看
String basedate = "";
String begindate = "";
String enddate = "";
String titlestr = "";
int prevyear = Integer.parseInt(year);
int prevtype2 = Integer.parseInt(type2)-1;
int nextyear = Integer.parseInt(year);
int nexttype2 = Integer.parseInt(type2)+1;
String weekdate1 = "";
String weekdate2 = "";
int currentweek = TimeUtil.getWeekOfYear(new Date());
int currentmonth = Integer.parseInt(currentdate.substring(5,7));
if(type1.equals("1")){
basedate = TimeUtil.getYearMonthEndDay(Integer.parseInt(year),Integer.parseInt(type2));
begindate = TimeUtil.dateAdd(basedate,mstartdays*mstarttype);
enddate = TimeUtil.dateAdd(basedate,menddays*mendtype);
titlestr = "月";
if(type2.equals("1")){
prevyear = prevyear - 1;
prevtype2 = 12;
}
if(type2.equals("12")){
nextyear = nextyear + 1;
nexttype2 = 1;
}
}else if(type1.equals("2")){
basedate = TimeUtil.getDateString(TimeUtil.getLastDayOfWeek(Integer.parseInt(year),Integer.parseInt(type2)));
weekdate1 = TimeUtil.getDateString(TimeUtil.getFirstDayOfWeek(Integer.parseInt(year),Integer.parseInt(type2)));
weekdate2 = basedate;
begindate = TimeUtil.dateAdd(basedate,wstartdays*wstarttype);
enddate = TimeUtil.dateAdd(basedate,wenddays*wendtype);
titlestr = "周";
if(type2.equals("1")){
prevyear = prevyear - 1;
prevtype2 = TimeUtil.getMaxWeekNumOfYear(prevyear);
}
if(type2.equals(TimeUtil.getMaxWeekNumOfYear(Integer.parseInt(year))+"")){
nextyear = nextyear + 1;
nexttype2 = 1;
}
}
if(planid.equals("")){
if("oracle".equals(rs.getDBType())){
sql = "select id,planname,status,userid,year,type1,type2,startdate,enddate,isupdate,auditids,remark,fileids,shareids"
+",(select v.viewdate from (select CONCAT(CONCAT(operatedate,' '),operatetime) as viewdate,planid from PR_PlanReportLog where operator="+user.getUID()+" and operatetype=0 order by operatedate desc,operatetime desc) v where v.planid=PR_PlanReport.id and rownum=1) as viewdate"
+" from PR_PlanReport"
+" where isvalid=1 and year="+year+" and type1="+type1+" and type2="+type2+" and userid="+resourceid;
}else if("mysql".equals(rs.getDBType())){
sql = "select id,planname,status,userid,year,type1,type2,startdate,enddate,isupdate,auditids,remark,fileids,shareids"
+",(select concat(operatedate,' ',operatetime) from PR_PlanReportLog where PR_PlanReportLog.planid=PR_PlanReport.id and operator="+user.getUID()+" and operatetype=0 order by operatedate desc,operatetime desc limit 1) as viewdate"
+" from PR_PlanReport"
+" where isvalid=1 and year="+year+" and type1="+type1+" and type2="+type2+" and userid="+resourceid;
}else{
sql = "select id,planname,status,userid,year,type1,type2,startdate,enddate,isupdate,auditids,remark,fileids,shareids"
+",(select top 1 operatedate+' '+operatetime from PR_PlanReportLog where PR_PlanReportLog.planid=PR_PlanReport.id and operator="+user.getUID()+" and operatetype=0 order by operatedate desc,operatetime desc) as viewdate"
+" from PR_PlanReport"
+" where isvalid=1 and year="+year+" and type1="+type1+" and type2="+type2+" and userid="+resourceid;
}
rs.executeSql(sql);
if(rs.next()){
planid = Util.null2String(rs.getString("id"));
planname = Util.null2String(rs.getString("planname"));
status = Util.null2String(rs.getString("status"));
auditids = Util.null2String(rs.getString("auditids"));
remark = Util.null2String(rs.getString("remark"));
s_enddate = Util.null2String(rs.getString("enddate"));
fileids = Util.null2String(rs.getString("fileids"));
viewdate = Util.null2String(rs.getString("viewdate"));
shareids = Util.null2String(rs.getString("shareids"));
}
}
if(TimeUtil.dateInterval(currentdate,enddate)>=0) istime = true;
if(planid.equals("")){
if(TimeUtil.dateInterval(begindate,currentdate)<0){
msg = "此计划报告将在"+begindate+"开始提交";
}else if(TimeUtil.dateInterval(currentdate,enddate)<0 || !canedit){
msg = "此周期无数据";
}
planname = ResourceComInfo.getLastname(resourceid)+year+"年"+type2+titlestr+"工作总结及"+nextyear+"年"+nexttype2+titlestr+"工作计划";
}else{
if(TimeUtil.dateInterval(currentdate, begindate)>0 || TimeUtil.dateInterval(currentdate,enddate)<0){
//msg = "此计划报告将在"+begindate+"开始提交";
canedit = false;
}
}
String programid = "0";
String subCompanyId = ResourceComInfo.getSubCompanyID(resourceid);
String departmentId = ResourceComInfo.getDepartmentID(resourceid);
String companyId = SubComInfo.getCompanyid(subCompanyId);
String sql_pp = "select id,auditids,shareids from PR_PlanProgram where ("+
" (userid="+resourceid+" and (resourcetype=4 or resourcetype is null))"+
" or (userid="+subCompanyId+" and resourcetype = 2)"+
" or (userid="+departmentId+" and resourcetype = 3)"+
" or (userid="+companyId+" and resourcetype = 1)"+
" ) and programtype="+type1+" order by resourcetype desc";
//System.out.println(sql_pp);
rs.executeSql(sql_pp);
if(rs.next()){
programid = Util.null2String(rs.getString("id"));
if(planid.equals("")) auditids = Util.null2String(rs.getString("auditids"));
pshareids = Util.null2String(rs.getString("shareids"));
}
if(!canview){
if((","+auditids+",").indexOf(","+userid+",")<0 && (","+shareids+","+pshareids+",").indexOf(","+userid+",")<0){
if(!planid.equals("")){
//查询是否审批过
rs.executeSql("select count(id) from PR_PlanReportlog l where l.planid="+planid+" and l.operatetype in (4,5) and l.operator="+userid);
if(rs.next() && rs.getInt(1)==0){
msg = "您暂时无权限查看!";
}
//response.sendRedirect("../util/Message.jsp?type=1");
}else{
msg = "您暂时无权限查看!";
}
}
}
if((","+auditids+",").indexOf(","+userid+",")>-1) editshare = true;//审批人可编辑共享
if(status.equals("1") || status.equals("3")) canedit = false;
if(s_enddate.equals("")) s_enddate = enddate;
canaudit = RightUtil.isCanAuditPlan(planid,userid);
request.getSession().setAttribute("PR_PLANREPORT_YEAR",year);
request.getSession().setAttribute("PR_PLANREPORT_TYPE1",type1);
request.getSession().setAttribute("PR_PLANREPORT_TYPE2_"+type1,type2);
int islog = Util.getIntValue(request.getParameter("islog"),1);
if(!planid.equals("") && islog==1){
OperateUtil.addPlanLog(userid,planid,0);
}
//非草稿状态下本人可重新编写总结计划
boolean canreset = RightUtil.isCanResetPlan(planid,userid);
//草稿状态下本人可删除总结计划
boolean candel = RightUtil.isCanDelPlan(planid,userid);
boolean canupload = false;//附件上传
int inttype2 = Integer.parseInt(type2);
int index1 = 0;
int index2 = 0;
int showindex = 0;
List showfields1 = new ArrayList();
List hidefields1 = new ArrayList();
List showfields2 = new ArrayList();
List hidefields2 = new ArrayList();
List showstemp = new ArrayList();
List fieldlist = new ArrayList();
String[] feilds = null;
String showname = "";
String fieldname = "";
String ismust="";
boolean hascate1 = false;
boolean hascate2 = false;
//创建任务
boolean createtask = weaver.workrelate.util.TransUtil.istask();
//是否启用绩效考核
boolean isperformance = weaver.workrelate.util.TransUtil.isperformance();
if(planid.equals("")) editshare = false;//未保存过的报告不能进行共享
remark = Util.convertDB2Input(remark);
if(!"".equals(remark)){
remark = remark.replaceAll(""", "\"");
}
String titlename = planname;
%>
<HTML>
<HEAD>
<title><%=planname %></title>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
<SCRIPT language="javascript" src="../../js/util.js"></script>
<script language="javascript" defer="defer" src="/js/datetime_wev8.js"></script>
<script language="javascript" defer="defer" src="/js/JSDateTime/WdatePicker_wev8.js"></script>
<script language="javascript" src="/workrelate/js/jquery.textarea.autoheight.js"></script>
<SCRIPT language="javascript" src="../js/jquery.dragsort.js"></script>
<link rel="stylesheet" type="text/css" href="../css/tab.css" />
<style type="text/css">
.maintable,.maintable2{width: 100%;border-collapse: collapse;}
.maintable td{line-height: 180%;padding-left: 2px;padding-right: 4px;padding-top: 4px;padding-bottom: 4px;border-bottom: 1px #F6F6F6 solid;white-space: normal;height: 28px;word-break:break-all;}
.maintable2 td{line-height: 180%;border-bottom: 1px #F6F6F6 solid;word-break:break-all;}
.maintable td.title{background: #DDD9C3;}
.maintable td.title2{font-weight: bold;background: #F8F8F8;text-align: right;padding-right: 8px;}
.maintable tr.header td,.maintable2 tr.header td{font-weight: normal;background: #fff;text-align: left;line-height: 28px;padding: 0px;padding-left: 2px;color: #999999;}
.maintable tr.header1 td,.maintable2 tr.header1 td{border-bottom-color: #59D445;color: #000000;font-weight: bold;background:#f8f8f8;height:30px;padding-left:5px;padding-top:4px !important;padding-bottom:0px !important;line-height: 28px;cursor: pointer;}
.maintable tr.header2 td{border-bottom-color: #CD682B;}
.maintable td.edit_title{background: #EAEAEA !important;}
.maintable td .icheck{margin-bottom: 5px;margin-right: 5px;vertical-align: middle;}
td.td_index{white-space: nowrap;color: #525252;}
<%if(canedit){%>td.td_index{cursor: move !important;}<%}%>
.tr_data td{position: relative;}
.input_span{color: #C9C9C9;}
.td_spancate{border-bottom-color: #fff !important;}
.td_index_span{border-bottom-color:#fff !important;}
.tr_data_hover td{background: #EBF1DE;}
.tr_data_hover td{border-bottom-color: #4f95e4 !important;}
.tr_data_hover td .input_txt{color:#000;border-bottom-color: #EBF1DE;}
.tr_blank td{font-size: 0px;border: 0px;height: 2px;}
.btn_panel{width: auto;height: 26px;background: #4f95e4;position: absolute;top: 0px;right: 0px;overflow: hidden;display: none;}
.btn_opt{width: 26px;height: 26px;float: left;cursor: pointer;}
.btn_copy{background: url('../images/btn_copy.png') center no-repeat;}
.btn_insert{background: url('../images/btn_insert.png') center no-repeat;}
.btn_create{background: url('../images/btn_create.png') center no-repeat;}
.btn_detail{background: url('../images/btn_detail.png') center no-repeat;}
.btn_detail_new{background-color: red}
.newfb{width: 26px;height: 25px;line-height: 25px;text-align: center;background: #fff;color: red;position: absolute;right: 0px;bottom: 0px;font-style: italic;font-weight: normal;}
.title_panel{width: 100%;height: 24px;margin-top: 10px;position: relative;}
.cate_panel{cursor: pointer;}
.tag1{width: 5px;height: 25px;background: #59D445;font-size: 0px;float: left;margin-right: 7px;}
.tag2{width: 5px;height: 25px;background: #CD682B;font-size: 0px;float: left;margin-right: 7px;}
.tag3{width: 5px;height: 25px;background: #0080FF;font-size: 0px;float: left;margin-right: 7px;}
.tag4{width: 5px;height: 25px;background: #808080;font-size: 0px;float: left;margin-right: 7px;}
.tag5{width: 5px;height: 25px;background: #808080;font-size: 0px;float: left;margin-right: 7px;}
.tag6{width: 5px;height: 25px;background: #808080;font-size: 0px;float: left;margin-right: 7px;}
.title_txt{width: auto;line-height: 25px;float: left;font-weight: bold;font-size: 13px;}
.cate_more{width: auto;line-height: 25px;float: left;padding-left: 5px;font-weight: bold;display: none;}
.head_more{width: auto;padding-left: 5px;font-weight: bold;display: none;}
.btn_con{width: auto;;height: 20px;position: absolute;right: 2px;top:6px;}
.btn_add{width: 20px;height: 20px;background: url('../images/add.png');cursor: pointer;float: left;margin-right: 5px;}
.btn_add_hover{background: url('../images/add_hover.png');}
.btn_del{width: 20px;height: 20px;background: url('../images/delete.png');cursor: pointer;float: left;}
.btn_del_hover{background: url('../images/delete_hover.png');}
.btn1{width: 55px;line-height: 20px;height: 20px;padding: 0px !important;text-align: center;border: 1px #C5C5C5 solid;color:#808080;cursor: pointer;margin-left: 5px;float: left;font-weight: normal !important;font-size: 12px !important;}
.btn2{width: 40px;line-height: 20px;height: 20px;padding: 0px !important;text-align: center;border: 1px #B0B0B0 solid;cursor: pointer;margin-left: 5px;float: left;}
.btn_browser{width:25px;height:22px;float: left;margin-left: 0px;margin-top: 2px;cursor: pointer;
background: url('../images/btn_browser.png') center no-repeat !important;}
.btn_hover{background: #5581DA;color: #fff;border-color: #5581DA !important;}
.txt_browser{width:200px;height:22px;line-height:22px;float: left;margin-top: 2px;}
.input_txt{width: 96%;font-size: 12px;background: none;padding-left: 0px;margin-left: 0px;border: 0px !important;border-bottom: 1px #ffffff solid !important;outline: none;height: 23px;padding-top: 3px;padding-bottom: 0px;word-break:break-all;}
.input_txt_hover{border-bottom-color: #D1D1D1 !important;}
.input_txt_focus{border-bottom-color: #FF8040 !important;}
.input_txt2{width: 96%;font-size: 12px;}
.input_first{width: 70%;}
.area_txt{overflow-x: hidden;overflow-y: hidden;resize:none;word-break:break-all;min-height: 22px;line-height: 22px;}
.area_txt2{width: 98%;height: 70px;margin-top: 2px;margin-bottom: 2px;overflow-x: hidden;overflow-y: auto;}
.area_reason{height: 50px;}
.area_blur{font-style: italic;color: #C3C3C3;}
.score_txt{font-size: 12px !important;}
.final{font-weight: bold;font-size: 13px;}
.formula{color: #AFAFAF;}
.status{width: 30px;height: 20px;margin-right: 10px;display:-moz-inline-box;display:inline-block;float: left;}
.status0{background: url('../images/pstatus0.png') center no-repeat;}
.status1{background: url('../images/status5.png') center no-repeat;}
.status2{background: url('../images/pstatus2.png') center no-repeat;}
.status3{background: url('../images/status3.png') center no-repeat;}
.status6{background: url('../images/status6.png') center no-repeat;}
.status_txt{line-height: 20px;display:-moz-inline-box;display:inline-block;float: left;}
.btn_exchange{width: 70px;height: 20px;line-height: 20px;text-align: center;border:1px #C0C0C0 solid;cursor: pointer;margin-top: 2px;margin-bottom: 2px;}
.exchange_title{width: 100%;line-height: 22px;color: #808080;}
.exchange_content{width: 100%;height: auto;overflow: hidden;line-height: 20px;border-bottom: 1px #C0C0C0 dashed;margin-bottom: 5px;padding-bottom: 3px;}
.content_blur{width: 99%;height: 30px;resize:none;}
.content_focus{width: 99%;height: 80px;resize:auto;}
.progressBarStatus{width: 100%;}
.remark{padding:0px;line-height: 180%;}
.remark p{margin: 0px;}
.cke_skin_v2 .cke_top,.cke_skin_v2 .cke_contents{border-color: #fff !important;}
button.Calendar{height: 22px !important;background-position: bottom left;}
button.Calendar_d{background-image: none !important;}
.logview{display: none;}
.scroll{
SCROLLBAR-DARKSHADOW-COLOR: #EBEBEB;
SCROLLBAR-ARROW-COLOR: #F7F7F7;
SCROLLBAR-3DLIGHT-COLOR: #EBEBEB;
SCROLLBAR-SHADOW-COLOR: #EBEBEB;
SCROLLBAR-HIGHLIGHT-COLOR: #EBEBEB;
SCROLLBAR-FACE-COLOR: #EBEBEB;
scrollbar-track-color: #F7F7F7;
background: #FCFCFC;
overflow-x: hidden;
}
.cke_wrapper{background:none !important;}
.opttd{vertical-align:bottom;}
.optshow {background-image: url("/workrelate/plan/images/optshow.png");background-repeat: no-repeat;width: 16px;background-position: 50% 50%;height: 25px;cursor: pointer;float:right;}
.editorImgWin{z-index:100000;}
</style>
<%@ include file="/secondwev/common/head.jsp" %>
<SCRIPT language="javascript" src="/workrelate/js/pointout.js"></script>
</head>
<BODY style="overflow: auto">
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp"%>
<%
if(canreset && TimeUtil.dateInterval(currentdate,s_enddate)>=0){
RCMenu += "{重新编写,javascript:doReset(this),_self}";
RCMenuHeight += RCMenuHeightStep ;
}
if(canedit){
RCMenu += "{保存,javascript:doSave(this),_self}";
RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{提交,javascript:doSubmit(this),_self}";
RCMenuHeight += RCMenuHeightStep ;
}
if(candel){
RCMenu += "{删除,javascript:doDel(this),_self}";
RCMenuHeight += RCMenuHeightStep ;
}
if(canaudit){
RCMenu += "{批准,javascript:doApprove(this),_self}";
RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{退回,javascript:doReturn(this),_self}";
RCMenuHeight += RCMenuHeightStep ;
}
if(editshare){
RCMenu += "{共享,javascript:doShare(this),_self}";
RCMenuHeight += RCMenuHeightStep ;
}
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp"%>
<form id="form1" name="form1" action="PlanOperation.jsp" method="post">
<input type="hidden" name="planid" value="<%=planid %>">
<input type="hidden" name="planname" value="<%=planname %>">
<input type="hidden" name="resourceid" value="<%=resourceid %>">
<input type="hidden" name="auditids" value="<%=auditids %>">
<input type="hidden" name="year" value="<%=year %>">
<input type="hidden" name="type1" value="<%=type1 %>">
<input type="hidden" name="type2" value="<%=type2 %>">
<input type="hidden" id="operation" name="operation" value="">
<table width=100% height=100% border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="10">
<col width="">
<col width="10">
</colgroup>
<tr>
<td height="1" colspan="3"></td>
</tr>
<tr>
<td></td>
<td valign="top" style="position: relative;">
<div class="tabpanel">
<div id="yearpanel" class="yearpanel" > <%=year %></div>
<%if(isweek==1){%><div class="tab <%if(type1.equals("2")){ %>tab_click<%} %>" onclick="changeType(2)">周报</div><%} %>
<%if(ismonth==1){ %><div class="tab <%if(type1.equals("1")){ %>tab_click<%} %>" onclick="changeType(1)">月报</div><%} %>
<%if(type1.equals("1")){ %>
<div class="tab2_panel" style="width: 91px;">
<div class="week_btn1 <%if(inttype2!=1){ %>week_prev<%} %>" <%if(inttype2!=1){ %> onclick="changeType2(<%=inttype2-1 %>)" title="上一月" <%} %>></div>
<div id="monthpanel" class="week_txt" title=""><%=type2 %> 月</div>
<div class="week_btn2 <%if(inttype2!=12){ %>week_next<%} %>" <%if(inttype2!=12){ %> onclick="changeType2(<%=inttype2+1 %>)" title="下一月" <%} %>></div>
</div>
<%}else if(type1.equals("2")){
%>
<div class="tab2_panel" style="width: 91px;">
<div class="week_btn1 <%if(inttype2!=1){ %>week_prev<%} %>" <%if(inttype2!=1){ %> onclick="changeType2(<%=inttype2-1 %>)" title="上一周" <%} %>></div>
<div id="weekpanel" class="week_txt" title="<%=weekdate1+" 至 "+weekdate2 %>">第 <%=type2 %> 周</div>
<div class="week_btn2 <%if(inttype2!=TimeUtil.getMaxWeekNumOfYear(Integer.parseInt(year))){ %>week_next<%} %>" <%if(inttype2!=TimeUtil.getMaxWeekNumOfYear(Integer.parseInt(year))){ %> onclick="changeType2(<%=inttype2+1 %>)" title="下一周" <%} %>></div>
</div>
<%}else{ %>
<div class="tab2_panel" style="width: 1px;border-right: 0px;"></div>
<%} %>
<%if(msg.equals("")){ %>
<div id="operate_panel" style="width: auto;height: 28px;float: right;margin-top: 4px;">
<%if(canreset && TimeUtil.dateInterval(currentdate,s_enddate)>=0){ %>
<div class="btn1 btn" onclick="doReset();" title="重新编写计划报告">重新编写</div>
<%} %>
<%if(canedit){%>
<div class="btn1 btn" onclick="doSave();" title="保存为草稿">保存</div><div class="btn1 btn" onclick="doSubmit();" title="保存并提交">提交</div>
<%} %>
<%if(candel){%>
<div class="btn1 btn" onclick="doDel();" title="删除计划报告">删除</div>
<%} %>
<%if(canaudit){ %>
<div class="btn1 btn" onclick="doApprove();" title="批准计划报告">批准</div><div class="btn1 btn" onclick="doReturn();" title="退回计划报告">退回</div>
<%} %>
<%if(editshare){%>
<div class="btn1 btn" onclick="doShare();" title="共享计划报告">共享</div>
<%} %>
</div>
<div style="width: auto;height: 28px;float: right;font-size: 12px;font-weight: normal;margin-top: 5px;color: #999999;">
<%if((status.equals("0") || status.equals("1") || status.equals("2")) && TimeUtil.dateInterval(s_enddate,currentdate)>0){ %>
<span class="status status6"></span>
<%}else{ %>
<span class="status status<%=status %>"></span>
<%} %>
<%if(status.equals("1")){ %>
<span class="status_txt">待审批人:<%=cmutil.getPerson(RightUtil.getUnAuditPlanHrm(planid)) %> 截止日期:<%=s_enddate %></span>
<%}else if(!status.equals("3")){%>
<span class="status_txt">提交截止日期:<%=s_enddate %></span>
<%}%>
</div>
<%} %>
<div class="maintitle"><%=cmutil.getPerson(resourceid) %>工作计划报告
<%if(programid.equals("0") && canedit){ %><font style="font-size: 12px;font-weight: normal;font-style: italic;" title="您可自定义计划报告模板"><a href="../program/ProgramFrame.jsp?resourceid=<%=resourceid %>&programtype=<%=type1 %>" target="_blank"> [定义模板]</a></font><%} %></div>
</div>
<%if(!msg.equals("")){ %>
<font style="color: red;font-size: 13px;margin-left: 5px;"><%=msg %></font>
<%}else{ %>
<%
//读取总结及计划的显示列
//String sql = "";
String showsql1 = "select showname,fieldname,customname,showwidth,isshow,ismust from PR_PlanProgramDetail where 1=1";
String showsql2 = "select showname,fieldname,customname,showwidth2,isshow2,ismust2 from PR_PlanProgramDetail where 1=1";
if(planid.equals("")){
showsql1 += " and programid="+programid + " order by showorder";
showsql2 += " and programid="+programid + " order by showorder2";
rs.executeSql("select showname,fieldname,customname,isshow,showorder,showwidth,isshow2,showorder2,showwidth2,ismust,ismust2 from PR_PlanProgramDetail where programid="+programid);
while(rs.next()){
fieldname = Util.null2String(rs.getString("fieldname"));
fieldlist.add(new String[]{fieldname,Util.null2String(rs.getString("showname"))
,Util.null2String(rs.getString("customname")),Util.null2String(rs.getString("isshow"))
,Util.null2String(rs.getString("showorder")),Util.null2String(rs.getString("showwidth"))
,Util.null2String(rs.getString("isshow2")),Util.null2String(rs.getString("showorder2"))
,Util.null2String(rs.getString("showwidth2"))});
%>
<input type="hidden" id="fieldname_<%=showindex %>" name="fieldname_<%=showindex %>" value="<%=fieldname %>"/>
<input type="hidden" id="<%=fieldname %>_showname" name="<%=fieldname %>_showname" value="<%=Util.null2String(rs.getString("showname")) %>"/>
<input type="hidden" id="<%=fieldname %>_isshow" name="<%=fieldname %>_isshow" value="<%=Util.null2String(rs.getString("isshow")) %>"/>
<input type="hidden" id="<%=fieldname %>_ismust" name="<%=fieldname %>_ismust" value="<%=Util.null2String(rs.getString("ismust")) %>"/>
<input type="hidden" id="<%=fieldname %>_showorder" name="<%=fieldname %>_showorder" value="<%=Util.null2String(rs.getString("showorder")) %>"/>
<input type="hidden" id="<%=fieldname %>_showwidth" name="<%=fieldname %>_showwidth" value="<%=Util.null2String(rs.getString("showwidth")) %>"/>
<input type="hidden" id="<%=fieldname %>_isshow2" name="<%=fieldname %>_isshow2" value="<%=Util.null2String(rs.getString("isshow2")) %>"/>
<input type="hidden" id="<%=fieldname %>_ismust2" name="<%=fieldname %>_ismust2" value="<%=Util.null2String(rs.getString("ismust2")) %>"/>
<input type="hidden" id="<%=fieldname %>_showorder2" name="<%=fieldname %>_showorder2" value="<%=Util.null2String(rs.getString("showorder2")) %>"/>
<input type="hidden" id="<%=fieldname %>_showwidth2" name="<%=fieldname %>_showwidth2" value="<%=Util.null2String(rs.getString("showwidth2")) %>"/>
<input type="hidden" id="<%=fieldname %>_customname" name="<%=fieldname %>_customname" value="<%=Util.null2String(rs.getString("customname")) %>"/>
<%
showindex++;}
}else{
showsql1 += " and planid="+planid + " order by showorder";
showsql2 += " and planid="+planid + " order by showorder2";
}
rs.executeSql(showsql1);
while(rs.next()){
if(Util.getIntValue(rs.getString("isshow"),0)==1){
ismust = Util.null2String(rs.getString("ismust"))!=null && !"".equals(Util.null2String(rs.getString("ismust")))?Util.null2String(rs.getString("ismust")):"0";
showfields1.add(new String[]{Util.null2String(rs.getString("showname")),Util.null2String(rs.getString("fieldname"))
,Util.null2String(rs.getString("customname")),Util.null2String(rs.getString("showwidth")),ismust});
}else{
hidefields1.add(new String[]{Util.null2String(rs.getString("showname")),Util.null2String(rs.getString("fieldname"))
,Util.null2String(rs.getString("customname")),Util.null2String(rs.getString("showwidth"))});
}
}
rs.executeSql(showsql2);
while(rs.next()){
if(Util.getIntValue(rs.getString("isshow2"),0)==1){
ismust = Util.null2String(rs.getString("ismust2"))!=null && !"".equals(Util.null2String(rs.getString("ismust2")))?Util.null2String(rs.getString("ismust2")):"0";
showfields2.add(new String[]{Util.null2String(rs.getString("showname")),Util.null2String(rs.getString("fieldname"))
,Util.null2String(rs.getString("customname")),Util.null2String(rs.getString("showwidth2")),ismust});
showstemp.add(Util.null2String(rs.getString("fieldname")));
}else{
hidefields2.add(new String[]{Util.null2String(rs.getString("showname")),Util.null2String(rs.getString("fieldname"))
,Util.null2String(rs.getString("customname")),Util.null2String(rs.getString("showwidth2"))});
}
}
%>
<div class="title_panel cate_panel" title="点击收缩">
<div class="tag1"></div>
<div class="title_txt"><%=year+"年"+type2+titlestr %>工作总结</div>
<div class="cate_more">. . .</div>
</div>
<table style="width: 100%;" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="12px;"></td>
<td width="*">
<table id="maintable1" class="maintable" cellspacing="0" cellpadding="0" border="0">
<tr class="header">
<td width="2%"></td>
<%
for(int i=0;i<showfields1.size();i++){
feilds = ((String[])showfields1.get(i));
fieldname = feilds[1];
showname = feilds[2];
ismust = feilds[4];
if(showname.equals("")) showname = feilds[0];
if(fieldname.equals("finishrate")) {
if("1".equals(ismust) && canedit){
showname+="(% 必填)";
}else{
showname+="(%)";
}
}else{
if(("1".equals(ismust) || fieldname.equals("name")) && canedit) showname+="(必填)";
}
if(fieldname.equals("cate")) hascate1 = true;
%>
<td id="column1_<%=fieldname %>" class="td_title1" _width="<%=feilds[3] %>"
<%if(canedit&&i==0){ %> style="padding-left: 25px;"<%} %>>
<%=showname %>
</td>
<%} %>
<td width="2%"></td>
</tr>
<%
String orderby = " order by t1.showorder,t1.id";
String fbdate = "";
int datatype = 2;
String datatitle = "计划内";
String datadesc = "【计划内】工作来源于上一周期的计划,如有其它工作可在【计划外】中添加";
boolean detailedit = canedit;
for(int m=0;m<2;m++){ %>
<%
if(m==1){
datatype = 3;
datatitle = "计划外";
datadesc = "【计划外】工作表示不属于上一周期计划中的工作内容";
}
%>
<tr class="header1" _tindex="<%=m%>" title="点击收缩">
<td colspan="<%=showfields1.size()+2 %>" style="position: relative;" title="<%=datadesc %>"><%=datatitle %>
<span class="head_more">. . .</span>
<%if(canedit && m==1){%>
<div class="btn_con" >
<div class="btn_add" onclick="doAddRow1()" title="添加"></div>
<div class="btn_del" onclick="doDelRow1()" title="删除"></div>
</div>
<%} %>
</td>
</tr>
<!-- <tr class="tr_blank<%if(m==1){ %> tr_show<%} %>"><td class="td_blank" colspan="<%=showfields1.size()+1%>"></td></tr> -->
<%
//读取总结内容
sql = "select t1.id,t1.name,t1.cate,t1.begindate1,t1.enddate1,t1.begindate2,t1.enddate2,t1.days1,t1.days2,t1.finishrate,t1.target,t1.result,t1.custom1,t1.custom2,t1.custom3,t1.custom4,t1.custom5 ";
if(planid.equals("")){
if(m==0){
sql += " from PR_PlanReportDetail t1 where t1.planid=(select t2.id from PR_PlanReport t2 where t2.userid="+resourceid+" and t2.year="+prevyear+" and t2.type1="+type1+" and t2.type2="+prevtype2+")";//读取上个月的计划内容
}else{
break;
}
}else{
if(!viewdate.equals("")){
if("oracle".equals(rs.getDBType())){
sql +=",(select v.fbdate from (select CONCAT(CONCAT(fb.createdate,' '),fb.createtime) as fbdate,plandetailid from PR_PlanFeedback fb where fb.hrmid<>"+user.getUID()+" order by fb.createdate desc,fb.createtime desc) v where v.plandetailid=t1.id and rownum=1) as fbdate";
}else if("mysql".equals(rs.getDBType())){
sql +=",(select concat(fb.createdate,' ',fb.createtime) from PR_PlanFeedback fb where fb.plandetailid=t1.id and fb.hrmid<>"+user.getUID()+" order by fb.createdate desc,fb.createtime desc limit 1) as fbdate";
}else{
sql +=",(select top 1 fb.createdate+' '+fb.createtime from PR_PlanFeedback fb where fb.plandetailid=t1.id and fb.hrmid<>"+user.getUID()+" order by fb.createdate desc,fb.createtime desc) as fbdate";
}
}
sql += " from PR_PlanReportDetail t1 where t1.datatype="+datatype+" and t1.planid2=" + planid;//读取已保存的内容
}
//System.out.println(sql+orderby);
rs.executeSql(sql+orderby);
%>
<%if(rs.getCounts()==0 && m==0){%><tr class="tr_none0"><td colspan="<%=showfields1.size() %>" style="font-style: italic;color: #808080;padding-left: 3px;">无</td></tr><%}%>
<%if(rs.getCounts()==0 && m==1 && !canedit){%><tr class="tr_none1"><td colspan="<%=showfields1.size() %>" style="font-style: italic;color: #808080;padding-left: 3px;">无</td></tr><%}%>
<%
while(rs.next()){
fbdate = Util.null2String(rs.getString("fbdate"));
%>
<tr id="tr1_<%=index1 %>" class="tr_data tr_must tr_show<%=m%><%if(m==1){ %> tr_show<%} %>" _index="<%=index1 %>" _type="1">
<td width="2%" class="td_index" valign="top" title="拖动调整排序"></td>
<%
for(int i=0;i<showfields1.size();i++){
feilds = ((String[])showfields1.get(i));
fieldname = feilds[1];
detailedit = canedit;
if(m==0 && showstemp.indexOf(fieldname)>-1) detailedit = false;
%>
<td valign="top" class="td1_<%=fieldname %>" <%if(canedit && i==0 && !detailedit){%>style="padding-left: 20px !important"<%} %>>
<%if(detailedit){%>
<%if(i==0){ %><input class="icheck" type="checkbox" notBeauty="false" _index="<%=index1 %>"
/><%} %><%if(fieldname.equals("name")||fieldname.equals("target")||fieldname.equals("result")||fieldname.startsWith("custom")){//多行文本 %><textarea
class="area_txt input_txt <%if(i==0){ %>input_first<%} %>" id="s_<%=fieldname %>_value_<%=index1 %>" name="s_<%=fieldname %>_value_<%=index1 %>"><%=Util.convertDB2Input(rs.getString(fieldname)) %></textarea>
<%}else if(fieldname.indexOf("date")>-1){//日期 %><button
type="button" class="Calendar Calendar_d" onclick="getMyDate('s_<%=fieldname %>_value_<%=index1 %>','s_<%=fieldname %>_span_<%=index1 %>')">
</button><span id="s_<%=fieldname %>_span_<%=index1 %>" class="datespan" title="<%=Util.null2String(rs.getString(fieldname)) %>"><%=this.convertdate(rs.getString(fieldname)) %></span>
<input type="hidden" id="s_<%=fieldname %>_value_<%=index1 %>" name="s_<%=fieldname %>_value_<%=index1 %>" value="<%=Util.null2String(rs.getString(fieldname)) %>">
<%}else{//单行文本 %><input class="input_txt<%if(i==0){ %> input_first<%} %>" type="text"
id="s_<%=fieldname %>_value_<%=index1 %>" name="s_<%=fieldname %>_value_<%=index1 %>" value="<%=Util.null2String(rs.getString(fieldname)) %>"
<%if(fieldname.equals("days1")||fieldname.equals("days2")||fieldname.equals("finishrate")){%>
onkeypress="ItemNum_KeyPress('s_<%=fieldname %>_value_<%=index1 %>')" onblur="checknumber('s_<%=fieldname %>_value_<%=index1 %>')" maxlength="5"<%} %>
<%if(fieldname.equals("cate")){%> onchange="seteditspan(1)" <%}%>
<%if(fieldname.equals("name")||fieldname.equals("cate")){%> maxlength="100" <%} %>/>
<%} %>
<%}else{ %>
<%//if(canedit && i==0){ } %>
<%if(fieldname.equals("cate")){ %><span><%=Util.toHtml(rs.getString(fieldname)) %></span>
<%}else{ %><%=Util.toHtml(rs.getString(fieldname)) %><%} %>
<input class="input_txt" type="hidden" id="s_<%=fieldname %>_value_<%=index1 %>" name="s_<%=fieldname %>_value_<%=index1 %>" value="<%=Util.null2String(rs.getString(fieldname)) %>"/>
<%} %>
<%if(i==0){ %>
<input type="hidden" id="s_id_value_<%=index1 %>" name="s_id_value_<%=index1 %>" value="<%=Util.null2String(rs.getString("id")) %>"/>
<input type="hidden" name="s_datatype_value_<%=index1 %>" value="<%=datatype %>"/>
<input type="hidden" class="value_index" name="s_showorder_value_<%=index1 %>" value=""/>
<%} %>
<%if(i==(showfields1.size()-1)){ %>
<% if(!fbdate.equals("") && !viewdate.equals("") && TimeUtil.dateInterval(viewdate,fbdate)>0){ %>
<div id="fbnew_<%=index1 %>_1" class="newfb">new</div>
<% } %>
<%} %>
</td>
<% } %>
<%
for(int i=0;i<hidefields1.size();i++){
feilds = ((String[])hidefields1.get(i));
fieldname = feilds[1];
%>
<input type="hidden" id="s_<%=fieldname %>_value_<%=index1 %>" name="s_<%=fieldname %>_value_<%=index1 %>" value="<%=Util.null2String(rs.getString(fieldname)) %>"/>
<% } %>
<td width="2%" class="opttd"><div class="optshow"> </div></td>
</tr>
<% index1++;} %>
<%} %>
</table>
<table class="maintable2" style="margin-top: 0px;" cellspacing="0" cellpadding="0" border="0">
<tr class="header1" _tindex="2" title="点击收缩">
<td style="position: relative;">工作总体分析<span class="head_more">. . .</span></td>
</tr>
<tr class="tr_show2">
<td class="remark" style="<%if(!canedit){%>padding-top:4px;padding-bottom:4px;<%} %>" valign="top">
<%if(canedit){%>
<%=remark %>
<textarea id="remark" name="remark"><%=remark%></textarea>
<%}else{ %>
<%=remark %>
<%} %>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="title_panel cate_panel" title="点击收缩">
<div class="tag2"></div>
<div class="title_txt"><%=nextyear+"年"+nexttype2+titlestr %>工作计划</div>
<div class="cate_more">. . .</div>
<%if(canedit){%>
<div class="btn_con" >
<div class="btn_add" onclick="doAddRow2()" title="添加"></div>
<div class="btn_del" onclick="doDelRow2()" title="删除"></div>
</div>
<%} %>
</div>
<table style="width: 100%;" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="12px;"></td>
<td width="*" valign="top">
<table id="maintable2" class="maintable" cellspacing="0" cellpadding="0" border="0">
<tr class="header header2">
<td width="2%"></td>
<%
for(int i=0;i<showfields2.size();i++){
feilds = ((String[])showfields2.get(i));
fieldname = feilds[1];
showname = feilds[2];
ismust = feilds[4];
if(showname.equals("")) showname = feilds[0];
if(("1".equals(ismust) || fieldname.equals("name")) && canedit) showname+="(必填)";
if(fieldname.equals("cate")) hascate2 = true;
%>
<td id="column2_<%=fieldname %>" class="td_title2" _width="<%=feilds[3] %>"
<%if(canedit&&i==0){ %> style="padding-left: 25px;"<%} %>>
<%=showname %>
</td>
<%} %>
<td width="2%"></td>
</tr>
<!-- <tr class="tr_show tr_blank"><td class="td_blank" colspan="<%=showfields2.size()+1%>"></td></tr>-->
<%
//读取计划内容
sql = "select t1.id,t1.name,t1.cate,t1.begindate1,t1.enddate1,t1.begindate2,t1.enddate2,t1.days1,t1.days2,t1.finishrate,t1.target,t1.result,t1.custom1,t1.custom2,t1.custom3,t1.custom4,t1.custom5";
if(planid.equals("")) sql += " from PR_PlanReportDetail t1 where t1.programid=" + programid;//读取模板中的默认内容
else{
if(!viewdate.equals("")){
if("oracle".equals(rs.getDBType())){
sql +=",(select v.fbdate from (select CONCAT(CONCAT(fb.createdate,' '),fb.createtime) as fbdate,plandetailid from PR_PlanFeedback fb where fb.hrmid<>"+user.getUID()+" order by fb.createdate desc,fb.createtime desc) v where v.plandetailid=t1.id and t1.planid2=0 and rownum=1) as fbdate";
}else if("mysql".equals(rs.getDBType())){
sql +=",(select concat(fb.createdate,' ',fb.createtime) from PR_PlanFeedback fb where fb.plandetailid=t1.id and t1.planid2=0 and fb.hrmid<>"+user.getUID()+" order by fb.createdate desc,fb.createtime desc limit 1) as fbdate";
}else{
sql +=",(select top 1 fb.createdate+' '+fb.createtime from PR_PlanFeedback fb where fb.plandetailid=t1.id and t1.planid2=0 and fb.hrmid<>"+user.getUID()+" order by fb.createdate desc,fb.createtime desc) as fbdate";
}
}
sql += " from PR_PlanReportDetail t1 where t1.datatype=2 and t1.planid=" + planid;//读取已保存的内容
}
rs.executeSql(sql+orderby);
%>
<%if(rs.getCounts()==0 && !canedit){%><tr><td colspan="<%=showfields2.size() %>" style="font-style: italic;color: #808080;padding-left: 3px;">无</td></tr><%}%>
<%
while(rs.next()){
fbdate = Util.null2String(rs.getString("fbdate"));
%>
<tr id="tr2_<%=index2 %>" class="tr_data tr_show" _index="<%=index2 %>" _type="2">
<td width="2%" class="td_index" valign="top" title="拖动调整排序"></td>
<%
for(int i=0;i<showfields2.size();i++){
feilds = ((String[])showfields2.get(i));
fieldname = feilds[1];
%>
<td valign="top" class="td2_<%=fieldname %>" <%if(canedit&&1==2){%>style="white-space: nowrap"<%} %>>
<%if(canedit){%>
<%if(i==0){ %><input class="icheck" type="checkbox" notBeauty="false" _index="<%=index2 %>"
/><%} %><%if(fieldname.equals("name")||fieldname.equals("target")||fieldname.equals("result")||fieldname.startsWith("custom")){ %><textarea
class="area_txt input_txt <%if(i==0){ %>input_first<%} %>" id="p_<%=fieldname %>_value_<%=index2 %>" name="p_<%=fieldname %>_value_<%=index2 %>"><%=Util.convertDB2Input(rs.getString(fieldname)) %></textarea>
<%}else if(fieldname.indexOf("date")>-1){//日期 %><button
type="button" class="Calendar Calendar_d" onclick="getMyDate('p_<%=fieldname %>_value_<%=index2 %>','p_<%=fieldname %>_span_<%=index2 %>')">
</button><span id="p_<%=fieldname %>_span_<%=index2 %>" class="datespan" title="<%=Util.null2String(rs.getString(fieldname)) %>"><%=this.convertdate(rs.getString(fieldname)) %></span>
<input type="hidden" id="p_<%=fieldname %>_value_<%=index2 %>" name="p_<%=fieldname %>_value_<%=index2 %>" value="<%=Util.null2String(rs.getString(fieldname)) %>">
<%}else{ %><input class="input_txt<%if(i==0){ %> input_first<%} %>" type="text"
id="p_<%=fieldname %>_value_<%=index2 %>" name="p_<%=fieldname %>_value_<%=index2 %>" value="<%=Util.null2String(rs.getString(fieldname)) %>"
<%if(fieldname.equals("days1")||fieldname.equals("days2")||fieldname.equals("finishrate")){%>
onkeypress="ItemNum_KeyPress('p_<%=fieldname %>_value_<%=index2 %>')" onblur="checknumber('p_<%=fieldname %>_value_<%=index2 %>')" maxlength="5" <%} %>
<%if(fieldname.equals("cate")){%> onchange="seteditspan(2)" <%}%>
<%if(fieldname.equals("name")||fieldname.equals("cate")){%> maxlength="100" <%} %>/>
<%} %>
<%}else{ %>
<%if(fieldname.equals("cate")){ %><span><%=Util.toHtml(rs.getString(fieldname)) %></span>
<%}else{ %><%=Util.toHtml(rs.getString(fieldname)) %><%} %>
<input class="input_txt" type="hidden" id="p_<%=fieldname %>_value_<%=index2 %>" name="p_<%=fieldname %>_value_<%=index2 %>" value="<%=Util.null2String(rs.getString(fieldname)) %>"/>
<%} %>
<%if(i==0){ %>
<input type="hidden" id="p_id_value_<%=index2 %>" name="p_id_value_<%=index2 %>" value="<%=(!planid.equals(""))?Util.null2String(rs.getString("id")):"" %>"/>
<input type="hidden" name="p_datatype_value_<%=index2 %>" value="2"/>
<input type="hidden" class="value_index" name="p_showorder_value_<%=index2 %>" value=""/>
<%} %>
<%if(i==(showfields2.size()-1)){ %>
<% if(!fbdate.equals("") && !viewdate.equals("") && TimeUtil.dateInterval(viewdate,fbdate)>0){ %>
<div id="fbnew_<%=index2 %>_2" class="newfb">new</div>
<% } %>
<%} %>
</td>
<% } %>
<%
for(int i=0;i<hidefields2.size();i++){
feilds = ((String[])hidefields2.get(i));
fieldname = feilds[1];
%>
<input type="hidden" id="p_<%=fieldname %>_value_<%=index2 %>" name="p_<%=fieldname %>_value_<%=index2 %>" value="<%=Util.null2String(rs.getString(fieldname)) %>"/>
<% } %>
<td width="2%" class="opttd"><div class="optshow"> </div></td>
</tr>
<% index2++;} %>
</table>
</td>
</tr>
</table>
<table style="width: 100%;margin-top: 20px;" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="50%" valign="top">
<div class="title_panel" style="margin-top: 20px;">
<div class="tag3"></div>
<div class="title_txt">相关附件</div>
</div>
<table style="width: 100%;" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="12px;"></td>
<td width="*">
<table class="maintable" cellspacing="0" cellpadding="0" border="0">
<tr>
<td style="white-space: normal;line-height: 180%;">
<%
if(!fileids.equals("")) fileids = fileids.substring(1);
List fileidList = Util.TokenizerString(fileids,",");
int linknum=-1;
for(int j=0;j<fileidList.size();j++){
if(!"0".equals(fileidList.get(j)) && !"".equals(fileidList.get(j))){
linknum++;
DocImageManager.resetParameter();
DocImageManager.setDocid(Integer.parseInt((String)fileidList.get(j)));
DocImageManager.selectDocImageInfo();
DocImageManager.next();
String docImagefileid = DocImageManager.getImagefileid();
int docImagefileSize = DocImageManager.getImageFileSize(Util.getIntValue(docImagefileid));
String docImagefilename = DocImageManager.getImagefilename();
%>
<div style="width:auto;height: 30px;"><a href="javaScript:openFullWindowHaveBar('../util/ViewDoc.jsp?id=<%=fileidList.get(j) %>&planid=<%=planid %>')"><%=docImagefilename %></a>
<a href='../util/ViewDoc.jsp?id=<%=fileidList.get(j) %>&planid=<%=planid %>&fileid=<%=docImagefileid %>'>下载(<%=docImagefileSize/1000 %>K)</a>
<%=weaver.workrelate.util.TransUtil.getReviewLink(docImagefilename, docImagefileid, user.getLanguage(), user,2,(String)fileidList.get(j),planid,"") %>
<%if(canedit){%>
<input type="checkbox" notBeauty="false" onclick="onDeleteAcc(this,'<%=fileidList.get(j)%>')"/><U><%=linknum%></U>-删除
<%} %>
</div>
<% }
}
%>
<%if(canedit){
if(!docsecid.equals("")&&!docsecid.equals("0")){
String subid = SecCategoryComInfo.getSubCategoryid(docsecid);
String mainid = SubCategoryComInfo.getMainCategoryid(subid);
String maxsize = "0";
rs2.executeSql("select maxUploadFileSize from DocSecCategory where id=" + docsecid);
if(rs2.next()) maxsize = Util.null2String(rs2.getString(1));
canupload = true;
%>
<div id="edit_uploadDiv" style="margin-top: 0px;margin-bottom: 2px;" mainId="<%=mainid%>" subId="<%=subid%>" secId="<%=docsecid%>" maxsize="<%=maxsize%>"></div>
<% }else{ %>
<font color="red">未设置附件上传目录!</font>
<% } %>
<input type="hidden" id="edit_relatedacc" name="edit_relatedacc" value="<%=fileids%>">
<input type="hidden" id="delrelatedacc" name="delrelatedacc" value="">
<%}%>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="3%"></td>
<td width="47%" valign="top">
<%if(type1.equals("1") && isperformance){
rs.executeSql("select 1 from GP_BaseSetting where resourceid=" + ResourceComInfo.getSubCompanyID(resourceid) + " and resourcetype=2 and ismonth=1");
if(rs.next()){
%>
<div class="title_panel" style="margin-top: 20px;">
<div class="tag3" style="background: #FF00FF"></div>
<div class="title_txt">绩效考核</div>
</div>
<table style="width: 100%;" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="12px;"></td>
<td width="*">
<table class="maintable" cellspacing="0" cellpadding="0" border="0">
<tr>
<td style="white-space: normal;line-height: 180%;">
<div style="color: #808080;line-height: 30px">
<a href="javaScript:openFullWindowHaveBar('/performance/access/AccessView.jsp?year=<%=year %>&type1=1&type2=<%=type2 %>&resourceid=<%=resourceid %>')">
<%=ResourceComInfo.getLastname(resourceid)%><%=year %>年<%=type2 %>月目标绩效考核</a>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<% }
}
%>
</td>
</tr>
</table>
<table style="width: 100%;margin-top: 20px;" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="50%" valign="top">
<%if(!planid.equals("")){ %>
<div class="title_panel">
<div class="tag4"></div>
<div class="title_txt" style="color: #808080;">意见反馈</div>
</div>
<table style="width: 100%;" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="12px;"></td>
<td width="*">
<table id="maintable2" class="maintable" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<div id="exchange" style="width: 100%;overflow: hidden;">
<textarea id="content" name="content" class="content_blur" onfocus="contentFocus()" onblur="contentBlur()"></textarea>
<div id="exchangebtn" class="btn btn_exchange" style="display: none;" onclick="saveExchange()">保存</div>
<div id="exchangeload" style="height: 22px;display: none;"><img style="margin-top: 4px;margin-right: 2px;" src='../images/loading2.gif'/></div>
</div>
<%
String operatedate = "";
rs.executeSql("select operator,operatedate,operatetime,content from PR_PlanReportExchange where planid="+planid+" order by operatedate desc,operatetime desc,id desc");
while(rs.next()){
operatedate = Util.null2String(rs.getString("operatedate")+" "+rs.getString("operatetime"));
%>
<div class="exchange_title"><%=cmutil.getPerson(rs.getString("operator")) %> <%=Util.null2String(rs.getString("operatedate")) %> <%=Util.null2String(rs.getString("operatetime")) %>
<%if(!Util.null2String(rs.getString("operator")).equals(user.getUID()+"")
&& !viewdate.equals("") && TimeUtil.dateInterval(viewdate,operatedate)>0){
%>
<font style="color: red;margin-left: 5px;font-style: italic;font-size: 11px;cursor: pointer;" title="新反馈">new</font>
<%} %>
</div>
<div class="exchange_content"><%=Util.toHtml(rs.getString("content")) %></div>
<%
}
%>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
if(!shareids.equals("")){
if(shareids.startsWith(",")) shareids = shareids.substring(1);
if(shareids.endsWith(",")) shareids = shareids.substring(0,shareids.length()-1);
}
String sharenames = cmutil.getPerson(shareids);
%>
<div id="sharetitle" class="title_panel">
<div class="tag6"></div>
<div class="title_txt" style="color: #808080;">报告共享</div>
</div>
<table style="width: 100%;" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="12px;"></td>
<td width="*">
<%if(editshare){%>
<div class="btn_browser" onclick="onShowMutiHrm('shareids','shareidsSpan')"></div>
<div class="txt_browser" id="shareidsSpan"><%=sharenames %></div>
<input type="hidden" id="shareids" name="shareids" value="<%=shareids %>"/>
<%}else{ %>
<%=sharenames %>
<%if(sharenames.equals("")){ %><font style="color: #808080;font-style: italic;">无</font><%} %>
<%} %>
<%if(!pshareids.equals("")){ %>
<div style="color: #717171;clear: both;line-height: 30px;">默认共享:<%=cmutil.getPerson(pshareids) %></div>
<%} %>
</td>
</tr>
</table>
<%} %>
</td>
<td width="3%"></td>
<td width="47%" valign="top">
<%if(!planid.equals("")){ %>
<div class="title_panel">
<div class="tag5"></div>
<div class="title_txt" style="color: #808080;">操作日志 </div>
</div>
<table style="width: 100%;" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="12px;"></td>
<td width="*">
<table id="maintable2" class="maintable" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<%
rs.executeSql("select operator,operatedate,operatetime,operatetype from PR_PlanReportLog where operatetype<>0 and planid="+planid+" order by operatedate desc,operatetime desc,id desc");
if(rs.getCounts()>0){
%>
<% String logoperator = "";
while(rs.next()){
logoperator = Util.null2String(rs.getString("operator"));
if(logoperator.equals("0")){
logoperator = "系统";
}else{
logoperator = cmutil.getPerson(logoperator);
}
%>
<div class="log_op" style="color: #808080;"><%=logoperator %> <%=Util.null2String(rs.getString("operatedate")) %> <%=Util.null2String(rs.getString("operatetime")) %> <%=cmutil.getPlanOperateType(rs.getString("operatetype")) %>
</div>
<% }
}else{
%>
<font style="font-style: italic;color: #C3C3C3;">暂无</font>
<% }%>
<div style="line-height:22px;font-style: italic;font-weight: normal;cursor: pointer;font-size: 12px;color: #A0A0A0;" onclick="showLog(this)" title="显示包括查看在内的所有日志记录">显示所有</div>
<%
int _pagesize = 10;
int _total = 0;//总数
rs.executeSql("select count(id) from PR_PlanReportLog where planid="+planid);
if(rs.next()){
_total = rs.getInt(1);
}
%>
<div id="btnmore" style="cursor: pointer;width: 70px;height: 20px;line-height: 20px;margin-right: 0px;text-align: left;
color: #696969;display: none;font-weight: bold;letter-spacing: 8px;padding-left: 2px;font-size: 14px;"
onclick="getMoreLog(this)" _currentpage="0" _pagesize="<%=_pagesize %>" _total="<%=_total %>" title="加载更多日志">...</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%} %>
</td>
</tr>
<tr>
<td width="100%" colspan="3" valign="top">
</td>
</tr>
</table>
<%} %>
<div style="width: 100%;height: 10px;font-size: 0px;"></div>
<div id="btn_panel" class="btn_panel" _index="0" _type="0">
<div class="btn_opt btn_copy" style="display: none;" onclick="autoAddRow(this)" title="添加到工作计划"></div>
<div class="btn_opt btn_insert" style="display: none;" onclick="insertRow(this)" title="插入一行数据"></div>
<%if(createtask){ %><div class="btn_opt btn_create" onclick="createTask(this)" title="创建任务"></div><%} %>
<div id="btn_detail" class="btn_opt btn_detail" onclick="showDetail(this)" title="查看明细"></div>
</div>
</td>
<td></td>
</tr>
</table>
<input type="hidden" id="index1" name="index1" value="<%=index1 %>" />
<input type="hidden" id="index2" name="index2" value="<%=index2 %>" />
<input type="hidden" id="showindex" name="showindex" value="<%=showindex %>" />
</form>
<div id="yearselect" class="yearselect">
<%
int currentyear = Integer.parseInt(currentdate.substring(0,4));
for(int i=2013;i<(currentyear+3);i++){ %>
<div class="yearoption" _val="<%=i %>"> <%=i %></div>
<% } %>
</div>
<div id="monthselect" class="weekselect">
<%
for(int i=1;i<13;i++){
%>
<div class="weekoption<%if(currentmonth==i){ %> weekoption_current<%} %><%if(inttype2==i){ %> weekoption_select<%} %>" <%if(inttype2!=i){ %> onclick="changeType2(<%=i%>)" style="cursor:pointer;" <%} %>><%=i %>月</div>
<% } %>
</div>
<div id="weekselect" class="weekselect">
<%
for(int i=1;i<TimeUtil.getMaxWeekNumOfYear(Integer.parseInt(year))+1;i++){
%>
<div class="weekoption<%if(currentweek==i){ %> weekoption_current<%} %><%if(inttype2==i){ %> weekoption_select<%} %>" <%if(inttype2!=i){ %> onclick="changeType2(<%=i%>)" style="cursor:pointer;" <%} %>
title="<%=TimeUtil.getDateString(TimeUtil.getFirstDayOfWeek(Integer.parseInt(year),i)) %> 至 <%=TimeUtil.getDateString(TimeUtil.getLastDayOfWeek(Integer.parseInt(year),i)) %>">第<%=i %>周</div>
<% } %>
</div>
<div id="plandetail" style="width: 500px;height: 600px;position: absolute;top: 40px;right: 80px;display: none;background: #75ACEA">
<iframe id="detailframe" class="scroll" style="width: 496px;height: 596px;margin: 2px" src="" scrolling="auto" frameborder="0"></iframe>
</div>
<%if(canedit){ %>
<script type="text/javascript" src="/wui/common/js/ckeditor/ckeditor_wev8.js"></script>
<script type="text/javascript" src="/wui/common/js/ckeditor/ckeditorext_wev8.js"></script>
<%} %>
<script type="text/javascript" src="../js/tab.js"></script>
<script type="text/javascript">
var loadstr = "<img src='../images/loading2.gif' align='absMiddle'/>";
var itemMap = null;
var rowindex = <%=index1%>;
var rowindex2 = <%=index2%>;
jQuery(document).ready(function(){
<%if(isrefresh.equals("1")){%>
refreshOpener();
<%}%>
<%if(msg.equals("")){%>
jQuery("div.btn").bind("mouseover",function(){
jQuery(this).addClass("btn_hover");
}).bind("mouseout",function(){
jQuery(this).removeClass("btn_hover");
});
jQuery("div.btn_add").bind("mouseover",function(){
jQuery(this).addClass("btn_add_hover");
}).bind("mouseout",function(){
jQuery(this).removeClass("btn_add_hover");
});
jQuery("div.btn_del").bind("mouseover",function(){
jQuery(this).addClass("btn_del_hover");
}).bind("mouseout",function(){
jQuery(this).removeClass("btn_del_hover");
});
jQuery("div.cate_panel").bind("click",function(e){
var target=$.event.fix(e).target;
if(!$(target).hasClass("btn_add") && !$(target).hasClass("btn_del")){
if(jQuery(this).attr("title")=="点击收缩"){
jQuery(this).attr("title","点击展开");
jQuery(this).children("div.cate_more").show();
jQuery(this).find(".btn_con").hide();
jQuery(this).next("table").hide();
}else{
jQuery(this).attr("title","点击收缩");
jQuery(this).children("div.cate_more").hide();
jQuery(this).find(".btn_con").show();
jQuery(this).next("table").show();
}
}
});
jQuery("tr.header1").bind("click",function(e){
var target=$.event.fix(e).target;
if(!$(target).hasClass("btn_add") && !$(target).hasClass("btn_del")){
var _tindex = jQuery(this).attr("_tindex");
if(jQuery(this).attr("title")=="点击收缩"){
jQuery(this).attr("title","点击展开");
jQuery(this).find("span.head_more").show();
jQuery(this).find(".btn_con").hide();
jQuery("tr.tr_show"+_tindex+",tr.tr_none"+_tindex).hide();
}else{
jQuery(this).attr("title","点击收缩");
jQuery(this).find("span.head_more").hide();
jQuery(this).find(".btn_con").show();
jQuery("tr.tr_show"+_tindex+",tr.tr_none"+_tindex).show();
}
}
});
<%if(canedit){%>
jQuery(".input_txt").live("focus",function(){
jQuery(this).addClass("input_txt_focus");
}).live("blur",function(){
jQuery(this).removeClass("input_txt_focus");
});
<%}%>
setwidth(1);
setwidth(2);
setIndex(1);
setIndex(2);
<%if(canedit && canupload){%>
bindUploaderDiv(jQuery("#edit_uploadDiv"),"newrelatedacc");
<%}%>
<%if(canedit){ %>
bindarea();//绑定多行文本框自动伸缩事件
//初始化编辑器
CkeditorExt.initEditor("form1","remark","<%=user.getLanguage()%>","",150);
<%if(index1==0){%>doAddRow1();doAddRow1();<%}%>
<%if(index2==0){%>doAddRow2();doAddRow2();doAddRow2();<%}%>
//拖动排序事件绑定
$("#maintable1").dragsort({
itemSelector: "tr.tr_show",
dragSelector: "td.td_index",
dragBetween: false,
dragStart: function(){},
dragEnd: function(){
setIndex(1);
<%if(hascate1){%>seteditspan(1);<%}%>
},
placeHolderTemplate: "<tr class='tr_data'><td colspan='<%=showfields1.size()+2%>'></td></tr>",
scrollSpeed: 5
});
$("#maintable2").dragsort({
itemSelector: "tr.tr_show",
dragSelector: "td.td_index",
dragBetween: false,
dragStart: function(){},
dragEnd: function(){
setIndex(2);
<%if(hascate2){%>seteditspan(2);<%}%>
},
placeHolderTemplate: "<tr class='tr_data'><td colspan='<%=showfields2.size()+2%>'></td></tr>",
scrollSpeed: 5
});
<%if(hascate1){%>seteditspan(1);setrowspan(0);<%}%>
<%if(hascate2){%>seteditspan(2);<%}%>
<%}else{%>
<%if(hascate1){%>setrowspan(1);<%}%>
<%if(hascate2){%>setrowspan(2);<%}%>
<%}%>
jQuery("#btn_panel").bind("mouseenter",function(){
jQuery(this).show();
var _index = jQuery(this).attr("_index");
var _type = jQuery(this).attr("_type");
jQuery("#tr"+_type+"_"+_index).addClass("tr_data_hover");
}).bind("mouseleave",function(){
jQuery(this).hide();
var _index = jQuery(this).attr("_index");
var _type = jQuery(this).attr("_type");
jQuery("#tr"+_type+"_"+_index).removeClass("tr_data_hover");
});
jQuery("tr.tr_data").live("mouseenter",function(){
jQuery(this).addClass("tr_data_hover");
<%if(canedit){%>jQuery(this).find(".input_txt").addClass("input_txt_hover");jQuery(this).find("button.Calendar").removeClass("Calendar_d");<%}%>
}).live("mouseleave",function(){
jQuery(this).removeClass("tr_data_hover");
<%if(canedit){%>jQuery(this).find(".input_txt").removeClass("input_txt_hover");jQuery(this).find("button.Calendar").addClass("Calendar_d");<%}%>
});
$(".optshow").live("mouseenter",function(){
var h = jQuery(this).parent().parent().height();
if(h>39){
jQuery("#btn_panel").height(39);
$(".btn_opt").height(39);
}else{
jQuery("#btn_panel").height(h);
$(".btn_opt").height(h);
}
var t = jQuery(this).parent().parent().offset().top + h -1 -jQuery("#btn_panel").height();
var _index = jQuery(this).parent().parent().attr("_index");
var _type = jQuery(this).parent().parent().attr("_type");
<%if(canedit){%>
//控制添加到工作计划按钮是否显示
if(_type==1){
jQuery("div.btn_copy").show();
}else{
jQuery("div.btn_copy").hide();
}
//控制插入一行数据按钮是否显示
if(jQuery(this).parent().parent().hasClass("tr_show")){
jQuery("div.btn_insert").show();
}else{
jQuery("div.btn_insert").hide();
}
<%}%>
if(jQuery(this).parent().parent().find("div.newfb").length>0){
jQuery("#btn_detail").addClass("btn_detail_new").attr("title","有新反馈");
}else{
jQuery("#btn_detail").removeClass("btn_detail_new").attr("title","查看明细");
}
jQuery("#btn_panel").attr("_index",_index).attr("_type",_type).css({"top":t}).show();
}).live("mouseleave",function(){
jQuery("#btn_panel").hide();
});
<%}%>
});
jQuery(document).bind("click",function(e){
var target=$.event.fix(e).target;
if($(target).attr("id")!="plandetail" && $(target).attr("id")!="btn_detail" && $(target).parents("#plandetail").length==0){
closeDetail();
}
});
jQuery(window).scroll(function(){
var t = jQuery(document).scrollTop()+40;
jQuery("#plandetail").css("top",t);
});
function setrowspan(index){
var s = null;
var prevTd = null;
var trobjs = null;
if(index==0){
trobjs = $("tr.tr_show0");
index = 1;
//alert(trobjs.length);
}else{
trobjs = $("#maintable"+index).find('tr');
}
trobjs.each(function() {
var td = $(this).find("td.td"+index+"_cate");
if(td.length>0){
var s1 = td.text();
if (s1 == s) { //相同即执行合并操作
//td.hide(); //hide() 隐藏相同的td ,remove()会让表格错位 此处用hide
td.children("span").html("");
prevTd.addClass("td_spancate").parent("tr").find("td.td_index").addClass("td_index_span");
//prevTd.addClass("td_spancate");//.attr('rowspan', prevTd.attr('rowspan') ? parseInt(prevTd.attr('rowspan')) + 1 : 2); //赋值rowspan属性
}
else {
s = s1;
}
prevTd = td;
}else{
s = null;
prevTd = null;
}
});
}
function setwidth(type){
var sumwidth = 0;
var sumrate = 0;
var lastid = "";
var lastrate = 0;
var columns = jQuery("td.td_title"+type).length;
jQuery("td.td_title"+type).each(function(){
sumwidth += getFloatVal(jQuery(this).attr("_width"));
});
for(var i=0;i<columns;i++){
var tdobj = jQuery("td.td_title"+type).eq(i);
var cwidth = getFloatVal(tdobj.attr("_width"));
var rate = 0;
if(sumwidth!=0) rate = (getFloatVal(cwidth/sumwidth*100)).toFixed(0);
sumrate += getIntVal(rate);
lastid = tdobj.attr("id");
lastrate = getIntVal(rate);
jQuery(tdobj).attr("width",(rate+"%"));
}
lastrate = 96 - (sumrate-lastrate);
jQuery("#"+lastid).attr("width",lastrate+"%");
}
<%if(canedit){%>
function seteditspan(index){
var s = null;
$("#maintable"+index).find('tr').each(function() {
var td = $(this).find("td.td"+index+"_cate");
if(td.length>0){
var input = td.children("input.input_txt");
if(input.length>0){
var s1 = input.val();
if (s1!="" && s1 == s) {
input.addClass("input_span");
}
else {
input.removeClass("input_span");
s = s1;
}
}else{
s = null;
}
}else{
s = null;
}
});
}
function doSave(obj) {
if(checkIsMust()){
alertStyle("提示:请填写标题不为空的计划数据的必填项!");
return false;
}
if(checkMust()){
confirmStyle("提示:未填写标题的明细项将不会保存,确定继续执行操作?",function(){
jQuery(".area_reason").each(function(){
if(jQuery(this).val()==reasondef){
jQuery(this).val("");
}
});
showload(obj);
jQuery("#operation").val("save");
//obj.disabled = true;
<%if(canupload){%>
submitform();
<%}else{%>
doSaveAfterAccUpload();
<%}%>
});
}else{
jQuery(".area_reason").each(function(){
if(jQuery(this).val()==reasondef){
jQuery(this).val("");
}
});
showload(obj);
jQuery("#operation").val("save");
//obj.disabled = true;
<%if(canupload){%>
submitform();
<%}else{%>
doSaveAfterAccUpload();
<%}%>
}
}
function doSubmit(obj) {
if(checkIsMust()){
alertStyle("请填写:标题不为空计划数据的必填项!");
return false;
}
confirmStyle("确定提交工作总结?",function(){
if(checkMust()){
confirmStyle("提示:未填写标题的明细项将不会保存,确定继续执行操作?",function(){
jQuery("#operation").val("submit");
//obj.disabled = true;
showload(obj);
<%if(canupload){%>
submitform();
<%}else{%>
doSaveAfterAccUpload();
<%}%>
});
}else{
jQuery("#operation").val("submit");
//obj.disabled = true;
showload(obj);
<%if(canupload){%>
submitform();
<%}else{%>
doSaveAfterAccUpload();
<%}%>
}
});
}
function submitform(){
var oUploader=window[jQuery("#edit_uploadDiv").attr("oUploaderIndex")];
try{
if(oUploader.getStats().files_queued==0) //如果没有选择附件则直接提交
doSaveAfterAccUpload();
else
oUploader.startUpload();
}catch(e) {
doSaveAfterAccUpload();
}
}
function doSaveAfterAccUpload(){
jQuery("#form1").submit();
}
function onDeleteAcc(obj,delid){
var delrelatedacc=jQuery("#delrelatedacc").val();
var relatedacc=jQuery("#edit_relatedacc").val();
relatedacc=","+relatedacc;
delrelatedacc=","+delrelatedacc;
if(jQuery(obj).attr("checked")){
delrelatedacc=delrelatedacc+delid+",";
var index=relatedacc.indexOf(","+delid+",");
relatedacc=relatedacc.substr(0,index+1)+relatedacc.substr(index+delid.length+2);
}else{
var index=delrelatedacc.indexOf(","+delid+",");
delrelatedacc=delrelatedacc.substr(0,index+1)+delrelatedacc.substr(index+delid.length+2);
relatedacc=relatedacc+delid+",";
}
jQuery("#edit_relatedacc").val(relatedacc.substr(1,relatedacc.length));
jQuery("#delrelatedacc").val(delrelatedacc.substr(1,delrelatedacc.length));
}
function checkMust(){
var noname = false;
for(var i=0;i<rowindex;i++){
var nameobj = jQuery("#s_name_value_"+i);
if(nameobj.length>0 && nameobj.val()==""){
noname = true;
break;
}
}
if(!noname){
for(var i=0;i<rowindex2;i++){
var nameobj = jQuery("#p_name_value_"+i);
if(nameobj.length>0 && nameobj.val()==""){
noname = true;
break;
}
}
}
return noname;
}
function checkIsMust(){
var _flag = false;
$("#maintable1").find("tr.tr_must").each(function(){
if(_flag){
return false;
}
var _index = $(this).attr("_index");
var _names = $(this).find("#s_name_value_"+_index);
<%
for(int i=0;i<showfields1.size();i++){
feilds = ((String[])showfields1.get(i));
fieldname = feilds[1];
ismust = feilds[4];
%>
if(_names.length>0 && _names.val()!="" && <%=ismust%>==1){
var _obj = $(this).find("#s_"+"<%=fieldname%>"+"_value_"+_index);
if(_obj.length>0 && _obj.val()==""){
_flag =true;
}
}
<%
}
%>
});
if(!_flag){
$("#maintable2").find("tr.tr_show").each(function(){
if(_flag){
return false;
}
var _index = $(this).attr("_index");
var _names = $(this).find("#p_name_value_"+_index);
<%
for(int i=0;i<showfields2.size();i++){
feilds = ((String[])showfields2.get(i));
fieldname = feilds[1];
ismust = feilds[4];
%>
if(_names.length>0 && _names.val()!="" && <%=ismust%>==1){
var _obj = $(this).find("#p_"+"<%=fieldname%>"+"_value_"+_index);
if(_obj.length>0 && _obj.val()==""){
_flag =true;
}
}
<%
}
%>
});
}
return _flag;
}
function bindarea(trid){
/**
var areaobjs = null;
if(getVal(trid)!=""){
areaobjs = jQuery("#"+trid).find(".area_txt");
}else{
areaobjs = jQuery(".area_txt");
}
if(areaobjs.length>0){
areaobjs.autogrow({
minLines: 1,
lineHeight: 24,
overflow: 'hidden',
restore: false
});
}*/
var areaobjs = null;
if(getVal(trid)!=""){
areaobjs = jQuery("#"+trid).find(".area_txt");
}else{
areaobjs = jQuery(".area_txt");
}
if(areaobjs.length>0){
areaobjs.textareaAutoHeight({ minHeight:22 });
areaobjs.each(function(){
var textarea= jQuery(this).get(0);
//alert(textarea.clientHeight);
jQuery(this).height(textarea.scrollHeight);
});
}
}
//总结数据添加到工作计划
function autoAddRow(obj){
var index = jQuery(obj).parent().attr("_index");
var trdata = jQuery("#tr1_"+index);
itemMap = new Map();
<%
for(int i=0;i<showfields1.size();i++){
feilds = ((String[])showfields1.get(i));
fieldname = feilds[1];
%>
itemMap.put("<%=fieldname%>",getVal(jQuery("#s_<%=fieldname%>_value_"+index).val()));
<% } %>
<%
for(int i=0;i<hidefields1.size();i++){
feilds = ((String[])hidefields1.get(i));
fieldname = feilds[1];
%>
itemMap.put("<%=fieldname%>",getVal(jQuery("#s_<%=fieldname%>_value_"+index).val()));
<% } %>
doAddRow2();
}
//添加计划外工作总结
function doAddRow1(insertindex){
var trstr = "<tr id=\"tr1_"+rowindex+"\" class=\"tr_data tr_must tr_show tr_show1\" _index=\""+rowindex+"\" _type='1'>";
trstr += "<td width='2%' class='td_index' valign=\"top\" title=\"拖动调整排序\"></td>"
<%
for(int i=0;i<showfields1.size();i++){
feilds = ((String[])showfields1.get(i));
fieldname = feilds[1];
%>
trstr += "<td valign=\"top\" class=\"td1_<%=fieldname %>\">"
<%if(i==0){%>
trstr += "<input class=\"icheck\" type=\"checkbox\" notBeauty=\"false\" _index=\""+rowindex+"\" />";
trstr += "<input type=\"hidden\" id=\"s_id_value_"+rowindex+"\" name=\"s_id_value_"+rowindex+"\" value=\"\"/>";
trstr += "<input type=\"hidden\" name=\"s_datatype_value_"+rowindex+"\" value=\"3\"/>";
trstr += "<input type=\"hidden\" class=\"value_index\" name=\"s_showorder_value_"+rowindex+"\" value=\"\"/>";
<%}%>
<%if(fieldname.equals("name")||fieldname.equals("target")||fieldname.equals("result")||fieldname.startsWith("custom")){ %>
trstr += "<textarea class=\"area_txt input_txt <%if(i==0){ %>input_first<%} %>\" id=\"s_<%=fieldname %>_value_"+rowindex+"\" name=\"s_<%=fieldname %>_value_"+rowindex+"\"></textarea>";
<%}else if(fieldname.indexOf("date")>-1){//日期 %>
trstr += "<button type=\"button\" class=\"Calendar Calendar_d\" onclick=\"getMyDate('s_<%=fieldname %>_value_"+rowindex+"','s_<%=fieldname %>_span_"+rowindex+"')\"></button>";
trstr += "<span id=\"s_<%=fieldname %>_span_"+rowindex+"\" class=\"datespan\"></span>";
trstr += "<input type=\"hidden\" id=\"s_<%=fieldname %>_value_"+rowindex+"\" name=\"s_<%=fieldname %>_value_"+rowindex+"\" value=\"\">";
<%}else{%>
trstr += "<input class=\"input_txt <%if(i==0){%>input_first<%}%>\" type=\"text\" id=\"s_<%=fieldname %>_value_"+rowindex+"\" name=\"s_<%=fieldname %>_value_"+rowindex+"\" ";
<%if(fieldname.equals("days1")||fieldname.equals("days2")||fieldname.equals("finishrate")){%>
trstr += " onkeypress=\"ItemNum_KeyPress('s_<%=fieldname %>_value_"+rowindex+"')\" onblur=\"checknumber('s_<%=fieldname %>_value_"+rowindex+"')\" maxlength=\"5\"";
<%} %>
<%if(fieldname.equals("cate")){%>
//分类字段会自动引用前一行数据的分类
var catevalue = "";
if(getVal(insertindex)!=""){
catevalue = jQuery("#s_cate_value_"+insertindex).val();
}else{
if(jQuery("#maintable1").find("tr.tr_show").length>0){
var lastindex = jQuery("#maintable1").find("tr.tr_show:last").attr("_index");
catevalue = jQuery("#s_cate_value_"+lastindex).val();
}
}
trstr += " value=\""+catevalue+"\"";
trstr += " onchange=\"seteditspan(1)\"";
<%}%>
<%if(fieldname.equals("name")||fieldname.equals("cate")){%>
trstr += " maxlength=\"100\"";
<%} %>
trstr += "/>";
<%}%>
trstr += "</td>";
<% } %>
trstr +="<td width=\"2%\" class=\"opttd\"><div class=\"optshow\"> </div></td>";
trstr +="</tr>";
if(getVal(insertindex)!=""){
jQuery("#tr1_"+insertindex).after(trstr);
}else{
jQuery("#maintable1").append(trstr);
}
bindarea("tr1_"+rowindex);
rowindex = rowindex*1.0+1;
jQuery("#index1").val(rowindex);
setIndex(1);
<%if(hascate1){%>seteditspan(1);<%}%>
}
//删除计划外工作总结
function doDelRow1(){
var checks = jQuery("#maintable1").find("input:checked");
if(checks.length>0){
confirmStyle("确定删除选择明细项?",function(){
checks.each(function(){
var _index = jQuery(this).attr("_index");
jQuery("#tr1_"+_index).remove();
});
setIndex(1);
});
}else{
alertStyle("请选择删除项!");
}
}
//添加工作计划
function doAddRow2(insertindex){
var fieldval = "";
var trstr = "<tr id=\"tr2_"+rowindex2+"\" class=\"tr_data tr_show\" _index=\""+rowindex2+"\" _type='2'>";
trstr += "<td width='2%' class='td_index' valign=\"top\" title=\"拖动调整排序\"></td>"
<%
for(int i=0;i<showfields2.size();i++){
feilds = ((String[])showfields2.get(i));
fieldname = feilds[1];
%>
fieldval = "";
if(itemMap!=null) fieldval = getVal(itemMap.get("<%=fieldname%>"));
trstr += "<td valign=\"top\" class=\"td2_<%=fieldname %>\">"
<%if(i==0){%>
trstr += "<input class=\"icheck\" type=\"checkbox\" notBeauty=\"false\" _index=\""+rowindex2+"\" />";
trstr += "<input type=\"hidden\" id=\"p_id_value_"+rowindex2+"\" name=\"p_id_value_"+rowindex2+"\" value=\"\"/>";
trstr += "<input type=\"hidden\" name=\"p_datatype_value_"+rowindex2+"\" value=\"2\"/>";
trstr += "<input type=\"hidden\" class=\"value_index\" name=\"p_showorder_value_"+rowindex2+"\" value=\"\"/>";
<%}%>
<%if(fieldname.equals("name")||fieldname.equals("target")||fieldname.equals("result")||fieldname.startsWith("custom")){ %>
trstr += "<textarea class=\"area_txt input_txt <%if(i==0){ %>input_first<%} %>\" id=\"p_<%=fieldname %>_value_"+rowindex2+"\" name=\"p_<%=fieldname %>_value_"+rowindex2+"\">"+fieldval+"</textarea>";
<%}else if(fieldname.indexOf("date")>-1){//日期 %>
trstr += "<button type=\"button\" class=\"Calendar Calendar_d\" onclick=\"getMyDate('p_<%=fieldname %>_value_"+rowindex2+"','p_<%=fieldname %>_span_"+rowindex2+"')\"></button>";
trstr += "<span id=\"p_<%=fieldname %>_span_"+rowindex2+"\" class=\"datespan\">"+fieldval+"</span>";
trstr += "<input type=\"hidden\" id=\"p_<%=fieldname %>_value_"+rowindex2+"\" name=\"p_<%=fieldname %>_value_"+rowindex2+"\" value=\""+fieldval+"\">";
<%}else{%>
trstr += "<input class=\"input_txt <%if(i==0){%>input_first<%}%>\" type=\"text\" id=\"p_<%=fieldname %>_value_"+rowindex2+"\" name=\"p_<%=fieldname %>_value_"+rowindex2+"\"";
<%if(fieldname.equals("days1")||fieldname.equals("days2")||fieldname.equals("finishrate")){%>
trstr += " onkeypress=\"ItemNum_KeyPress('p_<%=fieldname %>_value_"+rowindex2+"')\" onblur=\"checknumber('p_<%=fieldname %>_value_"+rowindex2+"')\" maxlength=\"5\"";
<%} %>
<%if(fieldname.equals("cate")){%>
//分类字段会自动引用前一行数据的分类
if(itemMap==null){
if(getVal(insertindex)!=""){
fieldval = jQuery("#p_cate_value_"+insertindex).val();
}else{
if(jQuery("#maintable2").find("tr.tr_show").length>0){
var lastindex = jQuery("#maintable2").find("tr.tr_show:last").attr("_index");
fieldval = jQuery("#p_cate_value_"+lastindex).val();
}
}
}
trstr += " onchange=\"seteditspan(2)\"";
<%}%>
<%if(fieldname.equals("name")||fieldname.equals("cate")){%>
trstr += " maxlength=\"100\"";
<%} %>
trstr += " value=\""+fieldval+"\"/>";
<%} %>
trstr += "</td>";
<% } %>
trstr +="<td width=\"2%\" class=\"opttd\"><div class=\"optshow\"> </div></td>";
trstr +="</tr>";
if(getVal(insertindex)!=""){
jQuery("#tr2_"+insertindex).after(trstr);
}else{
jQuery("#maintable2").append(trstr);
}
bindarea("tr2_"+rowindex2);
rowindex2 = rowindex2*1.0+1;
jQuery("#index2").val(rowindex2);
itemMap = null;
setIndex(2);
<%if(hascate2){%>seteditspan(2);<%}%>
}
//删除工作计划
function doDelRow2(){
var checks = jQuery("#maintable2").find("input:checked");
if(checks.length>0){
confirmStyle("确定删除选择明细项?",function(){
checks.each(function(){
var _index = jQuery(this).attr("_index");
jQuery("#tr2_"+_index).remove();
});
setIndex(2);
});
}else{
alertStyle("请选择删除项!");
}
}
//插入一行数据
function insertRow(obj){
var index = jQuery(obj).parent().attr("_index");
var type = jQuery(obj).parent().attr("_type");
if(type==1){
doAddRow1(index);
}else{
doAddRow2(index);
}
}
<%}%>
<%if(canaudit){ %>
function doApprove(obj) {
confirmStyle("确定批准此计划报告?",function(){
jQuery("#operation").val("approve");
showload(obj);
jQuery("#form1").submit();
});
}
function doReturn(obj) {
confirmStyle("确定退回此计划报告?",function(){
jQuery("#operation").val("return");
showload(obj);
jQuery("#form1").submit();
});
}
<%}%>
<%if(canreset){ %>
function doReset(obj){
confirmStyle("确定重新编写总结计划?",function(){
jQuery("#operation").val("reset");
showload(obj);
jQuery("#form1").submit();
});
}
<%}%>
<%if(candel){ %>
function doDel(obj){
confirmStyle("确定删除此总结计划?",function(){
jQuery("#operation").val("delete");
showload(obj);
jQuery("#form1").submit();
});
}
<%}%>
function changeYear(year){
window.location = "PlanView.jsp?resourceid=<%=resourceid%>&year="+year+"&type1=<%=type1%>&type2=<%=type2%>";
}
function changeType(type){
window.location = "PlanView.jsp?resourceid=<%=resourceid%>&year=<%=year%>&type1="+type;
}
function changeType2(type){
window.location = "PlanView.jsp?resourceid=<%=resourceid%>&year=<%=year%>&type1=<%=type1%>&type2="+type;
}
function showload(obj){
if(obj!=null && typeof(obj)!="undefined"){
obj.disabled = true;
}
jQuery("#operate_panel").html(loadstr);
}
document.onkeydown=keyListener;
function keyListener(e){
e = e ? e : event;
if(e.keyCode == 13){
if(event.ctrlKey){
saveExchange()
}
}
}
function saveExchange(){
if(jQuery("#content").val()==""){
alertStyle("请填写意见内容!");
}else{
jQuery("#exchangebtn").hide();
jQuery("#exchangeload").show();
jQuery.ajax({
type: "post",
url: "PlanOperation.jsp",
data:{"operation":"add_exchange","planid":"<%=planid%>","content":filter(encodeURIComponent(jQuery("#content").val()))},
contentType : "application/x-www-form-urlencoded;charset=UTF-8",
complete: function(data){
if(data!=""){
var txt = $.trim(data.responseText);
jQuery("#exchange").after(txt);
}
jQuery("#exchangebtn").show();
jQuery("#exchangeload").hide();
jQuery("#content").val("").blur();
}
});
}
}
function contentFocus(){
if(jQuery("#content").val()==""){
jQuery("#content").addClass("content_focus");
jQuery("#exchangebtn").show();
var st = jQuery(document).scrollTop();
jQuery(document).scrollTop(st+80);
}
}
function contentBlur(){
if(jQuery("#content").val()==""){
jQuery("#content").removeClass("content_focus");
jQuery("#exchangebtn").hide();
}
}
function showDetail(obj){
var index = jQuery(obj).parent().attr("_index");
var type = jQuery(obj).parent().attr("_type");
showDetail2(index,type);
}
function showDetail2(index,type){
var detailid_id = "s_id_value_"+index;
if(type==2) detailid_id = "p_id_value_"+index;
var detailid = getVal(jQuery("#"+detailid_id).val());
if(detailid==""){
savedetail(index,type);
}else{
<%if(canedit){%>
savedetail(index,type,2,detailid);
<%}else{%>
openDetail(index,type,detailid);
<%}%>
}
}
function openDetail(index,type,detailid){
var viewdate = "";
if(jQuery("#fbnew_"+index+"_"+type).length>0){
jQuery("#fbnew_"+index+"_"+type).remove();
viewdate = "<%=viewdate%>";
}
var h = jQuery(window).height()-100;
jQuery("#detailframe").height(h-4).attr("src","/workrelate/plan/data/DetailView.jsp?viewdate="+viewdate+"&fromplan=1&parentindex="+index+"&parenttype="+type+"&plandetailid="+detailid+"&"+new Date().getTime());
jQuery("#plandetail").height(h).show();
jQuery("body").css("overflow","hidden");
}
function closeDetail(){
jQuery("#plandetail").hide();
jQuery("#detailframe").attr("src","");
jQuery("body").css("overflow","");
}
// 设置序号
function setIndex(tableindex){
var index=1;
if(tableindex==2){
jQuery("#maintable2").find("tr.tr_show").each(function(){
if(!jQuery(this).hasClass("tr_blank")){
jQuery(this).find("td.td_index").html(index);
jQuery(this).find("input.value_index").val(index);
index++;
}
});
}else{
jQuery("#maintable1").find("tr.tr_show0").each(function(){
if(!jQuery(this).hasClass("tr_blank")){
jQuery(this).find("td.td_index").html(index);
jQuery(this).find("input.value_index").val(index);
index++;
}
});
index=1;
jQuery("#maintable1").find("tr.tr_show1").each(function(){
if(!jQuery(this).hasClass("tr_blank")){
jQuery(this).find("td.td_index").html(index);
jQuery(this).find("input.value_index").val(index);
index++;
}
});
}
}
function createTask(obj){
var index = jQuery(obj).parent().attr("_index");
var type = jQuery(obj).parent().attr("_type");
var name = getVal(jQuery("#"+((type==1)?"s":"p")+"_name_value_"+index).val());
if(name==""){
alertStyle("请填写标题!");
return;
}
confirmStyle("确定创建任务?",function(){
var detailid_id = "s_id_value_"+index;
if(type==2) detailid_id = "p_id_value_"+index;
var detailid = getVal(jQuery("#"+detailid_id).val());
if(detailid==""){
savedetail(index,type);
}else{
saveTask(index,type);
}
});
}
function saveTask(index,type){
var begindate = "";
var enddate = "";
var tag = "s";
var detailid_id = "s_id_value_"+index;
if(type==1){
begindate = getVal(jQuery("#s_begindate2_value_"+index).val());
enddate = getVal(jQuery("#s_enddate2_value_"+index).val());
}else{
tag = "p";
detailid_id = "p_id_value_"+index;
begindate = getVal(jQuery("#p_begindate1_value_"+index).val());
enddate = getVal(jQuery("#p_enddate1_value_"+index).val());
}
var detailid = getVal(jQuery("#"+detailid_id).val());
jQuery.ajax({
type: "post",
url: "/workrelate/task/data/Operation.jsp",
data:{"operation":"add","plandetailid":detailid,"principalid":"<%=resourceid%>"
,"taskName":getsaveval(jQuery("#"+tag+"_name_value_"+index).val())
,"begindate":begindate
,"enddate":enddate
},
contentType : "application/x-www-form-urlencoded;charset=UTF-8",
complete: function(data){
var txt = $.trim(data.responseText);
if(txt!=""){
var taskid = txt.split("$")[0];
showTask(taskid);
}
}
});
}
<%if(canedit){%>
//保存明细信息
function savedetail(index,type,callback,detailid){
var _detailid = getVal(detailid);
var operation = "save_detail";
if(callback==2) operation = "edit_detail";
var tag = "s";
if(type==2) tag = "p";
jQuery.ajax({
type: "post",
url: "/workrelate/plan/data/Operation.jsp",
data:{"operation":operation,"planid":"<%=planid%>","type":type,"resourceid":"<%=resourceid%>","plandetailid":_detailid
,"name":getsaveval(jQuery("#"+tag+"_name_value_"+index).val())
,"cate":getsaveval(jQuery("#"+tag+"_cate_value_"+index).val())
,"begindate1":getsaveval(jQuery("#"+tag+"_begindate1_value_"+index).val())
,"enddate1":getsaveval(jQuery("#"+tag+"_enddate1_value_"+index).val())
,"begindate2":getsaveval(jQuery("#"+tag+"_begindate2_value_"+index).val())
,"enddate2":getsaveval(jQuery("#"+tag+"_enddate2_value_"+index).val())
,"days1":getsaveval(jQuery("#"+tag+"_days1_value_"+index).val())
,"target":getsaveval(jQuery("#"+tag+"_target_value_"+index).val())
,"begindate2":getsaveval(jQuery("#"+tag+"_begindate2_value_"+index).val())
,"enddate2":getsaveval(jQuery("#"+tag+"_enddate2_value_"+index).val())
,"days2":getsaveval(jQuery("#"+tag+"_days2_value_"+index).val())
,"finishrate":getsaveval(jQuery("#"+tag+"_finishrate_value_"+index).val())
,"result":getsaveval(jQuery("#"+tag+"_result_value_"+index).val())
,"custom1":getsaveval(jQuery("#"+tag+"_custom1_value_"+index).val())
,"custom2":getsaveval(jQuery("#"+tag+"_custom2_value_"+index).val())
,"custom3":getsaveval(jQuery("#"+tag+"_custom3_value_"+index).val())
,"custom4":getsaveval(jQuery("#"+tag+"_custom4_value_"+index).val())
,"custom5":getsaveval(jQuery("#"+tag+"_custom5_value_"+index).val())
},
contentType : "application/x-www-form-urlencoded;charset=UTF-8",
complete: function(data){
var txt = $.trim(data.responseText);
_detailid = txt;
//alert(_detailid);
jQuery("#"+tag+"_id_value_"+index).val(txt);
if(callback==1){
saveTask(index,type);
}else{
openDetail(index,type,_detailid);
//showDetail2(index,type);
}
}
});
}
function getMyDate(inputname,spanname){
WdatePicker({el:spanname,onpicked:function(dp){
var returnvalue = dp.cal.getDateStr();
var spanvalue = returnvalue.substring(5).replace("-",".");
jQuery("#"+spanname).html(spanvalue).attr("title",returnvalue);
$dp.$(inputname).value = returnvalue;
checkMyDate(inputname);
},oncleared:function(dp){$dp.$(inputname).value = ''}});
}
function checkMyDate(inputname){
var daysid = "";
if(inputname.indexOf("begindate1")>-1 || inputname.indexOf("enddate1")>-1){
var begindate1 = "";
var enddate1 = "";
var days1 = "";
if(inputname.indexOf("begindate1")>-1){
daysid = inputname.replace("begindate1","days1");
begindate1 = getVal(jQuery("#"+inputname).val());
if(jQuery("#"+inputname.replace("begindate1","enddate1")).length>0)
enddate1 = getVal(jQuery("#"+inputname.replace("begindate1","enddate1")).val());
}else if(inputname.indexOf("enddate1")>-1){
daysid = inputname.replace("enddate1","days1");
if(jQuery("#"+inputname.replace("enddate1","begindate1")).length>0)
begindate1 = getVal(jQuery("#"+inputname.replace("enddate1","begindate1")).val());
enddate1 = getVal(jQuery("#"+inputname).val());
}
if(begindate1!="" && enddate1!=""){
days1 = compdatedays(begindate1,enddate1);
if(days1<0){
alertStyle("结束日期不能小于开始日期!");
jQuery("#"+inputname).val("");
jQuery("#"+inputname.replace("value","span")).html("");
}else{
if(jQuery("#"+daysid).length>0)
jQuery("#"+daysid).val(days1);
}
}
}
else if(inputname.indexOf("begindate2")>-1 || inputname.indexOf("enddate2")>-1){
var begindate2 = "";
var enddate2 = "";
var days2 = "";
if(inputname.indexOf("begindate2")>-1){
daysid = inputname.replace("begindate2","days2");
begindate2 = getVal(jQuery("#"+inputname).val());
if(jQuery("#"+inputname.replace("begindate2","enddate2")).length>0)
enddate2 = getVal(jQuery("#"+inputname.replace("begindate2","enddate2")).val());
}else if(inputname.indexOf("enddate2")>-1){
daysid = inputname.replace("enddate2","days2");
if(jQuery("#"+inputname.replace("enddate2","begindate2")).length>0)
begindate2 = getVal(jQuery("#"+inputname.replace("enddate2","begindate2")).val());
enddate2 = getVal(jQuery("#"+inputname).val());
}
if(begindate2!="" && enddate2!=""){
days2 = compdatedays(begindate2,enddate2);
if(days2<0){
alertStyle("结束日期不能小于开始日期!");
jQuery("#"+inputname).val("");
jQuery("#"+inputname.replace("value","span")).html("");
}else{
if(jQuery("#"+daysid).length>0)
jQuery("#"+daysid).val(days2);
}
}
}
}
<%}%>
function showLog(obj){
jQuery(obj).remove();
//jQuery("div.logview").show();
jQuery("#btnmore").html("<img src='../images/loading2.gif' align='absMiddle'/>").show();
jQuery("div.log_op").hide();
getMoreLog(jQuery("#btnmore"));
}
//读取更多日志
function getMoreLog(obj){
var btnobj = jQuery(obj);
var _currentpage = parseInt(btnobj.attr("_currentpage"))+1;
var _pagesize = btnobj.attr("_pagesize");
var _total = btnobj.attr("_total");
btnobj.html("<img src='../images/loading2.gif' align='absMiddle'/>");
$.ajax({
type: "post",
url: "/workrelate/plan/data/Operation.jsp",
data:{"operation":"get_more_log","currentpage":_currentpage,"pagesize":_pagesize,"total":_total,"planid":"<%=planid%>"},
contentType : "application/x-www-form-urlencoded;charset=UTF-8",
complete: function(data){
var txt = $.trim(data.responseText);
btnobj.before(txt);
var st = document.body.scrollTop;
jQuery("html, body").scrollTop(st+210);
if(_currentpage*_pagesize>=_total){
btnobj.hide();
}else{
btnobj.attr("_currentpage",_currentpage).html("...").show();
}
}
});
}
<%if(editshare){%>
function doShare(){
var t = jQuery("#sharetitle").offset().top;
jQuery('html, body').scrollTop(t);
onShowMutiHrm('shareids','shareidsSpan');
}
function onShowMutiHrm(inputid,inputspan) {
var resourceids = $("#"+inputid).val();
var diag;
try{
var _parentWin = window;
while (_parentWin != _parentWin.parent) {
if (_parentWin.parent.document.getElementsByTagName("FRAMESET").length > 0 && _parentWin == _parentWin.parent) break;
_parentWin = _parentWin.parent;
}
if(_parentWin.document.getElementsByTagName("FRAMESET").length > 0){
diag = new Dialog();
}else{
diag = new _parentWin.Dialog();
}
}catch(e){
diag = new Dialog();
}
diag.Title = "选择共享人员";
diag.URL = "/systeminfo/BrowserMain.jsp?url=/hrm/resource/MutiResourceBrowser.jsp?resourceids="+resourceids;
diag.Width = 660;
diag.Height = 600;
diag.callback=function(datas){
if (datas) {
confirmStyle("确定保存共享设置?",function(){
jQuery.ajax({
type: "post",
url: "PlanOperation.jsp",
data:{"operation":"set_share","planid":"<%=planid%>","shareids":datas.id},
contentType : "application/x-www-form-urlencoded;charset=UTF-8",
complete: function(data){
if(datas.id!=""){
$("#"+inputid).val(datas.id);
//$("#"+inputspan).html(datas.name.substring(1));
var ids = datas.id.split(",");
var names = datas.name.split(",");
var showname = "";
for(var i=0;i<ids.length;i++){
if(ids[i]!="") showname += "<a href='javaScript:openhrm("+ids[i]+ ");' onclick='pointerXY(event);'>"+names[i]+"</a> ";
}
$("#"+inputspan).html(showname);
}else{
$("#"+inputid).val("");
$("#"+inputspan).html("");
}
var txt = $.trim(data.responseText);
jQuery("div.log_op:first").before(txt);
}
});
});
}
};
diag.show();
}
<%}%>
</script>
</BODY>
</HTML>
<%@ include file="/workrelate/plan/util/uploader.jsp" %>
<%!
private String convertdate(String datestr){
datestr = Util.null2String(datestr);
if(datestr.length()==10){
datestr = datestr.substring(5).replace("-",".");
}
return datestr;
}
%>