[fix][V]:完善周次选择器

master
aiyadc 5 years ago
parent 1087cbf408
commit ce8ffdc3db

@ -10,7 +10,7 @@
active-text-color="#ffd04b"
router>
<el-menu-item index="1" route="../">首页</el-menu-item>
<el-menu-item index="2" route="labApply">审核</el-menu-item>
<el-menu-item index="2" route="managerCheck">审核</el-menu-item>
<el-menu-item index="3" route="labManager">实验室管理</el-menu-item>
<drop-down-user :user="nickname" @back="backLogin" @goPersonal="goPersonal"></drop-down-user>
</el-menu>

@ -4,13 +4,13 @@
:visible.sync="addLabDialog"
width="48%">
<div style="width: 100%;height: 120% ">
<el-form :model="form">
<el-form :model="form" ref="form">
<el-form-item label="位置" label-width="100px">
<el-form-item label="位置" prop="position" label-width="100px" :rules="[{ required: true, message: '请输入位置', trigger: 'blur' }]">
<el-input v-model="form.position" placeholder="位置"></el-input>
</el-form-item>
<el-form-item label="实验室名称" label-width="100px">
<el-form-item label="实验室名称" prop="name" label-width="100px" :rules="[{ required: true, message: '请输入实验室名称', trigger: 'blur' }]">
<el-input v-model="form.name" placeholder="实验室名称"></el-input>
</el-form-item>
<!-- <el-col style="width:45%">-->
@ -23,15 +23,15 @@
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-form-item label="可容纳人数" label-width="100px">
<el-form-item label="可容纳人数" prop="capacity" label-width="100px" :rules="[{ required: true, message: '请输入工号', trigger: 'blur' }]">
<el-input v-model="form.capacity" placeholder="输入数量"></el-input>
</el-form-item>
<el-form-item label="软件" label-width="100px">
<el-form-item label="软件" prop="software" label-width="100px" :rules="[{ required: true, message: '请输入工号', trigger: 'blur' }]">
<el-input v-model="form.software" placeholder="输入实验室包含的软件"></el-input>
</el-form-item>
<el-form-item label="管理员" label-width="100px">
<el-form-item label="管理员" prop="manager_id" label-width="100px" :rules="[{ required: true, message: '请输入工号', trigger: 'blur' }]">
<el-select v-model="form.manager_id" style="width: 100%;">
<div v-for="item in userList">
<el-option :label="item.nickname" :value="item.uid"></el-option>

@ -12,7 +12,7 @@
<el-menu-item index="1" route="../">首页</el-menu-item>
<el-menu-item index="2" route="labManager">实验室管理</el-menu-item>
<el-menu-item index="3" route="userManage">用户管理</el-menu-item>
<el-menu-item index="4" route="check">审核</el-menu-item>
<el-menu-item index="4" route="supCheck">审核</el-menu-item>
<drop-down-user :user="nickname" @back="backLogin" @goPersonal="goPersonal"></drop-down-user>
</el-menu>
</div>

