|
|
|
@ -52,6 +52,9 @@
|
|
|
|
|
<el-form-item label="地址">
|
|
|
|
|
<el-input v-model="form.position" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="申请时间" prop="date" >-->
|
|
|
|
|
<!-- <el-input v-model="form.date" disabled></el-input>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="实验室名称">
|
|
|
|
|
<el-input v-model="form.name" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -79,8 +82,10 @@
|
|
|
|
|
<tb_course :cClick="cellClick" :cStyle="cellStyle" table-label="点击相应的位置选取时间段" ref="times"></tb_course>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<!-- checkbox:周次选择-->
|
|
|
|
|
<el-dialog :visible.sync="weekDialog" title="请选择周数" width="400px" :close-on-click-modal="false">
|
|
|
|
|
<week-selection @add="addWeek" @cancel="cancelSelection" ref="weekSelection" :able-list="ableList"></week-selection>
|
|
|
|
|
<el-dialog :visible.sync="weekDialog" title="请选择周数" width="400px" :close-on-click-modal="false"
|
|
|
|
|
:before-close="beforeClose" :destroy-on-close="true">
|
|
|
|
|
<week-selection @add="addWeek" @cancel="cancelSelection" ref="weekSelection"
|
|
|
|
|
:able-list="ableList"></week-selection>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</el-container>
|
|
|
|
|
|
|
|
|
@ -91,7 +96,7 @@
|
|
|
|
|
<script>
|
|
|
|
|
import tb_course from "~/components/tb_course";
|
|
|
|
|
import navBar from "~/components/teacher/navBar";
|
|
|
|
|
import weekSelection from "~/components/teacher/weekSelection";
|
|
|
|
|
import weekSelection from "~/components/weekSelection";
|
|
|
|
|
import timeSelect from "~/components/timeSelect";
|
|
|
|
|
import {get, post, stop} from "~/utils";
|
|
|
|
|
import {showDialog, showFail, showSuccess} from "~/utils/dialog";
|
|
|
|
@ -105,7 +110,7 @@
|
|
|
|
|
return {
|
|
|
|
|
user: {},
|
|
|
|
|
lab: {},
|
|
|
|
|
ableList:[],
|
|
|
|
|
ableList: [],
|
|
|
|
|
tableAlive: false, //用于重载表格
|
|
|
|
|
tableData: [{}],
|
|
|
|
|
checkOption: [],
|
|
|
|
@ -136,7 +141,7 @@
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
//表格中每个格子的风格
|
|
|
|
|
cellStyle: function ({row, column, rowIndex, columnIndex}) {
|
|
|
|
|
cellStyle({row, column, rowIndex, columnIndex}) {
|
|
|
|
|
if (column.label != '') {
|
|
|
|
|
return 'cursor:pointer'
|
|
|
|
|
}
|
|
|
|
@ -147,7 +152,7 @@
|
|
|
|
|
this.form.time = row.index
|
|
|
|
|
this.form.year = this.$refs.timeSelection.year
|
|
|
|
|
this.form.semester = this.$refs.timeSelection.semester
|
|
|
|
|
this.ableList = await get("lb/labTime/getWeeksAbleBook",this.form)
|
|
|
|
|
this.ableList = await get("lb/labTime/getWeeksAbleBook", this.form)
|
|
|
|
|
|
|
|
|
|
this.aWeekValue.push(row.index, column.index)
|
|
|
|
|
//(待写)检索该格子的周数申请信息,被申请的周数使其样式变为disable
|
|
|
|
@ -156,17 +161,27 @@
|
|
|
|
|
// let columIndex = column.index
|
|
|
|
|
// var weeks=get('',{position,rowIndex,columIndex}) //发送给实验室的地址,rowIndex,columIndex返回该格子的周数信息:数组
|
|
|
|
|
// var weeks=[6,7,8]
|
|
|
|
|
|
|
|
|
|
// for (let i=0;i<weeks.length;i++){
|
|
|
|
|
// console.log(weeks[i])
|
|
|
|
|
// // this.$refs.weekSelection.$refs.children[weeks[i]].disabled=true
|
|
|
|
|
// }
|
|
|
|
|
// console.log(row.index)
|
|
|
|
|
// console.log(column.index)
|
|
|
|
|
|
|
|
|
|
//(待写)检索该格子的周数申请信息,被申请的周数使其样式变为disablevar
|
|
|
|
|
if (column.label != '') {
|
|
|
|
|
this.weekDialog = true
|
|
|
|
|
this.perTargetValue = event.target //用target对表格进行定位并保存致target对象
|
|
|
|
|
this.aWeekValue.push(row.index, column.index)
|
|
|
|
|
|
|
|
|
|
new Promise((resolve, reject) => { //使weekDialog打开和调用按顺序执行
|
|
|
|
|
this.weekDialog = true
|
|
|
|
|
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)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//点击表格操作栏申请按钮
|
|
|
|
@ -198,11 +213,8 @@
|
|
|
|
|
//添加已选择的的周数
|
|
|
|
|
async addWeek() {
|
|
|
|
|
this.weekDialog = false
|
|
|
|
|
const targetValue = this.$refs.weekSelection.checkedValue
|
|
|
|
|
this.form.weeks = targetValue
|
|
|
|
|
await showDialog("确认提交选择该时间段吗?", this)
|
|
|
|
|
console.log(this.form)
|
|
|
|
|
|
|
|
|
|
var targetValue = this.$refs.weekSelection.checkedValue
|
|
|
|
|
await showDialog("确认设置此时间段吗?", this)
|
|
|
|
|
if (targetValue.length !== 0) {
|
|
|
|
|
this.perTargetValue.textContent = '【' + targetValue + '】周'
|
|
|
|
|
this.aWeekValue.push(targetValue) //单个节数时间段添加完成,包括[rowIndex,column,targetValue]
|
|
|
|
@ -286,6 +298,11 @@
|
|
|
|
|
cancelAppy: function () {
|
|
|
|
|
this.formDialog = false
|
|
|
|
|
},
|
|
|
|
|
//周次选择器关闭前的回调
|
|
|
|
|
beforeClose() {
|
|
|
|
|
this.weekDialog = false
|
|
|
|
|
this.aWeekValue = []
|
|
|
|
|
},
|
|
|
|
|
//跳转到我的申请记录
|
|
|
|
|
toMyRecord() {
|
|
|
|
|
this.$router.push('/teacher/myApplyRecord/' + this.user.u_id) //这里的user.u_id作为是作为路径参数存在
|
|
|
|
|