first commit
This commit is contained in:
341
bin/WebRoot/jsp/activiti/leavetaskList.jsp
Normal file
341
bin/WebRoot/jsp/activiti/leavetaskList.jsp
Normal file
@ -0,0 +1,341 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<%-- <script src="<%=contextPath%>/JS/activiti/leave-todo.js" type="text/javascript"></script> --%>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加班组',
|
||||
url : ext.contextPath + '/activiti/leavew/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var completeFun = function(leaveid,taskId,tdkey,name) {
|
||||
switch(tdkey)
|
||||
{
|
||||
case 'deptLeaderAudit':
|
||||
deptLeaderAuditFun(leaveid,taskId);
|
||||
break;
|
||||
case 'deptLeaderAuditToSub':
|
||||
deptLeaderAuditFunToSub(leaveid,taskId);
|
||||
break;
|
||||
case 'deptLeaderAuditToCA':
|
||||
deptLeaderAuditFunToCA(leaveid,taskId);
|
||||
break;
|
||||
case 'modifyApply':
|
||||
modifyApplyFun(leaveid,taskId,'deptLeaderAudit');
|
||||
break;
|
||||
case 'hrAudit':
|
||||
hrAuditFun(leaveid,taskId);
|
||||
break;
|
||||
case 'hrAuditCA':
|
||||
hrAuditCAFun(leaveid,taskId);
|
||||
break;
|
||||
default:
|
||||
alert("未查询到“"+tdkey+"”任务模块!");
|
||||
}
|
||||
|
||||
};
|
||||
var deptLeaderAuditFunToSub = function(leaveid,taskId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '任务办理',
|
||||
width : 500,
|
||||
height : 300,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/activiti/leavew/getleavedetail.do?id='+leaveid,
|
||||
buttons : [ {
|
||||
text : '通过',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.docompleteToSub(dialog, taskId);
|
||||
}
|
||||
},{
|
||||
text : '驳回',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doreject(dialog,taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}
|
||||
});
|
||||
};
|
||||
var deptLeaderAuditFunToCA = function(leaveid,taskId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '任务办理',
|
||||
width : 500,
|
||||
height : 300,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/activiti/leavew/getleavedetail.do?id='+leaveid,
|
||||
buttons : [ {
|
||||
text : '通过',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.docompleteToCA(dialog, taskId,leaveid);
|
||||
}
|
||||
},{
|
||||
text : '驳回',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doreject(dialog,taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}
|
||||
});
|
||||
};
|
||||
var deptLeaderAuditFun = function(leaveid,taskId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '任务办理',
|
||||
width : 500,
|
||||
height : 300,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/activiti/leavew/getleavedetail.do?id='+leaveid,
|
||||
buttons : [ {
|
||||
text : '通过',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.docomplete(dialog, taskId);
|
||||
}
|
||||
},{
|
||||
text : '驳回',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doreject(dialog,taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}
|
||||
});
|
||||
};
|
||||
var modifyApplyFun = function(leaveid,taskId,taskKey) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '任务办理',
|
||||
width : 500,
|
||||
height : 500,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/activiti/leavew/detail-with-vars.do?id='+leaveid+'&taskId='+taskId+'&taskKey='+taskKey,
|
||||
buttons : [ {
|
||||
text : '调整申请',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doreApply(dialog, taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消申请',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dounApply(dialog,taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}
|
||||
});
|
||||
};
|
||||
var hrAuditFun = function(leaveid,taskId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : 'HR审批',
|
||||
width : 500,
|
||||
height : 500,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/activiti/leavew/getleavedetail.do?id='+leaveid,
|
||||
buttons : [ {
|
||||
text : '通过',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doPass(dialog, taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}
|
||||
});
|
||||
};
|
||||
var hrAuditCAFun = function(leaveid,taskId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : 'HR审批',
|
||||
width : 500,
|
||||
height : 500,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/activiti/leavew/getleavedetail.do?id='+leaveid,
|
||||
buttons : [ {
|
||||
text : '通过',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.docompleteFinishCA(dialog, taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}
|
||||
});
|
||||
};
|
||||
var claimFun = function(id) {
|
||||
$.post(ext.contextPath + '/activiti/leavew/task/claim.do', {taskId : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','签收成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','签收失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/activiti/leavew/gettasklist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '请假类型', field : 'leaveType', sortable : true, halign:'center'},
|
||||
{width : '180', title : '申请时间', field : 'applyTime', sortable : true, halign:'center'},
|
||||
{width : '280', title : '申请原因', field : 'reason', sortable : false, halign:'center'},
|
||||
{width : '180', title : '任务下发时间', field : 'createTime', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return row.task.createTime;
|
||||
}},
|
||||
{width : '180', title : '任务节点', field : 'taskName', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return row.task.name;
|
||||
}},
|
||||
{width : '80', title : '用户名', field : 'userId', sortable : true, halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"activiti/leavew/edit.do")) {%>
|
||||
if(!row.task.assignee){
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="签收" onclick="claimFun(\''+row.task.id+'\');"/>';
|
||||
}else{
|
||||
str += '<img class="iconImg ext-icon-table_go" title="办理" onclick="completeFun(\''+row.id+'\',\''+row.task.id+'\',\''+row.task.taskDefinitionKey+'\',\''+row.task.name+'\');"/>';
|
||||
}
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_pid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
width:200,
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#search_pid").tree("search_pid");
|
||||
}
|
||||
},
|
||||
editable:false
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>班组名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属车间</td>
|
||||
<td><input id="search_pid" name="search_pid" class="easyui-combotree"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
<!-- 部门领导审批 -->
|
||||
<div id="deptLeaderAudit" style="display: none">
|
||||
|
||||
<!-- table用来显示信息,方便办理任务 -->
|
||||
<%@include file="view-form.jsp" %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user