law
This commit is contained in:
parent
08d344c2b5
commit
cf8a235156
|
|
@ -75,7 +75,7 @@ def lawstype(req):
|
|||
list_items = (Regulations.objects.filter(usecomp__partid=companyid,deletemark=1)).annotate(parentId=F('parent__id'),name=F('typename')).values('id','parentId','name')
|
||||
return HttpResponse(json.dumps(list(list_items)),content_type="application/json")
|
||||
elif a == 'tree':
|
||||
list_items = (Regulations.objects.filter(usecomp__partid=1,deletemark=1)|Regulations.objects.filter(usecomp__partid=companyid,deletemark=1)).annotate(parentId=F('parent__id')).values('id','parentId','typename')
|
||||
list_items = (Regulations.objects.filter(usecomp__partid=1,deletemark=1)|Regulations.objects.filter(usecomp__partid=companyid,deletemark=1)).annotate(parentId=F('parent__id'),name=F('typename')).values('id','parentId','name')
|
||||
return HttpResponse(json.dumps(list(list_items)),content_type="application/json")
|
||||
elif a == 'add':
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
|
|
@ -129,7 +129,7 @@ def lawstype(req):
|
|||
id = req.GET.get('id')
|
||||
user = User.objects.get(userid=userid)
|
||||
a = Regulations.objects.get(id=id)
|
||||
if user.issuper==1 or a.usecomp.partid == companyid:
|
||||
if a.usecomp==Partment.objects.get(partid=companyid):
|
||||
Regulations.objects.filter(id = id).update(deletemark=0)
|
||||
return JsonResponse({"code":1})
|
||||
else:
|
||||
|
|
@ -139,7 +139,7 @@ def lawstype(req):
|
|||
elif a == 'canedit':
|
||||
id = req.GET.get('id')
|
||||
a = Regulations.objects.get(id=id)
|
||||
if a.usecomp == companyid or int(companyid)==1:
|
||||
if a.usecomp==Partment.objects.get(partid=companyid):
|
||||
return JsonResponse({'code':1})
|
||||
else:
|
||||
return JsonResponse({"code":0})
|
||||
|
|
@ -169,7 +169,7 @@ def lawstype(req):
|
|||
id =req.GET.get('id')
|
||||
userid = req.session['userid']
|
||||
a = FileManage.objects.get(id=id)
|
||||
if User.objects.get(userid = userid).issuper == 1:
|
||||
if a.usecomp==Partment.objects.get(partid=companyid):
|
||||
a.deletemark=0
|
||||
a.save()
|
||||
return JsonResponse({"code":1})
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@
|
|||
<tr>
|
||||
<td>法律法规名称:</td>
|
||||
<td>
|
||||
<input id="maragename" class="easyui-textbox" name="maragename" style="width:480px">
|
||||
<input id="maragename" class="easyui-textbox" name="maragename" readonly="readonly" style="width:480px">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
|
@ -113,7 +113,7 @@
|
|||
<tr>
|
||||
<td>法律法规分类:</td>
|
||||
<td>
|
||||
<input id="maragetype" class="easyui-combotree" name="maragetype" style="width:480px" data-options="url:'rlt/api/lawstype?a=tree2',loadFilter: function (rows) {
|
||||
<input id="maragetype" class="easyui-combotree" name="maragetype" style="width:480px" data-options="url:'rlt/api/lawstype?a=tree',loadFilter: function (rows) {
|
||||
return convert(rows);
|
||||
},">
|
||||
</td>
|
||||
|
|
|
|||
Loading…
Reference in New Issue