Commit 4d45c472 authored by 黄奎's avatar 黄奎

页面修改

parent 3a5d2e64
...@@ -2,325 +2,240 @@ ...@@ -2,325 +2,240 @@
<div class="page-body MainPlan xg"> <div class="page-body MainPlan xg">
<div class="col row wrap q-col-gutter-md"> <div class="col row wrap q-col-gutter-md">
<div class="col-2"> <div class="col-2">
<el-select <el-select v-model="msg.TeacherId" style="width: 100%" placeholder="教师" size="small"
v-model="msg.TeacherId" @change="getTypeWay()">
style="width: 100%" <el-option v-for="item in TeacherList" :key="item.TeacherName" :label="item.TeacherName" :value="item.TId">
placeholder="教师"
size="small"
@change="getTableList()"
>
<el-option
v-for="item in TeacherList"
:key="item.TeacherName"
:label="item.TeacherName"
:value="item.TId"
>
</el-option> </el-option>
<div <div slot="prefix" class="full-height flex items-center" style="color: #000; padding-right: 10px">
slot="prefix"
class="full-height flex items-center"
style="color: #000; padding-right: 10px"
>
教师: 教师:
</div> </div>
</el-select> </el-select>
</div> </div>
<div class="col-2"> <div class="col-2">
<el-select <el-select v-model="msg.ClassRoomId" style="width: 100%" placeholder="教室" size="small" @change="getTypeWay()">
v-model="msg.ClassRoomId" <el-option v-for="item in ClassRoomList" :key="item.RoomName" :label="item.RoomName" :value="item.RoomId">
style="width: 100%"
placeholder="教室"
size="small"
@change="getTypeWay()"
>
<el-option
v-for="item in ClassRoomList"
:key="item.RoomName"
:label="item.RoomName"
:value="item.RoomId"
>
</el-option> </el-option>
<div <div slot="prefix" class="full-height flex items-center" style="color: #000; padding-right: 10px">
slot="prefix"
class="full-height flex items-center"
style="color: #000; padding-right: 10px"
>
教室: 教室:
</div> </div>
</el-select> </el-select>
</div> </div>
<div class="col-2"> <div class="col-2">
<el-date-picker <el-date-picker v-model="msg.StartTime" type="date" value-format="yyyy-MM-dd" placeholder="开始日期" size="small"
v-model="msg.StartTime" style="width: 100%" @change="getTypeWay()" :picker-options="picker" :clearable="false">
type="date"
value-format="yyyy-MM-dd"
placeholder="开始日期"
size="small"
style="width: 100%"
@change="getTypeWay()"
:picker-options="picker"
:clearable="false"
>
</el-date-picker> </el-date-picker>
</div> </div>
<div class="col-2"> <div class="col-2">
<el-date-picker <el-date-picker v-model="msg.EndTime" type="date" value-format="yyyy-MM-dd" placeholder="结束日期" size="small"
v-model="msg.EndTime" style="width: 100%" @change="getTypeWay()" clear-icon="iconfont icon-guanbi" :picker-options="pickerEnd"
type="date" :clearable="false">
value-format="yyyy-MM-dd"
placeholder="结束日期"
size="small"
style="width: 100%"
@change="getTypeWay()"
clear-icon="iconfont icon-guanbi"
:picker-options="pickerEnd"
:clearable="false"
>
</el-date-picker> </el-date-picker>
</div> </div>
<div class="col-2"> <div class="col-2">
<el-select <el-select v-model="msg.ClassType" style="width: 100%" placeholder="类型" size="small" @change="getTypeWay()">
v-model="msg.ClassType"
style="width: 100%"
placeholder="类型"
size="small"
@change="getTypeWay()"
>
<el-option :key="0" label="全部" :value="0"> </el-option> <el-option :key="0" label="全部" :value="0"> </el-option>
<el-option :key="1" label="正常" :value="1"> </el-option> <el-option :key="1" label="正常" :value="1"> </el-option>
<el-option :key="2" label="试听课" :value="2"> </el-option> <el-option :key="2" label="试听课" :value="2"> </el-option>
<div <div slot="prefix" class="full-height flex items-center" style="color: #000; padding-right: 10px">
slot="prefix"
class="full-height flex items-center"
style="color: #000; padding-right: 10px"
>
状态: 状态:
</div> </div>
</el-select> </el-select>
</div> </div>
<div class="col-2"> <div class="col-2">
<!-- <q-btn
color="accent"
size="sm"
class="q-mr-md"
style="margin-top: 2px"
@click="exchangeType"
:label="typeName"
/> -->
<!-- <q-btn
color="negative"
size="sm"
label="调课申请"
@click="openForm"
></q-btn> -->
</div> </div>
</div> </div>
<!-- <classmateForm :dataList="dataList" v-if="commonType == 1"></classmateForm> --> <teachTable v-if="commonType == 2" :tableData="tableData" :PageCount="PageCount" :setMsg="tabMsg" :showCZ="true"
<!-- <change-class-form @getChange="getChange"></teachTable>
v-if="persistent"
@close="closeSaveForm"
@success="refreshPage"
></change-class-form> -->
<teachTable
v-if="commonType == 2"
:tableData="tableData"
:PageCount="PageCount"
:setMsg="tabMsg"
:showCZ="true"
@getChange="getChange"
></teachTable>
</div> </div>
</template> </template>
<script> <script>
import { import {
getTeacherDropDownList, getTeacherDropDownList,
queryClassRoomList, queryClassRoomList,
} from "../../api/school/index"; } from "../../api/school/index";
import { import {
GetClassPlanStatistical, GetClassPlanStatistical,
GetClassPlanStatisticalPage, GetClassPlanStatisticalPage,
} from "../../api/teacher/index"; } from "../../api/teacher/index";
import classmateForm from "../../components/course/classmate-form"; import classmateForm from "../../components/course/classmate-form";
import teachTable from "../teacher/components/teachTable"; import teachTable from "../teacher/components/teachTable";
import changeClassForm from "../../components/teacher/changeClassForm.vue"; import changeClassForm from "../../components/teacher/changeClassForm.vue";
export default { export default {
meta: { meta: {
title: "我的课表", title: "我的课表",
}, },
components: { components: {
classmateForm, classmateForm,
teachTable, teachTable,
changeClassForm, changeClassForm,
}, },
data() { data() {
return { return {
persistent: false, persistent: false,
TeacherList: [], //教师团队 TeacherList: [], //教师团队
ClassRoomList: [], // ClassRoomList: [], //
StartTime: "",
EndTime: "",
TeacherId: 0,
ClassRoomId: 0,
dataList: {},
activeNames: [1],
msg: {
StartTime: "",
EndTime: "",
TeacherId: 0,
ClassRoomId: 0,
ClassType: 0,
},
commonType: 2, //1日历模式 2列表模式
typeName: "列表模式",
tabMsg: {
PageIndex: 1,
PageSize: 12,
rowsPerPage: 12,
StartTime: "", StartTime: "",
EndTime: "", EndTime: "",
TeacherId: 0, TeacherId: 0,
ClassRoomId: 0, ClassRoomId: 0,
ClassType: 0, dataList: {},
OrderBy: 1, msg: {
}, StartTime: "",
tableData: [], //表格数据 EndTime: "",
PageCount: 0, TeacherId: 0,
picker: { ClassRoomId: 0,
disabledDate: (time) => { ClassType: 0,
if (this.msg.EndTime == null) { },
commonType: 2, //1日历模式 2列表模式
typeName: "列表模式",
tabMsg: {
PageIndex: 1,
PageSize: 12,
rowsPerPage: 12,
StartTime: "",
EndTime: "",
TeacherId: 0,
ClassRoomId: 0,
ClassType: 0,
OrderBy: 1,
},
tableData: [], //表格数据
PageCount: 0,
picker: {
disabledDate: (time) => {
if (this.msg.EndTime == null) {
return false; return false;
} else { } else {
let endTime = new Date(this.msg.EndTime); let endTime = new Date(this.msg.EndTime);
return endTime.getTime() < time.getTime(); return endTime.getTime() < time.getTime();
} }
},
}, },
}, pickerEnd: {
pickerEnd: { disabledDate: (time) => {
disabledDate: (time) => { let startTime = new Date(this.msg.StartTime);
let startTime = new Date(this.msg.StartTime); return startTime.getTime() >= time.getTime();
return startTime.getTime() >= time.getTime(); },
}, },
}, today: "",
today: "", };
};
},
created() {
if (this.$route.query && this.$route.query.ClassType) {
this.msg.ClassType = this.$route.query.ClassType;
}
let date = new Date();
let today =
date.getFullYear() +
"-" +
(date.getMonth() < 9
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1) +
"-" +
(date.getDate() < 10 ? "0" + date.getDate() : date.getDate());
this.today = today;
this.msg.StartTime = today;
this.tabMsg.StartTime = today;
this.msg.EndTime = today;
this.tabMsg.EndTime = today;
// let userinfo = this.getLocalStorage();
// this.msg.TeacherId = userinfo.AccountId;
// this.tabMsg.TeacherId = userinfo.AccountId;
this.getClassRoomList();
},
mounted() {
this.GetTeacherList();
this.getTableList();
},
methods: {
refreshPage() {
this.getPlanList();
}, },
openForm() { created() {
this.persistent = true; if (this.$route.query && this.$route.query.ClassType) {
this.msg.ClassType = this.$route.query.ClassType;
}
let date = new Date();
let today =
date.getFullYear() +
"-" +
(date.getMonth() < 9 ?
"0" + (date.getMonth() + 1) :
date.getMonth() + 1) +
"-" +
(date.getDate() < 10 ? "0" + date.getDate() : date.getDate());
this.today = today;
this.msg.StartTime = today;
this.tabMsg.StartTime = today;
this.msg.EndTime = today;
this.tabMsg.EndTime = today;
this.getClassRoomList();
}, },
closeSaveForm() { mounted() {
this.persistent = false; this.GetTeacherList();
this.getTableList();
}, },
// 获取校区教室导航列表 methods: {
getPlanList() { refreshPage() {
GetClassPlanStatistical(this.msg) this.getPlanList();
.then((res) => { },
openForm() {
this.persistent = true;
},
closeSaveForm() {
this.persistent = false;
},
// 获取校区教室导航列表
getPlanList() {
GetClassPlanStatistical(this.msg)
.then((res) => {
if (res.Code == 1) {
this.dataList = res.Data;
}
})
.catch(() => {});
},
//获取教师下拉
GetTeacherList() {
getTeacherDropDownList({}).then((res) => {
if (res.Code == 1) { if (res.Code == 1) {
this.dataList = res.Data; this.TeacherList = res.Data;
var obj = {
TeacherName: "请选择",
TId: 0,
};
this.TeacherList.unshift(obj);
} }
}) });
.catch(() => {}); },
}, //获取教室下拉
//获取教师下拉 getClassRoomList() {
GetTeacherList() { queryClassRoomList({}).then((res) => {
getTeacherDropDownList({}).then((res) => { if (res.Code == 1) {
if (res.Code == 1) { this.ClassRoomList = res.Data;
this.TeacherList = res.Data; var obj = {
var obj = { RoomName: "请选择",
TeacherName: "请选择", RoomId: 0,
TId: 0, };
}; this.ClassRoomList.unshift(obj);
this.TeacherList.unshift(obj); }
});
},
exchangeType() {
if (this.commonType == 1) {
this.commonType = 2;
this.typeName = "日历模式";
this.getTableList();
} else {
this.commonType = 1;
this.typeName = "列表模式";
this.getPlanList();
} }
}); },
}, getTableList() {
//获取教室下拉 if (Date.parse(this.msg.StartTime) > Date.parse(this.msg.EndTime)) {
getClassRoomList() { this.msg.StartTime = "";
queryClassRoomList({}).then((res) => {
if (res.Code == 1) {
this.ClassRoomList = res.Data;
var obj = {
RoomName: "请选择",
RoomId: 0,
};
this.ClassRoomList.unshift(obj);
} }
}); this.tabMsg.StartTime = this.msg.StartTime;
}, this.tabMsg.EndTime = this.msg.EndTime;
exchangeType() { this.tabMsg.ClassRoomId = this.msg.ClassRoomId;
if (this.commonType == 1) { this.tabMsg.ClassType = this.msg.ClassType;
this.commonType = 2; this.tabMsg.TeacherId=this.msg.TeacherId;
this.typeName = "日历模式"; GetClassPlanStatisticalPage(this.tabMsg).then((res) => {
if (res.Code == 1) {
this.tableData = res.Data.PageData;
this.PageCount = res.Data.PageCount;
}
});
},
getChange(val) {
this.tabMsg.PageIndex = val;
this.getTableList(); this.getTableList();
} else { },
this.commonType = 1; getTypeWay() {
this.typeName = "列表模式"; if (this.commonType == 2) {
this.getPlanList(); this.getTableList();
} } else {
}, this.getPlanList();
getTableList() {
if (Date.parse(this.msg.StartTime) > Date.parse(this.msg.EndTime)) {
this.msg.StartTime = "";
}
this.tabMsg.StartTime = this.msg.StartTime;
this.tabMsg.EndTime = this.msg.EndTime;
this.tabMsg.ClassRoomId = this.msg.ClassRoomId;
this.tabMsg.ClassType = this.msg.ClassType;
GetClassPlanStatisticalPage(this.tabMsg).then((res) => {
if (res.Code == 1) {
this.tableData = res.Data.PageData;
this.PageCount = res.Data.PageCount;
} }
}); },
},
getChange(val) {
this.tabMsg.PageIndex = val;
this.getTableList();
},
getTypeWay() {
if (this.commonType == 2) {
this.getTableList();
} else {
this.getPlanList();
}
}, },
}, };
};
</script> </script>
<style lang="scss"> <style lang="scss">
.xg .el-input--prefix .el-input__inner { .xg .el-input--prefix .el-input__inner {
padding-left: 50px; padding-left: 50px;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment