apzl_leasing/WebContent/Common/WorkFlow/ApproveMain_temp.jsp
2018-06-03 22:26:41 +08:00

146 lines
7.2 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@page import="jbo.sys.FLOW_MODEL"%>
<%@page import="com.amarsoft.app.als.workflow.model.FlowConstant"%>
<%@page import="com.amarsoft.app.als.workflow.action.GetFlowAction"%>
<%@page import="com.amarsoft.are.jbo.BizObject"%>
<%@page import="com.amarsoft.app.als.credit.common.model.CreditConstant"%>
<%@page import="com.amarsoft.dict.als.object.Item"%>
<%@page import="com.amarsoft.dict.als.manage.CodeManager"%>
<%@ page contentType="text/html; charset=GBK"%><%@
include file="/Frame/resources/include/begin.jspf"%><%
/*
Content: 审查审批工作台_Main
Input Param:
ApproveType审批类型
—ApproveCreditApply/授信业务审查审批
—ApproveApprovalApply/最终审批意见复核
—ApprovePutOutApply/出帐申请复核
*/
String PG_TITLE = "审批主页面"; // 浏览器窗口标题 <title> PG_TITLE </title>
String PG_CONTENT_TITLE = "&nbsp;&nbsp;审批主页面&nbsp;&nbsp;"; //默认的内容区标题
String PG_CONTNET_TEXT = "请点击左侧列表";//默认的内容区文字
String PG_LEFT_WIDTH = "200";//默认的treeview宽度
//定义变量SQL语句、当前工作、已完成工作
String sSql = "",sFolder = "",sFolderUnfinished = "",sFolderfinished = "";
//定义变量:阶段编号、阶段名称、工作数、工作数显示标签、文件夹标记
String sPhaseNo = "",sPhaseName = "",sWorkCount = "",sPageShow = "",sFolderSign= "" ;
//定义变量:流程编号、阶段类型、组件编号、组件名称、审批类型名称、流程对象类型、显示树图
String sFlowNo = "",sPhaseType = "",sCompID = "",sCompName = "",sItemName = "",sObjectType = "",sMainCode = "";
//定义变量:树型菜单页数
int iLeaf = 1,i = 0;
//定义变量:传入阶段编号条件
String sPhaseCase="";
String sCurUserID = CurUser.getUserID();
String sDisplay="";//用于存放sPageShow拿到的第一条数据当相同阶段存在两个或多个流程时
//获得组件参数:审批类型
String sComponentName = CurPage.getParameter("ComponentName");
if(StringX.isSpace(sComponentName)) sComponentName = "";
String sApproveType = CurPage.getParameter("ApproveType");
if(StringX.isSpace(sApproveType)) sApproveType = "";
String sCurPhaseNo = CurPage.getParameter("PhaseNo");
if(StringX.isSpace(sCurPhaseNo)) sCurPhaseNo = "";
//根据申请类型从代码表CODE_LIBRARY中获得审批类型名称、审批模型编号、流程对象类型、组件编号、组件名称
Item approveMain = CodeManager.getItem("ApproveType",sApproveType);
if(approveMain == null) throw new Exception("没有找到相应的审批类型定义CODE_LIBRARY.ApproveType:"+sApproveType+"");
sItemName = approveMain.getItemName();
if(StringX.isSpace(sItemName)) sItemName = "";
sFlowNo = approveMain.getAttribute2();
if(StringX.isSpace(sFlowNo)) sFlowNo = "";
sObjectType = approveMain.getItemAttribute();
if(StringX.isSpace(sObjectType)) sObjectType = "";
sCompID = approveMain.getAttribute7();
if(StringX.isSpace(sCompID)) sCompID = "";
sCompName = approveMain.getAttribute8();
if(StringX.isSpace(sCompName)) sCompName = "";
sMainCode = approveMain.getItemDescribe();
if(StringX.isSpace(sMainCode)) sMainCode = "";
//设置窗口标题
if(!"".equals(sComponentName)) PG_TITLE = sComponentName;
else PG_TITLE = sItemName;
PG_CONTENT_TITLE = "&nbsp;&nbsp;"+PG_TITLE+"&nbsp;&nbsp;";
//把FlowNo拆开为了加上单引号
String sTempFlowNo = "(";
StringTokenizer st = new StringTokenizer(sFlowNo,",");
while(st.hasMoreTokens()){
sTempFlowNo += "'"+ st.nextToken()+"',";
}
if(!StringX.isSpace(sTempFlowNo)){
sTempFlowNo = sTempFlowNo.substring(0,sTempFlowNo.length()-1)+")";
}
//out.println(sTempFlowNo);
if(!StringX.isSpace(sCurPhaseNo)) sPhaseCase=" and PhaseNo='"+sCurPhaseNo+"'";
else sPhaseCase = " and O.PhaseNo not in (select FM.PhaseNo from "+FLOW_MODEL.CLASS_NAME+" FM where FM.PhaseAttribute like '%"+FlowConstant.FLAG_ISMENU+"%' and FM.FlowNo in "+sTempFlowNo+") ";
OHTMLTreeView tviTemp = new OHTMLTreeView(CurPage,PG_TITLE,"right");
Item[] items = CodeManager.getItems(sMainCode);
Item aItem = null;
String aItemNo = "",aItemName = "";
for(int j=0;j<items.length;j++){
aItem = items[j];
aItemNo = aItem.getItemNo();
aItemName = aItem.getItemName();
if(StringX.isSpace(sCompName)) sCompName = aItem.getAttribute5().split("@")[0];
//设置当前用户对于该类对象的当前工作菜单项
sFolder = tviTemp.insertFolder("root",aItemName,"",i++);
//从流程任务表FLOW_TASK中查询出当前用户的待审查审批工作信息
if(!CreditConstant.CREDITOBJECT_APPLY_REAL.equalsIgnoreCase(sObjectType)) sSql += " and FlowNo in "+sTempFlowNo+" ";
if(CreditConstant.CREDITOBJECT_TRANSACTIONAPPLY.equalsIgnoreCase(sObjectType))
sSql += " and exists(select AT.SerialNo from jbo.acct.ACCT_TRANSACTION AT where O.ObjectType='TransactionApply' and O.ObjectNo=AT.SerialNo and AT.TransCode in('"+CurPage.getParameter("TransactionFilter").replaceAll("@", "','")+"')) ";
sSql += sPhaseCase;
List<BizObject> boList = GetFlowAction.getFlowTasks(sObjectType,sCurUserID,sTempFlowNo,sSql,aItemNo);
int t=0;//定义变量用于判断是否是第一条数据
for(BizObject bo : boList){
sFlowNo = bo.getAttribute("FlowNo").getString();
if(StringX.isSpace(sFlowNo)) sFlowNo = "";
sPhaseType = bo.getAttribute("PhaseType").getString();
if(StringX.isSpace(sPhaseType)) sPhaseType = "";
sPhaseNo = bo.getAttribute("PhaseNo").getString();
if(StringX.isSpace(sPhaseNo)) sPhaseNo = "";
sPhaseName = bo.getAttribute("PhaseName").getString();
if(StringX.isSpace(sPhaseName)) sPhaseName = "";
sWorkCount = String.valueOf(bo.getAttribute("WorkCount").getInt());
if(StringX.isSpace(sWorkCount)) sWorkCount = "";
if(sWorkCount.equals("")) sPageShow = sPhaseName+" 0 件";
else sPageShow = sPhaseName+" "+sWorkCount+" 件";
tviTemp.insertPage(sFolder,sPageShow,"javascript:parent.openPhase(\""+ sApproveType +"\",\""+ sPhaseType +"\",\""+sFlowNo+"\",\""+sPhaseNo+"\",\""+aItemNo+"\")",iLeaf++);
if("N".equalsIgnoreCase(aItemNo)){
//获得sPageShow第一条数据
if(t==0){
sDisplay = sPageShow;
t++;
}
sFolderUnfinished = sFolder;
}else if("Y".equalsIgnoreCase(aItemNo)){
sFolderfinished = sFolder;
}
}
}
%><%@include file="/Frame/resources/include/ui/main.jspf"%>
<script type="text/javascript">
<%/*~[Describe=treeview单击选中事件打开对应的审批界面;]~*/%>
function openPhase(sApproveType,sPhaseType,sFlowNo,sPhaseNo,sFinishFlag){
//modify by xwlu 2015-04-02 当前阶段号传递到list页面用于控制业务提交后页面的跳转
AsControl.OpenView("<%=sCompName%>","ApproveType="+sApproveType+"&FlowNo="+sFlowNo+"&PhaseType="+sPhaseType+"&PhaseNo="+sPhaseNo+"&FinishFlag="+sFinishFlag+"&CurPhaseNo=<%=sCurPhaseNo%>","right","");
setTitle(getCurTVItem().name);
}
<%/*~[Describe=生成treeview;]~*/%>
function initTreeView(){
<%=tviTemp.generateHTMLTreeView()%>
}
try{
initTreeView();
expandNode('root');
expandNode('<%=sFolderUnfinished%>');
selectItemByName('<%=sDisplay%>');
}catch(e){}
</script>
<%@ include file="/Frame/resources/include/end.jspf"%>