职业素养功能修改
This commit is contained in:
@@ -86,7 +86,7 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getHistoryTitle();
|
||||
this.getTitle();
|
||||
},
|
||||
methods: {
|
||||
// 返回
|
||||
@@ -114,16 +114,6 @@
|
||||
}
|
||||
this.pageIndex--
|
||||
},
|
||||
//获取答题记录
|
||||
getHistoryTitle(){
|
||||
api.getTestRecordProcessList(17).then(res => {
|
||||
if (res.Result === 1) {
|
||||
let data = res.Data;
|
||||
this.historyTitle = data;
|
||||
this.getTitle();
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取题目
|
||||
getTitle() {
|
||||
uni.showLoading({
|
||||
@@ -135,20 +125,7 @@
|
||||
let list = res.Data.List;
|
||||
list.forEach(item => {
|
||||
item.Value = 0;
|
||||
this.historyTitle.forEach(ritem=>{
|
||||
if(item.TitleId == ritem.TestTitleId){
|
||||
item.Value = Number(ritem.TestResult) + 1;
|
||||
}
|
||||
})
|
||||
})
|
||||
if(this.historyTitle.length == 0){
|
||||
this.pageIndex = 0;
|
||||
}else if(this.historyTitle.length == list.length){
|
||||
this.pageIndex = list.length - 1;
|
||||
}else {
|
||||
this.pageIndex = this.historyTitle.length;
|
||||
}
|
||||
|
||||
this.allNum = list.length;
|
||||
this.list = list;
|
||||
}
|
||||
@@ -165,28 +142,14 @@
|
||||
console.log('单击事件被触发');
|
||||
this.lastTapTime = now;
|
||||
this.list[INDEX].Value = NUM;
|
||||
//
|
||||
this.saveTestRecordProcess(this.list[INDEX].TitleId,NUM-1);
|
||||
|
||||
setTimeout(()=>{
|
||||
if(this.pageIndex != this.list.length - 1){
|
||||
this.pageIndex = INDEX + 1;
|
||||
|
||||
}
|
||||
},300)
|
||||
}
|
||||
},
|
||||
//存储答题记录
|
||||
saveTestRecordProcess(ID,VALUE){
|
||||
let data = {
|
||||
testType: 17,
|
||||
testTitleId: ID,
|
||||
testResult: VALUE
|
||||
}
|
||||
api.saveTestRecordProcess(data).then(res => {
|
||||
if (res.Result === 1) {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交题目
|
||||
submitTitle() {
|
||||
let testStr = "";
|
||||
@@ -217,9 +180,7 @@
|
||||
let data = {
|
||||
testStr
|
||||
}
|
||||
api.removeTestRecordProcess(17).then((res) => {
|
||||
return api.saveWorkValuesResult(data);
|
||||
}).then((res) => {
|
||||
api.saveWorkValuesResult(data).then((res) => {
|
||||
uni.hideLoading();
|
||||
if (res.Result === 1) {
|
||||
uni.showToast({
|
||||
@@ -231,7 +192,7 @@
|
||||
beforePage.data.refreshIfNeeded = true;
|
||||
setTimeout(()=>{
|
||||
uni.redirectTo({
|
||||
url: `/packageCa/testReport/workValuesTestReport?year=${res.Data.Year}`
|
||||
url: `/packageCa/testReport/workValuesTestReport`
|
||||
})
|
||||
},1000)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user