@ -4,7 +4,7 @@
<el-main>
<el-header>
<div>
<el-input type="text" style="max-width: 400px;float: left" placeholder="请输入查询关键字">
<el-input type="text" v-model="search" style="max-width: 400px;float: left" placeholder="请输入查询关键字">
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
</div>
@ -51,8 +51,8 @@
</el-table-column>
<el-table-column label="操作" width="100px" align="center">
<template slot-scope="scope">
<el-button @click="showDetail(scope.row)" :type="isCheck===0?'primary':'danger'" size="mini"
>{{isCheck===0?'审核':'重新审核'}}
<el-button @click="showDetail(scope.row)" :disabled="isCheck===0?false:true" :type="isCheck===0?'primary':'danger'" size="mini"
>审核
</el-button>
</template>
@ -77,6 +77,7 @@
},
data() {
return {
search:'',
isCheck:0,
tableData: []
}
@ -99,10 +100,28 @@
computed:{
tableDataComputed(){
if (this.isCheck===0){
return this.tableData.filter(data=>data.status===0)
}else {
return this.tableData.filter(data=>data.status===1 || data.status===2)
return this.tableData.filter(data=>data.status===0 && (!this.search ||
data.classes.toLowerCase().includes(this.search.toLowerCase())
|| data.course_name.toLowerCase().includes(this.search.toLowerCase())
|| data.lab_name.toLowerCase().includes(this.search.toLowerCase())
||data.population.toString().includes(this.search)
||data.position.toLowerCase().includes(this.search.toLowerCase())
||data.year.includes(this.search)
||data.day.toString().includes(this.search)
)
)
}else {
return this.tableData.filter(data=>(data.status===1 || data.status===2) && (!this.search ||
data.classes.toLowerCase().includes(this.search.toLowerCase())
|| data.course_name.toLowerCase().includes(this.search.toLowerCase())
|| data.lab_name.toLowerCase().includes(this.search.toLowerCase())
||data.population.toString().includes(this.search)
||data.position.toLowerCase().includes(this.search.toLowerCase())
||data.year.includes(this.search)
||data.day.toString().includes(this.search)
)
)
}
}

@ -36,6 +36,11 @@
name: '个人中心', func: () => {
this.$router.push('/supManager/index/personal')
}
},
{
name: '审核', func: () => {
this.$router.push('/supManager/index/check')
}
}
]
}

