[feat][V]:添加实验室修改时间段时Dialog的title

master
Romesum 5 years ago
parent 1657b2cb9f
commit 678cc27dc5

@ -108,7 +108,7 @@
<!-- icon="el-icon-delete">删除-->
<!-- </el-button>-->
<el-button @click="schedulePreview(scope.row.lab_id)" size="mini" plain>查看课表</el-button>
<el-button @click="editSchedule(scope.row.lab_id)" type="primary" size="mini" icon="el-icon-edit"
<el-button @click="editSchedule(scope.row)" type="primary" size="mini" icon="el-icon-edit"
plain>修改可预约时间段
</el-button>
</template>
@ -214,9 +214,9 @@
async schedulePreview() {
await showFail('尚未开发', this)
},
async editSchedule(lab_id) {
console.log(this.$refs.setLabTime)
this.$refs.setLabTime.form.labId = lab_id
async editSchedule(item) {
this.$refs.setLabTime.lab = item
this.$refs.setLabTime.form.labId = item.lab_id
this.$refs.setLabTime.setLabTimeDialog = true
}
},

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

@ -1,60 +1,62 @@
<template>
<div>
<el-table :data="tableData" :span-method="objectSpanMethod" @cell-click="cClick" :cell-style="cStyle">
<el-table-column :label="tableLabel" align="center ">
<el-table-column prop="daytime" label="" fixed align="center" width="60"></el-table-column>
<el-table-column prop="time" label="" fixed align="center" width="100"></el-table-column>
<el-table-column :index="1" prop="Monday" label="星期一" align="center">
<template slot-scope="scope">
{{scope.row.Monday.name}} &nbsp;<br>
{{scope.row.Monday.classes}} &nbsp; {{scope.row.Monday.population}}<br>
{{scope.row.Monday.software}}
</template>
<el-dialog :visible.sync="courseDialog" append-to-body :close-on-click-modal="false" :title="lab.position+' '+lab.name">
<el-table :data="tableData" :span-method="objectSpanMethod" @cell-click="cClick" :cell-style="cStyle">
<el-table-column :label="tableLabel" align="center ">
<el-table-column prop="daytime" label="" fixed align="center" width="60"></el-table-column>
<el-table-column prop="time" label="" fixed align="center" width="100"></el-table-column>
<el-table-column :index="1" prop="Monday" label="星期一" align="center">
<template slot-scope="scope">
{{scope.row.Monday.name}} &nbsp;<br>
{{scope.row.Monday.classes}} &nbsp; {{scope.row.Monday.population}}<br>
{{scope.row.Monday.software}}
</template>
</el-table-column>
<el-table-column :index="2" prop="Tuesday" label="星期二" align="center">
<template slot-scope="scope">
{{scope.row.Tuesday.name}} &nbsp;<br>
{{scope.row.Tuesday.classes}} &nbsp; {{scope.row.Tuesday.population}}<br>
{{scope.row.Tuesday.software}}
</template>
</el-table-column>
<el-table-column :index="3" prop="Wednesday" label="星期三" align="center">
<template slot-scope="scope">
{{scope.row.Wednesday.name}} &nbsp;<br>
{{scope.row.Wednesday.classes}} &nbsp; {{scope.row.Wednesday.population}}<br>
{{scope.row.Wednesday.software}}
</template>
</el-table-column>
<el-table-column :index="4" prop="Thursday" label="星期四" align="center">
<template slot-scope="scope">
{{scope.row.Thursday.name}} &nbsp;<br>
{{scope.row.Thursday.classes}} &nbsp; {{scope.row.Thursday.population}}<br>
{{scope.row.Thursday.software}}
</template>
</el-table-column>
<el-table-column :index="5" prop="Friday" label="星期五" align="center">
<template slot-scope="scope">
{{scope.row.Friday.name}} &nbsp;<br>
{{scope.row.Friday.classes}} &nbsp; {{scope.row.Friday.population}}<br>
{{scope.row.Friday.software}}
</template>
</el-table-column>
<el-table-column :index="6" prop="Saturday" label="星期六" align="center">
<template slot-scope="scope">
{{scope.row.Saturday.name}} &nbsp;<br>
{{scope.row.Saturday.classes}} &nbsp; {{scope.row.Saturday.population}}<br>
{{scope.row.Saturday.software}}
</template>
</el-table-column>
<el-table-column :index="7" prop="Sunday" label="星期日" align="center">
<template slot-scope="scope">
{{scope.row.Sunday.name}} &nbsp;<br>
{{scope.row.Sunday.classes}} &nbsp; {{scope.row.Sunday.population}}<br>
{{scope.row.Sunday.software}}
</template>
</el-table-column>
</el-table-column>
<el-table-column :index="2" prop="Tuesday" label="星期二" align="center">
<template slot-scope="scope">
{{scope.row.Tuesday.name}} &nbsp;<br>
{{scope.row.Tuesday.classes}} &nbsp; {{scope.row.Tuesday.population}}<br>
{{scope.row.Tuesday.software}}
</template>
</el-table-column>
<el-table-column :index="3" prop="Wednesday" label="星期三" align="center">
<template slot-scope="scope">
{{scope.row.Wednesday.name}} &nbsp;<br>
{{scope.row.Wednesday.classes}} &nbsp; {{scope.row.Wednesday.population}}<br>
{{scope.row.Wednesday.software}}
</template>
</el-table-column>
<el-table-column :index="4" prop="Thursday" label="星期四" align="center">
<template slot-scope="scope">
{{scope.row.Thursday.name}} &nbsp;<br>
{{scope.row.Thursday.classes}} &nbsp; {{scope.row.Thursday.population}}<br>
{{scope.row.Thursday.software}}
</template>
</el-table-column>
<el-table-column :index="5" prop="Friday" label="星期五" align="center">
<template slot-scope="scope">
{{scope.row.Friday.name}} &nbsp;<br>
{{scope.row.Friday.classes}} &nbsp; {{scope.row.Friday.population}}<br>
{{scope.row.Friday.software}}
</template>
</el-table-column>
<el-table-column :index="6" prop="Saturday" label="星期六" align="center">
<template slot-scope="scope">
{{scope.row.Saturday.name}} &nbsp;<br>
{{scope.row.Saturday.classes}} &nbsp; {{scope.row.Saturday.population}}<br>
{{scope.row.Saturday.software}}
</template>
</el-table-column>
<el-table-column :index="7" prop="Sunday" label="星期日" align="center">
<template slot-scope="scope">
{{scope.row.Sunday.name}} &nbsp;<br>
{{scope.row.Sunday.classes}} &nbsp; {{scope.row.Sunday.population}}<br>
{{scope.row.Sunday.software}}
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</el-dialog>
</div>
</template>
@ -65,10 +67,15 @@
export default {
name: "tb_course",
components: {navBar},
props: ['tableLabel','cClick', 'cStyle',],
props: ['tableLabel', 'cClick', 'cStyle',],
data() {
return {
item: '',
lab: {
name: '',
position: ''
},
courseDialog:false,
data: [],
tableData: [
{
@ -113,94 +120,94 @@
},
mounted() {
console.log('aaaaaaaaaaaaaaa')
// this.data = [
// [
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "Web",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// }
// ]
// ]
// this.data = [
// [
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "Web",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// }
// ]
// ]
for (let i = 0; i < this.data.length; i++) {
this.tableData[i].Monday = this.data[i][0]
this.tableData[i].Tuesday = this.data[i][1]

@ -148,6 +148,7 @@
},
//
async cellClick(row, column, cell, event) {
this.form.weeks = null
this.form.day = column.index
this.form.time = row.index
this.form.year = this.$refs.timeSelection.year
@ -240,22 +241,22 @@
// console.log(this.allWeeksValue)
},
//
async cancelSelection() {
for (let i = 0; i < this.allWeeksValue.length; i++) {
if (this.aWeekValue[0] === this.allWeeksValue[i][0] && this.aWeekValue[1] === this.allWeeksValue[i][1]) {
this.allWeeksValue.splice(i, 1)
console.log(this.allWeeksValue)
}
}
this.aWeekValue = []
this.perTargetValue.style.backgroundColor = ''
this.perTargetValue.textContent = ''
//allWeeksValue
// if (this.perTargetValue!=''){
// this.allWeeksValue.pop()
// }
this.weekDialog = false
},
// async cancelSelection() {
// for (let i = 0; i < this.allWeeksValue.length; i++) {
// if (this.aWeekValue[0] === this.allWeeksValue[i][0] && this.aWeekValue[1] === this.allWeeksValue[i][1]) {
// this.allWeeksValue.splice(i, 1)
// console.log(this.allWeeksValue)
// }
// }
// this.aWeekValue = []
// this.perTargetValue.style.backgroundColor = ''
// this.perTargetValue.textContent = ''
// //allWeeksValue
// // if (this.perTargetValue!=''){
// // this.allWeeksValue.pop()
// // }
// this.weekDialog = false
// },
//
// async setWeeks() {
// console.log(this.allWeeksValue)
@ -280,14 +281,14 @@
//
// },
//
cancelSetWeeks: function () {
this.allWeeksValue = []
this.form.schedule = ""
this.courseDialog = false
this.formDialog = true
console.log(this.allWeeksValue)
this.tableAlive = false //
},
// cancelSetWeeks: function () {
// this.allWeeksValue = []
// this.form.schedule = ""
// this.courseDialog = false
// this.formDialog = true
// console.log(this.allWeeksValue)
// this.tableAlive = false //
// },
setTime: function () {
this.tableAlive = true
// alert('便')

Loading…
Cancel
Save