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

Loading…
Cancel
Save