CptAssortmentDsp.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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
<%@page import="org.json.JSONObject"%>
<%@page import="weaver.proj.util.PropUtil"%>
<%@ 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="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="RecordSet1" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="CapitalAssortmentComInfo" class="weaver.cpt.maintenance.CapitalAssortmentComInfo" scope="page" />
<%
boolean canedit = HrmUserVarify.checkUserRight("CptCapitalGroupEdit:Edit", user) ;
if(!canedit ){
response.sendRedirect("/notice/noright.jsp");
return;
}
int detachable=Util.getIntValue(String.valueOf(session.getAttribute("detachable")),0);
int parentid=Util.getIntValue(request.getParameter("paraid"),0);
boolean isroot=parentid<=0;
int data1count=Util.getIntValue( CapitalAssortmentComInfo.getCapitalCount(parentid+""),0);
//判断资产组的资产资料个数是否和实际的是否一致20180224
if(data1count>0){
RecordSet.executeSql("select id from cptcapital where isdata =1 and capitalgroupid ="+parentid);
if(RecordSet.next()){
RecordSet1.executeSql("select count(1) as num from cptcapital where isdata =1 and capitalgroupid ="+parentid);
RecordSet1.next();
int num = RecordSet1.getInt(1);
if(num!=data1count){
RecordSet.executeSql("update CptCapitalAssortment set capitalcount="+num+" where id ="+parentid);
}
}else{
data1count=0;
RecordSet.executeSql("update CptCapitalAssortment set capitalcount=0 where id ="+parentid);
}
}//end20180224
int subCompanyId=Util.getIntValue(request.getParameter("subCompanyId"),-1);
int subcompanyid1=Util.getIntValue(request.getParameter("subcompanyid1"),0);
String nameQuery=Util.null2String(request.getParameter("flowTitle"));
String assortmentid = ""+parentid;
RecordSet.executeProc("CptCapitalAssortment_SByID",assortmentid);
RecordSet.next();
String assortmentname = RecordSet.getString("assortmentname");
String assortmentmark = RecordSet.getString("assortmentmark");
String supassortmentid = RecordSet.getString("supassortmentid");
String supassortmentstr = RecordSet.getString("supassortmentstr");
String assortmentremark= RecordSet.getString("assortmentremark");
String subassortmentcount= RecordSet.getString("subassortmentcount");
String capitalcount= RecordSet.getString("capitalcount");
String roleid= RecordSet.getString("roleid");
//System.out.println("isroot:"+isroot);
String pageId=Util.null2String(PropUtil.getPageId("cpt_cptassortmentdsp"));
%>
<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="/cpt/js/common_wev8.js"></script>
<script language="javascript">
function OpenNewWindow(sURL,w,h)
{
var iWidth = 0 ;
var iHeight = 0 ;
iWidth=(window.screen.availWidth-10)*w;
iHeight=(window.screen.availHeight-50)*h;
ileft=(window.screen.availWidth - iWidth)/2;
itop= (window.screen.availHeight - iHeight + 50)/2;
var szFeatures = "" ;
szFeatures = "resizable=no,status=no,menubar=no,width=" +
iWidth + ",height=" + iHeight*h + ",top="+itop+",left="+ileft
window.open(sURL,"",szFeatures)
}
</script>
<%
String imagefilename = "/images/hdMaintenance_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(259,user.getLanguage());
String needfav ="1";
String needhelp ="";
%>
</head>
<body style="overflow:hidden;">
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
if(canedit&&data1count<=0) {
RCMenu += "{"+SystemEnv.getHtmlLabelName(82,user.getLanguage())+",javascript:addSub("+parentid+"),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
}
if(canedit){
RCMenu += "{"+SystemEnv.getHtmlLabelNames("32136",user.getLanguage())+",javascript:batchDel(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
}
/**
if(HrmUserVarify.checkUserRight("CptAssortment:Log", user)){
RCMenu += "{"+SystemEnv.getHtmlLabelName(83,user.getLanguage())+",/systeminfo/SysMaintenanceLog.jsp?sqlwhere=where operateitem = 43 and relatedid="+parentid+",_self} " ;
RCMenuHeight += RCMenuHeightStep ;
}
**/
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<form name="form2" method="post" action="">
<input type="hidden" name="pageId" id="pageId" value="<%=pageId %>" />
<input type="hidden" name="isroot" value="<%=isroot %>" />
<input type="hidden" name="paraid" value="<%=parentid %>" />
<table id="topTitle" cellpadding="0" cellspacing="0">
<tr>
<td>
</td>
<td class="rightSearchSpan" style="text-align:right; width:500px!important">
<%
if(canedit&&data1count<=0){
%>
<input type="button" value="<%=SystemEnv.getHtmlLabelNames("82",user.getLanguage())%>" class="e8_btn_top" onclick="addSub(<%=parentid %>);"/>
<%
}
if(canedit){
%>
<input type="button" value="<%=SystemEnv.getHtmlLabelNames("32136",user.getLanguage())%>" class="e8_btn_top" onclick="batchDel()"/>
<%
}
%>
<input type="text" class="searchInput" name="flowTitle" value="<%=nameQuery %>" />
<span id="advancedSearch" class="advancedSearch" style="display:none;"><%=SystemEnv.getHtmlLabelNames("347",user.getLanguage())%></span>
<span title="<%=SystemEnv.getHtmlLabelNames("23036",user.getLanguage())%>" class="cornerMenu"></span>
</td>
</tr>
</table>
<!-- advanced search -->
<div class="advancedSearchDiv" id="advancedSearchDiv" style="display:none;">
<table class="viewForm">
<TR>
<td></td>
<td class=Field><select class=inputstyle name=typeid onChange="wfSearch()" >
<option value="0"> </option>
</select></td>
<td></td>
<td class=Field><input type="text" class=inputstyle name="wfnameQuery" size="30" value=""></td>
</TR>
<tr>
<td colspan="4" class="btnTd">
<input type="submit" value="<%=SystemEnv.getHtmlLabelNames("197",user.getLanguage())%>" class="e8_btn_submit" />
<input type="button" value="<%=SystemEnv.getHtmlLabelNames("201",user.getLanguage())%>" class="e8_btn_cancel" id="cancel"/>
</td>
</tr>
</table>
</div>
<%
String popedomOtherpara="";
//操作列参数
JSONObject operatorInfo=new JSONObject();
operatorInfo.put("userid", user.getUID());
operatorInfo.put("usertype", user.getLogintype());
operatorInfo.put("languageid", user.getLanguage());
operatorInfo.put("operatortype", "cpt_cptassortment");//操作项类型
operatorInfo.put("operator_num", 5);//操作项数量
operatorInfo.put("operator_val", popedomOtherpara);
operatorInfo.put("isroot", isroot);
String sqlWhere = " where supassortmentid="+parentid;
if(!"".equals(nameQuery)){
sqlWhere+=" and assortmentname like '%"+nameQuery+"%'";
}
if(subcompanyid1>0) {
sqlWhere+=" and subcompanyid1="+subcompanyid1;
}
String orderby =" assortmentmark ";
String tableString = "";
int perpage=10;
String backfields = " id,assortmentname,assortmentmark ";
String fromSql = " CptCapitalAssortment ";
tableString = " <table pageId=\""+pageId+"\" instanceid=\"CptCapitalAssortmentTable\" tabletype=\"checkbox\" pagesize=\""+PageIdConst.getPageSize(pageId,user.getUID(),"cpt")+"\" >"+
" <checkboxpopedom id=\"checkbox\" popedompara=\"column:id\" showmethod='weaver.cpt.util.CapitalTransUtil.getCanDelCptAssortment' />"+
" <sql backfields=\""+backfields+"\" sqlform=\""+fromSql+"\" sqlwhere=\""+Util.toHtmlForSplitPage(sqlWhere)+"\" sqlorderby=\""+orderby+"\" sqlprimarykey=\"id\" sqlsortway=\"ASC\" sqlisdistinct=\"true\" />"+
" <head>"+
" <col width=\"25%\" text=\""+SystemEnv.getHtmlLabelName( 195 ,user.getLanguage())+"\" column=\"assortmentname\" orderkey=\"assortmentname\" />"+
" <col width=\"25%\" text=\""+SystemEnv.getHtmlLabelName( 714 ,user.getLanguage())+"\" column=\"assortmentmark\" orderkey=\"assortmentmark\" />"+
" </head>"+
" <operates>"+
" <popedom column='id' otherpara='"+operatorInfo.toString() +"' transmethod='weaver.cpt.util.CapitalTransUtil.getOperates' ></popedom> "+
" <operate href=\"javascript:onEdit();\" text=\""+SystemEnv.getHtmlLabelNames("93",user.getLanguage())+"\" target=\"_self\" index=\"0\"/>"+
" <operate href=\"javascript:onDel();\" text=\""+SystemEnv.getHtmlLabelNames("91",user.getLanguage())+"\" target=\"_self\" index=\"1\"/>"+
" <operate href=\"javascript:onLog();\" text=\""+SystemEnv.getHtmlLabelNames("83",user.getLanguage())+"\" target=\"_self\" index=\"2\"/>"+
" <operate href=\"javascript:addSub();\" text=\""+SystemEnv.getHtmlLabelNames("18423",user.getLanguage())+"\" target=\"_self\" index=\"3\"/>"+
" <operate href=\"javascript:onShare();\" text=\""+SystemEnv.getHtmlLabelNames("2112",user.getLanguage())+"\" target=\"_self\" index=\"4\"/>" +
" </operates>"+
" </table>";
%>
<!-- listinfo -->
<wea:SplitPageTag tableString='<%=tableString%>' mode="run" />
</form>
<script language="javascript">
function submitData()
{
var wfids = _xtable_CheckedCheckboxId();
if(wfids=="") return ;
window.top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(15097,user.getLanguage())%>", function (){
form2.action="delwfs.jsp?wfids="+wfids;
form2.submit();
enableAllmenu();
}, function () {}, 320, 90,false);
}
function submitClear()
{
btnclear_onclick();
}
</script>
<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 type="text/javascript">
function addSub(id){
if(id==undefined||id==null) id=0;
var url="/cpt/maintenance/CptAssortmentAdd.jsp?subcompanyid1=<%=subcompanyid1 %>&isdialog=1¶id="+id;
var title=id!=0?"<%=SystemEnv.getHtmlLabelNames("18423",user.getLanguage())%>":"<%=SystemEnv.getHtmlLabelNames("83654",user.getLanguage())%>";
openDialog(url,title,600,368);
}
function onEdit(id){
if(id){
var url="/cpt/maintenance/CptAssortmentEdit.jsp?isdialog=1¶id="+id;
var title="<%=SystemEnv.getHtmlLabelNames("83656",user.getLanguage())%>";
openDialog(url,title,600,368);
}
}
function onDel(id){
if(id){
window.top.Dialog.confirm('<%=SystemEnv.getHtmlLabelNames("83600",user.getLanguage())%>',function(){
jQuery.post(
"/cpt/maintenance/CptAssortmentOperation.jsp",
{"operation":"deleteassortment","assortmentid":id},
function(data){
window.top.Dialog.alert("<%=SystemEnv.getHtmlLabelNames("83472",user.getLanguage())%>",function(){
_table.reLoad();
refreshLeftTree();
});
}
);
});
}
}
function onShare(id){
if(id){
var url="/cpt/maintenance/CptAssortmentAddShare.jsp?isdialog=1&assortmentid="+id;
var title="<%=SystemEnv.getHtmlLabelNames("83660",user.getLanguage())%>";
openDialog(url,title,500,290);
}
}
function onLog(id){
//var url="/systeminfo/SysMaintenanceLog.jsp?sqlwhere=where operateitem = 43 and relatedid="+id;
var url = "/systeminfo/SysMaintenanceLog.jsp?operateitem=43&relatedid="+id;
var title="<%=SystemEnv.getHtmlLabelNames("32061",user.getLanguage())%>";
openDialog(url,title,1000,600,false);
}
function batchDel(){
var typeids = _xtable_CheckedCheckboxId();
if(typeids=="") return ;
window.top.Dialog.confirm('<%=SystemEnv.getHtmlLabelNames("83601",user.getLanguage())%>',function(){
jQuery.post(
"/cpt/maintenance/CptAssortmentOperation.jsp",
{"operation":"batchdeleteassortment","assortmentid":typeids},
function(data){
window.top.Dialog.alert("<%=SystemEnv.getHtmlLabelNames("83472",user.getLanguage())%>",function(){
_table.reLoad();
refreshLeftTree();
});
}
);
});
}
function onBtnSearchClick(){
form2.submit();
}
$(function(){
var cptgroupname='<%=CapitalAssortmentComInfo.getAssortmentName(""+ parentid) %>';
if(cptgroupname==''){
cptgroupname='<%=SystemEnv.getHtmlLabelName(16617,user.getLanguage()) %>';
}
try{
parent.setTabObjName(cptgroupname);
}catch(e){}
});
$(function(){
$("#topTitle").topMenuTitle({searchFn:onBtnSearchClick});
});
function refreshLeftTree(){
try{
var tree= $("#leftframe",parent.parent.document);
var src=tree.attr("src");
tree.attr("src",src);
}catch(e){}
}
</script>
</body>
</html>