This commit is contained in:
YeMingfei666 2025-09-28 13:26:52 +08:00
commit b5635f70ae
5 changed files with 127 additions and 51 deletions

View File

@ -136,10 +136,20 @@ export function shopRecharge(data) {
data data
}); });
} }
// 智慧充值 配置信息获取 // 智慧充值 配置信息获取
export function shopRechargeGet() { export function shopRechargeGet() {
return request({ return request({
url: `${Market_BaseUrl + "/admin/shopRecharge"}`, url: `${Market_BaseUrl + "/admin/shopRecharge"}`,
method: 'get' method: 'get'
}); });
}
// 获取店铺用户列表
export function getShopUserList(params) {
return request({
url: `${Account_BaseUrl + "/admin/shopUser/getPage"}`,
method: 'get',
params
});
} }

View File

@ -109,15 +109,15 @@
@input="discountRateInput" @input="discountRateInput"
/> />
</el-form-item> </el-form-item>
<el-form-item label="使用门槛" prop="discountAmount"> <el-form-item label="使用门槛" prop="fullAmount2">
<div class="center"> <div class="center">
<el-input <el-input
v-model="form.discountAmount" v-model="form.fullAmount"
placeholder="请输入使用门槛" placeholder="请输入使用门槛"
style="width: 200px" style="width: 300px"
input-style="text-align: center;" input-style="text-align: center;"
:maxlength="8" :maxlength="8"
@input="(e) => (form.discountAmount = filterNumberInput(e))" @input="(e) => (form.fullAmount = filterNumberInput(e))"
> >
<template #prepend></template> <template #prepend></template>
<template #append>可用</template> <template #append>可用</template>
@ -167,7 +167,11 @@
</div> </div>
<div v-if="form.couponType == 6"></div> <div v-if="form.couponType == 6"></div>
<div class="title">指定设置</div> <div class="title">指定设置</div>
<el-form-item label="选择门店" prop="useShopType" v-if="shopInfo.isHeadShop"> <el-form-item
label="选择门店"
prop="useShopType"
v-if="shopInfo.isHeadShop && shopInfo.shopType != 'only'"
>
<el-radio-group v-model="form.useShopType"> <el-radio-group v-model="form.useShopType">
<el-radio label="仅本店可用" value="only"></el-radio> <el-radio label="仅本店可用" value="only"></el-radio>
<el-radio label="全部门店" value="all"></el-radio> <el-radio label="全部门店" value="all"></el-radio>
@ -445,7 +449,10 @@
</el-form> </el-form>
</div> </div>
<template #footer> <template #footer>
<div class="dialog-footer" v-if="shopInfo.isHeadShop || !form.syncId"> <div
class="dialog-footer"
v-if="(shopInfo.isHeadShop && shopInfo.shopType != 'only') || !form.syncId"
>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" :loading="loading" @click="submitHandle"> </el-button> <el-button type="primary" :loading="loading" @click="submitHandle"> </el-button>
</div> </div>

View File

