区域二维码

This commit is contained in:
caoqianming 2019-09-19 22:07:25 +08:00
parent d507d03418
commit 96459324d6
6 changed files with 46 additions and 10 deletions

View File

@ -8,7 +8,6 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('safesite', '0269_auto_20190919_1409'),
]
operations = [

View File

@ -0,0 +1,14 @@
# Generated by Django 2.1.5 on 2019-09-19 14:23
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('safesite', '0267_auto_20190917_1543'),
('safesite', '0265_auto_20190917_1716'),
]
operations = [
]

View File

@ -0,0 +1,18 @@
# Generated by Django 2.1.5 on 2019-09-19 14:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('safesite', '0268_merge_20190919_1423'),
]
operations = [
migrations.AddField(
model_name='observe',
name='lookers',
field=models.ManyToManyField(related_name='gcrs', to='safesite.User'),
),
]

View File

@ -101,7 +101,7 @@
{ field: 'lookplace', title: '观察地点', width: 150 },
{ field: 'actname', title: '作业名称', width: 200 },
{ field: 'looktime', title: '观察时间', width: 200 },
{ field: 'looker__name', title: '观察人', width: 200 },
{ field: 'looker__name', title: '观察记录人', width: 200 },
{ field: 'lookeder', title: '被观察对象', width: 200 },
{ field: 'otherunsafe', title: '过程和交流记录', width: 300 },
]]

View File

@ -14,7 +14,10 @@
</tr>
<tr>
<td style="width:50%">所属部门:{{lookpart__partname}}</td>
<td style="width:50%">观察人:{{looker__name}}</td>
<td>观察人记录人:{{looker__name}}</td>
</tr>
<tr>
<td colspan="2">观察人员:{{lookers}}</td>
</tr>
<tr>
<td>开始时间:{{looktime| dateFormat 'yyyy-MM-dd hh:mm'}}</td>

View File

@ -2542,11 +2542,12 @@ def gchandle(req):
obj.usecomp = Partment.objects.get(partid=companyid)
if 'lookimg' in gcdata:
obj.lookimg = '?'.join(gcdata['lookimg'])
ulist=gcdata['lookers'].split(',')
for i in ulist:
x=User.objects.get(userid=i)
obj.lookers.add(x)
obj.save()
if 'lookers' in gcdata:
ulist=gcdata['lookers'].split(',')
for i in ulist:
x=User.objects.get(userid=i)
obj.lookers.add(x)
if 'unsafe' in gcdata:
olist = gcdata['unsafe']
for i in olist:
@ -2625,9 +2626,10 @@ def gchandle(req):
x['lookimg'] = x['lookimg'].split('?')
else:
x['lookimg']=[]
for key in x:
if x[key] == None:
x[key] = ''
x['lookers']=[]
for i in a[0].lookers.all():
x['lookers'].append(i.name)
x['lookers']=','.join(x['lookers'])
Observeto.objects.get_or_create(observe=a[0], user=User.objects.get(userid=req.session['userid']),defaults={'read': 1})
return HttpResponse(json.dumps(x,cls=MyEncoder),content_type="application/json")
elif a == 'getdics':