FnaExpenseDetail.jsp
8.92 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
<%@page import="weaver.fna.general.FnaSplitPageTransmethod"%>
<%@page import="org.json.JSONObject"%>
<%@page import="weaver.fna.budget.BudgetYear"%>
<%@page import="weaver.fna.budget.BudgetHandler"%>
<%@page import="weaver.fna.general.FnaBudgetLeftRuleSet"%>
<%@page import="weaver.hrm.HrmUserVarify"%>
<%@page import="weaver.general.Util"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ page import="java.util.*" %>
<%@page import="weaver.conn.RecordSet"%>
<jsp:useBean id="pack" class="weaver.general.ParameterPackage" scope="page"/>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="RecordSet2" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="RecordSet3" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="RecordSet4" class="weaver.conn.RecordSet" scope="page"/>
<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="FnaBudgetInfoComInfo" class="weaver.fna.maintenance.FnaBudgetInfoComInfo" scope="page"/>
<jsp:useBean id="CheckSubCompanyRight" class="weaver.systeminfo.systemright.CheckSubCompanyRight" scope="page"/>
<HTML><HEAD>
<script src="/js/tabs/jquery.tabs.extend_wev8.js"></script>
<link type="text/css" href="/js/tabs/css/e8tabs1_wev8.css" rel="stylesheet" />
<link rel="stylesheet" href="/css/ecology8/request/searchInput_wev8.css" type="text/css" />
<script type="text/javascript" src="/js/ecology8/request/searchInput_wev8.js"></script>
<link rel="stylesheet" href="/css/ecology8/request/seachBody_wev8.css" type="text/css" />
<link rel="stylesheet" href="/css/ecology8/request/hoverBtn_wev8.css" type="text/css" />
<script type="text/javascript" src="/js/ecology8/request/hoverBtn_wev8.js"></script>
<script type="text/javascript" src="/js/ecology8/request/titleCommon_wev8.js"></script>
<script type="text/javascript">
jQuery(function(){
jQuery('.e8_box').Tabs({
getLine:1,
iframe:"tabcontentframe",
mouldID:"<%=MouldIDConst.getID("fna") %>",
objName:<%=JSONObject.quote(SystemEnv.getHtmlLabelName(16505, user.getLanguage())) %>,
staticOnLoad:true
});
});
</script>
<!-- 自定义设置tab页 -->
<%
boolean canView = true;//可查看
String organizationid = Util.null2String(request.getParameter("organizationid"));//组织ID
String organizationtype = Util.null2String(request.getParameter("organizationtype"));//组织类型
String budgetperiods = Util.null2String(request.getParameter("budgetperiods"));//期间ID
String budgetyears = "";//期间年
String sqlstr = "";
char separator = Util.getSeparator();
Calendar today = Calendar.getInstance();
String currentdate = Util.add0(today.get(Calendar.YEAR), 4) + "-" +
Util.add0(today.get(Calendar.MONTH) + 1, 2) + "-" +
Util.add0(today.get(Calendar.DAY_OF_MONTH), 2);
//如果期间为空
if ("".equals(budgetperiods)) {
//取前一次操作的期间
budgetperiods = (String) session.getAttribute("budgetperiods");
//System.out.println("session budgetperiods:"+budgetperiods);
if (budgetperiods == null || "".equals(budgetperiods)) {
//如果未取到,取得默认生效期间
sqlstr = " select id from FnaYearsPeriods where status = 1 order by fnayear desc";
RecordSet.executeSql(sqlstr);
if (RecordSet.next()) {
budgetperiods = RecordSet.getString("id");
} else {
//如果未取到,取最大年
RecordSet.executeProc("FnaYearsPeriods_SelectMaxYear", "");
if (RecordSet.next()) {
budgetperiods = RecordSet.getString("id");
}
}
//System.out.println("empty budgetperiods:"+budgetperiods);
}
} else {
session.setAttribute("budgetperiods", budgetperiods);
}
//如果组织为空,取得当前期间默认总公司
//检查权限
int right = -1;//-1:禁止、0:只读、1:编辑、2:完全操作
if ("0".equals(organizationtype) || "".equals(organizationid)) {
organizationid = "1";
organizationtype = "0";
if (HrmUserVarify.checkUserRight("HeadBudget:Maint", user)) {
right = Util.getIntValue(HrmUserVarify.getRightLevel("HeadBudget:Maint", user), 0);
} else {
organizationtype = "1";
SubCompanyComInfo.setTofirstRow();
SubCompanyComInfo.next();
organizationid = SubCompanyComInfo.getSupsubcomid();
}
}
if (!"0".equals(organizationtype)) {
if (Util.getIntValue(String.valueOf(session.getAttribute("detachable")), 0) == 1) {//如果分权
int subCompanyId = 0;
if ("1".equals(organizationtype))
subCompanyId = (new Integer(organizationid)).intValue();
else if ("2".equals(organizationtype))
subCompanyId = (new Integer(DepartmentComInfo.getSubcompanyid1(organizationid))).intValue();
else if ("3".equals(organizationtype))
subCompanyId = (new Integer(DepartmentComInfo.getSubcompanyid1(ResourceComInfo.getDepartmentID(organizationid)))).intValue();
right = CheckSubCompanyRight.ChkComRightByUserRightCompanyId(user.getUID(), "SubBudget:Maint", subCompanyId);
} else {
if (HrmUserVarify.checkUserRight("SubBudget:Maint", user))
right = Util.getIntValue(HrmUserVarify.getRightLevel("SubBudget:Maint", user), 0);
}
}
String fnabudgetinfoid = "";
String status = "";
if (!"".equals(budgetperiods) && !"".equals(organizationid) && !"".equals(organizationtype)) {
sqlstr = " select id,status from FnaBudgetInfo where status in (1,3) and budgetperiods = "
+ budgetperiods + " and budgetorganizationid = " + organizationid + " and organizationtype = "
+ organizationtype;
//System.out.println(sqlstr);
RecordSet.executeSql(sqlstr);
if (RecordSet.next()) {
fnabudgetinfoid = RecordSet.getString("id");
status = RecordSet.getString("status");
//System.out.println("get id:"+fnabudgetinfoid+" by revision:"+revision+",budgetperiods:"+budgetperiods+",budgetorganizationid:"+organizationid+",organizationtype:"+organizationtype);
}
} else {
canView = false;
}
if (right < 0) canView = false;//可查看
if (!canView) {
response.sendRedirect("/notice/noright.jsp");
return;
}
String commonPara = "organizationid="+organizationid+"&organizationtype="+organizationtype;
String ysxxUrl = "/fna/report/expense/FnaExpenseDetailInner.jsp?"+commonPara;
FnaSplitPageTransmethod fnaSplitPageTransmethod = new FnaSplitPageTransmethod();
String orgName = fnaSplitPageTransmethod.getOrgName(organizationid, organizationtype);
if("".equals(orgName)){
orgName = JSONObject.quote(SystemEnv.getHtmlLabelName(16505, user.getLanguage()));
}
String orgTypeName = "";
if("0".equals(organizationtype)){
orgTypeName = SystemEnv.getHtmlLabelNames("140,428",user.getLanguage());//总部收支
}else if("1".equals(organizationtype)){
orgTypeName = SystemEnv.getHtmlLabelNames("141,428",user.getLanguage());//分部收支
}else if("2".equals(organizationtype)){
orgTypeName = SystemEnv.getHtmlLabelNames("124,428",user.getLanguage());//部门收支
}else if("3".equals(organizationtype)){
orgTypeName = SystemEnv.getHtmlLabelNames("6087,428",user.getLanguage());//个人收支
}
%>
</head>
<BODY scroll="no">
<div class="e8_box demo2">
<div class="e8_boxhead">
<div class="div_e8_xtree" id="div_e8_xtree"></div>
<div class="e8_tablogo" id="e8_tablogo" onclick="mnToggleleft(this);"></div>
<div class="e8_ultab">
<div class="e8_navtab" id="e8_navtab">
<span id="objName"></span>
</div>
<div>
<ul class="tab_menu">
<li class="defaultTab">
<a href="#">
<%=TimeUtil.getCurrentTimeString() %>
</a>
</li>
</ul>
<div id="rightBox" class="e8_rightBox">
</div>
</div>
</div>
</div>
<div class="tab_box">
<div>
<iframe src="<%=ysxxUrl %>" onload="update();" id="tabcontentframe" name="tabcontentframe" class="flowFrame" frameborder="0" height="100%" width="100%;"></iframe>
</div>
</div>
</div>
</body>
<script type="text/javascript">
function mnToggleleft(obj){
if(window!=null&&window.parent!=null&&window.parent.oTd1!=null&&window.parent.oTd1.style!=null){
var f = window.parent.oTd1.style.display;
if(f==null||f==""){
obj.innerHTML=obj.innerHTML.replace("<<",">>");
window.parent.oTd1.style.display='none';
}else{
obj.innerHTML=obj.innerHTML.replace(">>","<<");
window.parent.oTd1.style.display='';
}
}
}
jQuery(document).ready(function(){
setTabObjName("<%=orgName%>(<%=orgTypeName %>)");
});
</script>
</html>