Browse Source

Merge branch 'zzx' into 2.0

wenjie 7 months ago
parent
commit
308dd0cca3

+ 0 - 1
package.json

@@ -33,7 +33,6 @@
     "vue-router": "3.0.6",
     "vuex": "3.1.0",
     "xlsx": "^0.16.0"
-
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "4.4.4",

+ 40 - 4
src/api/common.js

@@ -4,13 +4,49 @@
  * @LastEditors: wenjie 1454560336@qq.com
  * @LastEditTime: 2024-08-19 16:52:26
  * @FilePath: \admin-manage\src\api\common.js
- * @Description: 
- * 
- * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
+ * @Description:
+ *
+ * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
  */
 
 import request from '@/utils/request'
 
+// 后台激活指定账号
+export function labourActivation(params) {
+  return request({
+    url: '/vipserver/group/activation',
+    method: 'post',
+    params
+  })
+}
+
+// 查看激活码列表
+export function checkoutActivationCode(data) {
+  return request({
+    url: '/vipserver/group/activationList',
+    method: 'post',
+    data
+  })
+}
+
+// 生成激活码
+export function generateCode(data) {
+  return request({
+    url: '/vipserver/group/createTicket',
+    method: 'post',
+    data
+  })
+}
+
+// 获取会员激活码列表
+export function getGroupList(data) {
+  return request({
+    url: '/vipserver/group/groupList',
+    method: 'post',
+    data
+  })
+}
+
 // 获取套餐字典
 export function getSetMealNameAndId(params) {
   return request({
@@ -155,4 +191,4 @@ export function delCity(params) {
     method: 'post',
     params
   })
-}
+}

+ 35 - 13
src/router/index.js

@@ -4,9 +4,9 @@
  * @LastEditors: wenjie 1454560336@qq.com
  * @LastEditTime: 2024-10-21 14:58:35
  * @FilePath: \admin-manage\src\router\index.js
- * @Description: 
- * 
- * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
+ * @Description:
+ *
+ * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
  */
 import Vue from 'vue'
 import Router from 'vue-router'
@@ -116,7 +116,7 @@ export let constantRoutes = [{
   //       id: 37,
   //       path: '/adminManage/adminDetail',
   //       name: '/adminManage/adminDetail',
-  //       hidden: true , 
+  //       hidden: true ,
   //       component: () => import('@/views/adminManage/adminDetail.vue'),
   //       meta: { title: '账号详情', icon: '',activeMenu:'/adminManage/adminList' },
   //     },
@@ -124,7 +124,7 @@ export let constantRoutes = [{
   //       id: 37,
   //       path: '/adminManage/adminAdd',
   //       name: '/adminManage/adminAdd',
-  //       hidden: true , 
+  //       hidden: true ,
   //       component: () => import('@/views/adminManage/adminAdd.vue'),
   //       meta: { title: '人员添加', icon: '',activeMenu:'/adminManage/adminList' },
   //     },
@@ -170,7 +170,7 @@ export let constantRoutes = [{
               icon: ''
             },
           },
-          
+
           {
             id: 1,
             path: '/operationManage/shopManage/shopAdd',
@@ -488,7 +488,7 @@ export let constantRoutes = [{
             activeMenu: '/operationManage/orderManage/list'
           },
         },
-        
+
        ]
       },
       {
@@ -509,7 +509,7 @@ export let constantRoutes = [{
             title: '小桔活动',
             icon: ''
           },
-        }, 
+        },
         {
           id: 0,
           path: '/operationManage/marketingManage/invitePromotion/index',
@@ -573,6 +573,16 @@ export let constantRoutes = [{
               icon: ''
             },
           },
+          {
+            id: 1,
+            path: '/operationManage/comboManage/vipActivation',
+            name: '/operationManage/comboManage/vipActivation',
+            component: () => import('@/views/operationManage/comboManage/vipActivation.vue'),
+            meta: {
+              title: '会员激活码',
+              icon: ''
+            },
+          },
           // {
           //   id: 1,
           //   path: '/operationManage/comboManage/addCombo',
@@ -619,9 +629,21 @@ export let constantRoutes = [{
 
             },
           },
+          {
+            id: 1,
+            path: '/operationManage/comboManage/checkoutCode',
+            name: '/operationManage/comboManage/checkoutCode',
+            component: () => import('@/views/operationManage/comboManage/checkoutCode.vue'),
+            hidden:true,
+            meta: {
+              title: '查看激活码',
+              icon: '',
+              activeMenu: '/operationManage/comboManage/vipActivation'
+            },
+          },
         ]
       },
-      
+
       {
         id: 0,
         path: '/operationManage/financeManage/index',
@@ -640,7 +662,7 @@ export let constantRoutes = [{
             title: '分账列表',
             icon: ''
           },
-        }, 
+        },
         {
           id: 1,
           path: '/operationManage/financeManage/withdraw',
@@ -650,7 +672,7 @@ export let constantRoutes = [{
             title: '账户余额',
             icon: ''
           },
-        }, 
+        },
       ]
       },
       // {
