[feat][v]:对接选课接口

master
Romesum 5 years ago
parent b3b5343950
commit e23bb33b15

@ -42,8 +42,8 @@
<el-dialog title="请填写以下申请信息" :visible.sync="formDialog" :close-on-click-modal="false">
<el-form :model="form" :inline="true" label-width="100px" ref="courseForm">
<el-form-item label="课程名称" prop="course_name"
:rules="[{ required: true, message: '请选择课程', trigger: 'blur' }]">
<el-form-item label="课程名称" prop="ucId"
:rules="[{ required: true, message: '请选择课程', trigger: 'change' }]">
<el-select v-model="form.ucId" @change="selectChange">
<el-option v-for="item in courseOption" :key="item.ucId" :label="item.name"
:value="item.ucId"></el-option>
@ -171,16 +171,16 @@
resolve('打开了weekDialog')
}).then((res) => {
// console.log(this.$refs.weekSelection)
var position = this.form.position
var rowIndex = row.index
var columnIndex = column.index
var selectedWeeks = get('', {position, rowIndex, columnIndex}) //rowIndexcolumIndex:
selectedWeeks = [1, 2, 3]
this.$refs.weekSelection.disableList = selectedWeeks
this.$refs.weekSelection.singleVal = this.$refs.weekSelection.singleVal.filter(x => !selectedWeeks.includes(x))
this.$refs.weekSelection.doubleVal = this.$refs.weekSelection.doubleVal.filter(x => !selectedWeeks.includes(x))
this.$refs.weekSelection.allVal = this.$refs.weekSelection.allVal.filter(x => !selectedWeeks.includes(x))
console.log('aa', this.$refs.weekSelection.singleVal)
// var position = this.form.position
// var rowIndex = row.index
// var columnIndex = column.index
// var selectedWeeks = get('', {position, rowIndex, columnIndex}) //rowIndexcolumIndex:
// selectedWeeks = [1, 2, 3]
// this.$refs.weekSelection.disableList = selectedWeeks
// this.$refs.weekSelection.singleVal = this.$refs.weekSelection.singleVal.filter(x => !selectedWeeks.includes(x))
// this.$refs.weekSelection.doubleVal = this.$refs.weekSelection.doubleVal.filter(x => !selectedWeeks.includes(x))
// this.$refs.weekSelection.allVal = this.$refs.weekSelection.allVal.filter(x => !selectedWeeks.includes(x))
// console.log('aa', this.$refs.weekSelection.singleVal)
})
}
},
@ -209,12 +209,19 @@
let course = await get("lb/usercourse/findusercourse/" + uc_id)
this.form.class = course.classes
this.form.population = course.population
this.form.uc_id = uc_id
},
//
async addWeek() {
this.weekDialog = false
var targetValue = this.$refs.weekSelection.checkedValue
await showDialog("确认设置此时间段吗?", this)
const targetValue = this.$refs.weekSelection.checkedValue
this.form.weeks = targetValue
//
await showDialog("确认预约此时间段吗?", this)
await post('lb/labrecord/updateWeeks', this.form)
await showSuccess("预约成功,管理员正在审核",this)
this.form.weeks = []
if (targetValue.length !== 0) {
this.perTargetValue.textContent = '【' + targetValue + '】周'
this.aWeekValue.push(targetValue) //[rowIndex,column,targetValue]
@ -231,9 +238,6 @@
this.aWeekValue = []
this.$refs.weekSelection.checkedValue = [] //
// console.log(this.allWeeksValue)
//
await post('lb/labRecord/updateWeeks', this.form);
},
//
async cancelSelection() {
@ -253,28 +257,28 @@
this.weekDialog = false
},
//
async setWeeks() {
console.log(this.allWeeksValue)
await post('/lb_teacher_applyLab', {
weeks: this.allWeeksValue,
year: this.$refs.timeSelection.year,
semester: this.$refs.timeSelection.semester,
position: this.form.position,
name: this.form.name,
date: this.form.date,
nickname: this.form.nickname,
tel: this.form.tel,
course_name: this.form.course_name,
class: this.form.class,
population: this.form.population,
remind: this.form.remind
})
// this.form.schedule=this.allWeeksValue.toString()
this.courseDialog = false
// console.log(this.$refs.times)
this.tableAlive = false
},
// async setWeeks() {
// console.log(this.allWeeksValue)
// await post('/lb_teacher_applyLab', {
// weeks: this.allWeeksValue,
// year: this.$refs.timeSelection.year,
// semester: this.$refs.timeSelection.semester,
// position: this.form.position,
// name: this.form.name,
// date: this.form.date,
// nickname: this.form.nickname,
// tel: this.form.tel,
// course_name: this.form.course_name,
// class: this.form.class,
// population: this.form.population,
// remind: this.form.remind
// })
// // this.form.schedule=this.allWeeksValue.toString()
// this.courseDialog = false
// // console.log(this.$refs.times)
// this.tableAlive = false
//
// },
//
cancelSetWeeks: function () {
this.allWeeksValue = []
@ -286,14 +290,14 @@
},
setTime: function () {
this.tableAlive = true
alert('这里本来要验证的,为了方便查看表格,暂无设置,需要验证请把代码行注释解除掉')
this.courseDialog = true
// this.$refs.courseForm.validate(()=>{
// if (vailid){
// this.courseDialog=true
// }
// })
this.formDialog = false
// alert('便')
// this.courseDialog = true
this.$refs.courseForm.validate((valid)=>{
if (valid){
this.courseDialog=true
this.formDialog = false
}
})
},
cancelAppy: function () {
this.formDialog = false

Loading…
Cancel
Save