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