This commit is contained in:
commit
62888f8b4c
|
@ -22,7 +22,7 @@ from django.core.serializers.json import DjangoJSONEncoder
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
import operator
|
import operator
|
||||||
import jwt
|
import jwt
|
||||||
from ..views import getcompany,fenye,transjson,upfile
|
from ..views import apicheck_login, getcompany,fenye,transjson,upfile
|
||||||
|
|
||||||
def index(req):
|
def index(req):
|
||||||
return render(req,'edulessonindex.html')
|
return render(req,'edulessonindex.html')
|
||||||
|
@ -63,6 +63,8 @@ def selectDate(req):
|
||||||
startnum,endnum=fenye(req)
|
startnum,endnum=fenye(req)
|
||||||
a = a.order_by('-submittime')[startnum:endnum].values('id','num','title','user__name','desciption','submittime','type','cate__name','url','downnum')
|
a = a.order_by('-submittime')[startnum:endnum].values('id','num','title','user__name','desciption','submittime','type','cate__name','url','downnum')
|
||||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
return HttpResponse(transjson(total,a),content_type="application/json")
|
||||||
|
|
||||||
|
@apicheck_login
|
||||||
def api(req):
|
def api(req):
|
||||||
a = req.GET.get('a')
|
a = req.GET.get('a')
|
||||||
#首页列表
|
#首页列表
|
||||||
|
|
|
@ -57,8 +57,15 @@
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
|
var searchStr = sessionStorage.getItem("observe");
|
||||||
var option = $('#main').attr('value')
|
var option = $('#main').attr('value')
|
||||||
$('#gctable').datagrid({ url: 'gchandle', queryParams: { a: option } });
|
var queryParams = {'a': option}
|
||||||
|
if(searchStr){
|
||||||
|
var lls = JSON.parse(searchStr)
|
||||||
|
queryParams = Object.assign(queryParams, lls)
|
||||||
|
sessionStorage.removeItem("observe")
|
||||||
|
}
|
||||||
|
$('#gctable').datagrid({ url: 'gchandle', queryParams: queryParams });
|
||||||
$("#searchgcff").form('clear');
|
$("#searchgcff").form('clear');
|
||||||
})
|
})
|
||||||
$("#sgcbm").combotree({
|
$("#sgcbm").combotree({
|
||||||
|
|
|
@ -42,6 +42,12 @@
|
||||||
<a href="javascript:void(0);" onclick="goDetail('trouble', 'zgr', 'qssj', 'jssj')" id="troublediv2">0</a>
|
<a href="javascript:void(0);" onclick="goDetail('trouble', 'zgr', 'qssj', 'jssj')" id="troublediv2">0</a>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>上报观察</th>
|
||||||
|
<th>
|
||||||
|
<a href="javascript:void(0);" onclick="goDetail('observe', 'gcr', 'qssj', 'jssj')" id="observediv1">0</a>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>参加培训</th>
|
<th>参加培训</th>
|
||||||
<th>
|
<th>
|
||||||
|
@ -163,7 +169,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var arrs = new Array("trouble", "train", "operation", "miss", "suggest", "test", "drill", "inspect", "cert")
|
var arrs = new Array("trouble", "train", "operation", "miss", "suggest", "test", "drill", "inspect", "cert", "observe")
|
||||||
var useridx = '{{ user.userid }}';
|
var useridx = '{{ user.userid }}';
|
||||||
var namex = '{{user.name}}'
|
var namex = '{{user.name}}'
|
||||||
$('#pname').html(namex)
|
$('#pname').html(namex)
|
||||||
|
@ -247,6 +253,9 @@
|
||||||
$('#certdiv1').html(res.aq_count)
|
$('#certdiv1').html(res.aq_count)
|
||||||
$('#certdiv2').html(res.tz_count)
|
$('#certdiv2').html(res.tz_count)
|
||||||
}
|
}
|
||||||
|
else if (data.type == 'observe') {
|
||||||
|
$('#observediv1').html(res.ob_count)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -269,7 +278,8 @@
|
||||||
'inspect': ['巡检记录', '/html/inspect'],
|
'inspect': ['巡检记录', '/html/inspect'],
|
||||||
'inspectitem': ['异常处理', '/html/inspectitem'],
|
'inspectitem': ['异常处理', '/html/inspectitem'],
|
||||||
'safecert':['安全资格证书', '/html/safecert'],
|
'safecert':['安全资格证书', '/html/safecert'],
|
||||||
'socert':['特种作业证书', '/socerthtml']
|
'socert':['特种作业证书', '/socerthtml'],
|
||||||
|
'observe':['行为观察', '/observehtml']
|
||||||
}
|
}
|
||||||
var myquerydata={}
|
var myquerydata={}
|
||||||
if(querydatax.startdate){
|
if(querydatax.startdate){
|
||||||
|
|
|
@ -3303,7 +3303,7 @@ def pxhandle(req):
|
||||||
str1 = []
|
str1 = []
|
||||||
for i in a.values('trainpart__partname'):
|
for i in a.values('trainpart__partname'):
|
||||||
str1.append(i['trainpart__partname'])
|
str1.append(i['trainpart__partname'])
|
||||||
x['trainpart'] = ','.join(str1)
|
x['trainpart'] = ','.join(str1) if str1 else ''
|
||||||
str2 = []
|
str2 = []
|
||||||
objs = Trainuser.objects.filter(train=a[0])
|
objs = Trainuser.objects.filter(train=a[0])
|
||||||
detailobjs = objs.order_by('checked').values(
|
detailobjs = objs.order_by('checked').values(
|
||||||
|
@ -3541,9 +3541,20 @@ def gchandle(req):
|
||||||
yjjs_gc.delay(companyid)
|
yjjs_gc.delay(companyid)
|
||||||
return JsonResponse({"code": 1})
|
return JsonResponse({"code": 1})
|
||||||
elif a == 'listall':
|
elif a == 'listall':
|
||||||
startnum, endnum = fenye(req)
|
|
||||||
a = Observe.objects.filter(usecomp=Partment.objects.get(
|
a = Observe.objects.filter(usecomp=Partment.objects.get(
|
||||||
partid=companyid), deletemark=1).order_by('-looktime')
|
partid=companyid), deletemark=1).order_by('-looktime')
|
||||||
|
if req.GET.get('gcr'):
|
||||||
|
a = a.filter(looker__userid=req.GET.get('gcr'))
|
||||||
|
if req.GET.get('gcbm'):
|
||||||
|
parts = Partment.objects.filter(partlink__contains=','+req.GET.get(
|
||||||
|
'gcbm')+',') | Partment.objects.filter(partid=req.GET.get('gcbm'))
|
||||||
|
a = a.filter(lookpart__in=parts)
|
||||||
|
if req.GET.get('qssj'):
|
||||||
|
a = a.filter(looktime__gte=req.GET.get('qssj'))
|
||||||
|
if req.GET.get('jssj'):
|
||||||
|
a = a.filter(looktime__lte=req.GET.get('jssj'))
|
||||||
|
total = a.count()
|
||||||
|
startnum, endnum = fenye(req)
|
||||||
total = a.count()
|
total = a.count()
|
||||||
a = a[startnum:endnum].values('lookid', 'looknum', 'lookplace',
|
a = a[startnum:endnum].values('lookid', 'looknum', 'lookplace',
|
||||||
'actname', 'looktime', 'looker__name', 'lookeder', 'otherunsafe')
|
'actname', 'looktime', 'looker__name', 'lookeder', 'otherunsafe')
|
||||||
|
@ -8826,6 +8837,7 @@ def getprodata(req):
|
||||||
total = a.count()
|
total = a.count()
|
||||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
return HttpResponse(transjson(total,a),content_type="application/json")
|
||||||
|
|
||||||
|
@apicheck_login
|
||||||
def checkprojects(req):
|
def checkprojects(req):
|
||||||
a = req.GET.get('a')
|
a = req.GET.get('a')
|
||||||
userid = req.session['userid']
|
userid = req.session['userid']
|
||||||
|
|
|
@ -123,4 +123,15 @@ def apicountsafe(req):
|
||||||
ret['tzcq_count'] = objs1.filter(user__userid=userid, zszt=3).count()
|
ret['tzcq_count'] = objs1.filter(user__userid=userid, zszt=3).count()
|
||||||
ret['aq_count'] = objs2.filter(user__userid=userid).count()
|
ret['aq_count'] = objs2.filter(user__userid=userid).count()
|
||||||
ret['aqcq_count'] = objs2.filter(user__userid=userid, zszt=3).count()
|
ret['aqcq_count'] = objs2.filter(user__userid=userid, zszt=3).count()
|
||||||
|
return JsonResponse(ret)
|
||||||
|
elif type == 'observe':
|
||||||
|
objs = Observe.objects.all()
|
||||||
|
if startdate:
|
||||||
|
objs = objs.filter(looktime__gte=startdate)
|
||||||
|
if enddate:
|
||||||
|
objs = objs.filter(looktime__lte=enddate)
|
||||||
|
if dept:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
ret['ob_count'] = objs.filter(looker__userid=userid).count()
|
||||||
return JsonResponse(ret)
|
return JsonResponse(ret)
|
Loading…
Reference in New Issue