325 lines
10 KiB
Plaintext
325 lines
10 KiB
Plaintext
<%@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:'iframeedit',
|
|
title : '新增模型',
|
|
width: 500,
|
|
height:250,
|
|
url : ext.contextPath + '/activiti/workflow/model/addModel.do',
|
|
buttons : [ {
|
|
text : '保存',
|
|
handler : function() {
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
|
grid.datagrid('reload');
|
|
|
|
}
|
|
} ]
|
|
});
|
|
};
|
|
var editFun = function(id) {
|
|
var dialog = parent.ext.modalDialog({
|
|
iframeId:'iframeedit',
|
|
title : '编辑模型',
|
|
width:1000,
|
|
url : ext.contextPath + '/modeler.html?modelId=' + id,
|
|
buttons : [ {
|
|
text : '关闭',
|
|
handler : function() {
|
|
grid.datagrid('reload');
|
|
dialog.dialog('destroy');
|
|
}
|
|
} ]
|
|
});
|
|
};
|
|
var copyFun = function(id) {
|
|
parent.$.messager.confirm('提示', '您确定要为该模型生成副本?', function(r) {
|
|
if (r) {
|
|
$.post(ext.contextPath + '/activiti/workflow/model/copycreat.do', {id : id}, function(data) {
|
|
if(data==1){
|
|
parent.$.messager.alert('提示','生成成功','info',function(){
|
|
grid.datagrid('reload');
|
|
grid.datagrid('clearChecked');
|
|
});
|
|
}else{
|
|
parent.$.messager.alert('提示','生成失败','info');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
var deployFun = function(id) {
|
|
$.post(ext.contextPath + '/activiti/workflow/model/deploy.do',{modelId:id}, function(data) {
|
|
if(data.res=="1"){
|
|
if(data.restr!=""){
|
|
parent.$.messager.alert('部署成功',data.restr,'info');
|
|
}else{
|
|
parent.$.messager.alert('提示','部署成功','info');
|
|
}
|
|
|
|
}else{
|
|
parent.$.messager.alert('提示','部署失败','info');
|
|
}
|
|
},'json');
|
|
};
|
|
var viewFun = function(id) {
|
|
var dialog = parent.ext.modalDialog({
|
|
iframeId:'iframeedit',
|
|
title : '模型管控',
|
|
url : ext.contextPath + '/activiti/workflow/model/showProcessTechnicsList.do?modelid=' + id,
|
|
buttons : [ {
|
|
text : '关闭',
|
|
handler : function() {
|
|
//grid.datagrid('reload');
|
|
dialog.dialog('destroy');
|
|
}
|
|
} ]
|
|
});
|
|
|
|
};
|
|
|
|
var deleteFun = function(id) {
|
|
parent.$.messager.confirm('提示', '您确定要删除此模型?', function(r) {
|
|
if (r) {
|
|
$.post(ext.contextPath + '/activiti/workflow/model/delete.do', {id : id}, function(data) {
|
|
if(data==1){
|
|
parent.$.messager.alert('提示','删除成功','info',function(){
|
|
grid.datagrid('reload');
|
|
grid.datagrid('clearChecked');
|
|
});
|
|
}else{
|
|
parent.$.messager.alert('提示','删除失败','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');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
};
|
|
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/processdefinition/update.do', {processDefinitionId : id,state:status}, function(data) {
|
|
if(data==1){
|
|
parent.$.messager.alert('提示',tip+'成功','info',function(){
|
|
grid.datagrid('reload');
|
|
});
|
|
}else{
|
|
parent.$.messager.alert('提示',tip+'失败','info');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
function FormatDate (strTime) {
|
|
var date = new Date(strTime);
|
|
return date.Format("yyyy-MM-dd hh:mm:ss");
|
|
}
|
|
$(function() {
|
|
grid = $('#grid').datagrid({
|
|
title : '',
|
|
url : ext.contextPath + '/activiti/workflow/model/getModelList.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 : '模型ID', field : 'id', sortable : false, halign:'center'},
|
|
{width : '180', title : '模型名称', field : 'name', sortable : false, halign:'center'},
|
|
{width : '200', title : '模型key', field : 'key', sortable : false, halign:'center'},
|
|
{width : '180', title : '创建时间', field : 'createTime', sortable : false, halign:'center', formatter : function(value, row) {
|
|
return FormatDate(value.time);
|
|
}},
|
|
/* {width : '180', title : '流程描述', field : 'description', sortable : true, halign:'center'}, */
|
|
{width : '100', title : '版本号', field : 'version', sortable : false, halign:'center'},
|
|
{title : '操作', field : 'action', width : '160', halign:'center', align:'center', formatter : function(value, row) {
|
|
var str = '';
|
|
|
|
<%if (sessionManager.havePermission(session,"activiti/workflow/model/showlist.do?scope=all")) {%>
|
|
str += '<img class="iconImg ext-icon-table_sort" title="查看管控内容" onclick="viewFun(\''+row.id+'\');"/>';
|
|
|
|
<%}%>
|
|
<%if (sessionManager.havePermission(session,"activiti/workflow/model/edit.do")) {%>
|
|
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
|
str += '<img class="iconImg ext-icon-table_multiple" title="复制" onclick="copyFun(\''+row.id+'\');"/>';
|
|
<%}%>
|
|
<%if (sessionManager.havePermission(session,"activiti/workflow/model/edit.do")) {%>
|
|
str += '<img class="iconImg ext-icon-table_go" title="部署" onclick="deployFun(\''+row.id+'\');"/>';
|
|
|
|
<%}%>
|
|
<%if (sessionManager.havePermission(session,"activiti/workflow/model/delete.do")) {%>
|
|
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
|
<%}%>
|
|
return str;
|
|
}
|
|
}
|
|
] ],
|
|
toolbar : '#toolbar',
|
|
onLoadSuccess : function(data) {
|
|
$('.iconImg').attr('src', ext.pixel_0);
|
|
}
|
|
});
|
|
|
|
});
|
|
var importFun = function() {
|
|
var dest='/activiti/workflow/model/saveImportModel.do';
|
|
var dialog = parent.ext.modalDialog({
|
|
title : '选择文件',
|
|
width: 600,
|
|
height:300,
|
|
closeOnEscape:true,
|
|
url : ext.contextPath + '/activiti/workflow/model/doimportExcel.do?dest='+dest,
|
|
buttons : [ {
|
|
text : '上传',
|
|
handler : function() {
|
|
dialog.find('iframe').get(0).contentWindow.doimport(dialog, grid);
|
|
}
|
|
} ]
|
|
});
|
|
|
|
|
|
};
|
|
//同步
|
|
var synchroFun = function() {
|
|
var dialog = parent.ext.modalDialog({
|
|
title : '选择产品',
|
|
closeOnEscape:true,
|
|
url : ext.contextPath + '/material/materialinfo/showPLMProducts.do',
|
|
buttons : [ {
|
|
text : '确认',
|
|
handler : function() {
|
|
var data =dialog.find('iframe').get(0).contentWindow.selectOK(dialog, grid);
|
|
//console.log(data.materialcode)
|
|
dialog.dialog("destroy");
|
|
$.post(ext.contextPath + '/activiti/workflow/model/savePLMProcess.do', {code : data.materialcode}, function(data) {
|
|
if(data.res=="1"){
|
|
if(data.unmatch==""){
|
|
parent.$.messager.alert('提示','同步成功','info',function(){
|
|
grid.datagrid('reload');
|
|
});
|
|
}else{
|
|
top.$.messager.alert('导入成功!', "以下工序:"+data.unmatch+",未查询到匹配工序,若需要,请手动编辑模型添加工序!");
|
|
grid.datagrid('reload');
|
|
}
|
|
}else{
|
|
if(data.reason!=null && data.reason!=""){
|
|
parent.$.messager.alert('同步失败',data.reason,'info');
|
|
}else{
|
|
parent.$.messager.alert('提示','同步失败','info');
|
|
}
|
|
|
|
}
|
|
},'json');
|
|
}
|
|
} ]
|
|
});
|
|
};
|
|
</script>
|
|
</head>
|
|
<body class="easyui-layout" data-options="fit:true,border:false">
|
|
<div id="toolbar" style="display: none;">
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
|
onclick="addFun();">新增</a>
|
|
</td>
|
|
<td>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true"
|
|
onclick="importFun();">导入</a>
|
|
</td>
|
|
<td>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_save',plain:true"
|
|
onclick="synchroFun();">同步</a>
|
|
</td>
|
|
<%--
|
|
<%if (sessionManager.havePermission(session,"work/group/delete.do")) {%>
|
|
<td>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
|
onclick="deletesFun();">删除</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>
|
|
<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> |