148 lines
4.8 KiB
Plaintext
148 lines
4.8 KiB
Plaintext
<%@page import="com.amarsoft.are.util.json.JSONEncoder"%>
|
|
<%@ page language="java" contentType="text/html; charset=GBK"%>
|
|
<%@ include file="/Frame/resources/include/include_begin.jspf"%>
|
|
<%@ page import="com.tenwa.flow.util.SelectUser" %>
|
|
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/widget/htmltree.js"></script>
|
|
<%
|
|
String pid="8" ;
|
|
String curOrgId="";
|
|
|
|
//if(CurUser.hasRole("299")){
|
|
// curOrgId=session.getAttribute("managerPlatFormOrgId").toString();
|
|
//}else{
|
|
curOrgId=CurUser.getOrgID();
|
|
//}
|
|
//if(curOrgId.length()>13){
|
|
// curOrgId=curOrgId.substring(0,13);
|
|
//}
|
|
curOrgId=curOrgId.substring(0,curOrgId.length()-3);
|
|
pid=curOrgId;
|
|
String selectType=CurPage.getParameter("selectType");
|
|
String flowno=CurPage.getParameter("flowno");
|
|
ObjectTree tree = new ObjectTree("多选参半案例");
|
|
SelectUser selectUser=new SelectUser(pid,Sqlca,"","",CurUser,selectType,flowno);
|
|
selectUser.initTreeNode(tree);
|
|
SelectUser selectUser1=new SelectUser("8006",Sqlca,"","",CurUser,selectType,flowno);
|
|
selectUser1.initTreeNode(tree);
|
|
String isSingle=CurPage.getParameter("IsSingle");
|
|
if(isSingle==null){isSingle="false";}
|
|
%>
|
|
<body>
|
|
<table style="width:100%">
|
|
<tr>
|
|
<td style="width:40%"><div id="test" style="width:100%;height:420px;overflow:auto;border:1px solid #D9D9D9"></div></td>
|
|
<td style="width:20%;text-align:center;margin:0 auto">
|
|
<div style="width:20%;display:inline;text-align:center;margin:0 auto">
|
|
<%out.print(new Button("选择", "", "showChecked()").getHtmlText());%>
|
|
<%out.print(new Button("取消", "", "deleteSelectedItem()").getHtmlText());%>
|
|
</div>
|
|
</td>
|
|
<td style="width:40%">
|
|
<select name='selectInfo' id="id_selectInfo" size='10' style='width:100%;height:420px;border:1px solid #D9D9D9' multiple>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3" style="text-align:center;margin:0 auto" >
|
|
<%=new Button(" 确 定 ","确定","getSelectData()","","").getHtmlText()%>
|
|
<%=new Button(" 返 回 ","返回"," parent.AsDialog.ClosePage('back')","","").getHtmlText()%>
|
|
<%=new Button(" 清 空 ","清空"," parent.AsDialog.ClosePage('clean')","","").getHtmlText()%>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
<div>
|
|
|
|
</div>
|
|
</body>
|
|
<script type="text/javascript">
|
|
var tree = new HtmlTree(document.getElementById("test"), <%=JSONEncoder.encode(tree)%>);
|
|
tree.initDefQuickKeys();
|
|
tree.nearCss("<style>.htmltreesearch {top:5px;left:480px;right:auto;bottom:auto;}</style>");
|
|
tree.expand(true);
|
|
function showChecked(){
|
|
|
|
var nodes = tree.getRoot().getChecked(false);
|
|
var cflag=true;
|
|
var sSelectType="<%=selectType%>";
|
|
var options=$("#id_selectInfo option");
|
|
if(nodes.length==0){alert("请选择左边的树");return false;}
|
|
for(var i = 0; i < nodes.length; i++){
|
|
cflag=true;
|
|
if(options.length>0){
|
|
for(var j=0;j<options.length;j++){
|
|
if(nodes[i].getAttribute("id")==options[j].value){
|
|
cflag=false;
|
|
}
|
|
}
|
|
}
|
|
if(cflag){
|
|
if(sSelectType=="指定人员"){
|
|
var temp=nodes[i].getAttribute("id");
|
|
if(temp.indexOf("U")>0||temp=="admin"||temp=="administrator"){
|
|
$("#id_selectInfo").append("<option value='"+nodes[i].getAttribute("id")+"'>"+nodes[i].getText()+"</option>");
|
|
}}
|
|
else{
|
|
$("#id_selectInfo").append("<option value='"+nodes[i].getAttribute("id")+"'>"+nodes[i].getText()+"</option>");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
function initSelectData(){
|
|
var selectData="<%=CurPage.getParameter("selectParam")%>";
|
|
var vData=selectData.split(",");
|
|
var options=$("#id_selectInfo option");
|
|
var cflag=true;
|
|
|
|
for(var i=0;i<vData.length-1;i=i+2){
|
|
cflag=true;
|
|
if(options.length>0){
|
|
for(var j=0;j<options.length;j=j+2){
|
|
if(vData[i]==options[j].value){
|
|
cflag=false;
|
|
}
|
|
}
|
|
}
|
|
if(cflag){
|
|
$("#id_selectInfo").append("<option value='"+vData[i]+"'>"+vData[i+1]+"</option>");
|
|
|
|
}
|
|
}
|
|
}
|
|
$(function(){ initSelectData()});
|
|
function getSelectData(){
|
|
var cdate=[];
|
|
var options=$("#id_selectInfo option")
|
|
if(options.length==0){
|
|
alert("请选择人员");
|
|
}else{
|
|
if("<%=isSingle%>"=="true"){
|
|
if(options.length>1){
|
|
alert("只能选择一个人");
|
|
return false;
|
|
}
|
|
}
|
|
for(var i=0;i<options.length;i++){
|
|
cdate.push(options[i].value);
|
|
cdate.push(options[i].text);
|
|
}
|
|
parent.AsDialog.ClosePage(cdate.join(","));
|
|
}
|
|
}
|
|
function deleteSelectedItem(){
|
|
var selectObject=$("#id_selectInfo").find("option:selected");
|
|
if(selectObject.length==0){
|
|
alert("请选择要删除的项");
|
|
return false;
|
|
}
|
|
if(confirm("确定删除")){
|
|
for(var i=0;i<selectObject.length;i++){
|
|
selectObject[i].parentNode.removeChild(selectObject[i]);
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<%@ include file="/Frame/resources/include/include_end.jspf"%> |