BaseSetting.jsp
17.6 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
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="/systeminfo/init_wev8.jsp"%>
<jsp:useBean id="CompanyComInfo" class="weaver.hrm.company.CompanyComInfo" scope="page" />
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page" />
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page" />
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page" />
<jsp:useBean id="cmutil" class="weaver.gp.util.TransUtil" scope="page" />
<jsp:useBean id="ctutil" class="weaver.workrelate.util.CommonTransUtil" scope="page" />
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="MainCategoryComInfo" class="weaver.docs.category.MainCategoryComInfo" scope="page" />
<jsp:useBean id="SubCategoryComInfo" class="weaver.docs.category.SubCategoryComInfo" scope="page" />
<jsp:useBean id="SecCategoryComInfo" class="weaver.docs.category.SecCategoryComInfo" scope="page" />
<%
boolean canedit = false;
//判断是否有权限
if (HrmUserVarify.checkUserRight("GP_BaseSettingMaint", user)) {
canedit = true;
}
%>
<HTML>
<HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
<style type="text/css">
.maintable,.listtable{width: 100%;}
.maintable td,.listtable td{line-height: 28px;padding-left: 5px;}
.maintable td.title{background: #E9E7D8;}
.listtable td{border-bottom: 1px #F1F0E7 solid;}
.listtable tr.header td{font-weight: bold;border-bottom: 1px #DDD9C3 solid;}
.sbSelector{line-height:23px !important;}
.end_txt{vertical-align: middle;}
</style>
<%@ include file="/secondwev/common/head.jsp" %>
</head>
<%
String type = Util.fromScreen3(request.getParameter("resourcetype"), user.getLanguage());
String orgId = Util.fromScreen3(request.getParameter("resourceid"), user.getLanguage());
String titlename = "";
if (type.equals("1")) {
titlename += CompanyComInfo.getCompanyname(orgId);
} else if (type.equals("2")) {
titlename += SubCompanyComInfo.getSubCompanyname(orgId);
} else if (type.equals("3")) {
titlename += DepartmentComInfo.getDepartmentname(orgId);
} else if (type.equals("4")){
titlename += ResourceComInfo.getLastname(orgId);
}
titlename += "计划报告基础设置";
String setid = "";
int isweek = 0;
int ismonth = 0;
int iswremind = 0;
int ismremind = 0;
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 programcreate = "";
String reportaudit = "";
int manageraudit = 0;
String reportview = "";
int isself = 0;
int ismanager = 0;
String docsecid = "";
String docpath = "";
String sql = "select * from PR_BaseSetting where resourceid=" + orgId + " and resourcetype=" + type;
rs.executeSql(sql);
if(rs.next()){
setid = Util.null2String(rs.getString("id"));
isweek = Util.getIntValue(rs.getString("isweek"),0);
ismonth = Util.getIntValue(rs.getString("ismonth"),0);
iswremind = Util.getIntValue(rs.getString("iswremind"),0);
ismremind = Util.getIntValue(rs.getString("ismremind"),0);
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);
programcreate = ctutil.cutString(rs.getString("programcreate"),",",3);
reportaudit = ctutil.cutString(rs.getString("reportaudit"),",",3);
manageraudit = Util.getIntValue(rs.getString("manageraudit"),0);
reportview = ctutil.cutString(rs.getString("reportview"),",",3);
isself = Util.getIntValue(rs.getString("isself"),0);
ismanager = Util.getIntValue(rs.getString("ismanager"),0);
docsecid = Util.null2String(rs.getString("docsecid"));
}
if(!docsecid.equals("") && !docsecid.equals("0")){
/* int subid = Util.getIntValue(SecCategoryComInfo.getSubCategoryid(docsecid), -1);
int mainid = Util.getIntValue(SubCategoryComInfo.getMainCategoryid(""+subid), -1);
docpath = "/"+MainCategoryComInfo.getMainCategoryname(mainid+"")+
"/"+SubCategoryComInfo.getSubCategoryname(subid+"")+
"/"+SecCategoryComInfo.getSecCategoryname(docsecid); */
docpath = SecCategoryComInfo.getAllParentName(docsecid);
if(!"".equals(docpath)) docpath += "/";
docpath += SecCategoryComInfo.getSecCategoryname(docsecid);
}
%>
<BODY style="overflow: auto">
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp"%>
<%
if(canedit){
RCMenu += "{"+SystemEnv.getHtmlLabelName(86,user.getLanguage())+",javascript:submitData(this),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
if(type.equals("2")){
RCMenu += "{应用到下级分部,javascript:doSync(this),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
}
if(type.equals("3") && !"".equals(setid)){
RCMenu += "{删除设置,javascript:delData(this),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
}
}
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp"%>
<form id="baseForm" name="baseForm" action="BaseOperation.jsp" method="post">
<input type="hidden" name="setid" value="<%=setid %>">
<input type="hidden" name="resourceid" value="<%=orgId %>">
<input type="hidden" name="resourcetype" value="<%=type %>">
<input type="hidden" id="operation" name="operation" value="">
<input class=inputstyle type="hidden" name=num 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">
<div style="width: 100%;line-height: 28px;border-bottom:2px #D6D6D6 solid;font-size: 14px;font-weight: bold;margin-bottom: 10px;">
<%=titlename %>
</div>
<%if(type.equals("2")){%>
<table class="maintable" cellspacing="5" border="0">
<colgroup><col width="20%"/><col width="80%"/></colgroup>
<tr>
<td class="title">启用报告周期</td>
<td>
<input <%if(!canedit){ %> disabled="disabled"<%} %> type="checkbox" id="isweek" name="isweek" onclick="changeCon(this)" _index="1" <%if(isweek==1){%> checked="checked" <%}%> value="<%=isweek %>"/>周报告
<input <%if(!canedit){ %> disabled="disabled"<%} %> type="checkbox" id="ismonth" name="ismonth" onclick="changeCon(this)" _index="2" <%if(ismonth==1){%> checked="checked" <%}%> value="<%=ismonth %>"/>月报告
</td>
</tr>
<tr>
<td colspan="2" class="title">提交起止时间</td>
</tr>
<tr>
<td colspan="2">
<table class="listtable" cellpadding="0" cellspacing="0" border="0">
<colgroup><col width="25%"/><col width="25%"/><col width="25%"/><col width="25%"/></colgroup>
<tr class="header">
<td>类型</td><td>开始时间</td><td>截止时间</td><td>是否提醒</td>
</tr>
<tr id="ds_1" <%if(isweek==0){%>style="display: none"<%} %>>
<td>周报</td>
<td>
<%if(canedit){ %>
<span class="end_txt">结束</span>
<select id="wstarttype" name="wstarttype"><option value="1" <%if(wstarttype==1){ %> selected="selected" <%} %>>后</option><option value="-1" <%if(wstarttype==-1){ %> selected="selected" <%} %>>前</option></select>
<input type="text" size="5" maxlength="10" id="wstartdays" name="wstartdays" onkeypress="ItemCount_KeyPress()" onBlur="checkcount('wstartdays')" value="<%=wstartdays %>"/>
<%}else{ %>
结束<%if(wstarttype==-1){%>前<%}else{%>后<%}%><%=wstartdays%><%}%>天
</td>
<td>
<%if(canedit){ %>
<span class="end_txt">结束</span>
<select id="wendtype" name="wendtype"><option value="1" <%if(wendtype==1){ %> selected="selected" <%} %>>后</option><option value="-1" <%if(wendtype==-1){ %> selected="selected" <%} %>>前</option></select>
<input type="text" size="5" maxlength="10" id="wenddays" name="wenddays" onkeypress="ItemCount_KeyPress()" onBlur="checkcount('wenddays')" value="<%=wenddays %>"/>
<%}else{ %>
结束<%if(wendtype==-1){%>前<%}else{%>后<%}%><%=wenddays%><%}%>天
</td>
<td>
<input <%if(!canedit){ %> disabled="disabled"<%} %> type="checkbox" id="iswremind" name="iswremind" <%if(iswremind==1){%> checked="checked" <%}%> value="<%=iswremind %>"/>
</td>
</tr>
<tr id="ds_2" <%if(ismonth==0){%>style="display: none"<%} %>>
<td>月报</td>
<td>
<%if(canedit){ %>
<span class="end_txt">结束</span>
<select id="mstarttype" name="mstarttype"><option value="1" <%if(mstarttype==1){ %> selected="selected" <%} %>>后</option><option value="-1" <%if(mstarttype==-1){ %> selected="selected" <%} %>>前</option></select>
<input type="text" size="5" maxlength="10" id="mstartdays" name="mstartdays" onkeypress="ItemCount_KeyPress()" onBlur="checkcount('mstartdays')" value="<%=mstartdays %>"/>
<%}else{ %>
结束<%if(mstarttype==-1){%>前<%}else{%>后<%}%><%=mstartdays%><%}%>天
</td>
<td>
<%if(canedit){ %>
<span class="end_txt">结束</span>
<select id="mendtype" name="mendtype"><option value="1" <%if(mendtype==1){ %> selected="selected" <%} %>>后</option><option value="-1" <%if(mendtype==-1){ %> selected="selected" <%} %>>前</option></select>
<input type="text" size="5" maxlength="10" id="menddays" name="menddays" onkeypress="ItemCount_KeyPress()" onBlur="checkcount('menddays')" value="<%=menddays %>"/>
<%}else{ %>
结束<%if(mendtype==-1){%>前<%}else{%>后<%}%><%=menddays %><%}%>天
</td>
<td>
<input <%if(!canedit){ %> disabled="disabled"<%} %> type="checkbox" id="ismremind" name="ismremind" <%if(ismremind==1){%> checked="checked" <%}%> value="<%=ismremind %>"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%} %>
<table class="maintable" cellspacing="5" border="0" style="margin-top: 20px;">
<colgroup><col width="20%"/><col width="30%"/><col width="20%"/><col width="30%"/></colgroup>
<tr>
<td class="title">报告模版制定人</td>
<td>
<%if(canedit){ %>
<INPUT class="wuiBrowser" type="hidden" id="programcreate" name="programcreate" value="<%=programcreate %>"
_displayTemplate="<A href='javaScript:openhrm(#b{id})' onclick='pointerXY(event)'>#b{name}</A>"
_displayText="<%=cmutil.getPerson(programcreate) %>" _param="resourceids"
_url="/systeminfo/BrowserMain.jsp?url=/hrm/resource/MutiResourceBrowser.jsp" />
<%}else{ %>
<%=cmutil.getPerson(programcreate) %>
<%} %>
</td>
<td class="title">报告审批人</td>
<td>
<table style="width: 100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="50%" style="padding: 0px;">
<%if(canedit){ %>
<input class="wuiBrowser" type="hidden" id="reportaudit" name="reportaudit" value="<%=reportaudit %>"
_displayTemplate="<A href='javaScript:openhrm(#b{id})' onclick='pointerXY(event)'>#b{name}</A>"
_displayText="<%=cmutil.getPerson(reportaudit) %>" _param="resourceids"
_url="/systeminfo/BrowserMain.jsp?url=/hrm/resource/MutiResourceBrowser.jsp" />
<%}else{ %>
<%=cmutil.getPerson(reportaudit) %>
<%} %>
</td>
<td width="50%" style="padding: 0px;">
<input <%if(!canedit){ %> disabled="disabled"<%} %> type="checkbox" id="manageraudit" name="manageraudit" <%if(manageraudit==1){%> checked="checked" <%}%> value="<%=manageraudit %>"/>
直接上级审批
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="title">报告结果查看人</td>
<td colspan="3">
<%if(canedit){ %>
<input class="wuiBrowser" type="hidden" id="reportview" name="reportview" value="<%=reportview %>"
_displayTemplate="<A href='javaScript:openhrm(#b{id})' onclick='pointerXY(event)'>#b{name}</A>"
_displayText="<%=cmutil.getPerson(reportview) %>" _param="resourceids"
_url="/systeminfo/BrowserMain.jsp?url=/hrm/resource/MutiResourceBrowser.jsp" />
<%}else{ %>
<%=cmutil.getPerson(reportview) %>
<%} %>
</td>
</tr>
<tr>
<td class="title">个人定义方案</td>
<td>
<input <%if(!canedit){ %> disabled="disabled"<%} %> type="checkbox" id="isself" name="isself" _index="1" <%if(isself==1){%> checked="checked" <%}%> value="<%=isself %>"/>
</td>
<td class="title">上级定义方案</td>
<td>
<input <%if(!canedit){ %> disabled="disabled"<%} %> type="checkbox" id="ismanager" name="ismanager" _index="1" <%if(ismanager==1){%> checked="checked" <%}%> value="<%=ismanager %>"/>
</td>
</tr>
<tr>
<td class="title">附件上传目录</td>
<td colspan="3">
<%if(canedit){ %>
<div id="docseciddiv" class="browserdiv"></div>
<%}else{ %>
<%=docpath %>
<%} %>
</td>
</tr>
<%if(canedit){ %>
<tr>
<td class="title">应用到其他<%if("3".equals(type)){%>部门<%}else{%>分部<%} %></td>
<td>
<%if("3".equals(type)){ %>
<INPUT class="wuiBrowser" type="hidden" id="departmentids" name="departmentids" value=""
_param="selectedids" _url="/systeminfo/BrowserMain.jsp?url=/hrm/company/MutiDepartmentBrowser.jsp" />
<%}else{%>
<INPUT class="wuiBrowser" type="hidden" id="subcompanyids" name="subcompanyids" value=""
_param="selectedids" _url="/systeminfo/BrowserMain.jsp?url=/hrm/company/MutiSubcompanyBrowser.jsp" />
<%} %>
</td>
</tr>
<%} %>
</table>
</td>
<td></td>
</tr>
</table>
</form>
<script type="text/javascript" defer="defer">
<%if(canedit){ %>
jQuery(document).ready(function(){
jQuery("input[type=checkbox]").bind("click",function(){
if(jQuery(this).attr("checked")){
jQuery(this).val(1);
}else{
jQuery(this).val(0);
}
});
jQuery("#docseciddiv").e8Browser({
name:"docsecid",
viewType:"0",
browserValue:"<%=docsecid%>",
isMustInput:"1",
browserSpanValue:"<%=docpath%>",
hasInput:false,
linkUrl:"#",
isSingle:true,
completeUrl:"",
//browserUrl:"/systeminfo/BrowserMain.jsp?url=/docs/category/CategoryBrowser.jsp",
browserUrl:"/systeminfo/BrowserMain.jsp?url=/workrelate/comm/MultiCategorySingleBrowser.jsp",
width:"",
hasAdd:false,
needHidden:true,
defaultRow: 1,
zDialog:true,
isAutoComplete:false,
_callback:"",
nameKey:"path"
});
});
function submitData(obj) {
if(checkVal()){
jQuery("#operation").val("save");
obj.disabled = true;
jQuery("#baseForm").submit();
}
}
function doSync(obj){
if(checkVal()){
jQuery("#operation").val("sync");
obj.disabled = true;
jQuery("#baseForm").submit();
}
}
function delData(obj){
var sid = $("input[name='setid']").val();
if(sid=="" || sid==null){
alert("该部门报告暂无设置!");
return false;
}
if(confirm("确定删除该设置?")){
jQuery("#operation").val("del");
obj.disabled = true;
jQuery("#baseForm").submit();
}
}
function checkVal(){
var scoremin = getFloatVal($("#scoremin").val());
var scoremax = getFloatVal($("#scoremax").val());
if(scoremin>scoremax){
alert("评分最大值不能小于最小值!");
return false;
}
var revisemin = getFloatVal($("#revisemin").val());
var revisemax = getFloatVal($("#revisemax").val());
if(revisemin>revisemax){
alert("修正分最大值不能小于最小值!");
return false;
}
return true;
}
function getFloatVal(val){
if(isNaN(parseFloat(val))){
return 0;
}else{
return parseFloat(val);
}
}
function changeCon(obj){
var _index = jQuery(obj).attr("_index");
if(jQuery(obj).attr("checked")){
jQuery("#ds_"+_index).show();
}else{
jQuery("#ds_"+_index).hide();
}
}
function onShowCatalog() {
var datas = showModalDialog("/systeminfo/BrowserMain.jsp?url=/docs/category/MultiCategorySingleBrowser.jsp");
if (datas) {
if (datas.id!= "") {
jQuery("#docpath").html(datas.path);
jQuery("#docsecid").val(datas.id);
}else{
jQuery("#docpath").html("");
jQuery("#docsecid").val("");
}
}
}
<%}%>
</script>
</BODY>
</HTML>