@@ -866,7 +888,7 @@ export let constantRoutes = [{
 
             },
           },
-          
+
         ]
       },
       {
@@ -1004,7 +1026,7 @@ export let constantRoutes = [{
           },
         ]
       },
-      
+
       // {
       //   id: 0,
       //   path: '/operationManage/noticeManage/index',

+ 281 - 0
src/views/operationManage/comboManage/checkoutCode.vue

@@ -0,0 +1,281 @@
+<template>
+  <div class="orderManage app-container">
+    <div class="search">
+      <div>
+        <el-input v-model="query.id" size="small" placeholder="请输入激活ID" class="item-width-200"></el-input>
+        <el-input v-model="query.serialNumber" size="small" placeholder="请输入激活码" class="item-width-200 ml10"></el-input>
+        <el-input v-model="query.phone" size="small" placeholder="请输入激活手机号" class="item-width-200 ml10"></el-input>
+        <el-date-picker v-model="date" size="small" value-format="yyyy-MM-dd" class="item-width-350 ml10"
+          type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
+        </el-date-picker>
+        <el-select v-model="query.state" size="small" clearable class="item-width-200 ml10" placeholder="请选择状态">
+          <el-option label="待使用" value="1"></el-option>
+          <el-option label="激活成功" value="2"></el-option>
+        </el-select>
+        <el-button class="ml10" type="primary" size="small" icon="el-icon-search" @click="handleSearch">
+          搜索
+        </el-button>
+      </div>
+      <el-button class="ml10" type="info" size="small" plain icon="el-icon-back" @click="comeBack">
+        返回
+      </el-button>
+    </div>
+    <el-descriptions class="margin-top" :column="3" border>
+      <el-descriptions-item>
+        <template slot="label"> 计费号 </template>
+        {{ groupInfos.billId||'--' }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 集团名称 </template>
+        {{ groupInfos.groupName||'--' }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 订购数量 </template>
+        {{ groupInfos.orderNum||'--' }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 所属平台 </template>
+        慧研学惠生活
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 订购产品策划名称 </template>
+        {{ groupInfos.groupPlanName||'--' }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 激活码数量 </template>
+        {{ groupInfos.totalTicket||'--' }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 已使用数量 </template>
+        {{ groupInfos.useTicket||'--' }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 未使用数量 </template>
+        {{ groupInfos.totalTicket-groupInfos.useTicket||'--' }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 激活失败 </template>
+        {{ '--' }}
+      </el-descriptions-item>
+    </el-descriptions>
+    <div style="height: 20px;"></div>
+    <el-table :data="tableData" tooltip-effect="dark" border v-loading="loading" style="width: 100%">
+      <el-table-column align="center" label="激活ID" prop="id" show-overflow-tooltip>
+      </el-table-column>
+      <el-table-column prop="serialNumber" align="center" label="激活码" show-overflow-tooltip>
+      </el-table-column>
+      <el-table-column prop="planningName" align="center" label="会员套餐" show-overflow-tooltip>
+      </el-table-column>
+      <el-table-column prop="goodsAmount" align="center" label="有效期类型" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span v-if="scope.row.activationType == 1">时间段</span>
+          <span v-else>天数</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="activationDay" align="center" label="时间段/天数" show-overflow-tooltip>
+        <template slot-scope="scope">
+          {{ scope.row.activationDay||'--' }}
+        </template>
+      </el-table-column>
+      <el-table-column prop="startTime" align="center" label="创建时间" show-overflow-tooltip>
+        <template slot-scope="scope">
+          {{ timeFormat(scope.row.targetStartTime) }}
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="状态" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span v-if="scope.row.phone == null">待使用</span>
+          <span v-else>激活成功</span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="推送状态" show-overflow-tooltipphone>
+        <template slot-scope="scope">
+          <span>--</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="phone" align="center" label="激活手机号" show-overflow-tooltip>
+      </el-table-column>
+      <el-table-column align="center" label="激活时间" show-overflow-tooltip>
+        <template slot-scope="scope">
+          {{ timeFormat(scope.row.useTime) }}
+        </template>
+      </el-table-column>
+      <el-table-column prop="address" align="center" label="操作">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" v-if="scope.row.phone == null"
+            @click="activationVip(scope.row)">激活</el-button>
+          <el-button type="text" size="small" v-else @click="synchronization">同步</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="page-box">
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" background
+        :current-page="query.page" :page-sizes="[10, 20, 30, 40]" :page-size="query.size"
+        layout="total, sizes, prev, pager, next, jumper" :total="total">
+      </el-pagination>
+    </div>
+    <el-dialog title="激活" :visible.sync="vipDialogVisible" width="30%" center>
+      <div style="margin-left: 32px;margin-bottom: 30px;font-weight: 600;">激活码:{{ vipCode }}</div>
+      <el-form :model="updataPhone" ref="updataPhone" :rules="rules" label-width="130px" size="small">
+        <el-form-item label="激活手机号:" prop="num">
+          <el-input v-model="updataPhone.num" class="item-width-200" placeholder="请输入激活手机号"></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="Cancel">取 消</el-button>
+        <el-button type="primary" :loading="updataLoading" @click="confirmActivation('updataPhone')">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { debounce } from "@/utils/index";
+import { checkoutActivationCode, labourActivation } from "@/api/common";
+import { timeFormat } from "@/utils/index";
+
+export default {
+  name: "orderManage",
+  data() {
+    return {
+      updataLoading: false,
+      date: '',
+      vipCode: '',
+      groupInfos: {},
+      updataPhone: {
+        num: '',
+      },
+      rules: {
+        num: [
+          { required: true, pattern: /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/, message: "请正确输入手机号", trigger: "blur" },
+        ],
+      },
+      vipDialogVisible: false,
+
+      tableData: [],
+      loading: false,
+      query: {
+        id: '',
+        phone: "",
+        serialNumber: "",
+        groupOrderNo: '',
+        startTime: "",
+        endTime: "",
+        state:'',
+        page: 1,
+        size: 10,
+      },
+      title: "",
+      total: 0,
+    };
+  },
+  watch: {
+    // query: {
+    //   handler: debounce(function(val) {
+    //     this.getList()
+
+    //   }),
+    //   deep:true
+    // },
+    date(val) {
+      if (val) {
+        this.query.startTime = val[0];
+        this.query.endTime = val[1];
+      } else {
+        this.query.startTime = "";
+        this.query.endTime = "";
+      }
+    },
+  },
+  filters: {
+
+  },
+  methods: {
+    synchronization(){
+      this.getList();
+    },
+
+    Cancel(){
+      this.vipDialogVisible = false;
+      this.updataPhone.num = ''
+    },
+    // 确认激活
+    confirmActivation(formName) {
+      this.$refs[formName].validate((valid) => {
+        let updata = {
+          phone:this.updataPhone.num,
+          serialNumber: this.vipCode
+        }
+        if (valid) {
+          this.updataLoading = true;
+          labourActivation({ ...updata }).then((res) => {
+            this.updataLoading = false
+            if (res.state == "Success") {
+              this.vipDialogVisible = false
+              this.updataPhone.num = ''
+              this.getList()
+            } else {
+            }
+          })
+        } else {
+          return false;
+        }
+      });
+    },
+
+    // 激活弹窗
+    activationVip(item) {
+      this.vipDialogVisible = true
+      this.vipCode = item.serialNumber
+    },
+
+    // 返回上一级
+    comeBack() {
+      this.$router.back()
+    },
+    handleSearch() {
+      this.query.page = 1;
+      this.getList();
+    },
+    timeFormat(val) {
+      return timeFormat(val);
+    },
+    handleSizeChange(val) {
+      this.query.page = 1;
+      this.query.size = val;
+      this.getList();
+    },
+    handleCurrentChange(val) {
+      this.query.page = val;
+      this.getList();
+    },
+
+    search() {
+      this.query.page = 1;
+      this.getList();
+    },
+    getList() {
+      this.loading = true;
+      this.groupInfos = JSON.parse(this.$route.query.groupInfo)
+      this.query.groupOrderNo = this.groupInfos.orderNo;
+      let obj = JSON.parse(JSON.stringify(this.query));
+      obj.page = obj.page - 1;
+      if (!obj.orderType) {
+        delete obj.orderType;
+      }
+      checkoutActivationCode(obj).then((res) => {
+        this.loading = false;
+        if (res.state == "Success") {
+          this.tableData = res.content.content;
+          this.total = res.content.totalElements;
+        }
+      });
+    },
+  },
+  created() {
+    this.getList();
+  },
+};
+</script>
+
+<style lang="scss"></style>

+ 593 - 0
src/views/operationManage/comboManage/vipActivation.vue

@@ -0,0 +1,593 @@
+<template>
+  <div class="orderManage app-container">
+    <div class="search">
+      <div>
+        <el-input
+          v-model="query.billId"
+          size="small"
+          placeholder="请输入计费号"
+          class="item-width-200"
+        ></el-input>
+        <el-input
+          v-model="query.groupName"
+          size="small"
+          placeholder="请输入集团名称"
+          class="item-width-200 ml10"
+        ></el-input>
+        <el-input
+          v-model="query.groupPlanNameType"
+          size="small"
+          placeholder="请输入产品策划名称"
+          class="item-width-200 ml10"
+        ></el-input>
+        <el-input
+          v-model="query.orderNo"
+          size="small"
+          placeholder="请输入订单号"
+          class="item-width-200 ml10"
+        ></el-input>
+        <!-- <el-select
+          v-model="query.miniApp"
+          size="small"
+          clearable
+          class="item-width-200 ml10"
+          placeholder="请选择所属小程序"
+        >
+          <el-option
+            v-for="item in options"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select> -->
+        <el-select
+          v-model="query.groupType"
+          size="small"
+          clearable
+          class="item-width-200 ml10"
+          placeholder="请选择状态"
+        >
+          <el-option
+            v-for="item in statusOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+        <el-select
+          v-model="query.actionID"
+          size="small"
+          clearable
+          class="item-width-200 ml10"
+          placeholder="请选择订单状态"
+        >
+          <el-option
+            v-for="item in orderStatusoptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+        <el-button
+          class="ml10"
+          type="primary"
+          size="small"
+          icon="el-icon-search"
+          @click="handleSearch"
+        >
+          搜索
+        </el-button>
+      </div>
+    </div>
+
+    <el-table
+      :data="tableData"
+      tooltip-effect="dark"
+      border
+      v-loading="loading"
+      style="width: 100%"
+    >
+      <el-table-column
+        align="center"
+        label="计费号"
+        prop="billId"
+        show-overflow-tooltip
+      >
+      </el-table-column>
+      <el-table-column
+        prop="groupName"
+        align="center"
+        label="集团名称"
+        show-overflow-tooltip
+      >
+      </el-table-column>
+      <el-table-column
+        prop="orderNo"
+        align="center"
+        label="订单号"
+        show-overflow-tooltip
+      >
+      </el-table-column>
+      <el-table-column
+        prop="groupPlanName"
+        align="center"
+        label="订购产品策划名称"
+        show-overflow-tooltip
+      ></el-table-column>
+      <el-table-column
+        prop="orderPrice"
+        align="center"
+        label="订购产品单价(元)"
+        show-overflow-tooltip
+      >
+      </el-table-column>
+      <el-table-column align="center" label="订购数量" show-overflow-tooltip>
+        <template slot-scope="scope">
+          {{ scope.row.orderNum || "--" }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="orderDate"
+        align="center"
+        label="订购时间"
+        show-overflow-tooltip
+      >
+      </el-table-column>
+      <el-table-column
+        prop="invalidDate"
+        align="center"
+        label="失效时间"
+        show-overflow-tooltip
+      >
+      </el-table-column>
+      <el-table-column
+        align="center"
+        label="和校园推送时间"
+        show-overflow-tooltip
+      >
+        <template slot-scope="scope">
+          {{ timeFormat(scope.row.createTime) }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="groupType"
+        align="center"
+        label="状态"
+        show-overflow-tooltip
+      >
+        <template slot-scope="scope">
+          <span v-if="scope.row.groupType === 1">已生成</span>
+          <span v-if="scope.row.groupType === 2">待生成</span>
+          <span v-if="scope.row.groupType == 3">全部激活</span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="未激活数量" show-overflow-tooltip>
+        <template slot-scope="scope">
+          {{ scope.row.totalTicket-scope.row.useTicket || "--" }}
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="已激活数量" show-overflow-tooltip>
+        <template slot-scope="scope">
+          {{ scope.row.useTicket || "--" }}
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="所属小程序" show-overflow-tooltip>
+        <template slot-scope="scope">{{ "慧研学惠生活" }}</template>
+      </el-table-column>
+      <el-table-column
+        prop="action"
+        align="center"
+        label="订单状态"
+        show-overflow-tooltip
+      >
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.action === 1" type="success">订购</el-tag>
+          <el-tag type="danger" v-else-if="scope.row.action === 2">退订</el-tag>
+          <el-tag type="info" v-else-if="scope.row.action === 3">激活</el-tag>
+          <el-tag type="warning" v-else>暂停</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column prop="address" align="center" label="操作">
+        <template slot-scope="scope">
+          <el-button
+            type="text"
+            size="small"
+            v-if="scope.row.groupType === 2"
+            @click="gotoGenerating(scope.row)"
+            >生成激活码</el-button
+          >
+          <el-button
+            type="text"
+            size="small"
+            v-else
+            @click="codeDetails(scope.row)"
+            >查看激活码</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="page-box">
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        background
+        :current-page="query.page"
+        :page-sizes="[10, 20, 30, 40]"
+        :page-size="query.size"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="total"
+      >
+      </el-pagination>
+    </div>
+    <el-dialog title="生成激活码" :visible.sync="vipDialogVisible" width="50%">
+      <el-descriptions class="margin-top" :column="3" border>
+        <el-descriptions-item>
+          <template slot="label"> 计费号 </template>
+          {{ codeData.billId || "--" }}
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label"> 集团名称 </template>
+          {{ codeData.groupName || "--" }}
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label"> 订购时间 </template>
+          {{ codeData.orderDate || "--" }}
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label"> 失效时间 </template>
+          {{ codeData.invalidDate || "--" }}
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label"> 订购数量 </template>
+          {{ codeData.orderNum || "--" }}
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label"> 所属平台 </template>
+          慧研学惠生活
+        </el-descriptions-item>
+      </el-descriptions>
+      <div class="codeInfo">激活码信息</div>
+      <el-form
+        :model="setQuery"
+        ref="setQuery"
+        :rules="rules"
+        label-width="130px"
+        size="small"
+      >
+        <el-form-item label="激活码有效期:" prop="validDay">
+          <el-input
+            v-model="setQuery.validDay"
+            class="item-width-100"
+          ></el-input>
+          天
+        </el-form-item>
+        <el-form-item label="会员套餐:" prop="selectType">
+          <el-select
+            v-model="setQuery.selectType"
+            @change="selectChange"
+            placeholder="请选择套餐"
+          >
+            <el-option
+              v-for="(item, index) in optionsList"
+              :key="item.value"
+              :label="item.setMealName"
+              :value="{ value: item.setMealCode, label: item.setMealName }"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="会员有效期:" prop="activationType">
+          <el-radio-group v-model="setQuery.activationType">
+            <el-radio
+              v-for="item in radioOptions"
+              :key="item.value"
+              :value="item.value"
+              :label="item.label"
+            ></el-radio>
+          </el-radio-group>
+          <div v-if="setQuery.activationType == '时间段'">
+            <el-date-picker
+              v-model="date"
+              type="daterange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+            >
+            </el-date-picker>
+          </div>
+          <div v-if="setQuery.activationType == '天数'">
+            <el-input
+              v-model="setQuery.activationDay"
+              class="item-width-100"
+            ></el-input>
+            天
+          </div>
+        </el-form-item>
+        <div
+          style="
+            color: red;
+            font-size: 12px;
+            line-height: 16px;
+            margin-left: 40px;
+          "
+        >
+          注:会员有效期为用户使用激活码后会员生效时间。时间段为用户使用激活码后仅在对应时间段内拥有会员权益;天数为用户使用激活码后对应天数内拥有会员权益。时间段激活码无法叠加使用,天数激活码可叠加使用累计天数。
+        </div>
+        <el-form-item label="激活码数量:" prop="totalTicket">
+          <el-input
+            v-model="setQuery.totalTicket"
+            class="item-width-100"
+          ></el-input>
+          <span style="color: red; font-size: 12px; margin-left: 10px"
+            >注:默认为订购数量,激活码数量必须大于订购数量</span
+          >
+        </el-form-item>
+        <el-form-item label="激活码开头:" prop="startString">
+          <el-input
+            v-model="setQuery.startString"
+            class="item-width-100"
+          ></el-input>
+          <span style="color: red; font-size: 12px; margin-left: 10px"
+            >注:只能输入大小写英文和数字,创建激活码是放在激活码开头</span
+          >
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="vipDialogVisible = false">取 消</el-button>
+        <el-button
+          type="primary"
+          :loading="updataLoading"
+          @click="vipsubmitForm('setQuery')"
+          >生成</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { debounce } from "@/utils/index";
+import { getGroupList, generateCode, getList } from "@/api/common";
+import { timeFormat } from "@/utils/index";
+
+export default {
+  name: "orderManage",
+  data() {
+    return {
+      date: "",
+      updataLoading: false,
+      codeData: {},
+      optionsList: [],
+      radioOptions: [
+        {
+          value: 1,
+          label: "时间段",
+        },
+        {
+          value: 2,
+          label: "天数",
+        },
+      ],
+      orderStatusoptions: [
+        {
+          value: 1,
+          label: "订购",
+        },
+        {
+          value: 2,
+          label: "退订",
+        },
+        {
+          value: 3,
+          label: "激活",
+        },
+        {
+          value: 4,
+          label: "暂停",
+        },
+      ],
+      statusOptions: [
+        {
+          value: 1,
+          label: "已生成",
+        },
+        {
+          value: 2,
+          label: "待生成",
+        },
+        {
+          value: 3,
+          label: "全部激活",
+        },
+      ],
+      setQuery: {
+        validDay: "",
+        activationType: "",
+        activationDay: "",
+        totalTicket: "",
+        planningName: "",
+        planningId: "",
+        groupOrderNo: "",
+        startString: "",
+        startTime: "",
+        endTime: "",
+        selectType: "",
+      },
+      rules: {
+        validDay: [
+          { required: true, message: "请输入激活码有效期", trigger: "blur" },
+        ],
+        vipSetmenu: [
+          { required: true, message: "请选择会员套餐", trigger: "change" },
+        ],
+        endTime: [
+          {
+            required: true,
+            message: "请至少选择一个有效期类型",
+            trigger: "change",
+          },
+        ],
+        totalTicket: [
+          { required: true, message: "请输入激活码数量", trigger: "blur" },
+        ],
+        startString: [
+          { required: true, message: "请输入激活码开头", trigger: "blur" },
+        ],
+      },
+      vipDialogVisible: false,
+
+      tableData: [],
+      loading: false,
+      query: {
+        billId: "",
+        groupName: "",
+        orderNo: "",
+        groupType: "",
+        actionID: "",
+        page: 1,
+        size: 10,
+      },
+      title: "",
+      total: 0,
+    };
+  },
+  watch: {
+    // query: {
+    //   handler: debounce(function(val) {
+    //     this.getList()
+
+    //   }),
+    //   deep:true
+    // },
+    date(val) {
+      if (val) {
+        this.setQuery.startTime = new Date(val[0]).getTime();
+        this.setQuery.endTime = new Date(val[1]).getTime();
+      } else {
+        this.setQuery.startTime = "";
+        this.setQuery.endTime = "";
+      }
+    },
+  },
+  filters: {},
+  methods: {
+    //  生成弹窗
+    gotoGenerating(item) {
+      this.get_setmealList();
+      this.vipDialogVisible = true;
+      this.codeData = item;
+      this.setQuery.groupOrderNo = item.orderNo;
+    },
+
+    // 套餐选择
+    selectChange(item) {
+      const { value, label } = item;
+      this.setQuery.planningId = value;
+      this.setQuery.planningName = label;
+    },
+
+    // 提交生成
+    vipsubmitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          delete this.setQuery.selectType;
+          this.updataLoading = true;
+          if (this.setQuery.activationType == "时间段") {
+            this.setQuery.activationType = 1;
+          } else {
+            this.setQuery.activationType = 2;
+          }
+      console.log(this.setQuery.activationType, "-----type");
+          generateCode(this.setQuery).then((res) => {
+            this.updataLoading = false;
+            if (res.state == "Success") {
+              this.vipDialogVisible = false;
+              this.setQuery.validDay = "";
+              this.setQuery.activationType = "";
+              this.date = "";
+              this.setQuery.totalTicket = "";
+              setQuery.startString = "";
+              this.getList();
+            }
+          });
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+
+    // 查看激活码
+    codeDetails(item) {
+      this.$router.push({
+        path: "/operationManage/comboManage/checkoutCode",
+        query: {
+          groupInfo: JSON.stringify(item),
+        },
+      });
+    },
+
+    // 套餐列表
+    get_setmealList() {
+      this.loading = true;
+      getList().then((res) => {
+      this.loading = false;
+        if (res.state == "Success") {
+          this.optionsList = res.content.records;
+          this.total = res.content.total;
+        }
+      });
+    },
+
+    handleSearch() {
+      this.query.page = 1;
+      this.getList();
+    },
+    timeFormat(val) {
+      return timeFormat(val);
+    },
+    handleSizeChange(val) {
+      this.query.page = 1;
+      this.query.size = val;
+      this.getList();
+    },
+    handleCurrentChange(val) {
+      this.query.page = val;
+      this.getList();
+    },
+
+    search() {
+      this.query.page = 1;
+      this.getList();
+    },
+    getList() {
+      this.loading = true;
+      let obj = JSON.parse(JSON.stringify(this.query));
+      obj.page = obj.page - 1;
+      // getOrderList
+      getGroupList(obj).then((res) => {
+        this.loading = false;
+        if (res.state == "Success") {
+          this.tableData = res.content.content;
+          this.total = res.content.totalElements;
+        }
+      });
+    },
+  },
+  created() {
+    this.getList();
+  },
+};
+</script>
+
+<style lang="scss">
+.codeInfo {
+  height: 50px;
+  line-height: 50px;
+  font-weight: 800;
+  font-size: 16px;
+  color: #000;
+}
+</style>

+ 9 - 10
src/views/operationManage/goodsManage/index.vue

@@ -17,7 +17,7 @@
           placeholder="请输入店铺ID"
           class="item-width-200 ml10"
         ></el-input>
-       
+
         <el-button
         class="ml10"
         type="primary"
@@ -43,7 +43,7 @@
       v-loading="loading"
       style="width: 100%"
     >
-    
+
       <el-table-column
         align="center"
         label="商品图片"
@@ -66,7 +66,7 @@
         align="center"
         label="类型"
         show-overflow-tooltip
-      > 
+      >
        <template slot-scope="scope">
         {{goodsTypeObj[scope.row.goodsType] || '-' }}
        </template>
@@ -78,7 +78,7 @@
         show-overflow-tooltip
       >
        <template slot-scope="scope">
-        <span>{{scope.row.status|filterState}}</span> 
+        <span>{{scope.row.status|filterState}}</span>
        </template>
       </el-table-column>
       <el-table-column
@@ -131,7 +131,7 @@
     </div>
   </div>
 </template>
-  
+
   <script>
 import { debounce } from "@/utils/index";
 import { goodsList,operateByAdmin } from '@/api/goods';
@@ -169,7 +169,7 @@ export default {
       if(val == '上架商品'){
         this.query.status = 3
         this.query.applyState = ''
-        
+
       }else if(val == '待审核商品'){
         this.query.status = null
         this.query.applyState = 1
@@ -204,7 +204,7 @@ export default {
       }
       else if (value == 4) {
         return '下架'
-      } 
+      }
     },
     filterType:function(val){
       if(val== 801){
@@ -215,7 +215,7 @@ export default {
         return '餐饮商品'
       }else{
         return '新添加商品'
-        
+
       }
     }
   },
@@ -290,7 +290,7 @@ export default {
   },
 };
 </script>
-  
+
 <style lang="scss" scoped>
 .goodsList {
   .search{
@@ -302,4 +302,3 @@ export default {
   }
 }
 </style>
-  

+ 6 - 7
src/views/operationManage/shopManage/index.vue

@@ -85,7 +85,7 @@
         show-overflow-tooltip
       >
       </el-table-column>
-      
+
       <el-table-column
         prop="shopMenuId"
         align="center"
@@ -117,7 +117,7 @@
         show-overflow-tooltip
       >
       </el-table-column>
-     
+
       <el-table-column
         align="center"
         prop="state"
@@ -196,7 +196,7 @@
 
   </div>
 </template>
-  
+
   <script>
 import { debounce } from "@/utils/index";
 import { getList, updateState } from "@/api/shop";
@@ -448,8 +448,8 @@ export default {
             if (res.content.hasOwnProperty.call(res.content, key)) {
                 this.options.push({
                   label:res.content[key],
-                  value:Number(key) 
-                })              
+                  value:Number(key)
+                })
             }
           }
         }
@@ -462,7 +462,7 @@ export default {
   },
 };
 </script>
-  
+
 <style lang="scss" scoped>
 .shopManage {
   .search {
@@ -473,4 +473,3 @@ export default {
   }
 }
 </style>
-  

+ 26 - 26
src/views/operationManage/shopManage/shopAdd.vue

@@ -4,9 +4,9 @@
  * @LastEditors: wenjie 1454560336@qq.com
  * @LastEditTime: 2024-09-03 13:58:11
  * @FilePath: \admin-manage\src\views\operationManage\shopManage\shopAdd.vue
- * @Description: 
- * 
- * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
+ * @Description:
+ *
+ * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
 -->
 <template>
   <div class="shopAdd app-container" v-loading="loading">
@@ -40,8 +40,8 @@
           </el-option>
         </el-select> -->
         <el-cascader
-         size="small" 
-         class="item-width-300" 
+         size="small"
+         class="item-width-300"
          placeholder="请选择店铺经营类型"
          v-model="setQuery.shopMenuId"
         :options="options"
@@ -82,7 +82,7 @@
             v-model="setQuery.address"
             class="item-width-500"
             size="small"
-            placeholder="请点击右侧定位图标选择店铺地址" 
+            placeholder="请点击右侧定位图标选择店铺地址"
           ></el-input>
           <i class="el-icon-location ml10 position red" @click="chooseAddress"></i>
       </el-form-item>
@@ -94,7 +94,7 @@
         >
         </el-input>
       </el-form-item>
-       
+
        <el-form-item label="店铺简介:">
         <el-input
           type="textarea"
@@ -218,11 +218,11 @@
         </el-form-item>
 
     </el-tab-pane>
-    
+
   </el-tabs>
-    
-     
-   
+
+
+
     </el-form>
 
     <el-dialog title="选择地址" close="chose-model" :close-on-press-escape="false" :close-on-click-modal="false" width="60vw" :visible.sync="showMap">
@@ -269,7 +269,7 @@
       <el-button type="primary" :loading="loading" @click="edit"
         >编辑</el-button >
     </div>
-    
+
 
   </div>
 </template>
@@ -436,14 +436,14 @@ export default {
     //            if(that.map){
     //              that.map.centerAndZoom(point, 16);
     //              that.map.addOverlay(that.marker)
-    //              myGeo.getLocation(new BMapGL.Point(point.lng, point.lat), function(result){      
-    //                 if (result){      
+    //              myGeo.getLocation(new BMapGL.Point(point.lng, point.lat), function(result){
+    //                 if (result){
     //                   console.log(result);
     //                    // 选择营业地址时保存省市区
     //                   that.setQuery.province = result.addressComponents.province;
     //                   that.setQuery.city = result.addressComponents.city;
     //                   that.setQuery.district = result.addressComponents.district;
-    //                 }      
+    //                 }
     //             });
     //            }
     //         }
@@ -455,7 +455,7 @@ export default {
         this.finishComplexList()
       }else{
           this.authOptions = []
-        
+
       }
     },
     'setQuery.authAccount'(val){
@@ -479,7 +479,7 @@ export default {
       this.setQuery.district = item.district;
        this.map.centerAndZoom(item.location, 19);
 
-     
+
     },
     // 查询地址
     searchAddress(val){
@@ -546,7 +546,7 @@ export default {
     },
     add(obj) {
       this.loading = true;
-      
+
       add(obj).then((res) => {
         this.loading = false;
         if (res.state == "Success") {
@@ -555,7 +555,7 @@ export default {
             message: "操作成功",
             type: "success",
           });
-          
+
           this.$router.push("/operationManage/shopManage/index");
         }
       });
@@ -584,7 +584,7 @@ export default {
             message: "操作成功",
             type: "success",
           });
-          
+
           this.$router.push("/operationManage/shopManage/index");
         }
       });
@@ -626,7 +626,7 @@ export default {
               })
             }
           }
-        } 
+        }
       })
     },
     // 选择经营地址
