123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609 |
- <template>
- <div class>
- <!-- <h2>
- <div class="squrt"></div>网管课列表
- </h2>-->
- <div class="topWrap">
- <div class="newBand"
- v-permission="'export/practiceGroup'"
- @click="onStudentExport"
- style="width: 120px;">网管课续费提醒</div>
- <div class="newBand"
- v-permission="'export/practiceGroupList'"
- @click="onPracticeExport"
- style="width: 120px;">网管课导出</div>
- </div>
- <div class="m-core">
- <save-form :inline="true"
- class="searchForm"
- @submit="search"
- @reset="onReSet"
- :model.sync="searchForm">
- <!-- 状态 指导老师 活动方案-->
- <el-form-item>
- <el-input v-model.trim="searchForm.search"
- clearable
- placeholder="课程组名称"></el-input>
- </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 selects.branchs"
- :key="index"
- :label="item.name"
- :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select v-model.trim="searchForm.practiceGroupType"
- clearable
- filterable
- placeholder="课程组类型">
- <el-option v-for="(item,index) in practiceGroupType"
- :key="index"
- :value="item.value"
- :label="item.label"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="status">
- <el-select class="multiple"
- v-model.trim="searchForm.hasEducationalTeacherId"
- filterable
- clearable
- placeholder="是否有乐团主管">
- <el-option label="是"
- value="true"></el-option>
- <el-option label="否"
- value="false"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select v-model.trim="searchForm.teacherId"
- clearable
- filterable
- :filter-method="filterMethod"
- placeholder="指导老师">
- <el-option v-for="(item,index) in selects.teachers"
- :key="index"
- :value="item.id"
- :label="item.realName"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select v-model.trim="searchForm.groupStatus"
- clearable
- filterable
- placeholder="课程组状态">
- <el-option v-for="(item,index) in commGroupStatus"
- :key="index"
- :value="item.value"
- :label="item.label"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select v-model.trim="searchForm.firstOrRenew"
- clearable
- filterable
- placeholder="是否续费">
- <el-option label="首充"
- value="1"></el-option>
- <el-option label="续费"
- value="0"></el-option>
- <el-option label="免费"
- value="2"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button native-type="submit"
- type="danger">搜索</el-button>
- <el-button native-type="reset"
- type="primary">重置</el-button>
- </el-form-item>
- </save-form>
- <!-- tab -->
- <div class="tableWrap">
- <el-table style="width: 100%"
- :header-cell-style="{background:'#EDEEF0',color:'#444'}"
- :data="tableData">
- <el-table-column align="center"
- prop="id"
- label="课程组编号"
- width="100">
- <template slot-scope="scope">
- <copy-text>{{scope.row.id}}</copy-text>
- </template>
- </el-table-column>
- <el-table-column align="center"
- prop="name"
- label="课程组名称"
- width="100">
- <template slot-scope="scope">
- <copy-text>{{scope.row.name}}</copy-text>
- </template>
- </el-table-column>
- <el-table-column align="center"
- prop="type"
- label="课程组类型"
- width="100">
- <template slot-scope="scope">
- <div>
- <p>{{scope.row.type | comType}}</p>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center"
- prop="organName"
- label="所属分部"></el-table-column>
- <!-- educationalTeacherId -->
- <el-table-column align="center"
- prop="educationalTeacherName"
- label="乐团主管"></el-table-column>
- <el-table-column align="center"
- prop="teacherName"
- label="指导老师"></el-table-column>
- <el-table-column align="center"
- prop="studentNum"
- label="班级人数"></el-table-column>
- <!-- <el-table-column align="center" label="课程单价">
- <template slot-scope="scope">
- <div>
- <p>线上:{{scope.row.onlineClassesUnitPrice}}</p>
- <p>线下:{{scope.row.offlineClassesUnitPrice}}</p>
- </div>
- </template>
- </el-table-column>-->
- <el-table-column align="center"
- label="当前课次">
- <template slot-scope="scope">
- <div>
- <p>{{scope.row.currentClassTimes + '/' + scope.row.totalClassTimes}}</p>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center"
- prop="coursesStartDate"
- label="开课时间"
- width="120">
- <template slot-scope="scope">
- <div>
- <p>{{scope.row.coursesStartDate | formatTimer}}</p>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center"
- prop="coursesExpireDate"
- label="结束时间"
- width="120">
- <template slot-scope="scope">
- <div>
- <p>{{scope.row.coursesExpireDate | formatTimer}}</p>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center"
- prop="groupStatus"
- label="课程组状态"
- width="100">
- <template slot-scope="scope">
- <div>
- <p>{{scope.row.groupStatus | comCourseGroup}}</p>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center"
- label="是否续费"
- fixed="right">
- <template slot-scope="scope">
- <div>
- <p v-if="scope.row.buyMonths == 0">免费</p>
- <p v-if="scope.row.buyMonths > 0">{{scope.row.beRenewGroupId>0?'续费':'首充'}}</p>
- </div>
- </template>
- </el-table-column>
- <el-table-column width="150"
- prop="memo"
- label="备注"
- fixed="right">
- <template slot-scope="scope">
- <overflow-text :text="scope.row.memo" width="150px"></overflow-text>
- </template>
- </el-table-column>
- <el-table-column align="center"
- width="200"
- fixed="right"
- label="操作">
- <template slot-scope="scope">
- <div>
- <!-- v-permission="'courseSchedule/classStartDateAdjust'" v-if="!scope.row.isSettlement" -->
- <el-button type="text"
- @click="lookCrouse(scope.row)">查看</el-button>
- <el-button type="text"
- v-if="scope.row.groupStatus == 'NORMAL' && permission('practiceGroupManage/cancelGroup')"
- @click="closeCrouse(scope.row)">关闭</el-button>
- <el-button type="text"
- v-if="permission('practiceGroupManage/updateMemo')"
- @click="resetMemo(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="关闭课程组"
- width="400px"
- :visible.sync="closeVisible">
- <el-form :model="closeForm"
- ref="closeForm"
- label-position="right"
- label-width="80px;"
- :inline="true">
- <el-form-item label="是否退费"
- prop="isBasck">
- <el-radio v-model="closeForm.isBack"
- :label="true">是</el-radio>
- <el-radio v-model="closeForm.isBack"
- :label="false">否</el-radio>
- </el-form-item>
- <el-form-item label="退费金额"
- v-if="closeForm.isBack"
- prop="money">
- <el-input type="number"
- @mousewheel.native.prevent
- v-model.trim="closeForm.money"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer"
- class="dialog-footer">
- <el-button @click="closeVisible = false">取 消</el-button>
- <el-button type="primary"
- @click="submieCloseCrouse">确 定</el-button>
- </div>
- </el-dialog>
- <el-dialog title="备注"
- width="400px"
- :visible.sync="memoVisible">
- <el-input type="textarea"
- v-model.trim="memoForm.memo"
- :rows="7"
- :maxlength="255"
- show-word-limit></el-input>
- <div slot="footer"
- class="dialog-footer">
- <el-button @click="memoVisible = false">取 消</el-button>
- <el-button type="primary"
- @click="subMemo">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import pagination from "@/components/Pagination/index";
- import { permission } from "@/utils/directivePage";
- import cleanDeep from 'clean-deep'
- import { commGroupStatus, practiceGroupType } from "@/utils/searchArray";
- import {
- getTeacher,
- getEmployeeOrgan,
- practiceGroupManage,
- cancelGroup,
- practiceUpdateMemo
- } from "@/api/buildTeam";
- import axios from "axios";
- import { getToken } from "@/utils/auth";
- import load from "@/utils/loading";
- export default {
- components: { pagination },
- data () {
- return {
- searchForm: {
- search: null,
- status: null,
- teacherId: null,
- organIdList: null,
- firstOrRenew: null,
- practiceGroupType: null,
- groupStatus: null
- },
- closeForm: {
- isBack: false,
- money: null
- },
- memoForm: {
- memo: "",
- groupId: ""
- },
- memoVisible: false,
- closeVisible: false,
- activeRow: null,
- organList: [],
- statusList: [],
- teacherList: [],
- tableData: [],
- practiceGroupType: practiceGroupType,
- commGroupStatus: commGroupStatus,
- rules: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50] // 选择限制显示条数
- }
- };
- },
- mounted () {
- if (this.$route.query.searchForm) {
- this.$route.query.searchForm instanceof Object
- ? (this.searchForm = this.$route.query.searchForm)
- : (this.searchForm = JSON.parse(this.$route.query.searchForm));
- }
- if (this.$route.query.rules) {
- this.$route.query.rules instanceof Object
- ? (this.rules = this.$route.query.rules)
- : (this.rules = JSON.parse(this.$route.query.rules));
- }
- this.init();
- },
- activated () {
- this.init();
- },
- methods: {
- filterMethod(inp) {
- this.teacherList = this.selects.teachers.filter(item => (item.realName || '').indexOf(inp) > -1).slice(0, 49)
- },
- init () {
- this.$store.dispatch('setBranchs')
- this.$store.dispatch('setTeachers')
- .then(() => {
- this.teacherList = [...this.selects.teachers].slice(0, 49)
- })
- this.getList();
- },
- permission (str, parent) {
- return permission(str, parent);
- },
- search () {
- this.rules.page = 1;
- this.getList();
- },
- onReSet () {
- this.searchForm = {
- search: null,
- status: null,
- teacherId: null,
- organIdList: null,
- firstOrRenew: null,
- practiceGroupType: null,
- groupStatus: null
- };
- this.search();
- },
- onStudentExport () {
- // 导出VIP课
- // let searchForm = this.searchForm;
- let data = {
- // teacherId: searchForm.teacherId || null,
- // activityId: searchForm.activityId || null,
- // organId: searchForm.orgin || null,
- // status: searchForm.status || null,
- // search: searchForm.search || null
- };
- let url = "/api-web/export/practiceGroup";
- const options = {
- method: "get",
- headers: {
- Authorization: getToken()
- },
- params: data,
- 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(() => { });
- },
- onPracticeExport () {
- // 导出VIP课
- let searchForm = this.searchForm;
- let obj = {
- search: searchForm.search || null,
- teacherId: searchForm.teacherId || null,
- organId: searchForm.organIdList || null,
- hasEducationalTeacherId: searchForm.hasEducationalTeacherId || null,
- type: searchForm.firstOrRenew || null,
- practiceGroupType: searchForm.practiceGroupType || null,
- groupStatus: searchForm.groupStatus || null
- };
- let url = "/api-web/export/practiceGroupList";
- const options = {
- method: "get",
- headers: {
- Authorization: getToken()
- },
- params: cleanDeep(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 obj = {
- search: this.searchForm.search || null,
- teacherId: this.searchForm.teacherId || null,
- organId: this.searchForm.organIdList || null,
- page: this.rules.page,
- rows: this.rules.limit,
- hasEducationalTeacherId:
- this.searchForm.hasEducationalTeacherId || null,
- type: this.searchForm.firstOrRenew || null,
- practiceGroupType: this.searchForm.practiceGroupType || null,
- groupStatus: this.searchForm.groupStatus || null
- };
- practiceGroupManage(obj).then(res => {
- if (res.code == 200) {
- this.tableData = res.data.rows;
- this.rules.total = res.data.total;
- }
- });
- },
- lookCrouse (row) {
- let rules = JSON.stringify(this.rules);
- let searchForm = JSON.stringify(this.searchForm);
- this.$router.push({
- path: "/business/accompanys",
- query: { id: row.id, type: row.type }
- });
- },
- closeCrouse (row) {
- this.activeRow = row;
- this.closeVisible = true;
- },
- courseVisibleClose () {
- // 关闭弹窗前
- },
- submieCloseCrouse () {
- // 提交关闭课程组
- if (this.closeForm.isBack) {
- if (!this.closeForm.money) {
- this.$message.error("请输入退费金额");
- return;
- }
- } else {
- this.closeForm.money = null;
- }
- // 请求数据
- cancelGroup({
- groupId: this.activeRow.id,
- groupType: "PRACTICE",
- refundAmount: this.closeForm.money
- }).then(res => {
- if (res.code == 200) {
- this.$message.success("关闭成功");
- this.getList();
- this.closeVisible = false;
- }
- });
- },
- resetMemo (row) {
- this.$set(this.memoForm, "memo", row.memo);
- this.$set(this.memoForm, "groupId", row.id);
- this.memoVisible = true;
- },
- subMemo () {
- practiceUpdateMemo(this.memoForm).then(res => {
- if (res.code == 200) {
- this.$message.success("修改成功");
- this.memoVisible = false;
- this.getList();
- }
- });
- }
- },
- watch: {
- closeVisible (val) {
- if (!val) {
- this.activeRow = null;
- (this.closeForm = {
- isBack: false,
- money: null
- }),
- this.$refs.closeForm.resetFields();
- this.closeVisible = false;
- }
- }
- }
- };
- </script>
- <style lang='scss' scoped>
- .topWrap {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- div {
- margin-right: 10px;
- }
- }
- </style>
|