This commit is contained in:
caoqianming 2019-11-05 16:31:02 +08:00
parent 747ea9cf05
commit b54cae64a6
10 changed files with 25 additions and 1003 deletions

View File

@ -1,139 +1,3 @@
<<<<<<< HEAD
{% extends "./base.html" %}
{% block title %}隐患统计{% endblock %}
{% block content %}
{% load static %}
<div class="callout callout-warning">
<h3>未遂事件统计</h3>
</div>
<div style="height:600px;width:100%;background-color:aquamarine">
<div style="width:100%;height:100px;">
开始日期:<input type="text" id="test">
结束日期:<input type="text" id="test2">
<button class="btn btn-info" onclick="funTypeChange()">&nbsp;查询</button>
</div>
<div id="examchart" style="width:60%;height:400px;margin:auto"></div>
</div>
<!-- jQuery 3 -->
<script src="{% static 'groups/bower_components/jquery/dist/jquery.min.js' %}"></script>
<!-- Bootstrap 3.3.7 -->
<script src="{% static 'groups/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script>
<script src="{% static 'groups/time/laydate/laydate.js' %}"></script>
<link rel="stylesheet" href="{% static 'groups/time/laydate/theme/default/laydate.css' %}">
<!-- iCheck -->
<script src="{% static 'groups/plugins/iCheck/icheck.min.js' %}"></script>
<script src="{% static 'groups/bower_components/echarts.min.js' %}"></script>
<script type="text/javascript">
//隐患数量趋势图
$(function () {
laydate.render({
elem: '#test'
, format: 'yyyy-MM-dd' //可任意组合
});
laydate.render({
elem: '#test2'
, format: 'yyyy-MM-dd' //可任意组合
});
exam();
});
function funTypeChange() {
exam();
}
function exam() {
var start = $("#test").val();
var end = $("#test2").val();
$.ajax({
type: "get",
async: true, //异步请求(同步请求将会锁住浏览器,用户其他操作必须等待请求完成才可以执行)
url: "/groups/api/examChart?code=exam&start=" + start + "&end=" + end, //请求发送
dataType: "json", //返回数据形式为json
success: function (data) {
console.log(data.data.trainlist);
//请求成功时执行该函数内容data即为服务器返回的json对象
var examChart = echarts.init(document.getElementById("examchart"));
var examnum = [];
var companyName = [];
if (data.data.examlist != null) {
$.each(data.data.trainlist, function (i, item) {
examnum.push(item.number);
companyName.push(item.usecomp__partname);
})
examChart.setOption(
option = {
color: ['#FFA500'],
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
title: {
text: '本集团各公司未遂事件统计图'
},
tooltip: {},
legend: {
data: ['公司未遂事件总数']
},
grid: {
y2: 140
},
xAxis: {
type: 'category',
data: companyName,
boundaryGap: [0, 0.01],
axisLabel: {
interval: 0,//横轴信息全部显示
rotate: -30,//-30度角倾斜显示
}
},
yAxis: {},
series: [{
name: '公司未遂事件总数',
data: examnum,
type: 'bar'
}]
}
);
}
},
error: function (errorMsg) {
examChart.hideLoading();
}
});
}
</script>
{% endblock %}
=======
{% extends "./base.html" %}
{% block title %}在线考试统计{% endblock %}
@ -274,4 +138,3 @@
</script>
{% endblock %}
>>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345

View File

