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

217 lines
8.9 KiB
Plaintext
Raw 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="com.amarsoft.biz.workflow.ApplyManager"%>
<%@page import="java.util.Date"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=List00;Describe=注释区;]~*/%>
<%
/*
Content: 仅展示流程相关数据,不关联业务数据
*/
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=List01;Describe=定义页面属性;]~*/%>
<%
String PG_TITLE = "流程对象管理"; // 浏览器窗口标题 <title> PG_TITLE </title>
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Describe=其它操作;]~*/%>
<%
String sApplyType = CurPage.getParameter("ApplyType");
String sPhaseType = CurPage.getParameter("PhaseType");
if(sApplyType == null) sApplyType = "";
if(sPhaseType == null) sPhaseType = "";
//根据申请类型applyType、阶段类型phaseType 得到申请主树图申请按钮申请列表显示模板申请列表where条件等。
ApplyManager applyManager = new ApplyManager(sApplyType,sPhaseType,CurUser);
ASObjectModel doTemp = new ASObjectModel(applyManager.getDono());
doTemp.setLockCount(2);
doTemp.appendJboWhere(applyManager.getWhereClause()+" order by objectNo desc ");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //设置为Grid风格
//dwTemp.MultiSelect = true;//允许多选
dwTemp.ReadOnly = "1";//编辑模式
dwTemp.genHTMLObjectWindow("");
String sButtons[][] = applyManager.getButtonArr();
%>
<%/*~END~*/%>
<%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<%/*~BEGIN~可编辑区~[Describe=自定义函数;]~*/%>
<script type="text/javascript">
/*~[Describe=新增申请-初始化流程;InputParam=无;OutPutParam=无;]~*/
function newApply(){
//根据applyType,objectNo,userID 初始化流程
var d = new Date();
var sObjectNo = ""+d.getFullYear()+getNum(d.getMonth()+1, 2)+getNum(d.getDate(), 2)+getNum(d.getHours(), 2)
+getNum(d.getMinutes(), 2)+getNum(d.getSeconds(), 2)+getNum(d.getMilliseconds(), 3);
var sRet = AsControl.RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction","initFlow",
"ApplyType=<%=sApplyType%>,ObjectNo="+sObjectNo+",UserID=<%=CurUser.getUserID()%>");
if(sRet=="success"){
alert("操作成功. ");
}else{
alert("操作失败! ");
}
reloadSelf();
}
function getNum(num,n){//num的位数不够时补全为n位
var ret=num+"";
while(ret.length<n){
ret = "0"+ret;
}
return ret;
}
/*~[Describe=取消流程;InputParam=无;OutPutParam=无;]~*/
function cancelApply(){
//获得申请类型、申请流水号
var sObjectType = getItemValue(0,getRow(),"OBJECTTYPE");
var sObjectNo = getItemValue(0,getRow(),"OBJECTNO");
if (typeof(sObjectNo)=="undefined" || sObjectNo.length==0){
alert(getMessageText('AWEW1001'));//请选择一条信息!
return;
}
// 删除flow_object,flow_task,flow_opinion三张表的数据
var sRet = AsControl.RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction","delete","objectType="+ sObjectType +",objectNo="+sObjectNo);
if(sRet=="success"){
alert("操作成功. ");
}else{
alert("操作失败! ");
}
reloadSelf();
}
/*~[Describe=提交;InputParam=无;OutPutParam=无;]~*/
function doSubmit(){
//获得申请类型、申请流水号、流程编号、阶段编号、申请类型
var sObjectType = getItemValue(0,getRow(),"OBJECTTYPE");
var sObjectNo = getItemValue(0,getRow(),"OBJECTNO");
var sFlowNo = getItemValue(0,getRow(),"FLOWNO");
var sPhaseNo = getItemValue(0,getRow(),"PHASENO");
if (typeof(sObjectNo)=="undefined" || sObjectNo.length==0){
alert(getMessageText('AWEW1001'));//请选择一条信息!
return;
}
//检查该业务是否已经提交了(解决用户打开多个界面进行重复操作而产生的错误)
var sNewPhaseNo = AsControl.RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction","getCurPhaseNo","ObjectType="+sObjectType+",ObjectNo="+sObjectNo);
//alert(sNewPhaseNo+" "+sPhaseNo);
if(sNewPhaseNo != sPhaseNo) {
alert(getMessageText("ALS70486"));//该申请已经提交了,不能再次提交!
reloadSelf();
return;
}
//获取未完成的任务流水号
var sTaskNo = AsControl.RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction","getUnfinishedTaskNo",
"ObjectType="+sObjectType+",ObjectNo="+sObjectNo+",FlowNo="+sFlowNo+",PhaseNo="+sPhaseNo+",UserID=<%=CurUser.getUserID()%>");
if(typeof(sTaskNo)=="undefined" || sTaskNo.length==0) {
alert(getMessageText("ALS70500"));//该申请所对应的流程任务不存在,请核对!
return;
}
//检查是否签署意见
var sReturn = AsControl.RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction","isSignOpinion","TaskNo="+sTaskNo);//返回值: yes-有意见; no-无意见; error-查询出错
if(sReturn!="yes") {
alert(getMessageText("ALS70501"));//该业务未签署意见,不能提交,请先签署意见!
return;
}
//弹出审批提交选择窗口
AsDialog.PopView("/Common/WorkFlow/FlowSubmitDialog.jsp","TaskNo="+sTaskNo,
"dialogWidth=580px;dialogHeight=420px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(sPhaseInfo){
if(typeof(sPhaseInfo)=="undefined" || sPhaseInfo=="" || sPhaseInfo==null || sPhaseInfo=="null" || sPhaseInfo=="_CANCEL_") {
return;
}else if(sPhaseInfo == "Success" || sPhaseInfo == "success"){
alert("提交成功!");
reloadSelf();
}else{
alert("提交失败!");
}
});
}
/*~[Describe=签署意见;InputParam=无;OutPutParam=无;]~*/
function signOpinion(){
var sObjectType = getItemValue(0,getRow(),"OBJECTTYPE");
var sObjectNo = getItemValue(0,getRow(),"OBJECTNO");
var sFlowNo = getItemValue(0,getRow(),"FLOWNO");
var sPhaseNo = getItemValue(0,getRow(),"PHASENO");
if (typeof(sObjectNo)=="undefined" || sObjectNo.length==0){
alert(getMessageText('AWEW1001'));//请选择一条信息!
return;
}
//根据flow_object的数据,获取Flow_Task表中未完成的任务流水号
var sTaskNo = AsControl.RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction","getUnfinishedTaskNo",
"ObjectType="+sObjectType+",ObjectNo="+sObjectNo+",FlowNo="+sFlowNo+",PhaseNo="+sPhaseNo+",UserID=<%=CurUser.getUserID()%>");
if(typeof(sTaskNo)=="undefined" || sTaskNo.length==0) {
alert(getMessageText("ALS70500"));//该申请所对应的流程任务不存在,请核对!
return;
}
//弹出签意见界面
AsDialog.PopView("/Common/WorkFlow/SignTaskOpinionInfo.jsp","TaskNo="+sTaskNo+"&ObjectType="+sObjectType+"&ObjectNo="+sObjectNo,
"dialogWidth=700px;dialogHeight=600px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;");
}
/*~[Describe=查看审批意见;InputParam=无;OutPutParam=无;]~*/
function viewOpinions(){
//获得申请类型、申请流水号、流程编号、阶段编号
var sObjectType = getItemValue(0,getRow(),"OBJECTTYPE");
var sObjectNo = getItemValue(0,getRow(),"OBJECTNO");
var sFlowNo = getItemValue(0,getRow(),"FLOWNO");
var sPhaseNo = getItemValue(0,getRow(),"PHASENO");
if (typeof(sObjectNo)=="undefined" || sObjectNo.length==0){
alert(getMessageText('AWEW1001'));//请选择一条信息!
return;
}
AsDialog.PopView("/Common/WorkFlow/ViewFlowOpinions.jsp","FlowNo="+sFlowNo+"&PhaseNo="+sPhaseNo+"&ObjectType="+sObjectType+"&ObjectNo="+sObjectNo,{title:"查看审批意见"});
}
/* 撤回流程 */
function takeBack(){
var sObjectType = getItemValue(0,getRow(),"OBJECTTYPE");
var sObjectNo = getItemValue(0,getRow(),"OBJECTNO");
var sFlowNo = getItemValue(0,getRow(),"FLOWNO");
var sUserID = getItemValue(0,getRow(),"USERID");
if (typeof(sObjectNo)=="undefined" || sObjectNo.length==0){
alert(getMessageText('AWEW1001'));//请选择一条信息!
return;
}
if(!confirm("确认撤回?")) return;
var sRet = AsControl.RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction","takeBack",
"ObjectType="+ sObjectType+",ObjectNo="+sObjectNo+",FlowNo="+sFlowNo+",UserID=<%=CurUser.getUserID()%>" );
if(sRet=="success"){
alert("操作成功. ");
}else{
alert("操作失败! ");
}
reloadSelf();
}
/* 查看流程历史 */
function flowHistory(){
var sObjectNo = getItemValue(0,getRow(),"OBJECTNO");
var sObjectType = getItemValue(0,getRow(),"OBJECTTYPE");
if(typeof(sObjectNo) == "undefined" || sObjectNo.length == 0){
alert(getMessageText('AWEW1001'));//请选择一条信息!
return;
}
AsControl.OpenTab("/AppConfig/FlowManage/FlowMonitor/FlowChangeList.jsp","ObjectNo="+sObjectNo+"&ObjectType="+sObjectType+"&FlowStatus=02",{title:"流程对象["+sObjectNo+"]历史"});
}
/* 查看流程图 */
function viewFlowGraph(){
//获得申请类型、申请流水号、流程编号、阶段编号
var sObjectType = getItemValue(0,getRow(),"OBJECTTYPE");
var sObjectNo = getItemValue(0,getRow(),"OBJECTNO");
var sFlowNo = getItemValue(0,getRow(),"FLOWNO");
if (typeof(sObjectNo)=="undefined" || sObjectNo.length==0){
alert(getMessageText('AWEW1001'));//请选择一条信息!
return;
}
//ShowFlowInst.jsp
AsDialog.PopView("/Frame/ShowFlowTab.jsp","flowNo="+sFlowNo+"&objectType="+sObjectType+"&objectNo="+sObjectNo,"dialogWidth=800px;dialogHeight=600px");
}
</script>
<%/*~END~*/%>
<%@ include file="/Frame/resources/include/include_end.jspf"%>