@ -175,7 +175,7 @@
computed: {
tableDataComputed() {
this.currenttableData=this.tableData.filter(data => !this.search
return this.currenttableData=this.tableData.filter(data => !this.search
|| data.name.toLowerCase().includes(this.search.toLowerCase())
|| data.position.toLowerCase().includes(this.search.toLowerCase())
|| data.software.toLowerCase().includes(this.search.toLowerCase())
@ -183,21 +183,6 @@
|| data.tel.toLowerCase().includes(this.search.toLowerCase())
)
if (this.currenttableData.name===null&&
this.currenttableData.position===null&&
this.currenttableData.software===null&&
this.currenttableData.nickname===null&&
this.currenttableData.tel===null) {
return null
}
else {
return this.tableData.filter(data => !this.search
|| data.name.toLowerCase().includes(this.search.toLowerCase())
|| data.position.toLowerCase().includes(this.search.toLowerCase())
|| data.software.toLowerCase().includes(this.search.toLowerCase())
|| data.nickname.toLowerCase().includes(this.search.toLowerCase())
|| data.tel.toLowerCase().includes(this.search.toLowerCase()))
}
}
},
@ -221,6 +206,8 @@
this.dialogFormVisible = true
},
async submit() {
this.$refs.addLab.$refs.form.validate(async (valid)=> {
if (valid) {
this.$refs.addLab.form.capacity = parseInt(this.$refs.addLab.form.capacity)
this.$refs.addLab.form.managerId = this.$refs.addLab.form.manager_id
if (this.$refs.addLab.form.lab_id) {
@ -232,8 +219,8 @@
showSuccess('编辑成功', this)
}).catch(() => {
showFail('编辑失败', this)
})
}
)
} else {
//
await showDialog('确认要新增吗?', this)
@ -249,6 +236,8 @@
})
}
this.$refs.addLab.addLabDialog = false
}
})
},
async addLab() {
const loading = showLoading('正在新增...', this)

@ -0,0 +1,137 @@
<template>
<div>
<el-container>
<el-main>
<el-header>
<div>
<el-input type="text" v-model="search" style="max-width: 400px;float: left" placeholder="请输入查询关键字">
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
</div>
</el-header>
<el-form style="align-content: center;margin:auto;">
<el-row>
<el-col style="border:1.5px lightslategrey;width:50%;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;">
<el-button style="width:100%;text-align:center;float:right;background-color: peachpuff" icon="el-icon-circle-plus-outline"
@click="isCheck=0" >待审核</el-button>
</el-col>
<el-col style="border:1.5px lightslategrey;width:50%;border-right-style:solid;border-bottom-style:solid;">
<el-button style="width:100%;text-align:center;float:right;background:silver" icon="el-icon-circle-plus-outline"
@click="isCheck=1" >已审核</el-button>
</el-col>
</el-row>
</el-form >
<el-table :data="tableDataComputed" border ref="mar" style="align-content: center;margin:auto;" :cell-style="cellStyle">
<el-table-column prop="position" label="实验室地点"></el-table-column>
<el-table-column prop="lab_name" label="实验室名称"></el-table-column>
<el-table-column prop="classes" 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 label="申请时间段" align="center">
<template slot-scope="scope">
{{parseInt(scope.row.year)}}-{{parseInt(scope.row.year)+1}}学年<br>
{{scope.row.semester}}学期<br>
{{scope.row.day}}{{scope.row.time}}节课<br>
{{scope.row.week}}
</template>
</el-table-column>
<el-table-column prop="status" label="状态" align="center">
<template slot-scope="scope">
<el-tag
:type="scope.row.status === 0 ? 'primary' : scope.row.status ===2 ? 'success': 'warning'"
disable-transitions>
{{scope.row.status ===0 ? '待审核' :
scope.row.status ===2 ? '审核通过': '未通过'}}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="100px" align="center">
<template slot-scope="scope">
<el-button @click="showDetail(scope.row)" :disabled="isCheck===0?false:true" :type="isCheck===0?'primary':'danger'" size="mini"
>审核
</el-button>
</template>
</el-table-column>
</el-table>
</el-main>
</el-container>
<apply-detail-dialog ref="detail" @complete="load"></apply-detail-dialog>
</div>
</template>
<script>
import tb_course from "~/components/tb_course";
import applyDetailDialog from "~/components/manager/applyDetailDialog";
import {get} from "~/utils";
import {arr2shortString} from "~/utils/converter";
export default {
components: {
tb_course,applyDetailDialog
},
data() {
return {
search:'',
isCheck:0,
tableData: []
}
},
methods:{
async load(){
this.tableData = await get('/lb/labrecord/getRecordList')
},
cellStyle(){
return ""
},
async showDetail(item){
const data = await get('lb/labrecord/getRecordDetail',item)
data.create_time = new Date(data.create_time).toLocaleString( )
data.weeks = arr2shortString(data.weeks)?'第'+arr2shortString(data.weeks)+'周':''
this.$refs.detail.data = data
this.$refs.detail.show = true
}
},
computed:{
tableDataComputed(){
if (this.isCheck===0){
return this.tableData.filter(data=>data.status===0 && (!this.search ||
data.classes.toLowerCase().includes(this.search.toLowerCase())
|| data.course_name.toLowerCase().includes(this.search.toLowerCase())
|| data.lab_name.toLowerCase().includes(this.search.toLowerCase())
||data.population.toString().includes(this.search)
||data.position.toLowerCase().includes(this.search.toLowerCase())
||data.year.includes(this.search)
||data.day.toString().includes(this.search)
)
)
}else {
return this.tableData.filter(data=>(data.status===1 || data.status===2) && (!this.search ||
data.classes.toLowerCase().includes(this.search.toLowerCase())
|| data.course_name.toLowerCase().includes(this.search.toLowerCase())
|| data.lab_name.toLowerCase().includes(this.search.toLowerCase())
||data.population.toString().includes(this.search)
||data.position.toLowerCase().includes(this.search.toLowerCase())
||data.year.includes(this.search)
||data.day.toString().includes(this.search)
)
)
}
}
},
async mounted() {
await this.load()
}
}
</script>
<style scoped>
</style>

@ -12,17 +12,22 @@
<el-button slot="append" icon="el-icon-search">查询</el-button>
</el-input>
</el-col>
<el-col :offset="11" :span="2">
<el-button type="danger" v-show="showDeleteBtn" @click="deleteSelections"></el-button>
</el-col>
</el-row>
</div>
<el-table :data="tableDataComputed" border>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="课程编号" prop="ucId"></el-table-column>
<el-table-column label="课程名称" prop="name"></el-table-column>
<el-table-column label="软件名称" prop="software"></el-table-column>
<el-table-column label="授课班级" prop="classes"></el-table-column>
<el-table-column label="授课人数" prop="population"></el-table-column>
<el-table-column label="是否有课件" prop="ishavedocuments" align="center">
<el-table :data="tableDataComputed" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column label="课程名称" prop="name" align="center"></el-table-column>
<el-table-column label="软件名称" prop="software" align="center"></el-table-column>
<el-table-column label="授课班级" prop="classes" align="center"></el-table-column>
<el-table-column label="授课人数" prop="population" align="center"></el-table-column>
<el-table-column label="是否有课件" prop="ishavedocuments" align="center"
:filters="[{text:'有课件',value:1},{text:'无课件',value:0}]"
:filter-method="isDocumentHandler"
>
<template slot-scope="scope">
<el-tag
:type="scope.row.ishavedocuments === 0 ? 'danger' : 'success'"
@ -30,7 +35,7 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" prop="remind"></el-table-column>
<el-table-column label="备注" prop="remind" align="center"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
@ -100,7 +105,7 @@
<el-option label="否" :value=0></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remind"">
<el-form-item label="备注" prop="remind">
<el-input v-model="courseForm.remind"></el-input>
</el-form-item>
</el-form>
@ -125,6 +130,7 @@
data() {
return {
search: '',
showDeleteBtn:false,
dialogForm: false,
edit: '',
user: {},
@ -188,7 +194,11 @@
showSuccess("删除成功", this)
this.load()
}).catch(e => {
if(e.message){
showFail("不可删除,该课程已与对应的实验室申请绑定 " , this)
}else {
showFail("删除失败 " + e.msg, this)
}
})
},
//
@ -245,6 +255,19 @@
cancel: function () {
this.$refs.courseForm.resetFields()
this.dialogForm = false
},
//
isDocumentHandler(value, row, column){
const property = column.property
return row[property] === value
},
handleSelectionChange(val) {
this.showDeleteBtn=val.length>1?true:false
this.multipleSelection = val;
// console.log('',val)
},
deleteSelections(){
//
}
},
//
@ -254,6 +277,8 @@
|| data.name.toLowerCase().includes(this.search.toLowerCase())
|| data.software.toLowerCase().includes(this.search.toLowerCase())
|| data.classes.toLowerCase().includes(this.search.toLowerCase())
|| data.remind.toLowerCase().includes(this.search.toLowerCase())
|| data.population.toString().includes(this.search)
)
}
},

