| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-tabs v-model="activeName" @tab-click="handleClick"> |
| | | <el-tab-pane label="全部" name="first" /> |
| | | <el-tab-pane label="待续费" name="second" /> |
| | | <el-tab-pane label="已过期" name="third" /> |
| | | <el-tab-pane label="已停用" name="fourth" /> |
| | | <el-tab-pane label="全部" name="all" /> |
| | | <el-tab-pane label="待续费" name="pendingFees" /> |
| | | <el-tab-pane label="已过期" name="expired" /> |
| | | <el-tab-pane label="已停用" name="deactivated" /> |
| | | </el-tabs> |
| | | <div style="display: flex; flex-direction: row-reverse"> |
| | | <div style="display: flex; justify-content: space-between;"> |
| | | <el-button type="primary" size="small" @click="showCreate">新建学员</el-button> |
| | | <div style="width: 300px"> |
| | | <el-input |
| | | placeholder="按姓名搜索" |
| | | v-model="input3" |
| | | v-model="data.keyword" |
| | | class="input-with-select" |
| | | size="small" |
| | | > |
| | | <el-button slot="append" icon="el-icon-search"></el-button> |
| | | <el-button |
| | | slot="append" |
| | | icon="el-icon-search" |
| | | @click="fetchData" |
| | | ></el-button> |
| | | </el-input> |
| | | </div> |
| | | </div> |
| | |
| | | element-loading-text="Loading" |
| | | fit |
| | | > |
| | | <el-table-column label="姓名"> |
| | | <template slot-scope=""> xxxxx </template> |
| | | <el-table-column label="姓名" prop=""> |
| | | <template slot-scope="scope"> |
| | | <el-link |
| | | type="primary" |
| | | :underline="false" |
| | | @click="goDetails(scope.row)" |
| | | >{{ scope.row.name }}</el-link |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="性别" width="80"> |
| | | <template slot-scope=""> 男 </template> |
| | | </el-table-column> |
| | | <el-table-column label="手机号" width="200"> |
| | | <template slot-scope=""> 10086 </template> |
| | | </el-table-column> |
| | | <el-table-column label="微信" width="200"> |
| | | <template slot-scope=""> asfiaf </template> |
| | | </el-table-column> |
| | | <el-table-column label="账户" width=""> |
| | | <template slot-scope=""> asfiaf </template> |
| | | </el-table-column> |
| | | {{ accountList }} |
| | | <!-- <el-table-column label="Author" width="110" align="center"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.author }}</span> |
| | | {{ scope.row.gender == "FEMALE" ? "女" : "男" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="Pageviews" width="110" align="center"> |
| | | <el-table-column label="手机号" width="200" prop="mobile"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.pageviews }} |
| | | {{ scope.row.mobile ? scope.row.mobile : "--" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column class-name="status-col" label="Status" width="110" align="center"> |
| | | <el-table-column label="是否绑定微信" width="200"> |
| | | <template slot-scope="scope"> |
| | | <el-tag :type="scope.row.status | statusFilter">{{ scope.row.status }}</el-tag> |
| | | {{ scope.row.user ? "是" : "否" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="created_at" label="Display_time" width="200"> |
| | | <template slot-scope="scope"> |
| | | <i class="el-icon-time" /> |
| | | <span>{{ scope.row.display_time }}</span> |
| | | </template> |
| | | </el-table-column> --> |
| | | </el-table> |
| | | <div> |
| | | <el-pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="data.pageIn.index + 1" |
| | | :page-sizes="[10, 20, 30, 40]" |
| | | :page-size="data.pageIn.size" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | <StudentCreate ref="studentCreate"/> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getData } from "@/api/student"; |
| | | import { getData, getRenew, getExpire, getDeleted } from "@/api/student"; |
| | | import StudentCreate from './components/create.vue' |
| | | |
| | | export default { |
| | | filters: { |
| | |
| | | return statusMap[status]; |
| | | }, |
| | | }, |
| | | components:{ |
| | | StudentCreate, |
| | | }, |
| | | data() { |
| | | return { |
| | | list: null, |
| | | listLoading: true, |
| | | activeName: "first", |
| | | activeName: "all", |
| | | total: 0, |
| | | data: { |
| | | staffId: "1680", |
| | | staffId: JSON.parse(localStorage.getItem('user')).staffs[0].id, |
| | | keyword: "", |
| | | pageIn: { |
| | | //可选,如果是分页查询,需要加上。 |
| | | index: 1, //必选 |
| | | size: 20, //每页的大小。默认20 |
| | | index: 0, //必选 |
| | | size: 10, //每页的大小。默认20 |
| | | sorts: { |
| | | name: "name", //排序字段名称 |
| | | direction: "ASC", //排序方向 |
| | | }, |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | fetchData() { |
| | | this.listLoading = true; |
| | | getData(this.data).then((response) => { |
| | | this.list = response.data.items; |
| | | this.list = response.data.findPlayerByStaff.ls; |
| | | this.total = response.data.findPlayerByStaff.pageOut.total; |
| | | this.listLoading = false; |
| | | }); |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.data.pageIn.size = val; |
| | | this.fetchData(); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.data.pageIn.index = val - 1; |
| | | this.fetchData(); |
| | | }, |
| | | handleClick(tab, event) { |
| | | if (this.activeName == "pendingFees") { |
| | | this.listLoading = true; |
| | | getRenew(this.data).then((response) => { |
| | | this.list = response.data.findPlayerRenew.ls; |
| | | this.total = response.data.findPlayerRenew.pageOut.total; |
| | | this.listLoading = false; |
| | | }); |
| | | } else if (this.activeName == "expired") { |
| | | this.listLoading = true; |
| | | getExpire(this.data).then((response) => { |
| | | this.list = response.data.findPlayerExpire.ls; |
| | | this.total = response.data.findPlayerExpire.pageOut.total; |
| | | this.listLoading = false; |
| | | }); |
| | | } else if (this.activeName == "all") { |
| | | this.fetchData(); |
| | | } else if (this.activeName == "deactivated") { |
| | | this.listLoading = true; |
| | | getExpire(this.data).then((response) => { |
| | | this.list = response.data.findPlayerExpire.ls; |
| | | this.total = response.data.findPlayerExpire.pageOut.total; |
| | | this.listLoading = false; |
| | | }); |
| | | } |
| | | }, |
| | | goDetails(row) { |
| | | this.$router.push({ |
| | | name: "StudentDetails", |
| | | query: { |
| | | id: row.id, |
| | | }, |
| | | }); |
| | | }, |
| | | showCreate(){ |
| | | this.$refs.studentCreate.showDialog() |
| | | } |
| | | }, |
| | | }; |
| | | </script> |