抽题时出现重复

This commit is contained in:
caoqianming 2020-11-23 17:33:39 +08:00
parent 323d2eb222
commit e8f73c7847
3 changed files with 125 additions and 99 deletions

View File

@ -1,15 +1,18 @@
<div class="easyui-layout" style="width:100%;height:100%">
<div id='southdiv' data-options="region:'south'" style="width:100%;height:50px;text-align:center;padding:5px 0">
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="submitpass()" style="width:auto"
id="pass">提交</a>
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="submitreject()" style="width:auto"
id="reject">驳回</a>
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()" style="width:auto">取消</a>
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="submitpass()"
style="width:auto" id="pass">提交</a>
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="submitreject()"
style="width:auto" id="reject">驳回</a>
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()"
style="width:auto">取消</a>
</div>
<div data-options="region:'center'" style="width:100%;height:100%;padding:5px 15px;">
<div class='labeldiv'>流程信息</div>
<div><span id="0">待新增</span><span id="1">----->待评估</span><span id="7">----->整改措施/方案待提交</span><span id="2">----->整改措施/方案待确认</span></div>
<div><span id="3">----->待整改</span><span id="4">----->待审核</span><span id="5">----->待复查</span><span id="6">----->已归档</span></div>
<div><span id="0">待新增</span><span id="1">----->待评估</span><span id="7">----->整改措施/方案待提交</span><span
id="2">----->整改措施/方案待确认</span></div>
<div><span id="3">----->待整改</span><span id="4">----->待审核</span><span id="5">----->待复查</span><span
id="6">----->已归档</span></div>
<form id="accessff" method="post" enctype="multipart/form-data">
<input id="shresult" name="shresult" value="pass" style="display:none;" />
<div id="yhxq">
@ -21,8 +24,7 @@
method: 'get',
valueField:'value',
textField:'text',
"
required=true /></div>
" required=true /></div>
<div style="margin-bottom:5px">
<input editable="false" class="easyui-combobox" name="jclx" id="jclx" style="width:480px;"
data-options="
@ -30,18 +32,26 @@
method: 'get',
valueField:'value',
textField:'text',
"
required=true /></div>
" required=true /></div>
<div style="margin-bottom:5px">
<input id="fxsj" editable="false" type="text" name="fxsj" class="easyui-datetimebox" style="width:480px"
data-options="label:'发现时间',currentText:'今天',closeText:'关闭'" required=true></div>
<input id="fxsj" editable="false" type="text" name="fxsj" class="easyui-datetimebox"
style="width:480px" data-options="label:'发现时间',currentText:'今天',closeText:'关闭'" required=true>
</div>
<div style="margin-bottom:5px">
<input editable="false" name="yhqy" id="yhqy" style="width:480px" data-options="
label:'发现区域',
method: 'get',
valueField:'id',
textField:'name',
" />
</div>
<div style="margin-bottom:5px">
<input id="yhdd" class="easyui-textbox" name="yhdd" style="width:480px" data-options="label:'隐患地点'"
required=true>
</div>
<div style="margin-bottom:5px">
<input id="yhms" class="easyui-textbox" name="yhms" style="width:480px;height:60px" data-options="label:'隐患描述',multiline:true"
required=true>
<input id="yhms" class="easyui-textbox" name="yhms" style="width:480px;height:60px"
data-options="label:'隐患描述',multiline:true" required=true>
<!-- <a id="duibiao" class='easyui-linkbutton' onclick="duibiaoaccess()" style="width:auto" >对标</a> -->
</div>
@ -74,8 +84,7 @@
}
return s;
},
"
required=true /></div>
" required=true /></div>
<div style="margin-bottom:5px">
<input id="newr" name="newr" editable="false" class="easyui-textbox" style="width:480px"
data-options="label:'新评估人'" required=true>
@ -90,8 +99,7 @@
method: 'get',
valueField:'value',
textField:'text',
"
required=true />
" required=true />
</div>
<div style="margin-bottom:5px">
<input class="easyui-combobox" name="yhlx" id="yhlx" style="width:480px;" editable="false"
@ -101,8 +109,7 @@
valueField:'value',
textField:'text',
groupField:'group'
"
required=true /></div>
" required=true /></div>
<div style="margin-bottom:5px">
<input class="easyui-combobox" name="yhlb" id="yhlb" style="width:480px;" editable="false"
data-options="
@ -111,8 +118,7 @@
valueField:'value',
textField:'text',
groupField:'group'
"
required=true />
" required=true />
</div>
</div>
<div id="zpzgr">
@ -132,11 +138,10 @@
}
return s;
},
"
required=true /></div>
" required=true /></div>
<div style="margin-bottom:5px">
<input id="zgr" name="zgr" editable="false" class="easyui-textbox" style="width:480px" data-options="label:'整改人'"
required=true>
<input id="zgr" name="zgr" editable="false" class="easyui-textbox" style="width:480px"
data-options="label:'整改人'" required=true>
</div>
<input id="zgqx" editable="false" type="text" name="zgqx" class="easyui-datetimebox" style="width:480px"
data-options="label:'整改期限',currentText:'今天',closeText:'关闭'" required=true>
@ -144,20 +149,23 @@
<div id="fxcs">
<div id="fxcsh" class='labeldiv'>措施/方案</div>
<div style="margin-bottom:5px">
<input id="yyfx" class="easyui-textbox" name="yyfx" style="width:480px;height:60px" data-options="label:'原因分析',multiline:true,prompt:'如不填写将由整改人填写'" />
<input id="yyfx" class="easyui-textbox" name="yyfx" style="width:480px;height:60px"
data-options="label:'原因分析',multiline:true,prompt:'如不填写将由整改人填写'" />
</div>
<div style="margin-bottom:5px">
<input id="zgcs" class="easyui-textbox" name="zgcs" style="width:480px;height:60px" data-options="label:'整改措施',multiline:true,prompt:'如不填写将由整改人填写'" />
<input id="zgcs" class="easyui-textbox" name="zgcs" style="width:480px;height:60px"
data-options="label:'整改措施',multiline:true,prompt:'如不填写将由整改人填写'" />
</div>
</div>
<div id="zgxq">
<div class='labeldiv'>整改结果</div>
<div style="margin-bottom:5px">
<input id="zgms" class="easyui-textbox" name="zgms" style="width:480px;height:60px" data-options="label:'整改描述',multiline:true"
required=true></div>
<input id="zgms" class="easyui-textbox" name="zgms" style="width:480px;height:60px"
data-options="label:'整改描述',multiline:true" required=true></div>
<div style="margin-bottom:5px">
<input type="hidden" name="zghtp" id="zghtp" />
<label>整改后图片</label><input type="file" id="file2" name="" accept="image/*" style="margin-left: 15px" />
<label>整改后图片</label><input type="file" id="file2" name="" accept="image/*"
style="margin-left: 15px" />
<span id='ps2' style="display:none">
<progress id="progressBar2" value="0" max="100" style="width: 100px;"></progress>
<span id="percentage2"></span><span id="time2"></span></span>
@ -166,15 +174,18 @@
</div>
<div id="shyjdiv">
<div id="shyjh" class='labeldiv'>审核信息</div>
<input id="shyj" class="easyui-textbox" name="shyj" style="width:480px;" value="" data-options="label:'审核意见'">
<input id="shyj" class="easyui-textbox" name="shyj" style="width:480px;" value=""
data-options="label:'审核意见'">
</div>
<div id="fcyjdiv">
<div id="fcyjh" class='labeldiv'>复查信息</div>
<input id="fcyj" class="easyui-textbox" name="fcyj" style="width:480px;" value="" data-options="label:'审核意见'">
<input id="fcyj" class="easyui-textbox" name="fcyj" style="width:480px;" value=""
data-options="label:'审核意见'">
</div>
<div id="pgyjdiv" style="display:none">
<div id="pgyjh" class='labeldiv'>退回原因</div>
<input id="pgyj" class="easyui-textbox" name="pgyj" style="width:480px;" value="" data-options="label:'退回原因'">
<input id="pgyj" class="easyui-textbox" name="pgyj" style="width:480px;" value=""
data-options="label:'退回原因'">
</div>
</form>
</div>
@ -200,6 +211,8 @@
$("#zgms").textbox('setValue', data.zgms);
$("#yyfx").textbox('setValue', data.yyfx);
$("#zgcs").textbox('setValue', data.zgcs);
console.log(data.yhqy__name)
// $("#yhqy").textbox('setValue', data.yhqy__name);
var yhtp = data.yhtp;
for (var i = 0; i < yhtp.length; i++) {
$("#addImage").append('<li ><img title="点击放大" style="display:block;" onclick="bigger(this)" class = "yhtpimg" width="120" height="120" filepath="' + yhtp[i] + '" src="http://' + window.location.host + '/' + yhtp[i] + '"/></li>');
@ -301,7 +314,8 @@
$("#yhms").textbox('disable');
$('#fcyjdiv,#file2,#zgxq,#shyjdiv,#csyj,#reject').hide(); $('#jxpg').show();
$("#yhpg").combobox({ url: 'getdickey?dicclass=19&a=combobox', });
$("#zgbm").combotree({ url: 'parthandle?a=tree3', onSelect: function (node) {
$("#zgbm").combotree({
url: 'parthandle?a=tree3', onSelect: function (node) {
$('#zgr').combobox({
url: 'getuser?partid=' + node.id + '&a=combobox',
editable: false,
@ -310,7 +324,8 @@
return row[opts.textField].indexOf(q) >= 0;//这里改成>=即可在任意地方匹配
},
});
} });
}
});
// if (data.yhpg__dickeyname != '' & data.yhpg__dickeyname != null) {
// $("#yhpg").combobox('setValue', data.yhpg__dickeyid).combobox('readonly');
// $("#yhlx").combobox({ url: 'getdicclass?dicid=15' }).combobox('setValue', data.yhlx__dicid).combobox('readonly');
@ -374,7 +389,8 @@
$("#pg,#zpzgr,#fxcs").hide(); $('#newpgr').show(); $("#newbm").combotree({ url: 'parthandle?a=tree', onSelect: function (node) { $('#newr').combobox({ url: '/getuser?partid=' + node.id + '&a=combobox', }); } });
} else {
$('#checkboxid2').removeAttr("disabled");
$("#pg,#zpzgr,#fxcs").show(); $('#newpgr').hide(); $("#yhpg,#yhlx,#yhlb").combobox('clear'); $("#zgr").textbox('clear'); $("#zgqx").datetimebox('clear'); }
$("#pg,#zpzgr,#fxcs").show(); $('#newpgr').hide(); $("#yhpg,#yhlx,#yhlb").combobox('clear'); $("#zgr").textbox('clear'); $("#zgqx").datetimebox('clear');
}
}
function shide2() {
if ($('#checkboxid2').prop('checked') == true) {

View File

@ -30,10 +30,19 @@
textField:'text',
" />
</div>
<div style="margin-bottom:5px">
<input id="fxsj" editable="false" type="text" name="fxsj" class="easyui-datetimebox" style="width:480px"
data-options="label:'发现时间',currentText:'今天',closeText:'关闭',showSeconds:false" required=true />
</div>
<div style="margin-bottom:5px">
<input editable="false" name="yhqy" id="yhqy" style="width:480px" data-options="
label:'发现区域',
method: 'get',
valueField:'id',
textField:'name',
" />
</div>
<div style="margin-bottom:5px">
<input id="yhdd" class="easyui-textbox" name="yhdd" style="width:480px" data-options="label:'隐患地点'"
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('<li ><img style="display:block;" onclick ="bigger(this)" class = "yhtpimg" width="120" height="120" filepath="' + yhtp[i] + '" src="http://' + window.location.host + '/' + yhtp[i] + '"/><button onclick="removep(this)" >删除</button></li>'); }

View File

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