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: else:
numsdict[num]=name numsdict[num]=name
i = i+1 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> required=true>
</div> </div>
<div id="filediv" style="margin-bottom:5px;display:none"> <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"> <span id='ps' style="display:none">
<input type="button" onclick="cancleUploadFile()" value="取消" /> <input type="button" onclick="cancleUploadFile()" value="取消" />
<progress id="progressBar" value="0" max="100" style="width: 100px;"></progress> <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'"> <input id="examtest" name="examtest" class="easyui-combobox" style="width:480px;" editable=false data-options="label:'关联考试',url:'api/examtest?a=listtrain'">
</div> </div>
<div id='filediv' style="margin-bottom:5px;"> <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"> <span id='ps' style="display:none">
<input type="button" onclick="cancleUploadFile()" value="取消" /> <input type="button" onclick="cancleUploadFile()" value="取消" />
<progress id="progressBar" value="0" max="100" style="width: 100px;"></progress> <progress id="progressBar" value="0" max="100" style="width: 100px;"></progress>

View File

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

View File

@ -60,16 +60,16 @@
<table class='detailtable'> <table class='detailtable'>
<thead> <thead>
<tr> <tr>
<th style="width:10%"> <th style="width:5%">
序号 序号
</th> </th>
<th style="width:20%"> <th style="width:15%">
姓名 姓名
</th> </th>
<th style="width:20%"> <th style="width:10%">
部门 部门
</th> </th>
<th style="width:15%"> <th style="width:10%">
状态 状态
</th> </th>
<th style="width:10%"> <th style="width:10%">
@ -81,6 +81,9 @@
<th style="width:15%"> <th style="width:15%">
答题详情 答题详情
</th> </th>
<th style="width:20%">
重新考试
</th>
</tr> </tr>
</thead> </thead>
{{each cjrydetail}} {{each cjrydetail}}
@ -95,7 +98,13 @@
{{/if}} {{/if}}
<td>{{$value.score}}</td> <td>{{$value.score}}</td>
<td>{{$value.took}}</td> <td>{{$value.took}}</td>
<td id="examdlid" style="display:none">{{$value.id}}</td>
<td><a target="_blank" href="/html/examhistory/{{$value.id}}">点击查看</a></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> </tr>
{{/each}} {{/each}}
</table> </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> </script>

View File

@ -29,7 +29,7 @@
</div> </div>
<div style="margin-top:10px;margin-bottom:5px"> <div style="margin-top:10px;margin-bottom:5px">
<label class='labeldiv'>附件</label> <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"> <span id='ps' style="display:none">
<input type="button" onclick="cancleUploadFile()" value="取消" /> <input type="button" onclick="cancleUploadFile()" value="取消" />
<progress id="progressBar" value="0" max="100" style="width: 100px;"></progress> <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) obj = ExamTestDetail.objects.filter(id=id)
data = obj.values('id','starttime','took','score','passcode','testdetail','examtest__name','user__headimgurl','user__name')[0] data = obj.values('id','starttime','took','score','passcode','testdetail','examtest__name','user__headimgurl','user__name')[0]
return JsonResponse(data) 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): def apitrain(req):
if req.GET.get('a')=='listjoin': if req.GET.get('a')=='listjoin':
userid = req.session['userid'] userid = req.session['userid']