@ -1,4 +1,4 @@
template>
<template>
<div id="app">
<img src="../assets/logo.png">
<div>

@ -14,17 +14,19 @@ import labApplyDetail from "~/pages/labApplyDetail";
import applyLab from "~/pages/teacher/applyLab";
import myApplyRecord from "~/pages/teacher/myApplyRecord";
import courseManagement from "~/pages/teacher/courseManagement";
import supHome from "~/components/supManager/home";
import supHome from "~/pages/supManager/home";
import supIndex from "~/components/supManager/index";
import globalPersonal from "~/components/personal";
import userManage from "~/components/supManager/userManage";
import labManager from "~/components/supManager/labManage";
import userManage from "~/pages/supManager/userManage";
import labManager from "~/pages/supManager/labManage";
import supCheck from "~/pages/supManager/supCheck";
//manager
import applyRecord from "~/pages/manager/applyRecord";
import managerHome from "~/components/manager/home"
import applyRecord from "~/pages/manager/managerCheck";
import managerHome from "~/pages/manager/home"
import managerIndex from "~/components/manager/index";
import managerCheck from "~/pages/manager/managerCheck";
// 要告诉 vue 使用 vueRouter
Vue.use(VueRouter);
@ -90,8 +92,8 @@ const routes = [
path: 'labApply',
component: applyRecord
},{
path: 'labManager',
component: labManager
path: 'check',
component: managerCheck
}
]
}]
@ -120,8 +122,8 @@ const routes = [
component: userManage
},
{
path: 'check',
component: applyRecord
path: 'supCheck',
component: supCheck
}
]
}

Loading…
Cancel
Save