PeriodSettingEdit.jsp
12.3 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
<%@page import="weaver.hrm.company.DepartmentComInfo"%>
<%@page import="weaver.hrm.company.SubCompanyComInfo"%>
<%@page import="weaver.fna.general.FnaCommon"%>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ 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" />
<%@ page import="java.util.*"%>
<%
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 = "";
boolean isArchive = true;
String supId = "";
String description = "";
String supName = "";
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);
String date="";
String date2="";
if(!"".equals(tableName)) {
rs.executeQuery(" select * from " + tableName + " b where b.id = ? ", id);
if (rs.next()) {
name = Util.null2String(rs.getString("periodName"));
codeName = Util.null2String(rs.getString("codeName"));
isArchive = Util.getIntValue(rs.getString("isArchive")) == 1;
supId = Util.null2String(rs.getString("supId"));
description = Util.null2String(rs.getString("description"));
date= Util.null2String(rs.getString("beginDate"));
date2= Util.null2String(rs.getString("endDate"));
}
if("".equals(date)){
date=currentdate;
}
if("".equals(date2)){
date2=currentdate;
}
if (!"".equals(supId)) {
rs.executeQuery(" select * from " + tableName + " b where b.id = ? ", supId);
if (rs.next()) {
supName = Util.null2String(rs.getString("periodName"));
}
}
}
String browserUrl = "/systeminfo/BrowserMain.jsp?url=/fna/browser/periodSetting/BudgetPeriodBrowser.jsp%3Fselectedid="+id+"%26tableName="+tableName+"%26periodId="+id;
String completeUrl = "/data.jsp?show_virtual_org=-1&type=FnaPeriodSetting&tableName="+tableName+"&periodId="+id;
%>
<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 ;
%>
<div class="zDialog_div_content">
<%@ 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(388699,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><%=SystemEnv.getHtmlLabelName(740, user.getLanguage())%></wea:item><!-- 开始时间 -->
<wea:item>
<BUTTON class=Calendar type="button" id=selectstartdate onclick="onShowDate(startdatespan,beginDate)"></BUTTON>
<SPAN id=startdatespan ><%=date%></SPAN>
<input class=inputstyle type="hidden" name="beginDate" id="beginDate" value="<%=date%>">
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelName(83826, user.getLanguage())%></wea:item><!-- 结束时间 -->
<wea:item>
<BUTTON class=Calendar type="button" id=selectenddate onclick="onShowDate(enddatespan,endDate)"></BUTTON>
<SPAN id=enddatespan ><%=date2%></SPAN>
<input class=inputstyle type="hidden" name="endDate" id="endDate" value="<%=date2%>">
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelName(388305,user.getLanguage())%></wea:item><!-- 是否封存 -->
<wea:item>
<input id="isArchive" name="isArchive" value="1" type="checkbox" tzCheckbox="true" <%=(isArchive?"checked":"") %> onClick="isVirtual_onchange();"/>
</wea:item>
<wea:item attributes="{'customAttrs':'id=supIdItem'}">上级类别</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><%=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>
<jsp:include page="/systeminfo/commonTabFoot.jsp"></jsp:include>
</div>
</form>
<script language="javascript">
var _Label33574 = "<%=SystemEnv.getHtmlLabelName(33574,user.getLanguage()) %>";//正在处理数据,请不要离开该页面,请稍等...
var tableName = "<%=tableName%>";
var accountId = "<%=accountId%>";
resizeDialog(document);
//页面初始化事件
jQuery(document).ready(function(){
checkinput("name","nameSpan");
orgType_onchange();
isVirtual_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/periodSetting/PeriodSettingOp.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 isVirtual_onchange(){
var orgArray = ["orgItem"];
var isVirtual = jQuery("#isVirtual").attr("checked") ? 1:0;
if(isVirtual == 1){//是虚拟(开启)
for(var i = 0; i < orgArray.length; i++){
jQuery("#"+orgArray[i]).parent().hide();
jQuery("#"+orgArray[i]).parent().next().hide();
}
}else if(isVirtual == 0){//非虚拟(关闭)
for(var i = 0; i < orgArray.length; i++){
jQuery("#"+orgArray[i]).parent().show();
jQuery("#"+orgArray[i]).parent().next().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 beginDate = null2String(jQuery("#beginDate").val());
var endDate = null2String(jQuery("#endDate").val());
var description = null2String(jQuery("#description").val());
var archive = jQuery("#archive").attr("checked") ? 1:0;
var _data = "op="+op+"&id="+id+"&tableName="+tableName+"&accountId="+accountId+"&name="+name+"&codeName="+codeName+"&supId="+supId;
_data += "&description="+description+"&archive="+archive+"&beginDate="+beginDate+"&endDate="+endDate;
openNewDiv_FnaBudgetViewInner1(_Label33574);
jQuery.ajax({
url : "/fna/mulDimensions/periodSetting/PeriodSettingOp.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{
top.Dialog.alert(_json.errorInfo);
}
showRightMenuIframe();
}catch(e1){
showRightMenuIframe();
}
}
});
}catch(e1){
showRightMenuIframe();
}
}
</script>
</body>
</html>
<SCRIPT language="javascript" src="/js/datetime_wev8.js"></script>
<SCRIPT language="javascript" src="/js/JSDateTime/WdatePicker_wev8.js"></script>