123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400 |
- <!-- -->
- <template>
- <div class="m-container">
- <h2>
- <div class="squrt"></div>
- 运营指标
- </h2>
- <div class="m-core">
- <save-form
- :inline="true"
- :model="searchForm"
- @submit="search"
- @reset="onReSet"
- ref="searchForm"
- >
- <el-form-item>
- <el-input
- v-model.trim="searchForm.search"
- clearable
- @keyup.enter.native="
- (e) => {
- e.target.blur();
- $refs.searchForm.save();
- search();
- }
- "
- placeholder="学生姓名 编号"
- ></el-input>
- </el-form-item>
- <el-form-item prop="organId">
- <el-select
- class="multiple"
- v-model.trim="searchForm.organId"
- filterable
- clearable
- placeholder="请选择分部"
- >
- <el-option
- v-for="(item, index) in selects.branchs"
- :key="index"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <remote-search
- :commit="'setTeachers'"
- v-model="searchForm.teacherId"
- :isForzenWithQueryCondition="true"
- />
- </el-form-item>
- <el-form-item>
- <el-select
- placeholder="参与运营指标"
- v-model="searchForm.operatingTag"
- clearable
- >
- <el-option label="是" value="1"></el-option>
- <el-option label="否" value="0"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select
- placeholder="有线上vip课"
- v-model="searchForm.hasVip"
- clearable
- >
- <el-option label="是" value="1"></el-option>
- <el-option label="否" value="0"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select
- placeholder="参与免费网管课"
- v-model="searchForm.hasFreePractice"
- clearable
- >
- <el-option label="是" value="1"></el-option>
- <el-option label="否" value="0"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select
- placeholder="有付费网管课"
- v-model="searchForm.hasBuyPractice"
- clearable
- >
- <el-option label="是" value="1"></el-option>
- <el-option label="否" value="0"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select
- placeholder="有乐团网管课"
- v-model="searchForm.hasMusicNetWork"
- clearable
- >
- <el-option label="是" value="1"></el-option>
- <el-option label="否" value="0"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="danger" native-type="submit">搜索</el-button>
- <el-button @click="onReSet" native-type="reset" type="primary"
- >重置</el-button
- >
- <!-- export/isSettlementCourseSalarys -->
- <el-button
- @click="onExport"
- type="primary"
- v-permission="'export/operatingStudents'">导出</el-button
- >
- </el-form-item>
- </save-form>
- <div class="tableWrap">
- <el-table
- style="width: 100%"
- :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
- :data="tableList"
- >
- <el-table-column align="center" prop="studentId" label="学员编号">
- <template slot-scope="scope">
- <div>
- <copy-text>{{ scope.row.studentId }}</copy-text>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="studentName" label="学员姓名">
- <template slot-scope="scope">
- <div>
- <copy-text>{{ scope.row.studentName }}</copy-text>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="organName"
- label="所属分部"
- >
- <template slot-scope="scope">
- <div>
- <copy-text>{{ scope.row.organName }}</copy-text>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="groupNames" label="乐团名称">
- <template slot-scope="scope">
- <overflow-text width="100%" :text="scope.row.groupNames" />
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="teacherName"
- label="指导老师"
- >
- <template slot-scope="scope">
- <div>
- <copy-text>{{ scope.row.teacherName }}</copy-text>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="operatingTag"
- label="参与运营指标"
- >
- <template slot-scope="scope">
- <div>{{ scope.row.operatingTag ? "是" : "否" }}</div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="vipTimes" label="有线上vip课">
- <template slot-scope="scope">
- <div>{{ scope.row.vipTimes ? "是" : "否" }}</div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="freePracticeTimes"
- label="参与免费网管课"
- >
- <template slot-scope="scope">
- <div>{{ scope.row.freePracticeTimes ? "是" : "否" }}</div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="buyPracticeTimes"
- label="有付费网管课"
- >
- <template slot-scope="scope">
- <div>{{ scope.row.buyPracticeTimes ? "是" : "否" }}</div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="buyPracticeTimes"
- label="有乐团网管课"
- >
- <template slot-scope="scope">
- <div>{{ scope.row.musicNetWorkTimes ? "是" : "否" }}</div>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- sync
- :total.sync="rules.total"
- :page.sync="rules.page"
- :limit.sync="rules.limit"
- :page-sizes="rules.page_size"
- @pagination="getList"
- />
- </div>
- </div>
- </div>
- </template>
- <script>
- import axios from "axios";
- import { getToken, getTenantId } from "@/utils/auth";
- import pagination from "@/components/Pagination/index";
- import load from "@/utils/loading";
- import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
- import { getOperatingStudents } from "@/api/operateManager";
- export default {
- components: { pagination },
- data() {
- return {
- searchForm: {
- search: null,
- organId: null,
- teacherId: null,
- hasBuyPractice: null,
- hasFreePractice: null,
- hasVip: null,
- operatingTag: null,
- hasMusicNetWork: null,
- },
- teacherList: [],
- tableList: [],
- organList: [],
- rules: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50], // 选择限制显示条数
- },
- };
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {},
- activated() {
- this.init();
- },
- mounted() {
- // getTeacher().then(res => {
- // if (res.code == 200) {
- // this.teacherList = res.data;
- // }
- // });
- // getEmployeeOrgan().then(res => {
- // if (res.code == 200) {
- // this.organList = res.data;
- // }
- // });
- this.$store.dispatch("setBranchs");
- // 获取分部
- this.init();
- },
- methods: {
- init() {
- if (this.$route.query.teacherId) {
- this.searchForm.teacherId = this.$route.query.teacherId;
- }
- if (this.$route.query.operatingTag) {
- this.searchForm.operatingTag = this.$route.query.operatingTag;
- }
- this.getList();
- },
- getList() {
- let obj = this.getDate();
- getOperatingStudents(obj).then((res) => {
- if (res.code == 200) {
- this.tableList = res.data.rows;
- this.rules.total = res.data.total;
- }
- });
- },
- search() {
- this.rules.page = 1;
- this.getList();
- },
- onReSet() {
- this.searchForm = {
- search: null,
- organId: null,
- teacherId: null,
- hasBuyPractice: null,
- hasFreePractice: null,
- hasVip: null,
- operatingTag: null,
- };
- this.search();
- },
- onExport() {
- let url = "/api-web/export/operatingStudents";
- let obj = this.getDate();
- const options = {
- method: "get",
- headers: {
- Authorization: getToken(),
- tenantId: getTenantId()
- },
- url,
- params: obj,
- 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);
- if(json.code == 403) {
- this.$message.error(`登录过期,请重新登录!`)
- setTimeout(() => {
- this.$store.dispatch('user/resetToken').then(() => {
- location.reload()
- })
- }, 1000);
- return
- }
- this.$message.error(json.msg);
- } else {
- let objectUrl = URL.createObjectURL(blob);
- let link = document.createElement("a");
- let nowTime = new Date();
- let ymd =
- nowTime.getFullYear() +
- "" +
- (nowTime.getMonth() + 1) +
- "" +
- nowTime.getDate() +
- "" +
- nowTime.getHours() +
- "" +
- nowTime.getMinutes();
- let fname = ymd + "学员列表(运营).xls";
- link.href = objectUrl;
- link.setAttribute("download", fname);
- document.body.appendChild(link);
- link.click();
- }
- });
- load.endLoading();
- })
- .catch((error) => {
- this.$message.error("导出数据失败,请联系管理员");
- load.endLoading();
- });
- })
- .catch(() => {});
- },
- getDate() {
- let obj = {
- search: this.searchForm.search || null,
- organId: this.searchForm.organId || null,
- teacherId: this.searchForm.teacherId || null,
- hasBuyPractice: this.searchForm.hasBuyPractice || null,
- hasFreePractice: this.searchForm.hasFreePractice || null,
- hasVip: this.searchForm.hasVip || null,
- operatingTag: this.searchForm.operatingTag || null,
- page: this.rules.page,
- rows: this.rules.limit,
- hasMusicNetWork: this.searchForm.hasMusicNetWork || null,
- };
- return obj;
- },
- },
- };
- </script>
- <style lang='scss' scoped>
- </style>
|