diff --git a/element-vue/src/components/teacher/weekSelection.vue b/element-vue/src/components/teacher/weekSelection.vue
index 7b382af..5decc7f 100644
--- a/element-vue/src/components/teacher/weekSelection.vue
+++ b/element-vue/src/components/teacher/weekSelection.vue
@@ -25,6 +25,9 @@
const doubleVal=[2,4,6,8,10,12,14,16,18];
export default {
name: "weekSelection",
+ props:{
+ ableList:{default: allVal}
+ },
data(){
return{
checkedValue:[],
@@ -32,7 +35,6 @@
isIndeterminate1:true,
isIndeterminate2:true,
isIndeterminate3:true,
- ableList:[1,2,3,4,5,6],
checkOption:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]
}
},
diff --git a/element-vue/src/pages/teacher/applyLab.vue b/element-vue/src/pages/teacher/applyLab.vue
index 2cc9845..1b23fb5 100644
--- a/element-vue/src/pages/teacher/applyLab.vue
+++ b/element-vue/src/pages/teacher/applyLab.vue
@@ -2,97 +2,89 @@
-
+
-
+
-
+
-
+
+
+
我的申请记录
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
- 查看申请详情
+ 查看申请详情
+
申请
- >
+
+ >
-
+
-
-
-
+
+
+
-
+
-
-
-
-
+
-
+
-
+
-
+
-
填写申请时间段
取消
-
-
+
+
-
-
-
-
+
+
+
-
@@ -103,58 +95,61 @@
import timeSelect from "~/components/timeSelect";
import {get, post, stop} from "~/utils";
import {showDialog, showFail, showSuccess} from "~/utils/dialog";
+
export default {
name: "applyLab",
- components:{
- tb_course,
- navBar,
- weekSelection,
- timeSelect
+ components: {
+ tb_course, navBar, weekSelection, timeSelect
},
- data(){
- return{
- user:{},
- lab:{},
-
- tableAlive:false, //用于重载表格
- tableData:[{}],
- checkOption :[],
+ data() {
+ return {
+ user: {},
+ lab: {},
+ ableList:[],
+ tableAlive: false, //用于重载表格
+ tableData: [{}],
+ checkOption: [],
- formDialog:false,
- courseDialog:false,
- weekDialog:false,
+ formDialog: false,
+ courseDialog: false,
+ weekDialog: false,
- perTargetValue:'',
- aWeekValue:[],
- allWeeksValue:[],
+ perTargetValue: '',
+ aWeekValue: [],
+ allWeeksValue: [],
- form:{
- position:'',
- name:'',
- date: '',
- nickname:'',
- tel:'',
- course_name:'',
- class:'',
- population:'',
- schedule:'',
- remind:'无'
- },
- courseOption:[]
- }
+ form: {
+ position: '',
+ name: '',
+ date: '',
+ nickname: '',
+ tel: '',
+ course_name: '',
+ class: '',
+ population: '',
+ schedule: '',
+ remind: '无'
+ },
+ courseOption: []
+ }
},
- methods:{
+ methods: {
//表格中每个格子的风格
- cellStyle:function({row, column, rowIndex, columnIndex}){
- if (column.label!=''){
+ cellStyle: function ({row, column, rowIndex, columnIndex}) {
+ if (column.label != '') {
return 'cursor:pointer'
}
},
//点击格子促发的函数
- cellClick(row, column, cell, event) {
- console.log(row.index)
- this.aWeekValue.push(row.index,column.index)
+ async cellClick(row, column, cell, event) {
+ this.form.day = column.index
+ 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.aWeekValue.push(row.index, column.index)
//(待写)检索该格子的周数申请信息,被申请的周数使其样式变为disable
// let position = this.lab.position
// let rowIndex = row.index
@@ -169,142 +164,141 @@
// console.log(row.index)
// console.log(column.index)
- if (column.label!='') {
- this.weekDialog=true
- this.perTargetValue=event.target //用target对表格进行定位并保存致target对象
+ if (column.label != '') {
+ this.weekDialog = true
+ this.perTargetValue = event.target //用target对表格进行定位并保存致target对象
}
},
//点击表格操作栏申请按钮
- clickLabApply(row){
- this.lab=row
- this.form={
- position:'',
- name:'',
- date: '',
- nickname:'',
- tel:'',
- course_name:'',
- class:'',
- population:'',
- schedule:'',
- remind:'无'
+ clickLabApply(row) {
+ console.log(row)
+ this.lab = row
+ this.form = {
+ labId: row.lab_id,
+ position: row.position,
+ name: row.name,
+ nickname: this.user.nickname,
+ tel: this.user.tel,
+ class: '',
+ population: '',
+ remind: '无'
}
- this.formDialog=true
-
+ this.formDialog = true
},
//点击查看申请详情
- checkDetail(row){
- this.$router.push('/labApplyDetail/'+row.position) //发送该行的实验室地址作为参数,使得实验室申请详情可以获得此参数后请求并检索数据
+ checkDetail(row) {
+ this.$router.push('/labApplyDetail/' + row.position) //发送该行的实验室地址作为参数,使得实验室申请详情可以获得此参数后请求并检索数据
},
//当选择的课程发生改变触发此函数
- selectChange(){
- console.log('aaaaaa')
- var d=new Date()
- // this.form.position= this.lab.position //实验室地点
- // this.form.name= this.lab.name //实验室名称
- this.form.date=d.getFullYear()+'/'+(d.getMonth()+1)+'/'+d.getDate() //日期
- // this.form.nickname= this.user.nickname //昵称
- // this.form.tel= this.user.tel //电话
- // this.form.class= this.courseOption.class //班级
- // this.form.population= this.courseOption.population //人数
+ async selectChange(uc_id) {
+ let course = await get("lb/usercourse/findusercourse/" + uc_id)
+ this.form.class = course.classes
+ this.form.population = course.population
},
//添加已选择的的周数
async addWeek() {
- this.weekDialog=false
- var targetValue = this.$refs.weekSelection.checkedValue
- await showDialog("确认设置此时间段吗?",this)
- 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{
// if (vailid){
// this.courseDialog=true
// }
// })
- this.formDialog=false
+ this.formDialog = false
},
- cancelAppy:function () {
- this.formDialog=false
+ cancelAppy: function () {
+ this.formDialog = false
},
//跳转到我的申请记录
- toMyRecord(){
- this.$router.push('/teacher/myApplyRecord/'+this.user.u_id) //这里的user.u_id作为是作为路径参数存在
+ toMyRecord() {
+ this.$router.push('/teacher/myApplyRecord/' + this.user.u_id) //这里的user.u_id作为是作为路径参数存在
+ },
+ async loadCourse() {
+ this.courseOption = await get("lb/usercourse/findbyyearandsemester/" + this.$refs.timeSelection.year + "/" + this.$refs.timeSelection.semester)
}
},
//钩子函数,生命周期mouted
async mounted() {
- this.courseOption = get('',this.u_id) //发送教师id,返回该教师课程管理中所有的课程信息,是一个数组
+ // this.courseOption = get('',this.u_id) //发送教师id,返回该教师课程管理中所有的课程信息,是一个数组
//测试数据
- this.courseOption=[{
+ this.courseOption = [{
year: '1819',
semester: '2',
uc_id: '12345677',
@@ -315,11 +309,9 @@
isHaveDocuments: '1',
remind: '无',
}]
- // console.log(this.$refs.detailtb)
- console.log('this is mouted')
- console.log(this.$refs.weekSelection)
- var d = new Date()
this.tableData = await get('/lb/lab/getLabList')
+ this.user = await get('lb/user/getUserInfo')
+ await this.loadCourse()
}
}