master
Romesum 5 years ago
commit 0a6379e4e4

@ -1,6 +1,6 @@
<template>
<div>
<el-dialog
:visible.sync="addLabDialog"
width="48%">
<div style="width: 100%;height: 120% ">
@ -47,7 +47,7 @@
</el-col>
<el-col style="width:45%">
<el-form-item label="可容量认人数"style="">
<el-input v-model="form.compacity" placeholder="输入数量" style="width:60%;border-style: outset"></el-input>
<el-input v-model="form.capacity" placeholder="输入数量" style="width:60%;border-style: outset"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -64,7 +64,7 @@
</el-col>
</el-row>
<el-form-item label="可申请时间段"style="">
<el-input v-model="form.managerId" placeholder="点击编辑" style="width:80%"></el-input>
<el-input v-model="form.managerId" placeholder="点击编辑" style="width:80%" @focus="detailTime"></el-input>
</el-form-item>
<el-button type="success" style="width: 120px;text-align: left" icon="el-icon-circle-plus-outline"
@click="showAddLab">新增
@ -72,13 +72,26 @@
</el-form>
</div>
</el-dialog>
<el-dialog :visible="setLabTimeDialog" >
<set-lab-time ref="setLabTime"></set-lab-time>
<span slot="footer" class="dialog-footer">
<el-button @click="cancleSetTime"> </el-button>
<el-button type="primary" @click="setTime"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import setLabTime from "~/components/supManager/setLabTime";
export default {
name:"addLab",
components:{
setLabTime
},
data(){
return{
setLabTimeDialog:false,
addLabDialog:false,
form:{
position:'',
@ -86,15 +99,30 @@
labId:'',
name:'509',
status:'0',
compacity:'',
capacity:'',
manager:'',
managerId:''
managerId:'',
schedule:[] //
},
}
},
methods:{
showAddLab(){
this.addLabDialog=false
},
detailTime(){
this.setLabTimeDialog=true
this.form.schedule=[]
},
cancleSetTime(){
this.setLabTimeDialog=false
this.$refs.setLabTime.allWeeksValue=[]
},
setTime(){
this.setLabTimeDialog=false
var st=this.$refs.setLabTime
this.form.schedule.push(st.form.year,st.form.semester,st.allWeeksValue)
console.log(this.form.schedule)
}
}
}
@ -102,4 +130,4 @@
<style>
</style>
</style>

@ -10,7 +10,7 @@
</template>
<script>
import home from "~/components/home";
import home from "~/components/teacher/home";
import {get} from "~/utils";
import {showSuccess} from "~/utils/dialog";

