Procházet zdrojové kódy

代金券和活动

潘超林 před 1 měsícem
rodič
revize
e131eac15b

+ 42 - 0
src/api/marketing/lottery.js

@@ -0,0 +1,42 @@
+import request from '@/utils/request'
+
+
+export function queryPage(query) {
+  return request({
+    url: 'system/storeRaffle/queryPage',
+    method: 'get',
+    params: query
+  })
+}
+
+// 抽奖活动-选择商品
+export function getRaffleSpuListPage(query) {
+  return request({
+    url: 'system/goods/getRaffleSpuListPage',
+    method: 'get',
+    params: query
+  })
+}
+
+// 保存抽奖活动
+export function storeRaffleSave(query) {
+  return request({
+    url: 'system/storeRaffle/saveOrUpdates',
+    method: 'post',
+    data: query
+  })
+}
+// 详情
+export function storeRaffleInfo(query) {
+  return request({
+    url: 'system/storeRaffle/info/' + query,
+    method: 'get',
+  })
+}
+
+export function storeRaffleRemove(query) {
+  return request({
+    url: 'system/storeRaffle/remove/' + query,
+    method: 'get',
+  })
+}

+ 71 - 0
src/api/marketing/voucher.js

@@ -0,0 +1,71 @@
+import request from '@/utils/request'
+
+
+export function voucherSave(query) {
+  return request({
+    url: 'system/voucher/saveOrUpdates',
+    method: 'post',
+    data: query
+  })
+}
+
+
+export function voucherRemove(query) {
+  return request({
+    url: 'system/voucher/' + query,
+    method: 'delete',
+  })
+}
+
+export function queryPage(query) {
+  return request({
+    url: 'system/voucher/queryPage',
+    method: 'get',
+    params: query
+  })
+}
+// 连锁店分页查询
+export function storeMultipleShopQueryPage(query) {
+  return request({
+    url: 'system/storeMultipleShop/queryPage',
+    method: 'get',
+    params: query
+  })
+}
+export function voucherInfo(query) {
+  return request({
+    url: 'system/voucher/info/' + query,
+    method: 'get',
+  })
+}
+// 根据代金券id查询关联店铺信息
+export function queryPageByVoucherId(query) {
+  return request({
+    url: 'system/storeVoucherRel/queryPageByVoucherId',
+    method: 'get',
+    params: query
+  })
+}
+// 根据代金券id移除店铺
+export function queryPageByVoucherIdRemove(query) {
+  return request({
+    url: 'system/storeVoucherRel/removeStoreByVoucherId',
+    method: 'get',
+    params: query
+  })
+}
+// 联合券用户店铺详情模糊查询
+export function getStoreInfoByKey(query) {
+  return request({
+    url: 'system/appUser/getStoreInfoByKey',
+    method: 'get',
+    params: query
+  })
+}
+export function enable(query) {
+  return request({
+    url: 'system/voucher/enable',
+    method: 'get',
+    params: query
+  })
+}

+ 1 - 1
src/views/manage/shopInfo.vue

@@ -124,7 +124,7 @@
 </template>
 
 <script>
-import chainStore from "./shopInfoCommon/index.vue";
+import chainStore from "@/views/manage/shopInfoCommon/index.vue";
 import { getStoreInfo } from "@/api/common/index";
 export default {
   components: { chainStore },

+ 42 - 10
src/views/manage/voucher/index.vue

@@ -1,7 +1,12 @@
 <template>
   <div class="app-container">
     <h3>开启设置</h3>
-    <el-form ref="form" :model="form" label-width="200px" style="margin-top: 20px">
+    <el-form
+      ref="form"
+      :model="form"
+      label-width="200px"
+      style="margin-top: 20px"
+    >
       <el-row>
         <el-col :span="12">
           <div style="display: flex; flex-direction: row">
@@ -39,20 +44,30 @@
     <h3>规则配置</h3>
     <el-radio-group v-model="queryParams.useVoucherType" @change="radioChang">
       <el-radio :label="0" value="0">普通满减券</el-radio>
-      <!-- <el-radio :label="1" value="1">折扣</el-radio> -->
+      <!-- <el-radio :label="1" value="1">折扣</el-radio> -->
     </el-radio-group>
 
     <div style="margin-top: 20px">
-      <el-button type="primary" size="small" @click="addRole" v-hasPermi="['voucher:add']"
+      <el-button
+        type="primary"
+        size="small"
+        @click="addRole"
+        v-hasPermi="['voucher:add']"
         >新增规则</el-button
       >
     </div>
     <template v-if="queryParams.useVoucherType == 0">
       <el-col :span="24" v-if="this.form.length < 1">
-        <el-result icon="info" title="暂无规则" subTitle="请新增代金券规则"> </el-result>
+        <el-result icon="info" title="暂无规则" subTitle="请新增代金券规则">
+        </el-result>
       </el-col>
       <template v-else>
-        <el-form ref="form" :model="form" label-width="140px" style="margin-top: 20px">
+        <el-form
+          ref="form"
+          :model="form"
+          label-width="140px"
+          style="margin-top: 20px"
+        >
           <el-row>
             <el-col :span="24" v-for="(item, index) in form" :key="index">
               <el-form-item label="满">
@@ -95,7 +110,10 @@
           </el-row>
         </el-form>
         <div style="text-align: center; margin-top: 20px">
-          <el-button type="primary" @click="InviteSubmit" v-hasPermi="['voucher:edit']"
+          <el-button
+            type="primary"
+            @click="InviteSubmit"
+            v-hasPermi="['voucher:edit']"
             >确 定</el-button
           >
         </div>
@@ -103,10 +121,16 @@
     </template>
     <template v-if="queryParams.useVoucherType == 1">
       <el-col :span="24" v-if="person.length < 1">
-        <el-result icon="info" title="暂无规则" subTitle="请新增代金券规则"> </el-result>
+        <el-result icon="info" title="暂无规则" subTitle="请新增代金券规则">
+        </el-result>
       </el-col>
       <template v-else>
-        <el-form ref="form" :model="person" label-width="140px" style="margin-top: 20px">
+        <el-form
+          ref="form"
+          :model="person"
+          label-width="140px"
+          style="margin-top: 20px"
+        >
           <el-row>
             <el-col :span="24" v-for="(item, index) in person" :key="index">
               <el-form-item label="满">
@@ -129,7 +153,12 @@
 
 
-                  <el-input-number v-model="item.ratio" :min="0.5" :step="0.5" :max="10">
+                  <el-input-number
+                    v-model="item.ratio"
+                    :min="0.5"
+                    :step="0.5"
+                    :max="10"
+                  >
                   </el-input-number>
                   <span>折 </span>
                   <i
@@ -143,7 +172,10 @@
           </el-row>
         </el-form>
         <div style="text-align: center; margin-top: 20px">
-          <el-button type="primary" @click="InviteSubmit" v-hasPermi="['voucher:edit']"
+          <el-button
+            type="primary"
+            @click="InviteSubmit"
+            v-hasPermi="['voucher:edit']"
             >确 定</el-button
           >
         </div>

+ 63 - 24
src/views/marketing/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div style="padding: 20px">
+  <div style="padding: 20px" class="app-container">
     <div>
       <div class="header">
         <h3>添加新推送</h3>
@@ -12,7 +12,11 @@
     <el-form ref="form" :rules="rules" :model="form" label-width="150px">
       <el-row>
         <el-col :span="24">
-          <el-form-item label="主题名称" style="margin-top: 30px" prop="topicName">
+          <el-form-item
+            label="主题名称"
+            style="margin-top: 30px"
+            prop="topicName"
+          >
             <el-input
               type="text"
               placeholder="请输入内容"
@@ -31,7 +35,11 @@
               >设置钱请确认该账户钱包余额是否满足,此次营销所需金额,如不满足请先去充值</span
             >
           </el-form-item>
-          <el-form-item label="红包个数" prop="redEnvelopeNum" style="margin-left: 70px">
+          <el-form-item
+            label="红包个数"
+            prop="redEnvelopeNum"
+            style="margin-left: 70px"
+          >
             <el-input-number
               v-model="form.redEnvelopeNum"
               style="width: 150px"
@@ -41,7 +49,11 @@
             ></el-input-number
             >个
           </el-form-item>
-          <el-form-item label="单个金额" prop="singleAmount" style="margin-left: 70px">
+          <el-form-item
+            label="单个金额"
+            prop="singleAmount"
+            style="margin-left: 70px"
+          >
             <el-input-number
               v-model="form.singleAmount"
               style="width: 150px"
@@ -67,7 +79,11 @@
           </el-form-item>
         </el-col>
         <el-col :span="24">
-          <el-form-item label="推送消息" style="margin-top: 30px" prop="pushMessage">
+          <el-form-item
+            label="推送消息"
+            style="margin-top: 30px"
+            prop="pushMessage"
+          >
             <el-input
               type="textarea"
               :rows="3"
@@ -112,10 +128,27 @@
             </el-table-column>
 
             <el-table-column label="用户昵称" align="center" prop="nick" />
-            <el-table-column label="浏览记录" align="center" prop="browseRecord" />
-            <el-table-column label="距离" align="center" width="120" prop="distance" />
-            <el-table-column label="下单记录" align="center" prop="orderRecord" />
-            <el-table-column label="近期推送记录" align="center" prop="topicName" />
+            <el-table-column
+              label="浏览记录"
+              align="center"
+              prop="browseRecord"
+            />
+            <el-table-column
+              label="距离"
+              align="center"
+              width="120"
+              prop="distance"
+            />
+            <el-table-column
+              label="下单记录"
+              align="center"
+              prop="orderRecord"
+            />
+            <el-table-column
+              label="近期推送记录"
+              align="center"
+              prop="topicName"
+            />
             <el-table-column
               v-if="showButton"
               label="操作"
@@ -142,24 +175,24 @@
             @pagination="getList"
           />
         </el-col>
-        <el-col :span="24" style="text-align: center; margin-top: 20px" v-if="showButton">
+        <el-col
+          :span="24"
+          style="text-align: center; margin-top: 20px"
+          v-if="showButton"
+        >
           <el-button @click="cancel">取消</el-button>
           <el-button @click="submitForm" type="primary">保存</el-button>
         </el-col>
       </el-row>
     </el-form>
-    <userDialog ref="productDialog" @productDialogInfo="productDialogInfo"></userDialog>
+    <userDialog
+      ref="productDialog"
+      @productDialogInfo="productDialogInfo"
+    ></userDialog>
   </div>
 </template>
 
 <script>
-import {
-  shareRewardList,
-  shareRewardSave,
-  batchRemove,
-  shareRewardEdit,
-} from "@/api/manage/share";
-
 import * as markApi from "@/api/marketing/index";
 import { getGoodsListPage } from "@/api/manage/product";
 import userDialog from "./components/user-dialog.vue";
@@ -177,7 +210,9 @@ export default {
         selectUserId: "",
       },
       rules: {
-        proportion: [{ required: true, message: "请输入分享奖励比例", trigger: "blur" }],
+        proportion: [
+          { required: true, message: "请输入分享奖励比例", trigger: "blur" },
+        ],
       },
       tableData: [],
       multipleSelection: [],
@@ -253,11 +288,15 @@ export default {
           ids.splice(index, 1);
         }
       });
