123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- <template>
- <div class="studentvip">
- <!-- 搜索类型 -->
- <save-form
- :inline="true"
- class="searchForm"
- :model="searchForm"
- @submit="onSearch"
- save-key="studentDetail-studentVip"
- >
- <el-form-item>
- <el-input
- placeholder="课程名称"
- clearable
- @keyup.enter.native="onSearch"
- v-model.trim="searchForm.vipGroupName"
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-button native-type="submit" type="danger">搜索</el-button>
- </el-form-item>
- </save-form>
- <div class="tableWrap">
- <el-table
- :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
- :data="tableList"
- >
- <el-table-column label="VIP编号" align="center" prop="vipGroupId">
- <template slot-scope="scope">
- <copy-text>{{ scope.row.vipGroupId }}</copy-text>
- </template>
- </el-table-column>
- <el-table-column
- label="VIP课名称"
- align="center"
- prop="vipGroupName"
- >
- <template slot-scope="scope">
- <copy-text>{{ scope.row.vipGroupName }}</copy-text>
- </template>
- </el-table-column>
- <el-table-column label="VIP课状态" align="center">
- <template slot-scope="scope">{{
- scope.row.vipGroupStatus | vipCourseStatus
- }}</template>
- </el-table-column>
- <el-table-column
- label="指导老师"
- align="center"
- prop="teacherName"
- ></el-table-column>
- <el-table-column
- label="乐团主管"
- align="center"
- prop="eduTeacherName"
- ></el-table-column>
- <el-table-column
- label="班级人数"
- align="center"
- prop="studentNum"
- ></el-table-column>
- <el-table-column
- label="活动方案"
- align="center"
- prop="activeName"
- ></el-table-column>
- <el-table-column
- label="开课时间"
- width="150"
- align="center"
- prop="courseStartDate"
- >
- <template slot-scope="scope">{{
- scope.row.courseStartDate | dateForMinFormat
- }}</template>
- </el-table-column>
- <el-table-column
- label="当前课次"
- align="center"
- prop="currentClassTimes"
- >
- <template slot-scope="scope"
- >{{ scope.row.currentClassTimes }}/{{
- scope.row.totalClassTimes
- }}</template
- >
- </el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <el-button
- @click="onCourse(scope.row)"
- v-permission="'studentManage/findStudentVipGroups'"
- type="text"
- >课表</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <pagination
- save-key="studentDetail-studentVip"
- sync
- :total.sync="pageInfo.total"
- :page.sync="pageInfo.page"
- :limit.sync="pageInfo.limit"
- :page-sizes="pageInfo.page_size"
- @pagination="getCourseList"
- />
- <el-dialog :title="dialogTitle" :visible.sync="dialogTableVisible">
- <el-table :data="gridData">
- <el-table-column
- prop="courseDate"
- label="时间"
- align="center"
- width="150"
- >
- <template slot-scope="scope">{{
- scope.row.courseDate | dateForMinFormat
- }}</template>
- </el-table-column>
- <el-table-column
- prop="classGroupName"
- label="课程名称"
- align="center"
- width="200"
- ></el-table-column>
- <el-table-column label="课程类型" align="center">
- <template slot-scope="scope">{{
- scope.row.teachMode == "ONLINE" ? "线上" : "线下"
- }}</template>
- </el-table-column>
- <el-table-column prop="courseStatus" align="center" label="课程状态">
- <template slot-scope="scope">{{
- scope.row.courseStatus | coursesStatus
- }}</template>
- </el-table-column>
- </el-table>
- </el-dialog>
- </div>
- </div>
- </template>
- <script>
- import pagination from "@/components/Pagination/index";
- import {
- findStudentVipGroups,
- findStudentVipGroupClass,
- findStudentCourses,
- } from "@/api/studentManager";
- export default {
- name: "studentvip",
- components: { pagination },
- data() {
- return {
- searchForm: {
- studentId: null,
- vipGroupName: null
- },
- checkIndex: null, // 选中的课程
- dialogTableVisible: false,
- searchLsit: [],
- tableList: [],
- courseList: [],
- pageInfo: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50], // 选择限制显示条数
- },
- dialogTitle: "",
- gridData: [],
- userId: "",
- };
- },
- created() {
- this.userId = this.$route.query.userId || null;
- },
- mounted() {
- this.userId = this.$route.query.userId || null;
- this.searchForm.studentId = this.$route.query.userId;
- this.getCourseList();
- },
- activated() {
- this.userId = this.$route.query.userId || null;
- this.searchForm.studentId = this.$route.query.userId;
- this.getCourseList();
- },
- methods: {
- // onCheckCourse(item) {
- // this.checkIndex = item.id
- // this.getList()
- // },
- getCourseList() {
- let params = this.searchForm;
- params.rows = this.pageInfo.limit;
- params.page = this.pageInfo.page;
- findStudentVipGroupClass(params).then((res) => {
- if (res.code == 200) {
- this.tableList = res.data.rows;
- this.pageInfo.total = res.data.total;
- }
- });
- },
- onCourse(row) {
- findStudentVipGroups({
- vipGroupId: row.vipGroupId,
- studentId: this.userId,
- }).then((res) => {
- this.dialogTitle = row.vipGroupName;
- if (res.code == 200) {
- this.gridData = res.data.rows;
- this.dialogTableVisible = true;
- }
- });
- },
- onSearch() {
- this.pageInfo.page = 1;
- this.getCourseList();
- },
- // getList() {
- // findStudentCourses({
- // vipGroupId: this.checkIndex,
- // rows: this.pageInfo.limit,
- // page: this.pageInfo.page
- // }).then(res => {
- // if(res.code ==200) {
- // this.tableList = res.data.rows
- // this.pageInfo.total = res.data.total
- // }
- // })
- // }
- },
- };
- </script>
- <style lang="scss">
- .studentvip {
- .topCard {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- margin-bottom: 30px;
- .cardItem {
- margin-right: 15px;
- width: 300px;
- height: 130px;
- padding: 20px 24px;
- box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.1);
- box-sizing: border-box;
- border-radius: 6px;
- .top {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- margin-bottom: 23px;
- .name {
- font-size: 14px;
- color: #323c47;
- font-weight: 500;
- }
- .type {
- font-size: 14px;
- color: #aaa;
- }
- }
- .bottom {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- text-align: center;
- p {
- font-size: 14px;
- color: #444;
- }
- .title {
- color: #aaa;
- margin-bottom: 8px;
- }
- }
- }
- .cardItem.active {
- background-color: #14928a;
- .name {
- font-size: 14px;
- color: #fff;
- font-weight: 500;
- }
- .type {
- font-size: 14px;
- color: #fff;
- }
- .bottom {
- p {
- color: #fff;
- }
- .title {
- color: #fff;
- }
- }
- }
- }
- }
- </style>
|