Browse Source

排课资格调整

1
mo 3 years ago
parent
commit
a6c637ffc5

+ 2 - 0
src/router/index.js

@@ -456,6 +456,8 @@ export const asyncRoutes = {
   activeMarketing:()=>import ('@/views/activityScheduling/activeMarketing'),
   // 2021双11
   '2021double11List':()=>import ('@/views/activityScheduling/2021double11List'),
+  // 活动资格管理
+  activeSenior:()=>import('@/views/categroyManager/activeSenior')
 }
 
 export default router

+ 14 - 0
src/store/modules/permission.js

@@ -560,6 +560,20 @@ function setDetailRoute(accessedRoutes) {
           }
         },
         {
+          name: '活动资格管理',
+          path: 'activeSenior',
+          component: () => import('@/views/categroyManager/activeSenior'),
+          hidden: true,
+          meta: {
+            noCache: '1',
+            title: '活动资格管理',
+            belongTopMenu: "/operateManager",
+            activeMenu: '/vipActiveManager/vipActiveList',
+            id: 'xx16'
+          }
+        },
+        // activeSenior
+        {
           name: '添加分部活动',
           path: 'branchActiveOperationAdd',
           component: () => import('@/views/categroyManager/insideSetting/branchActiveOperation'),

+ 245 - 0
src/views/categroyManager/activeSenior.vue

@@ -0,0 +1,245 @@
+<template>
+  <div class="m-container">
+    <h2>
+      <el-page-header @back="onCancel" :content="title"></el-page-header>
+    </h2>
+    <div class="m-core">
+      <el-button
+        type="primary"
+        style="margin-bottom: 20px"
+        v-permission="'/vipNewActive'"
+        @click="addStudent"
+        >添加学员</el-button
+      >
+      <save-form
+        :inline="true"
+        :model="searchForm"
+        @submit="search"
+        @reset="onReSet"
+      >
+        <el-form-item>
+          <el-input
+            class="search"
+            v-model.trim="searchForm.search"
+            clearable
+            @keyup.enter.native="search"
+            placeholder="学员名称、编号、手机号"
+          ></el-input>
+        </el-form-item>
+        <el-form-item prop="organId">
+          <el-select
+            class="multiple"
+            filterable
+            style="width: 180px !important"
+            v-model.trim="searchForm.organId"
+            clearable
+            placeholder="请选择分部"
+          >
+            <el-option
+              v-for="(item, index) in organList"
+              :key="index"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button native-type="submit" type="primary">搜索</el-button>
+          <el-button native-type="reset" type="danger">重置</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="分部"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="studentId"
+            label="学员编号"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="studentId"
+            label="学员姓名"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="studentId"
+            label="手机号"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="studentId"
+            label="付费课已使用/剩余资格"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="studentId"
+            label="赠课已使用/剩余资格"
+          ></el-table-column>
+          <el-table-column align="center" prop="studentId" label="操作">
+            <template slot-scope="scope">
+              <div>
+                <el-button
+                  type="text"
+                  v-permission="'vipGroupActivity/update'"
+                  @click="reduceCount(scope.row)"
+                  >减少资格</el-button
+                >
+                <el-button
+                  type="text"
+                  v-permission="'vipGroupActivity/update'"
+                  @click="addCount(scope.row)"
+                  >添加资格</el-button
+                >
+              </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>
+    <el-dialog
+      title="添加学员"
+      :visible.sync="addStudentVisible"
+      width="1000px"
+    >
+      <addStudentSenior :organList="organList" :hasGive="hasGive" />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="addStudentVisible = false">取 消</el-button>
+        <el-button type="primary" @click="addStudentVisible = false"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+    <el-dialog title="添加资格" :visible.sync="addSeniorVisible" width="800px">
+      <addSenior :hasGive="hasGive" />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="addSeniorVisible = false">取 消</el-button>
+        <el-button type="primary" @click="addSeniorVisible = false"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import axios from "axios";
+import { getToken } from "@/utils/auth";
+import pagination from "@/components/Pagination/index";
+import load from "@/utils/loading";
+import { getVipGroupActivity } from "@/api/vipSeting";
+import addSenior from "./modals/addSenior.vue";
+import reduceSenior from "./modals/reduceSenior.vue";
+import addStudentSenior from "./modals/addStudentSenior.vue";
+export default {
+  components: { pagination, addSenior, reduceSenior, addStudentSenior },
+  data() {
+    return {
+      searchForm: {
+        search: null,
+        organId: null,
+      },
+      title: "",
+      tableList: [{}],
+      organList: [],
+      hasGive: false,
+      addStudentVisible: false,
+      addSeniorVisible: false,
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+    };
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  async mounted() {
+    // 获取分部
+    // 获取分部
+    await this.$store.dispatch("setBranchs");
+    this.init();
+  },
+  methods: {
+    async init() {
+      if (this.$route.query.id) {
+        // this.baseForm.id = this.$route.query.id;
+        try {
+          const rusult = await getVipGroupActivity({
+            id: this.$route.query.id,
+          });
+          this.formatDetail(rusult.data);
+        } catch (e) {
+          console.log(e);
+        }
+      }
+    },
+    getList() {},
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {},
+    onCancel() {
+      this.$store.dispatch("delVisitedViews", this.$route);
+      this.$router.push({
+        path: "/vipActiveManager/vipActiveList",
+        query: { rules: this.rules, searchForm: this.searchForm },
+      });
+    },
+    formatDetail(data) {
+      this.title = data.name;
+      let organIds = data.organId.split(",").map((organ) => {
+        return Number(organ);
+      });
+      this.organList = [];
+      this.selects.branchs.forEach((organ) => {
+        if (organIds.indexOf(organ.id) != -1) {
+          this.organList.push(organ);
+        }
+      });
+      this.hasGive = Boolean(
+        data.giveCourseType && data.giveCourseType != "MEMBER"
+      );
+      console.log(this.hasGive);
+      // selects.branchs
+    },
+    addCount() {
+      this.addSeniorVisible = true;
+    },
+    reduceCount() {},
+    addStudent() {
+      this.addStudentVisible = true;
+    },
+  },
+};
+</script>
+<style lang='scss' scoped>
+.m-container {
+  .search {
+    /deep/.el-input__inner {
+      width: 200px !important;
+    }
+  }
+}
+</style>
+

+ 59 - 0
src/views/categroyManager/modals/addSenior.vue

@@ -0,0 +1,59 @@
+<template>
+  <div>
+    <el-form :inline="true" :model="topForm" label-width="100px">
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="学生姓名:">
+            {{ topForm.userName }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="手机号:">
+            {{ topForm.phone }}
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="12">
+          <el-col :span="12">
+            <el-form-item
+              label="付费课资格:"
+              prop="paySeniorNum"
+              style="width: 100%"
+            >
+              <el-input
+                v-model="topForm.paySeniorNum"
+                style="width: 380px"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="赠课资格:" v-if="hasGive"   style="width: 100%">
+            <el-input
+              v-model="topForm.giveSeniorNum"
+              style="width: 380px"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+  </div>
+</template>
+<script>
+export default {
+  props: ["hasGive"],
+  data() {
+    return {
+      topForm: {
+        userName: "",
+        phone: "",
+        paySeniorNum:"",
+        giveSeniorNum:""
+      },
+    };
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 313 - 0
src/views/categroyManager/modals/addStudentSenior.vue

@@ -0,0 +1,313 @@
+<template>
+  <div>
+    <el-alert title="资格信息" :closable="false" class="alert" type="info" />
+    <el-form :inline="true" :model="topForm" label-width="100px">
+      <el-row>
+        <el-col :span="12">
+          <el-form-item
+            label="付费课资格:"
+            prop="paySeniorNum"
+            style="width: 100%"
+          >
+            <el-input
+              v-model="topForm.paySeniorNum"
+              style="width: 380px"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="赠课资格:" v-if="hasGive">
+            <el-input
+              v-model="topForm.giveSeniorNum"
+              style="width: 380px"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <el-alert title="添加学员" :closable="false" class="alert" type="info" />
+    <el-form
+      :inline="true"
+      @submit="search"
+      @reset="onReSet"
+      ref="searchForm"
+      :model="searchForm"
+    >
+      <el-form-item prop="search">
+        <el-input
+          class="search"
+          type="text"
+          clearable
+          v-model="searchForm.search"
+          placeholder="学员名称、编号、手机号"
+        ></el-input>
+      </el-form-item>
+      <el-form-item prop="organId">
+        <el-select
+          class="multiple"
+          filterable
+          style="width: 180px !important"
+          v-model.trim="searchForm.organId"
+          clearable
+          placeholder="请选择分部"
+        >
+          <el-option
+            v-for="(item, index) in organList"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item prop="subjectId">
+        <el-select
+          clearable
+          v-model="searchForm.subjectId"
+          filterable
+          placeholder="声部"
+        >
+          <el-option
+            v-for="item in selects.subjects"
+            :value="item.id"
+            :label="item.name"
+            :key="item.id"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item prop="subjectId">
+        <el-select
+          clearable
+          v-model="searchForm.subjectId"
+          filterable
+          placeholder="是否乐团在读"
+        >
+          <el-option
+            v-for="item in selects.subjects"
+            :value="item.id"
+            :label="item.name"
+            :key="item.id"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item prop="subjectId">
+        <el-select
+          clearable
+          v-model="searchForm.subjectId"
+          filterable
+          placeholder="是否vip在读"
+        >
+          <el-option
+            v-for="item in selects.subjects"
+            :value="item.id"
+            :label="item.name"
+            :key="item.id"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item prop="subjectId">
+        <el-select
+          clearable
+          v-model="searchForm.subjectId"
+          filterable
+          placeholder="是否网管课在读"
+        >
+          <el-option
+            v-for="item in selects.subjects"
+            :value="item.id"
+            :label="item.name"
+            :key="item.id"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item prop="subjectId">
+        <el-select
+          clearable
+          v-model="searchForm.subjectId"
+          filterable
+          placeholder="是否会员"
+        >
+          <el-option
+            v-for="item in selects.subjects"
+            :value="item.id"
+            :label="item.name"
+            :key="item.id"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="danger" native-type="submit">搜索</el-button>
+        <el-button native-type="reset" type="primary">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <div class="tableWrap">
+      <el-table
+        style="width: 100%"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+        :data="tableList"
+        ref="tableList"
+        @selection-change="handleSelectionChange"
+        @select="onTableSelect"
+        row-key="id"
+      >
+        <el-table-column type="selection" width="55"> </el-table-column>
+        <el-table-column
+          align="center"
+          prop="studentId"
+          label="分部"
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          prop="studentId"
+          label="学员编号"
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          prop="studentId"
+          label="学员姓名"
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          prop="studentId"
+          label="手机号"
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          prop="studentId"
+          label="声部"
+        ></el-table-column>
+      </el-table>
+      <pagination
+        :total="rules.total"
+        :page="rules.page"
+        :limit="rules.limit"
+        :page-sizes="rules.page_size"
+        @pagination="getList"
+      />
+    </div>
+  </div>
+</template>
+<script>
+import pagination from "@/components/Pagination/index";
+export default {
+  components: { pagination },
+  props: ["organList","hasGive"],
+  data() {
+    return {
+      topForm: {
+        paySeniorNum: null,
+        giveSeniorNum: null,
+      },
+      searchForm: {
+        search: null,
+        organId: null,
+        subjectId: null,
+      },
+      tableList: [],
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+      isDetele: false,
+      deleteList: [],
+    };
+  },
+  async mounted() {
+    await this.$store.dispatch("setSubjects");
+  },
+  methods: {
+    search() {},
+    onReSet() {},
+    getList() {
+      /**
+       *      this.tableList = res.data.rows;
+          this.rules.total = res.data.total;
+          let idList = this.deleteList.map((course) => {
+            return course.id;
+          });
+          this.isDetele = true;
+          this.$nextTick(() => {
+            this.tableList.forEach((course) => {
+              if (idList.indexOf(course.id) != -1) {
+                this.$refs.tableList.toggleRowSelection(course, true);
+              }
+            });
+            this.isDetele = false;
+          });
+       */
+    },
+    handleSelectionChange(arr) {
+      // this.deleteList = arr;
+      if (arr.length > 0) {
+        // 有可能加 有可能减
+        this.deleteList = this.deleteList.concat(arr);
+        // 去重
+        this.deleteList = this.$helpers.lodash.uniqBy(this.deleteList, "id");
+      }
+      // else if(){}
+      else {
+        if (this.isDetele) return;
+        // 有2种 1是新页
+        // 2是点击反选
+        let idList = this.deleteList.map((course) => {
+          return course.id;
+        });
+        this.$nextTick(() => {
+          let tableIdList = [];
+          this.tableList.forEach((course) => {
+            tableIdList.push(course.id);
+            if (idList.indexOf(course.id) != -1) {
+              this.$refs.tableList.toggleRowSelection(course, false);
+              // 删除这个元素
+            }
+          });
+          this.deleteList = this.$helpers.lodash.remove(
+            this.deleteList,
+            function (item) {
+              return tableIdList.indexOf(item.id) == -1;
+            }
+          );
+          if (this.deleteList.length <= 0) {
+            this.clearCom();
+          }
+        });
+      }
+    },
+    onTableSelect(rows, row) {
+      let idList = this.deleteList.map((course) => {
+        return course.id;
+      });
+      if (idList.indexOf(row.id) != -1) {
+        this.deleteList.splice(idList.indexOf(row.id), 1);
+        if (this.deleteList.length <= 0) {
+          this.clearCom();
+        }
+      }
+    },
+    clearCom() {
+      // this.deleteList = [];
+      this.$set(this, "deleteList", []);
+      this.$refs.tableList.clearSelection();
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.submitP {
+  margin-bottom: 20px;
+}
+.alert {
+  margin-bottom: 20px;
+}
+/deep/.el-form--inline .el-form-item {
+  margin-right: 0;
+}
+
+.search {
+  /deep/.el-input__inner {
+    width: 200px !important;
+  }
+}
+</style>

+ 2 - 2
src/views/categroyManager/modals/baseInfo.vue

@@ -164,7 +164,7 @@
             ></i>
           </el-tooltip>
         </el-form-item>
-        <el-form-item label="是否充值课程余额" prop="isPayToBalance">
+        <!-- <el-form-item label="是否充值课程余额" prop="isPayToBalance">
           <el-select
             v-model.trim="baseForm.isPayToBalance"
             placeholder="请选择是否充值课程余额"
@@ -186,7 +186,7 @@
               style="font-size: 18px; color: #f56c6c"
             ></i>
           </el-tooltip>
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="营销活动售价" prop="marketPrice">
           <el-input
             style="width: 400px"

+ 0 - 0
src/views/categroyManager/modals/reduceSenior.vue


+ 19 - 0
src/views/categroyManager/vipActiveList.vue

@@ -235,6 +235,18 @@
                   >查看</el-button
                 >
                 <el-button
+                  v-if="
+                    scope.row.status == 'PROGRESS' &&
+                    scope.row.maxCourseNum &&
+                    scope.row.minCourseNum &&
+                    scope.row.minCourseNum == scope.row.maxCourseNum
+                  "
+                  type="text"
+                  v-permission="'vipGroupActivity/update'"
+                  @click="activeManager(scope.row)"
+                  >资格管理</el-button
+                >
+                <el-button
                   style="margin-left: 0px"
                   type="text"
                   v-permission="'vipGroupActivity/update'"
@@ -642,6 +654,13 @@ export default {
         query: { id: row.id },
       });
     },
+    // 活动资格管理
+    activeManager(row) {
+      this.$router.push({
+        path: "/operateManager/activeSenior",
+        query: { id: row.id },
+      });
+    },
     // 点击确认按钮发送修改请求
     remove(scope) {
       let id = scope.row.id;