From 58f9b26048ee04139a809986f366e3edf98cd7cd Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期日, 28 九月 2025 09:14:04 +0800
Subject: [PATCH] 店铺绑优惠卷领取记录
---
manager/src/api/coupon-store.js | 18 ++
manager/src/views/promotions/coupon/coupon_store_receive.vue | 305 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 322 insertions(+), 1 deletions(-)
diff --git a/manager/src/api/coupon-store.js b/manager/src/api/coupon-store.js
index 9c9be5a..85bd6d6 100644
--- a/manager/src/api/coupon-store.js
+++ b/manager/src/api/coupon-store.js
@@ -1,5 +1,10 @@
import service from "../libs/axios";
-
+import {
+ getRequest,
+ postRequest,
+ putRequest,
+ deleteRequest
+} from "@/libs/axios";
export const addStoreCoupon = (params) =>{
return service({
url: "/lmk/storeCoupon",
@@ -28,3 +33,14 @@
method: "POST"
})
}
+
+export const getPageByStoreCouponClaimRecord =(params) =>{
+ return service({
+ url: `/lmk/storeCoupon/getPageByStoreCouponClaimRecord`,
+ method: "GET",
+ params: params
+ })
+}
+export const queryExportCoupon = (params) =>{
+ return getRequest("/lmk/storeCoupon/queryExportCoupon", params,'blob')
+}
diff --git a/manager/src/views/promotions/coupon/coupon_store_receive.vue b/manager/src/views/promotions/coupon/coupon_store_receive.vue
new file mode 100644
index 0000000..05d1ca6
--- /dev/null
+++ b/manager/src/views/promotions/coupon/coupon_store_receive.vue
@@ -0,0 +1,305 @@
+<template>
+ <div class="search">
+ <Card>
+ <Form
+ ref="searchForm"
+ :model="searchForm"
+ inline
+ :label-width="75"
+ class="search-form mb_10"
+ >
+ <Form-item label="浼樻儬鍒稿悕绉�" prop="couponName">
+ <Input
+ type="text"
+ v-model="searchForm.couponName"
+ placeholder="璇疯緭鍏ヤ紭鎯犲埜鍚嶇О"
+ clearable
+ style="width: 200px"
+ />
+ </Form-item>
+ <Form-item label="浼氬憳鍚嶇О" prop="memberName">
+ <Input
+ type="text"
+ v-model="searchForm.memberName"
+ placeholder="璇疯緭鍏ヤ細鍛樺悕绉�"
+ clearable
+ style="width: 200px"
+ />
+ </Form-item>
+<!-- <Form-item label="鑾峰彇鏂瑰紡" prop="getType">-->
+<!-- <Select-->
+<!-- v-model="searchForm.getType"-->
+<!-- placeholder="璇烽�夋嫨"-->
+<!-- clearable-->
+<!-- style="width: 200px"-->
+<!-- >-->
+<!-- <Option value="FREE">鍏嶈垂鑾峰彇</Option>-->
+<!-- <Option value="ACTIVITY">娲诲姩鑾峰彇</Option>-->
+<!-- </Select>-->
+<!-- </Form-item>-->
+ <Form-item label="浼樻儬鍒哥姸鎬�" prop="memberCouponStatus">
+ <Select
+ v-model="searchForm.memberCouponStatus"
+ placeholder="璇烽�夋嫨"
+ clearable
+ style="width: 200px"
+ >
+ <Option value="NEW">宸查鍙�</Option>
+ <Option value="USED">宸蹭娇鐢�</Option>
+ <Option value="EXPIRE">宸茶繃鏈�</Option>
+ <Option value="CLOSED">宸蹭綔搴�</Option>
+ </Select>
+ </Form-item>
+ <Form-item label="娲诲姩鏃堕棿">
+ <DatePicker
+ v-model="selectDate"
+ type="daterange"
+ clearable
+ placeholder="閫夋嫨璧峰鏃堕棿"
+ style="width: 200px"
+ ></DatePicker>
+ </Form-item>
+ <Button
+ @click="handleSearch"
+ type="primary"
+ icon="ios-search"
+ class="search-btn"
+ >鎼滅储</Button
+ >
+ <Button
+ @click="queryExportCoupon"
+ type="primary"
+ class="search-btn">
+ 瀵煎嚭棰嗗彇璁板綍
+ </Button>
+ </Form>
+ <Table
+ :loading="loading"
+ border
+ :columns="columns"
+ :data="data"
+ ref="table"
+ class="mt_10"
+ >
+ </Table>
+ <Row type="flex" justify="end" class="mt_10">
+ <Page
+ :current="searchForm.pageNumber"
+ :total="total"
+ :page-size="searchForm.pageSize"
+ @on-change="changePage"
+ @on-page-size-change="changePageSize"
+ :page-size-opts="[10, 20, 50]"
+ size="small"
+ show-total
+ show-elevator
+ show-sizer
+ ></Page>
+ </Row>
+ </Card>
+ </div>
+</template>
+<script>
+import { getPageByStoreCouponClaimRecord,queryExportCoupon } from "@/api/coupon-store";
+import {
+ memberPromotionsStatusRender,
+} from "@/utils/promotions";
+
+export default {
+ name: "coupon-store-recevie",
+ data() {
+ return {
+ loading: true, // 琛ㄥ崟鍔犺浇鐘舵��
+ searchForm: {
+ // 鎼滅储妗嗗垵濮嬪寲瀵硅薄
+ pageNumber: 1, // 褰撳墠椤垫暟
+ pageSize: 10, // 椤甸潰澶у皬
+ sort: "create_time", // 榛樿鎺掑簭瀛楁
+ order: "desc", // 榛樿鎺掑簭鏂瑰紡
+ getType: "", // 榛樿鎺掑簭鏂瑰紡
+ },
+
+ columns: [
+ // 琛ㄥご
+ {
+ title: "浼氬憳鍚嶇О",
+ key: "memberName",
+ minWidth: 130,
+ fixed: "left",
+ },
+ {
+ title: "浼樻儬鍒稿悕绉�",
+ key: "couponName",
+ minWidth: 100,
+ tooltip: true,
+ },
+ {
+ title: "鍙戝竷搴楅摵",
+ key: "storeName",
+ minWidth: 100,
+ render: (h, params) => {
+ return h("div", (params.row.storeName === 'platform' && "骞冲彴") || params.row.storeName);
+ },
+ },
+ {
+ title: "闈㈤/鎶樻墸",
+ key: "price",
+ width: 100,
+ render: (h, params) => {
+ if (params.row.price) {
+
+ return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
+
+ } else {
+ return h("div", params.row.discount + "鎶�");
+ }
+ },
+ },
+ {
+ title: "鑾峰彇鏂瑰紡",
+ width: 120,
+ key: "getType",
+ render: (h, params) => {
+ if (params.row.getType === "FREE") {
+ return h("Tag", { props: { color: "red" } }, "鍏嶈垂鑾峰彇");
+ } else if (params.row.getType === "ACTIVITY") {
+ return h("Tag", { props: { color: "volcano" } }, "娲诲姩鑾峰彇");
+ } else if (params.row.getType === "INSIDE") {
+ return h("Tag", { props: { color: "lime" } }, "鍐呰喘");
+ } else {
+ return h("Tag", { props: { color: "purple" } }, "鏈煡");
+ }
+ },
+ },
+ {
+ title: "浼氬憳浼樻儬鍒哥姸鎬�",
+ width: 130,
+ key: "memberCouponStatus",
+ render: (h, params) => {
+ return memberPromotionsStatusRender(
+ h,
+ params.row.memberCouponStatus
+ );
+ },
+ },
+ {
+ title: "浼樻儬鍒哥被鍨�",
+ key: "couponType",
+ width: 120,
+ render: (h, params) => {
+ if (params.row.couponType === "DISCOUNT") {
+ return h("Tag", { props: { color: "orange" } }, "鎵撴姌");
+ } else if (params.row.couponType === "PRICE") {
+ return h("Tag", { props: { color: "magenta" } }, "鍑忓厤鐜伴噾");
+ } else {
+ return h("Tag", { props: { color: "purple" } }, "鏈煡");
+ }
+ },
+ },
+ {
+ title: "鏈夋晥鏃堕棿",
+ width: 150,
+ render: (h, params) => {
+ if (
+ params?.row?.getType === "ACTIVITY" &&
+ params?.row?.rangeDayType === "DYNAMICTIME"
+ ) {
+ return h("div", "闀挎湡鏈夋晥");
+ } else if (params?.row?.startTime && params?.row?.endTime) {
+ return h("div", {
+ domProps: {
+ innerHTML:
+ params.row.startTime + "<br/>" + params.row.endTime,
+ },
+ });
+ }
+ },
+ },
+ ],
+ data: [], // 琛ㄥ崟鏁版嵁
+ total: 0, // 琛ㄥ崟鏁版嵁鎬绘暟
+ selectDate: [], //閫変腑鐨勪俊鎭�
+ };
+ },
+
+ methods: {
+ queryExportCoupon(){
+ console.log(this.selectDate.length === 0);
+
+ if(this.selectDate.length === 0){
+ this.$Message.error("蹇呴』閫夋嫨鏃堕棿鑼冨洿锛屾悳绱㈠悗杩涜瀵煎嚭锛�");
+ this.searchForm.startTime = null;
+ this.searchForm.endTime = null;
+ }else{
+ this.searchForm.startTime = this.selectDate[0].getTime();
+ this.searchForm.endTime = this.selectDate[1].getTime();
+ queryExportCoupon(this.searchForm).then(res =>{
+ const blob = new Blob([res], {
+ type: "application/vnd.ms-excel;charset=utf-8",
+ });
+ //瀵逛簬<a>鏍囩锛屽彧鏈� Firefox 鍜� Chrome锛堝唴鏍革級 鏀寔 download 灞炴��
+ //IE10浠ヤ笂鏀寔blob浣嗘槸渚濈劧涓嶆敮鎸乨ownload
+ if ("download" in document.createElement("a")) {
+ //鏀寔a鏍囩download鐨勬祻瑙堝櫒
+ const link = document.createElement("a"); //鍒涘缓a鏍囩
+ link.download = "浼樻儬鍒搁鍙栬褰�.xlsx"; //a鏍囩娣诲姞灞炴��
+ link.style.display = "none";
+ link.href = URL.createObjectURL(blob);
+ document.body.appendChild(link);
+ link.click(); //鎵ц涓嬭浇
+ URL.revokeObjectURL(link.href); //閲婃斁url
+ document.body.removeChild(link); //閲婃斁鏍囩
+ } else {
+ navigator.msSaveBlob(blob, fileName);
+ }
+ })
+ }
+
+ },
+ // 鍒濆鍖栨暟鎹�
+ init() {
+ this.getDataList();
+ },
+ changePage(v) {
+ // 鏀瑰彉椤电爜
+ this.searchForm.pageNumber = v;
+ this.getDataList();
+ },
+ changePageSize(v) {
+ // 鏀瑰彉椤垫暟
+ this.searchForm.pageNumber = 1;
+ this.searchForm.pageSize = v;
+ this.getDataList();
+ },
+ handleSearch() {
+ // 鎼滅储
+ this.searchForm.pageNumber = 1;
+ this.searchForm.pageSize = 10;
+ this.getDataList();
+ },
+ getDataList() {
+ // 鑾峰彇鏁版嵁
+ this.loading = true;
+ if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
+ this.searchForm.startTime = this.selectDate[0].getTime();
+ this.searchForm.endTime = this.selectDate[1].getTime();
+ } else {
+ this.searchForm.startTime = null;
+ this.searchForm.endTime = null;
+ }
+ getPageByStoreCouponClaimRecord(this.searchForm).then((res) => {
+ this.loading = false;
+ if (res.code === 200) {
+ console.log(res);
+ this.data = res.data;
+ this.total = res.total;
+ }
+ });
+ this.loading = false;
+ },
+ },
+ mounted() {
+ this.init();
+ },
+};
+</script>
--
Gitblit v1.8.0