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.
452 lines
15 KiB
452 lines
15 KiB
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<%
|
|
String path = request.getContextPath();
|
|
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
|
|
BaseSessionUser su = (BaseSessionUser)session.getAttribute(WDKConstant.SESSION_USER);
|
|
String WDK_ROOT = WDKCore.inst.WDK_ROOT;
|
|
%>
|
|
<!DOCTYPE html>
|
|
<%@page import="org.wdk.WDKConstant"%>
|
|
<%@page import="org.wdk.WDKCore"%>
|
|
<%@page import="org.wdk.core.base.BaseSessionUser"%>
|
|
<html>
|
|
|
|
<head>
|
|
<base href="<%=basePath%>" target="_self">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>流程发起</title>
|
|
<jsp:include page='<%=WDKCore.inst.WDK_COMMON %>'></jsp:include>
|
|
<script type="text/javascript" src="<%=WDK_ROOT%>/core/js/wdk.js"></script>
|
|
<script type="text/javascript">
|
|
var _pdid = $.getURLParam('pdid');
|
|
|
|
var isTreeLoadSuccess = false;
|
|
window.onload = function(){
|
|
$.wait_open();
|
|
|
|
var _data = {pdid:_pdid};
|
|
$.cuajax({
|
|
url:'wdk?action=wdk.wf&method=pi_new_init&ajaxparam='+new Date().getTime(),
|
|
method:"post",
|
|
timeout:WDK_Timeout,
|
|
data:_data,
|
|
success:function(result) {
|
|
var jparam = $.str2json(result);
|
|
if('1'==jparam.code){
|
|
init(jparam);
|
|
}else{
|
|
alert(jparam.desc);
|
|
}
|
|
$.wait_close();
|
|
},
|
|
error:function(result){
|
|
$.wait_close();
|
|
alert('网络错误!result='+result);
|
|
}
|
|
});
|
|
};
|
|
//普通任务节点初始化
|
|
function init(jparam){
|
|
//1、初始化工作日历
|
|
$.combobox({
|
|
id:'start_calendar'
|
|
,url:'wdk?action=wdk.wf&method=calendar_load&ajaxparam='+new Date().getTime()
|
|
,initvalue:jparam.calendar
|
|
,isinitselect:true
|
|
});
|
|
|
|
//2、初始化办理期限
|
|
$('#start_deadline').val(jparam.deadline);
|
|
|
|
//3、超限后处理方式
|
|
$("input[name=start_deadprocess]:eq("+jparam.deadprocess+")").attr("checked",'checked');
|
|
|
|
//4、黄牌预警时间
|
|
$('#start_warnyellow').val(jparam.warnyellow);
|
|
|
|
//5、红牌预警时间
|
|
$('#start_warnred').val(jparam.warnred);
|
|
|
|
//6、是否周期性预警
|
|
$("input[name=start_isperiod]:eq("+jparam.isperiod+")").attr("checked",'checked');
|
|
if('1'==jparam.isperiod){
|
|
$('#start_warnamount').val(jparam.warnamount);
|
|
$('#start_warnperiod').val(jparam.warnperiod);
|
|
$('#item_start_warnamount').css('display','block');
|
|
$('#item_start_warnperiod').css('display','block');
|
|
}else{
|
|
$('#start_warnamount').val('2');
|
|
$('#start_warnperiod').val('1');
|
|
$('#item_start_warnamount').css('display','none');
|
|
$('#item_start_warnperiod').css('display','none');
|
|
}
|
|
|
|
//7、开始环节
|
|
$('#start_startnode').val(jparam.nodename);
|
|
$('#start_startnode').attr('disabled','disabled');
|
|
$('#_nodetype').val(jparam.nodetype);
|
|
|
|
//7-2、开始环节类型
|
|
var _nodetype = jparam.nodetype;
|
|
var _nodetypename = "";
|
|
if('task'==_nodetype){
|
|
_nodetypename = "人工任务";
|
|
}else if('sign'==_nodetype){
|
|
_nodetypename = "会签任务";
|
|
}else if('custom'==_nodetype){
|
|
_nodetypename = '自动任务';
|
|
}else if('subprocess'==_nodetype){
|
|
_nodetypename = '子流程';
|
|
}else if('decision'==_nodetype){
|
|
_nodetypename = '自动判断';
|
|
}else if('frok'==_nodetype){
|
|
_nodetypename = '聚合';
|
|
}
|
|
|
|
$('#start_startnodetype').val(_nodetypename);
|
|
$('#start_startnodetype').attr('disabled','disabled');
|
|
|
|
//8、开始参与者
|
|
if('sign'==_nodetype){
|
|
$('#item_start_tasksort').css('display','block');
|
|
}else{
|
|
$('#item_start_tasksort').css('display','block');
|
|
}
|
|
if('task'==_nodetype||'sign'==_nodetype){
|
|
$('#item_start_startactors_label').css('display','block');
|
|
$('#item_start_startactors').css('display','block');
|
|
|
|
var _queryParams = {
|
|
pdid:_pdid
|
|
,nodename:jparam.nodename
|
|
};
|
|
$.tree({
|
|
id:'start_startactorlist',
|
|
checkbox:true,
|
|
url:"wdk?action=wdk.wf&method=node_actors",//wf_pd_newinst_startactorlist",
|
|
queryParams:_queryParams,
|
|
onLoadSuccess:function(node,data){
|
|
},
|
|
onCheck:function(node,checked){
|
|
actorlistUpdate(node,checked);
|
|
}
|
|
});
|
|
}else{
|
|
$('#item_start_startactors_label').css('display','none');
|
|
$('#item_start_startactors').css('display','none');
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
//是否按序增加办理人
|
|
function start_tasksort_click(str){
|
|
if('0'==str){
|
|
$('#start_startactors').css('display','none');
|
|
$('#_hsplit').css('height','110px');
|
|
}else{
|
|
$('#start_startactors').css('display','block');
|
|
$('#_hsplit').css('height','10px');
|
|
}
|
|
|
|
}
|
|
|
|
//动态修改下一环节办理人
|
|
function actorlistUpdate(node,checked){
|
|
var _isSort = $('#start_startactors').val();
|
|
if('0'==_isSort){
|
|
return;
|
|
}
|
|
var nodes = [];
|
|
if(-1!=node.id.indexOf('dept_')){
|
|
//如果是点击的部门,则将该部门下的所有人员依次添加
|
|
var childs = $.tree_getChildNodes({id:'start_startactorlist',node:node});
|
|
for(var i=0;i<childs.length;i++){
|
|
var child = childs[i];
|
|
nodes.push(child);
|
|
}
|
|
}else{
|
|
nodes.push(node);
|
|
}
|
|
|
|
var listobj = document.getElementById("start_startactors");
|
|
if(checked){
|
|
//1、如果是增加
|
|
for(var i=0;i<nodes.length;i++){
|
|
var _n = nodes[i];
|
|
var actorid = _n.id;
|
|
var actorname = _n.text;
|
|
var hasSame = false;
|
|
//1.1、如果有相同的ID则不处理
|
|
var options = listobj.options;
|
|
for(var i=0;i<options.length;i++){
|
|
var opt = options[i];
|
|
if(opt.value == actorid){
|
|
hasSame = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
//1.2、如果是不同的ID则添加
|
|
if(!hasSame){
|
|
var option = new Option(actorname,actorid);
|
|
if(listobj){
|
|
listobj.options.add(option);
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
for(var i=0;i<nodes.length;i++){
|
|
var _n = nodes[i];
|
|
var actorid = _n.id;
|
|
var actorname = _n.text;
|
|
//2、如果是删除
|
|
var options = listobj.options;
|
|
for(var j=0;j<options.length;j++){
|
|
var opt = options[j];
|
|
if(opt.value == actorid){
|
|
listobj.remove(j);
|
|
j = j - 1;//注意这一行
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//周期性预警
|
|
function start_isperiod_click(str){
|
|
if('1'==str){
|
|
$('#item_start_warnamount').css('display','block');
|
|
$('#item_start_warnperiod').css('display','block');
|
|
}else{
|
|
$('#start_warnamount').val('2');
|
|
$('#start_warnperiod').val('1');
|
|
$('#item_start_warnamount').css('display','none');
|
|
$('#item_start_warnperiod').css('display','none');
|
|
}
|
|
}
|
|
|
|
/*
|
|
//是否抄送
|
|
function start_cc_onclick(str){
|
|
if('0'==str){
|
|
$('#item_start_ccactors').css('display','none');
|
|
}else{
|
|
$('#item_start_ccactors').css('display','block');
|
|
$.wait_open();
|
|
$.tree({
|
|
id:'start_ccactors',
|
|
checkbox:true,
|
|
url:"wdk?action=wdk.wf&method=wf_actorlist",
|
|
queryParams:{},
|
|
onLoadSuccess:function(node,data){
|
|
$.wait_close();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
*/
|
|
|
|
/////////////////////////////////////////////////
|
|
//
|
|
// 任务提交及退回
|
|
//
|
|
////////////////////////////////////////////////
|
|
//任务提交
|
|
function inputpop_getValue(){
|
|
$.wait_open();
|
|
|
|
var _nodename = $('#start_startnode').val(); //节点名称
|
|
var _nodetype = $('#_nodetype').val(); //节点类型
|
|
var _comment = $('#start_comment').val(); //意见
|
|
var _calendar = $.combobox_getValue({id:'start_calendar'}); //选用的工作日历
|
|
var _deadline = $('#start_deadline').val(); //总期限
|
|
var _deadprocess = $('input[name=start_deadprocess]:checked').val(); //超期处理方式
|
|
var _warnyellow = $('#start_warnyellow').val(); //黄牌警告
|
|
var _warnred = $('#start_warnred').val(); //红牌警告
|
|
var _isperiod = $('input[name=start_isperiod]:checked').val(); //是否周期性预警
|
|
var _warnamount = $('#start_warnamount').val(); //预警次数
|
|
var _warnperiod = $('#start_warnperiod').val(); //预警间隔
|
|
var _showallactors = $('input[name=start_showallactors]:checked').val(); //用户过滤
|
|
|
|
//根据是否是顺序会签来确定提交的参与者
|
|
var _tasksort = "0"; //是否按顺序
|
|
if('sign'==_nodetype){
|
|
_tasksort= $('input[name=start_tasksort]:checked').val();
|
|
}
|
|
|
|
//a.取出所有树节点,构建所有人员ID
|
|
var tree_allnodes = $.tree_getAllNode({id:'start_startactorlist'});
|
|
|
|
//b.取出需要设置的人员ID
|
|
|
|
var _idarr = [];
|
|
if('1'==_tasksort){
|
|
//如果是按顺序会签,则从右边顺序列表中读取
|
|
var listobj = document.getElementById("start_startactors");
|
|
var options = listobj.options;
|
|
for(var i=0;i<options.length;i++){
|
|
var opt = options[i];
|
|
_idarr.push(opt.value);
|
|
}
|
|
}else{
|
|
//如果是同时会签,则直接读取树的勾选项
|
|
var _ids = [];
|
|
//如果没有选择参与者,则默认所有候选者均参与
|
|
var _tree_checked = $.tree_getChecked({id:'start_startactorlist'});
|
|
if(null==_tree_checked){
|
|
var _allnodes = $.tree_getAllNode({id:'start_startactorlist'});
|
|
for(var i=0;i<_allnodes.length;i++){
|
|
var _n = _allnodes[i];
|
|
_ids.push(_n.id);
|
|
}
|
|
}else{
|
|
_ids = $.tree_getChecked({id:'start_startactorlist'}).id.split(',');
|
|
}
|
|
|
|
for(var i=0;i<_ids.length;i++){
|
|
var _id = _ids[i];
|
|
if(-1==_id.indexOf('dept_')){
|
|
_idarr.push(_ids[i]);
|
|
}
|
|
}
|
|
}
|
|
|
|
//c.将人员ID转换为真实的提交参数
|
|
var _actors = [];
|
|
for(var i=0;i<_idarr.length;i++){
|
|
var _id = _idarr[i];
|
|
for(var j=0;j<tree_allnodes.length;j++){
|
|
var _node = tree_allnodes[j];
|
|
if(_node.id==_id){
|
|
_actors.push(_node.id+","+_node.attributes.actortype);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var _data ={
|
|
pdid:_pdid
|
|
,nodename:_nodename
|
|
,nodetype:_nodetype
|
|
,comment:_comment
|
|
,calendar:_calendar
|
|
,deadline:_deadline
|
|
,deadprocess:_deadprocess
|
|
,warnyellow:_warnyellow
|
|
,warnred:_warnred
|
|
,isperiod:_isperiod
|
|
,warnamount:_warnamount
|
|
,warnperiod:_warnperiod
|
|
,showallactors:_showallactors
|
|
,actorsinsort:_tasksort
|
|
,actors:_actors.join(';')
|
|
// ,iscc:_iscc
|
|
// ,ccactors:_ccactors
|
|
};
|
|
|
|
$.cuajax({
|
|
url:'wdk?action=wdk.wf&method=pi_new&ajaxparam='+new Date().getTime(),
|
|
method:"post",
|
|
timeout:WDK_Timeout,
|
|
data:_data,
|
|
success:function(result) {
|
|
$.wait_close();
|
|
var jparam = $.str2json(result);
|
|
alert(jparam.desc);
|
|
},
|
|
error:function(result){
|
|
$.wait_close();
|
|
alert('网络错误!result='+result);
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
<body class="easyui-layout" style="padding:0px;margin:0px;background-color:#FFFFFF;">
|
|
<!-- 表格 -->
|
|
<div id="layout_content" data-options="region:'center',border:false,collapsed:false" style="border:1px solid #ddd;" >
|
|
<div id="item_start_comment" class="fitem" style="margin:10px;">
|
|
<label>办理意见:</label>
|
|
<textarea id="start_comment" name="start_comment" class="txt" style="width:250px;height:100px;"></textarea>
|
|
</div>
|
|
<div id="item_start_calendar" class="fitem" style="margin:10px;">
|
|
<label>工作日历:</label>
|
|
<input id="start_calendar" name="start_calendar" class="txt" style="width:250px">
|
|
</div>
|
|
<div id="item_start_deadline" class="fitem" style="margin:10px;">
|
|
<label>办理期限:</label>
|
|
<input id="start_deadline" name="start_deadline" class="txt" style="width:250px">
|
|
</div>
|
|
<div id="item_start_deadprocess" class="fitem" style="margin:10px;">
|
|
<label>超期处理:</label>
|
|
<input name="start_deadprocess" type="radio" value="0" checked>继续执行
|
|
<input name="start_deadprocess" type="radio" value="1" >关闭流程
|
|
</div>
|
|
<div id="item_start_warnyellow" class="fitem" style="margin:10px;">
|
|
<label>黄牌预警:</label>
|
|
<input id="start_warnyellow" name="start_warnyellow" class="txt" style="width:250px">
|
|
</div>
|
|
<div id="item_start_warnred" class="fitem" style="margin:10px;">
|
|
<label>红牌预警:</label>
|
|
<input id="start_warnred" name="start_warnred" class="txt" style="width:250px">
|
|
</div>
|
|
<div id="item_start_isperiod" class="fitem" style="margin:10px;">
|
|
<label>周期预警:</label>
|
|
<input name="start_isperiod" type="radio" value="0" onclick="start_isperiod_click('0')" checked>预警一次
|
|
<input name="start_isperiod" type="radio" value="1" onclick="start_isperiod_click('1')">周期预警
|
|
</div>
|
|
<div id="item_start_warnamount" class="fitem" style="margin:10px;display:none;">
|
|
<label>预警次数:</label>
|
|
<input id="start_warnamount" name="start_warnamount" class="txt" style="width:250px">
|
|
</div>
|
|
<div id="item_start_warnperiod" class="fitem" style="margin:10px;display:none;">
|
|
<label>预警间隔:</label>
|
|
<input id="start_warnperiod" name="start_warnperiod" class="txt" style="width:250px">
|
|
</div>
|
|
<div id="item_start_showallactors" class="fitem" style="margin:10px;">
|
|
<label>用户过滤:</label>
|
|
<input name="start_showallactors" type="radio" value="0" checked>显示经办
|
|
<input name="start_showallactors" type="radio" value="1" >显示所有
|
|
</div>
|
|
|
|
<div id="item_start_startnode" class="fitem" style="margin:10px;">
|
|
<label>开始环节:</label>
|
|
<input id="start_startnode" name="start_startnode" class="txt" style="width:250px">
|
|
<input type="hidden" id="_nodetype" name="_nodetype" class="txt" style="width:250px">
|
|
</div>
|
|
<div id="item_start_startnodetype" class="fitem" style="margin:10px;">
|
|
<label>环节类型:</label>
|
|
<input id="start_startnodetype" name="start_startnodetype" class="txt" style="width:250px">
|
|
</div>
|
|
<div id="item_start_tasksort" class="fitem" style="margin:10px;display:none;">
|
|
<label>办理顺序:</label>
|
|
<input name="start_tasksort" type="radio" value="0" onclick="start_tasksort_click('0')" checked>同时办理
|
|
<input name="start_tasksort" type="radio" value="1" onclick="start_tasksort_click('1')">顺序办理
|
|
</div>
|
|
<div id="item_start_startactors_label" class="fitem" style="margin:10px;display:none;">
|
|
<label>开始办理:</label>
|
|
</div>
|
|
<div id="item_start_startactors" class="fitem" style="margin:10px;display:none;">
|
|
<div id="start_startactorlist" style="width:315px;height:100px;overflow:auto;float:left;border:1px solid #add;"></div>
|
|
<div style="width:105px;height:100px;overflow:auto;float:left;border:0px solid #add;"></div>
|
|
<select id="start_startactors" name="start_startactors" class="txt" multiple="multiple" style="width:250px;height:100px;display:none;">
|
|
</select>
|
|
</div>
|
|
<div id="_hsplit" class="fitem" style="margin:10px;height:110px;">
|
|
</div>
|
|
<div id="item_start_cc" class="fitem" style="margin:10px;display:none;">
|
|
<label>是否抄送:</label>
|
|
<input name="start_cc" type="radio" value="0" onclick="start_cc_onclick('0')" checked>否
|
|
<input name="start_cc" type="radio" value="1" onclick="start_cc_onclick('1')">是
|
|
</div>
|
|
<div id="item_start_ccactors" class="fitem" style="margin:10px;display:none;">
|
|
<div id="start_ccactors" style="width:315px;height:100px;overflow:auto;border:1px solid #add;"></div>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|