@ -1,180 +1,3 @@
<<<<<<< HEAD
{% extends "./base.html" %}
{% block pagehead %}
<h1>
本月数据
<small>Month Data</small>
</h1>
<ol class="breadcrumb">
<li class="active"><a href="{% url 'groups_index' %}"><i class="fa fa-dashboard"></i> 主页</a></li>
</ol>
{% endblock %}
{% block content %}
<!-- Info boxes -->
<div class="row">
<div class="col-lg-2 col-xs-6">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3>{{troublenum}}</h3>
<p>事故隐患</p>
</div>
<div class="icon">
<i class="fa fa-camera"></i>
</div>
<a href="{% url 'groups_trouble' %}" class="small-box-footer">更多分析 <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-2 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3>{{observenum}}
<!-- <sup style="font-size: 20px">%</sup> -->
</h3>
<p>行为观察</p>
</div>
<div class="icon">
<i class="fa fa-eye"></i>
</div>
<a href="#" class="small-box-footer">更多分析 <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-2 col-xs-6">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3>{{missnum}}</h3>
<p>未遂事件</p>
</div>
<div class="icon">
<i class="fa fa-life-ring"></i>
</div>
<a href="#" class="small-box-footer">更多分析 <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-2 col-xs-6">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<h3>{{trainnum}}</h3>
<p>教育培训</p>
</div>
<div class="icon">
<i class="fa fa-graduation-cap"></i>
</div>
<a href="#" class="small-box-footer">更多分析 <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-2 col-xs-6">
<!-- small box -->
<div class="small-box bg-teal">
<div class="inner">
<h3>{{companynum}}</h3>
<p>下属公司数</p>
</div>
<div class="icon">
<i class="fa fa-industry"></i>
</div>
<a href="#" class="small-box-footer">更多分析 <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-2 col-xs-6">
<!-- small box -->
<div class="small-box bg-orange">
<div class="inner">
<h3>{{usernum}}</h3>
<p>下属员工总数</p>
</div>
<div class="icon">
<i class="fa fa-users"></i>
</div>
<a href="#" class="small-box-footer">更多分析 <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-md-12">
<h3>
{{group.groupname}}
</h3>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">公司分布</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="row">
<div class="col-md-12">
<!-- <p class="text-center">
<strong>Sales: 1 Jan, 2014 - 30 Jul, 2014</strong>
</p> -->
<div id="container" style="height: 800px;width:auto">
</div>
<!-- /.chart-responsive -->
</div>
</div>
<!-- /.row -->
</div>
<!-- ./box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<script src="https://webapi.amap.com/maps?v=1.4.15&key=978fc7c286560aa4cb3f18ef06737f9a"></script>
<script>
var map = new AMap.Map('container', {
resizeEnable: true, //是否监控地图容器尺寸变化
zoom: 6, //初始化地图层级
center: [116.397428, 39.90923],//初始化地图中心点
//viewMode:'3D'//使用3D视图
});
$.getJSON('/groups/api/positions', function (res) {
var x=0,y=0,num=0;
for (var i = 0; i < res.data.length; i++) {
let podata = res.data[i]
if(podata.position !=null){
let arrayposition = podata.position.location.split(',')
x = x + parseFloat(arrayposition[0])
y = y + parseFloat(arrayposition[1])
num = num + 1
let marker = new AMap.Marker({
position: podata.position.location.split(','), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
label:{'content':podata.partname,'direction':'bottom'}
// title: res.data[i].partname,
// bubble:true,
// clickable:true
});
map.add(marker);
}
}
map.setCenter([x/num,y/num])
})
</script>
=======
{% extends "./base.html" %}
{% block pagehead %}
<h1>
@ -350,5 +173,4 @@
map.setCenter([x/num,y/num])
})
</script>
>>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345
{% endblock %}

View File

@ -1,140 +1,3 @@
<<<<<<< HEAD
{% extends "./base.html" %}
{% block title %}隐患统计{% endblock %}
{% block content %}
{% load static %}
<div class="callout callout-warning">
<h3>未遂事件统计</h3>
</div>
<div style="height:600px;width:100%;background-color:aquamarine">
<div style="width:100%;height:100px;">
开始日期:<input type="text" id="test">
结束日期:<input type="text" id="test2">
<button class="btn btn-info" onclick="funTypeChange()">&nbsp;查询</button>
</div>
<div id="misschart" style="width:60%;height:400px;margin:auto"></div>
</div>
<!-- jQuery 3 -->
<script src="{% static 'groups/bower_components/jquery/dist/jquery.min.js' %}"></script>
<!-- Bootstrap 3.3.7 -->
<script src="{% static 'groups/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script>
<script src="{% static 'groups/time/laydate/laydate.js' %}"></script>
<link rel="stylesheet" href="{% static 'groups/time/laydate/theme/default/laydate.css' %}">
<!-- iCheck -->
<script src="{% static 'groups/plugins/iCheck/icheck.min.js' %}"></script>
<script src="{% static 'groups/bower_components/echarts.min.js' %}"></script>
<script type="text/javascript">
//隐患数量趋势图
$(function () {
laydate.render({
elem: '#test'
, format: 'yyyy-MM-dd' //可任意组合
});
laydate.render({
elem: '#test2'
, format: 'yyyy-MM-dd' //可任意组合
});
miss();
});
function funTypeChange() {
miss();
}
function miss() {
var start = $("#test").val();
var end = $("#test2").val();
$.ajax({
type: "get",
async: true, //异步请求(同步请求将会锁住浏览器,用户其他操作必须等待请求完成才可以执行)
url: "/groups/api/missChart?code=miss&start=" + start + "&end=" + end, //请求发送
dataType: "json", //返回数据形式为json
success: function (data) {
console.log(data);
//请求成功时执行该函数内容data即为服务器返回的json对象
var missChart = echarts.init(document.getElementById("misschart"));
var missnum = [];
var companyName = [];
if (data.data.misslist != null) {
$.each(data.data.misslist, function (i, item) {
missnum.push(item.number);
companyName.push(item.usecomp__partname);
})
missChart.setOption(
option = {
color: ['#dd4b39'],
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
title: {
text: '本集团各公司未遂事件统计图'
},
tooltip: {},
legend: {
data: ['公司未遂事件总数']
},
grid: {
y2: 140
},
xAxis: {
type: 'category',
data: companyName,
boundaryGap: [0, 0.01],
axisLabel: {
interval: 0,//横轴信息全部显示
rotate: -30,//-30度角倾斜显示
}
},
yAxis: {},
series: [{
name: '公司未遂事件总数',
data: missnum,
type: 'bar'
}]
}
);
}
},
error: function (errorMsg) {
missChart.hideLoading();
}
});
}
</script>
{% endblock %}
=======
{% extends "./base.html" %}
{% block title %}未遂事件统计{% endblock %}
@ -276,4 +139,3 @@
</script>
{% endblock %}
>>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345