@ -2,12 +2,10 @@
<div style="width: 100%" >
<el-form :model="form" :inline="true">
<el-form-item label="类型" style="width: 20% ">
<el-select v-model="form.type" style="border-style: outset;" >
<el-option label="安卓实验室" value="0"></el-option>
<el-option label="window实验室" value="1"></el-option>
<el-option label="ios实验室" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="位置" style="width: 20% ;">
@ -15,7 +13,6 @@
<el-option label="旭日楼" value="0"></el-option>
<el-option label="电子楼" value="1"></el-option>
<el-option label="实训楼" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态" style="width: 20%">
@ -23,44 +20,32 @@
<el-option label="可预约" value="0"></el-option>
<el-option label="不可预约" value="1"></el-option>
<el-option label="故障" value="2"></el-option>
</el-select>
</el-form-item >
<el-input v-model="search" placeholder="输入关键字搜索" suffix-icon="el-icon-search" style="width: 20%;border-style: outset;"/>
<el-button type="success" style="width: 6%;text-align: left" icon="el-icon-circle-plus-outline"
@click="showAddLab" >新增
</el-button>
<el-button type="success" style="width: 8%;text-align: left" icon="el-icon-circle-plus-outline"
@click="showAddLab" >批量操作
<el-button type="success" style="width: 8%;text-align: left" icon="el-icon-circle-plus-outline" @click="showAddLab" >批量操作
</el-button>
</el-form>
<el-form :model="time" :inline="true" style="width: 100%">
<span style="width: 10% ;:-20px">可预约时间段:
</span>
<el-form-item label="学年" style="width: 20% ;">
<el-select v-model="time.year" style="border-style: outset;" >
<el-option label="2017-2018" value="0"></el-option>
<el-option label="2018-2019" value="1"></el-option>
<el-option label="2019-2020" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="学期" style="width: 20%">
<el-select v-model="time.semester" style="border-style: outset;" >
<el-option label="第一学期" value="0"></el-option>
<el-option label="第二学期" value="1"></el-option>
</el-select>
</el-form-item >
<el-form-item label="周次" style="width: 5%">
</el-form-item >
<el-select v-model="time.day1" style="border-style: outset;;width:5%" >
@ -102,8 +87,6 @@
</el-select>
<el-button type="success" style="width: 6%;text-align: left" icon="el-icon-circle-plus-outline"
@click="showAddLab" >检索
</el-button>
@ -161,6 +144,7 @@
<script>
import addLab from "~/components/supManager/addLab" ;
import {get, post} from "~/utils";
import {showDialog, showFail, showSuccess} from "~/utils/dialog";
export default {
@ -231,4 +215,4 @@
<style>
</style>
</style>

@ -0,0 +1,184 @@
<template>
<div>
<el-form :model="form">
<el-form-item label="学年:">
<el-select v-model="form.year" size="small" >
<el-option
v-for="item in selectOptions1"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="学期:">
<el-select v-model="form.semester" size="small" >
<el-option
v-for="item in selectOptions2"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="星期:">
<el-input v-model="form.time" @focus="showCourseDialog" placeholder="点我设置" style="width: 200px" >点击设置</el-input>
</el-form-item>
</el-form>
<!-- 表格节数选择-->
<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>
<!-- 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" ></week-selection>
</el-dialog>
</div>
</template>
<script>
import weekSelection from "~/components/weekSelection";
import tb_course from "~/components/tb_course";
import {get, post, stop} from "~/utils";
import {showDialog, showFail, showSuccess} from "~/utils/dialog";
export default {
name: "setLabTime",
components:{weekSelection,tb_course},
data(){
return{
form:{
year:2019,
semester:2,
time:"",
},
allWeeksValue:[],
aWeekValue:[],
courseDialog:false,
tableAlive:false, //
weekDialog:false,
selectOptions1: [
{
value: 2017,
label: '2017-2018年'
},
{
value: 2018,
label: '2018-2019年'
},
{
value: 2019,
label: '2019-2020年'
}
],
selectOptions2: [
{
value: 1,
label: '第一学期'
},
{
value: 2,
label: '第二学期'
}
],
}
},
methods:{
//
showCourseDialog(){
console.log('嘿')
this.tableAlive=true
this.courseDialog=true
},
//
cellStyle:function({row, column, rowIndex, columnIndex}){
if (column.label!=''){
return 'cursor:pointer'
}
},
//
cellClick(row, column, cell, event) {
console.log(row.index)
if (column.label!='') {
this.weekDialog=true
this.perTargetValue=event.target //targettarget
console.log(this.aWeekValue,this.allWeeksValue)
this.aWeekValue.push(row.index,column.index)
}
},
//
async addWeek() {
this.weekDialog=false
var targetValue = this.$refs.weekSelection.checkedValue
if(targetValue.length!==0){
this.perTargetValue.textContent='【'+targetValue+'】周'
this.aWeekValue.push(targetValue) //[rowIndex,column,targetValue]
this.allWeeksValue.push(this.aWeekValue) //allWeeksValue
this.perTargetValue.style.backgroundColor='lightyellow'
for (let i=0;i<this.allWeeksValue.length;i++){
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]){
this.allWeeksValue.splice(i,1)
}
}
}
}
this.aWeekValue=[]
// this.$refs.weekSelection.checkedValue=[] //
// 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 setWeeks () {
console.log(this.$refs.times)
console.log(this.allWeeksValue)
// this.form.schedule=this.allWeeksValue.toString()
this.courseDialog=false
// console.log(this.$refs.times)
this.tableAlive=false
if (this.allWeeksValue.length!==0){
this.form.time='已设置,点击修改'
}
},
//
cancelSetWeeks:function () {
this.allWeeksValue=[]
this.form.schedule=""
this.courseDialog=false
this.formDialog=true
console.log(this.allWeeksValue)
this.tableAlive=false //
}
}
}
</script>
<style scoped>
</style>