@@ -634,7 +634,7 @@ export default {
       if(this.mode == 'detail') return
       this.showMap = true;
       let that = this
-      
+
       this.$nextTick(() => {
         this.map = new BMapGL.Map("container",{enableIconClick: true});
         //  var point = new BMapGL.Point(this.setQuery.mapLon,this.setQuery.mapLat);
@@ -656,7 +656,7 @@ export default {
           }, 100);
 
         });
-       
+
         that.map.addEventListener("click", function (e) {
           let itemId = that.map.getIconByClickPosition(e)
           console.log(1111111,itemId);
@@ -678,7 +678,7 @@ export default {
               }
             })
             // let url = "//api.map.baidu.com/?qt=inf&uid="+itemId.uid+'&operate=mapclick&clicktype=tile&ie=utf-8&oue=1&fromproduct=jsapi&res=api&&ak=7aGqlyBw6mGwS6vNMLbmMlsHqE2OGV0E&callback=sucess'
-            
+
           }
           // var pt = e.latlng;
           // that.map.removeOverlay(that.marker); //移除点标记
@@ -697,7 +697,7 @@ export default {
           //   console.log(rs);
           // });
         });
-        
+
 
       });
     },
@@ -813,4 +813,4 @@ export default {
   }
 }
 }
-</style>
+</style>