View File

@ -1,137 +1,3 @@
<<<<<<< HEAD
{% extends "./base.html" %}
{% block title %}隐患统计{% endblock %}
{% block content %}
{% load static %}
<div class="callout callout-warning">
<h3>行为统计</h3>
</div>
<div style="height:600px;width:100%;background-color:aquamarine">
<div style="width:100%;height:100px;">
开始日期:<input type="text" id="test">
结束日期:<input type="text" id="test2">
<button class="btn btn-info" onclick="funTypeChange()">&nbsp;查询</button>
</div>
<div id="obvchart" style="width:60%;height:400px;margin:auto"></div>
</div>
<!-- jQuery 3 -->
<script src="{% static 'groups/bower_components/jquery/dist/jquery.min.js' %}"></script>
<!-- Bootstrap 3.3.7 -->
<script src="{% static 'groups/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script>
<script src="{% static 'groups/time/laydate/laydate.js' %}"></script>
<link rel="stylesheet" href="{% static 'groups/time/laydate/theme/default/laydate.css' %}">
<!-- iCheck -->
<script src="{% static 'groups/plugins/iCheck/icheck.min.js' %}"></script>
<script src="{% static 'groups/bower_components/echarts.min.js' %}"></script>
<script type="text/javascript">
//隐患数量趋势图
$(function () {
laydate.render({
elem: '#test'
, format: 'yyyy-MM-dd' //可任意组合
});
laydate.render({
elem: '#test2'
, format: 'yyyy-MM-dd' //可任意组合
});
observe();
});
function funTypeChange() {
observe();
}
function observe() {
var start = $("#test").val();
var end = $("#test2").val();
$.ajax({
type: "get",
async: true, //异步请求(同步请求将会锁住浏览器,用户其他操作必须等待请求完成才可以执行)
url: "/groups/api/observeChart?code=obv&start=" + start + "&end=" + end, //请求发送
dataType: "json", //返回数据形式为json
success: function (data) {
console.log(data);
//请求成功时执行该函数内容data即为服务器返回的json对象
var obvChart = echarts.init(document.getElementById("obvchart"));
var obvnum = [];
var companyName = [];
if (data.data.observelist != null) {
$.each(data.data.observelist, function (i, item) {
obvnum.push(item.number);
companyName.push(item.usecomp__partname);
})
obvChart.setOption(
option = {
color: ['#00a65a'],
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
title: {
text: '本集团各公司行为观察统计图'
},
tooltip: {},
legend: {
data: ['公司行为观察总数']
},
xAxis: {
type: 'category',
data: companyName,
boundaryGap: [0, 0.01],
axisLabel: {
interval: 0,//横轴信息全部显示
rotate: -30,//-30度角倾斜显示
}
},
grid: {
y2: 140
},
yAxis: {},
series: [{
name: '公司行为观察总数',
data: obvnum,
type: 'bar'
}]
}
);
}
},
error: function (errorMsg) {
obvChart.hideLoading();
}
});
}
</script>
{% endblock %}
=======
{% extends "./base.html" %}
{% block title %}行为统计{% endblock %}
@ -270,4 +136,3 @@
</script>
{% endblock %}
>>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345

