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.
313 lines
10 KiB
313 lines
10 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 _gridcode = "wdk.module.wf.deputegrid";
|
|
var _gridid = $.getUUID();
|
|
window.onload = function(){
|
|
//1、初始化显示表格
|
|
_gridid = $.grid({
|
|
id:_gridid,
|
|
containerid:'layout_grid',
|
|
gridcode:_gridcode,
|
|
url:'wdk?action=wdk.wf&method=depute_list&ajaxparam='+new Date().getTime(),
|
|
idField:'id',
|
|
singleSelect:true, //是否单选
|
|
pagination:true, //分页控件
|
|
rownumbers:true //行号
|
|
});
|
|
|
|
|
|
//2、初始化委托人选择控件
|
|
$.inputpop({
|
|
id:'_depute_actor'
|
|
,title:'委托人选择'
|
|
,width:320
|
|
,height:480
|
|
,url:'<%=WDK_ROOT%>/module/wf/usertree.jsp'
|
|
,required:false
|
|
,editable:false
|
|
,checkbox:false
|
|
,asyn:false
|
|
,dataurl:$.encode('wdk?action=wdk.wf&method=pub_actorlist&ajaxparam='+new Date().getTime())
|
|
});
|
|
//3、初始化被委托人选择控件
|
|
$.inputpop({
|
|
id:'_depute_deputeactor'
|
|
,title:'被委托人选择'
|
|
,width:320
|
|
,height:480
|
|
,url:'<%=WDK_ROOT%>/module/wf/usertree.jsp'
|
|
,required:false
|
|
,editable:false
|
|
,checkbox:false
|
|
,asyn:false
|
|
,dataurl:$.encode('wdk?action=wdk.wf&method=pub_actorlist&ajaxparam='+new Date().getTime())
|
|
});
|
|
|
|
//3、初始化流程模板
|
|
$.combobox({
|
|
id:'_depute_pdlist'
|
|
,url:'wdk?action=wdk.wf&method=combobox_pd_name&ajaxparam='+new Date().getTime()
|
|
,isinitselect:false
|
|
,onLoadSuccess:function(data){
|
|
$.combobox({
|
|
id:'_depute_nodenames'
|
|
,url:'wdk?action=wdk.wf&method=combobox_pd_nodenames&pdid=&ajaxparam='+new Date().getTime()
|
|
,multiple:true
|
|
,onLoadSuccess:function(data){
|
|
var _depute_type = $("input[name='_depute_type']:checked").val();
|
|
if('1'==_depute_type){
|
|
$.combobox_disabled({id:'_depute_nodenames'});
|
|
}
|
|
}
|
|
});
|
|
}
|
|
,onSelect:function(record){
|
|
//3.1、初始化流程环节列表
|
|
$.combobox({
|
|
id:'_depute_nodenames'
|
|
,url:'wdk?action=wdk.wf&method=combobox_pd_nodenames&pdid='+record.id+'&ajaxparam='+new Date().getTime()
|
|
,multiple:true
|
|
,onLoadSuccess:function(data){
|
|
var _depute_type = $("input[name='_depute_type']:checked").val();
|
|
if('1'==_depute_type){
|
|
$.combobox_disabled({id:'_depute_nodenames'});
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
//4、初始化委托日期
|
|
var dt = $.getDateTime();
|
|
$('#_depute_createdt').val(dt);
|
|
|
|
//5、初始化委托开始日期和委托结束日期
|
|
$.datetimebox({
|
|
id:'_depute_startdt'
|
|
,editable:false
|
|
});
|
|
$.datetimebox({
|
|
id:'_depute_enddt'
|
|
,editable:false
|
|
});
|
|
|
|
};
|
|
|
|
//委托方式选择
|
|
function _onclick_deputetype(type){
|
|
if('0'==type){ //如果不是全程委托,则选择
|
|
$.combobox_enabled({id:'_depute_nodenames'});
|
|
}else{ //如果是全程委托,则清除已选项,同时禁用选择
|
|
$.combobox_clear({id:'_depute_nodenames'});
|
|
$.combobox_disabled({id:'_depute_nodenames'});
|
|
}
|
|
}
|
|
|
|
//grid表格里的点击
|
|
function _handler_click(method,pdid,deploymentid,pdname,cnname){
|
|
switch(method){
|
|
case 'enable': //生效
|
|
break;
|
|
case 'disable': //失效
|
|
break;
|
|
case 'modify': //修改
|
|
break;
|
|
case 'remove': //删除委托
|
|
if(confirm('该操作将删除当前流程模板,是否继续?')){
|
|
_pd_remove(pdid,'0');
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
//打开新增委托界面
|
|
function _add(){
|
|
$('#dlg_add').dialog('open').dialog('setTitle','新增委托');
|
|
|
|
//初始化各类控件的值
|
|
$.inputpop_clear({id:'_depute_actor'});
|
|
$.inputpop_clear({id:'_depute_deputeactor'});
|
|
$.combobox_clear({id:'_depute_pdlist'});
|
|
$("input[type=_depute_type][value=1]").attr("checked",'checked');
|
|
$.combobox_clear({id:'_depute_nodenames'});
|
|
$('#_depute_createdt').val($.getDateTime());
|
|
$.datetimebox_clear({id:'_depute_startdt'});
|
|
$.datetimebox_clear({id:'_depute_enddt'});
|
|
$('#_depute_remark').val('');
|
|
$("input[type=_depute_isenable][value=1]").attr("checked",'checked');
|
|
}
|
|
//保存
|
|
function _save(){
|
|
var _actor = $.inputpop_getValue({id:'_depute_actor'});
|
|
var _deputeactor = $.inputpop_getValue({id:'_depute_deputeactor'});
|
|
var _pdid = $.combobox_getValue({id:'_depute_pdlist'});
|
|
var _type = $("input[name='_depute_type']:checked").val();
|
|
var _nodenames = $.combobox_getValue({id:'_depute_nodenames'});
|
|
var _createdt = $('#_depute_createdt').val();
|
|
var _startdt = $.datetimebox_getText({id:'_depute_startdt'});
|
|
var _enddt = $.datetimebox_getText({id:'_depute_enddt'});
|
|
var _remark = $('#_depute_remark').val();
|
|
var _isenable = $("input[name='_depute_isenable']:checked").val();
|
|
if(null==_actor||""==_actor){
|
|
alert("请选择委托人!");
|
|
return false;
|
|
}
|
|
if(null==_deputeactor||""==_deputeactor){
|
|
alert("请选择被委托人!");
|
|
return false;
|
|
}
|
|
if(null==_pdid||""==_pdid){
|
|
alert("请选择委托模板!");
|
|
return false;
|
|
}
|
|
|
|
|
|
$.wait_open_top();
|
|
var _data = {
|
|
actorid:_actor.split(",")[0]
|
|
,actortype:_actor.split(",")[1]
|
|
,deputeactorid:_deputeactor.split(",")[0]
|
|
,deputeactortype:_deputeactor.split(",")[1]
|
|
,type:_type
|
|
,nodenames:_nodenames
|
|
,createdt:_createdt
|
|
,startdt:_startdt
|
|
,enddt:_enddt
|
|
,pdid:_pdid
|
|
,remark:_remark
|
|
,isenable:_isenable
|
|
};
|
|
$.cuajax({
|
|
url:'wdk?action=wdk.wf&method=depute_add&ajaxparam='+new Date().getTime(),
|
|
method:"post",
|
|
timeout:WDK_Timeout,
|
|
data:_data,
|
|
success:function(result) {
|
|
var jparam = $.str2json(result);
|
|
alert(jparam.desc);
|
|
$.grid_reload({id:_gridid});
|
|
$.wait_close_top();
|
|
$('#dlg_add').dialog('close');
|
|
},
|
|
error:function(result){
|
|
$.wait_close();
|
|
alert('网络错误!result='+result);
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
//删除 isCascade:是否级联删除关联实例?
|
|
function _pd_remove(pdid,isCascade){
|
|
var _data ={
|
|
pdid:pdid
|
|
,iscascade:isCascade
|
|
};
|
|
$.cuajax({
|
|
url:'wdk?action=wdk.wf&method=wf_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{
|
|
$.messager.alert('Warning',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="_add()">新增委托</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_add" class="easyui-dialog" style="width:380px;height:450px;padding:20px 40px;margin:0;" closed="true" modal="true" buttons="#dlg-buttons">
|
|
<div class="fitem" style="margin:10px;">
|
|
<div style="width:100px;margin-top:5px;float:left;">委托人:</div>
|
|
<input id="_depute_actor" name="_depute_actor" class="txt" style="width:150px">
|
|
</div>
|
|
<div class="fitem" style="margin:10px;">
|
|
<div style="width:100px;margin-top:5px;float:left;">被委托人:</div>
|
|
<input id="_depute_deputeactor" name="_depute_deputeactor" class="txt" style="width:150px">
|
|
</div>
|
|
<div class="fitem" style="margin:10px;">
|
|
<div style="width:100px;margin-top:5px;float:left;">流程模板:</div>
|
|
<input id="_depute_pdlist" name="_depute_pdlist" class="txt" style="width:150px">
|
|
</div>
|
|
<div class="fitem" style="margin:10px;">
|
|
<div style="width:100px;margin-top:5px;float:left;">委托方式:</div>
|
|
<input name="_depute_type" type="radio" value="1" onclick="_onclick_deputetype('1')" checked>全程委托
|
|
<input name="_depute_type" type="radio" value="0" onclick="_onclick_deputetype('0')">部分委托
|
|
</div>
|
|
<div class="fitem" style="margin:10px;">
|
|
<div style="width:100px;margin-top:5px;float:left;">环节清单:</div>
|
|
<input id="_depute_nodenames" name="_depute_nodenames" class="txt" style="width:150px">
|
|
</div>
|
|
<div class="fitem" style="margin:10px;">
|
|
<div style="width:100px;margin-top:5px;float:left;">委托日期:</div>
|
|
<input id="_depute_createdt" name="_depute_createdt" class="txt" style="width:150px" disabled>
|
|
</div>
|
|
<div class="fitem" style="margin:10px;">
|
|
<div style="width:100px;margin-top:5px;float:left;">委托开始时间:</div>
|
|
<input id="_depute_startdt" name="_depute_startdt" class="txt" style="width:150px">
|
|
</div>
|
|
<div class="fitem" style="margin:10px;">
|
|
<div style="width:100px;margin-top:5px;float:left;">委托结束时间:</div>
|
|
<input id="_depute_enddt" name="_depute_enddt" class="txt" style="width:150px">
|
|
</div>
|
|
<div class="fitem" style="margin:10px;">
|
|
<div style="width:100px;margin-top:5px;float:left;">委托原因:</div>
|
|
<input id="_depute_remark" name="_depute_remark" class="txt" style="width:150px">
|
|
</div>
|
|
<div class="fitem" style="margin:10px;">
|
|
<div style="width:100px;margin-top:5px;float:left;">是否启用:</div>
|
|
<input name="_depute_isenable" type="radio" value="1" checked>启用
|
|
<input name="_depute_isenable" type="radio" value="0" >停用
|
|
</div>
|
|
</div>
|
|
<div id="dlg-buttons">
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="_save()">保存</a>
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg_add').dialog('close')">退出</a>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|