|
|
@ -77,14 +77,12 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
<!-- 表格:节数选择-->
|
|
|
|
<!-- 表格:节数选择-->
|
|
|
|
<el-dialog :title="form.position+' '+form.name" :visible.sync="courseDialog" append-to-body
|
|
|
|
<tb_course :cClick="cellClick" :cStyle="cellStyle" table-label="点击相应的位置选取时间段" ref="times"
|
|
|
|
:close-on-click-modal="false" v-if="tableAlive">
|
|
|
|
:custom="true"></tb_course>
|
|
|
|
<tb_course :cClick="cellClick" :cStyle="cellStyle" table-label="点击相应的位置选取时间段" ref="times"></tb_course>
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
<!-- checkbox:周次选择-->
|
|
|
|
<!-- checkbox:周次选择-->
|
|
|
|
<el-dialog :visible.sync="weekDialog" title="请选择周数" width="400px" :close-on-click-modal="false"
|
|
|
|
<el-dialog :visible.sync="weekDialog" title="请选择周数" width="400px" :close-on-click-modal="false"
|
|
|
|
:before-close="beforeClose" :destroy-on-close="true">
|
|
|
|
:before-close="beforeClose" :destroy-on-close="true">
|
|
|
|
<week-selection @add="addWeek" @cancel="cancelSelection" ref="weekSelection"
|
|
|
|
<week-selection @add="addWeek" @cancel="weekDialog=false" ref="weekSelection"
|
|
|
|
:able-list="ableList"></week-selection>
|
|
|
|
:able-list="ableList"></week-selection>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
</el-container>
|
|
|
|
</el-container>
|
|
|
@ -94,12 +92,13 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import tb_course from "~/components/tb_course";
|
|
|
|
import tb_course from "~/components/tb_courseDialog";
|
|
|
|
import navBar from "~/components/teacher/navBar";
|
|
|
|
import navBar from "~/components/teacher/navBar";
|
|
|
|
import weekSelection from "~/components/weekSelection";
|
|
|
|
import weekSelection from "~/components/weekSelection";
|
|
|
|
import timeSelect from "~/components/timeSelect";
|
|
|
|
import timeSelect from "~/components/timeSelect";
|
|
|
|
import {get, post, stop} from "~/utils";
|
|
|
|
import {get, post, stop} from "~/utils";
|
|
|
|
import {showDialog, showFail, showSuccess} from "~/utils/dialog";
|
|
|
|
import {showDialog, showFail, showSuccess} from "~/utils/dialog";
|
|
|
|
|
|
|
|
import {arr2shortString} from "~/utils/converter";
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "applyLab",
|
|
|
|
name: "applyLab",
|
|
|
@ -220,24 +219,25 @@
|
|
|
|
//提交
|
|
|
|
//提交
|
|
|
|
await showDialog("确认预约此时间段吗?", this)
|
|
|
|
await showDialog("确认预约此时间段吗?", this)
|
|
|
|
await post('lb/labrecord/updateWeeks', this.form)
|
|
|
|
await post('lb/labrecord/updateWeeks', this.form)
|
|
|
|
await showSuccess("预约成功,管理员正在审核",this)
|
|
|
|
await this.getScheduleAble()
|
|
|
|
|
|
|
|
await showSuccess("预约成功,管理员正在审核", this)
|
|
|
|
this.form.weeks = []
|
|
|
|
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]
|
|
|
|
this.allWeeksValue.push(this.aWeekValue) //把单个格子选择的时间段添加到allWeeksValue中
|
|
|
|
// this.allWeeksValue.push(this.aWeekValue) //把单个格子选择的时间段添加到allWeeksValue中
|
|
|
|
this.perTargetValue.style.backgroundColor = 'lightyellow'
|
|
|
|
// this.perTargetValue.style.backgroundColor = 'lightyellow'
|
|
|
|
for (let i = 0; i < this.allWeeksValue.length; i++) {
|
|
|
|
// for (let i = 0; i < this.allWeeksValue.length; i++) {
|
|
|
|
for (let j = i + 1; j < this.allWeeksValue.length; j++) {
|
|
|
|
// for (let j = i + 1; j < this.allWeeksValue.length; j++) {
|
|
|
|
if (this.allWeeksValue[i][0] === this.allWeeksValue[j][0] && this.allWeeksValue[i][1] === this.allWeeksValue[j][1]) {
|
|
|
|
// if (this.allWeeksValue[i][0] === this.allWeeksValue[j][0] && this.allWeeksValue[i][1] === this.allWeeksValue[j][1]) {
|
|
|
|
this.allWeeksValue.splice(i, 1)
|
|
|
|
// this.allWeeksValue.splice(i, 1)
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
this.aWeekValue = []
|
|
|
|
// this.aWeekValue = []
|
|
|
|
this.$refs.weekSelection.checkedValue = [] //将周数选择器已选择选项置空
|
|
|
|
// this.$refs.weekSelection.checkedValue = [] //将周数选择器已选择选项置空
|
|
|
|
// console.log(this.allWeeksValue)
|
|
|
|
// console.log(this.allWeeksValue)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//取消一个格子已选择这些周数
|
|
|
|
//取消一个格子已选择这些周数
|
|
|
@ -290,12 +290,14 @@
|
|
|
|
// this.tableAlive = false //表格失活
|
|
|
|
// this.tableAlive = false //表格失活
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
setTime: function () {
|
|
|
|
setTime: function () {
|
|
|
|
this.tableAlive = true
|
|
|
|
|
|
|
|
// alert('这里本来要验证的,为了方便查看表格,暂无设置,需要验证请把代码行注释解除掉')
|
|
|
|
// alert('这里本来要验证的,为了方便查看表格,暂无设置,需要验证请把代码行注释解除掉')
|
|
|
|
// this.courseDialog = true
|
|
|
|
// this.courseDialog = true
|
|
|
|
this.$refs.courseForm.validate((valid)=>{
|
|
|
|
this.$refs.courseForm.validate(async (valid) => {
|
|
|
|
if (valid){
|
|
|
|
if (valid) {
|
|
|
|
this.courseDialog=true
|
|
|
|
console.log(this)
|
|
|
|
|
|
|
|
await this.getScheduleAble()
|
|
|
|
|
|
|
|
this.$refs.times.lab = this.lab
|
|
|
|
|
|
|
|
this.$refs.times.courseDialog = true
|
|
|
|
this.formDialog = false
|
|
|
|
this.formDialog = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -314,6 +316,34 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async loadCourse() {
|
|
|
|
async loadCourse() {
|
|
|
|
this.courseOption = await get("lb/usercourse/findbyyearandsemester/" + this.$refs.timeSelection.year + "/" + this.$refs.timeSelection.semester)
|
|
|
|
this.courseOption = await get("lb/usercourse/findbyyearandsemester/" + this.$refs.timeSelection.year + "/" + this.$refs.timeSelection.semester)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
async getScheduleAble() {
|
|
|
|
|
|
|
|
const params = {
|
|
|
|
|
|
|
|
labId: this.form.labId,
|
|
|
|
|
|
|
|
year: this.$refs.timeSelection.year,
|
|
|
|
|
|
|
|
semester: this.$refs.timeSelection.semester,
|
|
|
|
|
|
|
|
uc_id: this.form.uc_id
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const schedule = await get('lb/labTime/getLabScheduleAbleBook', params)
|
|
|
|
|
|
|
|
const booked = await get('lb/labrecord/getWeekBooked', params)
|
|
|
|
|
|
|
|
for (let i = 0; i < schedule.length; i++) {
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Monday = arr2shortString(schedule[i][0]) ? '<span style="color:#1989fa">'+arr2shortString(schedule[i][0]) + '周可预约' +'</span>': ''
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Tuesday =arr2shortString(schedule[i][1]) ? '<span style="color:#1989fa">'+arr2shortString(schedule[i][1]) + '周可预约' +'</span>': ''
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Wednesday = arr2shortString(schedule[i][2]) ? '<span style="color:#1989fa">'+arr2shortString(schedule[i][2]) + '周可预约' +'</span>': ''
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Thursday = arr2shortString(schedule[i][3]) ? '<span style="color:#1989fa">'+arr2shortString(schedule[i][3]) + '周可预约' +'</span>': ''
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Friday = arr2shortString(schedule[i][4]) ? '<span style="color:#1989fa">'+arr2shortString(schedule[i][4]) + '周可预约' +'</span>': ''
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Saturday = arr2shortString(schedule[i][5]) ? '<span style="color:#1989fa">'+arr2shortString(schedule[i][5]) + '周可预约' +'</span>': ''
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Sunday = arr2shortString(schedule[i][6]) ? '<span style="color:#1989fa">'+arr2shortString(schedule[i][6]) + '周可预约' +'</span>': ''
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (let i = 0; i < booked.length; i++) {
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Monday = arr2shortString(booked[i][0]) ? '<span style="color:red">'+arr2shortString(booked[i][0]) + '周已预约' +'</span><br>'+this.$refs.times.tableData[i].Monday : this.$refs.times.tableData[i].Monday
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Tuesday =arr2shortString(booked[i][1]) ? '<span style="color:red">'+arr2shortString(booked[i][1]) + '周已预约' +'</span><br>'+this.$refs.times.tableData[i].Tuesday : this.$refs.times.tableData[i].Tuesday
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Wednesday = arr2shortString(booked[i][2]) ? '<span style="color:red">'+arr2shortString(booked[i][2]) + '周已预约' +'</span><br>'+this.$refs.times.tableData[i].Wednesday : this.$refs.times.tableData[i].Wednesday
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Thursday = arr2shortString(booked[i][3]) ? '<span style="color:red">'+arr2shortString(booked[i][3]) + '周已预约' +'</span><br>'+this.$refs.times.tableData[i].Thursday : this.$refs.times.tableData[i].Thursday
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Friday = arr2shortString(booked[i][4]) ? '<span style="color:red">'+arr2shortString(booked[i][4]) + '周已预约' +'</span><br>'+this.$refs.times.tableData[i].Friday : this.$refs.times.tableData[i].Friday
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Saturday = arr2shortString(booked[i][5]) ? '<span style="color:red">'+arr2shortString(booked[i][5]) + '周已预约' +'</span><br>'+this.$refs.times.tableData[i].Saturday : this.$refs.times.tableData[i].Saturday
|
|
|
|
|
|
|
|
this.$refs.times.tableData[i].Sunday = arr2shortString(booked[i][6]) ? '<span style="color:red">'+arr2shortString(booked[i][6]) + '周已预约' +'</span><br>'+this.$refs.times.tableData[i].Sunday : this.$refs.times.tableData[i].Sunday
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//钩子函数,生命周期mouted
|
|
|
|
//钩子函数,生命周期mouted
|
|
|
|