View File

@ -1,139 +1,3 @@
<<<<<<< HEAD
{% extends "./base.html" %}
{% block title %}风险管控{% endblock %}
{% block content %}
{% load static %}
<div class="callout callout-warning">
<h3>风险管控统计</h3>
</div>
<div style="height:600px;width:100%;background-color:aquamarine">
<div style="width:100%;height:100px;">
开始日期:<input type="text" id="test">
结束日期:<input type="text" id="test2">
<button class="btn btn-info" onclick="funTypeChange()">&nbsp;查询</button>
</div>
<div id="riskchart" style="width:60%;height:400px;margin:auto"></div>
</div>
<!-- jQuery 3 -->
<script src="{% static 'groups/bower_components/jquery/dist/jquery.min.js' %}"></script>
<!-- Bootstrap 3.3.7 -->
<script src="{% static 'groups/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script>
<script src="{% static 'groups/time/laydate/laydate.js' %}"></script>
<link rel="stylesheet" href="{% static 'groups/time/laydate/theme/default/laydate.css' %}">
<!-- iCheck -->
<script src="{% static 'groups/plugins/iCheck/icheck.min.js' %}"></script>
<script src="{% static 'groups/bower_components/echarts.min.js' %}"></script>
<script type="text/javascript">
//隐患数量趋势图
$(function () {
laydate.render({
elem: '#test'
, format: 'yyyy-MM-dd' //可任意组合
});
laydate.render({
elem: '#test2'
, format: 'yyyy-MM-dd' //可任意组合
});
risk();
});
function funTypeChange() {
risk();
}
function risk() {
var start = $("#test").val();
var end = $("#test2").val();
$.ajax({
type: "get",
async: true, //异步请求(同步请求将会锁住浏览器,用户其他操作必须等待请求完成才可以执行)
url: "/groups/api/riskChart?code=risk&start=" + start + "&end=" + end, //请求发送
dataType: "json", //返回数据形式为json
success: function (data) {
console.log(data);
//请求成功时执行该函数内容data即为服务器返回的json对象
var riskChart = echarts.init(document.getElementById("riskchart"));
var risknum = [];
var companyName = [];
if (data.data.risklist != null) {
$.each(data.data.risklist, function (i, item) {
risknum.push(item.number);
companyName.push(item.usecomp__partname);
})
riskChart.setOption(
option = {
color: ['#FFA500'],
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
title: {
text: '本集团各公司风险管控统计图'
},
tooltip: {},
legend: {
data: ['公司风险管控总数']
},
grid: {
y2: 140
},
xAxis: {
type: 'category',
data: companyName,
boundaryGap: [0, 0.01],
axisLabel: {
interval: 0,//横轴信息全部显示
rotate: -30,//-30度角倾斜显示
}
},
yAxis: {},
series: [{
name: '公司风险管控总数',
data: risknum,
type: 'bar'
}]
}
);
}
},
error: function (errorMsg) {
riskChart.hideLoading();
}
});
}
</script>
{% endblock %}
=======
{% extends "./base.html" %}
{% block title %}风险管控{% endblock %}
@ -309,4 +173,3 @@
</script>
{% endblock %}
>>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345

View File

