修改bug

This commit is contained in:
Vce 2024-05-24 00:27:16 +08:00
parent 210b0cacc8
commit 495c94ef51
2 changed files with 27 additions and 7 deletions

View File

@ -830,9 +830,11 @@ export default {
submitBtn() { submitBtn() {
console.log(this.compulsoryList) console.log(this.compulsoryList)
console.log(this.examForm,111333)
this.$refs.examForm.validate((valid) => { this.$refs.examForm.validate((valid) => {
if (valid) { if (valid) {
let examInfo = { if (this.title == '新增考试') {
let examInfo = {
checkQuestionType:this.examForm.checkQuestionType, checkQuestionType:this.examForm.checkQuestionType,
name:this.examForm.name, name:this.examForm.name,
duration:this.examForm.duration, duration:this.examForm.duration,
@ -840,7 +842,7 @@ export default {
projectSn:this.$store.state.projectSn, projectSn:this.$store.state.projectSn,
subjectId:this.examForm.subjectId, subjectId:this.examForm.subjectId,
remark:this.examForm.remark, remark:this.examForm.remark,
questions:this.examForm.checkQuestionType == 1 ? this.examForm.questions.map(item => item.id).join(',') : this.randomQuestionList.map(item => item.id).join(','), questions: this.examForm.checkQuestionType == 1 ? this.examForm.questions.map(item => item.id).join(',') : this.randomQuestionList.map(item => item.id).join(','),
examRecordList:this.compulsoryList.map(item => { examRecordList:this.compulsoryList.map(item => {
return { return {
id:item.id, id:item.id,
@ -848,15 +850,33 @@ export default {
}), }),
radio:this.examForm.checkQuestionType == 1 ? this.examForm.questions.filter(item => item.type == 1).length : this.randomQuestion.examSingle.count, radio:this.examForm.checkQuestionType == 1 ? this.examForm.questions.filter(item => item.type == 1).length : this.randomQuestion.examSingle.count,
multi:this.examForm.checkQuestionType == 1 ? this.examForm.questions.filter(item => item.type == 2).length : this.randomQuestion.examMultiple.count, multi:this.examForm.checkQuestionType == 1 ? this.examForm.questions.filter(item => item.type == 2).length : this.randomQuestion.examMultiple.count,
} }
// examInfo.questions = this.examForm.checkQuestionType == 1 ? this.examForm.questions.map(item => item.id).join(',') : this.randomQuestionList.map(item => item.id).join(','),
if (this.title == '新增考试') {
addPaperApi(examInfo).then((res) => { addPaperApi(examInfo).then((res) => {
this.$message.success('新增成功') this.$message.success('新增成功')
this.handleClose() this.handleClose()
this.getRecordList() this.getRecordList()
}) })
} else { } else {
this.examForm.questions = this.$refs.questionListTable.selection;
let examInfo = {
checkQuestionType:this.examForm.checkQuestionType,
name:this.examForm.name,
duration:this.examForm.duration,
passLine:this.examForm.passLine,
projectSn:this.$store.state.projectSn,
subjectId:this.examForm.subjectId,
remark:this.examForm.remark,
questions: this.examForm.checkQuestionType == 1 ? this.examForm.questions.map(item => item.id).join(',') : this.randomQuestionList.map(item => item.id).join(','),
examRecordList:this.compulsoryList.map(item => {
return {
id:item.id,
}
}),
radio:this.examForm.checkQuestionType == 1 ? this.examForm.questions.filter(item => item.type == 1).length : this.randomQuestion.examSingle.count,
multi:this.examForm.checkQuestionType == 1 ? this.examForm.questions.filter(item => item.type == 2).length : this.randomQuestion.examMultiple.count,
}
// examInfo.questions = this.examForm.checkQuestionType == 1 ? this.examForm.questions.map(item => item.id).join(',') : this.randomQuestionList.map(item => item.id).join(','),
examInfo.id = this.examForm.id examInfo.id = this.examForm.id
editPaperApi(examInfo).then((res) => { editPaperApi(examInfo).then((res) => {
if(res.success){ if(res.success){

View File

@ -478,7 +478,8 @@ export default {
pageNo: this.worker.pageNo, pageNo: this.worker.pageNo,
// pageSize: this.worker.pageSize, // pageSize: this.worker.pageSize,
pageSize: 999999, pageSize: 999999,
presence: 1, // presence: 1,
inserviceType: 1,
departmentId:'', departmentId:'',
teamId:'', teamId:'',
} }
@ -488,7 +489,6 @@ export default {
} }
if(this.workerInfo.departmentAndTeam.gtMaterialDepartmentTeamType?this.workerInfo.departmentAndTeam.gtMaterialDepartmentTeamType === 2:false) { if(this.workerInfo.departmentAndTeam.gtMaterialDepartmentTeamType?this.workerInfo.departmentAndTeam.gtMaterialDepartmentTeamType === 2:false) {
data.teamId = this.workerInfo.departmentAndTeam?this.workerInfo.departmentAndTeam.gtMaterialDepartmentTeamId:'' data.teamId = this.workerInfo.departmentAndTeam?this.workerInfo.departmentAndTeam.gtMaterialDepartmentTeamId:''
} }
} }
await getWorkerInfoListApi(data).then((res) => { await getWorkerInfoListApi(data).then((res) => {