Ver código fonte

提交测试

1
mo 3 anos atrás
pai
commit
5acdce3717

+ 31 - 0
src/api/vipSeting.js

@@ -442,4 +442,35 @@ export const getStudentList = data => request2({
   requestType: 'form'
 })
 
+//添加排课资格
+export const addActivityUserMapperStudents= data => request2({
+  url:api +  '/activityUserMapper/add',
+  data:data,
+  method: 'post',
+  requestType: 'json'
+})
+
+// 获取学生资格详情
+
+export const getStudentactivityList = data => request2({
+  url:api +  '/activityUserMapper/queryPage',
+  params:data,
+  method: 'get',
+  requestType: 'form'
+})
+
+// 取消资格
+export const cutActivityrMapper = data => request2({
+  url:api +  '/activityUserMapper/cut',
+  params:data,
+  method: 'get',
+  requestType: 'form'
+})
 
+// 资格记录
+export const activityrMapperInfo = data => request2({
+  url:api +  '/activityUserMapperAdjustLog/queryPage',
+  params:data,
+  method: 'get',
+  requestType: 'form'
+})

+ 119 - 34
src/views/categroyManager/activeSenior.vue

@@ -7,12 +7,13 @@
       <el-button
         type="primary"
         style="margin-bottom: 20px"
-        v-permission="'/vipNewActive'"
+        v-permission="'activityUserMapper/add'"
         @click="addStudent"
         >添加学员</el-button
       >
       <save-form
         :inline="true"
+        ref="searchForm"
         :model="searchForm"
         @submit="search"
         @reset="onReSet"
@@ -75,14 +76,14 @@
             label="手机号"
           ></el-table-column>
           <el-table-column
-            v-if="courseType&&courseType == 'VIP'"
+            v-if="courseType && courseType == 'VIP'"
             align="center"
             prop="studentId"
             label="付费课已使用/剩余资格"
           >
             <template slot-scope="scope">
               <div v-if="scope.row.userId">
-                {{ scope.row.useVipNum+'' + "/" + scope.row.freeVipNum+'' }}
+                {{ scope.row.useVipNum + "" + "/" + scope.row.freeVipNum + "" }}
               </div>
             </template>
           </el-table-column>
@@ -93,8 +94,14 @@
             label="付费课已使用/剩余资格"
           >
             <template slot-scope="scope">
-              <div  v-if="scope.row.userId">
-                {{ scope.row.usePracticeNum+'' + "/" + scope.row.freePracticeNum+'' }}
+              <div v-if="scope.row.userId">
+                {{
+                  scope.row.usePracticeNum +
+                  "" +
+                  "/" +
+                  scope.row.freePracticeNum +
+                  ""
+                }}
               </div>
             </template>
           </el-table-column>
@@ -106,8 +113,14 @@
             label="赠课已使用/剩余资格"
           >
             <template slot-scope="scope">
-              <div  v-if="scope.row.userId">
-                {{ scope.row.useGiveVipNum+'' + "/" + scope.row.freeGiveVipNum+'' }}
+              <div v-if="scope.row.userId">
+                {{
+                  scope.row.useGiveVipNum +
+                  "" +
+                  "/" +
+                  scope.row.freeGiveVipNum +
+                  ""
+                }}
               </div>
             </template>
           </el-table-column>
@@ -117,42 +130,56 @@
             prop="studentId"
             label="赠课已使用/剩余资格"
           >
-            <template slot-scope="scope" >
-              <div  v-if="scope.row.userId">
+            <template slot-scope="scope">
+              <div v-if="scope.row.userId">
                 {{
-                  scope.row.useGivePracticeNum+'' +
+                  scope.row.useGivePracticeNum +
+                  "" +
                   "/" +
-                  scope.row.freeGivePracticeNum+''
+                  scope.row.freeGivePracticeNum +
+                  ""
                 }}
               </div>
             </template>
           </el-table-column>
           <el-table-column
-            v-if="giveCourseType!='PRACTICE'&&giveCourseType!='VIP'"
+            v-if="giveCourseType != 'PRACTICE' && giveCourseType != 'VIP'"
             align="center"
             prop="studentId"
             label="赠课已使用/剩余资格"
           >
             <template slot-scope="scope">
-              <div  v-if="scope.row.userId">
+              <div v-if="scope.row.userId">
                 {{ "--" + "/" + "--" }}
               </div>
             </template>
           </el-table-column>
