Merge branch 'master' of 10.7.100.160:/job/safesite
This commit is contained in:
commit
d91c0681a7
|
@ -119,13 +119,17 @@ def api(req):
|
||||||
elif a == 'del':
|
elif a == 'del':
|
||||||
id =req.GET.get('id')
|
id =req.GET.get('id')
|
||||||
userid = req.session['userid']
|
userid = req.session['userid']
|
||||||
|
companyid = getcompany(userid)#公司ID
|
||||||
a = Edulesson.objects.get(id=id)
|
a = Edulesson.objects.get(id=id)
|
||||||
if User.objects.get(userid = userid).issuper == 1:
|
if a.usecomp==Partment.objects.get(partid=companyid):
|
||||||
a.deletemark=0
|
a.deletemark=0
|
||||||
a.save()
|
a.save()
|
||||||
return JsonResponse({"code":1})
|
return JsonResponse({"code":1})
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
return JsonResponse({"code":0})
|
return JsonResponse({"code":0})
|
||||||
|
|
||||||
#点击阅读
|
#点击阅读
|
||||||
elif a=='readnumber':
|
elif a=='readnumber':
|
||||||
id =req.GET.get('id')
|
id =req.GET.get('id')
|
||||||
|
|
|
@ -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')
|
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")
|
return HttpResponse(json.dumps(list(list_items)),content_type="application/json")
|
||||||
elif a == 'tree':
|
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")
|
return HttpResponse(json.dumps(list(list_items)),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'))
|
||||||
|
@ -129,7 +129,7 @@ def lawstype(req):
|
||||||
id = req.GET.get('id')
|
id = req.GET.get('id')
|
||||||
user = User.objects.get(userid=userid)
|
user = User.objects.get(userid=userid)
|
||||||
a = Regulations.objects.get(id=id)
|
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)
|
Regulations.objects.filter(id = id).update(deletemark=0)
|
||||||
return JsonResponse({"code":1})
|
return JsonResponse({"code":1})
|
||||||
else:
|
else:
|
||||||
|
@ -139,7 +139,7 @@ def lawstype(req):
|
||||||
elif a == 'canedit':
|
elif a == 'canedit':
|
||||||
id = req.GET.get('id')
|
id = req.GET.get('id')
|
||||||
a = Regulations.objects.get(id=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})
|
return JsonResponse({'code':1})
|
||||||
else:
|
else:
|
||||||
return JsonResponse({"code":0})
|
return JsonResponse({"code":0})
|
||||||
|
@ -169,7 +169,7 @@ def lawstype(req):
|
||||||
id =req.GET.get('id')
|
id =req.GET.get('id')
|
||||||
userid = req.session['userid']
|
userid = req.session['userid']
|
||||||
a = FileManage.objects.get(id=id)
|
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.deletemark=0
|
||||||
a.save()
|
a.save()
|
||||||
return JsonResponse({"code":1})
|
return JsonResponse({"code":1})
|
||||||
|
|
|
@ -120,7 +120,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>所属类别:</td>
|
<td>所属类别:</td>
|
||||||
<td>
|
<td>
|
||||||
<input id="cate" class="easyui-combotree" name="cate" style="width:480px" data-options="url:'api/questioncat?a=tree2',loadFilter: function (rows) {
|
<input id="cate" class="easyui-combotree" name="cate" style="width:480px" data-options="url:'api/questioncat?a=tree',loadFilter: function (rows) {
|
||||||
return convert(rows);
|
return convert(rows);
|
||||||
},">
|
},">
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -135,7 +135,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>所属类别:</td>
|
<td>所属类别:</td>
|
||||||
<td>
|
<td>
|
||||||
<input id="cate" class="easyui-combotree" name="cate" style="width:480px" data-options="url:'api/questioncat?a=tree2',loadFilter: function (rows) {
|
<input id="cate" class="easyui-combotree" name="cate" style="width:480px" data-options="url:'api/questioncat?a=tree',loadFilter: function (rows) {
|
||||||
return convert(rows);
|
return convert(rows);
|
||||||
},">
|
},">
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>法律法规名称:</td>
|
<td>法律法规名称:</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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>法律法规分类:</td>
|
<td>法律法规分类:</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);
|
return convert(rows);
|
||||||
},">
|
},">
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Reference in New Issue