2018-11-05 15:22:08 +08:00

136 lines
4.4 KiB
Plaintext

<%@page import="jbo.sys.USER_INFO"%>
<%@page import="com.amarsoft.biz.workflow.*"%>
<%@page import="com.amarsoft.are.lang.StringX"%>
<%@page contentType="text/html; charset=GBK"%>
<%@include file="/Frame/resources/include/include_begin.jspf"%>
<%
String taskNo = CurPage.getParameter("TaskNo");
if(StringX.isSpace(taskNo)) taskNo = "";
String userID = CurUser.getUserID(), attribute10 = null; /* 传阅角色 */
//JBOTransaction tx = JBOFactory.createJBOTransaction();
FlowTask ft = new FlowTask(taskNo, Sqlca);//使用jboTrans
BizObject fm = JBOFactory.getBizObjectManager("jbo.sys.FLOW_MODEL").createQuery("select attribute10 from O where flowNo=:flowNo and phaseNo=:phaseNo ")
.setParameter("flowNo", ft.FlowNo ).setParameter("phaseNo", ft.PhaseNo).getSingleResult(false);
if(fm!=null){
attribute10 = fm.getAttribute("attribute10").getString();
}
%>
<style>
.opinion-style{
width:100%;
overflow:hidden;
display:inline-block;
margin-bottom:2px;
outline:none;
}
.opinion-style2{
overflow:hidden;
display:inline-block;
margin-bottom:2px;
outline:none;
}
a.opinion-style:hover{
background-color:A8CAE5;
outline:none;
}
.opinion-focus{
background-color:A8CAE5;
}
</style>
<%
List<String> userList = new ArrayList<String>();
if(StringX.isEmpty(attribute10)){
%>
<div style="margin-top:10px;margin-left:15px;font-size:12px;">
<font color="#000000"><b>请确认是否配置了传阅角色! </b></font>
</div>
<%
}else{
//根据配置的角色, 在当前机构中找到所有用户
List<BizObject> users = JBOFactory.getBizObjectManager(USER_INFO.CLASS_NAME).createQuery("select O.userID,O.userName,UR.roleID , RI.roleName"
+" from O, jbo.sys.USER_ROLE UR,jbo.sys.ROLE_INFO RI where O.userID=UR.userID and UR.roleID=RI.roleID and O.BelongOrg=:BelongOrg and UR.roleID=:roleID and O.Status='1' and UR.status='1' ")
.setParameter("BelongOrg", CurUser.getOrgID()).setParameter("roleID", attribute10).getResultList(false);
for(BizObject user : users){
String _userID = user.getAttribute("userID").getString();
String _userName = user.getAttribute("userName").getString();
String _roleID = user.getAttribute("roleID").getString();
String _roleName = user.getAttribute("roleName").getString();
userList.add( _userID+" "+_userName+" "+_roleID+" "+_roleName );
}
%>
<div>
<table>
<tr>
<td width="50%" align="right"><%=new Button("传阅","传阅","javascript:passRound();","","btn_icon_Submit","").getHtmlText()%></td>
<td width="50%" align="center"><%=new Button("关闭","关闭","javascript:doCancel();","","btn_icon_delete","").getHtmlText()%></td>
</tr>
</table>
</div>
<%
}
%>
<div id="actionset"></div>
<div>
<table width="100%" align="center">
<tr>
<td align="center"><b><span id="phaseinfo" style="color: #FF0000" ></span></b></td>
</tr>
</table>
</div>
<script type="text/javascript">
var taskNo = "<%=taskNo%>";
var actionSet = $("#actionset");
/*~ 在当前机构中找传阅角色的用户,生成传阅用户列表 ~*/
function getUserList(){
if(<%=StringX.isEmpty(attribute10)%>) return;
actionSet.append("<div style='margin-top:10px;margin-left:15px;font-size:12px;'><font color='#000000'><b>请选择用户:</b></font></div><div id='phaseaction' style='margin-top:10px;margin-left:10px;font-size:12px;border:1px solid lightgray;padding:5px;'></div>");
var phaseAction = $("#phaseaction");
<%
if(userList.size()<1){
%>
phaseAction.append("<a class='opinion-style' href='javascript:void(0)' >在当前机构中没有<%=attribute10%>角色的用户!</a>");
<%
}else{
for(String userStr : userList){%>
phaseAction.append("<a class='opinion-style' href='javascript:void(0)' ><input type='checkbox' name='phaseaction' value='<%=userStr%>'><%=userStr%></input></a>");
<% }
}%>
}
//传阅
function passRound(){
var checkedbox = [];
$("input[name='phaseaction']:checked").each(function(){
checkedbox.push($(this).val());
});
var _users = checkedbox.join("@");
if(! _users){
alert("请选择用户!");
return;
}
if (!confirm("传阅给选择的用户,是否继续吗?")) return;
var returnValue = RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction","passRound","TaskNo="+taskNo+",PhaseAction="+_users);
parent.AsDialog.ClosePage(returnValue);
}
window.onload = function(){
//生成用户列表
getUserList();
};
function doCancel(){
if(confirm("您确定要关闭吗?")){
parent.AsDialog.ClosePage("_CANCEL_");
}
}
</script>
<%@include file="/Frame/resources/include/include_end.jspf"%>