diff --git a/safesite/templates/accesstrouble.html b/safesite/templates/accesstrouble.html
index 983b45b5..21a857b9 100644
--- a/safesite/templates/accesstrouble.html
+++ b/safesite/templates/accesstrouble.html
@@ -1,15 +1,18 @@
@@ -132,11 +138,10 @@
}
return s;
},
- "
- required=true />
+ " required=true />
@@ -179,6 +188,7 @@
}
});
$("#jclx").combobox({ url: 'getdickey?dicclass=14&a=combobox', });
+ $("#yhqy").combobox({ url: 'api/area?a=tree', });
$('#pg,#zghxq,#fxcs,#zpzgr').hide();
if (a == 'edityh') {
$.ajax({
@@ -192,6 +202,7 @@
$("#yhdd").textbox('setValue', data.yhdd);
$("#yhms").textbox('setValue', data.yhms);
$("#fxsj").datetimebox('setValue', data.fxsj);
+ $("#yhqy").combobox('setValue', data.yhqy__id);
if (data.yhtp != '') {
var yhtp = data.yhtp
for (var i = 0; i < yhtp.length; i++) { $("#addImage").append('

'); }
diff --git a/safesite/views.py b/safesite/views.py
index 8141b4f2..827c157b 100644
--- a/safesite/views.py
+++ b/safesite/views.py
@@ -1221,7 +1221,7 @@ def getyh(req):
userid = req.session['userid']
troubleid = req.GET.get('troubleid')
a = Trouble.objects.filter(troubleid=troubleid).values('sybzt', 'troubleid', 'fxr__userid', 'fxr__name', 'yhms', 'yhzt', 'fxsj', 'tbsj', 'yhlb__dickeyname', 'yhlb__dickeyid', 'todouser__name', 'yhpg__dickeyname', 'yhnum', 'yhdd', 'fxbm__partname', 'yhdj__dickeyname', 'yhdj__dickeyid', 'yhpg__dickeyname', 'yhpg__dickeyid', 'jclx__dickeyname', 'jclx__dickeyid', 'yhlx__dicname',
- 'yhlx__dicid', 'yyfx', 'zgcs', 'yhtp', 'zghtp', 'zgms', 'zgbm__partname', 'zgbm__partid', 'zgr__name', 'zgqx', 'fcr__ubelongpart__partname', 'fcr__name', 'shr__ubelongpart__partname', 'shr__name', 'pgr__ubelongpart__partname', 'pgr__name', 'zpr__ubelongpart__partname', 'zpr__name', 'csqrr__ubelongpart__partname', 'csqrr__name', 'shyj', 'fcyj', 'shresult', 'zgbm', 'zgr', 'pgyj')[0]
+ 'yhlx__dicid', 'yyfx', 'zgcs', 'yhtp', 'zghtp', 'zgms', 'zgbm__partname', 'zgbm__partid', 'zgr__name', 'zgqx', 'fcr__ubelongpart__partname', 'fcr__name', 'shr__ubelongpart__partname', 'shr__name', 'pgr__ubelongpart__partname', 'pgr__name', 'zpr__ubelongpart__partname', 'zpr__name', 'csqrr__ubelongpart__partname', 'csqrr__name', 'shyj', 'fcyj', 'shresult', 'zgbm', 'zgr', 'pgyj', 'yhqy__name', 'yhqy__id')[0]
# print(a['yhtp'])
if a['yhtp'] != '':
a['yhtp'] = a['yhtp'].split('?')
@@ -1893,7 +1893,7 @@ def troublehandle(req):
troubleid = req.GET.get('troubleid')
a = Trouble.objects.filter(troubleid=troubleid)
x = a.values('yhnum', 'fxr__name', 'yhms', 'yhzt', 'fxsj', 'tbsj', 'yhlb__dickeyname', 'yhpg__dickeyname', 'yhdd', 'fxbm__partname', 'yhdj__dickeyname', 'yhpg__dickeyname',
- 'jclx__dickeyname', 'yhlx__dicname', 'yyfx', 'zgcs', 'yhtp', 'zghtp', 'zgms', 'zgbm__partname', 'zgr__name', 'zgqx', 'yhqy__name')[0]
+ 'jclx__dickeyname', 'yhlx__dicname', 'yyfx', 'zgcs', 'yhtp', 'zghtp', 'zgms', 'zgbm__partname', 'zgr__name', 'zgqx', 'yhqy__name', 'yhqy__id')[0]
b = TroubleAccess.objects.filter(troubleid=a[0]).order_by(
'accesssj').values('clr__name', 'opinion', 'action', 'accesssj')
x['lcxq'] = list(b)
@@ -6270,8 +6270,7 @@ def apiexamtest(req):
objpaper.total = {'total': {'num': totalnum, 'score': totalscore}, 'dx': {
'num': dxnum, 'score': dxs}, 'duox': {'num': duoxnum, 'score': duoxs}, 'pd': {'num': pdnum, 'score': pds}}
objpaper.save()
- questionobjs = Question.objects.filter(
- questioncat__id__in=data['tmfls'])
+ questionobjs = Question.objects.filter(questioncat__id__in=data['tmfls'], deletemark=1)
if 'repeat' in data and data['repeat'] == 'no':
excludequestions = ExamTest.objects.filter(usecomps__contains=','+companyid +
',').exclude(nousecomps__contains=','+companyid+',').values_list('exampaper__question__id',flat=True).distinct()
@@ -6791,7 +6790,7 @@ def apiarea(req):
mapobj = Map.objects.filter(usecomp__partid=companyid, deletemark=1)
if mapobj.count() == 1:
objs = Area.objects.filter(belongmap=mapobj[0], deletemark=1).order_by(
- 'order').values('id', 'name')
+ 'order').annotate(parentId=F('parent__id')).values('id', 'parentId', 'name')
return HttpResponse(json.dumps(list(objs)), content_type="application/json")
elif a == 'add':
data = json.loads(req.body.decode('utf-8'))