Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/maintenance/statisticalchart/bizStatisticalChart.jsp

521 lines
22 KiB
Plaintext
Raw Normal View History

2026-01-16 14:13:44 +08:00
<%@page import="com.sipai.tools.CommString"%>
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
<%@page import="com.sipai.service.maintenance.MaintenanceDetailService"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page import="com.sipai.entity.base.ServerObject"%>
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
<%request.setAttribute("Status_Finish",MaintenanceDetail.Status_Finish);%>
<%request.setAttribute("Status_Start",MaintenanceDetail.Status_Start);%>
<% request.setAttribute("Type_Detail", MaintenanceDetailService.processDefKey);%>
<%request.setAttribute("UserType_Biz", CommString.UserType_Biz); %>
<!DOCTYPE html>
<!-- <html lang="zh-CN"> -->
<!-- BEGIN HEAD -->
<head>
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
<!-- 引用页头及CSS页-->
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script src="<%=request.getContextPath()%>/JS/activiti/workflow.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.js" type="text/javascript"></script>
<%-- 引入CSS --%>
<link rel="stylesheet" href="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/CSS/style-activiti.css" type="text/css">
<!-- Ionicons -->
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/ionicons/css/ionicons.min.css"/>
<style>
</style>
<script type="text/javascript">
var beginTimeStore = '';
var endTimeStore = '';
function initDate() {
//定义locale汉化插件
beginTimeStore = moment().subtract(30, 'days').format('YYYY-MM-DD');;
endTimeStore = moment().subtract(-1, 'days').format('YYYY-MM-DD');
var locale = {
"format": 'YYYY-MM-DD',
"separator": " ~ ",
"applyLabel": "确定",
"cancelLabel": "取消",
"fromLabel": "起始时间",
"toLabel": "结束时间'",
"customRangeLabel": "自定义",
"weekLabel": "W",
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
"firstDay": 1
};
$('#reservationtime').daterangepicker({
"timePicker": false,
"timePicker24Hour": false,
"linkedCalendars": false,
"autoUpdateInput": false,
"timePickerIncrement": 10,
"locale": locale,
//汉化按钮部分
ranges: {
'今日': [moment(), moment().subtract(-1, 'days')],
'昨日': [moment().subtract(1, 'days'), moment()],
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
},
startDate: beginTimeStore,
endDate: endTimeStore
}, function(start, end, label) {
beginTimeStore = start.format(this.locale.format);
endTimeStore = end.format(this.locale.format);
if(!this.startDate){
this.element.val('');
}else{
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
}
dosearch();
});
$('#reservationtime').val(beginTimeStore + locale.separator + endTimeStore);
};
var echartsPie_taskSituation;
var echartsPie_handle;
var echartsPie_finish;
function getBizTaskCompleteSituation(bizId){
$.post(ext.contextPath +"/maintenance/getBizTaskCompleteSituation4Pie.do",{bizId:bizId,sdt:beginTimeStore,edt:endTimeStore},function(data){
var json = data;
var legend = [];
$.each(data,function(index,value){
legend.push(value.name)
});
var date = new Date();
var option = {
/* title: {
text: date.getFullYear()+'年运维完成图',
x: 'center'
}, */
tooltip : {
trigger: 'item',
formatter: "{b} : {c} 次"
},
legend: {
orient : 'vertical',
x : 'left',
data:legend
},
calculable : true,
series : [
{
type:'pie',
radius : '55%',//饼图的半径大小
center: ['50%', '50%'],//饼图的位置
label: {
normal: {
show: true,
formatter: '{b}: {c}'
}
},
data:json
}
],
color: ['#dd4b39','#00a65a','#f39c12','#00c0ef','#3c8dbc']
};
if(echartsPie_taskSituation!=null){
echartsPie_taskSituation.clear();
echartsPie_taskSituation.dispose();
}
echartsPie_taskSituation = echarts.init(document.getElementById('echartsPie_taskSituation'));
echartsPie_taskSituation.setOption(option);
},'json');
}
function getMaintenanceDetailResult4Pie_handle(bizId){
$.post(ext.contextPath +"/maintenance/getMaintenanceDetailResult4Pie.do",{bizId:bizId,status:'${Status_Start}',sdt:beginTimeStore,edt:endTimeStore},function(data){
var json = data;
var legend = [];
$.each(data,function(index,value){
legend.push(value.name)
});
var date = new Date();
var option = {
/* title: {
text: date.getFullYear()+'年运维完成图',
x: 'center'
}, */
tooltip : {
trigger: 'item',
formatter: "{b} : {c} 次"
},
legend: {
orient : 'vertical',
x : 'left',
data:legend
},
calculable : true,
series : [
{
type:'pie',
radius : '55%',//饼图的半径大小
center: ['50%', '50%'],//饼图的位置
label: {
normal: {
show: true,
formatter: '{b}: {c}'
}
},
data:json
}
],
color: ['#dd4b39','#00a65a','#f39c12','#00c0ef','#3c8dbc']
};
if(echartsPie_handle!=null){
echartsPie_handle.clear();
echartsPie_handle.dispose();
}
echartsPie_handle = echarts.init(document.getElementById('echartsPie_handle'));
echartsPie_handle.setOption(option);
},'json');
}
function getMaintenanceDetailResult4Pie_finish(bizId){
$.post(ext.contextPath +"/maintenance/getMaintenanceDetailResult4Pie.do",{bizId:bizId,status:'${Status_Finish}',sdt:beginTimeStore,edt:endTimeStore},function(data){
var echartsPie;
var json = data;
var legend = [];
$.each(data,function(index,value){
legend.push(value.name)
});
var date = new Date();
var option = {
/* title: {
text: date.getFullYear()+'年运维完成图',
x: 'center'
}, */
tooltip : {
trigger: 'item',
formatter: "{b} : {c} 次"
},
legend: {
orient : 'vertical',
x : 'left',
data:legend
},
calculable : true,
series : [
{
type:'pie',
radius : '55%',//饼图的半径大小
center: ['50%', '50%'],//饼图的位置
label: {
normal: {
show: true,
formatter: '{b}: {c}'
}
},
data:json
}
],
color: ['#dd4b39','#00a65a','#f39c12','#00c0ef','#3c8dbc']
};
if(echartsPie_finish!=null){
echartsPie_finish.clear();
echartsPie_finish.dispose();
}
echartsPie_finish = echarts.init(document.getElementById('echartsPie_finish'));
echartsPie_finish.setOption(option);
},'json');
}
function dosearch(){
var value=$("#search_code").select2("val");
if(value!=""){
getBizTaskCompleteSituation(value);
getMaintenanceDetailResult4Pie_finish(value);
getMaintenanceDetailResult4Pie_handle(value);
$("#table").bootstrapTable('refresh');
}
}
var viewTaskTraceFun = function(pid,ppid,taskId) {
graphTrace(pid,ppid,taskId);
};
var viewDetailFun = function(id) {
$.post(ext.contextPath + '/maintenance/showMaintenanceDetailView.do', {id:id} , function(data) {
$("#subDiv").html(data);
openModal('maintenanceDetailModal');
});
};
function initialTable(companyId){
$("#table").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/maintenance/getCompanyAllTaskList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20,50], // 设置页面可以显示的数据条数
pageSize: 50, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset/params.limit+1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
companyId : companyId,
sdt:beginTimeStore,
edt:endTimeStore,
userType:'${UserType_Biz}'
}
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
field: 'name', // 返回json数据中的name
title: '流程名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle'
},{
field: 'createTime', // 返回json数据中的name
title: '任务下发时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
formatter:function(value, row){
return row.task.createTime;
}
},{
field: 'problem', // 返回json数据中的name
title: '问题描述', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
formatter:function(value, row){
return row.business==null?'':row.business.problem;
}
},{
field: 'taskName', // 返回json数据中的name
title: '任务节点', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
formatter:function(value, row){
return row.task.name;
}
},{
field: 'assigneeUser', // 返回json数据中的name
title: '当前处理人', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
formatter:function(value, row){
return row.assigneeUser==null?'未签收':row.assigneeUser.caption+'('+row.assigneeUser.mobile+')';
}
},{
title: "操作",
align: 'center',
valign: 'middle',
width: 120, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var str = '';
str += '<button class="btn btn-default btn-sm" onclick="viewTaskTraceFun(\''+row.processInstance.id+'\',\''+row.processDefinition.id+'\',\''+row.task.id+'\')" data-toggle="tooltip" title="查看"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 查看</span></button>'
if(!row.task.assignee){
}else{
if(row.type.indexOf('${Type_Detail}')!=-1){
str += '<button class="btn btn-default btn-sm" onclick="viewDetailFun(\''+row.processInstance.businessKey+'\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-history"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>'
}
}
str='<div class="btn-group" >'+str+'</div>';
return str;
}
}
],
onLoadSuccess: function(){ //加载成功时执行
adjustBootstrapTableView("table");
},
onLoadError: function(){ //加载失败时执行
console.info("加载数据失败");
}
})
}
$(function() {
initDate();
$.post(ext.contextPath + "/user/getBizsByUserId4Select.do", {companyId:'${param.bizId}'}, function(data) {
var bizId="";
var selelct =$("#search_code").select2({
data: data,
placeholder:'请选择',//默认文字提示
allowClear: false,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct.on("change",function(e){
var value=selelct.select2("val");
if(value!=""){
getBizTaskCompleteSituation(value);
getMaintenanceDetailResult4Pie_finish(value);
getMaintenanceDetailResult4Pie_handle(value);
initialTable(value);
}
});
if(data.length>0){
selelct.val(data[0].id).trigger("change");
if(data.length==1){
$("#search_code").next().css("display", "none");
selelct.attr("disabled","disabled");
var companyText = $("#search_code").text();
$("#companyName").text(companyText);
}
}else if('${param.bizId}'!=''){
selelct.val('${param.bizId}').trigger("change");
$("#search_code").next().css("display", "none");
selelct.attr("disabled","disabled");
var companyText = $("#search_code").text();
$("#companyName").text(companyText);
}else{
selelct.val("").trigger("change");
$("#company").css("display", "none");
};
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
},'json');
});
</script>
</head>
<body <c:if test="${!extFlag }">onload="initMenu();" </c:if> class="hold-transition ${cu.themeclass} sidebar-mini">
<div class="wrapper">
<c:if test="${!extFlag }">
<!-- 引用top -->
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
<!-- 菜单栏 -->
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
</c:if>
<div class="content-wrapper" <c:if test="${extFlag }">style="margin-left:0"</c:if>>
<!-- Content Header (Page header) -->
<c:if test="${!extFlag }">
<section class="content-header">
<h1 id ="head_title">
</h1>
<ol class="breadcrumb">
<li><a id ='head_firstlevel' onclick="goToMainPage();" style="cursor:pointer "><i class="fa fa-dashboard"></i> </a></li>
</ol>
</section>
</c:if>
<!-- Main content -->
<section class="content container-fluid">
<div id="subDiv"></div>
<div id="traceDiv"></div>
<div id="handleDetailDiv"></div>
<div class="form-group form-inline">
<div class="form-group " style="padding:0;">
<label class="form-label" >公司:</label>
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;" ></select>
<span class="select2-selection select2-selection--single" id="companyName" style="width:220px;border: none;background: transparent;" ></span>
</div>
<div class="form-group form-inline pull-right" >
<label class="input-lable" >起止日期:</label>
<div class="input-group " >
<div class="input-group pull-right input-group-sm" >
<div class="input-group-addon">
<i class="fa fa-clock-o"></i>
</div>
<input type="text" class="form-control" id="reservationtime" style="width:175px">
<!-- <div class="input-group-btn ">
<button type="button" class="btn btn-default" onclick="dosearch();" ><i class="fa fa-search"></i> 查询</button>
</div> -->
</div>
</div>
</div>
</div>
<div class="row">
</div>
<div class="row">
<div class="col-lg-4 col-xs-12">
<div class="box box-primary" style="padding-bottom:10px">
<div class="box-header ui-sortable-handle">
<i class="fa fa-pie-chart"></i>
<h3 class="box-title">总运维完成情况</h3>
</div>
<!-- /.box-header -->
<div class="box-body" ">
<div id="echartsPie_taskSituation" style="height:280px;"></div>
</div>
</div>
</div>
<div class="col-lg-4 col-xs-12">
<div class="box box-primary" style="padding-bottom:10px">
<div class="box-header ui-sortable-handle">
<i class="fa fa-pie-chart"></i>
<h3 class="box-title">已完成运维情况</h3>
</div>
<!-- /.box-header -->
<div class="box-body" >
<div id="echartsPie_finish" style="height:280px;"></div>
</div>
</div>
</div>
<div class="col-lg-4 col-xs-12">
<div class="box box-primary" style="padding-bottom:10px">
<div class="box-header ui-sortable-handle">
<i class="fa fa-pie-chart"></i>
<h3 class="box-title">处理中运维情况</h3>
</div>
<!-- /.box-header -->
<div class="box-body" >
<div id="echartsPie_handle" style="height:280px;"></div>
</div>
</div>
</div>
<div class="col-lg-12 col-xs-12">
<div class="box box-primary" style="padding-bottom:10px">
<div class="box-header ui-sortable-handle">
<i class="ion ion-clipboard"></i>
<h3 class="box-title">处理中运维任务</h3>
</div>
<!-- /.box-header -->
<div class="box-body" >
<table id="table"></table>
</div>
</div>
</div>
</div>
</section>
<!-- /.content -->
</div>
<c:if test="${!extFlag }">
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
</c:if>
</div>
</body>
<!-- echarts-->
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js" charset="utf-8"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.js" charset="utf-8"></script>
<!-- 引入daterangepicker-->
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js" charset="utf-8"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js" charset="utf-8"></script>
<!-- 文件上传-->
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
</html>