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