first commit
This commit is contained in:
348
WebRoot/jsp/activiti/taskList4main.jsp
Normal file
348
WebRoot/jsp/activiti/taskList4main.jsp
Normal file
@ -0,0 +1,348 @@
|
||||
<%@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);%>
|
||||
<script src="<%=contextPath%>/JS/activiti/workflow.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var grid_task;
|
||||
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_task);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
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(taskId);
|
||||
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(taskId) {
|
||||
/* 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?taskId='+taskId,
|
||||
onDestroy:function(){
|
||||
grid_task.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_task.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_task.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_task.datagrid('reload');
|
||||
grid_task.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_task);
|
||||
grid_task.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_task);
|
||||
grid_task.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_task.datagrid('reload');
|
||||
grid_task.datagrid('unselectAll');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','签收失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun_task = function(pid,ppid,taskId) {
|
||||
graphTrace(pid,ppid,taskId);
|
||||
};
|
||||
function loadworkorders(date){
|
||||
$("#workorderno").combobox({
|
||||
url : ext.contextPath + '/work/workorder/getList4Select.do?nowdate='+date,
|
||||
valueField : 'workorderno',
|
||||
textField : 'workorderno',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onSelect: function () {
|
||||
var datas=$("#workorderno").combobox('getData');
|
||||
var workorderno = $("#workorderno").combobox('getValue');
|
||||
var wforderid ="";
|
||||
for(var i=0;i<datas.length;i++){
|
||||
if(datas[i].workorderno==workorderno){
|
||||
wforderid=datas[i].wforderid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$("#processInstanceId").val(wforderid);
|
||||
$("#procedureno").combobox({
|
||||
url : ext.contextPath + '/work/workorder/getProcedurelist4Select.do?workorderno='+workorderno,
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onLoadSuccess: function(record){
|
||||
if($("#procedureno").combobox('getData').length>0){
|
||||
$("#procedureno").combobox('select','${sessionScope.procedure}');
|
||||
}
|
||||
},
|
||||
onSelect: function () {
|
||||
}
|
||||
});
|
||||
},
|
||||
onLoadSuccess : function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
var searchgrid = function() {
|
||||
grid_task.datagrid('reload',ext.contextPath + '/activiti/workflow/getProduceTaskList.do?'+$('#searchForm_task').serialize());
|
||||
};
|
||||
|
||||
$(function() {
|
||||
var nowdate = new Date();
|
||||
var dt=nowdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
loadworkorders(dt);
|
||||
grid_task = $('#grid_task').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/activiti/workflow/getProduceTaskList.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
/* {checkbox:true , field : 'ck'}, */
|
||||
{width : '80', title : '流程名称', field : 'name', sortable : false, halign:'center'},
|
||||
{width : '120', title : '任务下发时间', field : 'createTime', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return row.task.createTime;
|
||||
}},
|
||||
{width : '80', title : '任务节点', field : 'taskName', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return row.task.name;
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '70', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun_task(\''+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_task',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<div class="easyui-layout" data-options="fit:true,border:false">
|
||||
<%if (sessionManager.havePermission(session,"activiti/workflow/searchForm")) {%>
|
||||
<div id="toolbar_task" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<form id="searchForm_task">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工单</td>
|
||||
<td><input id="workorderno" name="workorderno" class="easyui-combobox" data-options="required:false" style="width: 100px;" />
|
||||
<input id="processInstanceId" name="processInstanceId" type="hidden" value=""/></td>
|
||||
<td>工序</td>
|
||||
<td><input id="procedureno" name="procedureno" class="easyui-combobox" style="width: 80px;" panelMaxHeight="400px" data-options="panelHeight:'auto'" value=""/></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_task" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
<!-- 部门领导审批 -->
|
||||
<%-- <div id="deptLeaderAudit" style="display: none">
|
||||
|
||||
<!-- table用来显示信息,方便办理任务 -->
|
||||
<%@include file="view-form.jsp" %>
|
||||
</div> --%>
|
||||
</div>
|
||||
Reference in New Issue
Block a user