CostCenterViewInner.jsp
18.1 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
<%@page import="weaver.fna.general.FnaCommon"%>
<%@page import="org.apache.commons.lang.StringEscapeUtils"%>
<%@page import="weaver.fna.maintenance.BudgetfeeTypeComInfo"%>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@page import="weaver.hrm.HrmUserVarify"%>
<%@page import="weaver.hrm.User"%>
<%@ page import="weaver.general.Util" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="UserDefaultManager" class="weaver.docs.tools.UserDefaultManager" scope="session" />
<%
if(!HrmUserVarify.checkUserRight("BudgetCostCenter:maintenance", user)){
response.sendRedirect("/notice/noright.jsp") ;
return ;
}
BudgetfeeTypeComInfo budgetfeeTypeComInfo = new BudgetfeeTypeComInfo();
String imagefilename = "/images/hdMaintenance_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(332,user.getLanguage());//全部
String needfav ="1";
String needhelp ="";
int detachable=Util.getIntValue(String.valueOf(session.getAttribute("detachable")),0);
int parentid=Util.getIntValue(request.getParameter("paraid"),0);
int fccId = Util.getIntValue(request.getParameter("fccId"),0);
String nameQuery = Util.null2String(request.getParameter("nameQuery")).trim();
String advQryArchive = Util.null2String(request.getParameter("advQryArchive")).trim();
String qryFccCode = Util.null2String(request.getParameter("qryFccCode")).trim();
int type = 0;
String sql = "select a.type from FnaCostCenter a where a.id = "+fccId;
rs.executeSql(sql);
if(rs.next()){
type = Util.getIntValue(rs.getString("type"), 0);
}
%>
<html>
<head>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<script language="javascript" src="/js/weaver_wev8.js"></script>
<script language="javascript" src="/fna/js/e8Common_wev8.js?r=3"></script>
</head>
<body style="overflow:hidden;">
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
if(type==0){
RCMenu += "{"+SystemEnv.getHtmlLabelNames("82,178",user.getLanguage())+",javascript:addLb("+fccId+"),_TOP} ";//新建类别
RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{"+SystemEnv.getHtmlLabelNames("82,515",user.getLanguage())+",javascript:addSub("+fccId+"),_TOP} ";//新建成本中心
RCMenuHeight += RCMenuHeightStep ;
}
// RCMenu += "{"+SystemEnv.getHtmlLabelName(127095,user.getLanguage())+",javascript:exportSelect(),_TOP} ";//导出所选记录
// RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{"+SystemEnv.getHtmlLabelName(125595,user.getLanguage())+",javascript:exportAll(),_TOP} ";//全部导出
RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{"+SystemEnv.getHtmlLabelName(32136,user.getLanguage())+",javascript:batchDel(),_TOP} ";//批量删除
RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{"+SystemEnv.getHtmlLabelName(26601,user.getLanguage())+",javascript:batchImp(),_TOP} ";//批量导入
RCMenuHeight += RCMenuHeightStep ;
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<form name="form2" method="post" action="/fna/costCenter/CostCenterViewInner.jsp">
<input type="hidden" id="fccId" name="fccId" value="<%=fccId %>" />
<input type="hidden" id="type" name="type" value="<%=type %>" />
<table id="topTitle" cellpadding="0" cellspacing="0">
<tr>
<td>
</td>
<td class="rightSearchSpan" style="text-align:right; width:500px!important">
<input type="button" value="<%=SystemEnv.getHtmlLabelNames("82,178",user.getLanguage()) %>" class="e8_btn_top" onclick="addLb(<%=fccId %>);"/><!-- 新建类别 -->
<input type="button" value="<%=SystemEnv.getHtmlLabelNames("82,515",user.getLanguage()) %>" class="e8_btn_top" onclick="addSub(<%=fccId %>);"/><!-- 新建成本中心 -->
<%-- <input type="button" value="<%=SystemEnv.getHtmlLabelName(127095,user.getLanguage()) %>" class="e8_btn_top" onclick="exportSelect()"/><!-- 导出所选记录 --> --%>
<input type="button" value="<%=SystemEnv.getHtmlLabelName(125595,user.getLanguage()) %>" class="e8_btn_top" onclick="exportAll()"/><!-- 全部导出 -->
<input type="button" value="<%=SystemEnv.getHtmlLabelName(32136,user.getLanguage()) %>" class="e8_btn_top" onclick="batchDel()"/><!-- 批量删除 -->
<input type="button" value="<%=SystemEnv.getHtmlLabelName(26601,user.getLanguage()) %>" class="e8_btn_top" onclick="batchImp()"/><!-- 批量导入 -->
<input type="text" class="searchInput" id="nameQuery" name="nameQuery" value="<%=FnaCommon.escapeHtml(nameQuery) %>" /><!-- 快速搜索 -->
<span id="advancedSearch" class="advancedSearch"><%=SystemEnv.getHtmlLabelName(21995,user.getLanguage()) %></span><!-- 高级搜索 -->
<span title="<%=SystemEnv.getHtmlLabelName(23036,user.getLanguage()) %>" class="cornerMenu"></span><!-- 菜单 -->
</td>
</tr>
</table>
<!-- advanced search -->
<div class="advancedSearchDiv" id="advancedSearchDiv">
<wea:layout type="4Col">
<wea:group context='<%=SystemEnv.getHtmlLabelName(32905, user.getLanguage()) %>'>
<wea:item><%=SystemEnv.getHtmlLabelName(195,user.getLanguage())%></wea:item><!-- 名称 -->
<wea:item>
<input type=text id="advQryName" name="advQryName" class=Inputstyle value='<%=FnaCommon.escapeHtml(nameQuery) %>' />
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelName(1321,user.getLanguage())%></wea:item><!-- 编码 -->
<wea:item>
<input type=text id="qryFccCode" name="qryFccCode" class=Inputstyle value='<%=FnaCommon.escapeHtml(qryFccCode) %>' />
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelName(602,user.getLanguage())%></wea:item><!-- 状态 -->
<wea:item>
<select class="" id="advQryArchive" name="advQryArchive" style="width: 80px;">
<option value=""></option>
<option value="0" <% if("0".equals(advQryArchive)) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(25456,user.getLanguage())%></option>
<option value="1" <% if("1".equals(advQryArchive)) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(22205,user.getLanguage())%></option>
</select>
</wea:item>
</wea:group>
<wea:group context="">
<wea:item type="toolbar">
<input class="e8_btn_submit" type="button" id="advSubmit" onclick="onBtnSearchClick('from_advSubmit');"
value="<%=SystemEnv.getHtmlLabelName(527,user.getLanguage())%>"/><!-- 查询 -->
<input class="e8_btn_submit" type="button" id="advReset" onclick="resetCondtion();"
value="<%=SystemEnv.getHtmlLabelName(2022,user.getLanguage())%>"/><!-- 重置 -->
<input class="e8_btn_cancel" type="button" id="cancel"
value="<%=SystemEnv.getHtmlLabelName(201,user.getLanguage())%>"/><!-- 取消 -->
</wea:item>
</wea:group>
</wea:layout>
</div>
<%
int perpage = UserDefaultManager.getNumperpage();
if(perpage <2) perpage=15;
//设置好搜索条件
String backFields =" a.* ";
String fromSql = " from FnaCostCenter a ";
String sqlWhere = " where 1=1 ";
if(fccId >= 0){
sqlWhere += " and a.supFccId = "+fccId+" ";
}
if(!"".equals(nameQuery)){
sqlWhere += " and a.name like '%"+StringEscapeUtils.escapeSql(nameQuery)+"%' ";
}
if(!"".equals(qryFccCode)){
sqlWhere += " and a.code like '%"+StringEscapeUtils.escapeSql(qryFccCode)+"%' ";
}
if(!"".equals(advQryArchive)){
if("0".equals(advQryArchive)){//未封存
sqlWhere += " and (a.archive = 0 or a.archive is null) ";
}else if("1".equals(advQryArchive)){//已封存
sqlWhere += " and a.archive = 1 ";
}else{
sqlWhere += " and a.archive = "+Util.getIntValue(advQryArchive)+" ";
}
}
String orderBy=" a.type,a.code,a.name ";
//out.println("select "+backFields+" "+fromSql+" "+sqlWhere+" order by "+orderBy);
String tableString=""+
"<table instanceid=\"FNA_COST_CENTER_VIEW_INNER_LIST\" pageId=\""+PageIdConst.FNA_COST_CENTER_VIEW_INNER_LIST+"\" "+
" pagesize=\""+PageIdConst.getPageSize(PageIdConst.FNA_COST_CENTER_VIEW_INNER_LIST,user.getUID(),PageIdConst.FNA)+"\" tabletype=\"checkbox\">"+
"<checkboxpopedom showmethod=\"weaver.fna.general.FnaSplitPageTransmethod.getCostCenterViewInner_checkboxpopedom\" popedompara=\"column:id\"/>"+
"<sql backfields=\""+Util.toHtmlForSplitPage(backFields)+"\" sqlform=\""+Util.toHtmlForSplitPage(fromSql)+"\" sqlwhere=\""+Util.toHtmlForSplitPage(sqlWhere)+"\" sqlorderby=\""+Util.toHtmlForSplitPage(orderBy)+"\" "+
" sqlprimarykey=\"id\" sqlsortway=\"Asc\" />"+
"<head>"+
"<col width=\"21%\" text=\""+SystemEnv.getHtmlLabelName(195,user.getLanguage())+"\" column=\"name\" orderkey=\"name\" "+
" transmethod=\"weaver.fna.general.FnaSplitPageTransmethod.doJsFunc\" otherpara=\"doEdit_grid+column:id\"/>"+
"<col width=\"20%\" text=\""+SystemEnv.getHtmlLabelName(1321,user.getLanguage())+"\" column=\"code\" orderkey=\"code\" "+
" transmethod=\"weaver.fna.general.FnaCommon.escapeHtml\" />"+
"<col width=\"12%\" text=\""+SystemEnv.getHtmlLabelName(63,user.getLanguage())+"\" column=\"type\" orderkey=\"type\" otherpara=\"column:id+"+user.getLanguage()+"\" "+
" transmethod=\"weaver.fna.general.FnaSplitPageTransmethod.getFccTypeName\" />"+
"<col width=\"12%\" text=\""+SystemEnv.getHtmlLabelName(602,user.getLanguage())+"\" column=\"archive\" orderkey=\"archive\" otherpara=\""+user.getLanguage()+"\" "+
" transmethod=\"weaver.fna.general.FnaSplitPageTransmethod.getFccStatus\" />"+
"<col width=\"35%\" text=\""+SystemEnv.getHtmlLabelName(24664,user.getLanguage())+"\" column=\"id\" orderkey=\"id\" otherpara=\""+user.getLanguage()+"\" "+
" transmethod=\"weaver.fna.general.FnaSplitPageTransmethod.getFccDtl\" />"+
"</head>"+
" <operates>"+
" <popedom transmethod=\"weaver.fna.general.FnaSplitPageTransmethod.getCostCenterViewInner_popedom\" otherpara=\"column:archive\" ></popedom> "+
" <operate href=\"javascript:doEdit_grid();\" text=\""+SystemEnv.getHtmlLabelName(93, user.getLanguage())+"\" index=\"0\"/>"+
" <operate href=\"javascript:doLifted_grid();\" text=\""+SystemEnv.getHtmlLabelName(22152, user.getLanguage())+"\" index=\"1\"/>"+
" <operate href=\"javascript:doArchive_grid();\" text=\""+SystemEnv.getHtmlLabelName(22151, user.getLanguage())+"\" index=\"2\"/>"+
" <operate href=\"javascript:doDel_grid();\" text=\""+SystemEnv.getHtmlLabelName(91, user.getLanguage())+"\" index=\"3\"/>"+
" </operates>"+
"</table>";
%>
<wea:layout type="4col">
<wea:group context="" attributes="{\"groupDisplay\":\"none\"}" ><!-- 科目 -->
<wea:item attributes="{'isTableList':'true'}">
<input type="hidden" name="pageId" id="pageId" value="<%=PageIdConst.FNA_COST_CENTER_VIEW_INNER_LIST %>" />
<wea:SplitPageTag tableString='<%=tableString%>' mode="run" />
</wea:item>
</wea:group>
</wea:layout>
</form>
<script language="javascript">
var _Label33574 = "<%=SystemEnv.getHtmlLabelName(33574,user.getLanguage()) %>";//正在处理数据,请不要离开该页面,请稍等...
//批量导入
function batchImp(){
var _w = 580;
var _h = 420;
_fnaOpenDialog("/fna/batch/CostCenterBatch.jsp",
"<%=SystemEnv.getHtmlLabelName(26601,user.getLanguage()) %>",
_w, _h);
}
//编辑
function doEdit_grid(id){
var type = null2String(jQuery("#tript_"+id+"_type").val());
var _h = 340;
if(type==1){
_h = 600;
}
var _titleName = "<%=SystemEnv.getHtmlLabelName(93,user.getLanguage())+SystemEnv.getHtmlLabelName(515,user.getLanguage()) %>";
if(type==0){
_titleName = "<%=SystemEnv.getHtmlLabelName(93,user.getLanguage())+SystemEnv.getHtmlLabelName(178,user.getLanguage()) %>";
}
_fnaOpenDialog("/fna/costCenter/CostCenterEdit.jsp?id="+id,
_titleName,
550, _h);
}
//新建
function doAdd(supFccId,type,_h){
var _titleName = "<%=SystemEnv.getHtmlLabelName(365,user.getLanguage())+SystemEnv.getHtmlLabelName(515,user.getLanguage()) %>";
if(type==0){
_titleName = "<%=SystemEnv.getHtmlLabelName(365,user.getLanguage())+SystemEnv.getHtmlLabelName(178,user.getLanguage()) %>";
}
_fnaOpenDialog("/fna/costCenter/CostCenterAdd.jsp?supFccId="+supFccId+"&type="+type,
_titleName,
550, _h);
}
//新建成本中心
function addSub(supFccId){
doAdd(supFccId,1,600);
}
//新建成本中心类别
function addLb(supFccId){
doAdd(supFccId,0,340);
}
//快速(高级)搜索事件
function onBtnSearchClick(from_advSubmit){
if(from_advSubmit=="from_advSubmit"){
jQuery("#nameQuery").val(jQuery("#advQryName").val());
}else{
jQuery("#advQryName").val(jQuery("#nameQuery").val());
}
form2.submit();
}
//删除
function doDel_grid(_id){
var id = null2String(jQuery("#fccId").val());
var type = null2String(jQuery("#type").val());
if(id==""){
id="0";
}
if(type==""){
type="0";
}
var _data = "operation=delete&id="+_id;
top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(15097,user.getLanguage())%>",
function(){
openNewDiv_FnaBudgetViewInner1(_Label33574);
jQuery.ajax({
url : "/fna/costCenter/CostCenterOperation.jsp",
type : "post",
cache : false,
processData : false,
data : _data,
dataType : "json",
success: function do4Success(_json){
try{
try{closeNewDiv_FnaBudgetViewInner1();}catch(ex1){}
if(_json.flag){
parent.parent.leftframe.do_reAsyncChildNodes(type+"_"+id, type+"_"+id);
window._table.reLoad();
}else{
top.Dialog.alert(_json.msg);
}
showRightMenuIframe();
}catch(e1){
showRightMenuIframe();
}
}
});
}, function(){}
);
}
//批量删除
function batchDel(){
var id = null2String(jQuery("#fccId").val());
var type = null2String(jQuery("#type").val());
if(id==""){
id="0";
}
if(type==""){
type="0";
}
var ids = _xtable_CheckedCheckboxId();
if(ids==""){
top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(18214,user.getLanguage())+SystemEnv.getHtmlLabelName(515,user.getLanguage()) %>");
return;
}
var _data = "operation=batchDel&batchDelIds="+ids;
top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(15097,user.getLanguage())%>",
function(){
openNewDiv_FnaBudgetViewInner1(_Label33574);
jQuery.ajax({
url : "/fna/costCenter/CostCenterOperation.jsp",
type : "post",
cache : false,
processData : false,
data : _data,
dataType : "json",
success: function do4Success(_json){
try{
try{closeNewDiv_FnaBudgetViewInner1();}catch(ex1){}
if(_json.flag){
parent.parent.leftframe.do_reAsyncChildNodes(type+"_"+id, type+"_"+id);
window._table.reLoad();
}else{
top.Dialog.alert(_json.msg);
}
showRightMenuIframe();
}catch(e1){
showRightMenuIframe();
}
}
});
}, function(){}
);
}
//解封
function doLifted_grid(_id){
var id = null2String(jQuery("#fccId").val());
var type = null2String(jQuery("#type").val());
if(id==""){
id="0";
}
if(type==""){
type="0";
}
_id += ",";
var _data = "operation=lifted&checkid="+_id;
openNewDiv_FnaBudgetViewInner1(_Label33574);
jQuery.ajax({
url : "/fna/costCenter/CostCenterOperation.jsp",
type : "post",
cache : false,
processData : false,
data : _data,
dataType : "json",
success: function do4Success(_json){
try{
try{closeNewDiv_FnaBudgetViewInner1();}catch(ex1){}
if(_json.flag){
parent.parent.leftframe.do_reAsyncChildNodes(type+"_"+id, type+"_"+id);
window._table.reLoad();
}else{
top.Dialog.alert(_json.msg);
}
showRightMenuIframe();
}catch(e1){
showRightMenuIframe();
}
}
});
}
//封存检查,并封存
function doArchive2_grid(_id){
var id = null2String(jQuery("#fccId").val());
var type = null2String(jQuery("#type").val());
if(id==""){
id="0";
}
if(type==""){
type="0";
}
var _data = "operation=archive&checkid="+_id;
openNewDiv_FnaBudgetViewInner1(_Label33574);
jQuery.ajax({
url : "/fna/costCenter/CostCenterOperation.jsp",
type : "post",
cache : false,
processData : false,
data : _data,
dataType : "json",
success: function do4Success(_json){
try{
try{closeNewDiv_FnaBudgetViewInner1();}catch(ex1){}
if(_json.flag){
parent.parent.leftframe.do_reAsyncChildNodes(type+"_"+id, type+"_"+id);
window._table.reLoad();
}else{
top.Dialog.alert(_json.msg);
}
showRightMenuIframe();
}catch(e1){
showRightMenuIframe();
}
}
});
}
//grid 封存检查,并封存
function doArchive_grid(_id){
hideRightMenuIframe();
try{
_id += ",";
var _data = "checkid="+_id;
openNewDiv_FnaBudgetViewInner1(_Label33574);
jQuery.ajax({
url : "/fna/costCenter/CostCenterViewAjax.jsp",
type : "post",
cache : false,
processData : false,
data : _data,
dataType : "html",
success: function do4Success(_html){
try{closeNewDiv_FnaBudgetViewInner1();}catch(ex1){}
_html = jQuery.trim(_html);
if(_html=="1"){
top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(126350,user.getLanguage())%>",
function(){
doArchive2_grid(_id);
},
function(){
showRightMenuIframe();
},
360
);
}else{
doArchive2_grid(_id);
}
}
});
}catch(e1){
showRightMenuIframe();
}
}
function OpenNewWindow(sURL,w,h){
var iWidth = 0 ;
var iHeight = 0 ;
iWidth=(window.screen.availWidth-10)*w;
iHeight=(window.screen.availHeight-50)*h;
ileft=(window.screen.availWidth - iWidth)/2;
itop= (window.screen.availHeight - iHeight + 50)/2;
var szFeatures = "" ;
szFeatures = "resizable=no,status=no,menubar=no,width=" + iWidth + ",height=" + iHeight*h + ",top="+itop+",left="+ileft
window.open(sURL,"",szFeatures)
}
/**
* 导出全部数据
*/
function exportAll() {
downExcel();
};
/**
* 导出列表中所勾选的数据
*/
function exportSelect() {
var ids = _xtable_CheckedCheckboxId();
if(!ids || ids =='' ) {
top.Dialog.alert("<%= SystemEnv.getHtmlLabelName(127108,user.getLanguage())%>");
}else {
downExcel(ids);
}
};
function downExcel(ids){
try{
var elemIF = document.createElement("iframe");
var url = "/fna/costCenter/CostCenViewInnerDownload.jsp";
if(ids) {
url += "?type=select&ids="+ids;
}else {
url += "?type=all";
}
elemIF.src = url;
elemIF.style.display = "none";
document.body.appendChild(elemIF);
}catch(e){
}
}
</script>
</body>
</html>