| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- <template>
- <div class="m-container">
- <h2>
- <div class="squrt"></div>
- 阶梯奖励
- </h2>
- <div class="m-core">
- <el-button
- type="primary"
- @click="openActive('create')"
- style="margin-bottom: 20px"
- v-permission="'/branchActiveOperationAdd'"
- >新建</el-button
- >
- <!-- 搜索类型 -->
- <save-form
- :inline="true"
- ref="searchForm"
- @submit.native.prevent
- @submit="onSearch"
- @reset="onReset"
- :model.sync="searchForm"
- >
- <el-form-item prop="search">
- <el-input
- type="text"
- v-model.trim="searchForm.search"
- @keyup.enter.native="getList"
- placeholder="分部活动名"
- ></el-input>
- </el-form-item>
- <el-form-item prop="rewardMode">
- <el-select
- v-model.trim="searchForm.rewardMode"
- clearable
- placeholder="分部活动类型"
- >
- <el-option
- v-for="(item, index) in rewardModeTypeList"
- :key="index"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="teacherId">
- <el-select
- v-model.trim="searchForm.teacherId"
- clearable
- filterable
- placeholder="适用老师"
- >
- <el-option
- v-for="item in selects.teachers"
- :key="item.id"
- :label="item.realName"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="vipGroupCategoryId">
- <el-select
- v-model.trim="searchForm.vipGroupCategoryId"
- filterable
- clearable
- placeholder="课程类型"
- >
- <el-option
- v-for="item in selects.vipGroupCategory"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- ></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>
- <!-- 列表 -->
- <div class="tableWrap">
- <el-table
- :data="tableList"
- :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
- >
- <el-table-column align="center" prop="name" label="分部活动名">
- <template slot-scope="scope">
- <copy-text>{{ scope.row.name }}</copy-text>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="rewardMode"
- label="分部活动类型"
- >
- <template slot-scope="scope">
- {{ scope.row.rewardMode | rewardModeTypeFormat }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="适用老师">
- <template slot-scope="scope">
- <span
- style="max-height: 68px; display: block"
- :title="scope.row.teacherNames | joinArray(',')"
- >{{ scope.row.teacherNames | joinArray(",") }}</span
- >
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="vipGroupCategoryNameList"
- label="课程类型"
- >
- </el-table-column>
- <el-table-column align="center" label="操作" width="100">
- <template slot-scope="scope">
- <el-button
- @click="openActive('update', scope.row)"
- v-permission="'/branchActiveOperationUpdate'"
- type="text"
- >修改</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <pagination
- :total.sync="pageInfo.total"
- :page.sync="pageInfo.page"
- :limit.sync="pageInfo.limit"
- sync
- :page-sizes="pageInfo.page_size"
- @pagination="getList"
- />
- </div>
- </div>
- </div>
- </template>
- <script>
- import pagination from "@/components/Pagination/index";
- import { courseScheduleRewards } from "@/api/systemManage";
- import { rewardModeTypeList } from "@/utils/searchArray";
- export default {
- name: "branchActive",
- components: { pagination },
- data() {
- return {
- rewardModeTypeList,
- searchForm: {
- search: null,
- rewardMode: null,
- vipGroupCategoryId: null,
- teacherId: null,
- },
- organId: null,
- tableList: [],
- pageInfo: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50], // 选择限制显示条数
- },
- };
- },
- mounted() {
- this.getList(); // 获取列表数据
- this.__init();
- },
- methods: {
- async __init() {
- // 获取类型
- this.$store.dispatch("setVipGroupCategory");
- this.$store.dispatch("setTeachers");
- },
- getList() {
- let params = this.searchForm;
- params.rows = this.pageInfo.limit;
- params.page = this.pageInfo.page;
- courseScheduleRewards(params).then((res) => {
- if (res.code == 200 && res.data) {
- this.tableList = res.data.rows;
- this.pageInfo.total = res.data.total;
- }
- });
- },
- openActive(type, row) {
- let params = {
- path: "/operateManager/branchActiveOperationAdd",
- query: {
- type: type,
- },
- };
- let tagTitle = "新建";
- if (row) {
- params.query.id = row.id;
- tagTitle = "修改";
- params.path='/operateManager/branchActiveOperation'
- }
- this.$router.push(params, (route) => {
- route.meta.title = tagTitle + "VIP分部活动";
- });
- },
- onFormClose(formName) {
- // 关闭弹窗重置验证
- this.$refs[formName].clearValidate();
- },
- onSearch() {
- this.$refs.searchForm.validate((valid) => {
- this.pageInfo.page = 1;
- this.getList();
- });
- },
- onReset() {
- this.$refs.searchForm.resetFields();
- this.onSearch();
- },
- },
- };
- </script>
- <style lang="scss">
- .el-vue-search-box-container {
- position: absolute !important;
- left: 10px;
- margin-top: 10px;
- z-index: 99999 !important;
- }
- </style>
|