first commit
This commit is contained in:
223
WebRoot/jsp/activiti/leaveList.jsp
Normal file
223
WebRoot/jsp/activiti/leaveList.jsp
Normal file
@ -0,0 +1,223 @@
|
||||
<%@page import="org.apache.poi.ss.usermodel.Row"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%
|
||||
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/workflow.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 editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeedit',
|
||||
title : '编辑班组',
|
||||
url : ext.contextPath + '/work/group/edit.do?iframeId=iframeedit&id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(pid,ppid) {
|
||||
/* var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/group/view.do?id=' + id
|
||||
}); */
|
||||
//alert(pid+","+ppid);
|
||||
graphTrace("",pid,ppid);
|
||||
};
|
||||
|
||||
var suspendFun = function(id,status) {
|
||||
var tip="";
|
||||
if(status=="active"){
|
||||
tip="激活";
|
||||
}else{
|
||||
tip="挂起";
|
||||
}
|
||||
parent.$.messager.confirm('提示', '您确定要'+tip+'此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/activiti/workflow/processinstance/update.do', {processInstanceId : id,state:status}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示',tip+'成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示',tip+'失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
//alert(datas);
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/group/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/activiti/leavew/getlist.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 : '80', title : '用户名', field : 'userId', sortable : true, halign:'center'},
|
||||
{width : '150', title : '流程ID', field : 'processDefinitionId', sortable : true, halign:'center',formatter : function(value, row) {
|
||||
return row.processDefinition.id;
|
||||
}},
|
||||
{width : '150', title : '是否挂起', field : 'suspended', sortable : true, halign:'center',formatter : function(value, row) {
|
||||
var suspend=row.processInstance.suspended;
|
||||
if(suspend=='2'){
|
||||
return "已挂起";
|
||||
}else{
|
||||
return "未挂起";
|
||||
}
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
|
||||
|
||||
<%if (sessionManager.havePermission(session,"activiti/leavew/showlist.do?scope=all")) {%>
|
||||
//alert(!row.task.assignee);
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.processInstanceId+'\',\''+row.processDefinition.id+'\');"/>';
|
||||
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"activiti/leavew/edit.do")) {%>
|
||||
if(row.processInstance.suspended=="2")
|
||||
str += '<img class="iconImg ext-icon-table_lightning" title="激活" onclick="suspendFun(\''+row.processInstanceId+'\',\'active\');"/>';
|
||||
else
|
||||
str += '<img class="iconImg ext-icon-table_link" title="挂起" onclick="suspendFun(\''+row.processInstanceId+'\',\'suspend\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
//var pi;
|
||||
var pager = grid.datagrid('getPager'); // get the pager of datagrid
|
||||
pager.pagination({
|
||||
beforePageText: '第', //页数文本框前显示的汉字
|
||||
afterPageText: '页 共 {pages} 页',
|
||||
displayMsg: '显示 {from}到{to},共 {total} 条记录',
|
||||
});
|
||||
|
||||
$('#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>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/group/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
</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>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user