区域二维码
This commit is contained in:
parent
d507d03418
commit
96459324d6
|
@ -8,7 +8,6 @@ class Migration(migrations.Migration):
|
||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('safesite', '0269_auto_20190919_1409'),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -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 = [
|
||||||
|
]
|
|
@ -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'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -101,7 +101,7 @@
|
||||||
{ field: 'lookplace', title: '观察地点', width: 150 },
|
{ field: 'lookplace', title: '观察地点', width: 150 },
|
||||||
{ field: 'actname', title: '作业名称', width: 200 },
|
{ field: 'actname', title: '作业名称', width: 200 },
|
||||||
{ field: 'looktime', 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: 'lookeder', title: '被观察对象', width: 200 },
|
||||||
{ field: 'otherunsafe', title: '过程和交流记录', width: 300 },
|
{ field: 'otherunsafe', title: '过程和交流记录', width: 300 },
|
||||||
]]
|
]]
|
||||||
|
|
|
@ -14,7 +14,10 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width:50%">所属部门:{{lookpart__partname}}</td>
|
<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>
|
||||||
<tr>
|
<tr>
|
||||||
<td>开始时间:{{looktime| dateFormat 'yyyy-MM-dd hh:mm'}}</td>
|
<td>开始时间:{{looktime| dateFormat 'yyyy-MM-dd hh:mm'}}</td>
|
||||||
|
|
|
@ -2542,11 +2542,12 @@ def gchandle(req):
|
||||||
obj.usecomp = Partment.objects.get(partid=companyid)
|
obj.usecomp = Partment.objects.get(partid=companyid)
|
||||||
if 'lookimg' in gcdata:
|
if 'lookimg' in gcdata:
|
||||||
obj.lookimg = '?'.join(gcdata['lookimg'])
|
obj.lookimg = '?'.join(gcdata['lookimg'])
|
||||||
|
obj.save()
|
||||||
|
if 'lookers' in gcdata:
|
||||||
ulist=gcdata['lookers'].split(',')
|
ulist=gcdata['lookers'].split(',')
|
||||||
for i in ulist:
|
for i in ulist:
|
||||||
x=User.objects.get(userid=i)
|
x=User.objects.get(userid=i)
|
||||||
obj.lookers.add(x)
|
obj.lookers.add(x)
|
||||||
obj.save()
|
|
||||||
if 'unsafe' in gcdata:
|
if 'unsafe' in gcdata:
|
||||||
olist = gcdata['unsafe']
|
olist = gcdata['unsafe']
|
||||||
for i in olist:
|
for i in olist:
|
||||||
|
@ -2625,9 +2626,10 @@ def gchandle(req):
|
||||||
x['lookimg'] = x['lookimg'].split('?')
|
x['lookimg'] = x['lookimg'].split('?')
|
||||||
else:
|
else:
|
||||||
x['lookimg']=[]
|
x['lookimg']=[]
|
||||||
for key in x:
|
x['lookers']=[]
|
||||||
if x[key] == None:
|
for i in a[0].lookers.all():
|
||||||
x[key] = ''
|
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})
|
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")
|
return HttpResponse(json.dumps(x,cls=MyEncoder),content_type="application/json")
|
||||||
elif a == 'getdics':
|
elif a == 'getdics':
|
||||||
|
|
Loading…
Reference in New Issue