-          <el-table-column align="center" prop="studentId" label="操作">
+          <el-table-column
+            align="center"
+            prop="studentId"
+            label="操作"
+            width="260px"
+          >
             <template slot-scope="scope">
               <div>
                 <el-button
                   type="text"
-                  v-permission="'vipGroupActivity/update'"
+                  v-permission="'activityUserMapper/add'"
+                  @click="addCount(scope.row)"
+                  >添加资格</el-button
+                >
+                <el-button
+                  type="text"
+                  v-permission="'activityUserMapper/cut'"
                   @click="reduceCount(scope.row)"
                   >减少资格</el-button
                 >
+
                 <el-button
                   type="text"
-                  v-permission="'vipGroupActivity/update'"
-                  @click="addCount(scope.row)"
-                  >添加资格</el-button
+                  v-permission="'activityUserMapperAdjustLog/queryPage'"
+                  @click="lookInfo(scope.row)"
+                  >调整记录</el-button
                 >
               </div>
             </template>
@@ -174,25 +201,48 @@
       width="1000px"
       v-if="addStudentVisible"
     >
-      <addStudentSenior :organList="organList" :hasGive="hasGive" />
+      <addStudentSenior
+        :organList="organList"
+        :hasGive="hasGive"
+        ref="addStudentSenior"
+        @getList="getList"
+        @close="addStudentVisible = false"
+      />
       <span slot="footer" class="dialog-footer">
         <el-button @click="addStudentVisible = false">取 消</el-button>
-        <el-button type="primary" @click="addStudentVisible = false"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="submitStudent">确 定</el-button>
       </span>
     </el-dialog>
-    <el-dialog title="添加资格" :visible.sync="addSeniorVisible" width="800px">
-      <addSenior :hasGive="hasGive" />
+    <el-dialog
+      title="添加资格"
+      :visible.sync="addSeniorVisible"
+      width="800px"
+      v-if="addSeniorVisible"
+    >
+      <addSenior
+        :hasGive="hasGive"
+        :activeRow="activeRow"
+        @getList="getList"
+        ref="addSenior"
+        @close="addSeniorVisible = false"
+      />
       <span slot="footer" class="dialog-footer">
         <el-button @click="addSeniorVisible = false">取 消</el-button>
-        <el-button type="primary" @click="addSeniorVisible = false"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="addSeniorSubmit">确 定</el-button>
       </span>
     </el-dialog>
-    <el-dialog title="减少资格" :visible.sync="reduceVisible" width="1000px">
-      <reduceSenior />
+    <el-dialog
+      title="减少资格"
+      :visible.sync="reduceVisible"
+      width="1000px"
+      v-if="reduceVisible"
+    >
+      <reduceSenior
+        :activeRow="activeRow"
+        :courseType="courseType"
+        :giveCourseType="giveCourseType"
+        @getList="getList"
+      />
       <span slot="footer" class="dialog-footer">
         <!-- <el-button @click="addStudentVisible = false">取 消</el-button> -->
         <el-button type="primary" @click="reduceVisible = false"
@@ -200,6 +250,17 @@
         >
       </span>
     </el-dialog>
+    <el-dialog
+      title="资格记录"
+      :visible.sync="infoVisible"
+      width="1000px"
+      v-if="infoVisible"
+    >
+      <seniorInfo :activeRow="activeRow" />
+      <!-- <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="infoVisible = false">确 定</el-button>
+      </span>-->
+    </el-dialog>
   </div>
 </template>
 