@ -1,141 +1,3 @@
<<<<<<< HEAD
{% extends "./base.html" %}
{% block title %}教育培训统计{% endblock %}
{% block content %}
{% load static %}
<div class="callout callout-warning">
<h3>教育培训统计</h3>
</div>
<div style="height:600px;width:100%;background-color:aquamarine">
<div style="width:100%;height:100px;">
开始日期:<input type="text" id="test">
结束日期:<input type="text" id="test2">
<button class="btn btn-info" onclick="funTypeChange()">&nbsp;查询</button>
<div id="trainchart" style="width:60%;height:400px;margin:auto"></div>
</div>
</div>
<!-- jQuery 3 -->
<script src="{% static 'groups/bower_components/jquery/dist/jquery.min.js' %}"></script>
<!-- Bootstrap 3.3.7 -->
<script src="{% static 'groups/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script>
<script src="{% static 'groups/time/laydate/laydate.js' %}"></script>
<link rel="stylesheet" href="{% static 'groups/time/laydate/theme/default/laydate.css' %}">
<!-- iCheck -->
<script src="{% static 'groups/plugins/iCheck/icheck.min.js' %}"></script>
<script src="{% static 'groups/bower_components/echarts.min.js' %}"></script>
<script type="text/javascript">
//隐患数量趋势图
$(function () {
laydate.render({
elem: '#test'
, format: 'yyyy-MM-dd' //可任意组合
});
laydate.render({
elem: '#test2'
, format: 'yyyy-MM-dd' //可任意组合
});
train();
});
function funTypeChange() {
train();
}
function train() {
var start = $("#test").val();
var end = $("#test2").val();
$.ajax({
type: "get",
async: true, //异步请求(同步请求将会锁住浏览器,用户其他操作必须等待请求完成才可以执行)
url: "/groups/api/trainChart?code=train&start=" + start + "&end=" + end, //请求发送
dataType: "json", //返回数据形式为json
success: function (data) {
console.log(data);
//请求成功时执行该函数内容data即为服务器返回的json对象
var trainChart = echarts.init(document.getElementById("trainchart"));
var trainnum = [];
var companyName = [];
if (data.data.trainlist != null) {
$.each(data.data.trainlist, function (i, item) {
trainnum.push(item.number);
companyName.push(item.usecomp__partname);
})
trainChart.setOption(
option = {
color: ['#00c0ef'],
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
title: {
text: '本集团各公司教育培训统计图'
},
tooltip: {},
legend: {
data: ['公司教育培训总数']
},
grid: {
y2: 140
},
xAxis: {
type: 'category',
data: companyName,
boundaryGap: [0, 0.01],
axisLabel: {
interval: 0,//横轴信息全部显示
rotate: -30,//-30度角倾斜显示
}
},
yAxis: {},
series: [{
name: '公司教育培训总数',
data: trainnum,
type: 'bar'
}]
}
);
}
},
error: function (errorMsg) {
trainChart.hideLoading();
}
});
}
</script>
{% endblock %}
=======
{% extends "./base.html" %}
{% block title %}教育培训统计{% endblock %}
@ -278,4 +140,3 @@
</script>
{% endblock %}
>>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345

View File

@ -1,134 +1,3 @@
<<<<<<< HEAD
{% extends "./base.html" %}
{% block title %}隐患统计{% endblock %}
{% block content %}
{% load static %}
<div class="callout callout-warning">
<h3>隐患统计</h3>
</div>
<div style="height:600px;width:100%;background-color:#dac2a3">
<div style="width:100%;height:100px;">
开始日期:<input type="text" id="test">
结束日期:<input type="text" id="test2">
<button class="btn btn-info" onclick="funTypeChange()">&nbsp;查询</button>
</div>
<div id="troubchart" style="width:60%;height:400px;margin:auto"></div>
</div>
<!-- jQuery 3 -->
<script src="{% static 'groups/bower_components/jquery/dist/jquery.min.js' %}"></script>
<!-- Bootstrap 3.3.7 -->
<script src="{% static 'groups/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script>
<script src="{% static 'groups/time/laydate/laydate.js' %}"></script>
<link rel="stylesheet" href="{% static 'groups/time/laydate/theme/default/laydate.css' %}">
<!-- iCheck -->
<script src="{% static 'groups/plugins/iCheck/icheck.min.js' %}"></script>
<script src="{% static 'groups/bower_components/echarts.min.js' %}"></script>
<script type="text/javascript">
//隐患数量趋势图
$(function () {
laydate.render({
elem: '#test'
, format: 'yyyy-MM-dd' //可任意组合
});
laydate.render({
elem: '#test2'
, format: 'yyyy-MM-dd' //可任意组合
});
troub();
});
function funTypeChange() {
troub();
}
function troub() {
var start = $("#test").val();
var end = $("#test2").val();
$.ajax({
type: "get",
async: true, //异步请求(同步请求将会锁住浏览器,用户其他操作必须等待请求完成才可以执行)
url: "/groups/api/troubleChart?code=tbpic&start=" + start + "&end=" + end, //请求发送
dataType: "json", //返回数据形式为json
success: function (data) {
console.log(data.data.troublelist);
console.log(data.num);
//请求成功时执行该函数内容data即为服务器返回的json对象
var yhChart = echarts.init(document.getElementById("troubchart"));
var yhnum = [];
var companyName = [];
if (data.data.troublelist != null) {
$.each(data.data.troublelist, function (i, item) {
yhnum.push(item.number);
companyName.push(item.usecomp__partname);
})
yhChart.setOption(
option = {
color: ['#f39c12'],
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
title: {
text: '本集团各公司隐患统计图'
},
tooltip: {},
legend: {
data: ['公司隐患总数']
},
grid: {
y2: 140
},
xAxis: {
type: 'category',
data: companyName,
boundaryGap: [0, 0.01],
axisLabel: {
interval: 0,//横轴信息全部显示
rotate: -30,//-30度角倾斜显示
}
},
yAxis: {},
series: [{
name: '公司隐患总数',
data: yhnum,
type: 'bar'
}]
}
);
}
},
error: function (errorMsg) {
yhChart.hideLoading();
}
});
}
</script>
{% endblock %}
=======
{% extends "./base.html" %}
{% block title %}隐患统计{% endblock %}
@ -264,4 +133,3 @@
</script>
{% endblock %}
>>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345

