peixun
This commit is contained in:
parent
b35ec7ea8f
commit
a288c876cf
BIN
safesite.lnk
BIN
safesite.lnk
Binary file not shown.
|
@ -76,8 +76,8 @@
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
orient: 'vertical',
|
orient: 'vertical',
|
||||||
x: 'left',
|
x: 'right',
|
||||||
y: 'bottom',
|
y:'bottom',
|
||||||
data: []
|
data: []
|
||||||
},
|
},
|
||||||
toolbox: {
|
toolbox: {
|
||||||
|
@ -187,8 +187,12 @@
|
||||||
containLabel: true
|
containLabel: true
|
||||||
},
|
},
|
||||||
toolbox: {
|
toolbox: {
|
||||||
|
show: true,
|
||||||
feature: {
|
feature: {
|
||||||
saveAsImage: {}
|
mark: { show: true },
|
||||||
|
dataView: { show: true, readOnly: false },
|
||||||
|
restore: { show: true },
|
||||||
|
saveAsImage: { show: true }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
|
@ -260,33 +264,34 @@
|
||||||
<!--行为观察统计-->
|
<!--行为观察统计-->
|
||||||
<select class="txtInput select3" id="years" name="years" style="width:100px;"></select><label>年</label>
|
<select class="txtInput select3" id="years" name="years" style="width:100px;"></select><label>年</label>
|
||||||
<button class="btn btn-info" onclick="funTypeChange2()"> 查询</button>
|
<button class="btn btn-info" onclick="funTypeChange2()"> 查询</button>
|
||||||
<div id="piecontainer2" style="width:100%;height:400px;">
|
<div id="piecontainer2" style="width:80%;margin:auto;height:400px;margin-bottom:100px;">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div style="width:100%">
|
<div style="width:100%">
|
||||||
<div style="width:40%;height:400px;float:left">
|
<select class="txtInput select3" id="year" name="year" style="width:100px;"></select><label>年</label>
|
||||||
<select class="txtInput select3" id="year" name="year" style="width:100px;"></select><label>年</label>
|
<select class="txtInput select3" id="month" name="month" style="width:100px;">
|
||||||
<select class="txtInput select3" id="month" name="month" style="width:100px;">
|
<option value="1">1月</option>
|
||||||
<option value="1">1月</option>
|
<option value="2">2月</option>
|
||||||
<option value="2">2月</option>
|
<option value="3">3月</option>
|
||||||
<option value="3">3月</option>
|
<option value="4">4月</option>
|
||||||
<option value="4">4月</option>
|
<option value="5">5月</option>
|
||||||
<option value="5">5月</option>
|
<option value="6">6月</option>
|
||||||
<option value="6">6月</option>
|
<option value="7">7月</option>
|
||||||
<option value="7">7月</option>
|
<option value="8">8月</option>
|
||||||
<option value="8">8月</option>
|
<option value="9">9月</option>
|
||||||
<option value="9">9月</option>
|
<option value="10">10月</option>
|
||||||
<option value="10">10月</option>
|
<option value="11">11月</option>
|
||||||
<option value="11">11月</option>
|
<option value="12">12月</option>
|
||||||
<option value="12">12月</option>
|
</select>
|
||||||
</select>
|
<button class="btn btn-info" onclick="funTypeChange()"> 查询</button>
|
||||||
<button class="btn btn-info" onclick="funTypeChange()"> 查询</button>
|
<div style="width:80%;margin:auto;height:400px;margin-bottom:100px;">
|
||||||
|
|
||||||
|
|
||||||
<div id="piecontainer" style="height:400px;width:100%">
|
<div id="piecontainer" style="height:400px;width:100%">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 60%; margin: 0px auto;float:right;margin-bottom:100px; ">
|
<div style="width: 80%; margin:auto;margin-bottom:100px; ">
|
||||||
<table name="" id="fxrpmtable" class='easyui-datagrid' title="行为观察记录排名" data-options="rownumbers:true,singleSelect:true,striped: true,method:'get',url: 'api/obscount?a=gclxbg',toolbar:'#fxrpmbar'" style="height:400px">
|
<table name="" id="fxrpmtable" class='easyui-datagrid' title="行为观察记录排名" data-options="rownumbers:true,singleSelect:true,striped: true,method:'get',url: 'api/obscount?a=gclxbg',toolbar:'#fxrpmbar'" style="height:400px">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -1,5 +1,25 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
$("#sfxbm2").combotree({
|
||||||
|
url: 'parthandle?a=tree',
|
||||||
|
editable: false,
|
||||||
|
loadFilter: function (rows) {
|
||||||
|
return convert(rows);
|
||||||
|
},
|
||||||
|
formatter: function (node) {
|
||||||
|
var s = node.text;
|
||||||
|
if (node.children) {
|
||||||
|
s += ' <span style=\'color:blue\'>(' + node.children.length + ')</span>';
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
},
|
||||||
|
onSelect: function (node) {
|
||||||
|
$('#sfxr').combobox({
|
||||||
|
url: 'getuser?partid=' + node.id + '&a=combobox',
|
||||||
|
editable: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
$(function () {
|
$(function () {
|
||||||
year = now.getFullYear();
|
year = now.getFullYear();
|
||||||
|
@ -144,36 +164,8 @@
|
||||||
function trainstatistical() {
|
function trainstatistical() {
|
||||||
var y = $("#year").val();
|
var y = $("#year").val();
|
||||||
var m = $("#month").val();
|
var m = $("#month").val();
|
||||||
var gcChart = echarts.init(document.getElementById("piecontainer2"));
|
var pxChart = echarts.init(document.getElementById("piecontainer2"));
|
||||||
|
|
||||||
gcChart.setOption(option = {
|
|
||||||
title: {
|
|
||||||
text: '培训类型分布',
|
|
||||||
x: 'left'
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'item',
|
|
||||||
formatter: "{a} <br/>{b} : {c} ({d}%)"
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
orient: 'vertical',
|
|
||||||
x: 'left',
|
|
||||||
y: 'bottom',
|
|
||||||
data: []
|
|
||||||
},
|
|
||||||
toolbox: {
|
|
||||||
show: true,
|
|
||||||
feature: {
|
|
||||||
mark: { show: true },
|
|
||||||
dataView: { show: true, readOnly: false },
|
|
||||||
restore: { show: true },
|
|
||||||
saveAsImage: { show: true }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
calculable: true,
|
|
||||||
|
|
||||||
});
|
|
||||||
gcChart.showLoading();
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "get",
|
type: "get",
|
||||||
async: true, //异步请求(同步请求将会锁住浏览器,用户其他操作必须等待请求完成才可以执行)
|
async: true, //异步请求(同步请求将会锁住浏览器,用户其他操作必须等待请求完成才可以执行)
|
||||||
|
@ -181,39 +173,58 @@
|
||||||
dataType: "json", //返回数据形式为json
|
dataType: "json", //返回数据形式为json
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
//请求成功时执行该函数内容,data即为服务器返回的json对象
|
//请求成功时执行该函数内容,data即为服务器返回的json对象
|
||||||
console.log(data)
|
|
||||||
if (data) {
|
if (data.data.traintypelist!= null) {
|
||||||
gcChart.hideLoading(); //隐藏加载动画
|
|
||||||
gcChart.setOption({
|
|
||||||
|
pxChart.setOption({
|
||||||
|
title: {
|
||||||
|
text: '培训类型',
|
||||||
|
subtext: '数量',
|
||||||
|
x: 'center'
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item',
|
||||||
|
formatter: "{a} <br/>{b} : {c} ({d}%)"
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
show: true,
|
||||||
|
feature: {
|
||||||
|
mark: { show: true },
|
||||||
|
dataView: { show: true, readOnly: false },
|
||||||
|
restore: { show: true },
|
||||||
|
saveAsImage: { show: true }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
calculable: true,
|
||||||
legend: {
|
legend: {
|
||||||
orient: 'vertical',
|
orient: 'vertical',
|
||||||
left: 'left',
|
left: 'right',
|
||||||
data: ['日常培训', '相关方培训', '在岗人员培训'] },
|
y: 'bottom',
|
||||||
series: [{
|
data: data.data.traintypelist.name
|
||||||
name: '培训类型',
|
},
|
||||||
type: 'pie',
|
series: [
|
||||||
radius: '55%',
|
{
|
||||||
center: ['50%', '60%'],
|
name: '培训类型',
|
||||||
data: [
|
type: 'pie',
|
||||||
{ value: data.daily, name: '日常培训' },
|
radius: '55%',
|
||||||
{ value: data.related, name: '相关方培训' },
|
center: ['50%', '60%'],
|
||||||
{ value: data.jobuser, name: '在岗人员培训' }
|
data: data.data.traintypelist ,
|
||||||
],
|
itemStyle: {
|
||||||
itemStyle: {
|
emphasis: {
|
||||||
emphasis: {
|
shadowBlur: 10,
|
||||||
shadowBlur: 10,
|
shadowOffsetX: 0,
|
||||||
shadowOffsetX: 0,
|
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}]
|
]
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (errorMsg) {
|
error: function (errorMsg) {
|
||||||
gcChart.hideLoading();
|
pxChart.hideLoading();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -224,7 +235,29 @@
|
||||||
function funTypeChange2() {
|
function funTypeChange2() {
|
||||||
trainstatistical();//
|
trainstatistical();//
|
||||||
}
|
}
|
||||||
|
function fxrpmsearch() {
|
||||||
|
var querydata = $('#fxrpms').serializeJSON();
|
||||||
|
$('#fxrpmtable').datagrid('load', querydata);
|
||||||
|
}
|
||||||
|
function fxrpmexport() {
|
||||||
|
var data = $('#fxrpmtable').datagrid('getData');
|
||||||
|
var datalist = data.rows;
|
||||||
|
|
||||||
|
|
||||||
|
for (var j = 0, len = datalist.length; j < len; j++) {
|
||||||
|
var dic = datalist[j]
|
||||||
|
for (var key in dic) {
|
||||||
|
dic["姓名"] = dic["participant__name"]
|
||||||
|
dic["用户名"] = dic["participant__username"]
|
||||||
|
dic["培训次数"] = dic["count"]
|
||||||
|
delete dic["participant__name"];
|
||||||
|
delete dic["participant__username"]
|
||||||
|
delete dic["count"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
JSONToCSVConvertor(JSON.stringify(datalist), "培训次数", true);
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
@ -266,15 +299,24 @@
|
||||||
<table name="" id="fxrpmtable" class='easyui-datagrid' title="培训次数" data-options="rownumbers:true,singleSelect:true,striped: true,method:'get',url: 'api/trainfg?a=trainuser',toolbar:'#fxrpmbar'" style="height:400px">
|
<table name="" id="fxrpmtable" class='easyui-datagrid' title="培训次数" data-options="rownumbers:true,singleSelect:true,striped: true,method:'get',url: 'api/trainfg?a=trainuser',toolbar:'#fxrpmbar'" style="height:400px">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th data-options="field:'participant__name',align:'right'" width="35%">姓名</th>
|
||||||
<th data-options="field:'participant__username',align:'right'" width="30%">姓名</th>
|
<th data-options="field:'participant__username',align:'right'" width="30%">用户名</th>
|
||||||
<th data-options="field:'count',align:'right'" width="35%">培训次数</th>
|
<th data-options="field:'count',align:'right'" width="35%">培训次数</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
|
<div id='fxrpmbar'>
|
||||||
|
<form id="fxrpms">
|
||||||
|
|
||||||
|
<div>
|
||||||
</div>
|
<label>发现部门</label><input id="sfxbm2" name="fxbm" style="width:180px;height:22px" />
|
||||||
|
<a onclick="fxrpmsearch()" class='easyui-linkbutton' iconCls='fa-search' plain=true>查询</a>
|
||||||
|
<a onclick="fxrpmexport()" class='easyui-linkbutton' iconCls='fa-upload' plain=true>导出</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -6079,20 +6079,27 @@ def trainfg(req):
|
||||||
teamlevel.append(a.filter(trainlevel__dicid=7).count())
|
teamlevel.append(a.filter(trainlevel__dicid=7).count())
|
||||||
departmentlevel.append(a.filter(trainlevel__dicid=42).count())
|
departmentlevel.append(a.filter(trainlevel__dicid=42).count())
|
||||||
return JsonResponse({'code':1,'companylevel':companylevel,'workshoplevel':workshoplevel,'teamlevel':teamlevel,'departmentlevel':departmentlevel})
|
return JsonResponse({'code':1,'companylevel':companylevel,'workshoplevel':workshoplevel,'teamlevel':teamlevel,'departmentlevel':departmentlevel})
|
||||||
|
elif a=='trainuser':
|
||||||
|
a = Trainuser.objects.filter(participant__usecomp__partid=companyid)
|
||||||
|
|
||||||
|
if req.GET.get('fxbm'):
|
||||||
|
fxbm = req.GET.get('fxbm')
|
||||||
|
parts = Partment.objects.filter(partlink__contains=',' + fxbm + ',')|Partment.objects.filter(partid=fxbm)
|
||||||
|
a = a.filter(participant__ubelongpart__in=parts)
|
||||||
|
total = a.count()
|
||||||
|
objs = a.values('participant__name','participant__username').annotate(count=Count('participant__userid'))
|
||||||
|
return HttpResponse(transjson(total,objs),content_type="application/json")
|
||||||
elif a=='traintype':
|
elif a=='traintype':
|
||||||
year = int(req.GET.get('year'))
|
year = int(req.GET.get('year'))
|
||||||
month = int(req.GET.get('month'))
|
month = int(req.GET.get('month'))
|
||||||
daily=[]#日常培训
|
traintypelist=[]
|
||||||
related=[]#相关方培训
|
|
||||||
jobuser=[]#在岗人员培训
|
|
||||||
first_day,first_day_of_next_month = gettime(datetime(year,month,1))
|
first_day,first_day_of_next_month = gettime(datetime(year,month,1))
|
||||||
a = Train.objects.filter(usecomp__partid=companyid,deletemark=1,starttime__range=(first_day, first_day_of_next_month))
|
a = Train.objects.filter(usecomp__partid=companyid,deletemark=1,starttime__range=(first_day, first_day_of_next_month))
|
||||||
daily.append(a.filter(traintype__dickeyid=1).count())
|
for i in Dickey.objects.filter(dicparent_id=8):
|
||||||
related.append(a.filter(traintype__dickeyid=108).count())
|
count=a.filter(traintype__dickeyid=i.dickeyid).count()
|
||||||
jobuser.append(a.filter(traintype__dickeyid=107).count())
|
dickeyname=i.dickeyname
|
||||||
return JsonResponse({'code':1,'daily':daily,'related':related,'jobuser':jobuser})
|
traintypelist.append({'value':count,'name':dickeyname})
|
||||||
elif a=='trainuser':
|
return HttpResponse(json.dumps({'code':1,'data':{'traintypelist':list(traintypelist)}}), content_type='application/json')
|
||||||
a = Trainuser.objects.filter(participant__userid=userid)
|
|
||||||
total = a.count()
|
|
||||||
objs = a.annotate(count=Count('participant')).values('participant__username','count')
|
|
||||||
return HttpResponse(transjson(total,objs),content_type="application/json")
|
|
||||||
|
|
Loading…
Reference in New Issue