|
|
@ -1,6 +1,6 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<el-dialog :visible="setLabTimeDialog" @close="setLabTimeDialog=false">
|
|
|
|
<el-dialog :visible="setLabTimeDialog" @close="setLabTimeDialog=false" :title="lab.position+' '+lab.name">
|
|
|
|
<el-form :model="form">
|
|
|
|
<el-form :model="form">
|
|
|
|
<el-form-item label="学年:">
|
|
|
|
<el-form-item label="学年:">
|
|
|
|
<el-select v-model="form.year" size="small">
|
|
|
|
<el-select v-model="form.year" size="small">
|
|
|
@ -26,20 +26,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="星期:">
|
|
|
|
<el-form-item label="星期:">
|
|
|
|
<el-input v-model="form.time" @focus="showCourseDialog" placeholder="点我设置" style="width: 200px">点击设置
|
|
|
|
<el-button type="primary" style="width: 200px" @click="showCourseDialog">点击设置</el-button>
|
|
|
|
</el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 表格:节数选择-->
|
|
|
|
<!-- 表格:节数选择-->
|
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
<!-- checkbox:周次选择-->
|
|
|
|
<!-- checkbox:周次选择-->
|
|
|
|
<el-dialog :visible.sync="weekDialog" title="请选择周数" width="400px" :close-on-click-modal="false" append-to-body>
|
|
|
|
<el-dialog :visible.sync="weekDialog" title="请选择周数" width="400px" :close-on-click-modal="false" append-to-body>
|
|
|
|
<week-selection @add="addWeek" @cancel="cancelSelection" ref="weekSelection"
|
|
|
|
<week-selection @add="addWeek" @cancel="cancelSelection" ref="weekSelection"
|
|
|
@ -59,13 +53,17 @@
|
|
|
|
components: {weekSelection, tb_course},
|
|
|
|
components: {weekSelection, tb_course},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|
|
|
|
lab: {
|
|
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
|
|
position: ''
|
|
|
|
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
form: {
|
|
|
|
year: '2019',
|
|
|
|
year: '2019',
|
|
|
|
semester: 2
|
|
|
|
semester: 2
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setLabTimeDialog: false,
|
|
|
|
setLabTimeDialog: false,
|
|
|
|
ableList: [],
|
|
|
|
ableList: [],
|
|
|
|
weekDisable:[],
|
|
|
|
weekDisable: [],
|
|
|
|
allWeeksValue: [],
|
|
|
|
allWeeksValue: [],
|
|
|
|
aWeekValue: [],
|
|
|
|
aWeekValue: [],
|
|
|
|
courseDialog: false,
|
|
|
|
courseDialog: false,
|
|
|
@ -104,8 +102,9 @@
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
//设置周次与节次
|
|
|
|
//设置周次与节次
|
|
|
|
async showCourseDialog() {
|
|
|
|
async showCourseDialog() {
|
|
|
|
|
|
|
|
this.$refs.times.lab = this.lab
|
|
|
|
this.tableAlive = true
|
|
|
|
this.tableAlive = true
|
|
|
|
this.courseDialog = true
|
|
|
|
this.$refs.times.courseDialog = true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//表格中每个格子的风格
|
|
|
|
//表格中每个格子的风格
|
|
|
|
cellStyle: function ({row, column, rowIndex, columnIndex}) {
|
|
|
|
cellStyle: function ({row, column, rowIndex, columnIndex}) {
|
|
|
@ -123,7 +122,7 @@
|
|
|
|
const weekAll = await get('lb/labTime/getWeeks', this.form)
|
|
|
|
const weekAll = await get('lb/labTime/getWeeks', this.form)
|
|
|
|
const weekAble = await get("lb/labTime/getWeeksAbleBook", this.form)
|
|
|
|
const weekAble = await get("lb/labTime/getWeeksAbleBook", this.form)
|
|
|
|
this.weekDisable = weekAll.filter(elem => !(weekAble.indexOf(elem) > -1))
|
|
|
|
this.weekDisable = weekAll.filter(elem => !(weekAble.indexOf(elem) > -1))
|
|
|
|
this.ableList = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18].filter(elem=> !(this.weekDisable.indexOf(elem) > -1))
|
|
|
|
this.ableList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18].filter(elem => !(this.weekDisable.indexOf(elem) > -1))
|
|
|
|
this.weekDialog = true
|
|
|
|
this.weekDialog = true
|
|
|
|
// if (column.label != '') {
|
|
|
|
// if (column.label != '') {
|
|
|
|
// this.weekDialog = true
|
|
|
|
// this.weekDialog = true
|
|
|
@ -140,12 +139,12 @@
|
|
|
|
this.form.weeks = targetValue
|
|
|
|
this.form.weeks = targetValue
|
|
|
|
//提交
|
|
|
|
//提交
|
|
|
|
await showDialog("确认设置此时间段可预约吗?", this)
|
|
|
|
await showDialog("确认设置此时间段可预约吗?", this)
|
|
|
|
for(let i in this.weekDisable){
|
|
|
|
for (let i in this.weekDisable) {
|
|
|
|
this.form.weeks.push(this.weekDisable[i])
|
|
|
|
this.form.weeks.push(this.weekDisable[i])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log(this.form)
|
|
|
|
console.log(this.form)
|
|
|
|
await post('lb/labTime/updateLabTime', this.form)
|
|
|
|
await post('lb/labTime/updateLabTime', this.form)
|
|
|
|
await showSuccess("设置成功",this)
|
|
|
|
await showSuccess("设置成功", this)
|
|
|
|
// 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]
|
|
|
@ -187,7 +186,7 @@
|
|
|
|
console.log(this.$refs.times)
|
|
|
|
console.log(this.$refs.times)
|
|
|
|
console.log(this.allWeeksValue)
|
|
|
|
console.log(this.allWeeksValue)
|
|
|
|
// this.form.schedule=this.allWeeksValue.toString()
|
|
|
|
// this.form.schedule=this.allWeeksValue.toString()
|
|
|
|
this.courseDialog = false
|
|
|
|
this.$refs.times.courseDialog = false
|
|
|
|
// console.log(this.$refs.times)
|
|
|
|
// console.log(this.$refs.times)
|
|
|
|
this.tableAlive = false
|
|
|
|
this.tableAlive = false
|
|
|
|
if (this.allWeeksValue.length !== 0) {
|
|
|
|
if (this.allWeeksValue.length !== 0) {
|
|
|
@ -199,7 +198,7 @@
|
|
|
|
cancelSetWeeks: function () {
|
|
|
|
cancelSetWeeks: function () {
|
|
|
|
this.allWeeksValue = []
|
|
|
|
this.allWeeksValue = []
|
|
|
|
this.form.schedule = ""
|
|
|
|
this.form.schedule = ""
|
|
|
|
this.courseDialog = false
|
|
|
|
this.$refs.times.courseDialog = false
|
|
|
|
this.formDialog = true
|
|
|
|
this.formDialog = true
|
|
|
|
console.log(this.allWeeksValue)
|
|
|
|
console.log(this.allWeeksValue)
|
|
|
|
this.tableAlive = false //表格失活
|
|
|
|
this.tableAlive = false //表格失活
|
|
|
|