344 lines
10 KiB
Plaintext
344 lines
10 KiB
Plaintext
|
|
<%@page import="com.sipai.service.plan.DailyPlanService"%>
|
|||
|
|
<%@page import="com.sipai.entity.plan.DailyPlanTaskDemand"%>
|
|||
|
|
<%@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();%>
|
|||
|
|
<% request.setAttribute("Type_Produce", DailyPlanService.processDefKey);%>
|
|||
|
|
<%request.setAttribute("Flag_Start",DailyPlanTaskDemand.Flag_Start);%>
|
|||
|
|
<%request.setAttribute("Flag_Report",DailyPlanTaskDemand.Flag_Report);%>
|
|||
|
|
<%request.setAttribute("Flag_CarryOver",DailyPlanTaskDemand.Flag_CarryOver);%>
|
|||
|
|
<!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 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 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 gotoTaskFun = function(type,tdkey,taskId) {
|
|||
|
|
if(type=='${Type_Produce}'){
|
|||
|
|
switch(tdkey)
|
|||
|
|
{
|
|||
|
|
case 'DrawDailyPlan':
|
|||
|
|
doLook();
|
|||
|
|
break;
|
|||
|
|
case 'deptLeaderAudit':
|
|||
|
|
doLookOperate();
|
|||
|
|
break;
|
|||
|
|
case 'IssueWorkOrder':
|
|||
|
|
showWorkOrders();
|
|||
|
|
break;
|
|||
|
|
case 'StartWork':
|
|||
|
|
dostart(taskId);
|
|||
|
|
break;
|
|||
|
|
case 'HandUp':
|
|||
|
|
doreport(taskId);
|
|||
|
|
break;
|
|||
|
|
case 'CarryOver':
|
|||
|
|
docarryover(taskId);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
alert("未查询到任务模块!");
|
|||
|
|
}
|
|||
|
|
}else{
|
|||
|
|
alert("未查询到任务模块!");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
var doLook = function() {
|
|||
|
|
var nowdate = new Date();
|
|||
|
|
var dt=nowdate.Format('yyyy-MM-dd');//月日必须都是两位
|
|||
|
|
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
id:'viewDialog',
|
|||
|
|
iframeId:'view',
|
|||
|
|
title : '查看计划',
|
|||
|
|
height:"90%",
|
|||
|
|
width:"90%",
|
|||
|
|
url : ext.contextPath + '/plan/dailyplansummary/showlist.do?dt='+dt,
|
|||
|
|
onDestroy:function(){
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var doLookOperate = function() {
|
|||
|
|
var nowdate = new Date();
|
|||
|
|
var dt=nowdate.Format('yyyy-MM-dd');//月日必须都是两位
|
|||
|
|
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
id:'viewDialog',
|
|||
|
|
iframeId:'view',
|
|||
|
|
title : '查看计划',
|
|||
|
|
height:"90%",
|
|||
|
|
width:"90%",
|
|||
|
|
url : ext.contextPath + '/plan/dailyplansummary/showlistoperate.do?dt='+dt,
|
|||
|
|
onDestroy:function(){
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var showWorkOrders = function() {
|
|||
|
|
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
id:'viewDialog',
|
|||
|
|
iframeId:'view',
|
|||
|
|
title : '任务调度',
|
|||
|
|
height:"90%",
|
|||
|
|
width:"90%",
|
|||
|
|
url : ext.contextPath + '/work/workorder/showlist.do',
|
|||
|
|
onDestroy:function(){
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
//开工 taskId为activiti的taskid
|
|||
|
|
var dostart = function(taskId) {
|
|||
|
|
$.post(ext.contextPath + '/work/workorder/doupdate_taskdemand.do', {taskId : taskId,status:'${Flag_Start}'}, function(data) {
|
|||
|
|
if(data==1){
|
|||
|
|
parent.$.messager.alert('提示','开工成功','info',function(){
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
grid.datagrid('unselectAll');
|
|||
|
|
});
|
|||
|
|
}else{
|
|||
|
|
parent.$.messager.alert('提示','开工失败','info');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
//报工
|
|||
|
|
var doreport=function(taskId){
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
title : '工单报工',
|
|||
|
|
width: 400,
|
|||
|
|
height:500,
|
|||
|
|
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskId='+taskId+'&status=${Flag_Report}',
|
|||
|
|
buttons : [{
|
|||
|
|
text : '确定',
|
|||
|
|
iconCls:'icon-ok',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
|||
|
|
grid.datagrid('unselectAll');
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
text : '取消',
|
|||
|
|
iconCls:'icon-cancel',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.dialog('destroy');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
//工单结转
|
|||
|
|
var docarryover=function(taskId){
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
title : '工单结转',
|
|||
|
|
width: 400,
|
|||
|
|
height:500,
|
|||
|
|
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskId='+taskId+'&status=${Flag_CarryOver}',
|
|||
|
|
buttons : [{
|
|||
|
|
text : '确定',
|
|||
|
|
iconCls:'icon-ok',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
|||
|
|
grid.datagrid('unselectAll');
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
text : '取消',
|
|||
|
|
iconCls:'icon-cancel',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.dialog('destroy');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
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');
|
|||
|
|
grid.datagrid('unselectAll');
|
|||
|
|
});
|
|||
|
|
}else{
|
|||
|
|
parent.$.messager.alert('提示','签收失败','info');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var viewFun = function(pid,ppid,taskId) {
|
|||
|
|
graphTrace(pid,ppid,taskId);
|
|||
|
|
};
|
|||
|
|
var deleteFun = function(id) {
|
|||
|
|
parent.$.messager.confirm('提示', '您确定要删除此记录?流程删除后将无法恢复。', function(r) {
|
|||
|
|
if (r) {
|
|||
|
|
$.post(ext.contextPath + '/activiti/workflow/process/delProcessInstance.do', {id : id}, function(data) {
|
|||
|
|
if(data==1){
|
|||
|
|
top.$.messager.alert('提示','删除成功','info');
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
grid.datagrid('unselectAll');
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.alert('提示','删除失败','info');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var searchgrid = function() {
|
|||
|
|
grid.datagrid('reload',ext.contextPath + '/activiti/workflow/getAllProcessInstaces.do?type='+$('#key').combobox('getValue'));
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
$(function() {
|
|||
|
|
|
|||
|
|
$("#key").combobox({
|
|||
|
|
url : ext.contextPath + '/activiti/workflow/getProcessTypes4Combo.do',
|
|||
|
|
valueField : 'id',
|
|||
|
|
textField : 'name',
|
|||
|
|
method:'get',
|
|||
|
|
panelHeight:'auto',
|
|||
|
|
onSelect:function(){
|
|||
|
|
//var value= $('#key').combobox('getValue');
|
|||
|
|
grid = $('#grid').datagrid({
|
|||
|
|
title : '',
|
|||
|
|
url : ext.contextPath + '/activiti/workflow/getAllProcessInstaces.do?type='+$('#key').combobox('getValue'),
|
|||
|
|
striped : true,
|
|||
|
|
rownumbers : true,
|
|||
|
|
pagination : true,
|
|||
|
|
singleSelect: false,
|
|||
|
|
ctrlSelect:true,
|
|||
|
|
nowrap:false,
|
|||
|
|
selectOnCheck: false,
|
|||
|
|
checkOnSelect: false,
|
|||
|
|
idField : 'id',
|
|||
|
|
pageSize : 50,
|
|||
|
|
pageList : [ 20, 50, 100],
|
|||
|
|
columns : [ [
|
|||
|
|
{checkbox:true , field : 'ck'},
|
|||
|
|
{width : '150', title : '流程名称', field : 'name', 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 : '180', title : '流程定义Id', field : 'processDefinitionId', sortable : false, halign:'center', formatter : function(value, row) {
|
|||
|
|
return row.processDefinition.id;
|
|||
|
|
}},
|
|||
|
|
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
|||
|
|
var str = '';
|
|||
|
|
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.processInstance.id+'\',\''+row.processDefinition.id+'\',\''+row.task.id+'\');"/>';
|
|||
|
|
/* 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="gotoTaskFun(\''+row.type+'\',\''+row.task.taskDefinitionKey+'\',\''+row.task.id+'\');"/>';
|
|||
|
|
} */
|
|||
|
|
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.processInstance.id+'\');"/>';
|
|||
|
|
return str;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
] ],
|
|||
|
|
toolbar : '#toolbar',
|
|||
|
|
onLoadSuccess : function(data) {
|
|||
|
|
$('.iconImg').attr('src', ext.pixel_0);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
},
|
|||
|
|
onLoadSuccess : function() {
|
|||
|
|
var data = $('#key').combobox('getData');
|
|||
|
|
if (data.length > 0) {
|
|||
|
|
$('#key').combobox('select', data[0].id);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
</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 id="key" name="key" class="easyui-combobox" data-options="required:false" style="width: 180px;" /></td>
|
|||
|
|
<td>
|
|||
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
|||
|
|
onclick="searchgrid();">搜索</a>
|
|||
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
|||
|
|
onclick="$('#searchForm').form('clear');searchgrid();">重置</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>
|