@ -20,13 +20,10 @@
</template>
<script>
const allVal=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18];
const singleVal=[1,3,5,7,9,11,13,15,17];
const doubleVal=[2,4,6,8,10,12,14,16,18];
export default {
name: "weekSelection",
props:{
ableList:{default: allVal}
ableList:{default: this.allVal}
},
data(){
return{
@ -35,6 +32,9 @@
isIndeterminate1:true,
isIndeterminate2:true,
isIndeterminate3:true,
allVal:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],
singleVal:[1,3,5,7,9,11,13,15,17],
doubleVal:[2,4,6,8,10,12,14,16,18],
checkOption:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]
}
},
@ -42,15 +42,15 @@
radioSelect:function (val) {
console.log(val)
if (val){
if (val==='全选'){this.checkedValue=allVal}
if(val==='单周'){this.checkedValue=singleVal}
if (val==='双周'){this.checkedValue=doubleVal}
if (val==='全选'){this.checkedValue=this.allVal}
if(val==='单周'){this.checkedValue=this.singleVal}
if (val==='双周'){this.checkedValue=this.doubleVal}
if (val==='全不选'){this.checkedValue=[]}
} else {this.checkedValue=[]}
},
handleCheckedValueChange:function (value) {
let checkedCount = value.length
this.radioValue=value.length===allVal.length?'all':''
this.radioValue=value.length===this.allVal.length?'all':''
}
},
mounted() {

@ -5,7 +5,7 @@
</template>
<script>
import home from "~/components/home";
import home from "~/components/teacher/home";
export default {
name: "index",
data(){

@ -1,6 +1,6 @@
<template>
<div>
<router-view></router-view>
<router-view> </router-view>
</div>
</template>

@ -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}) //rowIndexcolumIndex:
// 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 //targettarget
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}) //rowIndexcolumIndex:
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

@ -1,8 +1,7 @@
<template>
<div>
<router-view></router-view>
<router-view> </router-view>
</div>
</template>
<script>

@ -5,7 +5,7 @@
</template>
<script>
import home from "~/components/home";
import home from "~/components/teacher/home";
import {get} from "~/utils";
import {showSuccess} from "~/utils/dialog";

@ -11,19 +11,12 @@
</div>
</el-header>
<el-table :data="tableData" border ref="mar" height="500px">
<el-table-column prop="position" label="实验室地点">
</el-table-column>
<el-table-column prop="name" label="实验室名称">
</el-table-column>
<el-table-column prop="class" label="授课班级">
</el-table-column>
<el-table-column prop="population" label="人数">
</el-table-column>
<el-table-column prop="course_name" label="课程名称">
</el-table-column>
<el-table-column prop="position" label="实验室地点"></el-table-column>
<el-table-column prop="name" label="实验室名称"></el-table-column>
<el-table-column prop="class" label="授课班级"></el-table-column>
<el-table-column prop="population" label="人数"></el-table-column>
<el-table-column prop="course_name" label="课程名称"></el-table-column>
<el-table-column prop="course_name" label="申请时间段"></el-table-column>
<el-table-column prop="status" label="状态"></el-table-column>
</el-table>
</el-main>
@ -40,25 +33,17 @@
import navBar from "~/components/teacher/navBar";
import {get} from "~/utils";
export default {
name: "myApplyRecord",
props:['u_id'],
components: {
tb_course,
navBar
},
data() {
return {
tableData: [
]
tableData: []
}
},
computed:{
},
mounted() {
get('/lb_teacher_myApplyRecord',this.u_id).then((res)=>{
this.tableData=res.data
})
async mounted() {
this.tableData = await get('/lb/labrecord/getRecordBySelf')
}
}
</script>

@ -9,7 +9,7 @@ import manager from "~/pages/manager/index";
import supManager from "~/pages/supManager/index";
import personal from "~/pages/teacher/personal";
import login from "~/pages/login";
import empty from "~/components/empty";
import empty from "~/pages/teacher/empty";
import myCourse from "~/pages/teacher/myCourseTable";
import tb_course from "~/components/tb_course";
import labApplyDetail from "~/pages/labApplyDetail";
@ -20,8 +20,9 @@ import supHome from "~/components/supManager/home";
import supIndex from "~/components/supManager/index";
import globalPersonal from "~/components/personal";
import userManage from "~/components/supManager/userManage";
import setLabTime from "~/components/supManager/setLabTime";
import labManager from "~/components/supManager/labManage";
import check from "~/components/supManager/check"
import check from "~/components/supManager/check";
// 要告诉 vue 使用 vueRouter
Vue.use(VueRouter);
@ -123,6 +124,10 @@ const routes = [
path: '/labApplyDetail/:id',
component: labApplyDetail,
props:true
},
{
path:'/setLabTime',
component: setLabTime
}
]

Loading…
Cancel
Save