This commit is contained in:
commit
2d6f49e8c8
|
@ -76,8 +76,8 @@
|
|||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<select class="easyui-combobox" name="type" style="width:300px;" data-options="label:'类型'" required editable="false">
|
||||
<option value="1">职责</option>
|
||||
<option value="2">目标</option>
|
||||
<option value="1">责任清单</option>
|
||||
<option value="2">履职清单</option>
|
||||
</select>
|
||||
</div>
|
||||
<div style="text-align: center;">
|
||||
|
@ -133,8 +133,8 @@
|
|||
{ field: 'name', title: '名称', width: 150 },
|
||||
{ field: 'type', title: '类型', width: 80, formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case 1: return '职责'; break;
|
||||
case 2: return '目标'; break;
|
||||
case 1: return '责任清单'; break;
|
||||
case 2: return '履职清单'; break;
|
||||
}} },
|
||||
{ field: 'createtime', title: '创建时间', width: 100 },
|
||||
{ field: 'updatetime', title: '最近编辑时间', width: 100 }
|
||||
|
|
|
@ -8913,18 +8913,25 @@ def apioffence(req):
|
|||
objs = objs.filter(happentime__lte=req.GET.get('jssj'))
|
||||
total = objs.count()
|
||||
startnum, endnum = fenye(req)
|
||||
objs = objs.order_by('-createtime')[startnum:endnum].values('id', 'type', 'dept', 'area', 'parter', 'reporter', 'reporter__name', 'createtime', 'area__name', 'happentime', 'description')
|
||||
objs = objs.order_by('-createtime')[startnum:endnum].values('id', 'type', 'dept', 'area', 'parter', 'reporter', 'reporter__name', 'createtime', 'area__name', 'happentime', 'description', 'place')
|
||||
return HttpResponse(transjson(total, objs), content_type="application/json")
|
||||
elif a == 'add':
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
user = User.objects.get(userid=userid)
|
||||
if data.get('area', None):
|
||||
data['area'] = Area.objects.get(id=data['area'])
|
||||
data['reporter'] = user
|
||||
data['usecomp'] = user.usecomp
|
||||
instance = Offence()
|
||||
if 'area' in data and data['area']:
|
||||
instance.area = Area.objects.get(id=data['area'])
|
||||
instance.reporter = user
|
||||
instance.usecomp = user.usecomp
|
||||
if 'imgs' in data and data['imgs']:
|
||||
data['imgs'] = '?'.join(data['imgs'])
|
||||
instance = Offence(**data)
|
||||
instance.imgs = '?'.join(data['imgs'])
|
||||
instance.type = data['type']
|
||||
instance.dept = data['dept']
|
||||
instance.post = data['post']
|
||||
instance.place = data['place']
|
||||
instance.parter = data['parter']
|
||||
instance.description = data['description']
|
||||
instance.happentime = data['happentime']
|
||||
instance.save()
|
||||
return JsonResponse({"code":1})
|
||||
elif a == 'detail':
|
||||
|
@ -8933,6 +8940,8 @@ def apioffence(req):
|
|||
res = obj.values('id', 'type', 'dept', 'area', 'parter', 'reporter', 'reporter__name', 'createtime', 'area__name', 'happentime', 'description', 'imgs', 'post', 'place')[0]
|
||||
if res['imgs']:
|
||||
res['imgs'] = res['imgs'].split('?')
|
||||
else:
|
||||
res['imgs'] = []
|
||||
return HttpResponse(json.dumps(res, cls=MyEncoder), content_type="application/json")
|
||||
elif a == 'del':
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
|
@ -8947,8 +8956,8 @@ def apisafelist(req):
|
|||
userid = req.session['userid']
|
||||
companyid = getcompany(userid)
|
||||
if a == 'listall':
|
||||
objs = SafeList.objects.filter(usecomp__partid=companyid)
|
||||
# objs = SafeList.objects.filter(usecomp__partid=companyid)
|
||||
objs = SafeList.objects.all()
|
||||
if req.GET.get('search', None):
|
||||
objs = objs.filter(Q(user__name__contains=req.GET.get('search'))|Q(name__contains=req.GET.get('search')))
|
||||
total = objs.count()
|
||||
|
@ -9018,8 +9027,8 @@ def apisafeitem(req):
|
|||
userid = req.session['userid']
|
||||
companyid = getcompany(userid)
|
||||
if a == 'listall':
|
||||
# objs = SafeItem.objects.filter(safelist__usecomp__partid=companyid)
|
||||
objs = SafeItem.objects.all()
|
||||
objs = SafeItem.objects.filter(safelist__usecomp__partid=companyid)
|
||||
# objs = SafeItem.objects.all()
|
||||
if req.GET.get('safelist', None):
|
||||
objs = objs.filter(safelist = req.GET.get('safelist'))
|
||||
total = objs.count()
|
||||
|
|
Loading…
Reference in New Issue