This commit is contained in:
caoqianming 2019-12-05 21:06:30 +08:00
commit c1f9c9414d
7 changed files with 51 additions and 20 deletions

View File

@ -292,7 +292,10 @@ def drequipments(companyid,path):
else:
numsdict[num]=name
i = i+1
return numsdict
if numsdict:
return {'code':1,'msg':'全部导入成功!'}
else:
return {'code':2,'msg':'部分未导入成功!','info':numsdict}

View File

@ -90,7 +90,7 @@
required=true>
</div>
<div id="filediv" style="margin-bottom:5px;display:none">
<label>相关资料: </label><input type="file" id="file" name="" accept="image/*,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.zip" style="margin-left: 20px" />
<label>相关资料: </label><input type="file" id="file" name="" accept="image/*,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.zip,.pdf" style="margin-left: 20px" />
<span id='ps' style="display:none">
<input type="button" onclick="cancleUploadFile()" value="取消" />
<progress id="progressBar" value="0" max="100" style="width: 100px;"></progress>

View File

@ -70,7 +70,7 @@
<input id="examtest" name="examtest" class="easyui-combobox" style="width:480px;" editable=false data-options="label:'关联考试',url:'api/examtest?a=listtrain'">
</div>
<div id='filediv' style="margin-bottom:5px;">
<label>相关资料 </label><input type="file" id="file" name="" accept="image/*,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.zip" style="margin-left: 20px" />
<label>相关资料 </label><input type="file" id="file" name="" accept="image/*,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.zip,.pdf" style="margin-left: 20px" />
<span id='ps' style="display:none">
<input type="button" onclick="cancleUploadFile()" value="取消" />
<progress id="progressBar" value="0" max="100" style="width: 100px;"></progress>

View File

@ -311,23 +311,17 @@
var data = JSON.parse(evt.target.responseText);
removeLoading();
if (data.code == 1) {
$.messager.alert('提示', '上传成功!', 'info', function () {
$.messager.alert('提示', data.msg, 'info', function () {
$("#main").panel({ href: 'html/equipment', title: '设备设施' });
});
}
else if (data.code == 2) {
msg = ''
equipmentdict = data.equipmentdict
// for (var key in equipmentdict) {
// msg += key + ','
// }
msg += '部分因编号重复未成功上传!'
$.messager.alert('提示', msg, 'info', function () {
$.messager.alert('提示', data.msg+data.info, 'info', function () {
$("#main").panel({ href: 'html/equipment', title: '用户' });
});
}
else {
$.messager.alert('提示', '失败!文件内容有误');
$.messager.alert('提示', data.msg);
}
document.getElementById('drfile').value = '';

View File

@ -60,16 +60,16 @@
<table class='detailtable'>
<thead>
<tr>
<th style="width:10%">
<th style="width:5%">
序号
</th>
<th style="width:20%">
<th style="width:15%">
姓名
</th>
<th style="width:20%">
<th style="width:10%">
部门
</th>
<th style="width:15%">
<th style="width:10%">
状态
</th>
<th style="width:10%">
@ -81,6 +81,9 @@
<th style="width:15%">
答题详情
</th>
<th style="width:20%">
重新考试
</th>
</tr>
</thead>
{{each cjrydetail}}
@ -95,7 +98,13 @@
{{/if}}
<td>{{$value.score}}</td>
<td>{{$value.took}}</td>
<td><a target="_blank" href="/html/examhistory/{{$value.id}}" >点击查看</a></td>
<td id="examdlid" style="display:none">{{$value.id}}</td>
<td><a target="_blank" href="/html/examhistory/{{$value.id}}">点击查看</a></td>
{{if $value.passcode==0&&$value.ison==1&&state==1}}
<td><button style="background-color: #00ff5a;color: #004eff;" onclick="updateIson()">重新发布试卷</button></td>
{{else}}
<td><font color="green"></font></td>
{{/if}}
</tr>
{{/each}}
</table>
@ -187,6 +196,19 @@
}
});
}
function updateIson() {
var examdlid = document.getElementById("examdlid").innerHTML;
$.ajax({
type: "get",
url: "api/examtestdetail?a=updateison",
contentType: 'application/json; charset=utf-8',
data: { id: ksid, examdlid: examdlid},
success: function (data) {
alert(data.message);
}
});
}
</script>

View File

@ -29,7 +29,7 @@
</div>
<div style="margin-top:10px;margin-bottom:5px">
<label class='labeldiv'>附件</label>
<input type="file" id="file" name="" accept="image/*,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.zip" style="margin-left: 20px" />
<input type="file" id="file" name="" accept="image/*,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.zip,.pdf" style="margin-left: 20px" />
<span id='ps' style="display:none">
<input type="button" onclick="cancleUploadFile()" value="取消" />
<progress id="progressBar" value="0" max="100" style="width: 100px;"></progress>

View File

@ -5373,7 +5373,19 @@ def apiexamtestdetail(req):
obj = ExamTestDetail.objects.filter(id=id)
data = obj.values('id','starttime','took','score','passcode','testdetail','examtest__name','user__headimgurl','user__name')[0]
return JsonResponse(data)
elif a=='updateison':
id = req.GET.get('id')
examdlid = req.GET.get('examdlid')
user = User.objects.get(userid=userid)
a = ExamTest.objects.get(id=id)
if a.createuser==user:
objss = ExamTestDetail.objects.get(id=examdlid)
objss.ison=0
objss.testnum=objss.testnum+1
objss.save()
return JsonResponse({"code":1,"message":"发布成功!"})
else:
return JsonResponse({"code":2,"message":"您没有发布权限!"})
def apitrain(req):
if req.GET.get('a')=='listjoin':
userid = req.session['userid']