@@ -215,8 +276,15 @@ import {
 import addSenior from "./modals/addSenior.vue";
 import reduceSenior from "./modals/reduceSenior.vue";
 import addStudentSenior from "./modals/addStudentSenior.vue";
+import seniorInfo from "./modals/seniorInfo";
 export default {
-  components: { pagination, addSenior, reduceSenior, addStudentSenior },
+  components: {
+    pagination,
+    addSenior,
+    reduceSenior,
+    addStudentSenior,
+    seniorInfo,
+  },
   data() {
     return {
       searchForm: {
@@ -226,10 +294,12 @@ export default {
       title: "",
       tableList: [{}],
       organList: [],
+      activeRow: null,
       hasGive: false,
       addStudentVisible: false,
       addSeniorVisible: false,
       reduceVisible: false,
+      infoVisible: false,
       courseType: "",
       giveCourseType: "",
       rules: {
@@ -283,7 +353,10 @@ export default {
       this.rules.page = 1;
       this.getList();
     },
-    onReSet() {},
+    onReSet() {
+      this.$refs.searchForm.resetFields();
+      this.search();
+    },
     onCancel() {
       this.$store.dispatch("delVisitedViews", this.$route);
       this.$router.push({
@@ -307,18 +380,30 @@ export default {
       );
       this.courseType = data.courseType;
       this.giveCourseType = data.giveCourseType;
-      console.log( this.courseType , this.giveCourseType )
+      console.log(this.courseType, this.giveCourseType);
       // selects.branchs
     },
-    addCount() {
+    addCount(row) {
+      this.activeRow = row;
       this.addSeniorVisible = true;
     },
-    reduceCount() {
+    reduceCount(row) {
+      this.activeRow = row;
       this.reduceVisible = true;
     },
     addStudent() {
       this.addStudentVisible = true;
     },
+    submitStudent() {
+      this.$refs.addStudentSenior.submit();
+    },
+    addSeniorSubmit() {
+      this.$refs.addSenior.submit();
+    },
+    lookInfo(row) {
+      this.activeRow = row;
+      this.infoVisible = true;
+    },
   },
 };
 </script>

+ 71 - 22
src/views/categroyManager/modals/addSenior.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-form :inline="true" :model="topForm" label-width="100px">
+    <el-form :inline="true" :model="topForm" label-width="110px" ref='form'>
       <el-row>
         <el-col :span="12">
           <el-form-item label="学生姓名:">
@@ -20,48 +20,66 @@
             prop="paySeniorNum"
             style="width: 100%"
             :rules="[
-            {
-              pattern:
-               /^[1-9]d*$/,
-              message: '请输入正确的资格数',
-              trigger: 'blur',
-            },
-          ]"
+              {
+                required: true,
+                message: '请输入付费课资格数',
+                trigger: 'blur',
+              },
+              {
+                pattern: /^(0|\+?[1-9][0-9]*)$/,
+                message: '请输入正确的付费课资格数',
+                trigger: 'blur',
+              },
+            ]"
           >
             <el-input
               v-model="topForm.paySeniorNum"
-              style="width: 280px"
+              style="width: 270px"
             ></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="赠课资格:" v-if="hasGive" style="width: 100%"  :rules="[
-            {
-              pattern:
-               /^[1-9]d*$/,
-              message: '请输入正确的资格数',
-              trigger: 'blur',
-            },
-          ]">
+          <el-form-item
+          prop="giveSeniorNum"
+            label="赠课资格:"
+            v-if="hasGive"
+            style="width: 100%"
+            :rules="[
+              { required: true, message: '请输入赠课资格数', trigger: 'blur' },
+              {
+                pattern: /^(0|\+?[1-9][0-9]*)$/,
+                message: '请输入正确的赠课资格数',
+                trigger: 'blur',
+              },
+            ]"
+          >
             <el-input
               v-model="topForm.giveSeniorNum"
-              style="width: 280px"
+              style="width: 270px"
             ></el-input>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row>
-        <el-form-item label="调整原因">
-          <el-input   style="width: 660px" type="textarea" :rows="3"></el-input>
+        <el-form-item label="调整原因:" prop="memo"  :rules="[
+              { required: true, message: '请输入调整原因', trigger: 'blur' },
+            ]">
+          <el-input
+            style="width: 650px"
+            type="textarea"
+            v-model="topForm.memo"
+            :rows="3"
+          ></el-input>
         </el-form-item>
       </el-row>
-      <p style="color:red"> 资格调整不影响该活动学员购买次数</p>
+      <p style="color: red">资格调整不影响该活动学员购买次数</p>
     </el-form>
   </div>
 </template>
 <script>
+import { addActivityUserMapperStudents } from "@/api/vipSeting";
 export default {
-  props: ["hasGive"],
+  props: ["hasGive", "activeRow"],
   data() {
     return {
       topForm: {
@@ -72,6 +90,37 @@ export default {
       },
     };
   },
+  mounted() {
+    this.topForm.userName = this.activeRow?.username || "";
+    this.topForm.phone = this.activeRow?.phone || "";
+  },
+  methods: {
+    submit() {
+      this.$refs.form.validate(async (flag) => {
+        if (flag) {
+          let obj = {
+            activityId: this.$route.query.id,
+            memo: this.topForm.memo,
+            activityStudentAdjustDtos: [
+              {
+                courseNum: this.topForm.paySeniorNum,
+                giveCourseNum: this.topForm.giveSeniorNum,
+                userId: this.activeRow.userId,
+              },
+            ],
+          };
+          try {
+            const res = await addActivityUserMapperStudents(obj);
+            this.$message.success("添加成功");
+            this.$emit("getList");
+            this.$emit("close");
+          } catch (e) {
+            console.log(e);
+          }
+        }
+      });
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>

+ 93 - 53
src/views/categroyManager/modals/addStudentSenior.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-alert title="资格信息" :closable="false" class="alert" type="info" />
-    <el-form :inline="true" :model="topForm" label-width="100px">
+    <el-form :inline="true" :model="topForm" label-width="110px" ref="form">
       <el-row>
         <el-col :span="12">
           <el-form-item
@@ -9,8 +9,9 @@
             prop="paySeniorNum"
             style="width: 100%"
             :rules="[
+              { required: true, message: '请输入资格数', trigger: 'blur' },
               {
-                pattern: /^[1-9]d*$/,
+                pattern: /^(0|\+?[1-9][0-9]*)$/,
                 message: '请输入正确的资格数',
                 trigger: 'blur',
               },
@@ -18,7 +19,7 @@
           >
             <el-input
               v-model="topForm.paySeniorNum"
-              style="width: 380px"
+              style="width: 370px"
             ></el-input>
           </el-form-item>
         </el-col>
@@ -27,20 +28,35 @@
             label="赠课资格:"
             v-if="hasGive"
             :rules="[
+              { required: true, message: '请输入赠课资格数', trigger: 'blur' },
               {
-                pattern: /^[1-9]d*$/,
-                message: '请输入正确的资格数',
+                pattern: /^(0|\+?[1-9][0-9]*)$/,
+                message: '请输入正确的赠课资格数',
                 trigger: 'blur',
               },
             ]"
           >
             <el-input
               v-model="topForm.giveSeniorNum"
-              style="width: 380px"
+              style="width: 370px"
             ></el-input>
           </el-form-item>
         </el-col>
       </el-row>
+      <el-row>
+        <el-form-item
+          label="备注:"
+          prop="memo"
+          :rules="[{ required: true, message: '请输入备注', trigger: 'blur' }]"
+        >
+          <el-input
+            type="textarea"
+            :rows="3"
+            v-model="topForm.memo"
+            style="width: 370px"
+          ></el-input>
+        </el-form-item>
+      </el-row>
       <p style="color: red; margin-bottom: 20px">
         资格调整不影响该活动学员购买次数
       </p>
@@ -49,7 +65,6 @@
     <el-form
       :inline="true"
       @submit="search"
-      @reset="onReSet"
       ref="searchForm"
       :model="searchForm"
     >
@@ -69,6 +84,7 @@
           style="width: 180px !important"
           v-model.trim="searchForm.organId"
           clearable
+          multiple
           placeholder="请选择分部"
         >
           <el-option
@@ -94,69 +110,55 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item prop="subjectId">
+      <el-form-item prop="hasMusicCourse">
         <el-select
           clearable
-          v-model="searchForm.subjectId"
+          v-model="searchForm.hasMusicCourse"
           filterable
           placeholder="是否乐团在读"
         >
-          <el-option
-            v-for="item in selects.subjects"
-            :value="item.id"
-            :label="item.name"
-            :key="item.id"
-          ></el-option>
+          <el-option value="1" label="是"></el-option>
+          <el-option value="0" label="否"></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item prop="subjectId">
+      <el-form-item prop="hasVipCourse">
         <el-select
           clearable
-          v-model="searchForm.subjectId"
+          v-model="searchForm.hasVipCourse"
           filterable
           placeholder="是否vip在读"
         >
-          <el-option
-            v-for="item in selects.subjects"
-            :value="item.id"
-            :label="item.name"
-            :key="item.id"
-          ></el-option>
+          <el-option value="1" label="是"></el-option>
+          <el-option value="0" label="否"></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item prop="subjectId">
+      <el-form-item prop="hasPracticeCourse">
         <el-select
           clearable
-          v-model="searchForm.subjectId"
+          v-model="searchForm.hasPracticeCourse"
           filterable
           placeholder="是否网管课在读"
         >
-          <el-option
-            v-for="item in selects.subjects"
-            :value="item.id"
-            :label="item.name"
-            :key="item.id"
-          ></el-option>
+          <el-option value="1" label="是"></el-option>
+          <el-option value="0" label="否"></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item prop="subjectId">
+      <el-form-item prop="hasMember">
         <el-select
           clearable
-          v-model="searchForm.subjectId"
+          v-model="searchForm.hasMember"
           filterable
           placeholder="是否会员"
         >
-          <el-option
-            v-for="item in selects.subjects"
-            :value="item.id"
-            :label="item.name"
-            :key="item.id"
-          ></el-option>
+          <el-option value="1" label="是"></el-option>
+          <el-option value="0" label="否"></el-option>
         </el-select>
       </el-form-item>
       <el-form-item>
         <el-button type="danger" @click="search">搜索</el-button>
-        <el-button native-type="reset" type="primary">重置</el-button>
+        <el-button native-type="reset" type="primary" @click="onReSet"
+          >重置</el-button
+        >
       </el-form-item>
     </el-form>
     <div class="tableWrap">
@@ -208,7 +210,7 @@
 </template>
 <script>
 import pagination from "@/components/Pagination/index";
-import { getStudentList } from "@/api/vipSeting";
+import { getStudentList, addActivityUserMapperStudents } from "@/api/vipSeting";
 
 export default {
   components: { pagination },
@@ -218,11 +220,18 @@ export default {
       topForm: {
         paySeniorNum: null,
         giveSeniorNum: null,
+        memo: "",
       },
       searchForm: {
         search: null,
-        organId: null,
+        organId: this.organList.map((organ) => {
+          return organ.id;
+        }),
         subjectId: null,
+        hasMember: null,
+        hasMusicCourse: null,
+        hasPracticeCourse: null,
+        hasVipCourse: null,
       },
       tableList: [],
       rules: {
@@ -238,24 +247,27 @@ export default {
   },
   async mounted() {
     await this.$store.dispatch("setSubjects");
-    this.getList()
+    this.getList();
   },
   methods: {
     search() {
-      this.rules.page =1;
-      this.getList()
+      this.rules.page = 1;
+      this.getList();
     },
     onReSet() {
-       this.$refs.searchForm.resetFields();
-       this.search()
+      this.$refs.searchForm.resetFields();
+      this.search();
     },
     async getList() {
       try {
-        const res = await getStudentList({
-          ...this.searchForm,
+        let { organId, ...rest } = this.searchForm;
+        let params = {
+          ...rest,
           page: this.rules.page,
           rows: this.rules.limit,
-        });
+          organId: organId.join(","),
+        };
+        const res = await getStudentList(params);
         this.tableList = res.data.rows;
         this.rules.total = res.data.total;
         let idList = this.deleteList.map((course) => {
@@ -264,9 +276,8 @@ export default {
         this.isDetele = true;
         this.$nextTick(() => {
           this.tableList.forEach((course) => {
-
             if (idList.indexOf(course.userId) != -1) {
-                console.log(course)
+              console.log(course);
               this.$refs.tableList.toggleRowSelection(course, true);
             }
           });
@@ -286,7 +297,10 @@ export default {
         // 有可能加 有可能减
         this.deleteList = this.deleteList.concat(arr);
         // 去重
-        this.deleteList = this.$helpers.lodash.uniqBy(this.deleteList, "userId");
+        this.deleteList = this.$helpers.lodash.uniqBy(
+          this.deleteList,
+          "userId"
+        );
       }
       // else if(){}
       else {
@@ -333,6 +347,32 @@ export default {
       this.$set(this, "deleteList", []);
       this.$refs.tableList.clearSelection();
     },
+    async submit() {
+      this.$refs.form.validate(async (flag) => {
+        if (flag) {
+          let obj = {
+            activityId: this.$route.query.id,
+            memo: this.topForm.memo,
+          };
+          let activityStudentAdjustDtos = this.deleteList.map((stu) => {
+            return {
+              userId: stu.userId,
+              courseNum: this.topForm.paySeniorNum,
+              giveCourseNum: this.topForm.giveSeniorNum,
+            };
+          });
+          obj.activityStudentAdjustDtos = activityStudentAdjustDtos;
+          try {
+            const res = await addActivityUserMapperStudents(obj);
+            this.$message.success("添加成功");
+            this.$emit("getList");
+            this.$emit("close");
+          } catch (e) {
+            console.log(e);
+          }
+        }
+      });
+    },
   },
 };
 </script>

+ 158 - 22
src/views/categroyManager/modals/reduceSenior.vue

@@ -12,33 +12,103 @@
       >
         <el-table-column
           align="center"
-          prop="studentId"
+          prop="createTime"
           label="资格添加时间"
         ></el-table-column>
+               <el-table-column
+          align="center"
+          prop="createTime"
+          label="添加方式"
+        >
+        <template slot-scope="scope">
+          <div>
+            {{scope.row.paymentOrderId?'订单购买':'后台添加'}}
+          </div>
+        </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          prop="createTime"
+          label="订单号"
+        >
+        <template slot-scope="scope">
+          <div>
+            {{scope.row.paymentOrderId?scope.row.paymentOrderId:'--'}}
+          </div>
+        </template>
+        </el-table-column>
         <el-table-column
+          v-if="courseType && courseType == 'VIP'"
           align="center"
           prop="studentId"
           label="付费课资格"
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            <div v-if="scope.row.userId">
+              <p v-if="scope.row.returnFee">已退费</p>
+              <p v-else>{{ scope.row.vipFlag | filtersType }}</p>
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column
+          v-else
+          align="center"
+          prop="studentId"
+          label="付费课资格"
+        >
+          <template slot-scope="scope">
+            <div v-if="scope.row.userId">
+              <p v-if="scope.row.returnFee">已退费</p>
+              <p v-else>{{ scope.row.practiceFlag | filtersType }}</p>
+            </div>
+          </template>
+        </el-table-column>
+
+        <el-table-column
+          v-if="giveCourseType == 'VIP'"
           align="center"
           prop="studentId"
           label="赠课资格"
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            <div v-if="scope.row.userId">
+              <p v-if="scope.row.returnFee">已退费</p>
+              <p v-else>{{ scope.row.giveVipFlag | filtersType }}</p>
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column
+          v-if="giveCourseType == 'PRACTICE'"
           align="center"
           prop="studentId"
-          label="操作人"
-        ></el-table-column>
+          label="赠课资格"
+        >
+          <template slot-scope="scope">
+            <div v-if="scope.row.userId">
+              <p v-if="scope.row.returnFee">已退费</p>
+              <p v-else>{{ scope.row.givePracticeFlag | filtersType }}</p>
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column
+          v-if="giveCourseType != 'PRACTICE' && giveCourseType != 'VIP'"
           align="center"
           prop="studentId"
-          label="操作原因"
-        ></el-table-column>
+          label="赠课资格"
+        >
+          <template slot-scope="scope">
+            <div v-if="scope.row.userId">
+              {{ "--" }}
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column align="center" prop="studentId" label="操作">
           <template slot-scope="scope">
             <div>
-              <el-button type="text" @click="cancleSenior(scope.row)"
+              <el-button
+                v-if="showCancle(scope.row)"
+                type="text"
+                @click="cancleSenior(scope.row)"
                 >取消资格</el-button
               >
             </div>
@@ -57,7 +127,9 @@
         <el-row>
           <el-form-item
             label="退费金额"
+            prop="actualPrice"
             :rules="[
+              { required: true, message: '请输入退费金额', trigger: 'blur' },
               {
                 pattern:
                   /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
@@ -66,44 +138,108 @@
               },
             ]"
           >
-            <el-input v-model="form.money" style="width:330px"></el-input>
+            <el-input
+              v-model="form.actualPrice"
+              style="width: 320px"
+            ></el-input>
           </el-form-item>
         </el-row>
         <el-row>
-             <el-form-item label="调整原因">
-          <el-input type="textarea" style="width:330px" :rows="3" v-model="form.reson"></el-input>
-        </el-form-item>
+          <el-form-item
+            label="调整原因"
+            prop="memo"
+            :rules="[
+              { required: true, message: '请输入调整原因', trigger: 'blur' },
+            ]"
+          >
+            <el-input
+              type="textarea"
+              style="width: 320px"
+              :rows="3"
+              v-model="form.memo"
+            ></el-input>
+          </el-form-item>
         </el-row>
-
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="cancleVisible = false">取 消</el-button>
-        <el-button type="primary" @click="cancleVisible = false"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="submitCancle">确 定</el-button>
       </span>
     </el-dialog>
   </div>
 </template>
 <script>
+//
+import { getStudentactivityList, cutActivityrMapper } from "@/api/vipSeting";
 export default {
+  props: ["activeRow", "courseType", "giveCourseType"],
   data() {
     return {
-      tableList: [{}],
-      activeRow: null,
+      tableList: [],
+      activeSenior: null,
       cancleVisible: false,
       form: {
-        reson: null,
-        money: null,
+        memo: null,
+        actualPrice: null,
       },
     };
   },
-  mounted() {},
+  mounted() {
+    this.getList();
+  },
   methods: {
+    async getList() {
+      try {
+        const res = await getStudentactivityList({
+          activityId: this.$route.query.id,
+          userId: this.activeRow.userId,
+          page: 1,
+          rows: 9999,
+        });
+        this.tableList = res.data.rows;
+      } catch (e) {}
+    },
     cancleSenior(row) {
-      this.activeRow = row;
+      this.activeSenior = row;
+      this.form.actualPrice = row.actualPrice;
+      this.form.activityUserMapperId = row.id;
+      this.form.memo = null;
       this.cancleVisible = true;
     },
+    showCancle(row) {
+      return (
+        !row.returnFee &&
+        row.vipFlag !== 2 &&
+        row.practiceFlag !== 2 &&
+        row.givePracticeFlag !== 2 &&
+        row.giveVipFlag !== 2
+      );
+    },
+    submitCancle() {
+      this.$refs.form.validate(async (flag) => {
+        if (flag) {
+          let obj = {
+            activityUserMapperId: this.form.activityUserMapperId,
+            amount: this.form.actualPrice,
+            memo: this.form.memo,
+          };
+          try {
+            const res = await cutActivityrMapper(obj);
+            this.$message.success("取消成功");
+            this.cancleVisible = false;
+            this.$emit("getList");
+            this.getList();
+          } catch (e) {}
+        }
+      });
+      //
+    },
+  },
+  filters: {
+    filtersType(val) {
+      let arr = ["--", "未使用", "已使用"];
+      return arr[val];
+    },
   },
 };
 </script>

+ 64 - 0
src/views/categroyManager/modals/seniorInfo.vue

@@ -0,0 +1,64 @@
+<template>
+  <div>
+    <el-table
+      style="width: 100%"
+      :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      :data="tableList"
+    >
+      <el-table-column
+        align="center"
+        prop="operatorName"
+        label="操作人"
+      ></el-table-column>
+       <el-table-column
+        align="center"
+        prop="createTime"
+        label="操作时间"
+      ></el-table-column>
+      <el-table-column align="center" prop="operatorName" label="类型">
+        <template slot-scope="scope">
+          <div>
+            {{ scope.row.type ? "添加资格" : "减少资格" }}
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" prop="courseNum" label="付费资格数">
+      </el-table-column>
+      <el-table-column align="center" prop="giveCourseNum" label="赠课资格数">
+      </el-table-column>
+      <el-table-column align="center"  label="备注">
+        <template slot-scope="scope">
+          <div>
+               <overflow-text :text="scope.row.memo"></overflow-text>
+          </div>
+        </template>
+
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+<script>
+//
+import { activityrMapperInfo } from "@/api/vipSeting";
+export default {
+  props: ["activeRow"],
+  data() {
+    return {
+      tableList: [],
+    };
+  },
+  async mounted() {
+    try {
+      const res = await activityrMapperInfo({
+        rows: 9999,
+        page: 1,
+        userId: this.activeRow.userId,
+      });
+      this.tableList = res.data.rows;
+    } catch (e) {
+      console.log(e);
+    }
+  },
+  methods: {},
+};
+</script>

+ 1 - 1
src/views/categroyManager/vipActiveList.vue

@@ -242,7 +242,7 @@
                     scope.row.minCourseNum == scope.row.maxCourseNum
                   "
                   type="text"
-                  v-permission="'vipGroupActivity/update'"
+                  v-permission="'/activeSenior'"
                   @click="activeManager(scope.row)"
                   >资格管理</el-button
                 >