From b54cae64a6a57a9ec43e99bed427271dd436fa08 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 5 Nov 2019 16:31:02 +0800 Subject: [PATCH] zuoyelog --- groups/templates/groups/exam.html | 137 ------------------ groups/templates/groups/index.html | 178 ------------------------ groups/templates/groups/miss.html | 138 ------------------ groups/templates/groups/observe.html | 135 ------------------ groups/templates/groups/risk.html | 137 ------------------ groups/templates/groups/train.html | 139 ------------------ groups/templates/groups/troublepic.html | 132 ------------------ groups/views.py | 7 +- safesite/templates/zuoyepeizhi.html | 9 ++ safesite/views.py | 16 ++- 10 files changed, 25 insertions(+), 1003 deletions(-) diff --git a/groups/templates/groups/exam.html b/groups/templates/groups/exam.html index c67a62cb..c9a4ffc7 100644 --- a/groups/templates/groups/exam.html +++ b/groups/templates/groups/exam.html @@ -1,139 +1,3 @@ -<<<<<<< HEAD -{% extends "./base.html" %} - -{% block title %}隐患统计{% endblock %} - -{% block content %} -{% load static %} -
-

未遂事件统计

-
-
-
- 开始日期: - 结束日期: - - -
- -
-
- - - - - - - - - - - - {% endblock %} -======= {% extends "./base.html" %} {% block title %}在线考试统计{% endblock %} @@ -274,4 +138,3 @@ {% endblock %} ->>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345 diff --git a/groups/templates/groups/index.html b/groups/templates/groups/index.html index 8278b0a4..3bc6954a 100644 --- a/groups/templates/groups/index.html +++ b/groups/templates/groups/index.html @@ -1,180 +1,3 @@ -<<<<<<< HEAD -{% extends "./base.html" %} -{% block pagehead %} -

- 本月数据 - Month Data -

- -{% endblock %} -{% block content %} - -
-
- -
-
-

{{troublenum}}

- -

事故隐患

-
-
- -
- 更多分析 -
-
- -
- -
-
-

{{observenum}} - -

- -

行为观察

-
-
- -
- 更多分析 -
-
- -
- -
-
-

{{missnum}}

- -

未遂事件

-
-
- -
- 更多分析 -
-
- -
- -
-
-

{{trainnum}}

- -

教育培训

-
-
- -
- 更多分析 -
-
- -
- -
-
-

{{companynum}}

- -

下属公司数

-
-
- -
- 更多分析 -
-
-
- -
-
-

{{usernum}}

- -

下属员工总数

-
-
- -
- 更多分析 -
-
-
- - -
- -
-

- {{group.groupname}} -

-
-
-

公司分布

- -
- - -
-
- -
-
-
- - -
- -
- -
-
- -
- -
- -
- -
- - - -======= {% extends "./base.html" %} {% block pagehead %}

@@ -350,5 +173,4 @@ map.setCenter([x/num,y/num]) }) ->>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345 {% endblock %} \ No newline at end of file diff --git a/groups/templates/groups/miss.html b/groups/templates/groups/miss.html index 06a53758..df2dae57 100644 --- a/groups/templates/groups/miss.html +++ b/groups/templates/groups/miss.html @@ -1,140 +1,3 @@ -<<<<<<< HEAD -{% extends "./base.html" %} - -{% block title %}隐患统计{% endblock %} - -{% block content %} -{% load static %} -
-

未遂事件统计

-
-
-
- 开始日期: - 结束日期: - - -
- -
-
- - - - - - - - - - - - - {% endblock %} -======= {% extends "./base.html" %} {% block title %}未遂事件统计{% endblock %} @@ -276,4 +139,3 @@ {% endblock %} ->>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345 diff --git a/groups/templates/groups/observe.html b/groups/templates/groups/observe.html index bb9b8078..1d166545 100644 --- a/groups/templates/groups/observe.html +++ b/groups/templates/groups/observe.html @@ -1,137 +1,3 @@ -<<<<<<< HEAD -{% extends "./base.html" %} - -{% block title %}隐患统计{% endblock %} - -{% block content %} -{% load static %} -
-

行为统计

-
-
-
- 开始日期: - 结束日期: - - -
- -
-
- - - - - - - - - - - - {% endblock %} -======= {% extends "./base.html" %} {% block title %}行为统计{% endblock %} @@ -270,4 +136,3 @@ {% endblock %} ->>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345 diff --git a/groups/templates/groups/risk.html b/groups/templates/groups/risk.html index c20b48d7..68455ca4 100644 --- a/groups/templates/groups/risk.html +++ b/groups/templates/groups/risk.html @@ -1,139 +1,3 @@ -<<<<<<< HEAD -{% extends "./base.html" %} - -{% block title %}风险管控{% endblock %} - -{% block content %} -{% load static %} -
-

风险管控统计

-
-
-
- 开始日期: - 结束日期: - - -
- -
-
- - - - - - - - - - - - {% endblock %} -======= {% extends "./base.html" %} {% block title %}风险管控{% endblock %} @@ -309,4 +173,3 @@ {% endblock %} ->>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345 diff --git a/groups/templates/groups/train.html b/groups/templates/groups/train.html index 27ba7ef6..4bfc311e 100644 --- a/groups/templates/groups/train.html +++ b/groups/templates/groups/train.html @@ -1,141 +1,3 @@ -<<<<<<< HEAD -{% extends "./base.html" %} - -{% block title %}教育培训统计{% endblock %} - -{% block content %} -{% load static %} -
-

教育培训统计

-
-
-
- 开始日期: - 结束日期: - - - - - -
-
-
- - - - - - - - - - - {% endblock %} -======= {% extends "./base.html" %} {% block title %}教育培训统计{% endblock %} @@ -278,4 +140,3 @@ {% endblock %} ->>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345 diff --git a/groups/templates/groups/troublepic.html b/groups/templates/groups/troublepic.html index c481a4d6..27cc4816 100644 --- a/groups/templates/groups/troublepic.html +++ b/groups/templates/groups/troublepic.html @@ -1,134 +1,3 @@ -<<<<<<< HEAD -{% extends "./base.html" %} - -{% block title %}隐患统计{% endblock %} - -{% block content %} -{% load static %} -
-

隐患统计

-
-
-
- 开始日期: - 结束日期: - - -
- -
-
- - - - - - - - - - - - {% endblock %} -======= {% extends "./base.html" %} {% block title %}隐患统计{% endblock %} @@ -264,4 +133,3 @@ {% endblock %} ->>>>>>> 3bc970596107f51c6970b99f250cfccf1d7d4345 diff --git a/groups/views.py b/groups/views.py index 13879bbb..6bac2728 100644 --- a/groups/views.py +++ b/groups/views.py @@ -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') diff --git a/safesite/templates/zuoyepeizhi.html b/safesite/templates/zuoyepeizhi.html index e952e94a..3f1042a4 100644 --- a/safesite/templates/zuoyepeizhi.html +++ b/safesite/templates/zuoyepeizhi.html @@ -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') diff --git a/safesite/views.py b/safesite/views.py index 4d910170..ce2d47eb 100644 --- a/safesite/views.py +++ b/safesite/views.py @@ -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