Merge branch 'gyq' of https://newgitea.sxczgkj.cn/czg_team/cashier-web into ymf
This commit is contained in:
commit
b5635f70ae
|
|
@ -136,10 +136,20 @@ export function shopRecharge(data) {
|
|||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 智慧充值 配置信息获取
|
||||
export function shopRechargeGet() {
|
||||
return request({
|
||||
url: `${Market_BaseUrl + "/admin/shopRecharge"}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取店铺用户列表
|
||||
export function getShopUserList(params) {
|
||||
return request({
|
||||
url: `${Account_BaseUrl + "/admin/shopUser/getPage"}`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
|
@ -109,15 +109,15 @@
|
|||
@input="discountRateInput"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用门槛" prop="discountAmount">
|
||||
<el-form-item label="使用门槛" prop="fullAmount2">
|
||||
<div class="center">
|
||||
<el-input
|
||||
v-model="form.discountAmount"
|
||||
v-model="form.fullAmount"
|
||||
placeholder="请输入使用门槛"
|
||||
style="width: 200px"
|
||||
style="width: 300px"
|
||||
input-style="text-align: center;"
|
||||
:maxlength="8"
|
||||
@input="(e) => (form.discountAmount = filterNumberInput(e))"
|
||||
@input="(e) => (form.fullAmount = filterNumberInput(e))"
|
||||
>
|
||||
<template #prepend>满</template>
|
||||
<template #append>可用</template>
|
||||
|
|
@ -167,7 +167,11 @@
|
|||
</div>
|
||||
<div v-if="form.couponType == 6"></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 label="仅本店可用" value="only"></el-radio>
|
||||
<el-radio label="全部门店" value="all"></el-radio>
|
||||
|
|
@ -445,7 +449,10 @@
|
|||
</el-form>
|
||||
</div>
|
||||
<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 type="primary" :loading="loading" @click="submitHandle">确 定</el-button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,25 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog title="已领取详情" v-model="dialogVisible" width="80%">
|
||||
<el-dialog title="已领取详情" v-model="dialogVisible" width="80%" top="5vh">
|
||||
<div>
|
||||
<el-form :model="querForm" inline>
|
||||
<el-form-item label="搜索">
|
||||
<el-input
|
||||
v-model="querForm.search"
|
||||
<el-select
|
||||
v-model="querForm.userId"
|
||||
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 label="状态">
|
||||
<el-select
|
||||
|
|
@ -31,16 +43,25 @@
|
|||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@clear="querForm.time = []"
|
||||
@change="datePickerChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="0">
|
||||
<el-button type="primary" @click="searchHandle">搜索</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div>
|
||||
<el-table :data="tableData.list" border stripe v-loading="tableData.loading">
|
||||
<el-table-column label="用户ID" prop="id" width="80"></el-table-column>
|
||||
<el-table
|
||||
: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">
|
||||
<template #default="scope">
|
||||
<div class="user_info">
|
||||
|
|
@ -49,12 +70,17 @@
|
|||
</div>
|
||||
</template>
|
||||
</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="source"></el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template #default="scope">
|
||||
<el-text
|
||||
<el-tag
|
||||
disable-transitions
|
||||
:type="
|
||||
statusList.find((item) => item.value == scope.row.status).type
|
||||
"
|
||||
|
|
@ -62,19 +88,28 @@
|
|||
{{
|
||||
statusList.find((item) => item.value == scope.row.status).label
|
||||
}}
|
||||
</el-text>
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<el-popconfirm
|
||||
title="确认要失效吗?"
|
||||
@confirm="deleteHandle(scope.row)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="danger" link>失效</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
<template v-if="scope.row.status == 0">
|
||||
<el-popconfirm
|
||||
title="确认要失效吗?"
|
||||
@confirm="deleteHandle(scope.row)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="danger" link icon="EditPen">
|
||||
失效
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button type="danger" link icon="EditPen" disabled>
|
||||
失效
|
||||
</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -96,8 +131,9 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import _ from "lodash";
|
||||
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 row = ref(null);
|
||||
|
|
@ -106,12 +142,12 @@ const statusList = ref([
|
|||
{
|
||||
value: 0,
|
||||
label: "未使用",
|
||||
type: "warning",
|
||||
type: "success",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: "已使用",
|
||||
type: "success",
|
||||
type: "info",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
|
|
@ -120,12 +156,32 @@ const statusList = ref([
|
|||
},
|
||||
]);
|
||||
|
||||
const loading = ref(false);
|
||||
const options = ref([]);
|
||||
const querForm = reactive({
|
||||
search: "",
|
||||
status: "",
|
||||
userId: "",
|
||||
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() {
|
||||
tableData.page = 1;
|
||||
|
|
@ -133,29 +189,23 @@ function searchHandle() {
|
|||
couponRecordAjax();
|
||||
}
|
||||
|
||||
// 重置
|
||||
function resetHandle() {
|
||||
querForm.userId = "";
|
||||
querForm.status = "";
|
||||
querForm.time = [];
|
||||
options.value = [];
|
||||
tableData.page = 1;
|
||||
tableData.pageSize = 10;
|
||||
couponRecordAjax();
|
||||
}
|
||||
|
||||
const tableData = reactive({
|
||||
loading: false,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
list: [
|
||||
// {
|
||||
// id: 1,
|
||||
// shopId: 122,
|
||||
// shopUserId: 1,
|
||||
// userId: 1,
|
||||
// name: "满10减2/商品卷",
|
||||
// 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: "张三",
|
||||
// },
|
||||
],
|
||||
list: [],
|
||||
});
|
||||
|
||||
// 分页大小发生变化
|
||||
|
|
@ -170,14 +220,21 @@ function handleCurrentChange(e) {
|
|||
couponRecordAjax();
|
||||
}
|
||||
|
||||
function datePickerChange(e) {
|
||||
if (!e) {
|
||||
querForm.time = [];
|
||||
}
|
||||
}
|
||||
|
||||
// 已领取详情
|
||||
async function couponRecordAjax() {
|
||||
try {
|
||||
tableData.loading = true;
|
||||
const res = await couponRecord({
|
||||
search: querForm.search,
|
||||
page: tableData.page,
|
||||
size: tableData.pageSize,
|
||||
status: querForm.status,
|
||||
userId: "",
|
||||
userId: querForm.userId,
|
||||
id: "",
|
||||
shopId: row.value.shopId,
|
||||
couponId: row.value.id,
|
||||
|
|
@ -185,6 +242,8 @@ async function couponRecordAjax() {
|
|||
startTime: querForm.time[0] || "",
|
||||
endTime: querForm.time[1] || "",
|
||||
});
|
||||
tableData.total = res.totalRow;
|
||||
tableData.list = res.records;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
|
@ -192,7 +251,7 @@ async function couponRecordAjax() {
|
|||
}
|
||||
|
||||
// 删除用户优惠券
|
||||
async function delHandle(e) {
|
||||
async function deleteHandle(e) {
|
||||
try {
|
||||
tableData.loading = true;
|
||||
await deleteRecord({ id: e.id });
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<div class="row">
|
||||
<el-table :data="tableData.list" border stripe v-loading="tableData.loading">
|
||||
<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">
|
||||
<template #default="scope">
|
||||
满{{ scope.row.fullAmount }}元减{{ scope.row.discountAmount }}元
|
||||
|
|
|
|||
|
|
@ -11,12 +11,12 @@
|
|||
<div class="row">
|
||||
<el-table :data="tableData.list" border stripe v-loading="tableData.loading">
|
||||
<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">
|
||||
<template #default="scope">{{ scope.row.discountRate }}%</template>
|
||||
</el-table-column>
|
||||
<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
|
||||
prop="maxDiscountAmount"
|
||||
|
|
|
|||
Loading…
Reference in New Issue