View File

@ -25,7 +25,6 @@ def check_login(func): # 自定义登录验证装饰器
return warpper
def login(request):
# 不允许重复登录
if request.session.get('is_login', None):
@ -147,6 +146,7 @@ def company_userchange_page(request, uid):
user = s_models.User.objects.get(pk=uid)
except s_models.User.DoesNotExist:
raise Http404("User does not exist")
print(model_to_dict(user))
user_form = UserForm(model_to_dict(user))
return render(request, 'groups/company_userchange.html', locals())
@ -325,11 +325,12 @@ def examChart(request): # 在线考试
companys = GroupUser.objects.get(id=request.session['user_id']).group.members.all()
for i in companys:
examlist = s_models.ExamTest.objects.filter(usecomps__contains=',' + i + ',').count()
examlist = s_models.ExamTest.objects.filter(usecomps__contains=',' + str(i.partid) + ',')
if start:
examlist = examlist.filter(starttime__gte=start)
if end:
examlist = examlist.filter(starttime__lte=end)
examjson.append({'companyName': i.Partment, 'number': Partment})
number = examlist.count()
examjson.append({'companyName': i.partname, 'number': number})
return HttpResponse(json.dumps({'code': 1, 'data': examjson}), content_type='application/json')

View File

@ -100,6 +100,15 @@
$.messager.alert('提示', '未选择作业类型!');
}
}
function addspjd(){
var row = $('#zylxlist').datalist('getSelected')
if (row){
opendg('新增审批节点','html/operationspjd/add')
}else{
$.messager.alert('提示', '未选择作业类型!');
}
}
function delspjd(){
var row = $('#spjdtable').datagrid('getSelected')

View File

@ -28,6 +28,7 @@ import decimal
from . import forms
from .models import CompanyInfo
from django.contrib.sessions.models import Session
from groups import models as g_models
import logging
logger = logging.getLogger('log')
@ -1277,7 +1278,7 @@ def getdickey(req):
if req.GET.get('dicclass')=='33':
for i in a:
objs = Operationspjd.objects.filter(zylx=Dickey.objects.get(dickeyid=i['dickeyid']),usecomp=Partment.objects.get(partid=companyid))
str='作业部门主管-属地部门主管'
str='作业负责人-作业部门安全员-属地部门安全员'
for x in objs:
str = str + '-' + x.jdmc
i['splcdetail'] = str
@ -4054,6 +4055,13 @@ def apitool(req):
i.sprs = [i.spr.userid]
i.save()
return JsonResponse({"code":1})
elif a == 'supercompany':
supergroup = g_models.Group.objects.get(groupname='supergroup')
for i in Partment.objects.filter(iscompany=1,deletemark=1):
obj,create = g_models.Groupmember.objects.get_or_create(group=supergroup,member=i,defaults={'group':supergroup,'member':i})
if create:
print(i.partname+'---加入supergroup')
return JsonResponse({"code":1})
@ -4270,9 +4278,9 @@ def apioperation(req):
obj.zyzt = {'zyzt':'确认中','index':0}
obj.save()
splc = []
splc.append({'jdmc':'作业负责人审批','sprs':[userid]})
splc.append({'jdmc':'作业部门审批','sprs':getsprs(userid,obj.zybm)})
splc.append({'jdmc':'属地部门审批','sprs':getsprs(userid,obj.sdbm)})
splc.append({'jdmc':'作业负责人','sprs':[userid]})
splc.append({'jdmc':'作业部门审批','sprs':getsprs(userid,obj.zybm)})
splc.append({'jdmc':'属地部门审批','sprs':getsprs(userid,obj.sdbm)})
for i in Operationspjd.objects.filter(zylx=obj.zylx,usecomp=Partment.objects.get(partid=getcompany(userid))).order_by('id'):
splc.append({'jdmc':i.jdmc,'sprs':i.sprs})
obj.zyzt['splc']=splc