FnaInvoiceWfSetEditPageFieldSet.jsp
12.4 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
<%@page import="weaver.fna.invoice.utils.FnaInvoiceWfUtil"%>
<%@page import="weaver.fna.budget.FnaWfSet"%>
<%@page import="weaver.systeminfo.label.LabelComInfo"%>
<%@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" %>
<%@ 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="rs1" class="weaver.conn.RecordSet" scope="page" />
<%
if(!HrmUserVarify.checkUserRight("FnaInvoiceReset:Permissions", user)){
response.sendRedirect("/notice/noright.jsp") ;
return ;
}
String imagefilename = "/images/hdMaintenance_wev8.gif";
String titlename = "";//费控流程 //33075
String needfav ="1";
String needhelp ="";
int detachable=Util.getIntValue(String.valueOf(session.getAttribute("detachable")),0);
int parentid=Util.getIntValue(request.getParameter("paraid"),0);
String nameQuery = Util.null2String(request.getParameter("nameQuery")).trim();
int mainId = Util.getIntValue(request.getParameter("id"));
int tabIndex = Util.getIntValue(request.getParameter("tabIndex"));
String thisGuid = Util.null2String(request.getParameter("thisGuid"));
int workflowid = 0;
String sql = "select * from fnaInvoiceWfInfo where id = "+mainId;
rs.executeSql(sql);
if(rs.next()){
workflowid = rs.getInt("workflowid");
}
List fieldIdListAll = new ArrayList();
HashMap fieldInfoHmAll = new HashMap();
int formid = FnaWfSet.getFieldListForFieldTypeMain(fieldIdListAll, fieldInfoHmAll, workflowid);
int formidABS = Math.abs(formid);
List dtlFieldIdListAll = new ArrayList();//所有明细字段
HashMap dtlFieldInfoHmAll = new HashMap();
FnaWfSet.getWfFieldList(dtlFieldIdListAll, dtlFieldInfoHmAll, "", 0, workflowid, 0);
List dtlFieldIdListInvoice = new ArrayList();//发票浏览框
HashMap dtlFieldInfoHmInvoice = new HashMap();
List dtlFieldIdListBillingDate = new ArrayList();//日期浏览框
HashMap dtlFieldInfoHmBillingDate = new HashMap();
List dtlFieldIdListSubject = new ArrayList();//科目浏览框
HashMap dtlFieldInfoHmSubject = new HashMap();
List dtlFieldIdListAmount = new ArrayList();//金额
HashMap dtlFieldInfoHmAmount = new HashMap();
List dtlFieldIdListDescription = new ArrayList();//说明
HashMap dtlFieldInfoHmDescription = new HashMap();
if(tabIndex == 0){
FnaWfSet.getWfFieldList(dtlFieldIdListInvoice, dtlFieldInfoHmInvoice, "3", 292, workflowid, 0);
FnaWfSet.getWfFieldList(dtlFieldIdListBillingDate, dtlFieldInfoHmBillingDate, "3", 2, workflowid, 0);
FnaWfSet.getWfFieldList(dtlFieldIdListSubject, dtlFieldInfoHmSubject, "3", 22, workflowid, 0);
FnaWfSet.getWfFieldList(dtlFieldIdListAmount, dtlFieldInfoHmAmount, "1", 3, workflowid, 0);
FnaWfSet.getWfFieldList(dtlFieldIdListDescription, dtlFieldInfoHmDescription, "1", 1, workflowid, 0);
}
String dbTableName = "formtable_main_"+formidABS;
sql = "select DISTINCT detailtable \n" +
" from workflow_billfield \n" +
" where detailtable = '"+StringEscapeUtils.escapeSql(dbTableName+"_dt"+tabIndex)+"' \n"+
" order by detailtable asc";
rs.executeSql(sql);
int dtlNumber = 0;
if(rs.next()){
String detailtable = Util.null2String(rs.getString("detailtable")).trim();
dtlNumber = Util.getIntValue(detailtable.replaceAll("formtable_main_"+formidABS+"_dt", ""), 0);
dbTableName += "_dt"+tabIndex;
FnaInvoiceWfUtil.getFieldListForInvoiceFieldType(
dtlFieldIdListInvoice, dtlFieldInfoHmInvoice,
dtlFieldIdListBillingDate, dtlFieldInfoHmBillingDate,
dtlFieldIdListSubject, dtlFieldInfoHmSubject,
dtlFieldIdListAmount, dtlFieldInfoHmAmount,
dtlFieldIdListDescription, dtlFieldInfoHmDescription,
dtlFieldIdListAll, dtlFieldInfoHmAll,
workflowid, dtlNumber);
}
String fieldIdInvoice = "";
String fieldIdDate = "";
String fieldIdSubject = "";
String fieldIdAmount = "";
String fieldIdDesc = "";
sql = "select * from fnaInvoiceWfInfoField where tabIndex = ? and mainId=?";
rs1.executeQuery(sql, tabIndex, mainId);
while(rs1.next()){
String fieldname = Util.null2String(rs1.getString("fieldname")).trim();
String fieldId = Util.null2String(rs1.getString("fieldId")).trim();
if("fieldIdInvoice".equals(fieldname)){
fieldIdInvoice = fieldId;
}else if("fieldIdDate".equals(fieldname)){
fieldIdDate = fieldId;
}else if("fieldIdSubject".equals(fieldname)){
fieldIdSubject = fieldId;
}else if("fieldIdAmount".equals(fieldname)){
fieldIdAmount = fieldId;
}else if("fieldIdDesc".equals(fieldname)){
fieldIdDesc = fieldId;
}
}
String tempFieldId_invoiceNo = Util.null2String(request.getSession().getAttribute("fnaInvoiceWfSetEditSaveFnaAjax_"+thisGuid+"_"+tabIndex+"_fieldIdInvoice"));
String tempFieldId_BillingDate = Util.null2String(request.getSession().getAttribute("fnaInvoiceWfSetEditSaveFnaAjax_"+thisGuid+"_"+tabIndex+"_fieldIdBillingDate"));
String tempFieldId_Subject = Util.null2String(request.getSession().getAttribute("fnaInvoiceWfSetEditSaveFnaAjax_"+thisGuid+"_"+tabIndex+"_fieldIdSubject"));
String tempFieldId_Amount = Util.null2String(request.getSession().getAttribute("fnaInvoiceWfSetEditSaveFnaAjax_"+thisGuid+"_"+tabIndex+"_fieldIdAmount"));
String tempFieldId_Description = Util.null2String(request.getSession().getAttribute("fnaInvoiceWfSetEditSaveFnaAjax_"+thisGuid+"_"+tabIndex+"_fieldIdDescription"));
if(!"".equals(tempFieldId_invoiceNo)){
fieldIdInvoice = tempFieldId_invoiceNo;
}
if(!"".equals(tempFieldId_BillingDate)){
fieldIdDate = tempFieldId_BillingDate;
}
if(!"".equals(tempFieldId_Subject)){
fieldIdSubject = tempFieldId_Subject;
}
if(!"".equals(tempFieldId_Amount)){
fieldIdAmount = tempFieldId_Amount;
}
if(!"".equals(tempFieldId_Description)){
fieldIdDesc = tempFieldId_Description;
}
%>
<html>
<head>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<script language="javascript" src="/wui/theme/ecology8/jquery/js/zDialog_wev8.js"></script>
<script language="javascript" src="/wui/theme/ecology8/jquery/js/zDrag_wev8.js"></script>
<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" %>
<%
RCMenu += "{" + SystemEnv.getHtmlLabelName(86, user.getLanguage())
+ ",javascript:doSave1(),_self} ";//保存
RCMenuHeight += RCMenuHeightStep;
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<div class="zDialog_div_content">
<form action="">
<input id="mainId" name="mainId" value="<%=mainId %>" type="hidden" />
<input id="workflowid" name="workflowid" value="<%=workflowid %>" type="hidden" />
<input id="formid" name="formid" value="<%=formid %>" type="hidden" />
<input id="tabIndex" name=tabIndex value="<%=tabIndex %>" type="hidden" />
<wea:layout type="2col">
<wea:group context='<%=dbTableName %>'>
<wea:item><%=SystemEnv.getHtmlLabelName(131488,user.getLanguage()) %></wea:item><!-- 发票号码 -->
<wea:item>
<%
out.println(FnaWfSet.getSelect(dtlFieldIdListInvoice, dtlFieldInfoHmInvoice, fieldIdInvoice, user, formid, "fieldIdInvoice", true, -1, true, "width:380px;"));
%>
<img src="/wechat/images/remind_wev8.png" align="absMiddle"
title="<%=SystemEnv.getHtmlLabelNames("132211,695",user.getLanguage()) %>" /><!-- 发票浏览按钮 -->
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelName(17213,user.getLanguage()) %></wea:item><!-- 开票日期 -->
<wea:item>
<%
out.println(FnaWfSet.getSelect(dtlFieldIdListBillingDate, dtlFieldInfoHmBillingDate, fieldIdDate, user, formid, "fieldIdDate", true, -1, true, "width:380px;"));
%>
<img src="/wechat/images/remind_wev8.png" align="absMiddle"
title="<%=SystemEnv.getHtmlLabelNames("31682",user.getLanguage()) %>" /><!-- 非必填 -->
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelName(585,user.getLanguage()) %></wea:item><!-- 科目 -->
<wea:item>
<%
out.println(FnaWfSet.getSelect(dtlFieldIdListSubject, dtlFieldInfoHmSubject, fieldIdSubject, user, formid, "fieldIdSubject", true, -1, true, "width:380px;"));
%>
<img src="/wechat/images/remind_wev8.png" align="absMiddle"
title="<%=SystemEnv.getHtmlLabelNames("31682",user.getLanguage()) %>" /><!-- 非必填 -->
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelName(24940,user.getLanguage()) %></wea:item><!-- 开票金额 -->
<wea:item>
<%
out.println(FnaWfSet.getSelect(dtlFieldIdListAmount, dtlFieldInfoHmAmount, fieldIdAmount, user, formid, "fieldIdAmount", true, -1, true, "width:380px;"));
%>
<img src="/wechat/images/remind_wev8.png" align="absMiddle"
title="<%=SystemEnv.getHtmlLabelNames("31682",user.getLanguage()) %>" /><!-- 非必填 -->
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelNames("1491,85",user.getLanguage()) %></wea:item><!-- 费用说明 -->
<wea:item>
<%
out.println(FnaWfSet.getSelect(dtlFieldIdListDescription, dtlFieldInfoHmDescription, fieldIdDesc, user, formid, "fieldIdDesc", true, -1, true, "width:380px;"));
%>
<img src="/wechat/images/remind_wev8.png" align="absMiddle"
title="<%=SystemEnv.getHtmlLabelNames("688",user.getLanguage())+","+SystemEnv.getHtmlLabelNames("31682",user.getLanguage()) %>"/><!-- 非必填 -->
</wea:item>
</wea:group>
</wea:layout>
</form>
</div>
<script type="text/javascript">
var _Label33574 = "<%=SystemEnv.getHtmlLabelName(33574,user.getLanguage()) %>";//正在处理数据,请不要离开该页面,请稍等...
jQuery(document).ready(function(){
resizeDialog(document);
});
//保存
function doSave1(){
var mainId = null2String(jQuery("#mainId").val());
var workflowid = null2String(jQuery("#workflowid").val());
var formid = null2String(jQuery("#formid").val());
var tabIndex = null2String(jQuery("#tabIndex").val());
var fieldIdInvoice = null2String(jQuery("#fieldIdInvoice").val());
var fieldIdDate = null2String(jQuery("#fieldIdDate").val());
var fieldIdSubject = null2String(jQuery("#fieldIdSubject").val());
var fieldIdAmount = null2String(jQuery("#fieldIdAmount").val());
var fieldIdDesc = null2String(jQuery("#fieldIdDesc").val());
var _postStr = "&thisGuid=<%=thisGuid%>&mainId="+mainId+"&workflowid="+workflowid+"&formid="+formid+"&tabIndex="+tabIndex
+"&fieldIdInvoice="+fieldIdInvoice
+"&fieldIdDate="+fieldIdDate
+"&fieldIdSubject="+fieldIdSubject
+"&fieldIdAmount="+fieldIdAmount
+"&fieldIdDesc="+fieldIdDesc;
jQuery.ajax({
url : "/fna/invoice/invoiceWf/FnaInvoiceWfEditSaveFnaAjax.jsp",
type : "post",
cache : false,
processData : false,
async:false,
data : "postStr="+_postStr,
dataType : "html",
success: function do4Success(_json){
doSave2();
}
});
}
function doSave2(){
var mainId = null2String(jQuery("#mainId").val());
var workflowid = null2String(jQuery("#workflowid").val());
var formid = null2String(jQuery("#formid").val());
try{
//确定要保存么?
top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(32130,user.getLanguage()) %>",
function(){
hideRightMenuIframe();
var _data = "operation=editFieldSet&mainId="+mainId+"&workflowid="+workflowid+"&formid="+formid+"&thisGuid=<%=thisGuid%>&r=1";
openNewDiv_FnaBudgetViewInner1(_Label33574);
jQuery.ajax({
url : "/fna/invoice/invoiceWf/FnaInvoiceWfSetOp.jsp",
type : "post",
cache : false,
processData : false,
data : _data,
dataType : "json",
success: function do4Success(_json){
try{
try{closeNewDiv_FnaBudgetViewInner1();}catch(ex1){}
if(_json.flag){
//var parentWin = parent.parent.getParentWindow(parent.window);
//onCancel2();
top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(18758,user.getLanguage()) %>");//保存成功
}else{
top.Dialog.alert(_json.msg);
}
showRightMenuIframe();
}catch(e1){
showRightMenuIframe();
}
}
});
},
function(){}
);
}catch(e1){
showRightMenuIframe();
}
}
</script>
</body>
</html>