@ -1,13 +1,25 @@
<template> <template>
<div> <div>
<el-dialog title="已领取详情" v-model="dialogVisible" width="80%"> <el-dialog title="已领取详情" v-model="dialogVisible" width="80%" top="5vh">
<div> <div>
<el-form :model="querForm" inline> <el-form :model="querForm" inline>
<el-form-item label="搜索"> <el-form-item label="搜索">
<el-input <el-select
v-model="querForm.search" v-model="querForm.userId"
placeholder="用户昵称/用户ID/用户手机" placeholder="用户昵称/用户ID/用户手机"
></el-input> filterable
remote
reserve-keyword
:remote-method="remoteMethod"
:loading="loading"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.nickName"
:value="item.id"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="状态"> <el-form-item label="状态">
<el-select <el-select
@ -31,16 +43,25 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
@clear="querForm.time = []"
@change="datePickerChange"
/> />
</el-form-item> </el-form-item>
<el-form-item label-width="0"> <el-form-item label-width="0">
<el-button type="primary" @click="searchHandle">搜索</el-button> <el-button type="primary" @click="searchHandle">搜索</el-button>
<el-button @click="resetHandle">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div> <div>
<el-table :data="tableData.list" border stripe v-loading="tableData.loading"> <el-table
<el-table-column label="用户ID" prop="id" width="80"></el-table-column> :data="tableData.list"
border
stripe
v-loading="tableData.loading"
height="64vh"
>
<el-table-column label="用户ID" prop="userId" width="80"></el-table-column>
<el-table-column label="用户名称" prop="name" width="200"> <el-table-column label="用户名称" prop="name" width="200">
<template #default="scope"> <template #default="scope">
<div class="user_info"> <div class="user_info">
@ -49,12 +70,17 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="领取时间" prop="createTime"></el-table-column> <el-table-column
label="领取时间"
prop="createTime"
width="200"
></el-table-column>
<el-table-column label="使用时间" prop="useTime"></el-table-column> <el-table-column label="使用时间" prop="useTime"></el-table-column>
<el-table-column label="获得来源" prop="source"></el-table-column> <el-table-column label="获得来源" prop="source"></el-table-column>
<el-table-column label="状态" prop="status"> <el-table-column label="状态" prop="status">
<template #default="scope"> <template #default="scope">
<el-text <el-tag
disable-transitions
:type=" :type="
statusList.find((item) => item.value == scope.row.status).type statusList.find((item) => item.value == scope.row.status).type
" "
@ -62,19 +88,28 @@
{{ {{
statusList.find((item) => item.value == scope.row.status).label statusList.find((item) => item.value == scope.row.status).label
}} }}
</el-text> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template #default="scope"> <template #default="scope">
<el-popconfirm <template v-if="scope.row.status == 0">
title="确认要失效吗?" <el-popconfirm
@confirm="deleteHandle(scope.row)" title="确认要失效吗?"
> @confirm="deleteHandle(scope.row)"
<template #reference> >
<el-button type="danger" link>失效</el-button> <template #reference>
</template> <el-button type="danger" link icon="EditPen">
</el-popconfirm> 失效
</el-button>
</template>
</el-popconfirm>
</template>
<template v-else>
<el-button type="danger" link icon="EditPen" disabled>
失效
</el-button>
</template>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -96,8 +131,9 @@
</template> </template>
<script setup> <script setup>
import _ from "lodash";
import { ref, reactive } from "vue"; import { ref, reactive } from "vue";
import { couponRecord, deleteRecord } from "@/api/coupon/index.js"; import { couponRecord, deleteRecord, getShopUserList } from "@/api/coupon/index.js";
const dialogVisible = ref(false); const dialogVisible = ref(false);
const row = ref(null); const row = ref(null);
@ -106,12 +142,12 @@ const statusList = ref([
{ {
value: 0, value: 0,
label: "未使用", label: "未使用",
type: "warning", type: "success",
}, },
{ {
value: 1, value: 1,
label: "已使用", label: "已使用",
type: "success", type: "info",
}, },
{ {
value: 2, value: 2,
@ -120,12 +156,32 @@ const statusList = ref([
}, },
]); ]);
const loading = ref(false);
const options = ref([]);
const querForm = reactive({ const querForm = reactive({
search: "",
status: "", status: "",
userId: "",
time: [], time: [],
}); });
//
const remoteMethod = _.debounce(async function (query) {
try {
if (query) {
loading.value = true;
const res = await getShopUserList({
key: query,
page: 1,
size: 100,
});
options.value = res.records;
}
} catch (error) {
console.error(error);
}
loading.value = false;
}, 200);
// //
function searchHandle() { function searchHandle() {
tableData.page = 1; tableData.page = 1;
@ -133,29 +189,23 @@ function searchHandle() {
couponRecordAjax(); couponRecordAjax();
} }
//
function resetHandle() {
querForm.userId = "";
querForm.status = "";
querForm.time = [];
options.value = [];
tableData.page = 1;
tableData.pageSize = 10;
couponRecordAjax();
}
const tableData = reactive({ const tableData = reactive({
loading: false, loading: false,
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
list: [ list: [],
// {
// id: 1,
// shopId: 122,
// shopUserId: 1,
// userId: 1,
// name: "102/",
// sourceId: 1,
// sourceFlowId: 1,
// createTime: "20202020",
// useTime: "20202020",
// source: "",
// status: 0,
// headImg:
// "https://gips1.baidu.com/it/u=3920718280,2741989496&fm=3074&app=3074&f=PNG?w=2048&h=2048",
// nickName: "",
// },
],
}); });
// //
@ -170,14 +220,21 @@ function handleCurrentChange(e) {
couponRecordAjax(); couponRecordAjax();
} }
function datePickerChange(e) {
if (!e) {
querForm.time = [];
}
}
// //
async function couponRecordAjax() { async function couponRecordAjax() {
try { try {
tableData.loading = true; tableData.loading = true;
const res = await couponRecord({ const res = await couponRecord({
search: querForm.search, page: tableData.page,
size: tableData.pageSize,
status: querForm.status, status: querForm.status,
userId: "", userId: querForm.userId,
id: "", id: "",
shopId: row.value.shopId, shopId: row.value.shopId,
couponId: row.value.id, couponId: row.value.id,
@ -185,6 +242,8 @@ async function couponRecordAjax() {
startTime: querForm.time[0] || "", startTime: querForm.time[0] || "",
endTime: querForm.time[1] || "", endTime: querForm.time[1] || "",
}); });
tableData.total = res.totalRow;
tableData.list = res.records;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
@ -192,7 +251,7 @@ async function couponRecordAjax() {
} }
// //
async function delHandle(e) { async function deleteHandle(e) {
try { try {
tableData.loading = true; tableData.loading = true;
await deleteRecord({ id: e.id }); await deleteRecord({ id: e.id });

View File

@ -15,7 +15,7 @@
<div class="row"> <div class="row">
<el-table :data="tableData.list" border stripe v-loading="tableData.loading"> <el-table :data="tableData.list" border stripe v-loading="tableData.loading">
<el-table-column prop="id" label="ID" width="80" /> <el-table-column prop="id" label="ID" width="80" />
<el-table-column prop="title" label="规则名称" width="180" /> <el-table-column prop="title" label="名称" width="180" />
<el-table-column prop="fullAmount" label="使用门槛" width="180"> <el-table-column prop="fullAmount" label="使用门槛" width="180">
<template #default="scope"> <template #default="scope">
{{ scope.row.fullAmount }}元减{{ scope.row.discountAmount }} {{ scope.row.fullAmount }}元减{{ scope.row.discountAmount }}

View File

@ -11,12 +11,12 @@
<div class="row"> <div class="row">
<el-table :data="tableData.list" border stripe v-loading="tableData.loading"> <el-table :data="tableData.list" border stripe v-loading="tableData.loading">
<el-table-column prop="id" label="ID" width="80" /> <el-table-column prop="id" label="ID" width="80" />
<el-table-column prop="title" label="规则名称" width="180" /> <el-table-column prop="title" label="名称" width="180" />
<el-table-column prop="discountRate" label="折扣率" width="180"> <el-table-column prop="discountRate" label="折扣率" width="180">
<template #default="scope">{{ scope.row.discountRate }}%</template> <template #default="scope">{{ scope.row.discountRate }}%</template>
</el-table-column> </el-table-column>
<el-table-column prop="discountAmount" label="使用门槛" width="180"> <el-table-column prop="discountAmount" label="使用门槛" width="180">
<template #default="scope">{{ scope.row.discountAmount }}</template> <template #default="scope">{{ scope.row.fullAmount }}</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="maxDiscountAmount" prop="maxDiscountAmount"