add: 优化
This commit is contained in:
parent
a82f116918
commit
d3636be742
|
|
@ -8,13 +8,13 @@ VITE_APP_BASE_API=/dev-api
|
|||
|
||||
# VITE_APP_API_URL=https://tapi.cashier.sxczgkj.cn/ # 测试
|
||||
# VITE_APP_API_URL=https://cashier.sxczgkj.com/ # 正式
|
||||
VITE_APP_API_URL=http://192.168.0.71/ # 本地
|
||||
VITE_APP_API_URL=http://192.168.1.42/ # 本地
|
||||
|
||||
|
||||
# WebSocket 端点(不配置则关闭),线上 ws://api.youlai.tech/ws ,本地 ws://localhost:8989/ws
|
||||
# VITE_APP_WS_ENDPOINT=wss://sockets.sxczgkj.com/wss
|
||||
# VITE_APP_WS_ENDPOINT=wss://czgeatws.sxczgkj.com/wss # 正式
|
||||
VITE_APP_WS_ENDPOINT=ws://192.168.0.71:2348 # 本地
|
||||
VITE_APP_WS_ENDPOINT=ws://192.168.1.42:2348 # 本地
|
||||
|
||||
|
||||
# 启用 Mock 服务
|
||||
|
|
|
|||
|
|
@ -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,6 +1,6 @@
|
|||
<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="搜索">
|
||||
|
|
@ -31,6 +31,7 @@
|
|||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@clear="querForm.time = []"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="0">
|
||||
|
|
@ -39,7 +40,13 @@
|
|||
</el-form>
|
||||
</div>
|
||||
<div>
|
||||
<el-table :data="tableData.list" border stripe v-loading="tableData.loading">
|
||||
<el-table
|
||||
:data="tableData.list"
|
||||
border
|
||||
stripe
|
||||
v-loading="tableData.loading"
|
||||
height="64vh"
|
||||
>
|
||||
<el-table-column label="用户ID" prop="id" width="80"></el-table-column>
|
||||
<el-table-column label="用户名称" prop="name" width="200">
|
||||
<template #default="scope">
|
||||
|
|
@ -49,12 +56,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 +74,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>
|
||||
|
|
@ -106,12 +127,12 @@ const statusList = ref([
|
|||
{
|
||||
value: 0,
|
||||
label: "未使用",
|
||||
type: "warning",
|
||||
type: "success",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: "已使用",
|
||||
type: "success",
|
||||
type: "info",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
|
|
@ -138,24 +159,7 @@ const tableData = reactive({
|
|||
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: [],
|
||||
});
|
||||
|
||||
// 分页大小发生变化
|
||||
|
|
@ -175,6 +179,8 @@ async function couponRecordAjax() {
|
|||
try {
|
||||
tableData.loading = true;
|
||||
const res = await couponRecord({
|
||||
page: tableData.page,
|
||||
size: tableData.pageSize,
|
||||
search: querForm.search,
|
||||
status: querForm.status,
|
||||
userId: "",
|
||||
|
|
@ -185,6 +191,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 +200,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