个人安全数据
This commit is contained in:
parent
53297aff42
commit
63364b5794
|
@ -4,7 +4,7 @@
|
||||||
<label>查看</label>
|
<label>查看</label>
|
||||||
<input class="easyui-datebox" id="startdate" name="startdate" data-options="prompt:'起始日期'"></input>至
|
<input class="easyui-datebox" id="startdate" name="startdate" data-options="prompt:'起始日期'"></input>至
|
||||||
<input class="easyui-datebox" id="enddate" name="enddate" data-options="prompt:'结束日期'"></input>
|
<input class="easyui-datebox" id="enddate" name="enddate" data-options="prompt:'结束日期'"></input>
|
||||||
<input id="username" class="easyui-textbox" readonly>
|
<input id="username" class="easyui-textbox" readonly value="">
|
||||||
<input type="hidden" name="userid" id="userid" value="" />
|
<input type="hidden" name="userid" id="userid" value="" />
|
||||||
<a href="#" class="easyui-linkbutton" onclick="choseuser('user')">选择员工</a>
|
<a href="#" class="easyui-linkbutton" onclick="choseuser('user')">选择员工</a>
|
||||||
<a href="#" class="easyui-linkbutton" onclick="startSearch();"
|
<a href="#" class="easyui-linkbutton" onclick="startSearch();"
|
||||||
|
@ -18,9 +18,12 @@
|
||||||
<h3 style="font-size: 18px; width: 100%; text-align: center; margin-top: 10px;">个人安全数据统计</h3>
|
<h3 style="font-size: 18px; width: 100%; text-align: center; margin-top: 10px;">个人安全数据统计</h3>
|
||||||
<div style="text-align: right;" id="createdate"></div>
|
<div style="text-align: right;" id="createdate"></div>
|
||||||
<p style="text-indent: 40px; padding: 5px;">
|
<p style="text-indent: 40px; padding: 5px;">
|
||||||
感谢您为公司的安全生产付出的一份力,以下是您的安全数据清单。时间段为:
|
感谢您为公司的安全生产付出的一份力,以下是您的安全数据清单。
|
||||||
<span id="span_timerange"></span>
|
<span id="span_timerange"></span>
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
<div id="infodiv">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="troublediv">
|
<div id="troublediv">
|
||||||
|
|
||||||
|
@ -72,15 +75,21 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function startSearch(){
|
function startSearch(){
|
||||||
var querydata = $('#ff').serializeJSON()
|
var date = $('#ff').serializeJSON()
|
||||||
|
var name = $('#username').textbox('getValue')
|
||||||
|
if(name==""){
|
||||||
|
name = '{{ user.name }}';
|
||||||
|
}
|
||||||
|
$('#infodiv').html('<p>'+name+' '+ date.startdate + '-' + date.enddate +'</p>')
|
||||||
for(var i=0;i<arrs.length;i++){
|
for(var i=0;i<arrs.length;i++){
|
||||||
|
var querydata = $('#ff').serializeJSON()
|
||||||
querydata.type = arrs[i];
|
querydata.type = arrs[i];
|
||||||
beginsearch(querydata)
|
beginsearch(querydata)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
function ExportWord(e) {
|
function ExportWord(e) {
|
||||||
$("#exportdiv").wordExport();
|
$("#exportdiv").wordExport('个人安全数据');
|
||||||
}
|
}
|
||||||
function beginsearch(data) {
|
function beginsearch(data) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
|
@ -161,7 +161,8 @@ def upfile(req):
|
||||||
# html页面
|
# html页面
|
||||||
|
|
||||||
def personalphtml(req):
|
def personalphtml(req):
|
||||||
return render(req, 'personalp.html')
|
user = User.objects.get(userid=req.session['userid'])
|
||||||
|
return render(req, 'personalp.html', locals())
|
||||||
|
|
||||||
class EquipmentCheckFormUpdateView(TemplateView):
|
class EquipmentCheckFormUpdateView(TemplateView):
|
||||||
template_name='equipmentcheckformupdate.html'
|
template_name='equipmentcheckformupdate.html'
|
||||||
|
|
|
@ -10,9 +10,16 @@ def apicountsafe(req):
|
||||||
ret = {}
|
ret = {}
|
||||||
if req.GET.get('userid', None):
|
if req.GET.get('userid', None):
|
||||||
userid = req.GET.get('userid')
|
userid = req.GET.get('userid')
|
||||||
|
dept = req.GET.get('dept', None)
|
||||||
|
startdate = req.GET.get('startdate', None)
|
||||||
|
enddate = req.GET.get('enddate', None)
|
||||||
if type == 'trouble':
|
if type == 'trouble':
|
||||||
objs = Trouble.objects.filter(deletemark=1)
|
objs = Trouble.objects.filter(deletemark=1)
|
||||||
if req.GET.get('dept', None):
|
if startdate:
|
||||||
|
objs = objs.filter(fxsj__gte=startdate)
|
||||||
|
if enddate:
|
||||||
|
objs = objs.filter(fxsj__lte=enddate)
|
||||||
|
if dept:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
ret['fx_count'] = objs.filter(fxr__userid=userid).count()
|
ret['fx_count'] = objs.filter(fxr__userid=userid).count()
|
||||||
|
@ -20,7 +27,11 @@ def apicountsafe(req):
|
||||||
return JsonResponse(ret)
|
return JsonResponse(ret)
|
||||||
elif type == 'train':
|
elif type == 'train':
|
||||||
objs = Trainuser.objects.filter(train__deletemark=1)
|
objs = Trainuser.objects.filter(train__deletemark=1)
|
||||||
if req.GET.get('dept', None):
|
if startdate:
|
||||||
|
objs = objs.filter(train__starttime__gte=startdate)
|
||||||
|
if enddate:
|
||||||
|
objs = objs.filter(train__starttime__lte=enddate)
|
||||||
|
if dept:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
ret['px_count'] = objs.filter(participant__userid=userid).count()
|
ret['px_count'] = objs.filter(participant__userid=userid).count()
|
||||||
|
@ -28,7 +39,11 @@ def apicountsafe(req):
|
||||||
return JsonResponse(ret)
|
return JsonResponse(ret)
|
||||||
elif type == 'operation':
|
elif type == 'operation':
|
||||||
objs = Operation.objects.filter(deletemark=1)
|
objs = Operation.objects.filter(deletemark=1)
|
||||||
if req.GET.get('dept', None):
|
if startdate:
|
||||||
|
objs = objs.filter(kssj__gte=startdate)
|
||||||
|
if enddate:
|
||||||
|
objs = objs.filter(kssj__lte=enddate)
|
||||||
|
if dept:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
ret['zy_count'] = objs.filter(Q(zyry__userid=userid)|Q(zyfzr__userid=userid)).count()
|
ret['zy_count'] = objs.filter(Q(zyry__userid=userid)|Q(zyfzr__userid=userid)).count()
|
||||||
|
@ -36,14 +51,22 @@ def apicountsafe(req):
|
||||||
return JsonResponse(ret)
|
return JsonResponse(ret)
|
||||||
elif type == 'miss':
|
elif type == 'miss':
|
||||||
objs = Miss.objects.filter(deletemark=1)
|
objs = Miss.objects.filter(deletemark=1)
|
||||||
if req.GET.get('dept', None):
|
if startdate:
|
||||||
|
objs = objs.filter(submittime__gte=startdate)
|
||||||
|
if enddate:
|
||||||
|
objs = objs.filter(submittime__lte=enddate)
|
||||||
|
if dept:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
ret['ws_count'] = objs.filter(misser__userid=userid).count()
|
ret['ws_count'] = objs.filter(misser__userid=userid).count()
|
||||||
return JsonResponse(ret)
|
return JsonResponse(ret)
|
||||||
elif type == 'suggest':
|
elif type == 'suggest':
|
||||||
objs = Suggest.objects.all()
|
objs = Suggest.objects.all()
|
||||||
if req.GET.get('dept', None):
|
if startdate:
|
||||||
|
objs = objs.filter(submittime__gte=startdate)
|
||||||
|
if enddate:
|
||||||
|
objs = objs.filter(submittime__lte=enddate)
|
||||||
|
if dept:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
ret['jy_count'] = objs.filter(jyr__userid=userid, accept=1).count()
|
ret['jy_count'] = objs.filter(jyr__userid=userid, accept=1).count()
|
||||||
|
@ -51,7 +74,11 @@ def apicountsafe(req):
|
||||||
return JsonResponse(ret)
|
return JsonResponse(ret)
|
||||||
elif type == 'test':
|
elif type == 'test':
|
||||||
objs = ExamTestDetail.objects.exclude(examtest__nousecomps__contains=','+companyid+',')
|
objs = ExamTestDetail.objects.exclude(examtest__nousecomps__contains=','+companyid+',')
|
||||||
if req.GET.get('dept', None):
|
if startdate:
|
||||||
|
objs = objs.filter(starttime__gte=startdate)
|
||||||
|
if enddate:
|
||||||
|
objs = objs.filter(starttime__lte=enddate)
|
||||||
|
if dept:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
ret['ks_count'] = objs.filter(user__userid=userid).count()
|
ret['ks_count'] = objs.filter(user__userid=userid).count()
|
||||||
|
@ -59,24 +86,37 @@ def apicountsafe(req):
|
||||||
return JsonResponse(ret)
|
return JsonResponse(ret)
|
||||||
elif type == 'drill':
|
elif type == 'drill':
|
||||||
objs = Drill.objects.filter(deletemark=1)
|
objs = Drill.objects.filter(deletemark=1)
|
||||||
if req.GET.get('dept', None):
|
if startdate:
|
||||||
|
objs = objs.filter(starttime__gte=startdate)
|
||||||
|
if enddate:
|
||||||
|
objs = objs.filter(starttime__lte=enddate)
|
||||||
|
if dept:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
ret['yl_count'] = objs.filter(participant__userid=userid).count()
|
ret['yl_count'] = objs.filter(participant__userid=userid).count()
|
||||||
return JsonResponse(ret)
|
return JsonResponse(ret)
|
||||||
elif type == 'inspect':
|
elif type == 'inspect':
|
||||||
objs = Inspect.objects.all()
|
objs = Inspect.objects.all()
|
||||||
if req.GET.get('dept', None):
|
if startdate:
|
||||||
|
objs = objs.filter(creattime__gte=startdate)
|
||||||
|
if enddate:
|
||||||
|
objs = objs.filter(creattime__lte=enddate)
|
||||||
|
if dept:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
ret['xj_count'] = objs.filter(user__userid=userid).count()
|
ret['xj_count'] = objs.filter(user__userid=userid).count()
|
||||||
ret['xjyc_count'] = objs.filter(user__userid=userid, state=0).count()
|
ret['xjyc_count'] = objs.filter(user__userid=userid, state=0).count()
|
||||||
ret['clyc_count'] = InspectItem.objects.filter(todouser__userid=userid, state='异常已处理').count()
|
objs2 = InspectItem.objects.filter(state='异常已处理')
|
||||||
|
if startdate:
|
||||||
|
objs2 = objs2.filter(handletime__gte=startdate)
|
||||||
|
if enddate:
|
||||||
|
objs2 = objs2.filter(handletime__lte=enddate)
|
||||||
|
ret['clyc_count'] = objs2.filter(todouser__userid=userid).count()
|
||||||
return JsonResponse(ret)
|
return JsonResponse(ret)
|
||||||
elif type == 'cert':
|
elif type == 'cert':
|
||||||
objs1 = Socertificate.objects.all()
|
objs1 = Socertificate.objects.all()
|
||||||
objs2 = Safecert.objects.all()
|
objs2 = Safecert.objects.all()
|
||||||
if req.GET.get('dept', None):
|
if dept:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
ret['tz_count'] = objs1.filter(user__userid=userid).count()
|
ret['tz_count'] = objs1.filter(user__userid=userid).count()
|
||||||
|
|
Loading…
Reference in New Issue