2023-11-08 09:33:11 +08:00
|
|
|
|
<template>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<!-- 优惠券页面-->
|
2023-11-08 09:33:11 +08:00
|
|
|
|
<div class="app-container">
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-card style="margin-bottom: 20px">
|
2023-11-08 09:33:11 +08:00
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-form-item label="" prop="name">
|
|
|
|
|
<el-input v-model="queryParams.name" placeholder="优惠券名称"></el-input>
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-form-item>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-form-item label="" prop="region">
|
2023-11-09 10:29:49 +08:00
|
|
|
|
<el-select v-model="queryParams.isonline" clearable placeholder="在线/下线">
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-option label="在线" value="0"></el-option>
|
|
|
|
|
<el-option label="下线" value="1"></el-option>
|
|
|
|
|
</el-select>
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-form-item>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-form-item label="" prop="region">
|
2023-11-09 10:29:49 +08:00
|
|
|
|
<el-select v-model="queryParams.discountType" clearable placeholder="优惠类型">
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-option label="满减券" value="0"></el-option>
|
|
|
|
|
<el-option label="折扣券" value="1"></el-option>
|
|
|
|
|
</el-select>
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-form-item>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-form-item label="" prop="region">
|
2024-03-05 13:55:34 +08:00
|
|
|
|
<!-- <el-select v-model="queryParams.type" clearable placeholder="卡券类型">
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-option label="油品券" value="0"></el-option>
|
2024-03-05 13:55:34 +08:00
|
|
|
|
<!– <el-option label="商品券" value="1"></el-option>–>
|
|
|
|
|
<!– <el-option label="通用券" value="2"></el-option>–>
|
|
|
|
|
</el-select>-->
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-form-item>
|
2024-07-06 09:00:43 +08:00
|
|
|
|
<el-form-item style="float: right">
|
2023-11-08 09:33:11 +08:00
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
2024-07-15 15:05:28 +08:00
|
|
|
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
</el-card>
|
|
|
|
|
<el-card style="margin-bottom: 20px">
|
2023-11-08 09:33:11 +08:00
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleAdd"
|
2023-11-08 14:58:40 +08:00
|
|
|
|
|
2023-11-08 09:33:11 +08:00
|
|
|
|
>新增</el-button>
|
2024-02-06 09:10:18 +08:00
|
|
|
|
|
|
|
|
|
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="favorableList" @selection-change="handleSelectionChange">
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<!-- <el-table-column label="是否在线 0:在线 1: 下线" align="center" prop="isonline" />-->
|
2024-03-05 15:55:51 +08:00
|
|
|
|
<el-table-column
|
|
|
|
|
label="序号"
|
|
|
|
|
type="index"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
2023-11-08 09:33:11 +08:00
|
|
|
|
<el-table-column label="优惠券名称" align="center" prop="name" />
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-table-column label="卡券类型 " align="center" prop="type" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-tag v-if="scope.row.type == 0">油品券</el-tag>
|
2024-02-01 15:53:54 +08:00
|
|
|
|
<!-- <el-tag type="success" v-if="scope.row.type == 1">商品券</el-tag>-->
|
2024-02-21 15:23:19 +08:00
|
|
|
|
<!-- <el-tag type="warning" v-if="scope.row.type == 2">通用券</el-tag>-->
|
2023-11-08 14:58:40 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="优惠类型" align="center" prop="discountType" >
|
2023-11-08 09:33:11 +08:00
|
|
|
|
<template slot-scope="scope">
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-tag effect="dark" type="success" v-if="scope.row.discountType == 0">满减券</el-tag>
|
|
|
|
|
<el-tag effect="dark" v-if="scope.row.discountType == 1">折扣券</el-tag>
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
|
2024-01-03 09:11:56 +08:00
|
|
|
|
<el-table-column label="满减金额" align="center" prop="satisfiedAmount" >
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<template slot-scope="scope">
|
2024-01-03 09:11:56 +08:00
|
|
|
|
满 <el-tag effect="plain" type="success" >{{scope.row.satisfiedAmount}}</el-tag> 元
|
2023-11-08 14:58:40 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="优惠金额" align="center" prop="discountAmount" >
|
|
|
|
|
<template slot-scope="scope">
|
2024-03-15 10:44:21 +08:00
|
|
|
|
<span v-if="scope.row.discountType == 0">减 <el-tag effect="plain" >{{scope.row.discountAmount}}</el-tag> 元</span>
|
|
|
|
|
<span v-if="scope.row.discountType == 1">打 <el-tag effect="plain" >{{scope.row.specialDiscount}}</el-tag> 折</span>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="有效期" align="center" prop="validity" >
|
|
|
|
|
<template slot-scope="scope">
|
2023-11-11 10:57:49 +08:00
|
|
|
|
<span v-if="scope.row.timeType == 0" >{{scope.row.validityZero }} 天</span>
|
|
|
|
|
<span v-if="scope.row.timeType == 1" >{{scope.row.validityOne}} 天</span>
|
|
|
|
|
<span v-if="scope.row.timeType == 2" >{{scope.row. validityTwo}} 天</span>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2023-11-11 10:57:49 +08:00
|
|
|
|
<el-table-column label="生效日期" align="center" prop="timeType" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span v-if="scope.row.timeType == 0" >领券后立即生效</span>
|
|
|
|
|
<span v-if="scope.row.timeType == 1" >固定有效周期,固定开始日期{{scope.row.effectiveDate}}</span>
|
|
|
|
|
<span v-if="scope.row.timeType == 2" >领券后第{{ scope.row.validityDay}}天生效</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2023-11-24 17:24:10 +08:00
|
|
|
|
<!-- <el-table-column label="生效时间" align="center" prop="effectiveDateType" >
|
2023-11-11 10:57:49 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span v-if="scope.row.effectiveDateType == 0" >领取时间</span>
|
|
|
|
|
<span v-if="scope.row.effectiveDateType == 1" >指定{{scope.row. effectiveDateStart}}</span>
|
|
|
|
|
</template>
|
2023-11-24 17:24:10 +08:00
|
|
|
|
</el-table-column>-->
|
2023-11-08 09:33:11 +08:00
|
|
|
|
<el-table-column label="发放数量" align="center" prop="count" />
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-table-column label="满足金额" align="center" prop="satisfiedAmount" />
|
2024-02-01 15:53:54 +08:00
|
|
|
|
<!-- <el-table-column label="二维码链接" align="center" prop="qrCodeLink" >
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div style="cursor: pointer" @click="qrcodelook(scope.row.qrCodeLink)">
|
|
|
|
|
<i class="el-icon-picture" ></i>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2024-02-01 15:53:54 +08:00
|
|
|
|
</el-table-column>-->
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-table-column label="优惠券状态" align="center" prop="status" >
|
|
|
|
|
<template slot-scope="scope">
|
2024-03-06 16:12:20 +08:00
|
|
|
|
<div v-if="scope.row.isonline == 0"> <el-tag>上线</el-tag> </div>
|
|
|
|
|
<div v-if="scope.row.isonline == 1"> <el-tag type="danger">下线</el-tag> </div>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
2023-11-08 09:33:11 +08:00
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
2023-11-08 16:38:22 +08:00
|
|
|
|
|
2023-11-08 09:33:11 +08:00
|
|
|
|
@click="handleUpdate(scope.row)"
|
2023-11-08 14:58:40 +08:00
|
|
|
|
|
2023-11-08 09:33:11 +08:00
|
|
|
|
>修改</el-button>
|
2024-02-01 15:53:54 +08:00
|
|
|
|
<!-- <el-button
|
2023-11-08 16:38:22 +08:00
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="tableciick(scope.row)"
|
2024-02-01 15:53:54 +08:00
|
|
|
|
>统计</el-button>-->
|
2023-11-08 16:38:22 +08:00
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
v-if="scope.row.isonline == 0"
|
|
|
|
|
@click="ordai(scope.row)"
|
|
|
|
|
>下线</el-button>
|
2024-03-06 16:25:10 +08:00
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
v-if="scope.row.isonline == 1"
|
|
|
|
|
@click="handleDelete1(scope.row)"
|
|
|
|
|
>删除</el-button>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
2023-11-11 10:57:49 +08:00
|
|
|
|
|
2023-11-08 09:33:11 +08:00
|
|
|
|
<pagination
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
</el-card>
|
2023-11-08 09:33:11 +08:00
|
|
|
|
<!-- 添加或修改优惠券对话框 -->
|
2023-11-25 18:07:50 +08:00
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" :label-position="labelPosition" label-width="100px">
|
2024-01-19 14:28:32 +08:00
|
|
|
|
|
2023-11-08 09:33:11 +08:00
|
|
|
|
<el-form-item label="优惠券名称" prop="name">
|
|
|
|
|
<el-input v-model="form.name" placeholder="请输入优惠券名称" />
|
2024-01-19 14:28:32 +08:00
|
|
|
|
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-form-item>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-form-item label="卡券类型" prop="type">
|
|
|
|
|
<el-radio-group v-model="form.type">
|
|
|
|
|
<el-radio label="0">油品券</el-radio>
|
2024-02-01 15:53:54 +08:00
|
|
|
|
<!-- <el-radio label="1">商品券</el-radio>-->
|
2024-02-21 15:23:19 +08:00
|
|
|
|
<!-- <el-radio label="2">通用券</el-radio>-->
|
2023-11-08 14:58:40 +08:00
|
|
|
|
</el-radio-group>
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-form-item>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-form-item label="优惠类型" prop="discountType">
|
|
|
|
|
<el-radio-group v-model="form.discountType">
|
|
|
|
|
<el-radio label="0">满减券</el-radio>
|
|
|
|
|
<el-radio label="1">折扣券</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
2023-11-11 10:57:49 +08:00
|
|
|
|
<el-form-item label="可用油品" prop="oilType" v-if="form.type == 0">
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-checkbox-group v-model="form.oilType">
|
2024-01-03 09:11:56 +08:00
|
|
|
|
<el-checkbox v-for="(item,index) in oillist" :label=" item.id " :key="index">{{item.oilType}}{{item.oilName}}</el-checkbox>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
</el-checkbox-group>
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-form-item>
|
2024-02-21 15:23:19 +08:00
|
|
|
|
<div style="display: flex;align-items: center;margin-bottom: 25px" v-if="form.discountType == 0">
|
|
|
|
|
<div style="color: red">*</div>
|
|
|
|
|
<div style="margin: 0px 10px;font-weight: bold">满</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-input v-model="form.satisfiedAmount" placeholder="请输入满足金额" >
|
|
|
|
|
<template slot="append">元</template>
|
|
|
|
|
</el-input>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin: 0px 10px;font-weight: bold">减</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-input v-model="form.discountAmount" placeholder="请输入优惠金额" >
|
|
|
|
|
<template slot="append">元</template>
|
|
|
|
|
</el-input>
|
2024-01-19 14:28:32 +08:00
|
|
|
|
</div>
|
2024-03-14 19:55:35 +08:00
|
|
|
|
|
2024-02-21 15:23:19 +08:00
|
|
|
|
<!-- <div class="_k">-->
|
|
|
|
|
<!-- <el-form-item label="满" prop="satisfiedAmount" v-if="form.discountType == 0">-->
|
|
|
|
|
<!-- <el-input v-model="form.satisfiedAmount" placeholder="请输入满足金额" >-->
|
|
|
|
|
<!-- <template slot="append">元</template>-->
|
|
|
|
|
<!-- </el-input>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- <div class="_k" style="margin-left: 15px">-->
|
|
|
|
|
<!-- <el-form-item label="减" prop="discountAmount" v-if="form.discountType == 0">-->
|
|
|
|
|
<!-- <el-input v-model="form.discountAmount" placeholder="请输入优惠金额" >-->
|
|
|
|
|
<!-- <template slot="append">元</template>-->
|
|
|
|
|
<!-- </el-input>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
</div>
|
2024-03-15 16:24:27 +08:00
|
|
|
|
<!-- <div style="color: red" v-if="form.discountAmount>form.satisfiedAmount" >检测到优惠金额大于满足金额请确定是否要继续执行</div>-->
|
2024-02-21 15:23:19 +08:00
|
|
|
|
<div style="display: flex;align-items: center;margin-bottom: 25px" v-if="form.discountType == 1">
|
|
|
|
|
<div style="color: red">*</div>
|
|
|
|
|
<div style="margin: 0px 10px;font-weight: bold">满</div>
|
|
|
|
|
<div>
|
2024-01-19 14:28:32 +08:00
|
|
|
|
<el-input v-model="form.satisfiedAmount" placeholder="请输入满足金额" >
|
|
|
|
|
<template slot="append">元</template>
|
|
|
|
|
</el-input>
|
2024-02-21 15:23:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div style="margin: 0px 10px;font-weight: bold">打</div>
|
|
|
|
|
<div>
|
2024-03-14 19:55:35 +08:00
|
|
|
|
<el-input-number v-model="form.specialDiscount" :min="1" :max="9.9" placeholder="1 ~ 9.9"/>
|
2024-02-21 15:23:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div style="margin: 0px 10px;font-weight: bold">折</div>
|
2024-01-19 14:28:32 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
2024-02-21 15:23:19 +08:00
|
|
|
|
<!-- <div class="_k">-->
|
|
|
|
|
<!-- <el-form-item label="满足金额" prop="satisfiedAmount" v-if="form.discountType == 1">-->
|
|
|
|
|
<!-- <el-input v-model="form.satisfiedAmount" placeholder="请输入满足金额" >-->
|
|
|
|
|
<!-- <template slot="append">元</template>-->
|
|
|
|
|
<!-- </el-input>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
|
|
|
|
|
<!-- <el-form-item label="优惠折扣" prop="specialDiscount" v-if="form.discountType == 1">-->
|
|
|
|
|
<!-- <el-input-number v-model="form.specialDiscount" :min="0" :max="9.9" placeholder="1 ~ 9.9"/>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
2024-01-18 18:06:38 +08:00
|
|
|
|
<!-- <el-form-item label="折扣抵消" prop="discountOffset" v-if="form.discountType == 1">
|
2023-11-11 10:57:49 +08:00
|
|
|
|
<el-input v-model="form.discountOffset" placeholder="请输入折扣抵消" />
|
2024-01-18 18:06:38 +08:00
|
|
|
|
</el-form-item>-->
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-form-item label="生效日期" prop="timeType">
|
|
|
|
|
<el-radio-group v-model="form.timeType">
|
2023-11-20 09:28:45 +08:00
|
|
|
|
<!-- 0 -->
|
2023-11-20 11:23:38 +08:00
|
|
|
|
<el-radio label="0" style="display: flex;align-items: center" >
|
2024-03-15 18:13:06 +08:00
|
|
|
|
<div class="h-box"> <span style="margin-right: 5px">领券后立即生效,有效期 </span> <el-input placeholder="有效天数" type="number" min="0" style="width: 200px" v-model="form.validityZero">
|
2023-11-20 09:28:45 +08:00
|
|
|
|
<template slot="append">天</template>
|
2023-11-20 11:23:38 +08:00
|
|
|
|
</el-input> </div>
|
|
|
|
|
|
|
|
|
|
|
2023-11-20 09:28:45 +08:00
|
|
|
|
</el-radio>
|
|
|
|
|
<!-- 1 -->
|
2023-11-20 11:23:38 +08:00
|
|
|
|
<el-radio label="1" style="display: flex;align-items: center" >
|
|
|
|
|
<div class="h-box">
|
2024-01-03 14:24:24 +08:00
|
|
|
|
<span style="margin-right: 5px"> 固定有效周期,固定开始日期 </span>
|
2023-11-20 11:23:38 +08:00
|
|
|
|
<el-date-picker
|
2023-11-08 14:58:40 +08:00
|
|
|
|
v-model="form.effectiveDate"
|
|
|
|
|
type="date"
|
|
|
|
|
placeholder="选择日期">
|
|
|
|
|
</el-date-picker>
|
2024-01-03 14:24:24 +08:00
|
|
|
|
<span style="margin-right: 5px; margin-left: 5px">有效期</span>
|
2024-03-15 18:13:06 +08:00
|
|
|
|
<el-input type="number" min="0" placeholder="有效天数" style="width: 200px" v-model="form.validityOne"><template slot="append">天</template></el-input>
|
2023-11-20 11:23:38 +08:00
|
|
|
|
</div>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
</el-radio>
|
2023-11-20 09:28:45 +08:00
|
|
|
|
<!-- 2-->
|
2023-11-20 11:23:38 +08:00
|
|
|
|
<el-radio label="2" style="display: flex;align-items: center">
|
|
|
|
|
<div class="h-box">
|
2024-03-15 18:17:19 +08:00
|
|
|
|
<span style="margin-right: 5px">领券后第</span> <el-input style="width: 200px" type="number" min="0" placeholder="1" v-model="form.validityDay">
|
2023-11-20 09:28:45 +08:00
|
|
|
|
<template slot="append">天生效</template>
|
2024-03-15 18:13:06 +08:00
|
|
|
|
</el-input> <span style="margin-right: 5px; margin-left: 5px">有效期</span> <el-input type="number" min="0" placeholder="有效天数" style="width: 200px" v-model="form.validityTwo"><template slot="append">天</template></el-input>
|
2023-11-20 11:23:38 +08:00
|
|
|
|
</div>
|
2023-11-20 09:28:45 +08:00
|
|
|
|
</el-radio>
|
2023-11-20 11:23:38 +08:00
|
|
|
|
|
2023-11-08 14:58:40 +08:00
|
|
|
|
</el-radio-group>
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-form-item>
|
2024-04-09 09:23:11 +08:00
|
|
|
|
<el-form-item label="互斥功能" prop="exclusiveFunctionList" style="margin-left: 10px">
|
|
|
|
|
<el-checkbox-group v-model="form.exclusiveFunctionList">
|
|
|
|
|
<el-checkbox label="0">满减活动</el-checkbox>
|
|
|
|
|
<el-checkbox label="1">储值卡付款</el-checkbox>
|
|
|
|
|
<el-checkbox label="2">会员等级</el-checkbox>
|
|
|
|
|
</el-checkbox-group>
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-form-item>
|
2024-03-11 11:43:55 +08:00
|
|
|
|
|
2024-04-09 09:23:11 +08:00
|
|
|
|
<el-form-item label="会员等级" prop="region" v-if="form.exclusiveFunctionList && form.exclusiveFunctionList.length>0 && form.exclusiveFunctionList.includes('2') " >
|
2024-03-11 11:43:55 +08:00
|
|
|
|
<el-select v-model="form.membershipLevel" multiple placeholder="会员等级" >
|
|
|
|
|
<el-option v-for="(item,index) in vipname" :key="index" :label="item.name" :value="item.id.toString()"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-form-item label="领取规则 " prop="claimRule">
|
|
|
|
|
<el-radio-group v-model="form.claimRule">
|
|
|
|
|
<el-radio label="0">每人限领一张</el-radio>
|
|
|
|
|
<el-radio label="1">每人每日限领一张</el-radio>
|
|
|
|
|
</el-radio-group>
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="发放数量" prop="count">
|
|
|
|
|
<el-input v-model="form.count" placeholder="请输入发放数量" />
|
|
|
|
|
</el-form-item>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
|
|
<el-radio-group v-model="form.status">
|
|
|
|
|
<el-radio label="0">启用</el-radio>
|
|
|
|
|
<el-radio label="1">禁用</el-radio>
|
|
|
|
|
</el-radio-group>
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-form-item>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
<el-dialog
|
|
|
|
|
title="二维码"
|
|
|
|
|
v-loading="loadingdialog"
|
|
|
|
|
:visible.sync="centerDialogVisible"
|
|
|
|
|
width="350px"
|
|
|
|
|
center>
|
|
|
|
|
<div style="display: flex;align-items: center">
|
|
|
|
|
<div class="qr-code" id="qrCode" ref="qrCodeUrl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
2024-02-01 15:53:54 +08:00
|
|
|
|
<!-- <el-drawer
|
2023-11-08 16:38:22 +08:00
|
|
|
|
title="统计!"
|
|
|
|
|
:visible.sync="table"
|
|
|
|
|
direction="rtl"
|
|
|
|
|
size="50%">
|
|
|
|
|
<div style="box-sizing: border-box;padding: 20px">
|
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
|
<el-form-item label="" prop="name">
|
|
|
|
|
<el-input v-model="tongji.mobile" placeholder="手机号"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="" prop="region">
|
|
|
|
|
<el-select v-model="tongji.status" placeholder="卡券状态">
|
|
|
|
|
<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="gettongji" >查询</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div style="display: flex;align-items: center">
|
|
|
|
|
<div class="hui-box">
|
|
|
|
|
<div>已领取数量</div>
|
|
|
|
|
<div class="sizewit">{{fourdata.tatol}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="hui-box">
|
|
|
|
|
<div>已使用数量</div>
|
|
|
|
|
<div class="sizewit">{{fourdata.usedTatal}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="hui-box">
|
|
|
|
|
<div>未使用数量</div>
|
|
|
|
|
<div class="sizewit">{{fourdata.unTatal}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="hui-box">
|
|
|
|
|
<div>过期数量</div>
|
|
|
|
|
<div class="sizewit">{{fourdata.outTatal}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table :data="gridData">
|
|
|
|
|
<el-table-column property="createTime" label="领取时间"></el-table-column>
|
|
|
|
|
<el-table-column property="mobile" label="会员"></el-table-column>
|
|
|
|
|
<el-table-column property="startTime" label="有效期开始" ></el-table-column>
|
|
|
|
|
<el-table-column property="endTime" label="有效期结束"></el-table-column>
|
|
|
|
|
<el-table-column property="status" label="券状态">
|
2023-11-11 10:57:49 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span v-if="scope.row.status == 0">未使用</span>
|
|
|
|
|
<span v-if="scope.row.status == 1">已使用</span>
|
|
|
|
|
<span v-if="scope.row.status == 2">已过期</span>
|
|
|
|
|
</template>
|
2023-11-08 16:38:22 +08:00
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column property="exchangeFrom" label="描述信息"></el-table-column>
|
|
|
|
|
</el-table>
|
2023-11-08 17:01:44 +08:00
|
|
|
|
<pagination
|
|
|
|
|
v-show="tongji.total>0"
|
|
|
|
|
:total="tongji.total"
|
|
|
|
|
:page.sync="tongji.pageNum"
|
|
|
|
|
:limit.sync="tongji.pageSize"
|
|
|
|
|
@pagination="gettongji"
|
|
|
|
|
/>
|
2023-11-08 16:38:22 +08:00
|
|
|
|
</div>
|
2024-02-01 15:53:54 +08:00
|
|
|
|
</el-drawer>-->
|
2023-11-08 16:38:22 +08:00
|
|
|
|
|
2023-11-08 09:33:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2023-11-08 14:58:40 +08:00
|
|
|
|
import QRCode from 'qrcodejs2'
|
2023-11-11 10:57:49 +08:00
|
|
|
|
import { listFavorable, getFavorable,getcardFavorable,getcount,getcountList, delFavorable, addFavorable, updateFavorable } from "@/api/EventMarketing/cardFavorable";
|
2023-12-08 13:33:52 +08:00
|
|
|
|
import { getoilName, } from "@/api/EventMarketing/activeConsumption";
|
2024-03-08 15:15:34 +08:00
|
|
|
|
import {deleteById} from "@/api/EventMarketing/oilBlock";
|
2024-03-11 11:43:55 +08:00
|
|
|
|
import {listUserGrade} from "@/api/EventMarketing/SaveBlock";
|
2023-11-08 09:33:11 +08:00
|
|
|
|
export default {
|
|
|
|
|
name: "Favorable",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2023-11-25 18:07:50 +08:00
|
|
|
|
labelPosition:'left',
|
2023-11-08 16:38:22 +08:00
|
|
|
|
table: false,
|
|
|
|
|
gridData: [
|
|
|
|
|
{
|
|
|
|
|
date: '2016-05-02',
|
|
|
|
|
name: '王小虎',
|
|
|
|
|
address: '上海市普陀区金沙江路 1518 弄'
|
|
|
|
|
}, {
|
|
|
|
|
date: '2016-05-04',
|
|
|
|
|
name: '王小虎',
|
|
|
|
|
address: '上海市普陀区金沙江路 1518 弄'
|
|
|
|
|
}, {
|
|
|
|
|
date: '2016-05-01',
|
|
|
|
|
name: '王小虎',
|
|
|
|
|
address: '上海市普陀区金沙江路 1518 弄'
|
|
|
|
|
}, {
|
|
|
|
|
date: '2016-05-03',
|
|
|
|
|
name: '王小虎',
|
|
|
|
|
address: '上海市普陀区金沙江路 1518 弄'
|
|
|
|
|
}],
|
2023-11-08 14:58:40 +08:00
|
|
|
|
cities: ['1', '2', '3', '4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24'],
|
2023-11-11 10:57:49 +08:00
|
|
|
|
yue: ['1', '2', '3', '4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31'],
|
2023-11-25 09:04:19 +08:00
|
|
|
|
lookyue:[],
|
2023-11-11 10:57:49 +08:00
|
|
|
|
zhou:['周一','周二','周三','周四','周五','周六','周天'],
|
2023-12-08 13:33:52 +08:00
|
|
|
|
oillist:[],
|
|
|
|
|
/* oillist:['92#','95#','98#','0#','-10#','LNG','CNG','京92#','京95#','京0#',],*/
|
2023-11-08 14:58:40 +08:00
|
|
|
|
checkboxGroup1: ['1'],
|
|
|
|
|
centerDialogVisible:false,
|
|
|
|
|
loadingdialog:true,
|
2023-11-08 09:33:11 +08:00
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
|
ids: [],
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 优惠券表格数据
|
|
|
|
|
favorableList: [],
|
2023-11-08 16:38:22 +08:00
|
|
|
|
fourdata:[],
|
2023-11-08 09:33:11 +08:00
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
chainStorId: null,
|
|
|
|
|
storeId: null,
|
|
|
|
|
isonline: null,
|
|
|
|
|
name: null,
|
|
|
|
|
type: null,
|
|
|
|
|
discountType: null,
|
|
|
|
|
oilType: null,
|
|
|
|
|
fullDeduction: null,
|
|
|
|
|
discountAmount: null,
|
|
|
|
|
satisfiedAmount: null,
|
|
|
|
|
specialDiscount: null,
|
|
|
|
|
discountOffset: null,
|
|
|
|
|
validity: null,
|
|
|
|
|
effectiveDate: null,
|
|
|
|
|
effectiveTime: null,
|
|
|
|
|
availablePeriod: null,
|
|
|
|
|
checkDateType: null,
|
2023-11-11 10:57:49 +08:00
|
|
|
|
checkTime: [],
|
2023-11-08 09:33:11 +08:00
|
|
|
|
checkOutTime: null,
|
2024-04-09 09:23:11 +08:00
|
|
|
|
exclusiveFunctionList: [],
|
2023-11-08 09:33:11 +08:00
|
|
|
|
exclusiveFunction: null,
|
|
|
|
|
claimRule: null,
|
|
|
|
|
count: null,
|
|
|
|
|
qrCodeLink: null,
|
|
|
|
|
status: null,
|
2023-11-20 11:23:38 +08:00
|
|
|
|
effectiveDateType:'0'
|
2023-11-08 09:33:11 +08:00
|
|
|
|
},
|
2023-11-08 16:38:22 +08:00
|
|
|
|
tongji:{
|
|
|
|
|
id:'',
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
2023-11-08 17:01:44 +08:00
|
|
|
|
total:0
|
2023-11-08 16:38:22 +08:00
|
|
|
|
},
|
2024-03-14 19:55:35 +08:00
|
|
|
|
radioShow:[],
|
2023-11-08 09:33:11 +08:00
|
|
|
|
// 表单参数
|
2023-11-11 10:57:49 +08:00
|
|
|
|
form: {},
|
2024-03-11 11:43:55 +08:00
|
|
|
|
vipname:[],
|
2023-11-08 09:33:11 +08:00
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
2024-01-13 09:49:42 +08:00
|
|
|
|
timeType: [
|
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
2023-11-08 16:38:22 +08:00
|
|
|
|
chainStorId: [
|
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
storeId: [
|
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
isonline: [
|
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
name: [
|
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
type: [
|
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
discountType: [
|
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
oilType: [
|
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
fullDeduction: [
|
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
discountAmount: [
|
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
satisfiedAmount: [
|
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
specialDiscount: [
|
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
2023-11-08 17:01:44 +08:00
|
|
|
|
effectiveTime: [
|
2023-11-08 16:38:22 +08:00
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
2023-11-08 17:01:44 +08:00
|
|
|
|
checkTime: [
|
2023-11-08 16:38:22 +08:00
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
2023-11-08 17:01:44 +08:00
|
|
|
|
claimRule: [
|
2023-11-08 16:38:22 +08:00
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
2023-11-08 17:01:44 +08:00
|
|
|
|
count: [
|
2023-11-08 16:38:22 +08:00
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
status: [
|
|
|
|
|
{ required: true, message: '不能为空', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-09 10:29:49 +08:00
|
|
|
|
},
|
2023-11-08 09:33:11 +08:00
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
2023-12-08 13:33:52 +08:00
|
|
|
|
this.getoilName()
|
2023-11-08 09:33:11 +08:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
2024-03-14 19:55:35 +08:00
|
|
|
|
|
|
|
|
|
|
2023-12-08 13:33:52 +08:00
|
|
|
|
getoilName(){
|
|
|
|
|
getoilName().then(res=>{
|
|
|
|
|
console.log(res)
|
|
|
|
|
this.oillist = res.data
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
2023-11-25 09:04:19 +08:00
|
|
|
|
yueinput(e){
|
|
|
|
|
console.log(e)
|
|
|
|
|
this.lookyue = e
|
|
|
|
|
},
|
2023-11-08 16:38:22 +08:00
|
|
|
|
gettongji(){
|
|
|
|
|
let data = {
|
2023-11-08 17:01:44 +08:00
|
|
|
|
pageNum:this.tongji.pageNum,
|
|
|
|
|
pageSize:this.tongji.pageSize,
|
2023-11-08 16:38:22 +08:00
|
|
|
|
status:this.tongji.status,
|
|
|
|
|
mobile:this.tongji.mobile,
|
|
|
|
|
id:this.tongji.id
|
|
|
|
|
}
|
|
|
|
|
getcountList(data).then(res=>{
|
|
|
|
|
if(res.code == 200){
|
|
|
|
|
this.gridData = res.data.records
|
2023-11-08 17:01:44 +08:00
|
|
|
|
this.tongji.total = res.data.total
|
2023-11-08 16:38:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
2023-11-08 14:58:40 +08:00
|
|
|
|
qrcodelook(url) {
|
|
|
|
|
this.loadingdialog = true
|
|
|
|
|
this.centerDialogVisible = true
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.creatQrCode(url)
|
|
|
|
|
this.loadingdialog = false
|
|
|
|
|
}, 1000);
|
|
|
|
|
},
|
|
|
|
|
creatQrCode(url) {
|
|
|
|
|
document.getElementById("qrCode").innerHTML = ""
|
|
|
|
|
new QRCode(this.$refs.qrCodeUrl, {
|
|
|
|
|
text: url, // 二维码的内容
|
|
|
|
|
width: 300,
|
|
|
|
|
height: 300,
|
|
|
|
|
colorDark: '#000',
|
|
|
|
|
colorLight: '#fff',
|
|
|
|
|
correctLevel: QRCode.CorrectLevel.H
|
|
|
|
|
})
|
|
|
|
|
},
|
2023-11-08 09:33:11 +08:00
|
|
|
|
/** 查询优惠券列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
listFavorable(this.queryParams).then(response => {
|
2023-11-08 14:58:40 +08:00
|
|
|
|
this.favorableList = response.data.records;
|
|
|
|
|
this.total = response.data.total;
|
2023-11-08 09:33:11 +08:00
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
2024-03-06 16:25:10 +08:00
|
|
|
|
handleDelete1(data){
|
2024-03-08 15:15:34 +08:00
|
|
|
|
|
|
|
|
|
this.$modal.confirm('确定删除此条优惠券信息?').then(function() {
|
|
|
|
|
return delFavorable(data.id);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
this.getList();
|
|
|
|
|
}).catch(() => {});
|
2024-03-06 16:25:10 +08:00
|
|
|
|
},
|
2023-11-08 09:33:11 +08:00
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
id: null,
|
|
|
|
|
chainStorId: null,
|
|
|
|
|
storeId: null,
|
2023-11-09 10:29:49 +08:00
|
|
|
|
isonline: 0,
|
2023-11-08 09:33:11 +08:00
|
|
|
|
name: null,
|
2023-11-20 11:23:38 +08:00
|
|
|
|
type: "0",
|
|
|
|
|
discountType: "0",
|
2023-11-08 14:58:40 +08:00
|
|
|
|
oilType: [],
|
2023-11-08 09:33:11 +08:00
|
|
|
|
fullDeduction: null,
|
|
|
|
|
discountAmount: null,
|
|
|
|
|
satisfiedAmount: null,
|
|
|
|
|
specialDiscount: null,
|
|
|
|
|
discountOffset: null,
|
|
|
|
|
validity: null,
|
|
|
|
|
effectiveDate: null,
|
|
|
|
|
effectiveTime: null,
|
2023-11-08 14:58:40 +08:00
|
|
|
|
availablePeriod: [],
|
2023-11-08 09:33:11 +08:00
|
|
|
|
checkDateType: null,
|
2023-11-11 10:57:49 +08:00
|
|
|
|
checkTime: [],
|
2023-11-08 09:33:11 +08:00
|
|
|
|
checkOutTime: null,
|
2024-04-09 09:23:11 +08:00
|
|
|
|
exclusiveFunctionList:[],
|
2023-11-08 09:33:11 +08:00
|
|
|
|
exclusiveFunction: null,
|
|
|
|
|
claimRule: null,
|
|
|
|
|
count: null,
|
|
|
|
|
qrCodeLink: null,
|
|
|
|
|
status: null,
|
|
|
|
|
createBy: null,
|
|
|
|
|
createTime: null,
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
2024-07-15 15:05:28 +08:00
|
|
|
|
this.queryParams = {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
chainStorId: null,
|
|
|
|
|
storeId: null,
|
|
|
|
|
isonline: null,
|
|
|
|
|
name: null,
|
|
|
|
|
type: null,
|
|
|
|
|
discountType: null,
|
|
|
|
|
oilType: null,
|
|
|
|
|
fullDeduction: null,
|
|
|
|
|
discountAmount: null,
|
|
|
|
|
satisfiedAmount: null,
|
|
|
|
|
specialDiscount: null,
|
|
|
|
|
discountOffset: null,
|
|
|
|
|
validity: null,
|
|
|
|
|
effectiveDate: null,
|
|
|
|
|
effectiveTime: null,
|
|
|
|
|
availablePeriod: null,
|
|
|
|
|
checkDateType: null,
|
|
|
|
|
checkTime: [],
|
|
|
|
|
checkOutTime: null,
|
|
|
|
|
exclusiveFunctionList: [],
|
|
|
|
|
exclusiveFunction: null,
|
|
|
|
|
claimRule: null,
|
|
|
|
|
count: null,
|
|
|
|
|
qrCodeLink: null,
|
|
|
|
|
status: null,
|
|
|
|
|
effectiveDateType:'0'
|
|
|
|
|
}
|
2023-11-08 09:33:11 +08:00
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
|
|
this.single = selection.length!==1
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleAdd() {
|
|
|
|
|
this.reset();
|
2024-03-11 11:43:55 +08:00
|
|
|
|
listUserGrade().then(res=>{
|
|
|
|
|
this.vipname = res.data.records
|
|
|
|
|
})
|
2023-11-08 09:33:11 +08:00
|
|
|
|
this.open = true;
|
2024-03-14 10:46:35 +08:00
|
|
|
|
this.form.status = '0'
|
2024-03-14 19:55:35 +08:00
|
|
|
|
this.title = "添加电子优惠券";
|
2023-11-08 09:33:11 +08:00
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.reset();
|
2024-03-11 11:43:55 +08:00
|
|
|
|
listUserGrade().then(res=>{
|
|
|
|
|
this.vipname = res.data.records
|
|
|
|
|
})
|
2023-11-11 10:57:49 +08:00
|
|
|
|
getcardFavorable(row.id).then(res=>{
|
|
|
|
|
console.log(res)
|
|
|
|
|
if(res.code == 200){
|
|
|
|
|
this.form = res.data;
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "修改优惠券";
|
|
|
|
|
}
|
2023-11-08 14:58:40 +08:00
|
|
|
|
|
2023-11-11 10:57:49 +08:00
|
|
|
|
})
|
2023-11-08 09:33:11 +08:00
|
|
|
|
},
|
2023-11-08 16:38:22 +08:00
|
|
|
|
tableciick(row){
|
|
|
|
|
this.table = true
|
|
|
|
|
this.tongji.id = row.id
|
|
|
|
|
getcount(row.id).then(res =>{
|
|
|
|
|
this.fourdata = res.data
|
|
|
|
|
})
|
2023-11-08 17:01:44 +08:00
|
|
|
|
let data = {
|
|
|
|
|
pageNum:this.tongji.pageNum,
|
|
|
|
|
pageSize:this.tongji.pageSize,
|
|
|
|
|
id:row.id
|
|
|
|
|
}
|
|
|
|
|
getcountList(data).then(res=>{
|
2023-11-08 16:38:22 +08:00
|
|
|
|
this.gridData = res.data.records
|
2023-11-08 17:01:44 +08:00
|
|
|
|
this.tongji.total = res.data.total
|
2023-11-08 16:38:22 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
2024-03-06 16:25:10 +08:00
|
|
|
|
async ordai(row){
|
2023-11-11 10:57:49 +08:00
|
|
|
|
// 获取详情
|
2024-03-08 15:15:34 +08:00
|
|
|
|
// await getcardFavorable(row.id).then(res=>{
|
|
|
|
|
// console.log(res)
|
|
|
|
|
// if(res.code == 200){
|
|
|
|
|
// this.form = res.data;
|
|
|
|
|
// this.form.isonline = 1
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
this.$modal.confirm('确定下线此条优惠券信息?').then(function() {
|
|
|
|
|
return updateFavorable({id:row.id,isonline:1});
|
|
|
|
|
}).then(() => {
|
|
|
|
|
console.log(111)
|
2023-11-11 10:57:49 +08:00
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
2024-03-08 15:15:34 +08:00
|
|
|
|
}).catch(() => {console.log(222)});
|
|
|
|
|
// 执行修改
|
|
|
|
|
// await updateFavorable(this.form).then(response => {
|
|
|
|
|
// this.$modal.msgSuccess("修改成功");
|
|
|
|
|
// this.open = false;
|
|
|
|
|
// this.getList();
|
|
|
|
|
// });
|
2023-11-11 10:57:49 +08:00
|
|
|
|
|
|
|
|
|
|
2023-11-08 16:38:22 +08:00
|
|
|
|
},
|
2023-11-08 09:33:11 +08:00
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.id != null) {
|
|
|
|
|
updateFavorable(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
addFavorable(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
|
this.$modal.confirm('是否确认删除优惠券编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
|
return delFavorable(ids);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download('business/marketingActivity/favorable/export', {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, `favorable_${new Date().getTime()}.xlsx`)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
2024-07-12 15:10:46 +08:00
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
2023-11-08 16:38:22 +08:00
|
|
|
|
.hui-box{
|
|
|
|
|
width: 150px ;
|
|
|
|
|
height: 80px;
|
|
|
|
|
background: #f9f9f9;
|
|
|
|
|
margin: 0px 10px;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
padding: 15px;
|
|
|
|
|
}
|
|
|
|
|
.sizewit{
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
margin: 5px 0px;
|
|
|
|
|
}
|
2023-11-20 11:23:38 +08:00
|
|
|
|
.h-box{
|
|
|
|
|
|
|
|
|
|
height: 60px;
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
2024-01-19 14:28:32 +08:00
|
|
|
|
._k{
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
width: 300px;
|
|
|
|
|
}
|
2023-11-08 16:38:22 +08:00
|
|
|
|
</style>
|
|
|
|
|
|