-      this.$confirm("是否移除已选商品,移除后, 该商品不可使用获得分享奖励", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
+      this.$confirm(
+        "是否移除已选商品,移除后, 该商品不可使用获得分享奖励",
+        "提示",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      )
         .then(() => {
           batchRemove({
             id: this.$route.query.item.id,

+ 248 - 0
src/views/marketing/lottery/index.vue

@@ -0,0 +1,248 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      label-width="120px"
+    >
+      <el-form-item label="" prop="key">
+        <el-input
+          v-model="queryParams.key"
+          placeholder="输入活动ID/活动名称搜索"
+          clearable
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="活动时间" prop="times">
+        <el-date-picker
+          v-model="queryParams.times"
+          style="width: 240px"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          @change="redChange"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="活动状态" prop="activityStatus">
+        <el-select
+          v-model="queryParams.activityStatus"
+          placeholder="请选择活动状态"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option label="未开始" value="0"> </el-option>
+          <el-option label="进行中" value="1"> </el-option>
+          <el-option label="已结束" value="2"> </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+    <div style="margin: 10px 0px">
+      <el-button type="primary" size="mini" @click="hanleAdd">添加</el-button>
+    </div>
+
+    <el-table
+      v-loading="loading"
+      :data="configList"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column label="ID" align="center" prop="id" />
+      <el-table-column label="名称" align="center" prop="title" />
+      <el-table-column label="参与活动资格" align="center">
+        <template slot-scope="scope">
+          {{
+            scope.row.joinType == 0
+              ? "所有人"
+              : scope.row.joinType == 1
+              ? "固定时间下单"
+              : ""
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column label="活动时间" align="center">
+        <template slot-scope="scope">
+          {{
+            scope.row.startTime
+              ? $moment(scope.row.startTime).format("YYYY-MM-DD") +
+                "-" +
+                $moment(scope.row.endTime).format("YYYY-MM-DD")
+              : ""
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" align="center">
+        <template slot-scope="scope">
+          {{
+            scope.row.activityStatus == 0
+              ? "未开始"
+              : scope.row.activityStatus == 1
+              ? "进行中"
+              : scope.row.activityStatus == 2
+              ? "已结束"
+              : ""
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button size="mini" type="text" @click="handleLook(scope.row)"
+            >查看</el-button
+          >
+          <el-button size="mini" type="text" @click="handleEdit(scope.row)"
+            >编辑</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            style="color: red"
+            @click="handleRemove(scope.row)"
+            >编辑</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNo"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import moment from "moment";
+import { queryPage, storeRaffleRemove } from "@/api/marketing/lottery";
+export default {
+  name: "Config",
+  data() {
+    return {
+      loading: true,
+      total: 0,
+      configList: [],
+      title: "",
+      open: false,
+      queryParams: {
+        key: "",
+        times: [],
+        endTime: "",
+        startTime: "",
+        activityStatus: "",
+        pageNo: 1,
+        pageSize: 10,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      drawer: false,
+      userid: "",
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    redChange(val) {
+      this.queryParams.startTime = moment(val[0]).valueOf();
+      this.queryParams.endTime = moment(val[1]).valueOf();
+    },
+    hanleAdd() {
+      this.$router.push({
+        path: "/marketing/marketing/lottery/new/index",
+      });
+    },
+
+    handleRemove(record) {
+      this.$confirm("是否确认删除该奖励活动?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          storeRaffleRemove(record.id).then((res) => {
+            if (res.code == 200) {
+              this.$message({
+                type: "success",
+                message: "删除成功!",
+              });
+              this.getList();
+            }
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+    },
+
+    handleEdit(record) {
+      this.$router.push({
+        path: "/marketing/marketing/lottery/new/edit",
+        query: {
+          id: record.id,
+        },
+      });
+    },
+    handleLook(record) {
+      this.$router.push({
+        path: "/marketing/marketing/lottery/new/detail",
+        query: {
+          id: record.id,
+        },
+      });
+    },
+
+    /** 查询参数列表 */
+    getList() {
+      this.loading = true;
+      queryPage(this.queryParams).then((response) => {
+        this.configList = response.data.records;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+    },
+
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNo = 1;
+
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.endTime = "";
+      this.queryParams.startTime = "";
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+  },
+};
+</script>
+<style scoped lang="scss"></style>

+ 267 - 0
src/views/marketing/lottery/new/components/spulist.vue

@@ -0,0 +1,267 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="80px"
+    >
+      <el-form-item prop="key">
+        <el-input
+          v-model="queryParams.key"
+          placeholder="请输入商品名称/商品id"
+          clearable
+          style="width: 200px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="商品分类" prop="categoryId">
+        <el-cascader
+          v-model="queryParams.categoryId"
+          ref="formCascader"
+          placeholder="请选择分类"
+          :props="categoryprops"
+          style="width: 120px"
+          @change="cascaderChange"
+        />
+      </el-form-item>
+      <el-form-item label="类型" prop="spuType">
+        <el-select
+          v-model="queryParams.spuType"
+          placeholder="请选择类型"
+          style="width: 140px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option label="农商商品" :value="0"> </el-option>
+          <el-option label="同城秒送商品" :value="1"> </el-option>
+          <el-option label="会员专区" :value="2"> </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="商品状态" prop="spuStatus">
+        <el-select
+          v-model="queryParams.spuStatus"
+          placeholder="请选择商品状态"
+          style="width: 140px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option label="售罄" value="2"> </el-option>
+          <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="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+    <el-table
+      v-loading="loading"
+      :data="tableList"
+      @selection-change="handleSelectionChange"
+      row-key="id"
+    >
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="商品Id" align="center" prop="id" />
+      <el-table-column label="商品信息" align="center">
+        <template slot-scope="scope">
+          <div
+            style="
+              display: flex;
+              flex-direction: row;
+              justify-content: space-between;
+              align-items: center;
+            "
+          >
+            <el-image
+              style="width: 30px; height: 30px"
+              :src="scope.row.pic"
+              :preview-src-list="[scope.row.pic]"
+            >
+            </el-image>
+            <div
+              :title="scope.row.title"
+              style="
+                width: 80px;
+                height: auto;
+                word-wrap: break-word;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                white-space: nowrap;
+              "
+            >
+              {{ scope.row.title }}
+            </div>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="分类" align="center" prop="categoryName" />
+      <el-table-column label="商品状态" align="center">
+        <template slot-scope="scope">
+          {{
+            scope.row.spuStatus == 2
+              ? "售罄"
+              : scope.row.spuStatus == 0
+              ? "上架"
+              : scope.row.spuStatus == 1
+              ? "下架"
+              : ""
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column label="销量" align="center" prop="salesVolume" />
+      <el-table-column label="价格" align="center" width="120">
+        <template slot-scope="scope">
+          {{ scope.row.originalPrice }}元/{{ scope.row.unit }}
+        </template>
+      </el-table-column>
+      <el-table-column label="类型" align="center" width="120">
+        <template slot-scope="scope">
+          {{
+            scope.row.spuType == 0
+              ? "农商商品"
+              : scope.row.spuType == 1
+              ? "同城秒送商品"
+              : scope.row.spuType == 2
+              ? "会员专区"
+              : ""
+          }}
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNo"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { getRaffleSpuListPage } from "@/api/marketing/lottery";
+import { getClassificationListPage } from "@/api/common/index";
+import { getStoreInfo } from "@/api/common/index";
+export default {
+  name: "product",
+  data() {
+    return {
+      sort: {
+        merchantClassifyId: "",
+      },
+      sortDialog: false,
+      // 遮罩层
+      loading: true,
+      showSearch: true,
+      total: 0,
+      tableList: [],
+      title: "",
+      dialogVisible: false,
+      // 日期范围
+      dateRange: [],
+      // 查询参数
+      queryParams: {
+        pageNo: 1,
+        pageSize: 10,
+        key: "",
+        categoryId: "",
+        categoryName: "",
+        spuType: "",
+      },
+      // 表单参数
+      form: {},
+      categoryprops: {
+        checkStrictly: true,
+        lazy: true,
+        lazyLoad: this.categoryLazyLoad,
+      },
+    };
+  },
+  mounted() {
+    this.getList();
+  },
+  methods: {
+    handleSelectionChange(val) {
+      this.$emit("voucherChoose", val);
+    },
+    /** 查询参数列表 */
+    getList() {
+      this.loading = true;
+      getRaffleSpuListPage(this.queryParams).then((res) => {
+        this.tableList = res.data.records;
+        this.total = res.data.total;
+        this.loading = false;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    cascaderChange(val) {
+      this.queryParams.categoryId = val[val.length - 1];
+    },
+    categoryLazyLoad(node, resolve) {
+      let level = node.level;
+      if (!node.data) {
+        getClassificationListPage({ parentId: 0 }).then((res) => {
+          //接口
+          const nodes = Array.from(res.data).map((item, index) => ({
+            value: item.id,
+            label: `${item.className}`,
+            leaf: level >= 2,
+          }));
+          // 通过调用resolve将子节点数据返回,通知组件数据加载完成
+          resolve(nodes);
+        });
+      } else if (level == 1) {
+        getClassificationListPage({ parentId: node.data.value }).then((res) => {
+          const nodes = Array.from(res.data).map((item) => ({
+            value: item.id,
+            label: `${item.className}`,
+            leaf: level >= 2,
+            // level: 2,
+          }));
+          // 通过调用resolve将子节点数据返回,通知组件数据加载完成
+          resolve(nodes);
+        });
+      } else if (level == 2) {
+        getClassificationListPage({ parentId: node.data.value }).then((res) => {
+          const nodes = Array.from(res.data).map((item) => ({
+            value: item.id,
+            label: `${item.className}`,
+            leaf: level >= 1,
+            level: 1,
+          }));
+          // 通过调用resolve将子节点数据返回,通知组件数据加载完成
+          resolve(nodes);
+        });
+      } else {
+        resolve({});
+      }
+    },
+  },
+};
+</script>
+<style>
+.el-form-item {
+  margin-bottom: 10px;
+}
+</style>

+ 187 - 0
src/views/marketing/lottery/new/components/voucherlist.vue

@@ -0,0 +1,187 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      label-width="80px"
+    >
+      <el-form-item label="" prop="key">
+        <el-input
+          v-model="queryParams.key"
+          placeholder="请输入代金券ID/代金券名称搜索"
+          clearable
+          style="width: 180px"
+        />
+      </el-form-item>
+
+      <el-form-item label="类型" prop="type">
+        <el-select
+          v-model="queryParams.type"
+          placeholder="请选择券类型"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option label="独立券" value="1"> </el-option>
+          <el-option label="连锁券" value="2"> </el-option>
+          <el-option label="联合券" value="3"> </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+    <el-table v-loading="loading" :data="list">
+      <el-table-column label="ID" align="center" prop="id" />
+      <el-table-column label="名称" align="center" prop="title" />
+      <el-table-column label="类型" align="center">
+        <template slot-scope="scope">
+          {{
+            scope.row.type == 1
+              ? "独立券"
+              : scope.row.type == 2
+              ? "连锁券"
+              : scope.row.type == 3
+              ? "联合券"
+              : ""
+          }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="推广方式" align="center">
+        <template slot-scope="scope">
+          {{
+            scope.row.showType == 0
+              ? "全网自动推出"
+              : scope.row.showType == 1
+              ? "定向渠道推广"
+              : ""
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="邀请加入店铺数量"
+        align="center"
+        prop="inviteStoreNum"
+      />
+      <el-table-column
+        label="已同意加入店铺数量"
+        align="center"
+        prop="agreeStoreNum"
+      />
+      <el-table-column label="面额(元)" align="center" prop="sendAmount" />
+      <el-table-column label="总发放数量" align="center" prop="sendNum" />
+      <el-table-column label="已领取数量" align="center" prop="receiveNum" />
+
+      <el-table-column label="操作" align="center" width="200">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            style="color: #00b529"
+            @click="handleChoose(scope.row)"
+            >选择</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNo"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import moment from "moment";
+import { queryPage, voucherRemove } from "@/api/marketing/voucher";
+export default {
+  data() {
+    return {
+      loading: true,
+      total: 0,
+      title: "",
+      list: [],
+      queryParams: {
+        pageNo: 1,
+        pageSize: 10,
+        dateRange: [],
+        type: 1,
+        key: "",
+        showType: "",
+      },
+      form: {},
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    handleChoose(record) {
+      this.$emit("voucherChoose", record);
+    },
+
+    getList() {
+      this.loading = true;
+      queryPage(this.queryParams).then((res) => {
+        this.list = res.data.records;
+        this.total = res.data.total;
+        this.loading = false;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.queryParams.endTime = "";
+      this.queryParams.startTime = "";
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+  },
+};
+</script>
+<style>
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 138px;
+  height: 138px;
+  line-height: 138px;
+  text-align: center;
+}
+</style>
+<style scoped lang="scss">
+.avatar {
+  width: 138px;
+  height: 138px;
+  display: block;
+}
+</style>

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 641 - 0
src/views/marketing/lottery/new/detail.vue


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1035 - 0
src/views/marketing/lottery/new/edit.vue


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 992 - 0
src/views/marketing/lottery/new/index.vue


+ 282 - 0
src/views/marketing/voucher/add.vue

@@ -0,0 +1,282 @@
+<template>
+  <div class="app-container">
+    <el-form ref="form" :rules="rules" :model="shopInfo" label-width="120px">
+      <el-row>
+        <el-col :span="12">
+          <el-form-item prop="type">
+            <el-tooltip
+              slot="label"
+              class="item"
+              effect="dark"
+              placement="top-start"
+            >
+              <div slot="content">
+                独立券:本店铺单独代金券,用户领取后只可在本店铺使用<br />
+                连锁券:所添加店铺共有,用户在所添加店铺中都可使用该代金券
+                <br />
+                联合券:与其他店铺联合发布该代金券,用户所添加店铺都可使用该代金券
+              </div>
+              <span><i class="el-icon-question"></i>代金券类型</span>
+            </el-tooltip>
+
+            <el-radio-group v-model="shopInfo.type" :disabled="$route.query.id">
+              <el-radio :label="1" :name="1">独立券</el-radio>
+              <el-radio :label="2" :name="2">连锁券</el-radio>
+              <el-radio :label="3" :name="3">联合券</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item v-if="shopInfo.type == 3 || shopInfo.type == 2">
+            <template v-if="$route.query.id">
+              <el-button type="primary" size="mini" @click="shopDialog = true">
+                <span v-if="shopInfo.inviteStoreNum">
+                  已选择{{
+                    storeNum + parseInt(shopInfo.inviteStoreNum)
+                  }}个店铺</span
+                >
+                <span v-else-if="storeNum && !shopInfo.inviteStoreNum">
+                  已选择{{ storeNum }}个店铺</span
+                >
+                <span v-else> 选择店铺</span>
+              </el-button>
+
+              <span style="color: orange; margin-left: 20px">
+                <span v-if="shopInfo.agreeStoreNum"
+                  >{{ shopInfo.agreeStoreNum }}个店铺已同意,</span
+                >
+                <span v-else>0个店铺已同意,</span>
+
+                <span v-if="shopInfo.refuseStoreNum"
+                  >{{ shopInfo.refuseStoreNum }}个店铺已拒绝,</span
+                >
+                <span v-else>0个店铺已拒绝,</span>
+                等待剩余
+                <span v-if="shopInfo.auditStoreNum"
+                  >{{
+                    storeNum + parseInt(shopInfo.auditStoreNum)
+                  }}个店铺审核,</span
+                >
+                <span v-else>{{ storeNum ? storeNum : 0 }}个店铺审核,</span>
+              </span>
+            </template>
+
+            <template v-else>
+              <el-button type="primary" size="mini" @click="selectshop">
+                {{ storeNum ? "已选择" + storeNum + "个店铺" : "选择店铺" }}
+              </el-button>
+              <span v-if="storeNum" style="color: orange; margin-left: 20px"
+                >等待所选店铺审核</span
+              >
+            </template>
+          </el-form-item>
+
+          <el-form-item prop="showType">
+            <el-tooltip
+              slot="label"
+              class="item"
+              effect="dark"
+              placement="top-start"
+            >
+              <div slot="content">
+                全网自动推出:该代金券在店铺首页透出,用户在店铺中可直接领取代金券,下单抵扣,直到发放的代金券被领取完<br />
+                定向渠道推广:以供店铺设置抽奖活动使用,中奖用户奖自动发放该优惠券,其他用户无法领取,且该代金券不在店铺首页进行透出
+              </div>
+              <span><i class="el-icon-question"></i>推广方式</span>
+            </el-tooltip>
+
+            <el-radio-group v-model="shopInfo.showType">
+              <el-radio :label="0" :name="0">全网自动推出</el-radio>
+              <el-radio :label="1" :name="1">定向渠道推广</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item label="名称" prop="title">
+            <el-input
+              type="text"
+              style="width: 300px"
+              placeholder="请输入代金券名称"
+              v-model="shopInfo.title"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="代金券金额" prop="sendAmount">
+            <el-input-number
+              v-model="shopInfo.sendAmount"
+              style="width: 300px"
+              :controls="false"
+              max="9999"
+              min=""
+              step="1"
+            ></el-input-number>
+
+            元
+          </el-form-item>
+          <el-form-item label="代金券数量" prop="sendNum">
+            <el-input-number
+              v-model="shopInfo.sendNum"
+              style="width: 300px"
+               :controls="false"
+              max="9999"
+              min=""
+            ></el-input-number>
+
+          </el-form-item>
+        </el-col>
+        <el-col
+          :span="24"
+          style="margin-top: 30px; text-align: center"
+          v-if="$route.query.type != 'look'"
+        >
+          <el-form-item>
+            <el-button type="primary" @click="submitForm">保存</el-button>
+            <!-- <el-button>取消</el-button> -->
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <el-dialog
+      :visible.sync="shopDialog"
+      width="50%"
+      :destroy-on-close="true"
+      @close="close"
+    >
+      <div slot="title" style="padding: 0px 20px">
+        <el-tabs v-model="activeName" @tab-click="handleClick">
+          <el-tab-pane label="选择店铺" name="1"></el-tab-pane>
+          <el-tab-pane label="已选择店铺" name="2"></el-tab-pane>
+        </el-tabs>
+      </div>
+      <unionStore
+        v-if="shopInfo.type == 3"
+        @tabSelect="tabSelect"
+        :type="activeName"
+        :data="tabSelects"
+        :voucherid="$route.query.id"
+        :lookType="$route.query.type"
+        :oldShopIds="shopInfo.oldShopIds"
+      ></unionStore>
+
+      <chainStore
+        v-if="shopInfo.type == 2"
+        @tabSelect="tabSelect"
+        :type="activeName"
+        :data="tabSelects"
+        :voucherid="$route.query.id"
+        :lookType="$route.query.type"
+        :oldShopIds="shopInfo.oldShopIds"
+      ></chainStore>
+      <span
+        slot="footer"
+        class="dialog-footer"
+        v-if="$route.query.type != 'look'"
+      >
+        <el-button @click="shopDialog = false">取 消</el-button>
+        <el-button type="primary" @click="shopDialogSubmit">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { voucherSave, voucherInfo } from "@/api/marketing/voucher";
+import chainStore from "./components/stores-list/index.vue";
+import unionStore from "./components/stores-list/union.vue";
+export default {
+  components: { chainStore, unionStore },
+  data() {
+    return {
+      activeName: "1",
+      shopDialog: false,
+      shop: {
+        key: "",
+      },
+      rules: {
+        type: [{ required: true, message: "请选择券类型", trigger: "blur " }],
+        showType: [
+          { required: true, message: "请选择推广方式", trigger: "blur " },
+        ],
+        title: [{ required: true, message: "请输入券名称", trigger: "blur " }],
+        sendAmount: [
+          { required: true, message: "请输入发放金额", trigger: "blur " },
+        ],
+        sendNum: [
+          { required: true, message: "请输入发放数量", trigger: "blur " },
+        ],
+      },
+      shopInfo: {
+        type: 1,
+        showType: 0,
+      },
+      tabSelects: [],
+      storeNum: 0,
+    };
+  },
+  mounted() {
+    if (this.$route.query.id) {
+      this.getStoresInfo();
+    }
+    // this.getInfo();
+  },
+  methods: {
+    close() {
+      // this.activeName = "1";
+    },
+    selectshop() {
+      this.shopDialog = true;
+    },
+    getStoresInfo() {
+      voucherInfo(this.$route.query.id).then((res) => {
+        if (res.code == 200) {
+          this.shopInfo = res.data;
+        }
+      });
+    },
+    async shopDialogSubmit() {
+      this.storeNum = this.tabSelects.length;
+      this.shopDialog = false;
+      if (this.$route.query.id) {
+        this.getStoresInfo();
+      }
+    },
+    tabSelect(val) {
+      this.tabSelects = val;
+    },
+    submitForm() {
+      let a = this.tabSelects;
+      const selectedIds = a.map((item) => item.id);
+      this.shopInfo.shopIds = selectedIds.toString();
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          voucherSave(this.shopInfo).then((res) => {
+            if (res.code == 200) {
+              this.$message.success("保存成功!");
+              this.$store.dispatch("tagsView/delView", this.$route); //关闭当前页
+              this.$router.replace({
+                path: "/marketing/marketing/voucher/index",
+              });
+
+              this.getInfo();
+            }
+          });
+        } else {
+          return false;
+        }
+      });
+    },
+    resetForm(formName) {
+      this.$refs[formName].resetFields();
+    },
+    getInfo() {
+      getStoreInfo().then((res) => {
+        if (res.code == 200) {
+          this.shopInfo = res.data;
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style>
+.el-dialog__body {
+  padding: 0px 20px;
+}
+</style>

+ 278 - 0
src/views/marketing/voucher/components/list.vue

@@ -0,0 +1,278 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      label-width="80px"
+    >
+      <el-form-item label="" prop="key">
+        <el-input
+          v-model="queryParams.key"
+          placeholder="请输入代金券ID/代金券名称搜索"
+          clearable
+          style="width: 180px"
+        />
+      </el-form-item>
+      <el-form-item label="推广方式" prop="showType" >
+        <el-select
+          v-model="queryParams.showType"
+          placeholder="请选择推广方式"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option label="全网自动推出" value="0"> </el-option>
+          <el-option label="定向渠道推广" value="1"> </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="类型" prop="type">
+        <el-select
+          v-model="queryParams.type"
+          placeholder="请选择券类型"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option label="独立券" value="1"> </el-option>
+          <el-option label="连锁券" value="2"> </el-option>
+          <el-option label="联合券" value="3"> </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="发放时间" prop="dateRange">
+        <el-date-picker
+          v-model="queryParams.dateRange"
+          type="datetimerange"
+          range-separator="-"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          @change="datePicker"
+        >
+        </el-date-picker>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button type="primary" plain size="mini" @click="voucherAdd"
+          >新增</el-button
+        >
+      </el-col>
+    </el-row>
+    <el-table v-loading="loading" :data="list">
+      <el-table-column label="ID" align="center" prop="id" />
+      <el-table-column label="名称" align="center" prop="title" />
+      <el-table-column label="类型" align="center">
+        <template slot-scope="scope">
+          {{
+            scope.row.type == 1
+              ? "独立券"
+              : scope.row.type == 2
+              ? "连锁券"
+              : scope.row.type == 3
+              ? "联合券"
+              : ""
+          }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="推广方式" align="center">
+        <template slot-scope="scope">
+          {{
+            scope.row.showType == 0
+              ? "全网自动推出"
+              : scope.row.showType == 1
+              ? "定向渠道推广"
+              : ""
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="邀请加入店铺数量"
+        align="center"
+        prop="inviteStoreNum"
+      />
+      <el-table-column
+        label="已同意加入店铺数量"
+        align="center"
+        prop="agreeStoreNum"
+      />
+      <el-table-column label="面额(元)" align="center" prop="sendAmount" />
+      <el-table-column label="总发放数量" align="center" prop="sendNum" />
+      <el-table-column label="已领取数量" align="center" prop="receiveNum" />
+
+      <el-table-column label="操作" align="center" width="200">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            style="color: #00b529"
+            @click="handleLook(scope.row)"
+            >查看</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleEdit(scope.row)"
+            >编辑</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            style="color: red"
+            @click="handleRemove(scope.row)"
+            >删除</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNo"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import moment from "moment";
+import { queryPage, voucherRemove } from "@/api/marketing/voucher";
+export default {
+  data() {
+    return {
+      loading: true,
+      total: 0,
+      title: "",
+      list: [],
+      queryParams: {
+        pageNo: 1,
+        pageSize: 10,
+        dateRange: [],
+        type: "",
+        key: "",
+        showType: "",
+      },
+      form: {},
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    handleChoose(record) {
+      this.$emit("voucherChoose", record);
+    },
+
+    handleRemove(record) {
+      this.$confirm("是否确认删除该代金券?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          voucherRemove(record.id).then((res) => {
+            if (res.code == 200) {
+              this.$message({
+                type: "success",
+                message: "删除成功!",
+              });
+              this.getList();
+            }
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+    },
+    handleLook(record) {
+      this.$router.push({
+        path: "/marketing/marketing/voucher/add",
+        query: { id: record.id, type: "look" },
+      });
+    },
+
+    handleEdit(record) {
+      this.$router.push({
+        path: "/marketing/marketing/voucher/add",
+        query: { id: record.id },
+      });
+    },
+    voucherAdd() {
+      // this.$store.dispatch("tagsView/delView", this.$route); //关闭当前页
+      this.$router.push({ path: "/marketing/marketing/voucher/add" });
+    },
+
+    datePicker(val) {
+      this.queryParams.startTime = moment(val[0]).valueOf();
+      this.queryParams.endTime = moment(val[1]).valueOf();
+    },
+    getList() {
+      this.loading = true;
+      queryPage(this.queryParams).then((res) => {
+        this.list = res.data.records;
+        this.total = res.data.total;
+        this.loading = false;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.queryParams.endTime = "";
+      this.queryParams.startTime = "";
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+  },
+};
+</script>
+<style>
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 138px;
+  height: 138px;
+  line-height: 138px;
+  text-align: center;
+}
+</style>
+<style scoped lang="scss">
+.avatar {
+  width: 138px;
+  height: 138px;
+  display: block;
+}
+</style>

+ 758 - 0
src/views/marketing/voucher/components/record.vue

@@ -0,0 +1,758 @@
+<!-- <template>
+  <div class="app-container">
+    <div class="header" style="width: 100%">
+      <el-row class="row" :gutter="12">
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>今日新增订单</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.AllOrder : 0 }} 个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>待接单</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.waitOrderCount : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>账期待审核</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.waitAuditOrderCount : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>待发货</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.waitDelivery : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>未发货待退款</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.waitDeliveryRefund : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>待处理售后</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.afterSalesOrder : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>到账金额</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.divideSuccessPrice : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>冻结金额</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.divideWaitPrice : 0 }}元
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>账期待付款</span>
+            </div>
+            <div class="count">
+              {{
+                orderStatistics.divideWaitPayPrice
+                  ? orderStatistics.divideWaitPayPrice
+                  : 0
+              }}元
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>账期逾期金额</span>
+            </div>
+            <div class="count">
+              {{
+                orderStatistics.divideOverduePrice
+                  ? orderStatistics.divideOverduePrice
+                  : 0
+              }}元
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="radio">
+      <el-radio-group
+        v-model="queryParams.queryOrderStatus"
+        @change="radioChange"
+      >
+        <el-radio-button size="medium" label="0" name="0">
+          全部
+        </el-radio-button>
+        <el-radio-button
+          size="medium"
+          :label="item.value"
+          :name="item.value"
+          v-for="item in dict.type.sys_order_query_orderStatus"
+          :key="item.value"
+        >
+          {{ item.label }}
+        </el-radio-button>
+      </el-radio-group>
+    </div>
+
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      label-width="100px"
+    >
+      <el-form-item label="关键字" prop="key" label-width="100px">
+        <el-input
+          v-model="queryParams.spuName"
+          placeholder="请输入订单编号/商品ID/商品名称/买家手机号/买家ID搜索"
+          clearable
+          style="width: 420px"
+        />
+      </el-form-item>
+
+      <el-form-item label="下单时间" prop="createTime">
+        <el-date-picker
+          v-model="queryParams.createTime"
+          value-format="yyyy-MM-dd"
+          format="yyyy-MM-dd"
+          type="date"
+          placeholder="请选择下单时间"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="配送方式" prop="deliveryType">
+        <el-select
+          v-model="queryParams.deliveryType"
+          placeholder="请选择配送方式"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_deliveryType"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="订单状态" prop="orderStatusKey">
+        <el-select
+          v-model="queryParams.orderStatusKey"
+          placeholder="请选择订单状态"
+          style="width: 220px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_orderStatusKey"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="支付方式" prop="paymentType" label-width="100px">
+        <el-select
+          v-model="queryParams.paymentType"
+          placeholder="请选择支付方式"
+          style="width: 22 0px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_paymentType"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item
+        label="先用后付支付状态"
+        prop="paymentType"
+        label-width="140px"
+      >
+        <el-select
+          v-model="queryParams.paymentStatus"
+          placeholder="请选择支付状态"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_payStatus"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="售后状态" prop="afterSaleStatus">
+        <el-select
+          v-model="queryParams.afterSaleStatus"
+          placeholder="请选择售后状态"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_aftersalestatus"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="先用后付审核" prop="paymentType" label-width="140px">
+        <el-select
+          v-model="queryParams.paymentType"
+          placeholder="请选择支付方式"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_audit"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          plain
+          size="mini"
+          @click="printOrderBtn"
+          :disabled="!selectList.length > 0"
+          >批量接单</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          plain
+          size="mini"
+          @click="printOrderBtn"
+          :disabled="!selectList.length > 0"
+          >批量发货</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          size="mini"
+          @click="printOrderBtn"
+          :disabled="!selectList.length > 0"
+          >订单打印</el-button
+        >
+      </el-col>
+
+      <el-col :span="1.5">
+        <el-dropdown :hide-on-click="false" trigger="click">
+          <el-button type="primary" plain size="mini">
+            更多批量操作<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item @click.native=""
+              >批量先用后付审核</el-dropdown-item
+            >
+            <el-dropdown-item @click.native=""
+              >批量确认是否线下支付</el-dropdown-item
+            >
+            <el-dropdown-item @click.native="handleExport"
+              >批量导出</el-dropdown-item
+            >
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
+    </el-row>
+    <el-table
+      ref="multipleTable"
+      v-loading="loading"
+      :span-method="objectSpanMethod"
+      :data="spuList"
+      :border="true"
+      @selection-change="handleSelectionChange"
+      row-key="id"
+    >
+      <el-table-column type="selection" align="center" />
+      <el-table-column
+        label="订单编号"
+        align="center"
+        prop="carPayNo"
+        width="230"
+      />
+
+      <el-table-column
+        label="商品名称"
+        align="center"
+        prop="skuName"
+        width="200"
+      >
+        <template slot-scope="scope">
+          {{
+            scope.row.goodsInfo
+              ? JSON.parse(scope.row.goodsInfo)[0].skuName
+              : ""
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column label="单价" align="center" prop="price">
+        <template slot-scope="scope">
+          <span>
+            {{
+              scope.row.goodsInfo
+                ? JSON.parse(scope.row.goodsInfo)[0].price + "元"
+                : ""
+            }}
+          </span>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="数量" align="center" prop="price">
+        <template slot-scope="scope">
+          <span>
+            {{
+              scope.row.goodsInfo
+                ? JSON.parse(scope.row.goodsInfo)[0].quantity
+                : ""
+            }}{{
+              scope.row.goodsInfo ? JSON.parse(scope.row.goodsInfo)[0].unit : ""
+            }}</span
+          >
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        label="交易金额(元)"
+        align="center"
+        prop="paymentAmount"
+        width="100"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.goodsAmount.toFixed(2) }}元
+        </template>
+      </el-table-column>
+
+      <el-table-column label="订单状态" align="center" width="120">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_order_orderStatus_table"
+            :value="scope.row.orderStatus"
+          />
+        </template>
+      </el-table-column>
+
+      <el-table-column label="售后状态" align="center">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_order_aftersalestatus"
+            :value="scope.row.afterSaleStatus"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="下单人ID"
+        align="center"
+        prop="userId"
+        width="100"
+      />
+      <el-table-column
+        label="下单时间"
+        align="center"
+        prop="createTime"
+        width="160"
+      />
+      <el-table-column label="支付方式" align="center">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_order_paymentType"
+            :value="scope.row.paymentType"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column label="支付状态" align="center" prop="paymentStatus">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_order_payStatus"
+            :value="scope.row.paymentStatus"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="配送方式"
+        align="center"
+        prop="paymentType"
+        width="120"
+      >
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_order_deliveryType"
+            :value="scope.row.deliveryType"
+          />
+        </template>
+      </el-table-column>
+
+      <el-table-column label="操作" align="center" width="150" fixed="right">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="handlePrior(scope.row)"
+            v-if="
+              scope.row.paymentType == 'firstuse' &&
+              scope.row.auditFirstUse != 0
+            "
+            >先用后付审核</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleOffline(scope.row)"
+            v-if="
+              scope.row.paymentStatus == '2' &&
+              scope.row.confirmOfflinePayment != 0
+            "
+            >确认是否已线下支付</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleDetail(scope.row)"
+            v-hasPermi="['manage:order:detail']"
+            >订单详情</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNo"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { statisticsOrderNum, queryUserOrderByShopId } from "@/api/manage/order";
+import Utils from "@/utils/derive";
+export default {
+  name: "wholesale",
+  dicts: [
+    "sys_order_deliveryType",
+    "sys_order_orderStatusKey",
+    "sys_order_paymentType",
+    "sys_order_aftersalestatus",
+    "sys_order_payStatus",
+    "sys_order_orderStatus_table",
+    "sys_order_query_orderStatus",
+    "sys_order_audit",
+  ],
+  data() {
+    return {
+      // 遮罩层
+      loading: false,
+      // 显示搜索条件
+      total: 0,
+      // 参数表格数据
+      spuList: [],
+      // 弹出层标题
+      title: "订单详情",
+      // 查询参数
+      queryParams: {
+        queryOrderStatus: "0",
+        spuType: 0,
+        userId: "",
+        pageNo: 1,
+        pageSize: 10,
+        spuName: "",
+        userOrderSn: "",
+        userPhone: "",
+        createTime: "",
+        orderStatusKey: "",
+        afterSaleStatus: "",
+        paymentType: "",
+        deliveryType: "",
+      },
+      printForm: {
+        sn: "",
+      },
+      column: [
+        { header: "订单编号", key: "userOrderSn", width: 20 },
+        { header: "买家姓名", key: "userNick", width: 20 },
+        { header: "买家手机号", key: "userPhone", width: 20 },
+        { header: "商品名称", key: "skuName", width: 20 },
+        { header: "商品类型", key: "categoryName", width: 20 },
+        { header: "商品价格", key: "price", width: 20 },
+        { header: "包装方式", key: "packageType", width: 20 },
+        { header: "规格名称", key: "specsName", width: 20 },
+        { header: "规格值", key: "specsValue", width: 20 },
+        { header: "实付金额(元)", key: "goodsAmount", width: 20 },
+        { header: "商品数量", key: "goodsDetails", width: 20 },
+        { header: "运费", key: "freightFee", width: 20 },
+        { header: "订单状态", key: "orderStatus", width: 20 },
+        { header: "售后状态", key: "afterSaleStatus", width: 20 },
+        { header: "下单时间", key: "createTime", width: 20 },
+        { header: "付款时间 ", key: "paymentTime", width: 20 },
+      ],
+      // 表单参数
+      form: {},
+      // 表单校验
+      orderStatistics: {},
+      selectList: [],
+      selectListDC: [],
+      queryOrderStatus: 0,
+    };
+  },
+  mounted() {
+    this.getList();
+    this.getstatisticsOrder();
+  },
+  methods: {
+    radioChange() {
+      this.getList();
+    },
+    orderReturn(type) {
+      switch (type) {
+        case "print":
+          this.$refs.multipleTable.clearSelection();
+          this.getList();
+        case "prior":
+          this.getList();
+        case "offline":
+          this.getList();
+      }
+    },
+    handleOffline(record) {
+      this.$refs.orderDialogRef.openDialog("offline", record);
+    },
+    handlePrior(record) {
+      this.$refs.orderDialogRef.openDialog("prior", record);
+    },
+    printOrderBtn() {
+      this.$refs.orderDialogRef.openDialog("print", this.selectList);
+    },
+
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex === 0 || columnIndex === 1) {
+        if (
+          rowIndex === 0 ||
+          row.carPayNo != this.spuList[rowIndex - 1].carPayNo
+        ) {
+          let rowspan = 0;
+          this.spuList.forEach((element) => {
+            if (element.carPayNo === row.carPayNo) {
+              rowspan++;
+            }
+          });
+          return [rowspan, 1];
+        } else {
+          return [0, 0];
+        }
+      }
+    },
+
+    getstatisticsOrder() {
+      statisticsOrderNum({ spuType: 0 }).then((res) => {
+        if (res.code == 200) {
+          this.orderStatistics = res.data;
+        } else {
+          this.$modal.msgError(res.msg);
+        }
+      });
+    },
+
+    /** 查询参数列表 */
+    getList() {
+      this.selectList = [];
+      this.loading = true;
+      queryUserOrderByShopId(this.queryParams).then((response) => {
+        if (response.code == 200) {
+          let list = response.data.records;
+          let infoList = [];
+          for (let index = 0; index < list.length; index++) {
+            let e = list[index];
+            if (e.dxUserOrderVOList) {
+              for (let i = 0; i < e.dxUserOrderVOList.length; i++) {
+                let a = e.dxUserOrderVOList[i];
+                let c = { ...e, ...a };
+                infoList.push(c);
+              }
+            } else {
+              infoList.push(e);
+            }
+          }
+          let totalList = [];
+          for (let index = 0; index < infoList.length; index++) {
+            let e = infoList[index];
+            if (e.goodsInfo) {
+              try {
+                var goods = JSON.parse(e.goodsInfo);
+                e = { ...e, ...goods[0] };
+              } catch (error) {
+                console.error("解析 JSON 时出错:", error);
+                // 跳出当前循环,继续处理下一个元素
+                continue;
+              }
+            }
+            if (e.specsValue) {
+              for (let i = 0; i < e.specsValue.length; i++) {
+                let a = e.specsValue[i];
+                e = { ...e, ...a };
+              }
+            }
+
+            totalList.push(e);
+          }
+
+          totalList.forEach((e) => {
+            try {
+              let goos = JSON.parse(e.goodsInfo);
+              let detail = "";
+              if (goos && goos.length > 0) {
+                // 检查 goos 是否为空
+                goos.forEach((a) => {
+                  detail += `${a.skuName}(${a.specsValue[0]?.specsName})-数量:${a.quantity}${a.unit};`;
+                });
+              }
+              e.goodsDetails = detail;
+            } catch (error) {
+              console.error("解析 goodsInfo 时出错:", error);
+            }
+          });
+
+          this.spuList = totalList;
+          this.total = response.data.total;
+          this.loading = false;
+        }
+      });
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.selectList = selection.map((item) => item.carPayNo);
+      this.selectListDC = selection.map((item) => item);
+    },
+
+    /** 导出按钮操作 */
+    handleExport() {
+      let lists = [];
+      for (let index = 0; index < this.spuList.length; index++) {
+        for (let a = 0; a < this.selectListDC.length; a++) {
+          if (this.spuList[index].id == this.selectListDC[a].id) {
+            lists.push(this.spuList[index]);
+          }
+        }
+      }
+      Utils.exportExcel(this.column, lists, "订单列表"); //导出方法
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.header {
+  .item {
+    height: 100px;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    line-height: 40px;
+  }
+  .row {
+    background: #f4f4f4;
+    padding: 10px;
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+    .title {
+      text-align: center;
+    }
+    .count {
+      text-align: center;
+      font-size: 20px;
+      font-weight: bold;
+      color: rgb(64, 158, 255);
+    }
+    .zz {
+      font-size: 14px;
+      color: red;
+      padding: 0px 10px;
+    }
+  }
+}
+.radio {
+  margin: 20px 0px;
+}
+</style>
+<style>
+.el-radio-button__inner {
+  width: 150px;
+}
+</style> -->

+ 275 - 0
src/views/marketing/voucher/components/stores-list/index.vue

@@ -0,0 +1,275 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
+      <el-form-item label="" prop="key">
+        <el-input
+          v-model="queryParams.key"
+          placeholder="请输入店铺名称/ID搜索"
+          clearable
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="店铺区域" prop="area">
+        <el-cascader
+          v-model="queryParams.area"
+          ref="myCascader"
+          :placeholder="placeholder"
+          :props="props"
+          style="width: 100%"
+          @change="cascaderChange"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+    <span>已选择:{{ this.multipleSelection.length }}个</span>
+    <el-button
+      v-if="type == 2 && lookType != 'look'"
+      size="mini"
+      style="margin-left: 10px"
+      @click="allremove"
+    >
+      批量移除
+    </el-button>
+    <el-table
+      v-loading="loading"
+      :data="TableList"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column
+        type="selection"
+        width="55"
+        :selectable="checkSelectable"
+        v-if="lookType != 'look'"
+      >
+      </el-table-column>
+      <el-table-column label="店铺ID" align="center" prop="id" />
+      <el-table-column
+        label="店铺名称"
+        align="center"
+        prop="storeName"
+        :show-overflow-tooltip="true"
+      />
+      <el-table-column
+        label="店铺地址"
+        align="center"
+        prop="storeCity"
+        :show-overflow-tooltip="true"
+      />
+      <el-table-column label="联系方式" align="center" prop="storePhone" />
+      <el-table-column
+        label="营业状态"
+        align="center"
+        prop="businessStatus"
+        width="180"
+      >
+        <template slot-scope="scope">
+          <span v-if="scope.row.businessStatus == 0">未营业</span>
+          <span v-if="scope.row.businessStatus == 1">营业中</span>
+          <span v-if="scope.row.businessStatus == 2">禁用</span>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        v-if="type == 2"
+        label="审核状态"
+        align="center"
+        prop="receiveStatus"
+        width="180"
+      >
+        <template slot-scope="scope">
+          <span v-if="scope.row.receiveStatus == 0">待审核</span>
+          <span v-if="scope.row.receiveStatus == 1">已同意</span>
+          <span v-if="scope.row.receiveStatus == 2">已拒绝</span>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNo"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import {
+  storeMultipleShopQueryPage,
+  queryPageByVoucherId,
+  queryPageByVoucherIdRemove,
+} from "@/api/marketing/voucher";
+import { getCity } from "@/api/common/index";
+export default {
+  props: ["type", "data", "voucherid", "lookType", "oldShopIds"],
+  name: "chainStore",
+  data() {
+    return {
+      loading: true,
+      showSearch: true,
+      total: 0,
+      TableList: [],
+      open: false,
+      dateRange: [],
+      queryParams: {
+        createStartTime: "",
+        createEndTime: "",
+        pageNo: 1,
+        pageSize: 10,
+        cityProvCode: "",
+        auditStatus: "",
+        area: [],
+        key: "",
+      },
+      props: {
+        lazy: true,
+        lazyLoad: this.lazyLoad,
+        checkStrictly: true,
+      },
+      multipleSelection: [],
+    };
+  },
+  watch: {
+    type(newValue, oldValue) {
+      if (newValue == 1) {
+        this.getList();
+      } else {
+        if (this.voucherid) {
+          this.getStoreinfo();
+        } else {
+          this.TableList = this.data;
+          this.total = this.data.length;
+        }
+      }
+    },
+  },
+  mounted() {
+    this.getList();
+  },
+  methods: {
+    checkSelectable(row) {
+      // 根据状态判断是否可选择,这里假设状态为 '禁用' 时禁止选择
+      if (this.type == 1) {
+        let oldShop = JSON.parse(this.oldShopIds);
+        if (!oldShop.includes(row.id)) {
+          return row.status !== "禁用";
+        }
+      }
+    },
+    getStoreinfo() {
+      queryPageByVoucherId({ voucherId: this.voucherid }).then((response) => {
+        this.TableList = response.data.records;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+    },
+
+    allremove() {
+      if (this.voucherid) {
+        const selectedIds = this.multipleSelection.map((item) => item.id);
+        queryPageByVoucherIdRemove({
+          ids: selectedIds.toString(),
+          // voucherId: this.voucherid,
+        }).then((res) => {
+          if (res.code == 200) {
+            this.getStoreinfo();
+          }
+        });
+      } else {
+        this.TableList = this.TableList.filter((item) => {
+          return !this.multipleSelection.some(
+            (selectedItem) => selectedItem.id === item.id
+          );
+        });
+      }
+      // 清空选择
+      this.multipleSelection = [];
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+      this.$emit("tabSelect", this.multipleSelection);
+    },
+    pickerChange(val) {
+      this.queryParams.createStartTime = val[0];
+      this.queryParams.createEndTime = val[1];
+    },
+    cascaderChange(val) {
+      this.queryParams.cityProvCode = val[val.length - 1];
+    },
+
+    /** 查询参数列表 */
+    getList() {
+      this.loading = true;
+      storeMultipleShopQueryPage(this.queryParams).then((response) => {
+        this.TableList = response.data.records;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.createStartTime = "";
+      this.queryParams.createEndTime = "";
+      this.queryParams.area = [];
+      this.queryParams.cityProvCode = "";
+      this.dateRange = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+
+    lazyLoad(node, resolve) {
+      let level = node.level;
+      if (!node.data) {
+        getCity().then((res) => {
+          //接口
+          const nodes = Array.from(res.data).map((item, index) => ({
+            value: item.cityId,
+            label: `${item.name}`,
+            leaf: level >= 2,
+          }));
+          // 通过调用resolve将子节点数据返回,通知组件数据加载完成
+          resolve(nodes);
+        });
+      } else if (level == 1) {
+        getCity({ parentCityId: node.data.value }).then((res) => {
+          const nodes = Array.from(res.data).map((item) => ({
+            value: item.cityId,
+            label: `${item.name}`,
+            leaf: true, // 二级节点设为叶子节点
+            disabled: false, // 二级节点设为可选
+          }));
+          // 通过调用resolve将子节点数据返回,通知组件数据加载完成
+          resolve(nodes);
+        });
+      } else {
+        resolve({});
+      }
+    },
+  },
+};
+</script>

+ 220 - 0
src/views/marketing/voucher/components/stores-list/union.vue

@@ -0,0 +1,220 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
+      <el-form-item label="" prop="key">
+        <el-input
+          v-model="queryParams.key"
+          placeholder="请输入店铺名称/ID搜索"
+          clearable
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+    <el-table v-loading="loading" :data="TableList">
+      <el-table-column label="店铺ID" align="center" prop="id" />
+      <el-table-column
+        label="店铺名称"
+        align="center"
+        prop="storeName"
+        :show-overflow-tooltip="true"
+      />
+      <el-table-column
+        label="店铺地址"
+        align="center"
+        prop="storeCity"
+        :show-overflow-tooltip="true"
+      />
+      <el-table-column label="联系方式" align="center" prop="storePhone" />
+      <el-table-column
+        label="营业状态"
+        align="center"
+        prop="businessStatus"
+        width="180"
+      >
+        <template slot-scope="scope">
+          <span v-if="scope.row.businessStatus == 0">未营业</span>
+          <span v-if="scope.row.businessStatus == 1">营业中</span>
+          <span v-if="scope.row.businessStatus == 2">禁用</span>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        v-if="type == 2"
+        label="审核状态"
+        align="center"
+        prop="receiveStatus"
+        width="180"
+      >
+        <template slot-scope="scope">
+          <span v-if="scope.row.receiveStatus == 0">待审核</span>
+          <span v-if="scope.row.receiveStatus == 1">已同意</span>
+          <span v-if="scope.row.receiveStatus == 2">已拒绝</span>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        label="操作"
+        align="center"
+        width="200"
+        v-if="lookType != 'look'"
+      >
+        <template slot-scope="scope">
+          <el-button
+            v-if="type == 1 && !oldshop.includes(scope.row.id)"
+            size="mini"
+            type="text"
+            style="color: #00b529"
+            @click="handlesave(scope.row)"
+          >
+            {{ scope.row.union ? "已添加" : "添加店铺参与联合券" }}
+          </el-button>
+          <el-button
+            v-if="type == 2"
+            size="mini"
+            type="text"
+            @click="handleRemove(scope.row)"
+          >
+            解除添加
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNo"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import {
+  getStoreInfoByKey,
+  queryPageByVoucherId,
+  queryPageByVoucherIdRemove,
+} from "@/api/marketing/voucher";
+import { getCity } from "@/api/common/index";
+export default {
+  props: ["type", "data", "voucherid", "lookType", "oldShopIds"],
+  name: "chainStore",
+  data() {
+    return {
+      loading: true,
+      showSearch: true,
+      total: 0,
+      TableList: [],
+      open: false,
+      dateRange: [],
+      queryParams: {
+        pageNo: 1,
+        pageSize: 10,
+        key: "",
+      },
+      multipleSelection: [],
+      oldshop: [],
+    };
+  },
+  watch: {
+    type(newValue, oldValue) {
+      if (newValue == 1) {
+        this.getList();
+      } else {
+        if (this.voucherid) {
+          this.getStoreinfo();
+        } else {
+          this.TableList = this.data;
+          this.total = this.data.length;
+        }
+      }
+    },
+  },
+  mounted() {
+    if (this.oldShopIds) {
+      this.oldshop = JSON.parse(this.oldShopIds);
+    } else {
+      this.oldshop = [];
+    }
+    this.getList();
+  },
+  methods: {
+    handleRemove(record) {
+      if (this.voucherid) {
+        queryPageByVoucherIdRemove({
+          ids: record.id,
+        }).then((res) => {
+          if (res.code == 200) {
+            this.getStoreinfo();
+          }
+        });
+      } else {
+        this.TableList = this.TableList.filter((item) => {
+          return !this.multipleSelection.some(
+            (selectedItem) => selectedItem.id === item.id
+          );
+        });
+      }
+      // 清空选择
+      this.multipleSelection = [];
+    },
+
+    handlesave(record) {
+      record.union = record.id;
+      this.multipleSelection.push(record);
+      this.$emit("tabSelect", this.multipleSelection);
+    },
+    getStoreinfo() {
+      queryPageByVoucherId({ voucherId: this.voucherid }).then((response) => {
+        this.TableList = response.data.records;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+    },
+
+    /** 查询参数列表 */
+    getList() {
+      this.loading = true;
+      getStoreInfoByKey(this.queryParams).then((response) => {
+        this.TableList = response.data.records.map((item) => ({
+          ...item,
+          union: null,
+        }));
+        this.total = response.data.total;
+        this.loading = false;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+  },
+};
+</script>

+ 42 - 0
src/views/marketing/voucher/index.vue

@@ -0,0 +1,42 @@
+<template>
+  <div class="app-container">
+    <el-tabs v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="代金券" :name="1"></el-tab-pane>
+      <el-tab-pane label="代金券使用规则" :name="2"></el-tab-pane>
+      <el-tab-pane label="领取记录" :name="3"></el-tab-pane>
+    </el-tabs>
+    <component :is="componentName"></component>
+  </div>
+</template>
+
+<script>
+import voucherList from "./components/list.vue";
+import ruleConfig from "@/views/manage/voucher/index";
+import recordList from "./components/record.vue";
+export default {
+  components: { voucherList, ruleConfig, recordList },
+  data() {
+    return {
+      activeName: 1,
+      componentName: voucherList,
+    };
+  },
+  created() {},
+  methods: {
+    handleClick() {
+      console.log(this.activeName);
+      switch (this.activeName) {
+        case 1:
+          this.componentName = voucherList;
+          break;
+        case 2:
+          this.componentName = ruleConfig;
+          break;
+        case 3:
+          this.componentName = recordList;
+          break;
+      }
+    },
+  },
+};
+</script>