FnaInvoiceSubjectSetInner.jsp
15.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
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
<%@page import="weaver.workflow.field.BrowserComInfo"%>
<%@page import="weaver.fna.general.FnaCommon"%>
<%@page import="weaver.systeminfo.label.LabelComInfo"%>
<%@page import="org.apache.commons.lang.StringEscapeUtils"%>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ taglib uri="/WEB-INF/tld/browser.tld" prefix="brow"%>
<%@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" />
<jsp:useBean id="WorkflowComInfo" class="weaver.workflow.workflow.WorkflowComInfo" scope="page" />
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page" />
<%
if(!HrmUserVarify.checkUserRight("FnaInvoiceSubject:Check", user)){
response.sendRedirect("/notice/noright.jsp") ;
return ;
}
String imagefilename = "/images/hdMaintenance_wev8.gif";
String titlename = "";
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();
String advQry_invoiceServiceYype = Util.null2String(request.getParameter("advQry_invoiceServiceYype")).trim();
String datecondition = Util.null2String(request.getParameter("createdateselect"));
String createdatefrom = Util.null2String(request.getParameter("createdatefrom")).trim();
String createdateto = Util.null2String(request.getParameter("createdateto")).trim();
String subjectIds = Util.null2String(request.getParameter("subjectIds")).trim();
StringBuffer shownameSubject = new StringBuffer();
if(!"".equals(subjectIds)){
String sql = "select a.id, a.name from FnaBudgetfeeType a where a.id in ("+subjectIds+") ORDER BY a.codename, a.name, a.id ";
subjectIds = "";
rs.executeSql(sql);
while(rs.next()){
if(shownameSubject.length() > 0){
shownameSubject.append(",");
subjectIds+=",";
}
shownameSubject.append(Util.null2String(rs.getString("name")).trim());
subjectIds+=Util.null2String(rs.getString("id")).trim();
}
}
%>
<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(25055,user.getLanguage())+",javascript:addBatch(),_TOP} ";//批量添加
RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{"+SystemEnv.getHtmlLabelName(384937,user.getLanguage())+",javascript:setSubjectBatch(),_TOP} ";//批量设置科目
RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{"+SystemEnv.getHtmlLabelName(32136,user.getLanguage())+",javascript:delBatch(),_self} ";//批量删除
RCMenuHeight += RCMenuHeightStep ;
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<form id="form2" name="form2" method="post" action="/fna/invoice/invoiceWf/FnaInvoiceSubjectSetInner.jsp">
<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(25055,user.getLanguage()) %>"
class="e8_btn_top" onclick="addBatch();"/><!-- 批量添加 -->
<input type="button" value="<%=SystemEnv.getHtmlLabelName(384937,user.getLanguage()) %>"
class="e8_btn_top" onclick="setSubjectBatch();"/><!-- 批量设置科目 -->
<input type="button" value="<%=SystemEnv.getHtmlLabelName(32136,user.getLanguage()) %>"
class="e8_btn_top" onclick="delBatch();"/><!-- 批量删除 -->
<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>
<div class="advancedSearchDiv" id="advancedSearchDiv">
<wea:layout type="4Col">
<wea:group context='<%=SystemEnv.getHtmlLabelName(15774, user.getLanguage()) %>'><!-- 搜索条件 -->
<wea:item><%=SystemEnv.getHtmlLabelName(131492,user.getLanguage())%></wea:item><!-- 货物或应税服务类型 -->
<wea:item>
<input type=text class="inputstyle" id="advQry_invoiceServiceYype" name="advQry_invoiceServiceYype" style="width: 80%;" maxlength="500"
value="<%=FnaCommon.escapeHtmlNull(advQry_invoiceServiceYype) %>" />
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelNames("30754,585",user.getLanguage())%></wea:item><!-- 对应科目 -->
<wea:item>
<brow:browser viewType="0" name="subjectIds" browserValue='<%=subjectIds %>'
browserUrl="/systeminfo/BrowserMain.jsp?url=/fna/browser/FnaType4Report/FnaType4ReportBrowserMulti.jsp%3Fselectids=#id#"
hasInput="true" isSingle="false" hasBrowser = "true" isMustInput="1"
completeUrl="/data.jsp?type=22"
browserSpanValue='<%=shownameSubject.toString() %>' width="85%"
_callback="" afterDelCallback="">
</brow:browser>
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelName(19520,user.getLanguage())%></wea:item><!-- 最后修改时间 -->
<wea:item>
<span style='float:left;display:inline-block;'>
<select name="createdateselect" id="createdateselect" onchange="changeDate(this,'createdate2');" class="inputstyle" size=1>
<option value="0" <% if(datecondition.equals("0")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(332, user.getLanguage()) %></option>
<option value="1" <% if(datecondition.equals("1")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15537, user.getLanguage()) %></option>
<option value="2" <% if(datecondition.equals("2")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15539, user.getLanguage()) %></option>
<option value="3" <% if(datecondition.equals("3")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15541, user.getLanguage()) %></option>
<option value="4" <% if(datecondition.equals("4")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(21904, user.getLanguage()) %></option>
<option value="5" <% if(datecondition.equals("5")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15384, user.getLanguage()) %></option>
<option value="6" <% if(datecondition.equals("6")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(32530, user.getLanguage()) %></option>
</select>
</span>
<span style='float:left;margin-left: 10px;padding-top: 5px;'>
<span id="createdate2" style="display:<%if(!datecondition.equals("6")) {%>none<%} %>" >
<button type="button" class="calendar" id="SelectDate" onclick="getDate(createdatefromspan,createdatefrom)"></button>
<span id="createdatefromspan"><%=createdatefrom %></span>
- <button type="button" class="calendar" id="SelectDate2" onclick="getDate(createdatetospan,createdateto)"></button>
<span id="createdatetospan"><%=createdateto %></span>
</span>
<input type="hidden" name="createdatefrom" value="<%=createdatefrom %>">
<input type="hidden" name="createdateto" value="<%=createdateto %>">
</span>
</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>
<%
//设置好搜索条件
String backFields = " a.id,a.invoiceServiceYype,a.lastmodifytime,b.name,a.subjectid ";
String fromSql = " from FnaInvoiceSubject a "+
" left join Fnabudgetfeetype b on a.subjectid = b.id ";
String sqlWhere = " where 1=1 ";
if(!"".equals(nameQuery)){
sqlWhere += " and a.invoiceServiceYype like '%"+StringEscapeUtils.escapeSql(nameQuery)+"%' ";
}
if(!"".equals(advQry_invoiceServiceYype)){
sqlWhere += " and a.invoiceServiceYype like '%"+StringEscapeUtils.escapeSql(advQry_invoiceServiceYype)+"%' ";
}
if(!"".equals(subjectIds)){
sqlWhere += " and a.subjectid in ("+StringEscapeUtils.escapeSql(subjectIds)+")";
}
if(datecondition.equals("1")){
String date = TimeUtil.getDateByOption(""+datecondition,"0");
sqlWhere += " and a.lastmodifytime like '%"+StringEscapeUtils.escapeSql(date)+"%' ";
}else if(datecondition.equals("6")){
if(!"".equals(createdatefrom)){
sqlWhere += " and a.lastmodifytime >= '"+StringEscapeUtils.escapeSql(createdatefrom)+"' ";
}
if(!"".equals(createdateto)){
sqlWhere += " and a.lastmodifytime <= '"+StringEscapeUtils.escapeSql(createdateto)+"' ";
}
}else if(datecondition.equals("2") || datecondition.equals("3") || datecondition.equals("4") || datecondition.equals("5")){
createdatefrom = TimeUtil.getDateByOption(""+datecondition,"0");
createdateto = TimeUtil.getDateByOption(""+datecondition,"1");
sqlWhere = sqlWhere + " and a.lastmodifytime >= '"+createdatefrom+"' and a.lastmodifytime <= '"+createdateto+"'";
}
String orderBy = " a.id ";
String sqlprimarykey = "a.id";
// out.println("select "+backFields+" "+fromSql+" "+sqlWhere+" order by "+orderBy);
String tableString=""+
"<table instanceid=\"FNA_INVOICE_SUBJECT_INNER_LIST\" pageId=\""+PageIdConst.FNA_INVOICE_SUBJECT_INNER_LIST+"\" "+
" pagesize=\""+PageIdConst.getPageSize(PageIdConst.FNA_INVOICE_SUBJECT_INNER_LIST,user.getUID(),PageIdConst.FNA)+"\" tabletype=\"checkbox\">"+
"<sql backfields=\""+Util.toHtmlForSplitPage(backFields)+"\" sqlform=\""+Util.toHtmlForSplitPage(fromSql)+"\" sqlwhere=\""+Util.toHtmlForSplitPage(sqlWhere)+"\" sqlorderby=\""+Util.toHtmlForSplitPage(orderBy)+"\" "+
" sqlprimarykey=\""+Util.toHtmlForSplitPage(sqlprimarykey)+"\" sqlsortway=\"desc\" />"+
"<head>"+
"<col width=\"40%\" text=\""+SystemEnv.getHtmlLabelName(131492,user.getLanguage())+"\" column=\"invoiceServiceYype\" orderkey=\"invoiceServiceYype\" "+//货物或应税服务类型
" transmethod=\"weaver.fna.general.FnaSplitPageTransmethod.doJsFunc\" otherpara=\"setSubject+column:id\"/>"+
"<col width=\"30%\" text=\""+SystemEnv.getHtmlLabelNames("30754,585",user.getLanguage())+"\" column=\"name\" orderkey=\"name\" "+//对应科目
" transmethod=\"weaver.fna.general.FnaSplitPageTransmethod.doJsFunc\" otherpara=\"setSubject+column:id\"/>"+
"<col width=\"30%\" text=\""+SystemEnv.getHtmlLabelName(19520,user.getLanguage())+"\" column=\"lastmodifytime\" orderkey=\"lastmodifytime\" />"+//最后修改时间
"</head>"+
" <operates>"+
" <operate href=\"javascript:setSubject();\" text=\""+SystemEnv.getHtmlLabelNames("68,30754,585",user.getLanguage())+"\" index=\"0\"/>"+//设置对应科目
" <operate href=\"javascript:del();\" text=\""+SystemEnv.getHtmlLabelName(91,user.getLanguage())+"\" index=\"1\"/>"+//删除
" </operates>"+
"</table>";
%>
<wea:layout type="1col">
<wea:group context="" attributes="{'groupDisplay':'none'}">
<wea:item attributes="{'isTableList':'true'}">
<input type="hidden" name="pageId" id="pageId" value="<%=PageIdConst.FNA_INVOICE_SUBJECT_INNER_LIST %>" />
<wea:SplitPageTag tableString='<%=tableString%>' mode="run" />
</wea:item>
</wea:group>
</wea:layout>
</form>
<script type="text/javascript">
var _Label33574 = "<%=SystemEnv.getHtmlLabelName(33574,user.getLanguage()) %>";//正在处理数据,请不要离开该页面,请稍等...
function getFlowWindowUrl(){
return "/systeminfo/BrowserMain.jsp?url=/workflow/workflow/WorkflowTypeBrowser.jsp";
}
function query(){
document.getElementById("form2").submit();
}
function onBtnSearchClick(from_advSubmit){
if(from_advSubmit=="from_advSubmit"){
jQuery("#nameQuery").val(jQuery("#advQry_invoiceServiceYype").val());
}else{
jQuery("#advQry_invoiceServiceYype").val(jQuery("#nameQuery").val());
}
form2.submit();
}
function setSubject(id){
var _w = 600;
var _h = 395;
_fnaOpenDialog("/fna/invoice/invoiceWf/FnaInvoiceSubjectEdit.jsp?id="+id,
"<%=SystemEnv.getHtmlLabelName(93,user.getLanguage()) %>",
_w, _h);
}
function del(id){
var _data = "operation=delSubject&id="+id;
//确认要删除吗?
top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(15097,user.getLanguage()) %>",
function(){
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){}
top.Dialog.alert(_json.msg);
if(_json.flag){
window._table.reLoad();
}
}catch(e1){
}
}
});
},
function(){}
);
}
function delBatch(){
var ids = _xtable_CheckedCheckboxId();
if(ids==""){
top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(24244,user.getLanguage()) %>");//请先选择需要删除的数据
return;
}
var _data = "operation=delSubjectBatch&ids="+ids;
top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(15097,user.getLanguage()) %>",
function(){
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){}
top.Dialog.alert(_json.msg);
if(_json.flag){
window._table.reLoad();
}
}catch(e1){
}
}
});
},
function(){}
);
}
function setSubjectBatch(){
var ids = _xtable_CheckedCheckboxId();
if(ids==""){
top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(384965,user.getLanguage()) %>");//请选择需要设置的记录!
return;
}
var _w = 600;
var _h = 395;
_fnaOpenDialog("/fna/invoice/invoiceWf/FnaInvoiceSubjectBatchSet.jsp?ids="+ids,
"<%=SystemEnv.getHtmlLabelName(384937,user.getLanguage()) %>",
_w, _h);
}
function addBatch(){
var _w = 600;
var _h = 395;
_fnaOpenDialog("/fna/invoice/invoiceWf/FnaInvoiceSubjectBatchAdd.jsp",
"<%=SystemEnv.getHtmlLabelName(25055,user.getLanguage()) %>",
_w, _h);
}
</script>
<script language="javascript" src="/js/datetime_wev8.js"></script>
<script language="javascript" src="/js/JSDateTime/WdatePicker_wev8.js"></script>
</body>
</html>