123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531 |
- <template>
- <div class="m-container">
- <h2>
- <div class="squrt"></div>课表列表
- </h2>
- <div class="m-core">
- <!-- 搜索类型 -->
- <el-form :inline="true" class="searchForm" v-model.trim="searchForm">
- <el-form-item>
- <el-input
- v-model.trim="searchForm.search"
- @keyup.enter.native="search"
- placeholder="乐团名或VIP课名"
- />
- </el-form-item>
- <el-form-item>
- <el-select v-model.trim="searchForm.schoolId" clearable filterable placeholder="请选择教学点">
- <el-option
- v-for="(item, index) in schoolList"
- :key="index"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select
- v-model.trim="searchForm.teacherIdList"
- clearable
- filterable
- placeholder="请选择老师"
- >
- <el-option
- v-for="(item, index) in teacherList"
- :key="index"
- :value="item.id"
- :label="item.realName"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select
- class="multiple"
- v-model.trim="searchForm.organIdList"
- filterable
- clearable
- placeholder="请选择分部"
- >
- <el-option
- v-for="(item,index) in organList"
- :key="index"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select v-model.trim="searchForm.courseType" clearable filterable placeholder="课程类型">
- <el-option
- v-for="(item, index) in courseType"
- :key="index"
- :value="item.value"
- :label="item.label"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select v-model.trim="searchForm.courseStatus" clearable filterable placeholder="课程状态">
- <el-option label="未开始" value="NOT_START"></el-option>
- <el-option label="进行中" value="UNDERWAY"></el-option>
- <el-option label="已结束" value="OVER"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-date-picker
- v-model.trim="searchForm.timer"
- style="width:420px;"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- ></el-date-picker>
- </el-form-item>
- <el-form-item>
- <div class="searchBtn" @click="search">搜索</div>
- </el-form-item>
- <el-form-item>
- <div
- class="searchBtn exportBtn"
- v-permission="'export/superFindCourseSchedules'"
- @click="onCourseExport"
- >导出课表</div>
- </el-form-item>
- </el-form>
- <div class="btnWraps"></div>
- <!-- 列表 -->
- <div class="tableWrap">
- <el-table :data="tableList" :header-cell-style="{background:'#EDEEF0',color:'#444'}">
- <el-table-column align="center" prop="organName" label="分部名称"></el-table-column>
- <el-table-column align="center" prop="id" label="课程编号"></el-table-column>
- <el-table-column align="center" width="200px" label="时间">
- <template
- slot-scope="scope"
- >{{ scope.row.startClassTime ? scope.row.startClassTime.substr(0, 16) : '' }}-{{ scope.row.endClassTime ? scope.row.endClassTime.substr(11,5) : ''}}</template>
- </el-table-column>
- <el-table-column align="center" prop="groupName" label="乐团/VIP名"></el-table-column>
- <el-table-column align="center" prop="classGroupName" label="班级名称"></el-table-column>
- <el-table-column align="center" prop="studentId" label="学生id">
- <template slot-scope="scope">
- <div v-if="scope.row.groupType != 'MUSIC'">{{scope.row.studentId}}</div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="subjectName" label="声部"></el-table-column>
- <el-table-column align="center" prop="name" label="课程名称"></el-table-column>
- <el-table-column align="center" label="课程类型">
- <template slot-scope="scope">
- <div>{{ scope.row.type | coursesType}}</div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="教学模式">
- <template slot-scope="scope">
- <div>{{ scope.row.teachMode | teachMode}}</div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="schoolName" label="教学点">
- <template slot-scope="scope">
- <div>{{scope.row.schoolName?scope.row.schoolName:'网络教室'}}</div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="courseScheduleStatus" label="课程状态">
- <template slot-scope="scope">
- <div>{{ scope.row.status | coursesStatus }}</div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="是否签到">
- <template slot-scope="scope">
- <div>{{ scope.row.isSignIn | attendanceType}}</div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="是否签退" fixed="right">
- <template slot-scope="scope">
- <div>{{ scope.row.isSignOut | attendanceOutType}}</div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="isCallNames" label="是否点名" fixed="right">
- <template slot-scope="scope">{{ scope.row.isCallNames ? '是' : '否' }}</template>
- </el-table-column>
- <el-table-column align="center" prop="teacherName" label="指导老师" fixed="right"></el-table-column>
- <el-table-column align="center" label="详情" fixed="right" width="120px">
- <template slot-scope="scope">
- <div>
- <el-button type="text" v-if="permission('teamCourseList/details')" @click="lookDetail(scope.row)">详情</el-button>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- :total="rules.total"
- :page.sync="rules.page"
- :limit.sync="rules.limit"
- :page-sizes="rules.page_size"
- @pagination="getList"
- />
- </div>
- </div>
- <el-dialog
- title="课表详情"
- :visible.sync="classVisible"
- :before-close="closeClassVisible"
- width="1000px">
- <el-form :model="maskForm" :inline="true">
- <el-form-item label="老师姓名">
- <!-- <el-input v-model.trim="maskForm.teacherName"
- disabled></el-input>-->
- <div class="inputStyle">{{maskForm.teacherName}}</div>
- </el-form-item>
- <el-form-item label="课程模式">
- <!-- <el-input :value="maskForm.teachMode | teachMode"
- disabled></el-input>-->
- <div class="inputStyle">{{maskForm.teachMode| teachMode}}</div>
- <!-- <span>{{maskForm.teachMode }}</span> -->
- </el-form-item>
- <el-form-item label="课程类型">
- <!-- <el-input :value="maskForm.type |classType"
- disabled></el-input>-->
- <div class="inputStyle">{{maskForm.type|coursesType}}</div>
- </el-form-item>
- <!-- courseScheduleStatus -->
- <el-form-item label="课程状态">
- <!-- <el-input :value="maskForm.type |classType"
- disabled></el-input>-->
- <div class="inputStyle">{{maskForm.status | coursesStatus}}</div>
- </el-form-item>
- <el-form-item label="签到时间">
- <!-- <el-input v-model.trim=" maskForm.signInTime"
- disabled></el-input>-->
- <div class="inputStyle">{{maskForm.signInTime | dateForMinFormat}}</div>
- </el-form-item>
- <el-form-item label="签退时间">
- <!-- <el-input v-model.trim="maskForm.signOutTime"
- disabled></el-input>-->
- <div class="inputStyle">{{maskForm.signOutTime | dateForMinFormat}}</div>
- </el-form-item>
- <el-form-item label="是否点名">
- <!-- <el-input :value="maskForm.isCallNames | isCall"
- disabled></el-input>-->
- <div class="inputStyle">{{maskForm.isCallNames | isCall}}</div>
- </el-form-item>
- <el-form-item label="签到状态">
- <!-- <el-input :value=" maskForm.isSignIn | attendanceType"
- disabled></el-input>-->
- <div
- class="inputStyle"
- :class="maskForm.isSignIn==1?'':'red'"
- >{{ maskForm.isSignIn | attendanceType}}</div>
- </el-form-item>
- <el-form-item label="签退状态">
- <!-- <el-input :value=" maskForm.isSignOut | attendanceOutType"
- disabled></el-input>-->
- <div
- class="inputStyle"
- :class="maskForm.isSignIn==1?'':'red'"
- >{{ maskForm.isSignOut | attendanceOutType}}</div>
- </el-form-item>
- <el-form-item label="备注">
- <!-- <el-input :value=" maskForm.isSignOut | attendanceOutType"
- disabled></el-input>-->
- <div class="inputStyle">{{ maskForm.remark}}</div>
- </el-form-item>
- </el-form>
- <el-tabs
- v-model.trim="activeName"
- v-if="maskForm.status != 'NOT_START'"
- type="card"
- @tab-click="handleClick"
- >
- <el-tab-pane label="点名" name="first">
- <div v-if="activeName == 'first'">
- <!-- studentRollCall -->
- <studentRollCall :courseScheduleId="maskForm.id"></studentRollCall>
- </div>
- </el-tab-pane>
- <el-tab-pane label="GPS定位" v-if="maskForm.teachMode == 'OFFLINE'" name="second">
- <div v-if="activeName == 'second'">
- <gpsLoction :courseScheduleId="maskForm.id"></gpsLoction>
- </div>
- </el-tab-pane>
- <el-tab-pane label="作业" v-if="maskForm.type != 'VIP'" name="third">
- <div v-if="activeName == 'third'">
- <studentWork :courseScheduleId="maskForm.id"></studentWork>
- </div>
- </el-tab-pane>
- <el-tab-pane
- label="评论"
- v-if="maskForm.type == 'VIP' || maskForm.type == 'PRACTICE'"
- name="four"
- >
- <div v-if="activeName == 'four'">
- <courseEvaluate :courseScheduleId="maskForm.id"></courseEvaluate>
- </div>
- </el-tab-pane>
- </el-tabs>
- </el-dialog>
- </div>
- </template>
- <script>
- import pagination from "@/components/Pagination/index";
- import {
- getTeacher,
- getMusicGroupAllClass,
- superFindCourseSchedules,
- getEmployeeOrgan
- } from "@/api/buildTeam";
- import { getSchool } from "@/api/systemManage";
- import { courseType } from "@/utils/searchArray";
- import studentRollCall from "./componentCourse/studentRollCall";
- import gpsLoction from "./componentCourse/gpsLocation";
- import studentWork from "./componentCourse/studentWork";
- import courseEvaluate from "./componentCourse/courseEvaluate";
- import { permission } from "@/utils/directivePage";
- import axios from "axios";
- import { getToken } from "@/utils/auth";
- import load from "@/utils/loading";
- let nowTime = new Date();
- nowTime =
- nowTime.getFullYear() +
- "-" +
- (nowTime.getMonth() + 1) +
- "-" +
- nowTime.getDate();
- export default {
- data() {
- return {
- classVisible: false,
- timerVisible: false,
- courseVisible: false,
- courseType: courseType,
- searchForm: {
- organIdList: null,
- courseStatus: null,
- courseType: null,
- timer: [nowTime, nowTime], // 时间
- class: null,
- search: null, // 乐团名称 编号 vip课名称
- teacherIdList: null, // 老师编号
- schoolId: null // 教学点编号
- },
- tableList: [],
- searchLsit: [],
- organList: [],
- rules: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50] // 选择限制显示条数
- },
- teacherList: [],
- schoolList: [],
- maskForm: {},
- activeName: "first"
- // classList: []
- };
- },
- components: {
- pagination,
- studentRollCall,
- gpsLoction,
- studentWork,
- courseEvaluate
- },
- activated() {
- this.init();
- },
- mounted() {
- this.init();
- },
- methods: {
- init() {
- this.getList();
- // 获取所有老师
- getTeacher().then(res => {
- if (res.code == 200) {
- this.teacherList = res.data;
- }
- });
- // 获取教学点
- getSchool().then(res => {
- if (res.code == 200) {
- this.schoolList = res.data;
- }
- });
- getEmployeeOrgan().then(res => {
- if (res.code == 200) {
- this.organList = res.data;
- }
- });
- },
- permission(str, parent) {
- return permission(str, parent);
- },
-
- search() {
- this.rules.page = 1;
- this.getList();
- },
- onCourseExport() {
- // 课表导出
- let searchForm = this.searchForm;
- if (!searchForm.timer || searchForm.timer.length <= 0) {
- searchForm.timer = [];
- this.$message.error("请选择时间段");
- return;
- }
- let obj = {
- courseStatus: searchForm.courseStatus || null,
- courseType: searchForm.courseType || null,
- startTime: searchForm.timer[0] || null,
- endTime: searchForm.timer[1] || null,
- classGroupId: searchForm.class || null,
- organIdList: searchForm.organIdList || null,
- search: searchForm.search || null,
- teacherIdList: searchForm.teacherIdList || null,
- schoolId: searchForm.schoolId || null
- };
- let url = "/api-web/export/superFindCourseSchedules";
- const options = {
- method: "get",
- headers: {
- Authorization: getToken()
- },
- params: obj,
- url,
- responseType: "blob"
- };
- this.$confirm("您确定导出报表", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- load.startLoading();
- axios(options)
- .then(res => {
- let blob = new Blob([res.data], {
- // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
- type: "application/vnd.ms-excel;charset=utf-8"
- //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
- });
- let text = new Response(blob).text();
- text.then(res => {
- // 判断是否报错
- if (res.indexOf("code") != -1) {
- let json = JSON.parse(res);
- this.$message.error(json.msg);
- } else {
- let objectUrl = URL.createObjectURL(blob);
- let link = document.createElement("a");
- let fname = "课表列表" + new Date().getTime(); //下载文件的名字
- link.href = objectUrl;
- link.setAttribute("download", fname);
- document.body.appendChild(link);
- link.click();
- }
- });
- load.endLoading();
- })
- .catch(error => {
- this.$message.error("导出数据失败,请连接管理员");
- load.endLoading();
- });
- })
- .catch(() => {});
- },
- getList() {
- let searchForm = this.searchForm;
- if (!searchForm.timer || searchForm.timer.length <= 0) {
- searchForm.timer = [];
- this.$message.error("请选择时间段");
- return;
- }
- let obj = {
- courseStatus: searchForm.courseStatus || null,
- courseType: searchForm.courseType || null,
- startTime: searchForm.timer[0] || null,
- endTime: searchForm.timer[1] || null,
- page: this.rules.page,
- rows: this.rules.limit,
- classGroupId: searchForm.class || null,
- organIdList: searchForm.organIdList || null,
- search: searchForm.search || null,
- teacherIdList: searchForm.teacherIdList || null,
- schoolId: searchForm.schoolId || null
- };
- superFindCourseSchedules(obj).then(res => {
- if (res.code == 200) {
- this.tableList = res.data.rows;
- this.rules.total = res.data.total;
- }
- });
- },
- lookDetail(row) {
- this.maskForm = row;
- this.activeName = "first";
- // console.log(row)
- this.classVisible = true;
- },
- handleClick(tab, event) {
- // console.log(tab, event);
- },
- closeClassVisible() {
- this.activeName = null;
- this.classVisible = false;
- }
- },
- filters: {
- isCall(val) {
- if (val == 0) {
- return "未点名";
- } else if (val == 1) {
- return "已点名";
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .visible {
- visibility: hidden;
- }
- .cl-container {
- .topFrom {
- margin: 20px 30px 0;
- .classlist {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- align-items: center;
- ul {
- li {
- list-style: none;
- }
- }
- }
- }
- .searchForm {
- margin: 0 30px;
- }
- }
- .btnWraps {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- div {
- margin-right: 20px;
- }
- }
- .inputStyle {
- width: 180px;
- }
- .red {
- color: red;
- }
- .exportBtn {
- background: #13817a;
- }
- </style>
|