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.

410 lines
13 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 _param = $.getURLParam('param');
_param = $.decode(_param);
var jtask = $.str2json(_param);
var _pdid = jtask.pdid;
var _piid = jtask.piid;
var _nodename = jtask.nodename;
var _nodetype = jtask.nodetype;
var _islastactor = jtask.islastactor;
var _issub = jtask.issub;
var _islastsub = jtask.islastsub;
window.onload = function(){
//初始化显示
$('#nodename').html(_nodename);
$('#actorid').html(jtask.actorid);
if('sign'==_nodetype){
//获取当前会签进度
$.cuajax({
url:'wdk?action=wdk.wf&method=task_submit_signprocess&ajaxparam='+new Date().getTime()
,method:"post"
,timeout:WDK_Timeout
,data:{
pdid:_pdid
,piid:_piid
,nodename:_nodename
}
,success:function(result) {
var jres = $.str2json(result);
var jactors = jres.actors;
var htmlarr = [];
for(var i=0;i<jactors.length;i++){
var jactor = jactors[i];
htmlarr.push('<br><span style="margin:50px;">'+(('0'==jactor.iscomplete)?'待处理':(('1'==jactor.ispass)?'已通过':'未通过'))+'</span><span style="margin:1px;">'+jactor.actorid+'</span>');
}
$('#item_signinfo').css('display','block');
$('#signinfo').html(htmlarr.join(''));
// if('0'==_islastactor){
// $('#item_nextnode').css('display','none');
// $('#item_signtype').css('display','none');
// $('#item_nextactors').css('display','none');
// }else{
init();
// }
}
,error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
}else{
init();
}
};
function init(){
//初始化前序办理环节
var _data = {
pdid:_pdid
,nodename:jtask.nodename
};
$.cuajax({
url:'wdk?action=wdk.wf&method=node_prenodes&ajaxparam='+new Date().getTime()
,method:"post"
,timeout:WDK_Timeout
,data:_data
,success:function(result) {
var htmlarr = [];
var jnodes = $.str2json(result);
var checkedNodename = "";
for(var i=0;i<jnodes.length;i++){
var jnode = jnodes[i];
//如果节点不允许被退回
if('1'!=jnode.canbereturn){
continue;
}
htmlarr.push('<input name="nextnode" type="radio" value="'+_pdid+","+jnode.nodename+","+jnode.nodetype+'" onclick="node_click(this)" '+(0==i?'checked':'')+'>'+jnode.nodename+'&nbsp;&nbsp;');
if(0==i){
checkedNodename = jnode.nodename;
if('sign'==jnode.nodetype){
$('#item_signtype').css('display','block');
document.getElementById('signtype_0').checked = true;
$('#item_nextactors2').css('display','none');
}else{
$('#item_signtype').css('display','none');
$('#item_nextactors2').css('display','none');
}
}
}
$('#nextnodes').html(htmlarr.join(''));
//初始化构建树
//var next_nodename = $("input[name='nextnode'][type='radio']:checked").val();
actors_init(_pdid,_piid,checkedNodename,'1');
}
,error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
}
//参与环节点击,用来刷新环节参与者列表
function node_click(btn){
var pdid = btn.value.split(',')[0];
var name = btn.value.split(',')[1];
var type = btn.value.split(',')[2];
if('sign'==type){
$('#item_nextactors').css('display','block');
$('#item_signtype').css('display','block');
document.getElementById('signtype_0').checked = true;
$('#item_nextactors2').css('display','none');
}else{
$('#item_nextactors').css('display','block');
$('#item_signtype').css('display','none');
$('#item_nextactors2').css('display','none');
}
var _queryParams = {
pdid:_pdid
,piid:_piid
,nodename:name
,isfilter:'1'
};
$.tree_reload ({
id:'nextactors',
url:"wdk?action=wdk.wf&method=node_actors",
queryParams:_queryParams
});
}
//初始化环节参与者树
function actors_init(pdid,piid,nodename,isfilter){
var _queryParams = {
pdid:pdid
,piid:piid
,nodename:nodename
,isfilter:isfilter
};
$.tree({
id:'nextactors',
checkbox:true,
expandall:true,
url:"wdk?action=wdk.wf&method=node_actors",
queryParams:_queryParams,
onLoadSuccess:function(node,data){
$.wait_close();
},
onCheck:function(node,checked){
actorlistUpdate(node,checked);
}
});
}
//会签顺序点击事件
function signtype_onclick(signtype){
if('0'==signtype){
//同时办理
$('#item_nextactors2').css('display','none');
}else{
$('#item_nextactors2').css('display','block');
}
}
//点击人员树节点的事件
function actorlistUpdate(node,checked){
var nodes = [];
if(-1!=node.id.indexOf('dept_')){
//如果是点击的部门,则将该部门下的所有人员依次添加
var childs = $.tree_getChildNodes({id:'nextactors',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("nextactors2");
if(checked){
//1、如果是增加
for(var i=0;i<nodes.length;i++){
var _n = nodes[i];
var actorid = _n.id;
var actortype = _n.attributes.actortype;
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+","+actortype){
hasSame = true;
break;
}
}
//1.2、如果是不同的ID则添加
if(!hasSame){
var option = new Option(actorid,actorid+','+actortype);
if(listobj){
listobj.options.add(option);
}
}
}
}else{
for(var i=0;i<nodes.length;i++){
var _n = nodes[i];
var actorid = _n.id;
var actortype = _n.attributes.actortype;
//2、如果是删除
var options = listobj.options;
for(var j=0;j<options.length;j++){
var opt = options[j];
if(opt.value == actorid+','+actortype){
listobj.remove(j);
j = j - 1;//注意这一行
}
}
}
}
}
//提交
function task_submit(){
$.wait_open();
var _data = [];
var _comment = $('#comment').val();
var _nextnode = $("input[name='nextnode'][type='radio']:checked").val();
var _next_pdid = _nextnode.split(',')[0];
var _next_nodename = _nextnode.split(',')[1];
var _next_nodetype = _nextnode.split(',')[2];
var _next_actors = [];
//是否顺序
var _signtype = $("input[name='signtype']:checked").val();
if('sign'==_next_nodetype&&'1'==_signtype){
//如果是按顺序会签,则从右边顺序列表中读取
var listobj = document.getElementById("nextactors2");
var options = listobj.options;
for(var i=0;i<options.length;i++){
var opt = options[i];
_next_actors.push(opt.value);
}
}else{
var tree_checked = $.tree_getCheckedNode({id:'nextactors'});
if(null!=tree_checked){
for(var i=0;i<tree_checked.length;i++){
var node = tree_checked[i];
if(!node){
continue;
}
var node_id = node.id;
var node_type = node.attributes.actortype;
if(-1==node_id.indexOf('dept_')){
_next_actors.push(node_id+","+node_type);
}
}
}
}
if(_next_actors.length<1){
$.wait_close();
alert('请选择办理者!');
return;
}
_data ={
task:jtask.task
,forwardtype:'pre'
,nodename:_nodename
,nodetype:_nodetype
,pdid:_pdid
,piid:_piid
,taskid:jtask.taskid
,subtaskid:jtask.subtaskid
,signtype:_signtype
,actorid:jtask.actorid
,actortype:jtask.actortype
,comment:_comment
,nextnode:_next_nodename
,nextnodetype:_next_nodetype
,nextactors:_next_actors.join(';')
,tasktype:jtask.tasktype
,originactorid:jtask.originactorid
,originactortype:jtask.originactortype
,agenttype:jtask.agenttype
};
$.cuajax({
url:'wdk?action=wdk.wf&method=task_submit&ajaxparam='+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:_data,
success:function(result) {
$.wait_close();
var jres = $.str2json(result);
alert(jres.desc);
if('1'==jres.code){
$.tab_closeTop();
}
},
error:function(result){
alert('网络错误!result='+result);
}
});
}
</script>
</head>
<body class="easyui-layout" style="padding:0px;margin:0px;background-color:#FFFFFF;">
<!-- 按钮 -->
<div id="layout_toolbar" data-options="region:'north',border:false,collapsed:false" style="height:30px;overflow:hidden;border:1px solid #ddd;text-align:left;" >
<a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-ok'" href="javascript:void(0)" onclick="task_submit()">提交</a>
</div>
<!-- 表格 -->
<div id="layout_content" data-options="region:'center',border:false,collapsed:false" style="overflow:hidden;border:1px solid #ddd;" >
<div class="fitem" style="height:70px;">
<div style="float:left;">
<div style="float:left;">
<span class="title">回退意见:</span>
<div id="comment" style="width:200px;height:60px;overflow:auto;border:1px solid #d4a375">
</div>
</div>
<div style="float:left;position:absolute;right:0px;width:50%;">
<span class="title">请选择回退意见:</span>
<div style="width:200px;height:60px;overflow:auto;border:1px solid #d4a375">
<a href="javascript:void" onclick="javascript:document.getElementById('comment').innerText='同意';return false;">同意</a><br>
<a href="javascript:void" onclick="javascript:document.getElementById('comment').innerText='同意发';return false;">同意发</a><br>
<a href="javascript:void" onclick="javascript:document.getElementById('comment').innerText='同意测试';return false;">同意测试</a><br>
<a href="javascript:void" onclick="javascript:document.getElementById('comment').innerText='同意转发';return false;">同意转发</a><br>
<a href="javascript:void" onclick="javascript:document.getElementById('comment').innerText='同意意见';return false;">同意意见</a><br>
<a href="javascript:void" onclick="javascript:document.getElementById('comment').innerText='全部同意';return false;">全部同意</a><br>
<a href="javascript:void" onclick="javascript:document.getElementById('comment').innerText='同意签发';return false;">同意签发</a><br>
</div>
</div>
</div>
&nbsp;
</div>
<div class="fitem">
<span class="title">当前办理环节:</span>
<span id="nodename">&nbsp;</span>
</div>
<div class="fitem">
<span class="title">当前人员:</span>
<span id="actorid">&nbsp;</span>
</div>
<div class="fitem" id="item_signinfo" style="height:70px;display:none;">
<span class="title">会签信息:</span>
<div id="signinfo" style="height:70px;width:200px;overflow:auto;">
</div>
</div>
<div class="fitem" id="item_nextnode">
<span class="title">前序办理环节:</span>
<div id="nextnodes">
<input name="nextnode" type="radio" value="">
</div>
</div>
<div class="fitem" id="item_signtype" style="display:none;">
<span class="title">会签顺序:</span>
<div>
<input name="signtype" id="signtype_0" onclick="signtype_onclick('0')" type="radio" value="0" checked>同时办理
<input name="signtype" id="signtype_1" onclick="signtype_onclick('1')" type="radio" value="1">顺序办理
</div>
</div>
<div id="item_nextactors" class="fitem" style="height:160px;">
<div style="float:left;">
<span class="title">办理人:</span>
<div id="nextactors" style="width:200px;height:150px;overflow:auto;border:1px solid #d4a375">
</div>
</div>
<div id="item_nextactors2" style="float:left;position:absolute;right:0px;width:50%;display:none;">
<span class="title">办理人顺序:</span>
<div style="width:200px;height:150px;overflow:auto;">
<select id="nextactors2" name="nextactors2" class="txt" multiple="multiple" style="width:200px;height:150px;border:1px solid #d4a375;">
</select>
</div>
</div>
&nbsp;
</div>
</div>
</body>
</html>