From e23bb33b15fe4f660dfb8c176fe9d7f3b97d6b5e Mon Sep 17 00:00:00 2001 From: Romesum Date: Mon, 25 May 2020 15:25:51 +0800 Subject: [PATCH] =?UTF-8?q?[feat][v]:=E5=AF=B9=E6=8E=A5=E9=80=89=E8=AF=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- element-vue/src/pages/teacher/applyLab.vue | 98 +++++++++++----------- 1 file changed, 51 insertions(+), 47 deletions(-) diff --git a/element-vue/src/pages/teacher/applyLab.vue b/element-vue/src/pages/teacher/applyLab.vue index 47cddc1..ce3d107 100644 --- a/element-vue/src/pages/teacher/applyLab.vue +++ b/element-vue/src/pages/teacher/applyLab.vue @@ -42,8 +42,8 @@ - + @@ -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}) //发送给实验室的地址,rowIndex,columIndex返回该格子的周数信息:数组 - 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}) //发送给实验室的地址,rowIndex,columIndex返回该格子的周数信息:数组 + // 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