add: 优化
This commit is contained in:
parent
205aeb1320
commit
312fd8d1bc
|
|
@ -2,95 +2,103 @@ import request from "@/utils/request";
|
|||
const baseURL = "account/admin/shopInfo";
|
||||
|
||||
const ShopApi = {
|
||||
/** 获取店铺列表*/
|
||||
getList(params: PageQuery) {
|
||||
return request<any, ShopInfoEditDTO[]>({
|
||||
url: `${baseURL}`,
|
||||
method: "get",
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
getBranchList(params: PageQuery) {
|
||||
return request<any, ShopInfoEditDTO[]>({
|
||||
url: `${baseURL}/branchList`,
|
||||
method: "get",
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
getBranchChange(id: PageQuery) {
|
||||
return request<any, ShopInfoEditDTO[]>({
|
||||
url: `${baseURL}/change/${id}`,
|
||||
method: "post",
|
||||
});
|
||||
},
|
||||
add(data: ShopInfoEditDTO) {
|
||||
return request<any, ShopInfoEditDTO>({
|
||||
url: `${baseURL}`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
},
|
||||
edit(data: ShopInfoEditDTO) {
|
||||
return request<any, ShopInfoEditDTO>({
|
||||
url: `${baseURL}`,
|
||||
method: "put",
|
||||
data,
|
||||
});
|
||||
},
|
||||
get(params: getRequest) {
|
||||
return request<any, ShopInfo>({
|
||||
url: `${baseURL}/detail`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
},
|
||||
delete(params: any) {
|
||||
return request({
|
||||
url: `${baseURL}`,
|
||||
method: "delete",
|
||||
params,
|
||||
});
|
||||
},
|
||||
/** 获取店铺列表*/
|
||||
getList(params : PageQuery) {
|
||||
return request<any, ShopInfoEditDTO[]>({
|
||||
url: `${baseURL}`,
|
||||
method: "get",
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
/** 获取店铺分店列表*/
|
||||
getOtherShopList(params : PageQuery) {
|
||||
return request<any, ShopInfoEditDTO[]>({
|
||||
url: `${baseURL}/otherShop`,
|
||||
method: "get",
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
getBranchList(params : PageQuery) {
|
||||
return request<any, ShopInfoEditDTO[]>({
|
||||
url: `${baseURL}/branchList`,
|
||||
method: "get",
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
getBranchChange(id : PageQuery) {
|
||||
return request<any, ShopInfoEditDTO[]>({
|
||||
url: `${baseURL}/change/${id}`,
|
||||
method: "post",
|
||||
});
|
||||
},
|
||||
add(data : ShopInfoEditDTO) {
|
||||
return request<any, ShopInfoEditDTO>({
|
||||
url: `${baseURL}`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
},
|
||||
edit(data : ShopInfoEditDTO) {
|
||||
return request<any, ShopInfoEditDTO>({
|
||||
url: `${baseURL}`,
|
||||
method: "put",
|
||||
data,
|
||||
});
|
||||
},
|
||||
get(params : getRequest) {
|
||||
return request<any, ShopInfo>({
|
||||
url: `${baseURL}/detail`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
},
|
||||
delete(params : any) {
|
||||
return request({
|
||||
url: `${baseURL}`,
|
||||
method: "delete",
|
||||
params,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default ShopApi;
|
||||
export interface getRequest {
|
||||
/**
|
||||
* 店铺id,可不传,不传递则为获取当前用户店铺
|
||||
*/
|
||||
id?: string | number;
|
||||
[property: string]: any;
|
||||
/**
|
||||
* 店铺id,可不传,不传递则为获取当前用户店铺
|
||||
*/
|
||||
id ?: string | number;
|
||||
[property : string] : any;
|
||||
}
|
||||
|
||||
/**
|
||||
* ShopInfoEditDTO
|
||||
*/
|
||||
export interface ShopInfoEditDTO {
|
||||
accountName?: null | string;
|
||||
accountPwd?: null | string;
|
||||
activateCode?: null | string;
|
||||
address?: null | string;
|
||||
chainName?: null | string;
|
||||
detail?: null | string;
|
||||
frontImg?: null | string;
|
||||
id: number | null;
|
||||
lat?: null | string;
|
||||
lng?: null | string;
|
||||
logo?: null | string;
|
||||
phone?: null | string;
|
||||
profiles?: null | string;
|
||||
roleId?: number | null;
|
||||
shopName?: null | string;
|
||||
shopType?: null | string;
|
||||
[property: string]: any;
|
||||
accountName ?: null | string;
|
||||
accountPwd ?: null | string;
|
||||
activateCode ?: null | string;
|
||||
address ?: null | string;
|
||||
chainName ?: null | string;
|
||||
detail ?: null | string;
|
||||
frontImg ?: null | string;
|
||||
id : number | null;
|
||||
lat ?: null | string;
|
||||
lng ?: null | string;
|
||||
logo ?: null | string;
|
||||
phone ?: null | string;
|
||||
profiles ?: null | string;
|
||||
roleId ?: number | null;
|
||||
shopName ?: null | string;
|
||||
shopType ?: null | string;
|
||||
[property : string] : any;
|
||||
}
|
||||
|
||||
export interface PageQuery {
|
||||
page: number;
|
||||
shopName?: string;
|
||||
size: number;
|
||||
status?: number;
|
||||
[property: string]: any;
|
||||
page : number;
|
||||
shopName ?: string;
|
||||
size : number;
|
||||
status ?: number;
|
||||
[property : string] : any;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -98,196 +106,196 @@ export interface PageQuery {
|
|||
* ShopInfo
|
||||
*/
|
||||
export interface ShopInfo {
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
address?: null | string;
|
||||
/**
|
||||
* 项目分类
|
||||
*/
|
||||
article?: null | string;
|
||||
/**
|
||||
* 背景图
|
||||
*/
|
||||
backImg?: null | string;
|
||||
/**
|
||||
* 开票系统账号
|
||||
*/
|
||||
bindAccount?: null | string;
|
||||
/**
|
||||
* 台桌预订短信
|
||||
*/
|
||||
bookingSms?: null | string;
|
||||
/**
|
||||
* 营业时间(周结束)
|
||||
*/
|
||||
businessEndDay?: null | string;
|
||||
/**
|
||||
* 营业时间(周开始)
|
||||
*/
|
||||
businessStartDay?: null | string;
|
||||
/**
|
||||
* 营业时间
|
||||
*/
|
||||
businessTime?: null | string;
|
||||
/**
|
||||
* 连锁店扩展店名
|
||||
*/
|
||||
chainName?: null | string;
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
cities?: null | string;
|
||||
/**
|
||||
* 积分群体 all-所有 vip-仅针对会员
|
||||
*/
|
||||
consumeColony?: null | string;
|
||||
/**
|
||||
* 联系人姓名
|
||||
*/
|
||||
contactName?: null | string;
|
||||
/**
|
||||
* 封面图
|
||||
*/
|
||||
coverImg?: null | string;
|
||||
createTime?: null | string;
|
||||
/**
|
||||
* 店铺简介
|
||||
*/
|
||||
detail?: null | string;
|
||||
/**
|
||||
* 区/县
|
||||
*/
|
||||
districts?: null | string;
|
||||
/**
|
||||
* 就餐模式 堂食 dine-in 外带 take-out
|
||||
*/
|
||||
eatModel?: null | string;
|
||||
/**
|
||||
* 到期时间
|
||||
*/
|
||||
expireTime?: null | string;
|
||||
/**
|
||||
* 门头照
|
||||
*/
|
||||
frontImg?: null | string;
|
||||
/**
|
||||
* 使用系统用户 sys_user id
|
||||
*/
|
||||
id?: number | null;
|
||||
/**
|
||||
* 是否开启会员余额支付
|
||||
*/
|
||||
isAccountPay?: number | null;
|
||||
/**
|
||||
* 是否允许会员自定义金额 1 允许 0 不允许
|
||||
*/
|
||||
isCustomAmount?: number | null;
|
||||
/**
|
||||
* 是否开启会员充值密码 1 启用 0 禁用
|
||||
*/
|
||||
isMemberInPwd?: number | null;
|
||||
/**
|
||||
* 是否启用会员价 0否1是
|
||||
*/
|
||||
isMemberPrice?: number | null;
|
||||
/**
|
||||
* 是否开启会员退款密码 1 启用 0 禁用
|
||||
*/
|
||||
isMemberReturnPwd?: number | null;
|
||||
/**
|
||||
* 是否开启退款密码 1 启用 0 禁用
|
||||
*/
|
||||
isReturnPwd?: number | null;
|
||||
/**
|
||||
* 是否免除桌位费 0否1是
|
||||
*/
|
||||
isTableFee?: number | null;
|
||||
/**
|
||||
* 经纬度
|
||||
*/
|
||||
lat?: null | string;
|
||||
/**
|
||||
* 经纬度
|
||||
*/
|
||||
lng?: null | string;
|
||||
/**
|
||||
* 店铺logo
|
||||
*/
|
||||
logo?: null | string;
|
||||
/**
|
||||
* 主店id
|
||||
*/
|
||||
mainId?: number | null;
|
||||
/**
|
||||
* 0停业 1,正常营业 2,网上售卖
|
||||
*/
|
||||
onSale?: number | null;
|
||||
/**
|
||||
* 操作密码
|
||||
*/
|
||||
operationPwd?: null | string;
|
||||
/**
|
||||
* 店铺收款码
|
||||
*/
|
||||
paymentQrcode?: null | string;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone?: null | string;
|
||||
/**
|
||||
* trial试用版,release正式
|
||||
*/
|
||||
profiles?: null | string;
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
provinces?: null | string;
|
||||
registerType?: null | string;
|
||||
/**
|
||||
* 数电发票类型
|
||||
*/
|
||||
sdType?: null | string;
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
shopName?: null | string;
|
||||
/**
|
||||
* 商家二维码
|
||||
*/
|
||||
shopQrcode?: null | string;
|
||||
/**
|
||||
* 店铺类型 单店--only 连锁店--chain--加盟店join (对应原来 type)
|
||||
*/
|
||||
shopType?: null | string;
|
||||
/**
|
||||
* 小程序码(零点八零首页)
|
||||
*/
|
||||
smallQrcode?: null | string;
|
||||
/**
|
||||
* -1 平台禁用 0-过期,1正式营业,
|
||||
*/
|
||||
status?: number | null;
|
||||
/**
|
||||
* 店铺口号
|
||||
*/
|
||||
subTitle?: null | string;
|
||||
/**
|
||||
* 桌位费
|
||||
*/
|
||||
tableFee?: number | null;
|
||||
/**
|
||||
* 商家标签
|
||||
*/
|
||||
tag?: null | string;
|
||||
/**
|
||||
* 税率
|
||||
*/
|
||||
taxAmount?: null | string;
|
||||
/**
|
||||
* 管理 0否 1是, 1 为直接管理 可切换店铺 0 不可以切换
|
||||
*/
|
||||
tubeType?: number | null;
|
||||
updateTime?: null | string;
|
||||
[property: string]: any;
|
||||
}
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
address ?: null | string;
|
||||
/**
|
||||
* 项目分类
|
||||
*/
|
||||
article ?: null | string;
|
||||
/**
|
||||
* 背景图
|
||||
*/
|
||||
backImg ?: null | string;
|
||||
/**
|
||||
* 开票系统账号
|
||||
*/
|
||||
bindAccount ?: null | string;
|
||||
/**
|
||||
* 台桌预订短信
|
||||
*/
|
||||
bookingSms ?: null | string;
|
||||
/**
|
||||
* 营业时间(周结束)
|
||||
*/
|
||||
businessEndDay ?: null | string;
|
||||
/**
|
||||
* 营业时间(周开始)
|
||||
*/
|
||||
businessStartDay ?: null | string;
|
||||
/**
|
||||
* 营业时间
|
||||
*/
|
||||
businessTime ?: null | string;
|
||||
/**
|
||||
* 连锁店扩展店名
|
||||
*/
|
||||
chainName ?: null | string;
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
cities ?: null | string;
|
||||
/**
|
||||
* 积分群体 all-所有 vip-仅针对会员
|
||||
*/
|
||||
consumeColony ?: null | string;
|
||||
/**
|
||||
* 联系人姓名
|
||||
*/
|
||||
contactName ?: null | string;
|
||||
/**
|
||||
* 封面图
|
||||
*/
|
||||
coverImg ?: null | string;
|
||||
createTime ?: null | string;
|
||||
/**
|
||||
* 店铺简介
|
||||
*/
|
||||
detail ?: null | string;
|
||||
/**
|
||||
* 区/县
|
||||
*/
|
||||
districts ?: null | string;
|
||||
/**
|
||||
* 就餐模式 堂食 dine-in 外带 take-out
|
||||
*/
|
||||
eatModel ?: null | string;
|
||||
/**
|
||||
* 到期时间
|
||||
*/
|
||||
expireTime ?: null | string;
|
||||
/**
|
||||
* 门头照
|
||||
*/
|
||||
frontImg ?: null | string;
|
||||
/**
|
||||
* 使用系统用户 sys_user id
|
||||
*/
|
||||
id ?: number | null;
|
||||
/**
|
||||
* 是否开启会员余额支付
|
||||
*/
|
||||
isAccountPay ?: number | null;
|
||||
/**
|
||||
* 是否允许会员自定义金额 1 允许 0 不允许
|
||||
*/
|
||||
isCustomAmount ?: number | null;
|
||||
/**
|
||||
* 是否开启会员充值密码 1 启用 0 禁用
|
||||
*/
|
||||
isMemberInPwd ?: number | null;
|
||||
/**
|
||||
* 是否启用会员价 0否1是
|
||||
*/
|
||||
isMemberPrice ?: number | null;
|
||||
/**
|
||||
* 是否开启会员退款密码 1 启用 0 禁用
|
||||
*/
|
||||
isMemberReturnPwd ?: number | null;
|
||||
/**
|
||||
* 是否开启退款密码 1 启用 0 禁用
|
||||
*/
|
||||
isReturnPwd ?: number | null;
|
||||
/**
|
||||
* 是否免除桌位费 0否1是
|
||||
*/
|
||||
isTableFee ?: number | null;
|
||||
/**
|
||||
* 经纬度
|
||||
*/
|
||||
lat ?: null | string;
|
||||
/**
|
||||
* 经纬度
|
||||
*/
|
||||
lng ?: null | string;
|
||||
/**
|
||||
* 店铺logo
|
||||
*/
|
||||
logo ?: null | string;
|
||||
/**
|
||||
* 主店id
|
||||
*/
|
||||
mainId ?: number | null;
|
||||
/**
|
||||
* 0停业 1,正常营业 2,网上售卖
|
||||
*/
|
||||
onSale ?: number | null;
|
||||
/**
|
||||
* 操作密码
|
||||
*/
|
||||
operationPwd ?: null | string;
|
||||
/**
|
||||
* 店铺收款码
|
||||
*/
|
||||
paymentQrcode ?: null | string;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone ?: null | string;
|
||||
/**
|
||||
* trial试用版,release正式
|
||||
*/
|
||||
profiles ?: null | string;
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
provinces ?: null | string;
|
||||
registerType ?: null | string;
|
||||
/**
|
||||
* 数电发票类型
|
||||
*/
|
||||
sdType ?: null | string;
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
shopName ?: null | string;
|
||||
/**
|
||||
* 商家二维码
|
||||
*/
|
||||
shopQrcode ?: null | string;
|
||||
/**
|
||||
* 店铺类型 单店--only 连锁店--chain--加盟店join (对应原来 type)
|
||||
*/
|
||||
shopType ?: null | string;
|
||||
/**
|
||||
* 小程序码(零点八零首页)
|
||||
*/
|
||||
smallQrcode ?: null | string;
|
||||
/**
|
||||
* -1 平台禁用 0-过期,1正式营业,
|
||||
*/
|
||||
status ?: number | null;
|
||||
/**
|
||||
* 店铺口号
|
||||
*/
|
||||
subTitle ?: null | string;
|
||||
/**
|
||||
* 桌位费
|
||||
*/
|
||||
tableFee ?: number | null;
|
||||
/**
|
||||
* 商家标签
|
||||
*/
|
||||
tag ?: null | string;
|
||||
/**
|
||||
* 税率
|
||||
*/
|
||||
taxAmount ?: null | string;
|
||||
/**
|
||||
* 管理 0否 1是, 1 为直接管理 可切换店铺 0 不可以切换
|
||||
*/
|
||||
tubeType ?: number | null;
|
||||
updateTime ?: null | string;
|
||||
[property : string] : any;
|
||||
}
|
||||
|
|
@ -2,37 +2,44 @@ import request from "@/utils/request";
|
|||
import { Market_BaseUrl } from "@/api/config";
|
||||
const baseURL = Market_BaseUrl + "/admin/coupon";
|
||||
const API = {
|
||||
getList(params: any) {
|
||||
return request<any>({
|
||||
url: `${baseURL}/page`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
},
|
||||
//优惠券列表/已领取详情
|
||||
getDetail(params: any) {
|
||||
return request<any>({
|
||||
url: `${baseURL}/record`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
},
|
||||
// 删除用户优惠券
|
||||
delete(params: any) {
|
||||
return request({
|
||||
url: `${baseURL}/deleteRecord`,
|
||||
method: "delete",
|
||||
params,
|
||||
});
|
||||
},
|
||||
//优惠券发放
|
||||
giveCoupon(data: any) {
|
||||
return request<any>({
|
||||
url: `${baseURL}/grant`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
},
|
||||
getList(params : any) {
|
||||
return request<any>({
|
||||
url: `${baseURL}/page`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
},
|
||||
//优惠券列表/已领取详情
|
||||
getDetail(params : any) {
|
||||
return request<any>({
|
||||
url: `${baseURL}/record`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
},
|
||||
// 删除用户优惠券
|
||||
delete(params : any) {
|
||||
return request({
|
||||
url: `${baseURL}/deleteRecord`,
|
||||
method: "delete",
|
||||
params,
|
||||
});
|
||||
},
|
||||
//优惠券发放
|
||||
giveCoupon(data : any) {
|
||||
return request<any>({
|
||||
url: `${baseURL}/grant`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
},
|
||||
//优惠券发放
|
||||
getRecordByUser(params : any) {
|
||||
return request<any>({
|
||||
url: `${baseURL}/getRecordByUser`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
},
|
||||
}
|
||||
export default API;
|
||||
|
||||
export default API;
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<div class="gyq_container">
|
||||
<div class="gyq_content">
|
||||
<HeaderCard
|
||||
name="智慧充值"
|
||||
intro="允许客户充值并使用余额支付"
|
||||
|
|
@ -294,9 +294,9 @@ onMounted(async () => {
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
.gyq_container {
|
||||
padding: 14px;
|
||||
.content {
|
||||
.gyq_content {
|
||||
padding: 14px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,326 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<el-input
|
||||
v-model="state.query.name"
|
||||
clearable
|
||||
placeholder="请输入店铺名称"
|
||||
style="width: 100%"
|
||||
class="filter-item"
|
||||
@keyup.enter="getTableData"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-input
|
||||
v-model="state.query.account"
|
||||
clearable
|
||||
placeholder="请输入商户号"
|
||||
style="width: 100%"
|
||||
class="filter-item"
|
||||
@keyup.enter="getTableData"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-select
|
||||
v-model="state.query.status"
|
||||
placeholder="请选择店铺状态"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in state.status"
|
||||
:key="item.type"
|
||||
:label="item.label"
|
||||
:value="item.type"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-button type="primary" icon="plus" @click="addShopShow">添加店铺</el-button>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
||||
<el-table-column label="店铺信息" width="200">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
<el-image
|
||||
:src="scope.row.logo"
|
||||
style="
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 4px;
|
||||
background-color: #efefef;
|
||||
"
|
||||
>
|
||||
<template #error>
|
||||
<div class="img_error">
|
||||
<i class="icon el-icon-document-delete" />
|
||||
</div>
|
||||
</template>
|
||||
</el-image>
|
||||
<div class="info">
|
||||
<span>{{ scope.row.shopName }}</span>
|
||||
<div class="tag_wrap">
|
||||
<el-tag
|
||||
v-if="scope.row.profiles == 'no'"
|
||||
type="info"
|
||||
effect="dark"
|
||||
>
|
||||
未激活
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-if="scope.row.profiles == 'probation'"
|
||||
type="warning"
|
||||
effect="dark"
|
||||
>
|
||||
试用
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-if="scope.row.profiles == 'release'"
|
||||
type="success"
|
||||
effect="dark"
|
||||
>
|
||||
正式
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-if="scope.row.isWxMaIndependent"
|
||||
type="primary"
|
||||
effect="dark"
|
||||
>
|
||||
独立小程序
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="registerType" label="经营模式">
|
||||
<template v-slot="scope">
|
||||
<span v-if="scope.row.registerType == 'before'">快餐版</span>
|
||||
<span v-if="scope.row.registerType == 'after'">餐饮版</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="商户号" />
|
||||
<el-table-column prop="status" label="店铺类型" align="center">
|
||||
<template v-slot="scope">
|
||||
<div>
|
||||
<span v-if="scope.row.shopType == 'only'">单店</span>
|
||||
<span v-if="scope.row.shopType == 'chain'">连锁店</span>
|
||||
<span v-if="scope.row.shopType == 'join'">加盟店</span>
|
||||
<div v-if="scope.row.shopType != 'only' && scope.row.isHeadShop == 0">
|
||||
(主店:{{ scope.row.headShopName }})
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="店铺状态">
|
||||
<template v-slot="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
disabled
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createdAt" label="到期时间">
|
||||
<template v-slot="scope">
|
||||
<span v-if="scope.row.expireTime">
|
||||
{{ dayjs(scope.row.expireTime).format("YYYY-MM-DD HH:mm:ss") }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-link @click="addShopShow(scope.row)">
|
||||
<el-icon>
|
||||
<Edit />
|
||||
</el-icon>
|
||||
编辑
|
||||
</el-link>
|
||||
<el-link @click="activateCodeShow(scope.row)">
|
||||
<el-icon>
|
||||
<Edit />
|
||||
</el-icon>
|
||||
激活
|
||||
</el-link>
|
||||
<el-dropdown @command="dropdownClick($event, scope.row)">
|
||||
<el-link>
|
||||
更多
|
||||
<el-icon>
|
||||
<ArrowDown />
|
||||
</el-icon>
|
||||
</el-link>
|
||||
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item v-if="scope.row.isHeadShop == 1" :command="0">
|
||||
添加分店
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{ row: scope.row, command: 1 }">
|
||||
三方配置
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="2">续费记录</el-dropdown-item>
|
||||
<el-dropdown-item :command="3">前往店铺</el-dropdown-item>
|
||||
<el-dropdown-item :command="4">重置密码</el-dropdown-item>
|
||||
<el-dropdown-item divided :command="5">删除</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination
|
||||
v-model:current-page="state.tableData.page"
|
||||
v-model:page-size="state.tableData.size"
|
||||
:total="state.tableData.total"
|
||||
:page-sizes="[10, 20, 30, 50, 100]"
|
||||
layout="total, sizes , prev, pager ,next, jumper "
|
||||
@current-change="paginationChange"
|
||||
/>
|
||||
</div>
|
||||
<addShop ref="refAddShop" @success="getTableData" />
|
||||
<detailModal ref="refDetailModal" />
|
||||
<!-- 激活码 -->
|
||||
<activateCode ref="refActivateCode" @success="getTableData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import activateCode from "./components/activateCode.vue";
|
||||
import dayjs from "dayjs";
|
||||
import ShopApi from "@/api/account/shop";
|
||||
import { ElNotification, ElMessageBox } from "element-plus";
|
||||
import addShop from "./components/addShop.vue";
|
||||
import detailModal from "./components/detailModal.vue";
|
||||
const refActivateCode = ref(null);
|
||||
function activateCodeShow(row) {
|
||||
refActivateCode.value.open(row);
|
||||
}
|
||||
const refAddShop = ref(null);
|
||||
function addShopShow(row) {
|
||||
refAddShop.value.show(row);
|
||||
}
|
||||
const state = reactive({
|
||||
query: {
|
||||
name: "",
|
||||
account: "",
|
||||
status: "",
|
||||
},
|
||||
status: [
|
||||
{
|
||||
type: 1,
|
||||
label: "开启",
|
||||
},
|
||||
{
|
||||
type: 0,
|
||||
label: "关闭",
|
||||
},
|
||||
],
|
||||
tableData: {
|
||||
list: [],
|
||||
page: 1,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0,
|
||||
},
|
||||
});
|
||||
onMounted(() => {
|
||||
getTableData();
|
||||
});
|
||||
|
||||
const refDetailModal = ref(null);
|
||||
function dropdownClick(e, row) {
|
||||
console.log(e);
|
||||
console.log(row);
|
||||
if (e == 0) {
|
||||
refAddShop.value.show(
|
||||
{ mainId: row.id, shopType: row.shopType, isHeadShop: 0 },
|
||||
"addBranch"
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
if (e.command == 1) {
|
||||
refDetailModal.value.show(e.row);
|
||||
return;
|
||||
}
|
||||
if (e == 5) {
|
||||
ElMessageBox.confirm("是否确认删除该店铺?", "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(async () => {
|
||||
const res = await ShopApi.delete({ id: row.id });
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
});
|
||||
getTableData();
|
||||
})
|
||||
.catch(() => {});
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 重置查询
|
||||
function resetHandle() {
|
||||
state.query.name = "";
|
||||
state.query.account = "";
|
||||
state.query.status = "";
|
||||
getTableData();
|
||||
}
|
||||
// 分页回调
|
||||
function paginationChange(e) {
|
||||
state.tableData.page = e;
|
||||
getTableData();
|
||||
}
|
||||
// 获取商家列表
|
||||
async function getTableData() {
|
||||
state.tableData.loading = true;
|
||||
try {
|
||||
const res = await ShopApi.getOtherShopList({
|
||||
page: state.tableData.page,
|
||||
size: state.tableData.size,
|
||||
shopName: state.query.name,
|
||||
account: state.query.account,
|
||||
status: state.query.status,
|
||||
});
|
||||
state.tableData.loading = false;
|
||||
state.tableData.list = res.records;
|
||||
state.tableData.total = res.totalRow * 1;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.head-container {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-link {
|
||||
min-height: 23px;
|
||||
margin: 0 5px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,74 +1,74 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog title="优惠券" v-model="visible" width="80%">
|
||||
<el-form :inline="true" :model="form">
|
||||
<el-form-item label="券名称">
|
||||
<el-input v-model="form.name" placeholder="请输入券名称"></el-input>
|
||||
</el-form-item>
|
||||
<div>
|
||||
<el-dialog title="优惠券" v-model="visible" width="80%">
|
||||
<el-form :inline="true" :model="form">
|
||||
<el-form-item label="券名称">
|
||||
<el-input v-model="form.name" placeholder="请输入券名称"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="form.status" placeholder="请选择" style="width: 140px">
|
||||
<el-option
|
||||
v-for="item in status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="领取时间">
|
||||
<el-date-picker
|
||||
v-model="form.date"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch">搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="form.status" placeholder="请选择" style="width: 140px">
|
||||
<el-option
|
||||
v-for="item in status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="领取时间">
|
||||
<el-date-picker
|
||||
v-model="form.date"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch">搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
style="width: 100%"
|
||||
:data="tableData"
|
||||
:columns="columns"
|
||||
:pagination="pagination"
|
||||
:row-key="getRowKey"
|
||||
>
|
||||
<el-table-column prop="id" label="券ID" />
|
||||
<el-table-column prop="name" label="券名称" />
|
||||
<!-- <el-table-column prop="type" label="券类型" /> -->
|
||||
<el-table-column prop="createTime" label="领取时间" />
|
||||
<el-table-column prop="useTime" label="使用时间" />
|
||||
<el-table-column prop="source" label="领取来源" />
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<el-link :underline="false" type="primary" size="mini">查看</el-link>
|
||||
<el-link
|
||||
:underline="false"
|
||||
type="danger"
|
||||
class="ml-4"
|
||||
@click="deleteCoupon(scope.row)"
|
||||
size="mini"
|
||||
>
|
||||
删除
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-model:current-page="pagination.page"
|
||||
v-model:page-size="pagination.size"
|
||||
:total="pagination.total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="getList"
|
||||
@size-change="getList"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<el-table
|
||||
style="width: 100%"
|
||||
:data="tableData"
|
||||
:columns="columns"
|
||||
:pagination="pagination"
|
||||
:row-key="getRowKey"
|
||||
>
|
||||
<el-table-column prop="id" label="券ID" />
|
||||
<el-table-column prop="name" label="券名称" />
|
||||
<!-- <el-table-column prop="type" label="券类型" /> -->
|
||||
<el-table-column prop="createTime" label="领取时间" />
|
||||
<el-table-column prop="useTime" label="使用时间" />
|
||||
<el-table-column prop="source" label="领取来源" />
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<el-link :underline="false" type="primary" size="mini">查看</el-link>
|
||||
<el-link
|
||||
:underline="false"
|
||||
type="danger"
|
||||
class="ml-4"
|
||||
@click="deleteCoupon(scope.row)"
|
||||
size="mini"
|
||||
>
|
||||
删除
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-model:current-page="pagination.page"
|
||||
v-model:page-size="pagination.size"
|
||||
:total="pagination.total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="getList"
|
||||
@size-change="getList"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
|
@ -76,57 +76,57 @@ import couponApi from "@/api/market/coupon";
|
|||
|
||||
import { ref, reactive } from "vue";
|
||||
const status = [
|
||||
{ label: "全部", value: "" },
|
||||
{ label: "未使用", value: 0 },
|
||||
{ label: "已使用", value: 1 },
|
||||
{ label: "已过期", value: 2 },
|
||||
{ label: "全部", value: "" },
|
||||
{ label: "未使用", value: 0 },
|
||||
{ label: "已使用", value: 1 },
|
||||
{ label: "已过期", value: 2 },
|
||||
];
|
||||
const visible = ref(false);
|
||||
const form = reactive({
|
||||
status: 0,
|
||||
name: "",
|
||||
date: "",
|
||||
userId: "",
|
||||
page: 1,
|
||||
status: 0,
|
||||
name: "",
|
||||
date: "",
|
||||
shopUserId: "",
|
||||
page: 1,
|
||||
});
|
||||
const tableData = ref([]);
|
||||
const pagination = reactive({
|
||||
total: 0,
|
||||
size: 10,
|
||||
page: 1,
|
||||
total: 0,
|
||||
size: 10,
|
||||
page: 1,
|
||||
});
|
||||
function open(data) {
|
||||
console.log(data);
|
||||
form.userId = data.userId;
|
||||
pagination.page = 1;
|
||||
visible.value = true;
|
||||
getList();
|
||||
console.log(data);
|
||||
form.shopUserId = data.id;
|
||||
pagination.page = 1;
|
||||
visible.value = true;
|
||||
getList();
|
||||
}
|
||||
function close() {
|
||||
visible.value = false;
|
||||
visible.value = false;
|
||||
}
|
||||
function getList() {
|
||||
couponApi.getDetail({ ...form, ...pagination }).then((res) => {
|
||||
console.log(res);
|
||||
tableData.value = res.records;
|
||||
pagination.total = res.totalRow;
|
||||
});
|
||||
couponApi.getRecordByUser({ ...form, ...pagination }).then((res) => {
|
||||
console.log(res);
|
||||
tableData.value = res.records;
|
||||
pagination.total = res.totalRow;
|
||||
});
|
||||
}
|
||||
|
||||
function deleteCoupon(row) {
|
||||
couponApi
|
||||
.delete({
|
||||
id: row.id,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success("删除成功");
|
||||
getList();
|
||||
}
|
||||
});
|
||||
couponApi
|
||||
.delete({
|
||||
id: row.id,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success("删除成功");
|
||||
getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
defineExpose({
|
||||
open,
|
||||
close,
|
||||
open,
|
||||
close,
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,131 +1,137 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 列表 -->
|
||||
<!-- 搜索 -->
|
||||
<page-search
|
||||
ref="searchRef"
|
||||
:search-config="searchConfig"
|
||||
@query-click="searchQueryClick"
|
||||
@reset-click="handleResetClick"
|
||||
/>
|
||||
<div class="head-container">
|
||||
<div class="card">
|
||||
<!-- <div class="title">统计数据</div> -->
|
||||
<div class="row">
|
||||
<div class="item">
|
||||
<div class="t">用户数量</div>
|
||||
<div class="n">{{ summary.userTotal || 0 }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="t">用户总余额</div>
|
||||
<div class="n">{{ summary.balanceTotal || 0 }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="t">充值金额</div>
|
||||
<div class="n">{{ summary.chargeTotal || 0 }}</div>
|
||||
</div>
|
||||
<div class="item u-flex u-col-center">
|
||||
<el-button type="success" @click="toCharge()">充值记录</el-button>
|
||||
<!-- <el-button type="danger" @click="toCharge('cost')">消费记录</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<page-content
|
||||
ref="contentRef"
|
||||
:content-config="contentConfig"
|
||||
@add-click="handleAddClick"
|
||||
@edit-click="handleEditClick"
|
||||
@export-click="handleExportClick"
|
||||
@search-click="handleSearchClick"
|
||||
@toolbar-click="handleToolbarClick"
|
||||
@operat-click="handleOperatClick"
|
||||
@filter-change="handleFilterChange"
|
||||
>
|
||||
<template #status="scope">
|
||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #options="scope">
|
||||
{{ returnOptionsLabel(scope.prop, scope.row[scope.prop]) }}
|
||||
</template>
|
||||
<template #bol="scope">
|
||||
{{ scope.row[scope.prop] ? "是" : "否" }}
|
||||
</template>
|
||||
<template #gender="scope">
|
||||
<el-tag
|
||||
:type="
|
||||
scope.row[scope.prop] == null
|
||||
? 'info'
|
||||
: scope.row[scope.prop] == 1
|
||||
? 'success'
|
||||
: 'warning'
|
||||
"
|
||||
>
|
||||
{{ scope.row[scope.prop] === null ? "未知" : scope.row[scope.prop] == 1 ? "男" : "女" }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #user="scope">
|
||||
<div class="flex align-center">
|
||||
<el-avatar :src="scope.row.headImg" />
|
||||
<span class="u-line-1 u-m-l-6" style="max-width: 90px">
|
||||
{{ scope.row.nickName }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #link="scope">
|
||||
<el-link>{{ scope.row[scope.prop] }}</el-link>
|
||||
</template>
|
||||
<template #mobile="scope">
|
||||
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||
<copy-button
|
||||
v-if="scope.row[scope.prop]"
|
||||
:text="scope.row[scope.prop]"
|
||||
style="margin-left: 2px"
|
||||
/>
|
||||
</template>
|
||||
<div class="app-container">
|
||||
<!-- 列表 -->
|
||||
<!-- 搜索 -->
|
||||
<page-search
|
||||
ref="searchRef"
|
||||
:search-config="searchConfig"
|
||||
@query-click="searchQueryClick"
|
||||
@reset-click="handleResetClick"
|
||||
/>
|
||||
<div class="head-container">
|
||||
<div class="card">
|
||||
<!-- <div class="title">统计数据</div> -->
|
||||
<div class="row">
|
||||
<div class="item">
|
||||
<div class="t">用户数量</div>
|
||||
<div class="n">{{ summary.userTotal || 0 }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="t">用户总余额</div>
|
||||
<div class="n">{{ summary.balanceTotal || 0 }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="t">充值金额</div>
|
||||
<div class="n">{{ summary.chargeTotal || 0 }}</div>
|
||||
</div>
|
||||
<div class="item u-flex u-col-center">
|
||||
<el-button type="success" @click="toCharge()">充值记录</el-button>
|
||||
<!-- <el-button type="danger" @click="toCharge('cost')">消费记录</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<page-content
|
||||
ref="contentRef"
|
||||
:content-config="contentConfig"
|
||||
@add-click="handleAddClick"
|
||||
@edit-click="handleEditClick"
|
||||
@export-click="handleExportClick"
|
||||
@search-click="handleSearchClick"
|
||||
@toolbar-click="handleToolbarClick"
|
||||
@operat-click="handleOperatClick"
|
||||
@filter-change="handleFilterChange"
|
||||
>
|
||||
<template #status="scope">
|
||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #options="scope">
|
||||
{{ returnOptionsLabel(scope.prop, scope.row[scope.prop]) }}
|
||||
</template>
|
||||
<template #bol="scope">
|
||||
{{ scope.row[scope.prop] ? "是" : "否" }}
|
||||
</template>
|
||||
<template #gender="scope">
|
||||
<el-tag
|
||||
:type="
|
||||
scope.row[scope.prop] == null
|
||||
? 'info'
|
||||
: scope.row[scope.prop] == 1
|
||||
? 'success'
|
||||
: 'warning'
|
||||
"
|
||||
>
|
||||
{{
|
||||
scope.row[scope.prop] === null
|
||||
? "未知"
|
||||
: scope.row[scope.prop] == 1
|
||||
? "男"
|
||||
: "女"
|
||||
}}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #user="scope">
|
||||
<div class="flex align-center">
|
||||
<el-avatar :src="scope.row.headImg" />
|
||||
<span class="u-line-1 u-m-l-6" style="max-width: 90px">
|
||||
{{ scope.row.nickName }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #link="scope">
|
||||
<el-link>{{ scope.row[scope.prop] }}</el-link>
|
||||
</template>
|
||||
<template #mobile="scope">
|
||||
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||
<copy-button
|
||||
v-if="scope.row[scope.prop]"
|
||||
:text="scope.row[scope.prop]"
|
||||
style="margin-left: 2px"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template #coupon="scope">
|
||||
<div>
|
||||
1张
|
||||
<el-link :underline="false" type="primary" @click="handleViewCoupon(scope.row)">
|
||||
查看详情
|
||||
</el-link>
|
||||
</div>
|
||||
</template>
|
||||
</page-content>
|
||||
<template #coupon="scope">
|
||||
<div>
|
||||
{{ scope.row.couponNum }}张
|
||||
<el-link :underline="false" type="primary" @click="handleViewCoupon(scope.row)">
|
||||
查看详情
|
||||
</el-link>
|
||||
</div>
|
||||
</template>
|
||||
</page-content>
|
||||
|
||||
<!-- 新增 -->
|
||||
<page-modal
|
||||
ref="addModalRef"
|
||||
:modal-config="addModalConfig"
|
||||
@submit-click="handleSubmitClick"
|
||||
></page-modal>
|
||||
<!-- 新增 -->
|
||||
<page-modal
|
||||
ref="addModalRef"
|
||||
:modal-config="addModalConfig"
|
||||
@submit-click="handleSubmitClick"
|
||||
></page-modal>
|
||||
|
||||
<!-- 编辑 -->
|
||||
<page-modal
|
||||
ref="editModalRef"
|
||||
:modal-config="editModalConfig"
|
||||
@submit-click="handleSubmitClick"
|
||||
></page-modal>
|
||||
<!-- 用户余额修改 -->
|
||||
<page-modal
|
||||
ref="editMoneyModalRef"
|
||||
:modal-config="editMoneyModalConfig"
|
||||
@formDataChange="formDataChange"
|
||||
@submit-click="handleSubmitClick"
|
||||
></page-modal>
|
||||
<!-- 编辑 -->
|
||||
<page-modal
|
||||
ref="editModalRef"
|
||||
:modal-config="editModalConfig"
|
||||
@submit-click="handleSubmitClick"
|
||||
></page-modal>
|
||||
<!-- 用户余额修改 -->
|
||||
<page-modal
|
||||
ref="editMoneyModalRef"
|
||||
:modal-config="editMoneyModalConfig"
|
||||
@formDataChange="formDataChange"
|
||||
@submit-click="handleSubmitClick"
|
||||
></page-modal>
|
||||
|
||||
<!-- 用户优惠券详情 -->
|
||||
<UserCouponDialog ref="userCouponDialogRef"></UserCouponDialog>
|
||||
<!-- 赠送券 -->
|
||||
<GiveCoupon ref="GiveCouponRef"></GiveCoupon>
|
||||
</div>
|
||||
<!-- 用户优惠券详情 -->
|
||||
<UserCouponDialog ref="userCouponDialogRef"></UserCouponDialog>
|
||||
<!-- 赠送券 -->
|
||||
<GiveCoupon ref="GiveCouponRef"></GiveCoupon>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup >
|
||||
<script setup>
|
||||
import UserCouponDialog from "./components/user-coupon-dialog.vue";
|
||||
import GiveCoupon from "./components/give-coupon.vue";
|
||||
import usePage from "@/components/CURD/usePage";
|
||||
|
|
@ -141,143 +147,146 @@ const userCouponDialogRef = ref(null);
|
|||
const GiveCouponRef = ref(null);
|
||||
//查看用户优惠券
|
||||
function handleViewCoupon(row) {
|
||||
userCouponDialogRef.value.open(row);
|
||||
userCouponDialogRef.value.open(row);
|
||||
}
|
||||
const {
|
||||
searchRef,
|
||||
contentRef,
|
||||
addModalRef,
|
||||
editModalRef,
|
||||
handleQueryClick,
|
||||
handleResetClick,
|
||||
// handleAddClick,
|
||||
// handleEditClick,
|
||||
handleSubmitClick,
|
||||
handleExportClick,
|
||||
handleSearchClick,
|
||||
handleFilterChange,
|
||||
searchRef,
|
||||
contentRef,
|
||||
addModalRef,
|
||||
editModalRef,
|
||||
handleQueryClick,
|
||||
handleResetClick,
|
||||
// handleAddClick,
|
||||
// handleEditClick,
|
||||
handleSubmitClick,
|
||||
handleExportClick,
|
||||
handleSearchClick,
|
||||
handleFilterChange,
|
||||
} = usePage();
|
||||
|
||||
function searchQueryClick(e) {
|
||||
handleQueryClick(e);
|
||||
// 获取统计数据
|
||||
getSummary();
|
||||
handleQueryClick(e);
|
||||
// 获取统计数据
|
||||
getSummary();
|
||||
}
|
||||
const summary = reactive({
|
||||
userTotal: 0,
|
||||
chargeTotal: 0,
|
||||
balanceTotal: 0.0,
|
||||
userTotal: 0,
|
||||
chargeTotal: 0,
|
||||
balanceTotal: 0.0,
|
||||
});
|
||||
|
||||
const router = useRouter();
|
||||
// 跳转页面
|
||||
function toCharge(params) {
|
||||
console.log(params);
|
||||
router.push({ path: "/user/charge-list", query: { ...params } });
|
||||
console.log(params);
|
||||
router.push({ path: "/user/charge-list", query: { ...params } });
|
||||
}
|
||||
async function getSummary(e) {
|
||||
// 获取统计数据
|
||||
const res = await shopUserApi.getSummary(e);
|
||||
console.log(res);
|
||||
Object.assign(summary, res);
|
||||
// 获取统计数据
|
||||
const res = await shopUserApi.getSummary(e);
|
||||
console.log(res);
|
||||
Object.assign(summary, res);
|
||||
}
|
||||
// 修改金额表单类型
|
||||
function formDataChange(type, val) {
|
||||
if (type == "type") {
|
||||
if (val == 1) {
|
||||
editMoneyModalConfig.formItems[4].options = addOptions;
|
||||
} else {
|
||||
editMoneyModalConfig.formItems[4].options = reduceOptions;
|
||||
}
|
||||
}
|
||||
if (type == "type") {
|
||||
if (val == 1) {
|
||||
editMoneyModalConfig.formItems[4].options = addOptions;
|
||||
} else {
|
||||
editMoneyModalConfig.formItems[4].options = reduceOptions;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 新增
|
||||
async function handleAddClick() {
|
||||
addModalRef.value?.setModalVisible();
|
||||
// 加载部门下拉数据源
|
||||
// addModalConfig.formItems[2]!.attrs!.data = await DeptAPI.getOptions();
|
||||
// 加载角色下拉数据源
|
||||
// addModalConfig.formItems[4]!.options = await RoleAPI.getOptions();
|
||||
addModalRef.value?.setModalVisible();
|
||||
// 加载部门下拉数据源
|
||||
// addModalConfig.formItems[2]!.attrs!.data = await DeptAPI.getOptions();
|
||||
// 加载角色下拉数据源
|
||||
// addModalConfig.formItems[4]!.options = await RoleAPI.getOptions();
|
||||
}
|
||||
// 编辑
|
||||
async function handleEditClick(row) {
|
||||
editModalRef.value?.handleDisabled(false);
|
||||
editModalRef.value?.setModalVisible();
|
||||
// 根据id获取数据进行填充
|
||||
// const data = await VersionApi.getFormData(row.id);
|
||||
editModalRef.value?.setFormData({ ...row, headImg: row.headImg ? [row.headImg] : "" });
|
||||
editModalRef.value?.handleDisabled(false);
|
||||
editModalRef.value?.setModalVisible();
|
||||
// 根据id获取数据进行填充
|
||||
// const data = await VersionApi.getFormData(row.id);
|
||||
editModalRef.value?.setFormData({ ...row, headImg: row.headImg ? [row.headImg] : "" });
|
||||
}
|
||||
|
||||
// 其他工具栏
|
||||
function handleToolbarClick(name) {
|
||||
console.log(name);
|
||||
if (name === "custom1") {
|
||||
ElMessage.success("点击了自定义1按钮");
|
||||
}
|
||||
console.log(name);
|
||||
if (name === "custom1") {
|
||||
ElMessage.success("点击了自定义1按钮");
|
||||
}
|
||||
}
|
||||
|
||||
// 赠送券
|
||||
function toGiveCoupon() {}
|
||||
// 其他操作列
|
||||
async function handleOperatClick(data) {
|
||||
const row = data.row;
|
||||
if (data.name == "more") {
|
||||
if (data.command === "change-money") {
|
||||
editMoneyModalRef.value.setModalVisible();
|
||||
editMoneyModalRef.value.setFormData({ ...row, headImg: row.headImg ? [row.headImg] : "" });
|
||||
return;
|
||||
}
|
||||
if (data.command === "charge-list") {
|
||||
console.log(data);
|
||||
toCharge({ userId: data.row.userId });
|
||||
return;
|
||||
}
|
||||
if (data.command === "give-coupon") {
|
||||
GiveCouponRef.value.open(row);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
const row = data.row;
|
||||
if (data.name == "more") {
|
||||
if (data.command === "change-money") {
|
||||
editMoneyModalRef.value.setModalVisible();
|
||||
editMoneyModalRef.value.setFormData({
|
||||
...row,
|
||||
headImg: row.headImg ? [row.headImg] : "",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (data.command === "charge-list") {
|
||||
console.log(data);
|
||||
toCharge({ userId: data.row.userId });
|
||||
return;
|
||||
}
|
||||
if (data.command === "give-coupon") {
|
||||
GiveCouponRef.value.open(row);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getSummary(searchRef.value.getQueryParams());
|
||||
getSummary(searchRef.value.getQueryParams());
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.align-center {
|
||||
align-items: center;
|
||||
align-items: center;
|
||||
}
|
||||
.card {
|
||||
background-color: #f5f5f5;
|
||||
padding: 0 14px;
|
||||
background-color: #f5f5f5;
|
||||
padding: 0 14px;
|
||||
|
||||
.title {
|
||||
font-size: 22px;
|
||||
padding-top: 14px;
|
||||
}
|
||||
.title {
|
||||
font-size: 22px;
|
||||
padding-top: 14px;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
padding: 20px 0;
|
||||
.row {
|
||||
display: flex;
|
||||
padding: 20px 0;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
.item {
|
||||
flex: 1;
|
||||
|
||||
.t {
|
||||
text-align: center;
|
||||
color: #555;
|
||||
}
|
||||
.t {
|
||||
text-align: center;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.n {
|
||||
color: #000;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
padding-top: 6px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
.n {
|
||||
color: #000;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
padding-top: 6px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue