MultiPrintMode.jsp
6.17 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
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.Util,weaver.general.BaseBean" %>
<%@ page import="java.util.ArrayList" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<HTML><HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<LINK href="/css/rp_wev8.css" rel="STYLESHEET" type="text/css">
<script language=javascript src="/js/weaver_wev8.js"></script>
<jsp:useBean id="WFLinkInfo" class="weaver.workflow.request.WFLinkInfo" scope="page"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
BaseBean bb_printmode = new BaseBean();
int urm_printmode = 1;
try{
urm_printmode = Util.getIntValue(bb_printmode.getPropValue("systemmenu", "userightmenu"), 1);
}catch(Exception e){}
RCMenu += "{"+SystemEnv.getHtmlLabelName(20756,user.getLanguage())+",javascript:doPrintSet(),_top}" ;
RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{"+SystemEnv.getHtmlLabelName(257,user.getLanguage())+",javascript:doPrint(),_top}" ;
RCMenuHeight += RCMenuHeightStep ;
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<BODY id="flowbody" style="overflow:auto">
<input type="hidden" id="nPrintOrient" name="nPrintOrient" value="1">
<iframe id="setprinttypeiframe" name="setprinttypeiframe" src="" style="display:none"></iframe>
<table width=100% height=100% border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="10">
<col width="">
<col width="10">
<tr>
<td height="10" colspan="3"></td>
</tr>
<tr>
<td ></td>
<td valign="top">
<TABLE class="viewform">
<tr>
<td width="100%" height=100% valign="top" align="center">
<table class="viewform" width="100%">
<%
String multirequestid = Util.null2String(request.getParameter("multirequestid"));
int workflowid = 0;
int nodeid = 0;
int isbill = 0;
String formid = "";
int billid = 0;
String ismode="";
int modeid=0;
int isform=0;
int printdes=0;
//标识是否有可打印的流程
boolean hasPrintModeWf = false;
ArrayList requestidList = new ArrayList();
ArrayList wfidList = new ArrayList();
String passrequestids = "";
rs.executeSql("select * from workflow_requestbase where requestid in ("+multirequestid+"0) order by requestid");
while(rs.next()){
int requestid = Util.getIntValue(rs.getString("requestid"), 0);
if(requestid == 0){
continue;
}
workflowid = Util.getIntValue(rs.getString("workflowid"), 0);
requestidList.add(""+requestid);
wfidList.add(""+workflowid);
}
int userid=user.getUID(); //当前用户id
String logintype = user.getLogintype(); //当前用户类型 1: 类别用户 2:外部用户
String printstr = Util.null2String(request.getParameter("printstr"));
for(String itemstr : printstr.split(",")){
String[] itemArr = itemstr.split("\\|");
if(itemArr.length < 4)
continue;
int requestid = Util.getIntValue(itemArr[0], 0);
modeid = Util.getIntValue(itemArr[1], 0);
workflowid = Util.getIntValue(itemArr[2], 0);
nodeid = Util.getIntValue(itemArr[3], 0);
RecordSet.execute("select * from workflow_base where id="+workflowid);
if(RecordSet.next()){
isbill = Util.getIntValue(RecordSet.getString("isbill"), 0);
formid = Util.null2String(RecordSet.getString("formid"));
}
if(isbill == 1){
RecordSet.executeProc("workflow_form_SByRequestid", requestid+"");
if(RecordSet.next()){
billid = Util.getIntValue(RecordSet.getString("billid"));
}
}
if(modeid<1){
continue;
}
//只要有一个可打印的流程,则改变此flag 的状态
hasPrintModeWf = true;
%>
<tr>
<td align="center" width="100%">
<iframe id="requestiframe<%=requestid%>" name="requestiframe<%=requestid%>" scrolling="no" marginheight="0" marginwidth="0" allowTransparency="true" frameborder="0" style="overflow-x:visible;overflow-y:visible;" src="/workflow/request/PrintMode.jsp?requestid=<%=requestid%>&isbill=<%=isbill%>&workflowid=<%=workflowid%>&formid=<%=formid%>&nodeid=<%=nodeid%>&billid=<%=billid%>&fromFlowDoc=1&passrequestids=<%=passrequestids%>&ismultiprintmode=1&printmodeid=<%=modeid %>"></iframe>
</td>
</tr>
<%
passrequestids += (requestid+",");
}%>
</table>
</td>
</tr>
</TABLE>
</td>
<td></td>
</tr>
<tr>
<td height="10" colspan="3"></td>
</tr>
</table>
</body>
<script type="text/javascript">
<%
new BaseBean().writeLog("================= qyj browser_isie=================== :"+(String)session.getAttribute("browser_isie"));
String isIE_tmp = "false";
String useragent_tmp = request.getHeader("user-agent");
if(useragent_tmp.contains("Firefox")||useragent_tmp.contains(" Chrome")||useragent_tmp.contains("Safari") || useragent_tmp.contains("Edge")){
isIE_tmp = "false";
} else{
isIE_tmp = "true";
}
new BaseBean().writeLog("================= qyj isIE_tmp=================== :"+isIE_tmp);
%>
//if(<%=!"true".equals((String)session.getAttribute("browser_isie"))%>){
if(<%=!"true".equals(isIE_tmp)%>){
alert("<%=SystemEnv.getHtmlLabelName(387190 ,user.getLanguage())%>");
window.close();
}
if (<%=!hasPrintModeWf%>) {
alert("<%=SystemEnv.getHtmlLabelName(84014 ,user.getLanguage())%>");
window.close();
}
</script>
<script language="javascript">
function doPrint(){
//1:纵向;2:横向
var nPrintOrient = document.getElementById("nPrintOrient").value;
var intvalue = 1;
if(nPrintOrient=="1"){
intvalue = 1;
}else{
intvalue = 2;
}
<%
for(int i=0; i<requestidList.size(); i++){
int requestid = Util.getIntValue((String)requestidList.get(i), 0);
if(!requestidList.contains(""+requestid)){
continue;
}
%>
try{
var frameObj = document.getElementById("requestiframe<%=requestid%>").contentWindow;
frameObj.document.frmmain.ChinaExcel.SetPrintOrient(intvalue);
frameObj.document.frmmain.ChinaExcel.PrintFile();
}catch(e){
}
<%}%>
document.getElementById("setprinttypeiframe").src = "/workflow/multiprint/Setprinttypeiframe.jsp?multirequestid=<%=passrequestids%>";
}
function doPrintSet(){
var url = "/workflow/workflow/BrowserMain.jsp?url=/workflow/multiprint/MultiPrintSet.jsp";
var con = window.showModalDialog(url);
if(con != undefined){
document.getElementById("nPrintOrient").value = con;
}
}
</script>
</html>