From 48a7b16e2caeaa0177bec545dcb1f92d9988763b Mon Sep 17 00:00:00 2001 From: aiyadc <565548447@qq.com> Date: Thu, 21 May 2020 17:24:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=94=B3=E8=AF=B7=E5=AE=9E?= =?UTF-8?q?=E9=AA=8C=E5=AE=A4=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/teacher/weekSelection.vue | 2 +- element-vue/src/pages/teacher/applyLab.vue | 62 ++++++++----------- 2 files changed, 28 insertions(+), 36 deletions(-) diff --git a/element-vue/src/components/teacher/weekSelection.vue b/element-vue/src/components/teacher/weekSelection.vue index f112bd3..0ab1183 100644 --- a/element-vue/src/components/teacher/weekSelection.vue +++ b/element-vue/src/components/teacher/weekSelection.vue @@ -55,7 +55,7 @@ // var weeks=[6,7,8] // for (let i=0;i - + @@ -73,18 +73,17 @@
- 填写申请时间段 + 填写申请时间段 取消
- + 取 消 确 定 -

@@ -117,6 +116,7 @@ user:{}, lab:{}, + tableAlive:false, //用于重载表格 tableData:[{}], checkOption :[], @@ -128,7 +128,6 @@ aWeekValue:[], allWeeksValue:[], - tips:"已添加时间段:", form:{ position:'', name:'', @@ -151,8 +150,6 @@ if (column.label!=''){ return 'cursor:pointer' } - //(待写)检索该实验室的申请情况,每个格子的周数未满则显示为绿色外框,满了则显示红色外框 - //思路大概是每个格子都定义一个属性——isFull,点击打开格子时,就会获取格子的信息,进行for循环,如果isFull,则格子显示为绿色,反之显示为红色。 }, //点击格子促发的函数 cellClick(row, column, cell, event) { @@ -173,7 +170,6 @@ // console.log(column.index) if (column.label!='') { - this.tips="" this.weekDialog=true this.perTargetValue=event.target //用target对表格进行定位并保存致target对象 } @@ -181,6 +177,18 @@ //点击表格操作栏申请按钮 clickLabApply(row){ this.lab=row + this.form={ + position:'', + name:'', + date: '', + nickname:'', + tel:'', + course_name:'', + class:'', + population:'', + schedule:'', + remind:'无' + } this.formDialog=true }, @@ -190,8 +198,8 @@ }, //当选择的课程发生改变触发此函数 selectChange(){ - - + console.log('aaaaaa') + var d=new Date() // this.form.position= this.lab.position //实验室地点 // this.form.name= this.lab.name //实验室名称 this.form.date=d.getFullYear()+'/'+(d.getMonth()+1)+'/'+d.getDate() //日期 @@ -217,14 +225,8 @@ } } } - for (let k=0;k' - } - } - } + } this.aWeekValue=[] this.$refs.weekSelection.checkedValue=[] //将周数选择器已选择选项置空 // console.log(this.allWeeksValue) @@ -239,17 +241,6 @@ } } this.aWeekValue=[] - //显示所选周数 - if(this.allWeeksValue.length!==0){ - for (let k=0;k' - } - } - }else { - this.tips='已添加周数:无' - } - this.perTargetValue.style.backgroundColor='' this.perTargetValue.textContent='' //此处再设置将allWeeksValue里边减去这个表格原本的内容,要怎么删去呢,思考一下。 @@ -259,13 +250,13 @@ this.weekDialog=false }, //确定所有已选择的周数 - setWeeks:function () { + async setWeeks () { console.log(this.allWeeksValue) - post('/lb_teacher_applyLab',{ + await post('/lb_teacher_applyLab',{ weeks:this.allWeeksValue, year:this.$refs.timeSelection.year, semester:this.$refs.timeSelection.semester, - position:this.from.position, + position:this.form.position, name:this.form.name, date: this.form.date, nickname:this.form.nickname, @@ -277,20 +268,21 @@ }) // this.form.schedule=this.allWeeksValue.toString() this.courseDialog=false - this.tips='已添加时间段' // console.log(this.$refs.times) - + this.tableAlive=false }, //取消所有已选择的周数 cancelSetWeeks:function () { this.allWeeksValue=[] this.form.schedule="" - this.tips='已添加时间段' this.courseDialog=false + this.formDialog=true console.log(this.allWeeksValue) + this.tableAlive=false //表格失活 }, - sendApply:function () { + setTime:function () { + this.tableAlive=true alert('这里本来要验证的,为了方便查看表格,暂无设置,需要验证请把代码行注释解除掉') this.courseDialog=true // this.$refs.courseForm.validate(()=>{