|
|
|
@ -43,7 +43,7 @@
|
|
|
|
|
|
|
|
|
|
<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-select v-model="form.course_name">
|
|
|
|
|
<el-select v-model="form.course_name" @change="selectChange">
|
|
|
|
|
<el-option v-for="item in courseOption" :key="item.uc_id" :label="item.name" :value="item.uc_id"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -73,18 +73,17 @@
|
|
|
|
|
<el-form-item label="备注" prop="remind"><el-input v-model="form.remind" placeholder="请输入备注"></el-input></el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer">
|
|
|
|
|
<el-button type="primary" @click="sendApply">填写申请时间段</el-button>
|
|
|
|
|
<el-button type="primary" @click="setTime">填写申请时间段</el-button>
|
|
|
|
|
<el-button @click="cancelAppy">取消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<!-- 表格:节数选择-->
|
|
|
|
|
<el-dialog :visible.sync="courseDialog" append-to-body :close-on-click-modal="false">
|
|
|
|
|
<el-dialog :visible.sync="courseDialog" append-to-body :close-on-click-modal="false" v-if="tableAlive" >
|
|
|
|
|
<tb_course :cClick="cellClick" :cStyle="cellStyle" table-label="点击相应的位置选取时间段" ref="times"></tb_course>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="cancelSetWeeks">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="setWeeks">确 定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
<div><p style="color: deeppink" v-html="tips"></p></div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<!-- checkbox:周次选择-->
|
|
|
|
|
<el-dialog :visible.sync="weekDialog" title="请选择周数" width="400px" :close-on-click-modal="false" >
|
|
|
|
@ -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.allWeeksValue.length;k++){
|
|
|
|
|
// console.log(this.allWeeksValue[k][2])
|
|
|
|
|
if (this.allWeeksValue[k][2]!==[]){
|
|
|
|
|
this.tips+='星期'+this.allWeeksValue[k][1]+'、第'+this.allWeeksValue[k][0]+'节、所选周数'+this.allWeeksValue[k][2]+";"+'</br>'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
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<this.allWeeksValue.length;k++){
|
|
|
|
|
if (this.allWeeksValue[k][2]!==[]){
|
|
|
|
|
this.tips='星期'+this.allWeeksValue[k][1]+'、第'+this.allWeeksValue[k][0]+'节、所选周数'+this.allWeeksValue[k][2]+';'+'</br>'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}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(()=>{
|
|
|
|
|