Merge branch 'master' of 10.7.100.160:/job/safesite

This commit is contained in:
caoqianming 2019-09-19 22:08:10 +08:00
commit d91c0681a7
5 changed files with 13 additions and 9 deletions

View File

@ -119,13 +119,17 @@ def api(req):
elif a == 'del':
id =req.GET.get('id')
userid = req.session['userid']
companyid = getcompany(userid)#公司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.save()
return JsonResponse({"code":1})
else:
return JsonResponse({"code":0})
#点击阅读
elif a=='readnumber':
id =req.GET.get('id')

View File

@ -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})

View File

@ -120,7 +120,7 @@
<tr>
<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);
},">
</td>

View File

@ -135,7 +135,7 @@
<tr>
<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);
},">
</td>

View File

@ -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>