|
|
@@ -1,134 +1,151 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
|
|
|
+ <div class="app-container coupon-user-page">
|
|
|
+ <el-card shadow="never" class="search-card">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="88px" size="small">
|
|
|
+ <el-form-item label="优惠券名称" prop="couponTitle">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.couponTitle"
|
|
|
+ placeholder="请输入优惠券名称"
|
|
|
+ clearable
|
|
|
+ style="width: 180px"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="优惠券类型" prop="couponType">
|
|
|
+ <el-select v-model="queryParams.couponType" placeholder="全部类型" clearable style="width: 140px">
|
|
|
+ <el-option
|
|
|
+ v-for="item in couponTypeOptions"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :label="item.dictLabel"
|
|
|
+ :value="item.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态" prop="status">
|
|
|
+ <el-select v-model="queryParams.status" placeholder="全部状态" clearable style="width: 150px">
|
|
|
+ <el-option
|
|
|
+ v-for="item in statusFilterOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="领取时间">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="dateRange"
|
|
|
+ style="width: 240px"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ />
|
|
|
+ </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-card>
|
|
|
|
|
|
- <el-form-item label="优惠券名称" prop="couponTitle">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.couponTitle"
|
|
|
- placeholder="请输入优惠券名称"
|
|
|
- clearable
|
|
|
- size="small"
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="状态" prop="status">
|
|
|
- <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small" >
|
|
|
- <el-option
|
|
|
- v-for="item in statusOptions"
|
|
|
- :key="item.dictValue"
|
|
|
- :label="item.dictLabel"
|
|
|
- :value="item.dictValue"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="领取时间">
|
|
|
- <el-date-picker v-model="dateRange" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="cyan" 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="danger"
|
|
|
- icon="el-icon-delete"
|
|
|
- size="mini"
|
|
|
- :disabled="multiple"
|
|
|
- @click="handleDelete"
|
|
|
- v-hasPermi="['company:companySmsLogs:remove']"
|
|
|
- >删除</el-button>
|
|
|
- </el-col> -->
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="warning"
|
|
|
- icon="el-icon-download"
|
|
|
- size="mini"
|
|
|
- @click="handleExport"
|
|
|
- v-hasPermi="['store:storeCouponUser:export']"
|
|
|
- >导出</el-button>
|
|
|
- </el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
- </el-row>
|
|
|
+ <el-card shadow="never" class="table-card">
|
|
|
+ <div class="toolbar">
|
|
|
+ <div class="toolbar-left">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['store:storeCouponUser:export', 'live:issue:export']"
|
|
|
+ >导出</el-button>
|
|
|
+ <span class="toolbar-tip">普通券状态为待使用/已使用;核销券为未核销/已核销</span>
|
|
|
+ </div>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
|
|
|
+ </div>
|
|
|
|
|
|
- <el-table
|
|
|
- height="500"
|
|
|
- border
|
|
|
- size="mini"
|
|
|
- v-loading="loading"
|
|
|
- :data="storeCouponUserList"
|
|
|
- >
|
|
|
- <el-table-column label="会员" min-width="120" show-overflow-tooltip>
|
|
|
- <template slot-scope="scope">
|
|
|
- <div class="cell-main">{{ scope.row.nickname || '-' }}</div>
|
|
|
- <div class="cell-sub">{{ scope.row.phone || '-' }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="优惠券" min-width="140" show-overflow-tooltip>
|
|
|
- <template slot-scope="scope">
|
|
|
- <div class="cell-main">{{ scope.row.couponTitle || '-' }}</div>
|
|
|
- <div class="cell-sub">面值 {{ scope.row.couponPrice }} / 满 {{ scope.row.useMinPrice }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="领取/有效期" min-width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div class="cell-sub">领:{{ formatTime(scope.row.createTime) }}</div>
|
|
|
- <div class="cell-sub">止:{{ formatTime(scope.row.limitTime) }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="核销信息" min-width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div class="cell-main">{{ scope.row.verifyUserName || '-' }}</div>
|
|
|
- <div class="cell-sub">{{ formatTime(scope.row.verifyTime || scope.row.useTime) }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="状态" width="80" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag size="mini" :type="statusTagType(scope.row.status)">{{ statusLabel(scope.row.status) }}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
+ <el-table
|
|
|
+ height="520"
|
|
|
+ border
|
|
|
+ size="mini"
|
|
|
+ v-loading="loading"
|
|
|
+ :data="storeCouponUserList"
|
|
|
+ class="coupon-table"
|
|
|
+ >
|
|
|
+ <el-table-column label="会员" min-width="130" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="cell-main">{{ scope.row.nickname || '-' }}</div>
|
|
|
+ <div class="cell-sub">{{ scope.row.phone || '-' }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="优惠券" min-width="160" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="cell-main">{{ scope.row.couponTitle || '-' }}</div>
|
|
|
+ <div class="cell-sub">面值 ¥{{ scope.row.couponPrice }} · 满 ¥{{ scope.row.useMinPrice }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="类型" width="100" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag size="mini" :type="couponTypeTagType(scope.row.couponType)" effect="plain">
|
|
|
+ {{ couponTypeLabel(scope.row.couponType) }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="领取 / 有效期" min-width="160">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="cell-sub">领 {{ formatTime(scope.row.createTime) }}</div>
|
|
|
+ <div class="cell-sub">止 {{ formatTime(scope.row.limitTime) }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="使用信息" min-width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <template v-if="isVerifyCouponType(scope.row.couponType)">
|
|
|
+ <div class="cell-main">{{ scope.row.verifyUserName || '-' }}</div>
|
|
|
+ <div class="cell-sub">{{ formatTime(scope.row.verifyTime || scope.row.useTime) }}</div>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <div class="cell-main cell-muted">普通券不可核销</div>
|
|
|
+ <div class="cell-sub">{{ formatTime(scope.row.useTime) !== '-' ? ('使用 ' + formatTime(scope.row.useTime)) : '-' }}</div>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="状态" width="96" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag size="mini" :type="statusTagType(scope.row.status)">
|
|
|
+ {{ rowStatusLabel(scope.row) }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </el-card>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listStoreCouponUser, getStoreCouponUser, delStoreCouponUser, addStoreCouponUser, updateStoreCouponUser, exportStoreCouponUser } from "@/api/live/liveCouponUser";
|
|
|
+import axios from "axios";
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
+import { listStoreCouponUser, exportStoreCouponUser } from "@/api/live/liveCouponUser";
|
|
|
|
|
|
export default {
|
|
|
name: "StoreCouponUser",
|
|
|
data() {
|
|
|
return {
|
|
|
- statusOptions:[],
|
|
|
- // 遮罩层
|
|
|
+ statusOptions: [],
|
|
|
+ couponTypeOptions: [],
|
|
|
loading: true,
|
|
|
- // 选中数组
|
|
|
- ids: [],
|
|
|
- dateRange:[],
|
|
|
- // 非单个禁用
|
|
|
- single: true,
|
|
|
- // 非多个禁用
|
|
|
- multiple: true,
|
|
|
- // 显示搜索条件
|
|
|
+ dateRange: [],
|
|
|
showSearch: true,
|
|
|
- // 总条数
|
|
|
total: 0,
|
|
|
- // 优惠券发放记录表格数据
|
|
|
storeCouponUserList: [],
|
|
|
- // 弹出层标题
|
|
|
- title: "",
|
|
|
- // 是否显示弹出层
|
|
|
- open: false,
|
|
|
- // 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
@@ -140,65 +157,60 @@ export default {
|
|
|
endTime: null,
|
|
|
useTime: null,
|
|
|
type: null,
|
|
|
+ couponType: null,
|
|
|
status: null,
|
|
|
isFail: null,
|
|
|
isDel: null
|
|
|
},
|
|
|
- // 表单参数
|
|
|
- form: {},
|
|
|
- // 表单校验
|
|
|
- rules: {
|
|
|
- couponId: [
|
|
|
- { required: true, message: "兑换的项目id不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- userId: [
|
|
|
- { required: true, message: "优惠券所属用户不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- couponTitle: [
|
|
|
- { required: true, message: "优惠券名称不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- couponPrice: [
|
|
|
- { required: true, message: "优惠券的面值不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- useMinPrice: [
|
|
|
- { required: true, message: "最低消费多少金额可用优惠券不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- createTime: [
|
|
|
- { required: true, message: "优惠券创建时间不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- endTime: [
|
|
|
- { required: true, message: "优惠券结束时间不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- type: [
|
|
|
- { required: true, message: "获取方式不能为空", trigger: "change" }
|
|
|
- ],
|
|
|
- status: [
|
|
|
- { required: true, message: "状态不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- isFail: [
|
|
|
- { required: true, message: "是否有效不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- }
|
|
|
+ // 筛选用中性文案(同一 status 码,展示因券类型不同)
|
|
|
+ statusFilterOptions: [
|
|
|
+ { value: "0", label: "待使用 / 未核销" },
|
|
|
+ { value: "1", label: "已使用 / 已核销" },
|
|
|
+ { value: "2", label: "已过期" }
|
|
|
+ ]
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getDicts("live_coupon_user_status").then((response) => {
|
|
|
this.statusOptions = response.data || [];
|
|
|
});
|
|
|
+ this.getDicts("store_coupon_type").then((response) => {
|
|
|
+ this.couponTypeOptions = response.data || [];
|
|
|
+ });
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
- statusLabel(status) {
|
|
|
- const hit = (this.statusOptions || []).find(item => String(item.dictValue) === String(status));
|
|
|
- if (hit) {
|
|
|
- return hit.dictLabel;
|
|
|
+ couponTypeLabel(type) {
|
|
|
+ if (type === null || type === undefined || type === "") {
|
|
|
+ return "-";
|
|
|
+ }
|
|
|
+ const hit = (this.couponTypeOptions || []).find(item => String(item.dictValue) === String(type));
|
|
|
+ return hit ? hit.dictLabel : `类型${type}`;
|
|
|
+ },
|
|
|
+ isVerifyCouponType(type) {
|
|
|
+ const label = this.couponTypeLabel(type) || "";
|
|
|
+ return label.includes("核销") || label.includes("代金券");
|
|
|
+ },
|
|
|
+ couponTypeTagType(type) {
|
|
|
+ return this.isVerifyCouponType(type) ? "warning" : "";
|
|
|
+ },
|
|
|
+ /** 按券类型展示状态:普通券=待使用/已使用;核销券=未核销/已核销 */
|
|
|
+ rowStatusLabel(row) {
|
|
|
+ const status = row == null ? null : row.status;
|
|
|
+ if (status === null || status === undefined || status === "") {
|
|
|
+ return "-";
|
|
|
}
|
|
|
- const fallback = { 0: "未核销", 1: "已核销", 2: "已过期" };
|
|
|
- return fallback[status] != null ? fallback[status] : status;
|
|
|
+ const code = Number(status);
|
|
|
+ if (this.isVerifyCouponType(row.couponType)) {
|
|
|
+ const map = { 0: "未核销", 1: "已核销", 2: "已过期" };
|
|
|
+ return map[code] != null ? map[code] : String(status);
|
|
|
+ }
|
|
|
+ const map = { 0: "待使用", 1: "已使用", 2: "已过期" };
|
|
|
+ return map[code] != null ? map[code] : String(status);
|
|
|
},
|
|
|
statusTagType(status) {
|
|
|
const map = { 0: "info", 1: "success", 2: "danger" };
|
|
|
- return map[status] || "info";
|
|
|
+ return map[Number(status)] || "info";
|
|
|
},
|
|
|
formatTime(val) {
|
|
|
if (!val) {
|
|
|
@@ -207,135 +219,120 @@ export default {
|
|
|
const text = String(val).replace("T", " ");
|
|
|
return text.length >= 16 ? text.substring(0, 16) : text;
|
|
|
},
|
|
|
- /** 查询优惠券发放记录列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
listStoreCouponUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
|
|
- this.storeCouponUserList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
+ this.storeCouponUserList = response.rows || [];
|
|
|
+ this.total = response.total || 0;
|
|
|
+ this.loading = false;
|
|
|
+ }).catch(() => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
- // 取消按钮
|
|
|
- cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
- },
|
|
|
- // 表单重置
|
|
|
- reset() {
|
|
|
- this.form = {
|
|
|
- id: null,
|
|
|
- couponId: null,
|
|
|
- userId: null,
|
|
|
- couponTitle: null,
|
|
|
- couponPrice: null,
|
|
|
- useMinPrice: null,
|
|
|
- createTime: null,
|
|
|
- updateTime: null,
|
|
|
- endTime: null,
|
|
|
- useTime: null,
|
|
|
- type: null,
|
|
|
- status: 0,
|
|
|
- isFail: null,
|
|
|
- isDel: null
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
- },
|
|
|
- /** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
- /** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
+ this.dateRange = [];
|
|
|
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();
|
|
|
- this.open = true;
|
|
|
- this.title = "添加优惠券发放记录";
|
|
|
- },
|
|
|
- /** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
- const id = row.id || this.ids
|
|
|
- getStoreCouponUser(id).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.open = true;
|
|
|
- this.title = "修改优惠券发放记录";
|
|
|
- });
|
|
|
+ handleExport() {
|
|
|
+ const queryParams = this.addDateRange({ ...this.queryParams }, this.dateRange);
|
|
|
+ this.$confirm("是否确认导出所有优惠券发放记录数据项?", "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ return exportStoreCouponUser(queryParams);
|
|
|
+ }).then(response => {
|
|
|
+ return this.downloadFileWithAuth(response.msg);
|
|
|
+ }).catch(() => {});
|
|
|
},
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- if (this.form.id != null) {
|
|
|
- updateStoreCouponUser(this.form).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- addStoreCouponUser(this.form).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ downloadFileWithAuth(fileName) {
|
|
|
+ if (!fileName) {
|
|
|
+ this.msgError("导出失败,未获取到文件名");
|
|
|
+ return Promise.reject("empty fileName");
|
|
|
+ }
|
|
|
+ return axios({
|
|
|
+ method: "get",
|
|
|
+ url: process.env.VUE_APP_BASE_API + "/common/download",
|
|
|
+ params: { fileName: fileName, delete: false },
|
|
|
+ responseType: "blob",
|
|
|
+ headers: {
|
|
|
+ Authorization: "Bearer " + getToken(),
|
|
|
+ "X-Frontend-Type": "admin"
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ const disposition = res.headers["content-disposition"] || "";
|
|
|
+ let downloadName = fileName.indexOf("_") > -1 ? fileName.substring(fileName.indexOf("_") + 1) : fileName;
|
|
|
+ const match = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(disposition);
|
|
|
+ if (match && match[1]) {
|
|
|
+ downloadName = decodeURIComponent(match[1].replace(/['"]/g, ""));
|
|
|
}
|
|
|
+ const blob = new Blob([res.data]);
|
|
|
+ const link = document.createElement("a");
|
|
|
+ link.href = window.URL.createObjectURL(blob);
|
|
|
+ link.setAttribute("download", downloadName);
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ document.body.removeChild(link);
|
|
|
+ window.URL.revokeObjectURL(link.href);
|
|
|
});
|
|
|
- },
|
|
|
- /** 删除按钮操作 */
|
|
|
- handleDelete(row) {
|
|
|
- const ids = row.id || this.ids;
|
|
|
- this.$confirm('是否确认删除优惠券发放记录编号为"' + ids + '"的数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return delStoreCouponUser(ids);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- }).catch(function() {});
|
|
|
- },
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- const queryParams = this.queryParams;
|
|
|
- this.$confirm('是否确认导出所有优惠券发放记录数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return exportStoreCouponUser(queryParams);
|
|
|
- }).then(response => {
|
|
|
- this.download(response.msg);
|
|
|
- }).catch(function() {});
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+.coupon-user-page {
|
|
|
+ padding-bottom: 12px;
|
|
|
+}
|
|
|
+.search-card {
|
|
|
+ margin-bottom: 12px;
|
|
|
+ border-radius: 8px;
|
|
|
+}
|
|
|
+.search-card >>> .el-card__body {
|
|
|
+ padding: 14px 16px 2px;
|
|
|
+}
|
|
|
+.table-card {
|
|
|
+ border-radius: 8px;
|
|
|
+}
|
|
|
+.table-card >>> .el-card__body {
|
|
|
+ padding: 12px 16px 8px;
|
|
|
+}
|
|
|
+.toolbar {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 12px;
|
|
|
+}
|
|
|
+.toolbar-left {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 12px;
|
|
|
+}
|
|
|
+.toolbar-tip {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #909399;
|
|
|
+}
|
|
|
+.coupon-table {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
.cell-main {
|
|
|
line-height: 18px;
|
|
|
color: #303133;
|
|
|
+ font-weight: 500;
|
|
|
+}
|
|
|
+.cell-muted {
|
|
|
+ color: #909399;
|
|
|
+ font-weight: 400;
|
|
|
}
|
|
|
.cell-sub {
|
|
|
line-height: 18px;
|
|
|
font-size: 12px;
|
|
|
color: #909399;
|
|
|
+ margin-top: 2px;
|
|
|
}
|
|
|
</style>
|