فهرست منبع

提交测试

1
mo 3 سال پیش
والد
کامیت
409fb39f90

+ 8 - 1
src/api/vipSeting.js

@@ -417,5 +417,12 @@ export const getVipGroupActivity = data => request2({
   method: 'get',
   requestType: 'form'
 })
-// 获取活动方案
+// 启用停用活动方案
+export const enableVipGroupActivity = data => request2({
+  url:api +  '/vipGroupActivity/enable',
+  params:data,
+  method: 'get',
+  requestType: 'form'
+})
+
 

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

@@ -170,7 +170,7 @@
             placeholder="请选择是否充值课程余额"
             clearable
             style="width: 400px !important"
-            :disabled="isDisabled  || status !=  'DRAFT'"
+            :disabled="isDisabled || status != 'DRAFT' || balanceDis"
           >
             <el-option label="课程余额" :value="1"></el-option>
             <el-option label="资格限制" :value="0"></el-option>
@@ -202,6 +202,7 @@ export default {
   name: "vipNewActive",
   data() {
     return {
+      balanceDis: false,
       vipResetTypeList,
       pageType: "",
       labelPosition: "right",
@@ -240,7 +241,7 @@ export default {
         stauts: [
           { required: true, message: "请选择活动形式", trigger: "blur" },
         ],
-        applyToStudentType: [{ required: true, message: "请选择是否新生专享" }],
+        applyToStudentType: [{ required: false, message: "请选择是否新生专享" }],
         isPayToBalance: [{ required: true, message: "请选择是否支付到余额" }],
         allowOnlineToOffline: [
           { required: true, message: "请选择课程调整方式" },
@@ -560,6 +561,17 @@ export default {
       // this.$refs.vipform.resetFields();
     },
   },
+  watch: {
+    "baseForm.activityType"(val) {
+      if (val) {
+        // 会员活动
+        this.baseForm.isPayToBalance = 0;
+        this.balanceDis = true;
+      } else {
+        this.balanceDis = false;
+      }
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>

+ 3 - 3
src/views/categroyManager/modals/payInfo.vue

@@ -44,9 +44,9 @@
             prop="vipGroupCategoryIdList"
             v-if="payForm.courseType == 'VIP'"
           >
-            <select-all
+            <el-select
               v-model.trim="payForm.vipGroupCategoryIdList"
-              style="width: 400px"
+              style="width: 400px!important"
               @visible-change="$forceUpdate()"
               clearable
               :disabled="isDisabled"
@@ -57,7 +57,7 @@
                 :value="item.id"
                 :label="item.name"
               ></el-option>
-            </select-all>
+            </el-select>
           </el-form-item>
         </el-row>
         <el-row>

+ 57 - 3
src/views/categroyManager/vipActiveList.vue

@@ -59,6 +59,21 @@
             v-model="searchForm.enable"
             clearable
             @clear="resetEnable"
+<<<<<<< Updated upstream
+=======
+            placeholder="是否启用"
+          >
+            <el-option label="是" :value="true"></el-option>
+            <el-option label="否" :value="false"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item prop="status">
+          <el-select
+            filterable
+            style="width: 180px !important"
+            v-model="searchForm.status"
+            clearable
+>>>>>>> Stashed changes
             placeholder="活动状态"
           >
             <el-option label="开启" :value="true"></el-option>
@@ -231,7 +246,28 @@
                   type="text"
                   v-permission="'vipGroupActivity/update'"
                   @click="reset(scope.row)"
+<<<<<<< Updated upstream
                   >修改</el-button
+=======
+                  v-if="!scope.row.enable|| scope.row.status == 'DRAFT'"
+                  >修改</el-button
+                >
+                <el-button
+                  style="margin-left: 0px"
+                  v-if="!scope.row.enable&&scope.row.status == 'PROGRESS'"
+                  type="text"
+                  v-permission="'vipGroupActivity/enable'"
+                  @click="resetStatus(scope.row)"
+                  >启用</el-button
+                >
+                <el-button
+                  v-if="scope.row.enable&&scope.row.status == 'PROGRESS'"
+                  style="margin-left: 0px"
+                  type="text"
+                  v-permission="'vipGroupActivity/enable'"
+                  @click="resetStatus(scope.row)"
+                  >停用</el-button
+>>>>>>> Stashed changes
                 >
                 <!-- <el-button type='text'
                 @click="remove(scope.row)">删除</el-button>-->
@@ -240,6 +276,7 @@
                   width="160"
                   v-permission="'vipGroupActivity/delete'"
                   :ref="scope.$index"
+                  v-if="scope.row.status != 'PROGRESS'&&!scope.row.enable"
                 >
                   <p>确定删除?</p>
                   <div style="text-align: right; margin: 0">
@@ -278,10 +315,8 @@ const MAX_NUMBER = 999;
 import pagination from "@/components/Pagination/index";
 import {
   vipGroupActivity,
-  vipGroupCategory,
-  addVipActive,
-  resetVipActive,
   removeVipActive,
+  enableVipGroupActivity
 } from "@/api/vipSeting";
 import qs from "qs";
 import { Export } from "@/utils/downLoadFile";
@@ -665,6 +700,25 @@ export default {
       }
       return callback(new Error("输入值不得小于最小课时数"));
     },
+    resetStatus(row) {
+      let tempString = row.enable ? "停用" : "启用";
+      this.$confirm(`是否${tempString}该活动?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          enableVipGroupActivity({id: row.id }).then(
+            (res) => {
+              if(res.code == 200){
+                this.$message.success('操作成功')
+                this.getList()
+              }
+            }
+          );
+        })
+        .catch(() => {});
+    },
   },
 };
 </script>

+ 7 - 3
src/views/categroyManager/vipNewActive.vue

@@ -310,7 +310,6 @@ export default {
         startTime,
         endTime,
         applyToStudentType,
-        vipGroupCategoryIdList,
         vipGroupSalarySettlement,
       };
       if (this.baseForm.id) {
@@ -401,13 +400,18 @@ export default {
       };
       // this.$set()
       //格式化payForm
+      // console.log(data.vipGroupCategoryIdList
+      //     .split(",")
+      //     .map((id) => {
+      //       return Number(id);
+      //     }),)
       this.payForm = {
         courseType: data.courseType,
-        vipGroupCategoryIdList: data.vipGroupCategoryIdList
+        vipGroupCategoryIdList: data.vipGroupCategoryIdList?data.vipGroupCategoryIdList
           .split(",")
           .map((id) => {
             return Number(id);
-          }),
+          })[0]:null,
         teachMode: data.teachMode + "",
         allowOnlineToOffline: data.allowOnlineToOffline + "",
         singleCourseTime: data.singleCourseTime,