common.js
1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var prefix = ctx==undefined?"":ctx+"api";
var prefixPc = ctx+"exam/answerForPc";
function goBack(type){
window.location.href = ctx+"exam/answerForPc?type="+type;
}
function updateStatusOne(type){
var id=$("#answerId").val();
if(id==''||id==undefined){
return;
}
var ids=id.split(",")
layer.confirm("请确认合格?",{
title:false,
btn:["合格","不合格"]
},function(){
var url = ctx + "exam/answerForPc/updateStatus";
var data = { "ids": ids,"status":1 };
$.ajax({
type: "post",
dataType: "json",
url:url,
data: data,
success:function(r) {
if (r.code == 200) {
goBack(type)
}
}
})
},function(){
var url = ctx + "exam/answerForPc/updateStatus";
var data = { "ids": ids,"status":2 };
$.ajax({
type: "post",
dataType: "json",
url:url,
data: data,
success:function(r) {
if (r.code == 200) {
goBack(type)
}
}
})
})
}