You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

195 lines
6.1 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<%@include file="/wdk/theme/je/module/public/common.jsp"%>
<script type="text/javascript" src="<%=WDK_ROOT%>/theme/je/core/js/wdk.datatable.js"></script>
<title>流程模板管理</title>
<script type="text/javascript">
<% if(null==su){%>
$.timeout();
<%}%>
var _gridcode = "wdk.module.wf.processdefinitiongrid";
var _gridid = $.getUUID();
window.onload = function(){
_gridid = $.grid({
id:_gridid,
containerid:'layout_grid',
gridcode:_gridcode,
url:'wdk?action=wdk.wf&method=pd_list&ajaxparam='+new Date().getTime(),
idField:'pdid',
singleSelect:true, //是否单选
// pagination:true, //分页控件
rownumbers:true //行号
});
};
//grid表格里的点击
function _handler_click(method,jparam){
var pdid = jparam.pdid;
switch(method){
case 'newinst':
var _wid = $.getUUID();
$.openDialog({
id:_wid
,title:'新建流程'
,height:300
,width:600
,modal:true
,url:'<%=WDK_ROOT%>/module/wf/pi_new.jsp'
,queryParams:{pdid:pdid}
,maximizable:true
,maximized:true
,draggable:false
,resizable:false
,onSubmit:function(jres){ //点击确定按钮
//alert('提交');
}
});
break;
case 'instlist': //查看活动流程
$.tab_addTop({
menucode: 'instlist'+pdid
,title:jparam.cnname+'-活动流程'
,closable:true
,url:'<%=WDK_ROOT%>/module/wf/pi.jsp?pdid='+pdid
});
break;
case 'history': //查看历史流程
$.tab_addTop({
menucode: 'pihistory'+pdid
,title:cnname+'历史流程'
,closable:true
,url:'<%=WDK_ROOT%>/module/wf/pi_history.jsp?pdid='+pdid+'&pdname='+pdname
});
break;
case 'enable':
break;
case 'disable':
break;
case 'download':
break;
case 'remove':
if(confirm('该操作将删除当前流程模板,是否继续?')){
_pd_remove(pdid,'0');
}
break;
case 'removecascade':
if(confirm('级联删除将删除所有关联的运行实例,是否继续?')){
_pd_remove(pdid,'1');
}
break;
default:
break;
}
}
///////////////////////////////////////////////////
//
// 上传流程模板
//
////////////////////////////////////////////////
//流程模板上传窗口显示
function _pd_upload(id,cnname){
$('#pd_cnname').val('');
$('#dlg_pd_upload').dialog('open').dialog('setTitle','上传流程模板');
}
//保存流程模板中文名字并打开上传窗口
function _pd_upload_save(){
var _cnname = $('#pd_cnname').val();
$('#dlg_pd_upload').dialog('close');
$.upload({
upload_url:'wdk?action=wdk.wf&method=pd_upload&cnname='+encodeURI(encodeURI(encodeURI(_cnname)))+'&ajaxparam='+new Date().getTime(),
file_types :'*.zip',
callback:_pd_upload_save_callback
});
}
//上传成功后的回调
function _pd_upload_save_callback(jparam){
$.grid_reload({id:_gridid});
alert(jparam.fieldids);
}
///////////////////////////////////////////////////
//
// 流程模板管理
//
////////////////////////////////////////////////
//删除 isCascade:是否级联删除关联实例?
function _pd_remove(pdid,isCascade){
var _data ={
pdid:pdid
,iscascade:isCascade
};
$.cuajax({
url:'wdk?action=wdk.wf&method=pd_remove&ajaxparam='+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:_data,
success:function(result) {
var jparam = $.str2json(result);
$.grid_reload({id:_gridid});
alert(jparam.desc);
return;
if("1"==jparam.code){
$.grid_reload({id:_gridid});
}else{
alert(jparam.desc);
}
},
error:function(result){
alert('网络错误!result='+result);
}
});
}
</script>
</head>
<body class="easyui-layout" style="padding:0px;margin:0px;background-color:#FFFFFF;">
<!-- 按钮 -->
<div data-options="region:'north',border:false,collapsed:false" style="height:30px;overflow:hidden;border-bottom:1px solid #d4a375;text-align:left;" >
<a id="_btnaddledger" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add'" href="javascript:void(0)" onclick="_pd_upload()">新增流程模板</a>
</div>
<!-- 表格 -->
<div id="layout_grid" data-options="region:'center',border:false,collapsed:false" style="overflow:hidden;border:0px solid #d4a375;" ></div>
<!-- 编辑修改名称窗口 -->
<div id="dlg_pd_upload" class="easyui-dialog" style="width:350px;height:150px;padding:20px 40px;margin:0;" closed="true" modal="true" buttons="#dlg-buttons">
<div class="fitem" style="margin:10px;">
<label>流程名称:</label>
<input id="pd_cnname" name="pd_cnname" class="txt" style="width:150px">
</div>
</div>
<div id="dlg-buttons">
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="_pd_upload_save()">保存</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg_pd_upload').dialog('close')">退出</a>
</div>
<!-- 启动实例窗口 -->
<!-- <div id="dlg_newinst" class="easyui-dialog" style="width:350px;height:250px;padding:20px 40px;margin:0;" closed="true" modal="true" buttons="#dlg-buttons">-->
<!-- <div class="fitem" style="margin:10px;">-->
<!-- <label>发起人员:</label>-->
<!-- <input id="ni_creater" name="ni_creater" class="txt" style="width:150px">-->
<!-- <input type="hidden" id="ni_pdid" name="ni_pdid" class="txt" style="width:10px">-->
<!-- </div>-->
<!-- <div class="fitem" style="margin:10px;">-->
<!-- <label>流程参数:</label>-->
<!-- <input id="ni_wfparam" name="ni_wfparam" class="txt" style="width:150px">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div id="dlg-buttons">-->
<!-- <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="_pd_newinst_save()">确定</a>-->
<!-- <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg_newinst').dialog('close')">退出</a>-->
<!-- </div>-->
</body>
</html>