250825
This commit is contained in:
+1
-2
@@ -3,9 +3,8 @@ VITE_SOCKET_URL=wss://server.gxwebsoft.com
|
||||
VITE_SERVER_URL=https://gxtyzx-server.websoft.top/api
|
||||
VITE_API_URL=https://gxtyzx-modules.websoft.top/api
|
||||
VITE_THINK_URL=https://gxtyzx-api2.websoft.top/api
|
||||
#VITE_THINK_URL=http://127.0.0.1:9099/api
|
||||
|
||||
|
||||
#VITE_SERVER_URL=http://127.0.0.1:30000/api
|
||||
#VITE_API_URL=http://127.0.0.1:9002/api
|
||||
#VITE_THINK_URL=http://127.0.0.1:9099/api
|
||||
#/booking/bookingItem
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type { Role } from '../../role/model';
|
||||
import type { Menu } from '../../menu/model';
|
||||
import { Company } from '@/api/system/company/model';
|
||||
import type { PageParam } from "@/api";
|
||||
import type { Role } from "../../role/model";
|
||||
import type { Menu } from "../../menu/model";
|
||||
import { Company } from "@/api/system/company/model";
|
||||
|
||||
/**
|
||||
* 用户
|
||||
@@ -108,6 +108,7 @@ export interface User {
|
||||
idcard?: string;
|
||||
//
|
||||
truename?: string;
|
||||
limitSite?: string;
|
||||
// 是否管理员:1是;2否
|
||||
isAdmin?: boolean;
|
||||
// 客户端ID
|
||||
@@ -118,6 +119,7 @@ export interface User {
|
||||
sortNumber?: number;
|
||||
|
||||
deleted?: number;
|
||||
isOrganizationAdmin?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -104,3 +104,13 @@ export async function getThinkCardLog(id: number) {
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function thinkCardLogExport(data: ThinkCardLog) {
|
||||
const res = await request.post<ApiResult<ThinkCardLog>>(
|
||||
THINK_API_URL + '/think/think-card-log/export', data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
@@ -88,10 +88,13 @@ export interface ThinkOrder {
|
||||
export interface ThinkOrderParam extends PageParam {
|
||||
id?: number;
|
||||
sid?: number;
|
||||
cid?: number;
|
||||
payStatus?: number;
|
||||
orderStatus?: number;
|
||||
payType?: number;
|
||||
isInvoice?: number;
|
||||
checkBill?: number;
|
||||
siteName?: string;
|
||||
keywords?: string;
|
||||
wechatOrder?: string;
|
||||
}
|
||||
|
||||
@@ -106,3 +106,13 @@ export async function getThinkRechargeLog(id: number) {
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function thinkRechargeLogRefund(data: ThinkRechargeLog) {
|
||||
const res = await request.post<ApiResult<ThinkRechargeLog>>(
|
||||
THINK_API_URL + '/think/think-recharge-log/refund', data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ export interface ThinkSite {
|
||||
tel?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
sort?: number;
|
||||
// 类型:1天,2小时
|
||||
type?: string;
|
||||
// 天数或小时
|
||||
@@ -46,6 +47,7 @@ export interface ThinkSite {
|
||||
// 周末活动订场开关:1开,0关
|
||||
weekendOpen?: number;
|
||||
dailyMaxNum?: number;
|
||||
album?: string;
|
||||
key?: number;
|
||||
value?: number;
|
||||
title?: string;
|
||||
|
||||
@@ -11,6 +11,7 @@ export interface ThinkVip {
|
||||
name?: string;
|
||||
// 会员卡价格
|
||||
price?: number;
|
||||
renewPrice?: number;
|
||||
// 会员卡介绍
|
||||
desc?: string;
|
||||
// 会员卡说明
|
||||
@@ -50,6 +51,7 @@ export interface ThinkVip {
|
||||
// 是否有效:1是,0否
|
||||
isUse?: number;
|
||||
isSale?: number;
|
||||
reportSid?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -117,3 +117,12 @@ export async function getThinkVipCardsBills(id: number) {
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
export async function thinkVipCardsBillsExport(data: ThinkVipCardsBillsParam) {
|
||||
const res = await request.post<ApiResult<ThinkVipCardsBills>>(
|
||||
THINK_API_URL + '/think/think-vip-cards-bills/export', data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
@@ -34,4 +34,6 @@ export interface ThinkVipCardsBillsParam extends PageParam {
|
||||
keywords?: string;
|
||||
dateStart?: string;
|
||||
dateEnd?: string;
|
||||
isCard?: boolean;
|
||||
isVip?: boolean;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ const search = () => {
|
||||
const [d1, d2] = dateRange.value ?? [];
|
||||
xlsFileName.value = `${d1}至${d2}`;
|
||||
where.timeStart = d1 ? dayjs(d1).valueOf() / 1000 : undefined;
|
||||
where.timeEnd = d2 ? dayjs(d2).valueOf() / 1000 : undefined;
|
||||
where.timeEnd = d2 ? dayjs(d2 + ' 23:59:59').valueOf() / 1000 : undefined;
|
||||
// where.createTimeStart = d1 ? d1 + ' 00:00:00' : undefined;
|
||||
// where.createTimeEnd = d2 ? d2 + ' 00:00:00' : undefined;
|
||||
emit("search", {
|
||||
|
||||
@@ -4,25 +4,44 @@
|
||||
:visible="visible"
|
||||
:confirm-loading="loading"
|
||||
title="订单列表"
|
||||
:body-style="{ paddingBottom: '8px', background: '#f3f3f3' }"
|
||||
:body-style="{ paddingBottom: '8px', background: '#f3f3f3',}"
|
||||
@update:visible="updateVisible"
|
||||
:maskClosable="false"
|
||||
:footer="null"
|
||||
>
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<a-radio-group v-model:value="orderType" v-if="showType" @change="changeOrderType">
|
||||
<a-radio-button value="order">订场订场</a-radio-button>
|
||||
<a-radio-button value="usersVip">会员卡购买</a-radio-button>
|
||||
</a-radio-group>
|
||||
<a-radio-group v-model:value="orderType" v-if="showCardType" @change="changeOrderType">
|
||||
<a-radio-button value="order">订场订单</a-radio-button>
|
||||
<a-radio-button value="usersCard">实体卡购买</a-radio-button>
|
||||
<a-radio-button value="usersCardCharge">实体卡续卡</a-radio-button>
|
||||
</a-radio-group>
|
||||
<ele-pro-table
|
||||
v-if="orderType === 'order'"
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
:scroll="{ x: 800 }"
|
||||
:scroll="{ x: 800, y: tableHeight}"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
height="50vh"
|
||||
>
|
||||
<template #toolbar>
|
||||
<a-input v-model:value="keywords" allow-clear @input="reload" style="width: 300px;"
|
||||
placeholder="姓名/手机号搜索"></a-input>
|
||||
<a-space>
|
||||
<span class="font-bold text-red-400">本页合计金额: {{ total }}元</span>
|
||||
<a-input v-model:value="keywords" allow-clear @input="reload" style="width: 300px;"
|
||||
placeholder="姓名/手机号搜索"></a-input>
|
||||
<a-select v-model:value="orderStatus" placeholder="订单状态刷新" style="width: 300px" @change="reload()">
|
||||
<a-select-option value="1,2,6">全部状态</a-select-option>
|
||||
<a-select-option value="1">已完成</a-select-option>
|
||||
<a-select-option value="2">未使用</a-select-option>
|
||||
<a-select-option value="6">退款成功</a-select-option>
|
||||
</a-select>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'image'">
|
||||
@@ -105,30 +124,6 @@
|
||||
<span></span>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="column.key === 'payStatus'">
|
||||
<a-tag v-if="record.payStatus == 2" color="error">
|
||||
<CloseOutlined class="tag-icon" />
|
||||
未付款
|
||||
</a-tag>
|
||||
<a-tag v-if="record.payStatus == 1" color="green">
|
||||
<CheckOutlined class="tag-icon" />
|
||||
已付款
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-if="record.payStatus == 3 || record.payStatus == 0"
|
||||
color="cyan">
|
||||
<CoffeeOutlined class="tag-icon" />
|
||||
未付款,占场中
|
||||
</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'orderInfo'">
|
||||
{{ record.orderInfoList }}
|
||||
</template>
|
||||
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'code'">
|
||||
<span v-if="record.card">{{ record.card.code }}</span>
|
||||
<span v-if="record.thinkVip">{{ record.thinkVip.code }}</span>
|
||||
@@ -139,6 +134,76 @@
|
||||
}}</span>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</ele-pro-table>
|
||||
<ele-pro-table
|
||||
v-else-if="orderType === 'usersVip'"
|
||||
ref="usersVipTableRef"
|
||||
row-key="id"
|
||||
:columns="columns1"
|
||||
:datasource="datasource1"
|
||||
:scroll="{ x: 800, y: tableHeight }"
|
||||
height="50vh"
|
||||
>
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<span class="font-bold text-red-400">本页合计金额: {{ total }}元</span>
|
||||
<a-input v-model:value="keywords" allow-clear @input="reload" style="width: 300px;"
|
||||
placeholder="姓名/手机号搜索"></a-input>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'dateTime'">
|
||||
<div>{{ record.siteName }}</div>
|
||||
<div>{{ record.dateTime }} ¥{{ record.totalPrice }}元</div>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
<ele-pro-table
|
||||
v-else-if="orderType === 'usersCard'"
|
||||
ref="cardTableRef"
|
||||
row-key="id"
|
||||
:columns="columns2"
|
||||
:datasource="datasource2"
|
||||
:scroll="{ x: 800, y: tableHeight }"
|
||||
height="50vh"
|
||||
>
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<span class="font-bold text-red-400">本页合计金额: {{ total }}元</span>
|
||||
<a-input v-model:value="keywords" allow-clear @input="reload" style="width: 300px;"
|
||||
placeholder="卡号搜索"></a-input>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'dateTime'">
|
||||
<div>{{ record.siteName }}</div>
|
||||
<div>{{ record.dateTime }} ¥{{ record.totalPrice }}元</div>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
<ele-pro-table
|
||||
v-else-if="orderType === 'usersCardCharge'"
|
||||
ref="usersCardChargeTableRef"
|
||||
row-key="id"
|
||||
:columns="columns3"
|
||||
:datasource="datasource3"
|
||||
:scroll="{ x: 800, y: tableHeight }"
|
||||
height="50vh"
|
||||
>
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<span class="font-bold text-red-400">本页合计金额: {{ total }}元</span>
|
||||
<a-input v-model:value="keywords" allow-clear @input="reload" style="width: 300px;"
|
||||
placeholder="姓名/手机号搜索"></a-input>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'dateTime'">
|
||||
<div>{{ record.siteName }}</div>
|
||||
<div>{{ record.dateTime }} ¥{{ record.totalPrice }}元</div>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</ele-modal>
|
||||
@@ -147,8 +212,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
import {
|
||||
CheckOutlined,
|
||||
CloseOutlined,
|
||||
AlipayCircleOutlined
|
||||
} from "@ant-design/icons-vue";
|
||||
import { EleProTable, toDateString } from "ele-admin-pro";
|
||||
@@ -165,13 +228,24 @@ import type {
|
||||
} from "@/api/think/thinkOrder/model";
|
||||
import { formatNumber } from "ele-admin-pro/es";
|
||||
import dayjs from "dayjs";
|
||||
import { pageThinkRechargeLog } from "@/api/think/thinkRechargeLog";
|
||||
import { ThinkRechargeLogParam } from "@/api/think/thinkRechargeLog/model";
|
||||
import { pageThinkCard } from "@/api/think/thinkCard";
|
||||
import { ThinkCardParam } from "@/api/think/thinkCard/model";
|
||||
import { ThinkCardLogParam } from "@/api/think/thinkCardLog/model";
|
||||
import { pageThinkCardLog } from "@/api/think/thinkCardLog";
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
sid: number;
|
||||
createTimeStart: number;
|
||||
createTimeEnd: number;
|
||||
showType: boolean;
|
||||
showCardType: boolean;
|
||||
createTimeStart: string;
|
||||
createTimeEnd: string;
|
||||
wechatOrder: string;
|
||||
type: number;
|
||||
isPayTime: boolean;
|
||||
payType: number[];
|
||||
}>();
|
||||
|
||||
@@ -183,6 +257,8 @@ const updateVisible = (value: boolean) => {
|
||||
emit("update:visible", value);
|
||||
};
|
||||
|
||||
const orderType = ref("order");
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
@@ -191,15 +267,21 @@ const selection = ref<ThinkOrder[]>([]);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
|
||||
const tableHeight = document.body.clientHeight;
|
||||
console.log('tableHeight', tableHeight)
|
||||
|
||||
const keywords = ref();
|
||||
const total = ref();
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
const orderStatus = ref("1,2,6");
|
||||
const datasource: DatasourceFunction = async ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
@@ -207,18 +289,30 @@ const datasource: DatasourceFunction = ({
|
||||
where.keywords = keywords.value;
|
||||
}
|
||||
where.payTypeList = props.payType.join();
|
||||
if (where.payTypeList === "1,3,5") where.wechatInPos = true;
|
||||
where.payStatus = 1;
|
||||
where.forAdmin = true;
|
||||
if (props.type === 1) where.isUseTime = true;
|
||||
where.sid = props.sid;
|
||||
where.createTimeStart = props.createTimeStart;
|
||||
where.createTimeEnd = props.createTimeEnd;
|
||||
console.log(where, props.sid)
|
||||
return pageThinkOrder({
|
||||
where.orderStatusList = orderStatus.value;
|
||||
where.wechatOrder = props.wechatOrder;
|
||||
if (props.isPayTime) {
|
||||
where.payTimeStart = dayjs(props.createTimeStart).unix();
|
||||
where.payTimeEnd = dayjs(props.createTimeEnd).unix();
|
||||
} else {
|
||||
where.createTimeStart = dayjs(props.createTimeStart).unix();
|
||||
where.createTimeEnd = dayjs(props.createTimeEnd).unix();
|
||||
}
|
||||
const res = await pageThinkOrder({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
// console.log(res)
|
||||
total.value = 0;
|
||||
if (res.list !== null && res.list.length > 0) total.value = res.list.reduce((acc, cur) => acc + cur.payPrice, 0);
|
||||
return res;
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
@@ -226,9 +320,123 @@ const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "场馆名称",
|
||||
dataIndex: "siteName",
|
||||
key: "iod",
|
||||
fixed: "left",
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: "订单号",
|
||||
fixed: "left",
|
||||
dataIndex: "orderNum",
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: "凭证号",
|
||||
fixed: "left",
|
||||
dataIndex: "wechatOrder",
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: "订单状态",
|
||||
width: 100,
|
||||
fixed: "left",
|
||||
dataIndex: "orderStatus",
|
||||
customRender: ({ text }) => ["", "已完成", "未使用", "已取消", "退款申请中", "退款被拒绝", "退款成功", "客户端申请退款"][text]
|
||||
},
|
||||
{
|
||||
title: "金额",
|
||||
dataIndex: "payPrice",
|
||||
width: 90,
|
||||
key: "payPrice",
|
||||
align: "center",
|
||||
sorter: true,
|
||||
fixed: "left",
|
||||
customRender: ({ text }) => `¥${formatNumber(text)}`
|
||||
},
|
||||
{
|
||||
title: "下单时间",
|
||||
width: 120,
|
||||
dataIndex: "createTime",
|
||||
align: "center",
|
||||
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||
},
|
||||
{
|
||||
title: "支付时间",
|
||||
dataIndex: "payTime",
|
||||
width: 120,
|
||||
align: "center",
|
||||
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||
},
|
||||
{
|
||||
title: "用场时间",
|
||||
width: 180,
|
||||
dataIndex: "dateTime",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "phone",
|
||||
key: "phone",
|
||||
width: 120,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "实际转账单位/个人",
|
||||
dataIndex: "name",
|
||||
width: 120,
|
||||
key: "name",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "支付方式",
|
||||
dataIndex: "payType",
|
||||
width: 100,
|
||||
key: "payType",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "预付卡号",
|
||||
width: 120,
|
||||
key: "code",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "预付卡到期时间",
|
||||
key: "expiredTime",
|
||||
width: 120,
|
||||
align: "center",
|
||||
sorter: true
|
||||
}
|
||||
]);
|
||||
|
||||
const changeOrderType = () => {
|
||||
if (orderType.value === "order") reload();
|
||||
else if (orderType.value === "usersVip") vipReload();
|
||||
else if (orderType.value === "usersCard") cardReload();
|
||||
else if (orderType.value === "usersCardCharge") usersCardChargeReload();
|
||||
};
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ThinkOrderParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
query();
|
||||
|
||||
const columns1 = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "卡类型",
|
||||
dataIndex: "vipName"
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "realName",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "下单时间",
|
||||
dataIndex: "createTime",
|
||||
@@ -243,71 +451,183 @@ const columns = ref<ColumnItem[]>([
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "实际转账单位/个人",
|
||||
dataIndex: "name",
|
||||
key: "name",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "价格",
|
||||
dataIndex: "totalPrice",
|
||||
title: "金额",
|
||||
dataIndex: "money",
|
||||
key: "totalPrice",
|
||||
align: "center",
|
||||
sorter: true,
|
||||
customRender: ({ text }) => `¥${formatNumber(text)}`
|
||||
},
|
||||
{
|
||||
title: "积分",
|
||||
dataIndex: "totalPrice",
|
||||
key: "totalPrice",
|
||||
title: "状态",
|
||||
dataIndex: "status",
|
||||
align: "center",
|
||||
sorter: true,
|
||||
customRender: ({ text }) => `¥${formatNumber(text)}`
|
||||
},
|
||||
{
|
||||
title: "支付方式",
|
||||
dataIndex: "payType",
|
||||
key: "payType",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "预付卡号",
|
||||
key: "code",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "预付卡到期时间",
|
||||
key: "expiredTime",
|
||||
align: "center",
|
||||
sorter: true
|
||||
customRender: ({ text }) => ["", "已支付", "待支付", "已退款"][text]
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ThinkOrderParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
const datasource1: DatasourceFunction = async ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders
|
||||
}) => {
|
||||
|
||||
if (keywords.value) {
|
||||
where.keywords = keywords.value;
|
||||
}
|
||||
where.statusList = "1,3";
|
||||
where.sid = props.sid;
|
||||
where.createTimeStart = dayjs(props.createTimeStart).unix();
|
||||
where.createTimeEnd = dayjs(props.createTimeEnd).unix();
|
||||
const res = await pageThinkRechargeLog({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
total.value = 0;
|
||||
if (res.list != null && res.list.length > 0) total.value = res.list.reduce((acc, cur) => acc + cur.money, 0);
|
||||
return res;
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
const usersVipTableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
const vipReload = (where?: ThinkRechargeLogParam) => {
|
||||
usersVipTableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ThinkOrder) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
const columns2 = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "卡类型",
|
||||
dataIndex: ["thinkVip", "name"]
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "username",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "下单时间",
|
||||
dataIndex: "createTime",
|
||||
align: "center",
|
||||
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "phone",
|
||||
key: "phone",
|
||||
width: 120,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "金额",
|
||||
dataIndex: "price",
|
||||
align: "center",
|
||||
sorter: true,
|
||||
customRender: ({ text }) => `¥${formatNumber(text)}`
|
||||
}
|
||||
]);
|
||||
|
||||
const datasource2: DatasourceFunction = async ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders
|
||||
}) => {
|
||||
console.log("here");
|
||||
if (keywords.value) {
|
||||
where.keywords = keywords.value;
|
||||
}
|
||||
where.sid = props.sid;
|
||||
where.status = 1;
|
||||
where.createTimeStart = dayjs(props.createTimeStart).unix();
|
||||
where.createTimeEnd = dayjs(props.createTimeEnd).unix();
|
||||
let payTypeList = props.payType;
|
||||
if (payTypeList.includes(1) && payTypeList.includes(3) && payTypeList.includes(5)) payTypeList = [1, 2, 4];
|
||||
if (payTypeList.length === 1 && payTypeList[0] === 4) payTypeList = [3];
|
||||
if (payTypeList.length === 1 && payTypeList[0] === 18) payTypeList = [6];
|
||||
where.payTypeList = payTypeList.join();
|
||||
where.notChangeCard = true;
|
||||
const res = await pageThinkCard({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
total.value = 0;
|
||||
if (res.list != null && res.list.length > 0) total.value = res.list.reduce((acc, cur) => acc + cur.price, 0);
|
||||
return res;
|
||||
};
|
||||
query();
|
||||
|
||||
const cardTableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
const cardReload = (where?: ThinkCardParam) => {
|
||||
cardTableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
const columns3 = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "卡类型",
|
||||
dataIndex: ["thinkCard", "name"]
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "username",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "下单时间",
|
||||
dataIndex: "createTime",
|
||||
align: "center",
|
||||
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "phone",
|
||||
key: "phone",
|
||||
width: 120,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "金额",
|
||||
dataIndex: "money",
|
||||
align: "center",
|
||||
sorter: true,
|
||||
customRender: ({ text }) => `¥${formatNumber(text)}`
|
||||
}
|
||||
]);
|
||||
|
||||
const datasource3: DatasourceFunction = async ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders
|
||||
}) => {
|
||||
if (keywords.value) {
|
||||
where.keywords = keywords.value;
|
||||
}
|
||||
where.createTimeStart = dayjs(props.createTimeStart).unix();
|
||||
where.createTimeEnd = dayjs(props.createTimeEnd).unix();
|
||||
let payTypeList = props.payType;
|
||||
if (payTypeList.includes(1) && payTypeList.includes(3) && payTypeList.includes(5)) payTypeList = [1, 2, 4];
|
||||
if (payTypeList.length === 1 && payTypeList[0] === 4) payTypeList = [3];
|
||||
if (props.sid) where.sid = props.sid;
|
||||
where.payTypeList = payTypeList.join();
|
||||
const res = await pageThinkCardLog({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
total.value = 0;
|
||||
if (res.list != null && res.list.length > 0) total.value = res.list.reduce((acc, cur) => acc + cur.money, 0);
|
||||
return res;
|
||||
};
|
||||
|
||||
const usersCardChargeTableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
const usersCardChargeReload = (where?: ThinkCardLogParam) => {
|
||||
usersCardChargeTableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
@@ -27,13 +27,14 @@
|
||||
</a-card>
|
||||
</div>
|
||||
<OrderList v-model:visible="showList" v-if="showList" :pay-type="payTypeList" :sid="sid"
|
||||
:create-time-start="createTimeStart"
|
||||
:showType="showType" :showCardType="showCardType" :type="type" :isPayTime="type === 0"
|
||||
:create-time-start="createTimeStart" :wechat-order="wechatOrder"
|
||||
:create-time-end="createTimeEnd" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from "vue";
|
||||
import { ref } from "vue";
|
||||
import type {
|
||||
ColumnItem
|
||||
} from "ele-admin-pro/es/ele-pro-table/types";
|
||||
@@ -42,15 +43,17 @@ import {
|
||||
getThinkOrderExcelData, getThinkOrderExcelDataForCard
|
||||
} from "@/api/think/thinkOrder";
|
||||
import type {
|
||||
ThinkOrder, ThinkOrderParam
|
||||
ThinkOrderParam
|
||||
} from "@/api/think/thinkOrder/model";
|
||||
import OrderList from "./components/OrderList.vue";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
const showType = ref(false);
|
||||
const showCardType = ref(false);
|
||||
|
||||
const type = ref(0);
|
||||
const type = ref<number>(0);
|
||||
const changeType = (val) => {
|
||||
type.value = val;
|
||||
getList();
|
||||
@@ -84,6 +87,7 @@ createTimeEnd.value = dayjs().format("YYYY-MM-DD 23:59:59");
|
||||
getList();
|
||||
|
||||
const sid = ref<number>(0);
|
||||
const wechatOrder = ref<string>("");
|
||||
const columns1 = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "场馆名称",
|
||||
@@ -98,9 +102,12 @@ const columns1 = ref<ColumnItem[]>([
|
||||
customCell: (row) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
console.log(row);
|
||||
sid.value = row.sid;
|
||||
wechatOrder.value = "";
|
||||
payTypeList.value = [8, 11];
|
||||
showList.value = true;
|
||||
showType.value = false;
|
||||
showCardType.value = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -111,9 +118,12 @@ const columns1 = ref<ColumnItem[]>([
|
||||
customCell: (row) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
console.log(row);
|
||||
sid.value = row.sid;
|
||||
wechatOrder.value = "";
|
||||
payTypeList.value = [6, 7, 9, 10, 16, 17];
|
||||
showList.value = true;
|
||||
showType.value = false;
|
||||
showCardType.value = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -124,17 +134,31 @@ const columns1 = ref<ColumnItem[]>([
|
||||
customCell: (row) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
console.log(row);
|
||||
wechatOrder.value = "";
|
||||
sid.value = row.sid;
|
||||
payTypeList.value = [13, 14];
|
||||
showList.value = true;
|
||||
showType.value = false;
|
||||
showCardType.value = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "散客订单",
|
||||
dataIndex: "guest",
|
||||
customRender: () => 0
|
||||
dataIndex: "guestIncome",
|
||||
customCell: (row) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
wechatOrder.value = "";
|
||||
sid.value = row.sid;
|
||||
payTypeList.value = [1, 4, 5];
|
||||
showList.value = true;
|
||||
showType.value = false;
|
||||
showCardType.value = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "其他",
|
||||
@@ -143,8 +167,12 @@ const columns1 = ref<ColumnItem[]>([
|
||||
return {
|
||||
onClick: () => {
|
||||
console.log(row);
|
||||
sid.value = row.sid;
|
||||
wechatOrder.value = "";
|
||||
payTypeList.value = [2, 3, 12, 15];
|
||||
showList.value = true;
|
||||
showType.value = false;
|
||||
showCardType.value = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -173,8 +201,11 @@ const columns = ref<ColumnItem[]>([
|
||||
return {
|
||||
onClick: () => {
|
||||
sid.value = row.sid;
|
||||
wechatOrder.value = "420000";
|
||||
payTypeList.value = [1];
|
||||
showList.value = true;
|
||||
showType.value = true;
|
||||
showCardType.value = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -196,9 +227,12 @@ const columns = ref<ColumnItem[]>([
|
||||
customCell: (row) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
wechatOrder.value = "";
|
||||
sid.value = row.sid;
|
||||
payTypeList.value = [5];
|
||||
payTypeList.value = [1, 3, 5];
|
||||
showList.value = true;
|
||||
showType.value = false;
|
||||
showCardType.value = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -209,9 +243,12 @@ const columns = ref<ColumnItem[]>([
|
||||
customCell: (row) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
wechatOrder.value = "";
|
||||
sid.value = row.sid;
|
||||
payTypeList.value = [18];
|
||||
showList.value = true;
|
||||
showType.value = false;
|
||||
showCardType.value = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -222,9 +259,27 @@ const columns = ref<ColumnItem[]>([
|
||||
customCell: (row) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
wechatOrder.value = "";
|
||||
sid.value = row.sid;
|
||||
payTypeList.value = [4];
|
||||
showList.value = true;
|
||||
showType.value = false;
|
||||
showCardType.value = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "未支付已使用",
|
||||
dataIndex: "unPaidUsed",
|
||||
customCell: (row) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
wechatOrder.value = "";
|
||||
sid.value = row.sid;
|
||||
payTypeList.value = [4];
|
||||
showList.value = true;
|
||||
showType.value = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -235,9 +290,11 @@ const columns = ref<ColumnItem[]>([
|
||||
customCell: (row) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
wechatOrder.value = "";
|
||||
sid.value = row.sid;
|
||||
payTypeList.value = [2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
|
||||
payTypeList.value = [2, 12];
|
||||
showList.value = true;
|
||||
showType.value = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -12,12 +12,7 @@
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 5, sm: 4, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 17, sm: 20, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
:rules="rules">
|
||||
<a-row :gutter="16">
|
||||
<a-col
|
||||
v-bind="styleResponsive ? { md: 12, sm: 24, xs: 24 } : { span: 12 }"
|
||||
@@ -66,13 +61,19 @@
|
||||
v-model:value="form.realName"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="所属机构" name="type">
|
||||
<a-form-item label="所属部门">
|
||||
<org-select
|
||||
:data="organizationList"
|
||||
placeholder="请选择所属机构"
|
||||
placeholder="请选择所属部门"
|
||||
v-model:value="form.organizationId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="场馆限制" name="limitSite">
|
||||
<a-select placeholder="场馆限制" v-model:value="limitSite" allow-clear mode="multiple">
|
||||
<a-select-option :value="item.id" v-for="(item, index) in siteList" :key="index">{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col
|
||||
v-bind="styleResponsive ? { md: 12, sm: 24, xs: 24 } : { span: 12 }"
|
||||
@@ -116,6 +117,15 @@
|
||||
v-model:value="form.introduction"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否部门经理">
|
||||
<a-switch
|
||||
:checked-value="1"
|
||||
:un-checked-value="0"
|
||||
checked-children="是"
|
||||
un-checked-children="否"
|
||||
v-model:checked="form.isOrganizationAdmin"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="管理员">
|
||||
<a-switch
|
||||
checked-children="是"
|
||||
@@ -131,222 +141,241 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { message } from 'ant-design-vue/es';
|
||||
import type { FormInstance, Rule } from 'ant-design-vue/es/form';
|
||||
import { emailReg, phoneReg } from 'ele-admin-pro/es';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import useFormData from '@/utils/use-form-data';
|
||||
import RoleSelect from './role-select.vue';
|
||||
import { addUser, updateUser, checkExistence } from '@/api/system/user';
|
||||
import type { User } from '@/api/system/user/model';
|
||||
import OrgSelect from './org-select.vue';
|
||||
// import { getDictionaryOptions } from '@/utils/common';
|
||||
import { Organization } from '@/api/system/organization/model';
|
||||
import { Grade } from '@/api/user/grade/model';
|
||||
import { ref, reactive, watch } from "vue";
|
||||
import { message } from "ant-design-vue/es";
|
||||
import type { FormInstance, Rule } from "ant-design-vue/es/form";
|
||||
import { emailReg, phoneReg } from "ele-admin-pro/es";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useThemeStore } from "@/store/modules/theme";
|
||||
import useFormData from "@/utils/use-form-data";
|
||||
import RoleSelect from "./role-select.vue";
|
||||
import { addUser, updateUser, checkExistence } from "@/api/system/user";
|
||||
import type { User } from "@/api/system/user/model";
|
||||
import OrgSelect from "./org-select.vue";
|
||||
// import { getDictionaryOptions } from '@/utils/common';
|
||||
import { Organization } from "@/api/system/organization/model";
|
||||
import { Grade } from "@/api/user/grade/model";
|
||||
import { ThinkSite } from "@/api/think/thinkSite/model";
|
||||
import { listThinkSite } from "@/api/think/thinkSite";
|
||||
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
// 获取字典数据
|
||||
// const userTypeData = getDictionaryOptions('userType');
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
// 获取字典数据
|
||||
// const userTypeData = getDictionaryOptions('userType');
|
||||
const emit = defineEmits<{
|
||||
(e: "done"): void;
|
||||
(e: "update:visible", visible: boolean): void;
|
||||
}>();
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: User | null;
|
||||
// 全部机构
|
||||
organizationList: Organization[];
|
||||
}>();
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: User | null;
|
||||
// 全部机构
|
||||
organizationList: Organization[];
|
||||
}>();
|
||||
|
||||
//
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
//
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
|
||||
// 表单数据
|
||||
const { form, resetFields, assignFields } = useFormData<User>({
|
||||
type: undefined,
|
||||
userId: undefined,
|
||||
username: '',
|
||||
nickname: '',
|
||||
realName: '',
|
||||
companyName: '',
|
||||
sex: undefined,
|
||||
sexName: '',
|
||||
roles: [],
|
||||
email: '',
|
||||
phone: '',
|
||||
mobile: '',
|
||||
password: '',
|
||||
introduction: '',
|
||||
organizationId: undefined,
|
||||
birthday: '',
|
||||
idCard: '',
|
||||
comments: '',
|
||||
gradeName: '',
|
||||
isAdmin: undefined,
|
||||
gradeId: undefined
|
||||
});
|
||||
// 表单数据
|
||||
const { form, resetFields, assignFields } = useFormData<User>({
|
||||
type: undefined,
|
||||
userId: undefined,
|
||||
username: "",
|
||||
nickname: "",
|
||||
realName: "",
|
||||
companyName: "",
|
||||
sex: undefined,
|
||||
sexName: "",
|
||||
roles: [],
|
||||
email: "",
|
||||
phone: "",
|
||||
mobile: "",
|
||||
password: "",
|
||||
introduction: "",
|
||||
organizationId: undefined,
|
||||
isOrganizationAdmin: 0,
|
||||
birthday: "",
|
||||
idCard: "",
|
||||
comments: "",
|
||||
gradeName: "",
|
||||
isAdmin: undefined,
|
||||
limitSite: undefined,
|
||||
gradeId: undefined
|
||||
});
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive<Record<string, Rule[]>>({
|
||||
username: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
validator: (_rule: Rule, value: string) => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
if (!value) {
|
||||
return reject('请输入用户账号');
|
||||
}
|
||||
checkExistence('username', value, props.data?.userId)
|
||||
.then(() => {
|
||||
reject('账号已经存在');
|
||||
})
|
||||
.catch(() => {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
nickname: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入昵称',
|
||||
type: 'string',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
// realName: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: '请输入真实姓名',
|
||||
// type: 'string',
|
||||
// trigger: 'blur'
|
||||
// }
|
||||
// ],
|
||||
// sex: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: '请选择性别',
|
||||
// type: 'string',
|
||||
// trigger: 'blur'
|
||||
// }
|
||||
// ],
|
||||
roles: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择角色',
|
||||
type: 'array',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
email: [
|
||||
{
|
||||
pattern: emailReg,
|
||||
message: '邮箱格式不正确',
|
||||
type: 'string',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
password: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
validator: async (_rule: Rule, value: string) => {
|
||||
if (isUpdate.value || /^[\S]{5,18}$/.test(value)) {
|
||||
return Promise.resolve();
|
||||
// 表单验证规则
|
||||
const rules = reactive<Record<string, Rule[]>>({
|
||||
username: [
|
||||
{
|
||||
required: true,
|
||||
type: "string",
|
||||
validator: (_rule: Rule, value: string) => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
if (!value) {
|
||||
return reject("请输入用户账号");
|
||||
}
|
||||
return Promise.reject('密码必须为5-18位非空白字符');
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
phone: [
|
||||
{
|
||||
required: true,
|
||||
pattern: phoneReg,
|
||||
message: '手机号格式不正确',
|
||||
type: 'string',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseGradeId = (data: Grade) => {
|
||||
form.gradeName = data.name;
|
||||
form.gradeId = data.gradeId;
|
||||
};
|
||||
|
||||
const chooseSex = (data: any) => {
|
||||
form.sex = data.key;
|
||||
form.sexName = data.label;
|
||||
};
|
||||
|
||||
const updateIsAdmin = (value: boolean) => {
|
||||
form.isAdmin = value;
|
||||
};
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
checkExistence("username", value, props.data?.userId)
|
||||
.then(() => {
|
||||
reject("账号已经存在");
|
||||
})
|
||||
.catch(() => {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
},
|
||||
trigger: "blur"
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const saveOrUpdate = isUpdate.value ? updateUser : addUser;
|
||||
saveOrUpdate(form)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
if (props.data) {
|
||||
assignFields({
|
||||
...props.data,
|
||||
password: ''
|
||||
});
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
],
|
||||
nickname: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入昵称",
|
||||
type: "string",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
// realName: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: '请输入真实姓名',
|
||||
// type: 'string',
|
||||
// trigger: 'blur'
|
||||
// }
|
||||
// ],
|
||||
// sex: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: '请选择性别',
|
||||
// type: 'string',
|
||||
// trigger: 'blur'
|
||||
// }
|
||||
// ],
|
||||
roles: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择角色",
|
||||
type: "array",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
email: [
|
||||
{
|
||||
pattern: emailReg,
|
||||
message: "邮箱格式不正确",
|
||||
type: "string",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
password: [
|
||||
{
|
||||
required: true,
|
||||
type: "string",
|
||||
validator: async (_rule: Rule, value: string) => {
|
||||
if (isUpdate.value || /^[\S]{5,18}$/.test(value)) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
formRef.value?.clearValidate();
|
||||
}
|
||||
return Promise.reject("密码必须为5-18位非空白字符");
|
||||
},
|
||||
trigger: "blur"
|
||||
}
|
||||
);
|
||||
],
|
||||
phone: [
|
||||
{
|
||||
required: true,
|
||||
pattern: phoneReg,
|
||||
message: "手机号格式不正确",
|
||||
type: "string",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseGradeId = (data: Grade) => {
|
||||
form.gradeName = data.name;
|
||||
form.gradeId = data.gradeId;
|
||||
};
|
||||
|
||||
const chooseSex = (data: any) => {
|
||||
form.sex = data.key;
|
||||
form.sexName = data.label;
|
||||
};
|
||||
|
||||
const updateIsAdmin = (value: boolean) => {
|
||||
form.isAdmin = value;
|
||||
};
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
if (limitSite.value) {
|
||||
form.limitSite = limitSite.value.join(",");
|
||||
} else {
|
||||
form.limitSite = "";
|
||||
}
|
||||
if (isUpdate.value) form.password = null
|
||||
const saveOrUpdate = isUpdate.value ? updateUser : addUser;
|
||||
saveOrUpdate(form)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit("done");
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
};
|
||||
|
||||
const limitSite = ref([]);
|
||||
const siteList = ref<ThinkSite[]>([]);
|
||||
const getSiteList = async () => {
|
||||
siteList.value = await listThinkSite();
|
||||
};
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit("update:visible", value);
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
getSiteList();
|
||||
if (props.data) {
|
||||
assignFields({
|
||||
...props.data,
|
||||
password: ""
|
||||
});
|
||||
isUpdate.value = true;
|
||||
if (form.limitSite) limitSite.value = form.limitSite.split(",").map(Number);
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
formRef.value?.clearValidate();
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,286 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="'开具发票'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="发票金额" name="price">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入发票金额"
|
||||
v-model:value="form.price"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="单位名称" name="name">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入单位名称"
|
||||
v-model:value="form.name"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="税号" name="code">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入税号"
|
||||
v-model:value="form.code"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="开户行" name="bank">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入开户行"
|
||||
v-model:value="form.bank"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="开户账号" name="account">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入开户账号"
|
||||
v-model:value="form.account"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="单位地址" name="address">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入单位地址"
|
||||
v-model:value="form.address"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="公司电话" name="tel">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入公司电话"
|
||||
v-model:value="form.tel"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="手机号码" name="phone">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入手机号码"
|
||||
v-model:value="form.phone"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="电子邮箱" name="email">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入电子邮箱"
|
||||
v-model:value="form.email"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注信息" name="info">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入备注信息"
|
||||
v-model:value="form.info"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="发票类型" name="type">
|
||||
<a-radio-group v-model:value="form.type">
|
||||
<a-radio :value="1">纸质发票</a-radio>
|
||||
<a-radio :value="2">电子发票</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="发票类型" name="itype">
|
||||
<a-radio-group v-model:value="form.itype" :disabled="true">
|
||||
<a-radio :value="1">场地发票</a-radio>
|
||||
<a-radio :value="2">vip卡发票</a-radio>
|
||||
<a-radio :value="3">IC卡发票</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="发票类型" name="invoicetype">
|
||||
<a-radio-group v-model:value="form.invoicetype" :disabled="true">
|
||||
<a-radio :value="1">普票</a-radio>
|
||||
<a-radio :value="2">专票</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import {
|
||||
addThinkInvoice,
|
||||
doInvoice,
|
||||
pageThinkInvoice,
|
||||
updateThinkInvoice
|
||||
} from '@/api/think/thinkInvoice';
|
||||
import { ThinkInvoice } from '@/api/think/thinkInvoice/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { ThinkOrder } from '@/api/think/thinkOrder/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ThinkOrder | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ThinkInvoice>({
|
||||
id: undefined,
|
||||
incoiveNum: undefined,
|
||||
incoiveCode: undefined,
|
||||
orderNum: undefined,
|
||||
oid: undefined,
|
||||
uid: undefined,
|
||||
price: undefined,
|
||||
name: undefined,
|
||||
tel: undefined,
|
||||
address: undefined,
|
||||
bank: undefined,
|
||||
account: undefined,
|
||||
code: undefined,
|
||||
phone: undefined,
|
||||
email: undefined,
|
||||
info: undefined,
|
||||
isOpen: undefined,
|
||||
type: 2,
|
||||
itype: 1,
|
||||
invoicetype: 1,
|
||||
createTime: undefined,
|
||||
updateTime: undefined
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
price: [
|
||||
{
|
||||
required: true,
|
||||
type: 'number',
|
||||
message: '请填写发票金额',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写单位名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
code: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写税号',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const onChangeInvoice = (data: ThinkInvoice) => {
|
||||
console.log(data);
|
||||
console.log(form);
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
// const saveOrUpdate = isUpdate.value
|
||||
// ? updateThinkInvoice
|
||||
// : addThinkInvoice;
|
||||
doInvoice(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
// 第一次开票
|
||||
isUpdate.value = false;
|
||||
form.oid = props.data?.id;
|
||||
form.price = props.data?.price;
|
||||
form.incoiveNum = props.data?.code;
|
||||
form.orderNum = props.data?.code;
|
||||
form.vid = props.data?.vid;
|
||||
form.phone = props.data?.phone;
|
||||
form.itype = 3;
|
||||
|
||||
// 开过票
|
||||
pageThinkInvoice({ uid: props.data?.uid, limit: 1 }).then((res) => {
|
||||
if (res && res.list.length > 0) {
|
||||
assignObject(form, res?.list[0]);
|
||||
isUpdate.value = true;
|
||||
form.oid = props.data?.id;
|
||||
form.price = props.data?.price;
|
||||
form.incoiveNum = props.data?.code;
|
||||
form.vid = props.data?.vid;
|
||||
form.phone = props.data?.phone;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
@@ -0,0 +1,101 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="'80%'"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
title="使用记录"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
:footer="null"
|
||||
@update:visible="updateVisible"
|
||||
>
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
:need-page="false"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
:loading="loading"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'order'">
|
||||
<a-tag color="green" v-if="!!record.order">已使用</a-tag>
|
||||
<a-tag color="red" v-else>未使用</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'startTime'">
|
||||
<text>{{ dayjs(record.startTime * 1000).format('YYYY-MM-DD') }}</text>
|
||||
</template>
|
||||
<template v-if="column.key === 'orderInfo'">
|
||||
<span v-if="record.order">{{ record.order.thinkOrderInfos.map(item => item.dateTime).join() }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from "vue";
|
||||
import { EleProTable } from "ele-admin-pro";
|
||||
import type { ColumnItem, DatasourceFunction } from "ele-admin-pro/es/ele-pro-table/types";
|
||||
import { listThinkOrder } from "@/api/think/thinkOrder";
|
||||
import { ThinkCard } from "@/api/think/thinkCard/model";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ThinkCard | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "done"): void;
|
||||
(e: "update:visible", visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit("update:visible", value);
|
||||
};
|
||||
|
||||
const datasource: DatasourceFunction = () => {
|
||||
return listThinkOrder({
|
||||
cid: props?.data?.id
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "日期",
|
||||
key: "startTime",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "使用场馆",
|
||||
dataIndex: "siteName",
|
||||
align: "center"
|
||||
}
|
||||
]);
|
||||
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
tableRef?.value?.reload();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
@@ -28,6 +28,8 @@
|
||||
<a-space>
|
||||
<span>{{ record.username }}</span>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="openLog(record)">使用记录</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要解除绑定吗?"
|
||||
@confirm="unBindCard(record)"
|
||||
@@ -43,6 +45,8 @@
|
||||
>
|
||||
<a class="ele-text-danger">注销</a>
|
||||
</a-popconfirm>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="onInvoice(record)" v-if="record.isInvoice === 2">开票</a>
|
||||
</a-space>
|
||||
</template>
|
||||
<template v-if="column.key === 'sid'">
|
||||
@@ -91,7 +95,9 @@
|
||||
@done="reload"
|
||||
/>
|
||||
<MakeICCard v-model:visible="showMakeCard" @done="reload" />
|
||||
<ThinkCardLog v-model:visible="showLog" :data="current" />
|
||||
</div>
|
||||
<Invoice v-model:visible="showInvoice" :data="current" @done="reload" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -115,6 +121,8 @@ import {
|
||||
} from "@/api/think/thinkCard";
|
||||
import type { ThinkCard, ThinkCardParam } from "@/api/think/thinkCard/model";
|
||||
import MakeICCard from "@/views/think/thinkCard/components/makeICCard.vue";
|
||||
import ThinkCardLog from "./components/thinkCardLog.vue";
|
||||
import Invoice from "./components/invoice.vue";
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
@@ -143,7 +151,9 @@ const payTypes = ref<string[]>([
|
||||
"支付宝支付",
|
||||
"现金",
|
||||
"POS机刷卡",
|
||||
"平安健康卡"
|
||||
"平安健康卡",
|
||||
"免费",
|
||||
"抖音支付",
|
||||
]);
|
||||
const isIntegral = ref<string[]>(["", "赠送", "不赠送"]);
|
||||
|
||||
@@ -169,12 +179,12 @@ const datasource: DatasourceFunction = ({
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "姓名",
|
||||
title: "操作",
|
||||
dataIndex: "username",
|
||||
key: "username",
|
||||
align: "center",
|
||||
fixed: "left",
|
||||
width: 280
|
||||
width: 400
|
||||
},
|
||||
{
|
||||
title: "卡号",
|
||||
@@ -346,110 +356,6 @@ const columns = ref<ColumnItem[]>([
|
||||
width: 180,
|
||||
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||
}
|
||||
// {
|
||||
// title: '微信订单号',
|
||||
// dataIndex: 'wechatOrder',
|
||||
// key: 'wechatOrder',
|
||||
// align: 'center'
|
||||
// },
|
||||
// {
|
||||
// title: '手机号码',
|
||||
// dataIndex: 'phone',
|
||||
// key: 'phone',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '会员卡介绍',
|
||||
// dataIndex: 'desc',
|
||||
// key: 'desc',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '会员卡说明',
|
||||
// dataIndex: 'info',
|
||||
// key: 'info',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '续费累加次数',
|
||||
// dataIndex: 'number',
|
||||
// key: 'number',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '付款状态,1已付款,2未付款',
|
||||
// dataIndex: 'status',
|
||||
// key: 'status',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '卡类型:1成人卡,2儿童卡',
|
||||
// dataIndex: 'cardType',
|
||||
// key: 'cardType',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: 'vip卡等级类型:1特殊vip卡,2普通vip卡',
|
||||
// dataIndex: 'vipType',
|
||||
// key: 'vipType',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '特殊卡开发凭证图',
|
||||
// dataIndex: 'pic',
|
||||
// key: 'pic',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '价格组',
|
||||
// dataIndex: 'prices',
|
||||
// key: 'prices',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '卡号',
|
||||
// dataIndex: 'cardNum',
|
||||
// key: 'cardNum',
|
||||
// align: 'center'
|
||||
// }
|
||||
// {
|
||||
// title: '密码',
|
||||
// dataIndex: 'password',
|
||||
// key: 'password',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '使用时间',
|
||||
// dataIndex: 'useTime',
|
||||
// key: 'useTime',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '',
|
||||
// dataIndex: 'updateTime',
|
||||
// key: 'updateTime',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '身份证号码',
|
||||
// dataIndex: 'idcard',
|
||||
// key: 'idcard',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '备注',
|
||||
// dataIndex: 'remark',
|
||||
// key: 'remark',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '操作',
|
||||
// key: 'action',
|
||||
// width: 180,
|
||||
// fixed: 'right',
|
||||
// align: 'center',
|
||||
// hideInSetting: true
|
||||
// }
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
@@ -541,6 +447,18 @@ const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
const showLog = ref(false)
|
||||
const openLog = (row: ThinkCard) => {
|
||||
showLog.value = true
|
||||
current.value = row
|
||||
}
|
||||
|
||||
const showInvoice = ref(false)
|
||||
const onInvoice = (row?: ThinkCard) => {
|
||||
current.value = row ?? null;
|
||||
showInvoice.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ThinkCard) => {
|
||||
return {
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
ThinkCardLog,
|
||||
ThinkCardLogParam
|
||||
} from '@/api/think/thinkCardLog/model';
|
||||
import { listThinkCardLog } from '@/api/think/thinkCardLog';
|
||||
import { listThinkCardLog, thinkCardLogExport } from "@/api/think/thinkCardLog";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -106,74 +106,8 @@
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
loading.value = true;
|
||||
const array: (string | number)[][] = [
|
||||
[
|
||||
'卡号',
|
||||
'姓名',
|
||||
'手机号',
|
||||
'会员卡名称',
|
||||
'支付方式',
|
||||
'充值金额',
|
||||
'充值次数',
|
||||
'操作员',
|
||||
'第三方订单号',
|
||||
'充值时间'
|
||||
]
|
||||
];
|
||||
if (!where.timeStart) {
|
||||
message.error('请选择导出的开始日期、结束日期,每次最多导出5000条记录');
|
||||
return false;
|
||||
}
|
||||
await listThinkCardLog(where)
|
||||
.then((list) => {
|
||||
orders.value = list;
|
||||
orders.value?.forEach((d: ThinkCardLog) => {
|
||||
array.push([
|
||||
`${d.code}`,
|
||||
`${d.username}`,
|
||||
`${d.phone}`,
|
||||
`${d.cardName}`,
|
||||
`${payType.value[Number(d.payType)]}`,
|
||||
`${d.money}`,
|
||||
`${d.count}`,
|
||||
`${d.adminName || d.aid}`,
|
||||
`${d.wechatOrder}`,
|
||||
`${toDateString(d.createTime)}`
|
||||
]);
|
||||
});
|
||||
const sheetName = `充值记录导出`;
|
||||
const workbook = {
|
||||
SheetNames: [sheetName],
|
||||
Sheets: {}
|
||||
};
|
||||
const sheet = utils.aoa_to_sheet(array);
|
||||
workbook.Sheets[sheetName] = sheet;
|
||||
// 设置列宽
|
||||
sheet['!cols'] = [
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 20 },
|
||||
{ wch: 40 },
|
||||
{ wch: 10 }
|
||||
];
|
||||
message.loading('正在导出...');
|
||||
setTimeout(() => {
|
||||
writeFile(
|
||||
workbook,
|
||||
`${
|
||||
where.createTimeEnd ? xlsFileName.value + '_' : ''
|
||||
}${sheetName}.xlsx`
|
||||
);
|
||||
loading.value = false;
|
||||
}, 2000);
|
||||
})
|
||||
.catch((msg) => {
|
||||
message.error(msg);
|
||||
loading.value = false;
|
||||
})
|
||||
.finally(() => {});
|
||||
const res = await thinkCardLogExport(where)
|
||||
window.open(res.data.url);
|
||||
};
|
||||
|
||||
watch(
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
<a-tag v-if="record.payType === 2">支付宝支付</a-tag>
|
||||
<a-tag v-if="record.payType === 3">现金支付</a-tag>
|
||||
<a-tag v-if="record.payType === 4">POS支付</a-tag>
|
||||
<a-tag v-if="record.payType === 5">平安健康卡</a-tag>
|
||||
<a-tag v-if="record.payType === 6">对公支付</a-tag>
|
||||
<a-tag v-if="record.payType === 8">抖音支付</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'money'">
|
||||
¥{{ formatNumber(record.money) }}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
value-format="YYYY-MM-DD"
|
||||
class="ele-fluid"
|
||||
/>
|
||||
<a-button type="primary" @click="exportExcel">导出</a-button>
|
||||
</a-space>
|
||||
<p class="ele-text-danger font-bold mt-2">总金额:{{ totalAmount }}元</p>
|
||||
</div>
|
||||
@@ -17,6 +18,8 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from "vue";
|
||||
import { ThinkCardsBillsParam } from "@/api/think/thinkCardsBills/model";
|
||||
import { messageLoading } from "ele-admin-pro";
|
||||
import { thinkVipCardsBillsExport } from "@/api/think/thinkVipCardsBills";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -46,6 +49,22 @@ const search = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const exportExcel = async () => {
|
||||
let dateStart = "", dateEnd = "";
|
||||
if (dateRange.value && dateRange.value?.length > 0) {
|
||||
[dateStart, dateEnd] = dateRange.value;
|
||||
}
|
||||
const hide = messageLoading("导出中...", 0);
|
||||
const { data } = await thinkVipCardsBillsExport({
|
||||
dateStart,
|
||||
dateEnd,
|
||||
isCard: true
|
||||
});
|
||||
hide();
|
||||
window.open(data.url);
|
||||
};
|
||||
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
</template>
|
||||
<p v-else>散客</p>
|
||||
</template>
|
||||
<template v-if="column.key === 'vid'">
|
||||
<p v-if="record.card">{{ record.card.name }}</p>
|
||||
<p v-if="record.vip">{{ record.vip.name }}</p>
|
||||
</template>
|
||||
<template v-if="column.key === 'used'">
|
||||
<a-tag v-if="record.used === 1" color="green">已使用</a-tag>
|
||||
<a-tag v-if="record.used === 0" color="red">未使用</a-tag>
|
||||
@@ -61,6 +65,7 @@ import {
|
||||
thinkCardsBillsTotalAmount
|
||||
} from "@/api/think/thinkCardsBills";
|
||||
import type { ThinkCardsBills, ThinkCardsBillsParam } from "@/api/think/thinkCardsBills/model";
|
||||
import { pageThinkVipCardsBills } from "@/api/think/thinkVipCardsBills";
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
@@ -88,7 +93,8 @@ const datasource: DatasourceFunction = ({
|
||||
where.status = filters.status;
|
||||
}
|
||||
getTotalAmount(where);
|
||||
return pageThinkCardsBills({
|
||||
where.isCard = true;
|
||||
return pageThinkVipCardsBills({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
@@ -109,8 +115,7 @@ const columns = ref<ColumnItem[]>([
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "VIP卡",
|
||||
dataIndex: ["vip", "name"],
|
||||
title: "卡类型",
|
||||
key: "vid",
|
||||
align: "center"
|
||||
},
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
:max="9999"
|
||||
class="ele-fluid"
|
||||
placeholder="请输入排序号"
|
||||
v-model:value="form.sortNumber"
|
||||
v-model:value="form.sort"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
@@ -143,7 +143,7 @@
|
||||
isHalf: undefined,
|
||||
isChildren: undefined,
|
||||
num: undefined,
|
||||
sort: undefined,
|
||||
sort: 1,
|
||||
sid: undefined,
|
||||
row: undefined,
|
||||
createTime: undefined
|
||||
@@ -156,7 +156,7 @@
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
name: [
|
||||
name: [K
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
|
||||
@@ -53,6 +53,10 @@
|
||||
v-if="record.resJson && record.resJson.includes('本次操作需登录电子发票服务平台,请先使用短信验证码登录')">
|
||||
本次操作需登录电子发票服务平台,请先使用短信验证码登录
|
||||
</template>
|
||||
<template
|
||||
v-else-if="record.resJson && record.resJson.includes('发票额度已不够使用')">
|
||||
发票额度已不够使用
|
||||
</template>
|
||||
</p>
|
||||
<a-space v-if="record.isOpen === 2 && record.status === 0">
|
||||
<a @click="openInvoice(record)">开票</a>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<a-card class="order-card" :bordered="false">
|
||||
<a-descriptions title="基本信息" :column="3">
|
||||
<a-descriptions-item
|
||||
label="订单号"
|
||||
label="订单ID"
|
||||
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||
>
|
||||
{{ form.id }}
|
||||
|
||||
@@ -51,7 +51,8 @@ const form = reactive<ThinkOrderRefundLog>({
|
||||
sid: undefined,
|
||||
oid: undefined,
|
||||
status: 1,
|
||||
type: 0
|
||||
type: 0,
|
||||
isAdmin: true
|
||||
});
|
||||
|
||||
// 请求状态
|
||||
|
||||
@@ -47,6 +47,11 @@
|
||||
<a-select-option :value="2">未开票</a-select-option>
|
||||
<a-select-option :value="3">不能开票</a-select-option>
|
||||
</a-select>
|
||||
<span class="text-gray-400">对账状态</span>
|
||||
<a-select v-model:value="where.checkBill" style="width: 150px" placeholder="对账状态筛选" @change="search">
|
||||
<a-select-option value="1">已对账</a-select-option>
|
||||
<a-select-option :value="2">未对账</a-select-option>
|
||||
</a-select>
|
||||
<ThinkSelectSite
|
||||
:placeholder="`选择场馆`"
|
||||
class="input-item"
|
||||
@@ -67,6 +72,14 @@
|
||||
@search="search"
|
||||
style="width: 380px"
|
||||
/>
|
||||
<a-input-search
|
||||
allow-clear
|
||||
placeholder="请输入微信支付单号|POS流水号"
|
||||
v-model:value="where.wechatOrder"
|
||||
@pressEnter="search"
|
||||
@search="search"
|
||||
style="width: 280px"
|
||||
/>
|
||||
</a-space>
|
||||
<div class="mt-2">
|
||||
<a-space>
|
||||
@@ -120,10 +133,12 @@ const { where, resetFields } = useSearch<ThinkOrderParam>({
|
||||
timeEnd: undefined,
|
||||
categoryId: undefined,
|
||||
keywords: undefined,
|
||||
wechatOrder: undefined,
|
||||
payStatus: undefined,
|
||||
orderStatus: undefined,
|
||||
payType: undefined,
|
||||
isInvoice: undefined
|
||||
isInvoice: undefined,
|
||||
checkBill: undefined,
|
||||
});
|
||||
// 请求状态
|
||||
const loading = ref(false);
|
||||
|
||||
@@ -222,6 +222,22 @@
|
||||
</a-tag>
|
||||
<a-tag v-if="record.isInvoice == 3" color="purple">不能开</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'checkBill'">
|
||||
<template v-if="record.payStatus === 1 && record.payType === 1 && !record.wechatOrder.includes('420000')">
|
||||
<a-tag
|
||||
v-if="record.checkBill == 1"
|
||||
color="green"
|
||||
class="cursor-pointer"
|
||||
>已对账
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-if="record.checkBill == 2"
|
||||
color="red"
|
||||
class="cursor-pointer"
|
||||
>未对账
|
||||
</a-tag>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
@@ -264,7 +280,7 @@ import {
|
||||
CloseOutlined,
|
||||
AlipayCircleOutlined
|
||||
} from "@ant-design/icons-vue";
|
||||
import { EleProTable, toDateString } from "ele-admin-pro";
|
||||
import { EleProTable, messageLoading, toDateString } from "ele-admin-pro";
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
@@ -276,7 +292,7 @@ import InvoiceByList from "./components/invoiceByList.vue";
|
||||
import {
|
||||
pageThinkOrder,
|
||||
removeThinkOrder,
|
||||
removeBatchThinkOrder
|
||||
removeBatchThinkOrder, thinkOrderExport
|
||||
} from "@/api/think/thinkOrder";
|
||||
import * as InvoiceApi from "@/api/think/thinkInvoice";
|
||||
import type {
|
||||
@@ -288,7 +304,6 @@ import type { ThinkInvoice } from "@/api/think/thinkInvoice/model";
|
||||
import Refund from "@/views/think/thinkOrder/components/refund.vue";
|
||||
import { hasPermission } from "@/utils/permission";
|
||||
import dayjs from "dayjs";
|
||||
import { doInvoiceByListReq } from "@/api/think/thinkInvoice";
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
@@ -424,6 +439,11 @@ const columns = ref<ColumnItem[]>([
|
||||
align: "center",
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: "对账状态",
|
||||
key: "checkBill",
|
||||
align: "center"
|
||||
},
|
||||
// {
|
||||
// title: '类型',
|
||||
// dataIndex: 'type',
|
||||
@@ -557,69 +577,11 @@ const openInvoiceByList = async () => {
|
||||
showInvoiceList.value = true;
|
||||
};
|
||||
|
||||
const handleExport = (where: ThinkOrderParam) => {
|
||||
console.log('开始导出');
|
||||
loading.value = true;
|
||||
const array: (string | number)[][] = [
|
||||
[
|
||||
'订单号',
|
||||
'订单编号',
|
||||
'姓名',
|
||||
'电话号码',
|
||||
'预定信息',
|
||||
'消费金额',
|
||||
'实付金额',
|
||||
'付款时间',
|
||||
'下单时间'
|
||||
]
|
||||
];
|
||||
if (!where.timeStart) {
|
||||
message.error('请选择导出的开始日期、结束日期,每次最多导出5000条记录');
|
||||
return false;
|
||||
}
|
||||
pageThinkOrder(where)
|
||||
.then((data) => {
|
||||
data.list?.forEach((d: ThinkOrder) => {
|
||||
array.push([
|
||||
`${d.id}`,
|
||||
`${d.orderNum}`,
|
||||
`${d.name}`,
|
||||
`${d.phone}`,
|
||||
`${d.siteName} ${d.dateTime} ${d.totalPrice}`,
|
||||
`${d.totalPrice}`,
|
||||
`${d.payPrice}`,
|
||||
`${toDateString(d.payTime, 'YYYY年MM月dd日 HH:mm:ss')}`,
|
||||
`${toDateString(d.createTime, 'YYYY年MM月dd日 HH:mm:ss')}`
|
||||
]);
|
||||
});
|
||||
const sheetName = `订单数据导出`;
|
||||
const workbook = {
|
||||
SheetNames: [sheetName],
|
||||
Sheets: {}
|
||||
};
|
||||
const sheet = utils.aoa_to_sheet(array);
|
||||
workbook.Sheets[sheetName] = sheet;
|
||||
// 设置列宽
|
||||
sheet['!cols'] = [
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 20 },
|
||||
{ wch: 40 },
|
||||
{ wch: 10 }
|
||||
];
|
||||
message.loading('正在导出...');
|
||||
setTimeout(() => {
|
||||
writeFile(workbook, `${sheetName}.xlsx`);
|
||||
loading.value = false;
|
||||
}, 2000);
|
||||
})
|
||||
.catch((msg) => {
|
||||
message.error(msg);
|
||||
loading.value = false;
|
||||
})
|
||||
.finally(() => {});
|
||||
const handleExport = async (params: ThinkOrderParam) => {
|
||||
const hide = messageLoading("导出中...", 0);
|
||||
const res = await thinkOrderExport(params);
|
||||
hide();
|
||||
window.open(res.url);
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
|
||||
@@ -32,16 +32,15 @@
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 1" color="green">已付款</a-tag>
|
||||
<a-tag v-if="record.status === 2" color="red">未付款</a-tag>
|
||||
<a-tag v-if="record.status === 3" color="red">已退款</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
<a-popconfirm v-if="record.status === 1"
|
||||
title="确定要退款吗?"
|
||||
@confirm="refund(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
<a class="ele-text-danger">退款</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
@@ -60,257 +59,255 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import ThinkRechargeLogEdit from './components/thinkRechargeLogEdit.vue';
|
||||
import {
|
||||
pageThinkRechargeLog,
|
||||
removeThinkRechargeLog,
|
||||
removeBatchThinkRechargeLog
|
||||
} from '@/api/think/thinkRechargeLog';
|
||||
import type {
|
||||
ThinkRechargeLog,
|
||||
ThinkRechargeLogParam
|
||||
} from '@/api/think/thinkRechargeLog/model';
|
||||
import { createVNode, ref } from "vue";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||
import type { EleProTable } from "ele-admin-pro";
|
||||
import { toDateString } from "ele-admin-pro";
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from "ele-admin-pro/es/ele-pro-table/types";
|
||||
import Search from "./components/search.vue";
|
||||
import ThinkRechargeLogEdit from "./components/thinkRechargeLogEdit.vue";
|
||||
import {
|
||||
pageThinkRechargeLog,
|
||||
removeThinkRechargeLog,
|
||||
removeBatchThinkRechargeLog, thinkRechargeLogRefund
|
||||
} from "@/api/think/thinkRechargeLog";
|
||||
import type {
|
||||
ThinkRechargeLog,
|
||||
ThinkRechargeLogParam
|
||||
} from "@/api/think/thinkRechargeLog/model";
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ThinkRechargeLog[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ThinkRechargeLog | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
// 表格选中数据
|
||||
const selection = ref<ThinkRechargeLog[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ThinkRechargeLog | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageThinkRechargeLog({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageThinkRechargeLog({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 80,
|
||||
fixed: "left",
|
||||
align: "center",
|
||||
hideInSetting: true
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "phone",
|
||||
key: "phone",
|
||||
align: "center",
|
||||
fixed: "left",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
title: "订单号",
|
||||
dataIndex: "orderNum",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "真实姓名",
|
||||
dataIndex: "realName",
|
||||
key: "realName",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "VIP卡名称",
|
||||
dataIndex: "vipName",
|
||||
key: "vipName",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "可用场馆",
|
||||
dataIndex: "siteNames",
|
||||
key: "siteNames",
|
||||
align: "center",
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: "充值金额",
|
||||
dataIndex: "money",
|
||||
key: "money",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "支付状态",
|
||||
dataIndex: "status",
|
||||
key: "status",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "微信支付订单号",
|
||||
dataIndex: "wechatOrder",
|
||||
key: "wechatOrder",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "会员卡类型",
|
||||
dataIndex: "vipType",
|
||||
key: "vipType",
|
||||
align: "center",
|
||||
customRender: ({ text }) => ["", "特殊VIP卡", "普通VIP卡"][text]
|
||||
},
|
||||
{
|
||||
title: "会员卡类型",
|
||||
dataIndex: "cardType",
|
||||
key: "cardType",
|
||||
align: "center",
|
||||
customRender: ({ text }) => ["", "成人卡", "儿童卡", "不限"][text]
|
||||
},
|
||||
{
|
||||
title: "会员卡类型",
|
||||
dataIndex: "type",
|
||||
key: "type",
|
||||
align: "center",
|
||||
customRender: ({ text }) =>
|
||||
["", "年卡", "次卡", "月卡", "会员IC卡", "充值卡"][text]
|
||||
},
|
||||
// {
|
||||
// title: '是否已开具发票',
|
||||
// dataIndex: 'isInvoice',
|
||||
// key: 'isInvoice',
|
||||
// align: 'center',
|
||||
// sorter: true,
|
||||
// customRender: ({ text }) => ['', '已开票', '未开票'][text]
|
||||
// },
|
||||
{
|
||||
title: "到期时间",
|
||||
dataIndex: "expireTime",
|
||||
key: "expireTime",
|
||||
align: "center",
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||
},
|
||||
{
|
||||
title: "购卡时间",
|
||||
dataIndex: "createTime",
|
||||
key: "createTime",
|
||||
align: "center",
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ThinkRechargeLogParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ThinkRechargeLog) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
const refund = (row: ThinkRechargeLog) => {
|
||||
const hide = message.loading("请求中..", 0);
|
||||
thinkRechargeLogRefund(row)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
key: 'phone',
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
title: '微信昵称',
|
||||
dataIndex: 'username',
|
||||
key: 'username',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '真实姓名',
|
||||
dataIndex: 'realName',
|
||||
key: 'realName',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: 'VIP卡名称',
|
||||
dataIndex: 'vipName',
|
||||
key: 'vipName',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '可用场馆',
|
||||
dataIndex: 'siteNames',
|
||||
key: 'siteNames',
|
||||
align: 'center',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '充值金额',
|
||||
dataIndex: 'money',
|
||||
key: 'money',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '支付状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '微信支付订单号',
|
||||
dataIndex: 'wechatOrder',
|
||||
key: 'wechatOrder',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '会员卡类型',
|
||||
dataIndex: 'vipType',
|
||||
key: 'vipType',
|
||||
align: 'center',
|
||||
customRender: ({ text }) => ['', '特殊VIP卡', '普通VIP卡'][text]
|
||||
},
|
||||
{
|
||||
title: '会员卡类型',
|
||||
dataIndex: 'cardType',
|
||||
key: 'cardType',
|
||||
align: 'center',
|
||||
customRender: ({ text }) => ['', '成人卡', '儿童卡', '不限'][text]
|
||||
},
|
||||
{
|
||||
title: '会员卡类型',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
align: 'center',
|
||||
customRender: ({ text }) =>
|
||||
['', '年卡', '次卡', '月卡', '会员IC卡', '充值卡'][text]
|
||||
},
|
||||
// {
|
||||
// title: '是否已开具发票',
|
||||
// dataIndex: 'isInvoice',
|
||||
// key: 'isInvoice',
|
||||
// align: 'center',
|
||||
// sorter: true,
|
||||
// customRender: ({ text }) => ['', '已开票', '未开票'][text]
|
||||
// },
|
||||
{
|
||||
title: '到期时间',
|
||||
dataIndex: 'expireTime',
|
||||
key: 'expireTime',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '购卡时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error("请至少选择一条数据");
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定要删除选中的记录吗?",
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading("请求中..", 0);
|
||||
removeBatchThinkRechargeLog(
|
||||
selection.value.map((d) => d.id)
|
||||
)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
// {
|
||||
// title: '操作',
|
||||
// key: 'action',
|
||||
// width: 180,
|
||||
// fixed: 'right',
|
||||
// align: 'center',
|
||||
// hideInSetting: true
|
||||
// }
|
||||
]);
|
||||
});
|
||||
};
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ThinkRechargeLogParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ThinkRechargeLog) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ThinkRechargeLog) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeThinkRechargeLog(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ThinkRechargeLog) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchThinkRechargeLog(
|
||||
selection.value.map((d) => d.id)
|
||||
)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ThinkRechargeLog) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ThinkRechargeLog'
|
||||
};
|
||||
export default {
|
||||
name: "ThinkRechargeLog"
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
|
||||
@@ -23,10 +23,12 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="封面图" name="thumb">
|
||||
<a-avatar
|
||||
:src="form.thumb"
|
||||
size="120"
|
||||
shape="square"
|
||||
<SelectFile
|
||||
:placeholder="`请选择图片`"
|
||||
:limit="1"
|
||||
:data="images"
|
||||
@done="chooseImage"
|
||||
@del="onDeleteItem"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="每小时价格" name="price">
|
||||
@@ -43,11 +45,11 @@
|
||||
v-model:value="form.businessTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="场馆所在区域" name="address">
|
||||
<a-cascader v-model:value="city" :options="areaList" placeholder="点击选择省市"
|
||||
:field-names="areaFieldNames"
|
||||
@change="changeArea" />
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="场馆所在区域">-->
|
||||
<!-- <a-cascader v-model:value="city" :options="areaList" placeholder="点击选择省市"-->
|
||||
<!-- :field-names="areaFieldNames"-->
|
||||
<!-- @change="changeArea" />-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="场馆地址" name="address">
|
||||
<a-input
|
||||
allow-clear
|
||||
@@ -161,8 +163,16 @@
|
||||
<!-- />-->
|
||||
</a-form-item>
|
||||
<a-form-item label="周末活动订场开关" name="weekendOpen">
|
||||
<a-switch :checked="form.weekendOpen == 1" />
|
||||
<a-switch v-model:checked="form.weekendOpen" :checked-value="1" :un-checked-value="0" />
|
||||
</a-form-item>
|
||||
<template v-if="data && data.id === 37">
|
||||
<a-form-item label="开启成人手动价格">
|
||||
<a-switch v-model:checked="form.adultFree" :checked-value="1" :un-checked-value="0"/>
|
||||
</a-form-item>
|
||||
<a-form-item label="开启儿童手动价格">
|
||||
<a-switch v-model:checked="form.childFree" :checked-value="1" :un-checked-value="0"/>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<a-form-item label="每天人数上限" extra="-1为不限制">
|
||||
<a-input-number v-model:value="form.dailyMaxNum" />
|
||||
</a-form-item>
|
||||
@@ -192,6 +202,7 @@ import { uploadOss } from "@/api/system/file";
|
||||
import { TdtMap } from "vue-tianditu";
|
||||
import { listArea } from "@/api/system/area";
|
||||
import { Area } from "@/api/system/area/model";
|
||||
import { FileRecord } from "@/api/system/file/model";
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
@@ -218,7 +229,6 @@ const loading = ref(false);
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
const files = ref<ItemType[]>([]);
|
||||
// 编辑器内容,双向绑定
|
||||
const content = ref<any>("");
|
||||
@@ -230,9 +240,9 @@ const form = reactive<ThinkSite>({
|
||||
thumb: undefined,
|
||||
price: undefined,
|
||||
businessTime: undefined,
|
||||
province: undefined,
|
||||
city: undefined,
|
||||
region: undefined,
|
||||
province: '广西壮族自治区',
|
||||
city: '南宁市',
|
||||
region: '良庆区',
|
||||
address: undefined,
|
||||
rentStartDate: undefined,
|
||||
rentEndDate: undefined,
|
||||
@@ -250,7 +260,8 @@ const form = reactive<ThinkSite>({
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
weekendOpen: undefined,
|
||||
dailyMaxNum: undefined,
|
||||
dailyMaxNum: -1,
|
||||
album: '',
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
@@ -260,18 +271,59 @@ const updateVisible = (value: boolean) => {
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
thinkSiteName: [
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
type: "string",
|
||||
message: "请填写名称",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
thumb: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传图片",
|
||||
trigger: "change"
|
||||
}
|
||||
],
|
||||
price: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写价格",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
businessTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写营业时间",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
address: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写地址",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
tel: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写联系电话",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
sortNumber: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写排序",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
|
||||
realPropertyCertificate: [
|
||||
{
|
||||
required: true,
|
||||
type: "string",
|
||||
message: "请填写产权证书/不动产权证号",
|
||||
trigger: "blur"
|
||||
}
|
||||
@@ -279,7 +331,6 @@ const rules = reactive({
|
||||
rentStartDate: [
|
||||
{
|
||||
required: true,
|
||||
type: "string",
|
||||
message: "请填写租赁开始日期",
|
||||
trigger: "blur"
|
||||
}
|
||||
@@ -287,11 +338,17 @@ const rules = reactive({
|
||||
rentEndDate: [
|
||||
{
|
||||
required: true,
|
||||
type: "string",
|
||||
message: "请填写租赁结束日期",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
],
|
||||
size: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写面积",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
|
||||
});
|
||||
|
||||
@@ -416,6 +473,7 @@ const save = () => {
|
||||
info: content.value,
|
||||
files: JSON.stringify(files.value)
|
||||
};
|
||||
if (!form.lat) return message.error("请选择经纬度");
|
||||
const saveOrUpdate = isUpdate.value ? updateThinkSite : addThinkSite;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
@@ -447,6 +505,21 @@ const removeRefund = (index) => {
|
||||
moneyJson.value.splice(index, 1);
|
||||
};
|
||||
|
||||
const images = ref<ItemType[]>([]);
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: "done"
|
||||
});
|
||||
form.thumb = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.thumb = "";
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
async (visible) => {
|
||||
|
||||
@@ -161,9 +161,8 @@ const columns = ref<ColumnItem[]>([
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "微信昵称",
|
||||
dataIndex: "username",
|
||||
key: "username",
|
||||
title: "订单号",
|
||||
dataIndex: "wechatOrder",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -62,6 +62,13 @@
|
||||
<a-form-item label="可选场馆" name="sid">
|
||||
<ThinkSelectSiteMultiple v-model:value="sites" />
|
||||
</a-form-item>
|
||||
<a-form-item label="报表归属场馆" name="reportSid">
|
||||
<a-select v-model:value="form.reportSid" filter-option="label" show-search>
|
||||
<a-select-option v-for="item in siteList" :key="item.id" :value="item.id" :label="item.name">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="会员卡价格" name="price">
|
||||
<a-input
|
||||
allow-clear
|
||||
@@ -69,6 +76,13 @@
|
||||
v-model:value="form.price"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="续卡价格" name="renewPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入会员卡价格"
|
||||
v-model:value="form.renewPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="会员卡介绍" name="desc">
|
||||
<a-input
|
||||
allow-clear
|
||||
@@ -143,9 +157,9 @@
|
||||
<a-form-item label="特殊卡开发凭证图" name="pic">
|
||||
<a-avatar :src="`${IMG_URL}${form.pic}`" :size="120" />
|
||||
</a-form-item>
|
||||
<a-form-item label="VIP充值卡价格组" name="prices">
|
||||
{{ form.prices }}
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="VIP充值卡价格组" name="prices">-->
|
||||
<!-- {{ form.prices }}-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="是否有效" name="isUse">
|
||||
<a-radio-group v-model:value="form.isUse">
|
||||
<a-radio :value="1">是</a-radio>
|
||||
@@ -155,7 +169,7 @@
|
||||
<a-form-item label="是否在售" name="isSale">
|
||||
<a-radio-group v-model:value="form.isSale">
|
||||
<a-radio :value="1">是</a-radio>
|
||||
<a-radio :value="2">否</a-radio>
|
||||
<a-radio :value="0">否</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
@@ -175,6 +189,7 @@ import { FormInstance } from "ant-design-vue/es/form";
|
||||
import { FileRecord } from "@/api/system/file/model";
|
||||
import { ThinkSite } from "@/api/think/thinkSite/model";
|
||||
import { IMG_URL } from "@/config/setting";
|
||||
import { listThinkSite } from "@/api/think/thinkSite";
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
@@ -210,9 +225,11 @@ const form = reactive<ThinkVip>({
|
||||
sid: undefined,
|
||||
name: undefined,
|
||||
price: undefined,
|
||||
renewPrice: undefined,
|
||||
desc: undefined,
|
||||
info: undefined,
|
||||
discount: undefined,
|
||||
reportSid: undefined,
|
||||
count: undefined,
|
||||
eachMoney: undefined,
|
||||
term: 1,
|
||||
@@ -245,23 +262,31 @@ const rules = reactive({
|
||||
message: "请填写名称",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
],
|
||||
price: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写价格",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
renewPrice: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写续卡价格",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
reportSid: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择报表归属场馆",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: "done"
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = "";
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
@@ -300,6 +325,12 @@ const save = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const siteList = ref<ThinkSite[]>([])
|
||||
const getSiteList = async () => {
|
||||
siteList.value = await listThinkSite()
|
||||
};
|
||||
getSiteList()
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
<template v-if="column.key === 'price'">
|
||||
<span class="text-orange-500">¥{{ record.price }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'renewPrice'">
|
||||
<span class="text-orange-700">¥{{ record.renewPrice }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'siteNames'">
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>{{ record.siteNames }}</template>
|
||||
@@ -50,13 +53,13 @@
|
||||
</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
<!-- <a-divider type="vertical" />-->
|
||||
<!-- <a-popconfirm-->
|
||||
<!-- title="确定要删除此记录吗?"-->
|
||||
<!-- @confirm="remove(record)"-->
|
||||
<!-- >-->
|
||||
<!-- <a class="ele-text-danger">删除</a>-->
|
||||
<!-- </a-popconfirm>-->
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
@@ -158,6 +161,13 @@
|
||||
sorter: true,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '续卡价格',
|
||||
dataIndex: 'renewPrice',
|
||||
key: 'renewPrice',
|
||||
sorter: true,
|
||||
align: 'center'
|
||||
},
|
||||
// {
|
||||
// title: '会员卡说明',
|
||||
// dataIndex: 'info',
|
||||
|
||||
@@ -9,14 +9,17 @@
|
||||
value-format="YYYY-MM-DD"
|
||||
class="ele-fluid"
|
||||
/>
|
||||
<a-button type="primary" @click="exportExcel">导出</a-button>
|
||||
</a-space>
|
||||
<p class="ele-text-danger font-bold mt-2">总金额:{{totalAmount }}元</p>
|
||||
<p class="ele-text-danger font-bold mt-2">总金额:{{ totalAmount }}元</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from "vue";
|
||||
import { ThinkVipCardsBillsParam } from "@/api/think/thinkVipCardsBills/model";
|
||||
import { thinkVipCardsBillsExport } from "@/api/think/thinkVipCardsBills";
|
||||
import { messageLoading } from "ele-admin-pro/es";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -48,6 +51,21 @@ const search = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const exportExcel = async () => {
|
||||
let dateStart = "", dateEnd = "";
|
||||
if (dateRange.value && dateRange.value?.length > 0) {
|
||||
[dateStart, dateEnd] = dateRange.value;
|
||||
}
|
||||
const hide = messageLoading("导出中...", 0);
|
||||
const { data } = await thinkVipCardsBillsExport({
|
||||
dateStart,
|
||||
dateEnd,
|
||||
isVip: true
|
||||
});
|
||||
hide();
|
||||
window.open(data.url);
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {
|
||||
|
||||
@@ -87,6 +87,7 @@ const datasource: DatasourceFunction = ({
|
||||
where.status = filters.status;
|
||||
}
|
||||
getTotalAmount(where);
|
||||
where.isVip = true
|
||||
return pageThinkVipCardsBills({
|
||||
...where,
|
||||
...orders,
|
||||
@@ -120,8 +121,7 @@ const columns = ref<ColumnItem[]>([
|
||||
},
|
||||
{
|
||||
title: "金额",
|
||||
dataIndex: "amount",
|
||||
key: "amount",
|
||||
dataIndex: ["thinkOrder", 'payPrice'],
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user