浏览代码

提交一下

1
mo 3 年之前
父节点
当前提交
f635114054

+ 2 - 1
src/constant/index.js

@@ -393,5 +393,6 @@ export const coupontypeDetail = {
   PRACTICE:'网管课',
   SINGLE:'声部课',
   MIX:'合奏课',
-  VIP:'VIP'
+  VIP:'VIP',
+  FULLCOUPON:'全类券'
 }

+ 8 - 0
src/utils/vueFilter.js

@@ -794,3 +794,11 @@ Vue.filter('cloudGroupActive', value => {
 Vue.filter('chargingStatus', value => {
   return constant.chargingStatus[value]
 })
+Vue.filter('usageStatus', value => {
+  let obj = {
+    0: "未使用",
+    1: "已使用",
+    2: "已过期",
+  };
+  return obj[value];
+})

+ 22 - 0
src/views/couponManager/api.js

@@ -40,3 +40,25 @@ export const getSysCouponCode = data => request2({
   params: data,
   method: 'get',
 })
+
+// 手动发放优惠券
+export const getIssueCoupon = data => request2({
+  url: '/api-web/sysCouponIssue/issueCoupon',
+  data,
+  method: 'post',
+})
+
+// 优惠券发放名单
+export const getIssueRecord = data => request2({
+  url: '/api-web/sysCouponIssue/queryIssueRecord',
+ data,
+  method: 'post',
+})
+
+// 优惠卷发放详情
+export const getIssueRecordDetail = data => request2({
+  url: '/api-web/sysCouponIssue/queryIssueDetail',
+ data,
+  method: 'post',
+})
+

+ 102 - 8
src/views/couponManager/couponGiveChiose.vue

@@ -1,5 +1,52 @@
 <template>
   <div>
+    <el-form
+      :inline="true"
+      @submit="search"
+      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
+          multiple
+          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 prop="ops">
+        <el-select v-model="searchForm.ops" placeholder="使用状态" clearable>
+          <el-option label="未使用" :value="0"></el-option>
+          <el-option label="已使用" :value="1"></el-option>
+          <el-option label="已撤销" :value="1"></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" @click="onReSet"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
     <el-table
       style="width: 100%"
       :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
@@ -20,12 +67,7 @@
         prop="phone"
         label="手机号"
       ></el-table-column>
-      <el-table-column
-        align="center"
-        prop="couponId"
-        label="优惠券编号"
-      ></el-table-column>
-      <el-table-column align="center" prop="couponId" label="状态">
+      <el-table-column align="center" prop="couponId" label="优惠券状态">
         <template slot-scope="scope">
           <div>
             <p>{{ scope.row.usageStatus | usageStatus }}</p>
@@ -33,13 +75,65 @@
         </template>
       </el-table-column>
     </el-table>
+    <pagination
+      :total.sync="rules.total"
+      :page.sync="rules.page"
+      :limit.sync="rules.limit"
+      :page-sizes.sync="rules.page_size"
+      @pagination="getList"
+    />
   </div>
 </template>
 <script>
+import { getIssueRecordDetail } from "./api.js";
+import pagination from "@/components/Pagination/index";
 export default {
-  props:['tableList'],
+  components: {
+    pagination,
+  },
+  props: ["activeRow"],
   data() {
-    return {};
+    return {
+      tableList: [],
+      searchForm: {
+        search: null,
+        organId: null,
+        usageStatus: null,
+      },
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+    };
+  },
+  async mounted() {
+    await this.$store.dispatch("setBranchs");
+    this.getList();
+  },
+  methods: {
+    async getList() {
+      try {
+        const res = await getIssueRecordDetail({
+          page: this.rules.page,
+          rows: this.rules.limit,
+          ...this.searchForm,
+          issueId: this.activeRow.id,
+        });
+        this.tableList = res.data.rows;
+        this.rules.total = res.data.total;
+      } catch (e) {}
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.$refs.searchForm.resetFields();
+      this.search();
+    },
   },
 };
 </script>

+ 1 - 1
src/views/couponManager/couponGiveList.vue

@@ -139,7 +139,7 @@ export default {
         usageStatus: null,
         organId: null,
       },
-
+      couponDetailVisible:false,
       tableList: [],
       organList: [],
       rules: {

+ 49 - 3
src/views/couponManager/couponGrant.vue

@@ -102,6 +102,12 @@
           >
         </el-form-item>
       </el-form>
+      <el-button
+        type="primary"
+        @click="cancelChiose"
+        style="margin-bottom: 20px"
+        >取消选择</el-button
+      >
       <div class="tableWrap">
         <el-table
           style="width: 100%"
@@ -154,7 +160,9 @@
 <script>
 import pagination from "@/components/Pagination/index";
 import { getStudentList, addActivityUserMapperStudents } from "@/api/vipSeting";
+import { getIssueCoupon } from "./api";
 export default {
+  props: ["activeRow"],
   components: { pagination },
   data() {
     return {
@@ -178,7 +186,7 @@ export default {
         total: 0, // 总条数
         page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
-         isDetele: false,
+      isDetele: false,
       deleteList: [],
     };
   },
@@ -193,10 +201,10 @@ export default {
     }
     await this.$store.dispatch("setBranchs");
     await this.$store.dispatch("setSubjects");
-    this.getList()
+    this.getList();
   },
   methods: {
-      search() {
+    search() {
       this.rules.page = 1;
       this.getList();
     },
@@ -293,6 +301,44 @@ export default {
       this.$set(this, "deleteList", []);
       this.$refs.tableList.clearSelection();
     },
+    cancelChiose() {
+      this.clearCom();
+    },
+    submit() {
+      console.log(this.deleteList);
+      let obj = {};
+      let studentNames = this.deleteList
+        .map((course) => {
+          return course.username;
+        })
+        .join(",");
+      obj.couponId = this.activeRow.id;
+      obj.studentIds = this.deleteList
+        .map((course) => {
+          return course.userId;
+        })
+        .join(",");
+      this.$confirm(
+        `是否给以下${studentNames} ${this.deleteList.length}名发放优惠券`,
+        "提示",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      ).then(async (res) => {
+        try {
+          const rusle = await getIssueCoupon(obj)
+          this.$message.success('发放成功')
+          this.$emit("getList");
+          this.$emit("close");
+        } catch (e) {
+          console.log(e)
+        }
+      });
+
+      //  getIssueCoupon
+    },
     // onCancel() {
     //   this.$router.push("/couponManager");
     // },

+ 30 - 26
src/views/couponManager/couponRecord.vue

@@ -9,20 +9,17 @@
         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 prop="ops">
+          <el-select v-model="searchForm.ops" placeholder="操作" clearable>
+            <el-option label="发放" :value="0"></el-option>
+            <el-option label="撤回" :value="1"></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" @click="onReSet"
+          <!-- <el-button native-type="reset" type="primary" @click="onReSet"
             >重置</el-button
-          >
+          > -->
         </el-form-item>
       </el-form>
       <div class="tableWrap">
@@ -34,22 +31,28 @@
         >
           <el-table-column
             align="center"
-            prop="organName"
+            prop="createdTime"
             label="发放时间"
           ></el-table-column>
           <el-table-column
             align="center"
-            prop="username"
+            prop="num"
             label="数量"
           ></el-table-column>
           <el-table-column
             align="center"
             prop="phone"
-            label="操作类型"
-          ></el-table-column>
+            label="操作"
+          >
+          <template slot-scope="scope">
+            <div>
+              {{scope.row.ops?'撤回':'发放'}}
+            </div>
+          </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            prop="subjectNames"
+            prop="name"
             label="操作人"
           ></el-table-column>
           <el-table-column align="center" prop="subjectNames" label="操作">
@@ -78,8 +81,8 @@
         />
       </div>
 
-      <el-dialog title="发放名单" :visible.sync="couponDetailVisible" width="1000px" append-to-body>
-        <couponGiveList :activeRow="activeRow" />
+      <el-dialog title="发放名单" :visible.sync="couponDetailVisible" width="1000px" append-to-body v-if="couponDetailVisible">
+        <couponGiveChiose :activeRow="activeRows" />
         <span slot="footer" class="dialog-footer">
           <el-button @click="couponDetailVisible = false">取 消</el-button>
           <el-button @click="couponDetailVisible = false" type="primary"
@@ -93,10 +96,12 @@
 
 <script>
 import pagination from "@/components/Pagination/index";
-import { getStudentList, addActivityUserMapperStudents } from "@/api/vipSeting";
-import couponGiveList from'./couponGiveList'
+import { getStudentList } from "@/api/vipSeting";
+import {getIssueRecord} from './api'
+import couponGiveChiose from'./couponGiveChiose'
 export default {
-  components: { pagination,couponGiveList },
+  props:['activeRow'],
+  components: { pagination,couponGiveChiose },
   data() {
     return {
       searchForm: {
@@ -114,7 +119,7 @@ export default {
         page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
       couponDetailVisible:false,
-      activeRow:null
+      activeRows:null
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -122,9 +127,6 @@ export default {
   //生命周期 - 挂载完成(可以访问DOM元素)
   async mounted() {
     // 获取分部
-    if (this.$route.query.row) {
-      this.activeRow = JSON.parse(this.$route.query.row);
-    }
     this.getList();
   },
   methods: {
@@ -143,16 +145,18 @@ export default {
           ...rest,
           page: this.rules.page,
           rows: this.rules.limit,
+          couponId:this.activeRow.id
         };
-        const res = await getStudentList(params);
+        const res = await getIssueRecord(params);
         this.tableList = res.data.rows;
+        this.rules.total = res.data.total;
       } catch (e) {
         console.log(e);
       }
     },
     revokeCoupon(row) {},
     couponDetail(row) {
-      this.activeRow = row;
+      this.activeRows = row;
       this.couponDetailVisible = true
     },
   },

+ 9 - 5
src/views/couponManager/index.vue

@@ -365,12 +365,12 @@
                     >删除</el-button
                   >
                 </auth>
-                <auth auths="sysCoupon/delete" v-if="scope.row.issuanceType">
+                <auth auths="sysCoupon/delete" v-if="scope.row.issuanceType&&scope.row.status">
                   <el-button type="text" @click="getCoupon(scope.row)"
                     >手动发放</el-button
                   >
                 </auth>
-                <auth auths="sysCoupon/delete" v-if="scope.row.issuanceType">
+                <auth auths="sysCoupon/delete" v-if="scope.row.issuanceType&&scope.row.status">
                   <el-button type="text" @click="getCouponRecord(scope.row)"
                     >发放记录</el-button
                   >
@@ -389,11 +389,11 @@
         />
       </div>
     </div>
-    <el-dialog :title="title" :visible.sync="addCouponVisible" width="1200px">
-      <couponGrant :activeRow="activeRow" />
+    <el-dialog :title="title" :visible.sync="addCouponVisible" width="1200px" v-if="addCouponVisible">
+      <couponGrant :activeRow="activeRow" ref='couponGrant' @getList='getList' @close='addCouponVisible = false'/>
       <span slot="footer" class="dialog-footer">
         <el-button @click="addCouponVisible = false">取 消</el-button>
-        <el-button @click="addCouponVisible = false" type="primary"
+        <el-button @click="addCouponSubmit" type="primary"
           >确 定</el-button
         >
       </span>
@@ -401,6 +401,7 @@
     <el-dialog
       title="发放记录"
       :visible.sync="giveCouponVisible"
+      v-if="giveCouponVisible"
       width="1200px"
     >
       <couponRecord :activeRow="activeRow" />
@@ -567,6 +568,9 @@ export default {
       this.activeRow = row;
       this.giveCouponVisible = true;
     },
+    addCouponSubmit(){
+      this.$refs.couponGrant.submit()
+    }
   },
 };
 </script>

+ 7 - 4
src/views/resetTeaming/components/payInfoDetail.vue

@@ -458,24 +458,25 @@ export default {
       } catch (error) {}
     },
     goback() {
-      let query = this.$route.query;
+      let query = {...this.$route.query};
+      query.calenderId = null;
       if (query.type == "resetTeam") {
         this.$store.dispatch("delVisitedViews", this.$route);
         this.$router.push({
           path: "/business/resetTeaming",
-          query: { ...this.$route.query },
+          query
         });
       } else if (query.type == "look") {
         this.$store.dispatch("delVisitedViews", this.$route);
         this.$router.push({
           path: "/business/resetTeaming",
-          query: { ...this.$route.query },
+          query
         });
       } else if (query.type == "PRE_BUILD_FEE" || query.type == "feeAudit") {
         this.$store.dispatch("delVisitedViews", this.$route);
         this.$router.push({
           path: "/business/resetTeaming",
-          query: { ...this.$route.query },
+          query
         });
       }
     },
@@ -618,6 +619,8 @@ export default {
     teamCourse(val) {
       if (!val) {
         this.$set(this.form, "eclass", null);
+        this.$set(this.form, "leixing", '2');
+
       } else {
         // this.$set(this.form, "eclass", [{}]);
       }

+ 1 - 1
vue.config.js

@@ -16,7 +16,7 @@ const name = defaultSettings.title || '管乐迷后台管理系统' // page titl
 // http://47.99.212.176:8000
 // //  https://online.dayaedu.com
 // let target = 'https://online.dayaedu.com' //线上
-// let target = 'http://192.168.3.227:8000' // 何国威
+// let target = 'http://192.168.3.251:8000' // 何国威
 // let target = 'http://192.168.3.250:8000' //邹璇
 // let target = 'http://192.168.3.112:8000' //勇哥
 let target = 'http://dev.dayaedu.com' // 开发环境