BudgetBearerEdit.jsp
14.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
<%@page import="weaver.hrm.company.DepartmentComInfo"%>
<%@page import="weaver.hrm.company.SubCompanyComInfo"%>
<%@page import="weaver.fna.general.FnaCommon"%>
<%@page import="weaver.workflow.field.BrowserComInfo"%>
<%@page import="org.apache.commons.lang.StringEscapeUtils"%>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@page import="weaver.hrm.HrmUserVarify"%>
<%@page import="weaver.hrm.User"%>
<%@ page import="weaver.general.Util" %>
<%@ taglib uri="/browserTag" prefix="brow"%>
<%@ 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(true) {
response.sendRedirect("/notice/noright.jsp") ;
return ;
}
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
String imagefilename = "/images/hdMaintenance_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(332,user.getLanguage());//全部
String needfav ="1";
String needhelp ="";
String id = Util.null2String(request.getParameter("id"));
String tableName = Util.null2String(request.getParameter("tableName"));
String accountId = Util.null2String(request.getParameter("accountId"));
String name = "";
String codeName = "";
String supId = "";
String description = "";
String displayOrder = "";
String supName = "";
int orgType = 0;
StringBuffer subId = new StringBuffer();
StringBuffer shownameSub = new StringBuffer();
StringBuffer depId = new StringBuffer();
StringBuffer shownameDep = new StringBuffer();
if(!"".equals(tableName)){
rs.executeQuery(" select * from "+tableName+" b where b.id = ? ", id);
if(rs.next()){
name = Util.null2String(rs.getString("budgetBearerName"));
codeName = Util.null2String(rs.getString("codeName"));
supId = Util.null2String(rs.getString("supId"));
description = Util.null2String(rs.getString("description"));
displayOrder = Util.null2String(rs.getString("displayOrder"));
}
if(!"".equals(supId)){
rs.executeQuery(" select * from "+tableName+" b where b.id = ? ", supId);
if(rs.next()){
supName = Util.null2String(rs.getString("budgetBearerName"));
}
}
String number = tableName.split("_")[1];
rs.executeQuery(" select * from FnaBudgetBearerRangeSet_"+number+" where bearerId = ? ", id);
int i= 0;
while(rs.next()){
orgType = Util.getIntValue(rs.getString("orgType"));
String orgId = Util.null2String(rs.getString("orgId"));
if(orgType == 1){//分部
subId.append(orgId);
String subName = subCompanyComInfo.getSubCompanyname(orgId);
shownameSub.append(subName);
if(i != rs.getCounts() - 1){
subId.append(",");
shownameSub.append(",");
}
}else if(orgType == 2){
depId.append(orgId);
String depName = departmentComInfo.getDepartmentname(orgId);
shownameDep.append(depName);
if(i != rs.getCounts() - 1){
depId.append(",");
shownameDep.append(",");
}
}
i++;
}
}
String browserUrl = "/systeminfo/BrowserMain.jsp?url=/fna/browser/budgetBearer/BudgetBearerBrowser.jsp%3Fselectedid="+id+"%26tableName="+tableName+"%26bearerId="+id;
String completeUrl = "/data.jsp?show_virtual_org=-1&type=FnaBudgetBearer&tableName="+tableName+"&bearerId="+id;
%>
<%@page import="weaver.interfaces.workflow.browser.Browser"%><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>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(86,user.getLanguage())+",javascript:doEdit(this),_TOP} ";//保存
RCMenuHeight += RCMenuHeightStep ;
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<jsp:include page="/systeminfo/commonTabHead.jsp">
<jsp:param name="mouldID" value="fna"/>
<jsp:param name="navName" value="<%=SystemEnv.getHtmlLabelName(387641,user.getLanguage()) %>"/><!-- 预算承担主体 -->
</jsp:include>
<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.getHtmlLabelName(86,user.getLanguage()) %>"
class="e8_btn_top" onclick="doEdit(this);"/><!-- 保存 -->
<span title="<%=SystemEnv.getHtmlLabelName(23036,user.getLanguage()) %>" class="cornerMenu"></span><!-- 菜单 -->
</td>
</tr>
</table>
<form id="form2" name="form2" method="post">
<input type="hidden" id="id" name="id" value="<%=id%>" />
<wea:layout type="2col">
<wea:group context='<%=SystemEnv.getHtmlLabelName(1361,user.getLanguage())%>'><!-- 基本信息 -->
<wea:item><%=SystemEnv.getHtmlLabelName(195,user.getLanguage())%></wea:item><!-- 名称 -->
<wea:item>
<wea:required id="nameSpan" required="true">
<input class="inputstyle" id="name" name="name" maxlength="200" style="width: 150px;"
onchange='checkinput("name","nameSpan");' value="<%=FnaCommon.escapeHtml(name) %>" />
</wea:required>
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelName(1321,user.getLanguage())%></wea:item><!-- 编码 -->
<wea:item>
<input class="inputstyle" id="codeName" name="codeName" maxlength="30" style="width: 150px;"
value="<%=FnaCommon.escapeHtml(codeName) %>" _noMultiLang="true" />
</wea:item>
<wea:item attributes="{'customAttrs':'id=supIdItem'}"><%=SystemEnv.getHtmlLabelName(388697,user.getLanguage())%></wea:item><!-- 上级主体 -->
<wea:item attributes="{'customAttrs':'id=supIdItem'}">
<brow:browser viewType="0" id="supId" name="supId" browserValue='<%=supId%>'
browserUrl='<%=browserUrl %>'
hasInput="true" isSingle="true" hasBrowser = "true" isMustInput="1"
completeUrl="<%=completeUrl%>" temptitle='<%= SystemEnv.getHtmlLabelName(18214,user.getLanguage())%>'
browserSpanValue='<%=FnaCommon.escapeHtml(supName)%>' width="180px"
>
</brow:browser>
</wea:item>
<wea:item attributes="{'customAttrs':'id=orgItem'}"><%=SystemEnv.getHtmlLabelName(24664,user.getLanguage())%></wea:item><!-- 关联对象 -->
<wea:item attributes="{'customAttrs':'id=orgItem'}">
<div style="display:block;float:left;height:auto;width:125px;">
<select id="orgType" name="orgType" onchange="orgType_onchange();" style="width: 80px;float: left;">
<option value="1" <%=(orgType==1)?"selected":"" %>><%=SystemEnv.getHtmlLabelName(141, user.getLanguage()) %></option><!-- 分部 -->
<option value="2" <%=(orgType==2)?"selected":"" %>><%=SystemEnv.getHtmlLabelName(124, user.getLanguage()) %></option><!-- 部门 -->
</select>
</div>
<span id="spanSubId" style="display: none;">
<brow:browser viewType="0" id="subId" name="subId" browserValue='<%=subId.toString()%>'
browserUrl='<%=new BrowserComInfo().getBrowserurl("194")+"%3Fshow_virtual_org=-1%26selectedids=#id#" %>'
hasInput="true" isSingle="false" hasBrowser = "true" isMustInput="1"
completeUrl="/data.jsp?show_virtual_org=-1&type=194" temptitle='<%= SystemEnv.getHtmlLabelName(141,user.getLanguage())%>'
browserSpanValue='<%=FnaCommon.escapeHtml(shownameSub.toString())%>' width="180px"
>
</brow:browser>
</span>
<span id="spanDepId" style="display: none;">
<brow:browser viewType="0" id="depId" name="depId" browserValue='<%=depId.toString()%>'
browserUrl='<%=new BrowserComInfo().getBrowserurl("57")+"%3Fshow_virtual_org=-1%26resourceids=#id#" %>'
hasInput="true" isSingle="false" hasBrowser = "true" isMustInput="1"
completeUrl="/data.jsp?show_virtual_org=-1&type=57" temptitle='<%= SystemEnv.getHtmlLabelName(124,user.getLanguage())%>'
browserSpanValue='<%=FnaCommon.escapeHtml(shownameDep.toString())%>' width="180px"
>
</brow:browser>
</span>
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelName(15513,user.getLanguage())%></wea:item><!-- 显示顺序 -->
<wea:item>
<input id="displayOrder" name="displayOrder" value="<%=FnaCommon.escapeHtml(displayOrder) %>" type="text" class="inputstyle" style="width: 80%;" _noMultiLang="true"/>
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelName(433,user.getLanguage())%></wea:item><!-- 描述 -->
<wea:item>
<textarea class=inputstyle id="description" name="description" cols="60" rows=4><%=FnaCommon.escapeHtml(description) %></textarea>
</wea:item>
</wea:group>
</wea:layout>
</form>
<script language="javascript">
var _Label33574 = "<%=SystemEnv.getHtmlLabelName(33574,user.getLanguage()) %>";//正在处理数据,请不要离开该页面,请稍等...
var tableName = "<%=tableName%>";
var accountId = "<%=accountId%>";
//页面初始化事件
jQuery(document).ready(function(){
checkinput("name","nameSpan");
orgType_onchange();
if(tableName == ""){
var idArray = ["supIdItem"];
for(var i = 0; i < idArray.length; i++){
jQuery("#"+idArray[i]).parent().hide();
jQuery("#"+idArray[i]).parent().next().hide();
}
}
jQuery("#name").blur(function(){
var _data = "op=getCodeName&name=" + jQuery("#name").val();
jQuery.ajax({
url:"/fna/mulDimensions/budgetBearer/BudgetBearerOp.jsp",
type:"post",
cache:false,
processData:false,
data:_data,
dataType:"json",
success: function do4Success(_json){
if(_json.status == "1"){
jQuery("#codeName").val(_json.codeName);
}
}
});
});
});
//切换费用单位类型
function orgType_onchange(){
var spanSubIdObj = jQuery("#spanSubId");
var spanDepIdObj = jQuery("#spanDepId");
spanSubIdObj.hide();
spanDepIdObj.hide();
var orgType = jQuery("#orgType").val();
if(orgType=="1"){
spanSubIdObj.show();
}else if(orgType=="2"){
spanDepIdObj.show();
}
}
//快速(高级)搜索事件
function onBtnSearchClick(from_advSubmit){
}
//保存
function doEdit(obj){
if(jQuery("#name").val()==""){
alert("<%=SystemEnv.getHtmlLabelName(195,user.getLanguage())%><%=SystemEnv.getHtmlLabelName(18019,user.getLanguage())%>");
return;
}
hideRightMenuIframe();
try{
var id = null2String(jQuery("#id").val());
var op = "save";
if(id != "" && id.length != 0){
op = "edit";
}
var name = null2String(jQuery("#name").val());
var codeName = null2String(jQuery("#codeName").val());
var supId = null2String(jQuery("#supId").val());
var orgType = null2String(jQuery("#orgType").val());
var orgIds = "";
if(orgType == 1){
orgIds = null2String(jQuery("#subId").val());
}else if(orgType == 2){
orgIds = null2String(jQuery("#depId").val());
}
var description = null2String(jQuery("#description").val());
var isVirtual = jQuery("#isVirtual").attr("checked") ? 1:0;
var displayOrder = null2String(jQuery("#displayOrder").val());
if(isVirtual == 1){
orgIds = "";
}
var _data = "op="+op+"&id="+id+"&tableName="+tableName+"&accountId="+accountId+"&name="+name+"&codeName="+codeName+"&supId="+supId;
_data += "&description="+description+"&isVirtual="+isVirtual+"&displayOrder="+displayOrder+"&orgType="+orgType+"&orgIds="+orgIds;
openNewDiv_FnaBudgetViewInner1(_Label33574);
jQuery.ajax({
url : "/fna/mulDimensions/budgetBearer/BudgetBearerOp.jsp",
type : "post",
cache : false,
processData : false,
data : _data,
dataType : "json",
success: function do4Success(_json){
try{
try{closeNewDiv_FnaBudgetViewInner1();}catch(ex1){}
if(_json.status == 1){
var parentWin = parent.getParentWindow(window);
var dialog = parent.getDialog(parentWin);
if(supId == ""){
supId = "0";
}
if(tableName != ""){
parentWin.parent.parent.leftframe.do_reAsyncChildNodes(supId, supId);
parentWin._table.reLoad();
}else{
parentWin.parent.parent.location.reload();
}
parentWin.closeDialog();
}else{
console.log("_json.errorInfo",_json.errorInfo);
top.Dialog.alert(_json.errorInfo);
}
showRightMenuIframe();
}catch(e1){
showRightMenuIframe();
}
}
});
}catch(e1){
showRightMenuIframe();
}
}
</script>
</body>
</html>