恢复代码
This commit is contained in:
+2
-2
@@ -2,10 +2,10 @@ VITE_APP_NAME=后台管理系统
|
|||||||
VITE_SOCKET_URL=wss://server.gxwebsoft.com
|
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_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
|
#VITE_THINK_URL=http://127.0.0.1:9099/api
|
||||||
#/booking/bookingItem
|
#/booking/bookingItem
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import request from '@/utils/request';
|
import request from "@/utils/request";
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
import type { ApiResult, PageResult } from "@/api";
|
||||||
import type { ThinkInvoice, ThinkInvoiceParam } from './model';
|
import type { ThinkInvoice, ThinkInvoiceParam } from "./model";
|
||||||
import { THINK_API_URL } from '@/config/setting';
|
import { THINK_API_URL } from "@/config/setting";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
export async function pageThinkInvoice(params: ThinkInvoiceParam) {
|
export async function pageThinkInvoice(params: ThinkInvoiceParam) {
|
||||||
const res = await request.get<ApiResult<PageResult<ThinkInvoice>>>(
|
const res = await request.get<ApiResult<PageResult<ThinkInvoice>>>(
|
||||||
THINK_API_URL + '/think/think-invoice/page',
|
THINK_API_URL + "/think/think-invoice/page",
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@ export async function pageThinkInvoice(params: ThinkInvoiceParam) {
|
|||||||
*/
|
*/
|
||||||
export async function listThinkInvoice(params?: ThinkInvoiceParam) {
|
export async function listThinkInvoice(params?: ThinkInvoiceParam) {
|
||||||
const res = await request.get<ApiResult<ThinkInvoice[]>>(
|
const res = await request.get<ApiResult<ThinkInvoice[]>>(
|
||||||
THINK_API_URL + '/think/think-invoice',
|
THINK_API_URL + "/think/think-invoice",
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ export async function listThinkInvoice(params?: ThinkInvoiceParam) {
|
|||||||
*/
|
*/
|
||||||
export async function addThinkInvoice(data: ThinkInvoice) {
|
export async function addThinkInvoice(data: ThinkInvoice) {
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
THINK_API_URL + '/think/think-invoice',
|
THINK_API_URL + "/think/think-invoice",
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -54,7 +54,7 @@ export async function addThinkInvoice(data: ThinkInvoice) {
|
|||||||
*/
|
*/
|
||||||
export async function updateThinkInvoice(data: ThinkInvoice) {
|
export async function updateThinkInvoice(data: ThinkInvoice) {
|
||||||
const res = await request.put<ApiResult<unknown>>(
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
THINK_API_URL + '/think/think-invoice',
|
THINK_API_URL + "/think/think-invoice",
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -68,7 +68,7 @@ export async function updateThinkInvoice(data: ThinkInvoice) {
|
|||||||
*/
|
*/
|
||||||
export async function removeThinkInvoice(id?: number) {
|
export async function removeThinkInvoice(id?: number) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
THINK_API_URL + '/think/think-invoice/' + id
|
THINK_API_URL + "/think/think-invoice/" + id
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
return res.data.message;
|
return res.data.message;
|
||||||
@@ -81,7 +81,7 @@ export async function removeThinkInvoice(id?: number) {
|
|||||||
*/
|
*/
|
||||||
export async function removeBatchThinkInvoice(data: (number | undefined)[]) {
|
export async function removeBatchThinkInvoice(data: (number | undefined)[]) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
THINK_API_URL + '/think/think-invoice/batch',
|
THINK_API_URL + "/think/think-invoice/batch",
|
||||||
{
|
{
|
||||||
data
|
data
|
||||||
}
|
}
|
||||||
@@ -97,7 +97,17 @@ export async function removeBatchThinkInvoice(data: (number | undefined)[]) {
|
|||||||
*/
|
*/
|
||||||
export async function getThinkInvoice(id: number) {
|
export async function getThinkInvoice(id: number) {
|
||||||
const res = await request.get<ApiResult<ThinkInvoice>>(
|
const res = await request.get<ApiResult<ThinkInvoice>>(
|
||||||
THINK_API_URL + '/think/think-invoice/' + id
|
THINK_API_URL + "/think/think-invoice/" + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function thinkInvoiceData(params?: ThinkInvoiceParam) {
|
||||||
|
const res = await request.get<ApiResult<ThinkInvoice>>(
|
||||||
|
THINK_API_URL + "/think/think-invoice/data", { params }
|
||||||
);
|
);
|
||||||
if (res.data.code === 0 && res.data.data) {
|
if (res.data.code === 0 && res.data.data) {
|
||||||
return res.data.data;
|
return res.data.data;
|
||||||
@@ -110,7 +120,18 @@ export async function getThinkInvoice(id: number) {
|
|||||||
*/
|
*/
|
||||||
export async function doInvoice(data: ThinkInvoice) {
|
export async function doInvoice(data: ThinkInvoice) {
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
THINK_API_URL + '/think/think-invoice/doInvoice',
|
THINK_API_URL + "/think/think-invoice/doInvoice",
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function doInvoiceByListReq(data: ThinkInvoice) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
THINK_API_URL + "/think/think-invoice/doInvoiceByList",
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -124,7 +145,7 @@ export async function doInvoice(data: ThinkInvoice) {
|
|||||||
*/
|
*/
|
||||||
export async function showInvoice(id: number) {
|
export async function showInvoice(id: number) {
|
||||||
const res = await request.get<ApiResult<ThinkInvoice>>(
|
const res = await request.get<ApiResult<ThinkInvoice>>(
|
||||||
THINK_API_URL + '/think/think-invoice/showInvoice/' + id
|
THINK_API_URL + "/think/think-invoice/showInvoice/" + id
|
||||||
);
|
);
|
||||||
if (res.data.code === 0 && res.data.data) {
|
if (res.data.code === 0 && res.data.data) {
|
||||||
return res.data.data;
|
return res.data.data;
|
||||||
|
|||||||
@@ -129,6 +129,16 @@ export async function thinkOrderExport(params?: ThinkOrderParam) {
|
|||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function thinkOrderExportData(params?: ThinkOrderParam) {
|
||||||
|
const res = await request.post<ApiResult<ThinkOrder>>(
|
||||||
|
THINK_API_URL + "/think/think-order/export-data", params
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
export async function getThinkOrder(id: number) {
|
export async function getThinkOrder(id: number) {
|
||||||
const res = await request.get<ApiResult<ThinkOrder>>(
|
const res = await request.get<ApiResult<ThinkOrder>>(
|
||||||
THINK_API_URL + "/think/think-order/" + id
|
THINK_API_URL + "/think/think-order/" + id
|
||||||
@@ -138,3 +148,23 @@ export async function getThinkOrder(id: number) {
|
|||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getThinkOrderExcelData(params?: ThinkOrderParam) {
|
||||||
|
const res = await request.post<ApiResult<ThinkOrder>>(
|
||||||
|
THINK_API_URL + "/think/think-order/excel-data", params
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getThinkOrderExcelDataForCard(params?: ThinkOrderParam) {
|
||||||
|
const res = await request.post<ApiResult<ThinkOrder>>(
|
||||||
|
THINK_API_URL + "/think/think-order/excel-data-for-card", params
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { ThinkUsersVipBuyLog, ThinkUsersVipBuyLogParam } from './model';
|
||||||
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询Vip购卡记录
|
||||||
|
*/
|
||||||
|
export async function pageThinkUsersVipBuyLog(params: ThinkUsersVipBuyLogParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<ThinkUsersVipBuyLog>>>(
|
||||||
|
MODULES_API_URL + '/think/think-users-vip-buy-log/page',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询Vip购卡记录列表
|
||||||
|
*/
|
||||||
|
export async function listThinkUsersVipBuyLog(params?: ThinkUsersVipBuyLogParam) {
|
||||||
|
const res = await request.get<ApiResult<ThinkUsersVipBuyLog[]>>(
|
||||||
|
MODULES_API_URL + '/think/think-users-vip-buy-log',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加Vip购卡记录
|
||||||
|
*/
|
||||||
|
export async function addThinkUsersVipBuyLog(data: ThinkUsersVipBuyLog) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/think/think-users-vip-buy-log',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改Vip购卡记录
|
||||||
|
*/
|
||||||
|
export async function updateThinkUsersVipBuyLog(data: ThinkUsersVipBuyLog) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/think/think-users-vip-buy-log',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除Vip购卡记录
|
||||||
|
*/
|
||||||
|
export async function removeThinkUsersVipBuyLog(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/think/think-users-vip-buy-log/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除Vip购卡记录
|
||||||
|
*/
|
||||||
|
export async function removeBatchThinkUsersVipBuyLog(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/think/think-users-vip-buy-log/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询Vip购卡记录
|
||||||
|
*/
|
||||||
|
export async function getThinkUsersVipBuyLog(id: number) {
|
||||||
|
const res = await request.get<ApiResult<ThinkUsersVipBuyLog>>(
|
||||||
|
MODULES_API_URL + '/think/think-users-vip-buy-log/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vip购卡记录
|
||||||
|
*/
|
||||||
|
export interface ThinkUsersVipBuyLog {
|
||||||
|
//
|
||||||
|
id?: number;
|
||||||
|
//
|
||||||
|
uid?: number;
|
||||||
|
//
|
||||||
|
orderNumber?: string;
|
||||||
|
//
|
||||||
|
wechetNumber?: string;
|
||||||
|
//
|
||||||
|
amount?: string;
|
||||||
|
//
|
||||||
|
payStatus?: number;
|
||||||
|
//
|
||||||
|
payTime?: string;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 注册时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vip购卡记录搜索条件
|
||||||
|
*/
|
||||||
|
export interface ThinkUsersVipBuyLogParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,325 @@
|
|||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="`80%`"
|
||||||
|
:visible="visible"
|
||||||
|
:confirm-loading="loading"
|
||||||
|
title="订单列表"
|
||||||
|
:body-style="{ paddingBottom: '8px', background: '#f3f3f3' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:footer="null"
|
||||||
|
>
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
:scroll="{ x: 800 }"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<a-input v-model:value="keywords" allow-clear @input="reload" style="width: 300px;"
|
||||||
|
placeholder="姓名/手机号搜索"></a-input>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'dateTime'">
|
||||||
|
<div>{{ record.siteName }}</div>
|
||||||
|
<div>{{ record.dateTime }} ¥{{ record.totalPrice }}元</div>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'payType'">
|
||||||
|
<template v-if="record.payStatus == 1">
|
||||||
|
<a-tag v-if="record.payType == 0">余额支付</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 1">
|
||||||
|
<WechatOutlined class="tag-icon" />
|
||||||
|
微信支付
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 2">积分</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 3">
|
||||||
|
<AlipayCircleOutlined class="tag-icon" />
|
||||||
|
支付宝
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 4">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
现金
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 5">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
POS机
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 6">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
VIP月卡
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 7">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
VIP年卡
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 8">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
VIP次卡
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 9">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
IC月卡
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 10">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
IC年卡
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 11">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
IC次卡
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 12">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
免费
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 13">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
VIP充值卡
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 14">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
IC充值卡
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 15">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
积分支付
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 16">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
VIP季卡
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payType == 17">
|
||||||
|
<IdcardOutlined class="tag-icon" />
|
||||||
|
IC季卡
|
||||||
|
</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span></span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'payStatus'">
|
||||||
|
<a-tag v-if="record.payStatus == 2" color="error">
|
||||||
|
<CloseOutlined class="tag-icon" />
|
||||||
|
未付款
|
||||||
|
</a-tag>
|
||||||
|
<a-tag v-if="record.payStatus == 1" color="green">
|
||||||
|
<CheckOutlined class="tag-icon" />
|
||||||
|
已付款
|
||||||
|
</a-tag>
|
||||||
|
<a-tag
|
||||||
|
v-if="record.payStatus == 3 || record.payStatus == 0"
|
||||||
|
color="cyan">
|
||||||
|
<CoffeeOutlined class="tag-icon" />
|
||||||
|
未付款,占场中
|
||||||
|
</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'orderInfo'">
|
||||||
|
{{ record.orderInfoList }}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'code'">
|
||||||
|
<span v-if="record.card">{{ record.card.code }}</span>
|
||||||
|
<span v-if="record.thinkVip">{{ record.thinkVip.code }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'expiredTime'">
|
||||||
|
<span v-if="record.card">{{ dayjs(record.card.expireTime * 1000).format("YYYY-MM-DD HH:mm:ss") }}</span>
|
||||||
|
<span v-if="record.thinkVip">{{ dayjs(record.thinkVip.expireTime * 1000).format("YYYY-MM-DD HH:mm:ss")
|
||||||
|
}}</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref } from "vue";
|
||||||
|
import {
|
||||||
|
CheckOutlined,
|
||||||
|
CloseOutlined,
|
||||||
|
AlipayCircleOutlined
|
||||||
|
} from "@ant-design/icons-vue";
|
||||||
|
import { EleProTable, toDateString } from "ele-admin-pro";
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from "ele-admin-pro/es/ele-pro-table/types";
|
||||||
|
import {
|
||||||
|
pageThinkOrder
|
||||||
|
} from "@/api/think/thinkOrder";
|
||||||
|
import type {
|
||||||
|
ThinkOrder,
|
||||||
|
ThinkOrderParam
|
||||||
|
} from "@/api/think/thinkOrder/model";
|
||||||
|
import { formatNumber } from "ele-admin-pro/es";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
sid: number;
|
||||||
|
createTimeStart: number;
|
||||||
|
createTimeEnd: number;
|
||||||
|
payType: number[];
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: "done"): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit("update:visible", value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<ThinkOrder[]>([]);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
|
||||||
|
const keywords = ref();
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where,
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
if (filters) {
|
||||||
|
where.status = filters.status;
|
||||||
|
}
|
||||||
|
if (keywords.value) {
|
||||||
|
where.keywords = keywords.value;
|
||||||
|
}
|
||||||
|
where.payTypeList = props.payType.join();
|
||||||
|
where.payStatus = 1;
|
||||||
|
where.forAdmin = true;
|
||||||
|
where.sid = props.sid;
|
||||||
|
where.createTimeStart = props.createTimeStart;
|
||||||
|
where.createTimeEnd = props.createTimeEnd;
|
||||||
|
console.log(where, props.sid)
|
||||||
|
return pageThinkOrder({
|
||||||
|
...where,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表格列配置
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: "场馆名称",
|
||||||
|
dataIndex: "siteName",
|
||||||
|
key: "iod",
|
||||||
|
width: 90
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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: "name",
|
||||||
|
key: "name",
|
||||||
|
align: "center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "价格",
|
||||||
|
dataIndex: "totalPrice",
|
||||||
|
key: "totalPrice",
|
||||||
|
align: "center",
|
||||||
|
sorter: true,
|
||||||
|
customRender: ({ text }) => `¥${formatNumber(text)}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "积分",
|
||||||
|
dataIndex: "totalPrice",
|
||||||
|
key: "totalPrice",
|
||||||
|
align: "center",
|
||||||
|
sorter: true,
|
||||||
|
customRender: ({ text }) => `¥${formatNumber(text)}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "支付方式",
|
||||||
|
dataIndex: "payType",
|
||||||
|
key: "payType",
|
||||||
|
align: "center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "预付卡号",
|
||||||
|
key: "code",
|
||||||
|
align: "center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "预付卡到期时间",
|
||||||
|
key: "expiredTime",
|
||||||
|
align: "center",
|
||||||
|
sorter: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: ThinkOrderParam) => {
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: where });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: ThinkOrder) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import * as MenuIcons from "@/layout/menu-icons";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "ThinkOrder",
|
||||||
|
components: MenuIcons
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.tag-icon {
|
||||||
|
padding-right: 6px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<div class="search">
|
||||||
|
<a-space class="flex items-center" :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-range-picker
|
||||||
|
v-model:value="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
class="ele-fluid"
|
||||||
|
/>
|
||||||
|
<a-button @click="search" type="primary">搜索</a-button>
|
||||||
|
<a-button @click="reload">重置</a-button>
|
||||||
|
<a-button class="ele-btn-icon" :disabled="loading" @click="handleExport">
|
||||||
|
<template #icon>
|
||||||
|
<download-outlined />
|
||||||
|
</template>
|
||||||
|
<span>导出报表</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import useSearch from "@/utils/use-search";
|
||||||
|
import { ref, watch } from "vue";
|
||||||
|
import { ThinkOrderInfoParam } from "@/api/think/thinkOrderInfo/model";
|
||||||
|
import { messageLoading } from "ele-admin-pro";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import { thinkOrderExportData } from "@/api/think/thinkOrder";
|
||||||
|
import { ThinkOrder, ThinkOrderParam } from "@/api/think/thinkOrder/model";
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: "search", where?: ThinkOrderInfoParam): void;
|
||||||
|
(e: "reload"): void;
|
||||||
|
(e: "add"): void;
|
||||||
|
(e: "remove"): void;
|
||||||
|
(e: "advanced"): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const { where, resetFields } = useSearch<ThinkOrderParam>({
|
||||||
|
sid: undefined,
|
||||||
|
siteName: undefined,
|
||||||
|
createTimeStart: undefined,
|
||||||
|
createTimeEnd: undefined,
|
||||||
|
timeStart: undefined,
|
||||||
|
timeEnd: undefined,
|
||||||
|
categoryId: undefined,
|
||||||
|
payStatus: undefined,
|
||||||
|
orderStatus: undefined,
|
||||||
|
payType: undefined,
|
||||||
|
isInvoice: undefined,
|
||||||
|
keywords: undefined
|
||||||
|
});
|
||||||
|
// 请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 日期范围选择
|
||||||
|
const dateRange = ref<[string, string]>([dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD 23:59:59')]);
|
||||||
|
const orders = ref<ThinkOrder[] | any[]>();
|
||||||
|
const xlsFileName = ref<string>();
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const search = () => {
|
||||||
|
const [d1, d2] = dateRange.value ?? [];
|
||||||
|
where.createTimeStart = d1 ? dayjs(d1).format('YYYY-MM-DD') : undefined;
|
||||||
|
where.createTimeEnd = d2 ? dayjs(d2).format('YYYY-MM-DD 23:59:59') : undefined;
|
||||||
|
emit("search", {
|
||||||
|
...where
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 重置 */
|
||||||
|
const reload = () => {
|
||||||
|
dateRange.value = [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')];
|
||||||
|
emit('reload')
|
||||||
|
};
|
||||||
|
|
||||||
|
// 导出
|
||||||
|
const handleExport = async () => {
|
||||||
|
const hide = messageLoading("导出中...", 0);
|
||||||
|
const res = await thinkOrderExportData(where);
|
||||||
|
hide();
|
||||||
|
window.open(res.url);
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,285 @@
|
|||||||
|
<template>
|
||||||
|
<div class="page">
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<a-space style="margin-bottom: 1rem">
|
||||||
|
<a-button @click="changeType(0)" :type="type === 0 ? 'primary' : ''">收款汇总表</a-button>
|
||||||
|
<a-button @click="changeType(1)" :type="type === 1 ? 'primary' : ''">收入日报表及汇总表</a-button>
|
||||||
|
</a-space>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<search
|
||||||
|
@search="searchData"
|
||||||
|
@reload="reload"
|
||||||
|
/>
|
||||||
|
<a-table v-if="type === 0"
|
||||||
|
:scroll="{ y: tableHeight }"
|
||||||
|
:data-source="list"
|
||||||
|
:columns="columns"
|
||||||
|
:pagination="false"
|
||||||
|
/>
|
||||||
|
<a-table v-else
|
||||||
|
:scroll="{ y: tableHeight }"
|
||||||
|
:data-source="list"
|
||||||
|
:columns="columns1"
|
||||||
|
:pagination="false"
|
||||||
|
/>
|
||||||
|
</a-spin>
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
<OrderList v-model:visible="showList" v-if="showList" :pay-type="payTypeList" :sid="sid"
|
||||||
|
:create-time-start="createTimeStart"
|
||||||
|
:create-time-end="createTimeEnd" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from "vue";
|
||||||
|
import type {
|
||||||
|
ColumnItem
|
||||||
|
} from "ele-admin-pro/es/ele-pro-table/types";
|
||||||
|
import Search from "./components/search.vue";
|
||||||
|
import {
|
||||||
|
getThinkOrderExcelData, getThinkOrderExcelDataForCard
|
||||||
|
} from "@/api/think/thinkOrder";
|
||||||
|
import type {
|
||||||
|
ThinkOrder, ThinkOrderParam
|
||||||
|
} from "@/api/think/thinkOrder/model";
|
||||||
|
import OrderList from "./components/OrderList.vue";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
|
||||||
|
const type = ref(0);
|
||||||
|
const changeType = (val) => {
|
||||||
|
type.value = val;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
const tableHeight = document.body.clientHeight - 330;
|
||||||
|
console.log(tableHeight);
|
||||||
|
|
||||||
|
const createTimeStart = ref();
|
||||||
|
const createTimeEnd = ref();
|
||||||
|
const list = ref<any[]>([]);
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
list.value = [];
|
||||||
|
if (type.value === 0) {
|
||||||
|
list.value = await getThinkOrderExcelData({
|
||||||
|
createTimeStart: createTimeStart.value ? dayjs(createTimeStart.value).unix() : undefined,
|
||||||
|
createTimeEnd: createTimeEnd.value ? dayjs(createTimeEnd.value).unix() : undefined
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
list.value = await getThinkOrderExcelDataForCard({
|
||||||
|
createTimeStart: createTimeStart.value ? dayjs(createTimeStart.value).unix() : undefined,
|
||||||
|
createTimeEnd: createTimeEnd.value ? dayjs(createTimeEnd.value).unix() : undefined
|
||||||
|
});
|
||||||
|
}
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
createTimeStart.value = dayjs().format("YYYY-MM-DD");
|
||||||
|
createTimeEnd.value = dayjs().format("YYYY-MM-DD 23:59:59");
|
||||||
|
getList();
|
||||||
|
|
||||||
|
const sid = ref<number>(0);
|
||||||
|
const columns1 = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: "场馆名称",
|
||||||
|
dataIndex: "siteName"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "卡类型",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
title: "次卡",
|
||||||
|
dataIndex: "timeCardIncome",
|
||||||
|
customCell: (row) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
console.log(row);
|
||||||
|
payTypeList.value = [8, 11];
|
||||||
|
showList.value = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "期间卡(指月卡、季卡、年卡)",
|
||||||
|
dataIndex: "monthCardIncome",
|
||||||
|
customCell: (row) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
console.log(row);
|
||||||
|
payTypeList.value = [6, 7, 9, 10, 16, 17];
|
||||||
|
showList.value = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "充值卡(会员卡、IC卡)",
|
||||||
|
dataIndex: "chargeCardIncome",
|
||||||
|
customCell: (row) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
console.log(row);
|
||||||
|
payTypeList.value = [13, 14];
|
||||||
|
showList.value = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "散客订单",
|
||||||
|
dataIndex: "guest",
|
||||||
|
customRender: () => 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "其他",
|
||||||
|
dataIndex: "otherIncome",
|
||||||
|
customCell: (row) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
console.log(row);
|
||||||
|
payTypeList.value = [2, 3, 12, 15];
|
||||||
|
showList.value = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "小计",
|
||||||
|
dataIndex: "siteIncome"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
// 表格列配置
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: "场馆名称",
|
||||||
|
dataIndex: "siteName"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "收款方式",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
title: "微信支付",
|
||||||
|
dataIndex: "wechatIncome",
|
||||||
|
customCell: (row) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
sid.value = row.sid;
|
||||||
|
payTypeList.value = [1];
|
||||||
|
showList.value = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "微信支付退款",
|
||||||
|
dataIndex: "wechatRefund",
|
||||||
|
customCell: (row) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
sid.value = row.sid;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "POS机",
|
||||||
|
dataIndex: "posIncome",
|
||||||
|
customCell: (row) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
sid.value = row.sid;
|
||||||
|
payTypeList.value = [5];
|
||||||
|
showList.value = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "对公转账",
|
||||||
|
dataIndex: "businessIncome",
|
||||||
|
customCell: (row) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
sid.value = row.sid;
|
||||||
|
payTypeList.value = [18];
|
||||||
|
showList.value = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "现金收款",
|
||||||
|
dataIndex: "cashIncome",
|
||||||
|
customCell: (row) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
sid.value = row.sid;
|
||||||
|
payTypeList.value = [4];
|
||||||
|
showList.value = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "其他",
|
||||||
|
dataIndex: "otherIncome",
|
||||||
|
customCell: (row) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
sid.value = row.sid;
|
||||||
|
payTypeList.value = [2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
|
||||||
|
showList.value = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "小计",
|
||||||
|
dataIndex: "siteIncome"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const searchData = (param: ThinkOrderParam) => {
|
||||||
|
createTimeStart.value = param.createTimeStart;
|
||||||
|
createTimeEnd.value = param.createTimeEnd;
|
||||||
|
console.log(createTimeEnd.value);
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
createTimeStart.value = dayjs().format("YYYY-MM-DD");
|
||||||
|
createTimeEnd.value = dayjs().format("YYYY-MM-DD");
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
const payTypeList = ref<number[]>([]);
|
||||||
|
const showList = ref(false);
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import * as MenuIcons from "@/layout/menu-icons";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "ThinkOrder",
|
||||||
|
components: MenuIcons
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.tag-icon {
|
||||||
|
padding-right: 6px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -35,12 +35,15 @@
|
|||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="价格" name="price">
|
<a-form-item label="价格" name="price">
|
||||||
<a-input-number
|
<a-space>
|
||||||
allow-clear
|
<a-input-number
|
||||||
placeholder="请输入价格"
|
allow-clear
|
||||||
style="width: 200px"
|
placeholder="请输入价格"
|
||||||
v-model:value="form.price"
|
style="width: 200px"
|
||||||
/>
|
v-model:value="form.price"
|
||||||
|
/>
|
||||||
|
<a-button type="primary" @click="openCal">查看价格日历</a-button>
|
||||||
|
</a-space>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- <a-form-item label="每日不同价格" name="prices">-->
|
<!-- <a-form-item label="每日不同价格" name="prices">-->
|
||||||
<!-- <a-input-number-->
|
<!-- <a-input-number-->
|
||||||
@@ -66,6 +69,7 @@
|
|||||||
<!-- v-model:value="form.halfPrices"-->
|
<!-- v-model:value="form.halfPrices"-->
|
||||||
<!-- />-->
|
<!-- />-->
|
||||||
<!-- </a-form-item>-->
|
<!-- </a-form-item>-->
|
||||||
|
|
||||||
<a-form-item label="儿童价" name="childrenPrice">
|
<a-form-item label="儿童价" name="childrenPrice">
|
||||||
<a-input-number
|
<a-input-number
|
||||||
allow-clear
|
allow-clear
|
||||||
@@ -83,13 +87,13 @@
|
|||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="排序" name="sortNumber">
|
<a-form-item label="排序" name="sort">
|
||||||
<a-input-number
|
<a-input-number
|
||||||
:min="0"
|
:min="0"
|
||||||
: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-item label="是否关闭" name="isStatus">
|
<a-form-item label="是否关闭" name="isStatus">
|
||||||
@@ -114,173 +118,267 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
<ele-modal
|
||||||
|
:width="600"
|
||||||
|
v-model:visible="showCal"
|
||||||
|
:maskClosable="false"
|
||||||
|
title="日期价格"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="showCal = false"
|
||||||
|
>
|
||||||
|
<template #footer>
|
||||||
|
<a-button @click="showCal = false">关闭</a-button>
|
||||||
|
</template>
|
||||||
|
<a-date-picker v-model:value="month" value-format="YYYY-MM" picker="month"/>
|
||||||
|
<div v-for="(item, index) in prices" :key="index">
|
||||||
|
<div style="padding: 1rem 0">
|
||||||
|
<div class="flex justify-start items-center">
|
||||||
|
<span style="width: 120px">{{ index + 1 }}号价格</span>
|
||||||
|
<a-input-number v-model:value="prices[index]" style="width: 300px;" />
|
||||||
|
</div>
|
||||||
|
<p style="color: #999; font-size: 0.8rem"> {{ dayjs(`${month}-${(index + 1)}`).format("YYYY-MM-DD") }}
|
||||||
|
{{ weekStr[dayjs(`${month}-${(index + 1)}`).format("d")] }}的价格,温馨提示:如价格填写0则代表当日免费。</p>
|
||||||
|
</div>
|
||||||
|
<div style="margin-bottom: 1rem">
|
||||||
|
<div class="flex justify-start items-center">
|
||||||
|
<span style="width: 120px">{{ index + 1 }}号半场价格</span>
|
||||||
|
<a-input-number v-model:value="halfPrices[index]" style="width: 300px;" />
|
||||||
|
</div>
|
||||||
|
<p style="color: #999; font-size: 0.8rem"> {{ dayjs(`${month}-${(index + 1)}`).format("YYYY-MM-DD") }}
|
||||||
|
{{ weekStr[dayjs(`${month}-${(index + 1)}`).format("d")]
|
||||||
|
}}的半场价格,温馨提示:如价格填写0则代表当日免费。</p>
|
||||||
|
</div>
|
||||||
|
<a-divider />
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
</ele-modal>
|
</ele-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from "vue";
|
||||||
import { Form, message } from 'ant-design-vue';
|
import { Form, message } from "ant-design-vue";
|
||||||
import { assignObject } from 'ele-admin-pro';
|
import { assignObject } from "ele-admin-pro";
|
||||||
import {
|
import {
|
||||||
addThinkSiteTime,
|
addThinkSiteTime,
|
||||||
updateThinkSiteTime
|
updateThinkSiteTime
|
||||||
} from '@/api/think/thinkSiteTime';
|
} from "@/api/think/thinkSiteTime";
|
||||||
import { ThinkSiteTime } from '@/api/think/thinkSiteTime/model';
|
import { ThinkSiteTime } from "@/api/think/thinkSiteTime/model";
|
||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from "@/store/modules/theme";
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from "pinia";
|
||||||
import { FormInstance, RuleObject } from 'ant-design-vue/es/form';
|
import { FormInstance, RuleObject } from "ant-design-vue/es/form";
|
||||||
import { ThinkSite } from '@/api/think/thinkSite/model';
|
import { ThinkSite } from "@/api/think/thinkSite/model";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
// 是否是修改
|
// 是否是修改
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
// 是否开启响应式布局
|
// 是否开启响应式布局
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
const { styleResponsive } = storeToRefs(themeStore);
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
// 弹窗是否打开
|
// 弹窗是否打开
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
// 场馆ID
|
// 场馆ID
|
||||||
sid?: number;
|
sid?: number;
|
||||||
// 场馆信息
|
// 场馆信息
|
||||||
site?: ThinkSite | null;
|
site?: ThinkSite | null;
|
||||||
// 修改回显的数据
|
// 修改回显的数据
|
||||||
data?: ThinkSiteTime | null;
|
data?: ThinkSiteTime | null;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
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 loading = ref(false);
|
const loading = ref(false);
|
||||||
// 表格选中数据
|
// 表格选中数据
|
||||||
const formRef = ref<FormInstance | null>(null);
|
const formRef = ref<FormInstance | null>(null);
|
||||||
const weekOptions = ref([
|
const weekOptions = ref([
|
||||||
{ label: '星期一', value: '1' },
|
{ label: "星期一", value: "1" },
|
||||||
{ label: '星期二', value: '2' },
|
{ label: "星期二", value: "2" },
|
||||||
{ label: '星期三', value: '3' },
|
{ label: "星期三", value: "3" },
|
||||||
{ label: '星期四', value: '4' },
|
{ label: "星期四", value: "4" },
|
||||||
{ label: '星期五', value: '5' },
|
{ label: "星期五", value: "5" },
|
||||||
{ label: '星期六', value: '6' },
|
{ label: "星期六", value: "6" },
|
||||||
{ label: '星期日', value: '7' }
|
{ label: "星期日", value: "7" }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// 用户信息
|
// 用户信息
|
||||||
const form = reactive<ThinkSiteTime>({
|
const form = reactive<ThinkSiteTime>({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
timePeriod: '',
|
timePeriod: "",
|
||||||
timePeriod1: undefined,
|
timePeriod1: undefined,
|
||||||
timePeriod2: undefined,
|
timePeriod2: undefined,
|
||||||
price: '0',
|
price: "0",
|
||||||
prices: '',
|
prices: "",
|
||||||
halfPrice: '0',
|
halfPrice: "0",
|
||||||
halfPrices: '',
|
halfPrices: "",
|
||||||
childrenPrice: '0',
|
childrenPrice: "0",
|
||||||
week: undefined,
|
week: undefined,
|
||||||
sort: 0,
|
sort: 0,
|
||||||
sid: 0,
|
sid: 0,
|
||||||
isStatus: '1',
|
isStatus: "1",
|
||||||
isFree: '2',
|
isFree: "2",
|
||||||
startTime: ''
|
startTime: ""
|
||||||
});
|
});
|
||||||
|
|
||||||
/* 更新visible */
|
/* 更新visible */
|
||||||
const updateVisible = (value: boolean) => {
|
const updateVisible = (value: boolean) => {
|
||||||
emit('update:visible', value);
|
emit("update:visible", value);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 表单验证规则
|
// 表单验证规则
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
period: [
|
period: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
type: 'string',
|
type: "string",
|
||||||
message: '请填写时段,如红色、L码、远峰蓝、原色钛金属等',
|
message: "请填写时段,如红色、L码、远峰蓝、原色钛金属等",
|
||||||
trigger: 'blur'
|
trigger: "blur"
|
||||||
}
|
|
||||||
],
|
|
||||||
timePeriod: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
type: 'string',
|
|
||||||
message: '请选择时段',
|
|
||||||
trigger: 'blur',
|
|
||||||
validator: async (_rule: RuleObject, value: string) => {
|
|
||||||
if (form.timePeriod1 == undefined || form.timePeriod2 == undefined) {
|
|
||||||
return Promise.reject('请选择时段' + value);
|
|
||||||
}
|
|
||||||
return Promise.resolve();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const { resetFields } = useForm(form, rules);
|
|
||||||
|
|
||||||
/* 保存编辑 */
|
|
||||||
const save = () => {
|
|
||||||
if (!formRef.value) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
formRef.value
|
],
|
||||||
.validate()
|
timePeriod: [
|
||||||
.then(() => {
|
{
|
||||||
loading.value = true;
|
required: true,
|
||||||
form.sid = props.sid;
|
type: "string",
|
||||||
if (!form.sid || form.sid == 0) {
|
message: "请选择时段",
|
||||||
return;
|
trigger: "blur",
|
||||||
|
validator: async (_rule: RuleObject, value: string) => {
|
||||||
|
if (form.timePeriod1 == undefined || form.timePeriod2 == undefined) {
|
||||||
|
return Promise.reject("请选择时段" + value);
|
||||||
}
|
}
|
||||||
form.week = JSON.stringify(form.week);
|
return Promise.resolve();
|
||||||
form.prices = JSON.stringify(form.prices);
|
}
|
||||||
form.halfPrices = JSON.stringify(form.halfPrices);
|
}
|
||||||
form.timePeriod = `${form.timePeriod1} - ${form.timePeriod2}`;
|
]
|
||||||
form.startTime = `${form.timePeriod1?.replace(':', '')}`;
|
});
|
||||||
const formData = {
|
|
||||||
...form
|
|
||||||
};
|
|
||||||
const saveOrUpdate = isUpdate.value
|
|
||||||
? updateThinkSiteTime
|
|
||||||
: addThinkSiteTime;
|
|
||||||
saveOrUpdate(formData)
|
|
||||||
.then((msg) => {
|
|
||||||
loading.value = false;
|
|
||||||
message.success(msg);
|
|
||||||
updateVisible(false);
|
|
||||||
emit('done');
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
loading.value = false;
|
|
||||||
message.error(e.message);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(
|
const { resetFields } = useForm(form, rules);
|
||||||
() => props.visible,
|
|
||||||
(visible) => {
|
/* 保存编辑 */
|
||||||
if (visible) {
|
const save = () => {
|
||||||
if (props.data) {
|
if (!formRef.value) {
|
||||||
assignObject(form, props.data);
|
return;
|
||||||
if (props.data.timePeriod) {
|
}
|
||||||
const strings = props.data.timePeriod.split('-');
|
formRef.value
|
||||||
form.timePeriod1 = strings[0].replace(' ', '');
|
.validate()
|
||||||
form.timePeriod2 = strings[1].replace(' ', '');
|
.then(() => {
|
||||||
}
|
loading.value = true;
|
||||||
if (props.data.week) {
|
const formData = JSON.parse(JSON.stringify(form))
|
||||||
form.week = JSON.parse(props.data.week);
|
formData.sid = props.sid;
|
||||||
}
|
console.log(formData)
|
||||||
isUpdate.value = true;
|
if (!formData.sid || formData.sid == 0) {
|
||||||
|
loading.value = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formData.week = JSON.stringify(formData.week);
|
||||||
|
formData.prices = JSON.stringify({
|
||||||
|
[month.value]: prices.value.map(item => item ? item.toString() : '')
|
||||||
|
});
|
||||||
|
formData.halfPrices = JSON.stringify({
|
||||||
|
[month.value]: halfPrices.value.map(item => item ? item.toString() : '')
|
||||||
|
});
|
||||||
|
formData.timePeriod = `${formData.timePeriod1} - ${formData.timePeriod2}`;
|
||||||
|
formData.startTime = `${formData.timePeriod1?.replace(":", "")}`;
|
||||||
|
console.log(formData)
|
||||||
|
const saveOrUpdate = isUpdate.value
|
||||||
|
? updateThinkSiteTime
|
||||||
|
: addThinkSiteTime;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit("done");
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const month = ref<string>(dayjs().format("YYYY-MM"));
|
||||||
|
const prices = ref<any[]>([]);
|
||||||
|
const halfPrices = ref<any[]>([]);
|
||||||
|
const showCal = ref(false);
|
||||||
|
const openCal = () => {
|
||||||
|
showCal.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const weekStr = ref([
|
||||||
|
"星期日",
|
||||||
|
"星期一",
|
||||||
|
"星期二",
|
||||||
|
"星期三",
|
||||||
|
"星期四",
|
||||||
|
"星期五",
|
||||||
|
"星期六"
|
||||||
|
]);
|
||||||
|
|
||||||
|
const makePrices = () => {
|
||||||
|
const dayNum = dayjs().daysInMonth();
|
||||||
|
prices.value = [];
|
||||||
|
for (let i = 0; i < dayNum; i++) {
|
||||||
|
prices.value.push("");
|
||||||
|
}
|
||||||
|
// console.log(prices.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const makeHalfPrices = () => {
|
||||||
|
const dayNum = dayjs().daysInMonth();
|
||||||
|
halfPrices.value = [];
|
||||||
|
for (let i = 0; i < dayNum; i++) {
|
||||||
|
halfPrices.value.push("");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
loading.value = false;
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if (props.data.timePeriod) {
|
||||||
|
const strings = props.data.timePeriod.split("-");
|
||||||
|
form.timePeriod1 = strings[0].replace(" ", "");
|
||||||
|
form.timePeriod2 = strings[1].replace(" ", "");
|
||||||
|
}
|
||||||
|
if (props.data.week) {
|
||||||
|
form.week = JSON.parse(props.data.week);
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
if (props.data?.prices === "0") {
|
||||||
|
makePrices();
|
||||||
} else {
|
} else {
|
||||||
isUpdate.value = false;
|
const keys = Object.keys(JSON.parse(props.data?.prices))
|
||||||
|
month.value = keys[0]
|
||||||
|
const pricesItem = JSON.parse(props.data?.prices)[month.value];
|
||||||
|
if (pricesItem) prices.value = pricesItem;
|
||||||
|
else makePrices();
|
||||||
|
}
|
||||||
|
if (props.data?.halfPrices === "0") {
|
||||||
|
makeHalfPrices();
|
||||||
|
} else {
|
||||||
|
const keys = Object.keys(JSON.parse(props.data?.prices))
|
||||||
|
month.value = keys[0]
|
||||||
|
const halfPricesItem = JSON.parse(props.data?.halfPrices)[month.value];
|
||||||
|
if (halfPricesItem) halfPrices.value = halfPricesItem;
|
||||||
|
else makeHalfPrices();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
resetFields();
|
isUpdate.value = false;
|
||||||
}
|
}
|
||||||
},
|
} else {
|
||||||
{ immediate: true }
|
resetFields();
|
||||||
);
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
@add="openEdit"
|
@add="openEdit"
|
||||||
@remove="removeBatch"
|
@remove="removeBatch"
|
||||||
@batchMove="openMove"
|
@batchMove="openMove"
|
||||||
|
:openedData="openedData"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
@@ -31,13 +32,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'info'">
|
<template v-if="column.key === 'info'">
|
||||||
<span v-if="record.itype !== 4">{{ record.info }}</span>
|
<span v-if="record.itype !== 4">{{ record.info }}</span>
|
||||||
<span v-else
|
<span v-else>开票金额:{{ record.price }}元,租赁面积:{{ record.size }}㎡,租赁时间:{{ record.rentStartDate
|
||||||
>开票金额:{{ record.price }}元,租赁面积:{{
|
}}~{{ record.rentEndDate }}</span>
|
||||||
record.size
|
|
||||||
}}㎡,租赁时间:{{ record.rentStartDate }}~{{
|
|
||||||
record.rentEndDate
|
|
||||||
}}</span
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space v-if="record.isOpen === 1">
|
<a-space v-if="record.isOpen === 1">
|
||||||
@@ -52,14 +48,18 @@
|
|||||||
<a class="ele-text-danger">删除</a>
|
<a class="ele-text-danger">删除</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
</a-space>
|
</a-space>
|
||||||
|
<p v-else class="text-red-400">
|
||||||
|
<template
|
||||||
|
v-if="record.resJson && record.resJson.includes('本次操作需登录电子发票服务平台,请先使用短信验证码登录')">
|
||||||
|
本次操作需登录电子发票服务平台,请先使用短信验证码登录
|
||||||
|
</template>
|
||||||
|
</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>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a class="ele-text-danger" @click="refuse(record)">拒绝</a>
|
<a class="ele-text-danger" @click="refuse(record)">拒绝</a>
|
||||||
</a-space>
|
</a-space>
|
||||||
<span v-if="record.status === 2" class="ele-text-danger"
|
<span v-if="record.status === 2" class="ele-text-danger">已拒绝</span>
|
||||||
>已拒绝</span
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</ele-pro-table>
|
</ele-pro-table>
|
||||||
@@ -76,256 +76,267 @@
|
|||||||
</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 ThinkInvoiceEdit from './components/thinkInvoiceEdit.vue';
|
import ThinkInvoiceEdit from "./components/thinkInvoiceEdit.vue";
|
||||||
import {
|
import {
|
||||||
pageThinkInvoice,
|
pageThinkInvoice,
|
||||||
removeThinkInvoice,
|
removeThinkInvoice,
|
||||||
removeBatchThinkInvoice,
|
removeBatchThinkInvoice, updateThinkInvoice, doInvoice, thinkInvoiceData
|
||||||
updateThinkInvoice,
|
} from "@/api/think/thinkInvoice";
|
||||||
doInvoice
|
import type {
|
||||||
} from '@/api/think/thinkInvoice';
|
ThinkInvoice,
|
||||||
import type {
|
ThinkInvoiceParam
|
||||||
ThinkInvoice,
|
} from "@/api/think/thinkInvoice/model";
|
||||||
ThinkInvoiceParam
|
import * as InvoiceApi from "@/api/think/thinkInvoice";
|
||||||
} from '@/api/think/thinkInvoice/model';
|
|
||||||
import * as InvoiceApi from '@/api/think/thinkInvoice';
|
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
// 表格选中数据
|
// 表格选中数据
|
||||||
const selection = ref<ThinkInvoice[]>([]);
|
const selection = ref<ThinkInvoice[]>([]);
|
||||||
// 当前编辑数据
|
// 当前编辑数据
|
||||||
const current = ref<ThinkInvoice | null>(null);
|
const current = ref<ThinkInvoice | 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;
|
||||||
|
}
|
||||||
|
where.forAdmin = true;
|
||||||
|
getOpenedData(where);
|
||||||
|
return pageThinkInvoice({
|
||||||
|
...where,
|
||||||
|
...orders,
|
||||||
page,
|
page,
|
||||||
limit,
|
limit
|
||||||
where,
|
});
|
||||||
orders,
|
};
|
||||||
filters
|
|
||||||
}) => {
|
|
||||||
if (filters) {
|
|
||||||
where.status = filters.status;
|
|
||||||
}
|
|
||||||
where.forAdmin = true;
|
|
||||||
return pageThinkInvoice({
|
|
||||||
...where,
|
|
||||||
...orders,
|
|
||||||
page,
|
|
||||||
limit
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 表格列配置
|
const openedData = ref({});
|
||||||
const columns = ref<ColumnItem[]>([
|
const getOpenedData = async (where) => {
|
||||||
{
|
openedData.value = await thinkInvoiceData(where);
|
||||||
title: '操作',
|
};
|
||||||
key: 'action',
|
|
||||||
width: 180,
|
// 表格列配置
|
||||||
fixed: 'left',
|
const columns = ref<ColumnItem[]>([
|
||||||
align: 'center',
|
{
|
||||||
hideInSetting: true
|
title: "操作",
|
||||||
},
|
key: "action",
|
||||||
{
|
width: 180,
|
||||||
title: '订单号',
|
fixed: "left",
|
||||||
dataIndex: 'orderNum',
|
align: "center",
|
||||||
key: 'oid',
|
hideInSetting: true
|
||||||
align: 'center'
|
},
|
||||||
},
|
{
|
||||||
{
|
title: "订单号",
|
||||||
title: '公司名称',
|
dataIndex: "orderNum",
|
||||||
dataIndex: 'name',
|
key: "oid",
|
||||||
key: 'name',
|
align: "center"
|
||||||
align: 'center'
|
},
|
||||||
},
|
{
|
||||||
{
|
title: "公司名称",
|
||||||
title: '发票金额',
|
dataIndex: "name",
|
||||||
dataIndex: 'price',
|
key: "name",
|
||||||
key: 'price',
|
align: "center"
|
||||||
align: 'center'
|
},
|
||||||
},
|
{
|
||||||
{
|
title: "发票金额",
|
||||||
title: '税号',
|
dataIndex: "price",
|
||||||
dataIndex: 'code',
|
key: "price",
|
||||||
key: 'code',
|
align: "center"
|
||||||
align: 'center'
|
},
|
||||||
},
|
{
|
||||||
{
|
title: "税号",
|
||||||
title: '备注信息',
|
dataIndex: "code",
|
||||||
dataIndex: 'info',
|
key: "code",
|
||||||
key: 'info',
|
align: "center"
|
||||||
align: 'center'
|
},
|
||||||
},
|
{
|
||||||
{
|
title: "备注信息",
|
||||||
title: '是否已开',
|
dataIndex: "info",
|
||||||
dataIndex: 'isOpen',
|
key: "info",
|
||||||
key: 'isOpen',
|
align: "center"
|
||||||
align: 'center'
|
},
|
||||||
},
|
{
|
||||||
{
|
title: "是否已开",
|
||||||
title: '发票类型',
|
dataIndex: "isOpen",
|
||||||
dataIndex: 'type',
|
key: "isOpen",
|
||||||
key: 'type',
|
align: "center"
|
||||||
align: 'center',
|
},
|
||||||
customRender: ({ text }) => {
|
{
|
||||||
if (text === 1) {
|
title: "发票类型",
|
||||||
return '电子';
|
dataIndex: "type",
|
||||||
} else {
|
key: "type",
|
||||||
return '纸质';
|
align: "center",
|
||||||
}
|
customRender: ({ text }) => {
|
||||||
|
if (text === 1) {
|
||||||
|
return "纸质";
|
||||||
|
} else {
|
||||||
|
return "电子";
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '开票类型',
|
|
||||||
dataIndex: 'invoicetype',
|
|
||||||
key: 'invoicetype',
|
|
||||||
align: 'center',
|
|
||||||
customRender: ({ text }) => {
|
|
||||||
if (text === 1) {
|
|
||||||
return '普票';
|
|
||||||
} else {
|
|
||||||
return '专票';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '开票时间',
|
|
||||||
dataIndex: 'createTime',
|
|
||||||
key: 'createTime',
|
|
||||||
align: 'center',
|
|
||||||
sorter: true,
|
|
||||||
ellipsis: true,
|
|
||||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
|
||||||
}
|
}
|
||||||
]);
|
},
|
||||||
|
{
|
||||||
|
title: "开票类型",
|
||||||
|
dataIndex: "invoicetype",
|
||||||
|
key: "invoicetype",
|
||||||
|
align: "center",
|
||||||
|
customRender: ({ text }) => {
|
||||||
|
if (text === 1) {
|
||||||
|
return "普票";
|
||||||
|
} else {
|
||||||
|
return "专票";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "开票时间",
|
||||||
|
dataIndex: "createTime",
|
||||||
|
key: "createTime",
|
||||||
|
align: "center",
|
||||||
|
sorter: true,
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
/* 搜索 */
|
/* 搜索 */
|
||||||
const reload = (where?: ThinkInvoiceParam) => {
|
const reload = (where?: ThinkInvoiceParam) => {
|
||||||
selection.value = [];
|
selection.value = [];
|
||||||
tableRef?.value?.reload({ where: where });
|
tableRef?.value?.reload({ where: where });
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 打开编辑弹窗 */
|
/* 打开编辑弹窗 */
|
||||||
const openEdit = (row?: ThinkInvoice) => {
|
const openEdit = (row?: ThinkInvoice) => {
|
||||||
current.value = row ?? null;
|
current.value = row ?? null;
|
||||||
showEdit.value = true;
|
showEdit.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const openInvoicePdf = (row: ThinkInvoice) => {
|
const openInvoicePdf = (row: ThinkInvoice) => {
|
||||||
const hide = message.loading('请求中..', 0);
|
if (row.url) {
|
||||||
InvoiceApi.showInvoice(row?.id).then((res) => {
|
window.open(row.url);
|
||||||
const parse = JSON.parse(res);
|
return;
|
||||||
const pdfUrl = parse[0].pdfUrl;
|
}
|
||||||
|
const hide = message.loading("请求中..", 0);
|
||||||
|
InvoiceApi.showInvoice(row?.id).then((res) => {
|
||||||
|
const parse = JSON.parse(res);
|
||||||
|
hide();
|
||||||
|
console.log(parse[0]);
|
||||||
|
if (parseInt(parse[0].status) === 20) return message.error("开票中,请稍后查看");
|
||||||
|
else if (parseInt(parse[0].status) === 22) return message.error(`开票失败: ${parse[0].failCause}`);
|
||||||
|
const pdfUrl = parse[0].pdfUrl;
|
||||||
|
window.open(pdfUrl);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: ThinkInvoice) => {
|
||||||
|
const hide = message.loading("请求中..", 0);
|
||||||
|
removeThinkInvoice(row.id)
|
||||||
|
.then((msg) => {
|
||||||
hide();
|
hide();
|
||||||
window.open(pdfUrl);
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 打开批量移动弹窗 */
|
/* 批量删除 */
|
||||||
const openMove = () => {
|
const removeBatch = () => {
|
||||||
showMove.value = true;
|
if (!selection.value.length) {
|
||||||
};
|
message.error("请至少选择一条数据");
|
||||||
|
return;
|
||||||
/* 删除单个 */
|
}
|
||||||
const remove = (row: ThinkInvoice) => {
|
Modal.confirm({
|
||||||
const hide = message.loading('请求中..', 0);
|
title: "提示",
|
||||||
removeThinkInvoice(row.id)
|
content: "确定要删除选中的记录吗?",
|
||||||
.then((msg) => {
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
hide();
|
maskClosable: true,
|
||||||
message.success(msg);
|
onOk: () => {
|
||||||
reload();
|
const hide = message.loading("请求中..", 0);
|
||||||
})
|
removeBatchThinkInvoice(selection.value.map((d) => d.id))
|
||||||
.catch((e) => {
|
.then((msg) => {
|
||||||
hide();
|
hide();
|
||||||
message.error(e.message);
|
message.success(msg);
|
||||||
});
|
reload();
|
||||||
};
|
})
|
||||||
|
.catch((e) => {
|
||||||
/* 批量删除 */
|
hide();
|
||||||
const removeBatch = () => {
|
message.error(e.message);
|
||||||
if (!selection.value.length) {
|
});
|
||||||
message.error('请至少选择一条数据');
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
Modal.confirm({
|
});
|
||||||
title: '提示',
|
};
|
||||||
content: '确定要删除选中的记录吗?',
|
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
|
||||||
maskClosable: true,
|
|
||||||
onOk: () => {
|
|
||||||
const hide = message.loading('请求中..', 0);
|
|
||||||
removeBatchThinkInvoice(selection.value.map((d) => d.id))
|
|
||||||
.then((msg) => {
|
|
||||||
hide();
|
|
||||||
message.success(msg);
|
|
||||||
reload();
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
hide();
|
|
||||||
message.error(e.message);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 查询 */
|
/* 查询 */
|
||||||
const query = () => {
|
const query = () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const openInvoice = async (row: ThinkInvoice) => {
|
const openInvoice = async (row: ThinkInvoice) => {
|
||||||
await doInvoice(row);
|
await doInvoice(row);
|
||||||
message.success('操作成功');
|
message.success("操作成功");
|
||||||
reload();
|
reload();
|
||||||
};
|
};
|
||||||
|
|
||||||
const refuse = async (row: ThinkInvoice) => {
|
const refuse = async (row: ThinkInvoice) => {
|
||||||
await updateThinkInvoice({
|
await updateThinkInvoice({
|
||||||
id: row.id,
|
id: row.id,
|
||||||
status: 2
|
status: 2
|
||||||
});
|
});
|
||||||
message.success('操作成功');
|
message.success("操作成功");
|
||||||
reload();
|
reload();
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 自定义行属性 */
|
/* 自定义行属性 */
|
||||||
const customRow = (record: ThinkInvoice) => {
|
const customRow = (record: ThinkInvoice) => {
|
||||||
return {
|
return {
|
||||||
// 行点击事件
|
// 行点击事件
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
// console.log(record);
|
// console.log(record);
|
||||||
},
|
},
|
||||||
// 行双击事件
|
// 行双击事件
|
||||||
onDblclick: () => {
|
onDblclick: () => {
|
||||||
openEdit(record);
|
openEdit(record);
|
||||||
}
|
}
|
||||||
};
|
|
||||||
};
|
};
|
||||||
query();
|
};
|
||||||
|
query();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export default {
|
export default {
|
||||||
name: 'ThinkInvoice'
|
name: "ThinkInvoice"
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
|||||||
@@ -0,0 +1,260 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<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="phone">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入手机号码"
|
||||||
|
v-model:value="form.phone"
|
||||||
|
/>
|
||||||
|
</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="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="2">ic卡发票</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="发票类型" name="invoicetype">
|
||||||
|
<a-radio-group v-model:value="form.invoicetype">
|
||||||
|
<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 {
|
||||||
|
doInvoiceByListReq
|
||||||
|
} 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";
|
||||||
|
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: any;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
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,
|
||||||
|
orderIdList: []
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit("update:visible", value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
price: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请填写发票金额",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
name: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: "string",
|
||||||
|
message: "请填写单位名称",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
code: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: "string",
|
||||||
|
message: "请填写税号",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
phone: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: "string",
|
||||||
|
message: "请填写手机号",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
doInvoiceByListReq(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) {
|
||||||
|
form.price = props.data?.price;
|
||||||
|
form.orderIdList = props.data?.orderIdList;
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
@@ -1,265 +1,248 @@
|
|||||||
<!-- 搜索表单 -->
|
<!-- 搜索表单 -->
|
||||||
<template>
|
<template>
|
||||||
<a-space class="flex items-center" :size="10" style="flex-wrap: wrap">
|
<div class="flex flex-col justify-start items-start">
|
||||||
<span class="text-gray-400">付款状态</span>
|
|
||||||
<a-select
|
|
||||||
v-model:value="where.payStatus"
|
<a-space class="flex items-center" :size="10" style="flex-wrap: wrap">
|
||||||
style="width: 150px"
|
<span class="text-gray-400">付款状态</span>
|
||||||
placeholder="付款状态筛选"
|
<a-select v-model:value="where.payStatus" style="width: 150px" placeholder="付款状态筛选" @change="search">
|
||||||
@change="search"
|
<a-select-option value="">全部</a-select-option>
|
||||||
>
|
<a-select-option :value="1">已付款</a-select-option>
|
||||||
<a-select-option value="">全部</a-select-option>
|
<a-select-option :value="2">未付款</a-select-option>
|
||||||
<a-select-option :value="1">已付款</a-select-option>
|
</a-select>
|
||||||
<a-select-option :value="2">未付款</a-select-option>
|
<span class="text-gray-400">订单状态</span>
|
||||||
</a-select>
|
<a-select v-model:value="where.orderStatus" style="width: 150px" placeholder="订单状态筛选" @change="search">
|
||||||
<span class="text-gray-400">订单状态</span>
|
<a-select-option value="">全部</a-select-option>
|
||||||
<a-select
|
<a-select-option :value="1">已完成</a-select-option>
|
||||||
v-model:value="where.orderStatus"
|
<a-select-option :value="2">未使用</a-select-option>
|
||||||
style="width: 150px"
|
<a-select-option :value="3">已取消</a-select-option>
|
||||||
placeholder="订单状态筛选"
|
<a-select-option :value="4">退款中</a-select-option>
|
||||||
@change="search"
|
<a-select-option :value="5">退款被拒</a-select-option>
|
||||||
>
|
<a-select-option :value="6">退款成功</a-select-option>
|
||||||
<a-select-option value="">全部</a-select-option>
|
</a-select>
|
||||||
<a-select-option :value="1">已完成</a-select-option>
|
<span class="text-gray-400">付款方式</span>
|
||||||
<a-select-option :value="2">未使用</a-select-option>
|
<a-select v-model:value="where.payType" style="width: 150px" placeholder="付款方式筛选" @change="search">
|
||||||
<a-select-option :value="3">已取消</a-select-option>
|
<a-select-option value="">全部</a-select-option>
|
||||||
<a-select-option :value="4">退款中</a-select-option>
|
<a-select-option :value="1">微信支付</a-select-option>
|
||||||
<a-select-option :value="5">退款被拒</a-select-option>
|
<a-select-option :value="2">余额支付</a-select-option>
|
||||||
<a-select-option :value="6">退款成功</a-select-option>
|
<a-select-option :value="3">支付宝</a-select-option>
|
||||||
</a-select>
|
<a-select-option :value="4">现金</a-select-option>
|
||||||
<span class="text-gray-400">付款方式</span>
|
<a-select-option :value="5">POS机</a-select-option>
|
||||||
<a-select
|
<a-select-option :value="6">VIP月卡</a-select-option>
|
||||||
v-model:value="where.payType"
|
<a-select-option :value="7">VIP年卡</a-select-option>
|
||||||
style="width: 150px"
|
<a-select-option :value="8">VIP次卡</a-select-option>
|
||||||
placeholder="付款方式筛选"
|
<a-select-option :value="9">IC月卡</a-select-option>
|
||||||
@change="search"
|
<a-select-option :value="10">IC年卡</a-select-option>
|
||||||
>
|
<a-select-option :value="11">IC次卡</a-select-option>
|
||||||
<a-select-option value="">全部</a-select-option>
|
<a-select-option :value="12">免费</a-select-option>
|
||||||
<a-select-option :value="1">微信支付</a-select-option>
|
<a-select-option :value="13">VIP充值卡</a-select-option>
|
||||||
<a-select-option :value="2">余额支付</a-select-option>
|
<a-select-option :value="14">IC充值卡</a-select-option>
|
||||||
<a-select-option :value="3">支付宝</a-select-option>
|
<a-select-option :value="15">积分支付</a-select-option>
|
||||||
<a-select-option :value="4">现金</a-select-option>
|
<a-select-option :value="16">VIP季卡</a-select-option>
|
||||||
<a-select-option :value="5">POS机</a-select-option>
|
<a-select-option :value="17">IC季卡</a-select-option>
|
||||||
<a-select-option :value="6">VIP月卡</a-select-option>
|
</a-select>
|
||||||
<a-select-option :value="7">VIP年卡</a-select-option>
|
<span class="text-gray-400">开票状态</span>
|
||||||
<a-select-option :value="8">VIP次卡</a-select-option>
|
<a-select v-model:value="where.isInvoice" style="width: 150px" placeholder="开票状态筛选" @change="search">
|
||||||
<a-select-option :value="9">IC月卡</a-select-option>
|
<a-select-option value="1">已开票</a-select-option>
|
||||||
<a-select-option :value="10">IC年卡</a-select-option>
|
<a-select-option :value="2">未开票</a-select-option>
|
||||||
<a-select-option :value="11">IC次卡</a-select-option>
|
<a-select-option :value="3">不能开票</a-select-option>
|
||||||
<a-select-option :value="12">免费</a-select-option>
|
</a-select>
|
||||||
<a-select-option :value="13">VIP充值卡</a-select-option>
|
<ThinkSelectSite
|
||||||
<a-select-option :value="14">IC充值卡</a-select-option>
|
:placeholder="`选择场馆`"
|
||||||
<a-select-option :value="15">积分支付</a-select-option>
|
class="input-item"
|
||||||
<a-select-option :value="16">VIP季卡</a-select-option>
|
v-model:value="where.siteName"
|
||||||
<a-select-option :value="17">IC季卡</a-select-option>
|
@done="chooseSiteId"
|
||||||
</a-select>
|
/>
|
||||||
<span class="text-gray-400">开票状态</span>
|
<a-range-picker
|
||||||
<a-select
|
v-model:value="dateRange"
|
||||||
v-model:value="where.isInvoice"
|
@change="search"
|
||||||
style="width: 150px"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="开票状态筛选"
|
class="ele-fluid"
|
||||||
@change="search"
|
/>
|
||||||
>
|
<a-input-search
|
||||||
<a-select-option value="1">已开票</a-select-option>
|
allow-clear
|
||||||
<a-select-option :value="2">未开票</a-select-option>
|
placeholder="请输入订单号|编号|手机号"
|
||||||
<a-select-option :value="3">不能开票</a-select-option>
|
v-model:value="where.keywords"
|
||||||
</a-select>
|
@pressEnter="search"
|
||||||
<ThinkSelectSite
|
@search="search"
|
||||||
:placeholder="`选择场馆`"
|
style="width: 380px"
|
||||||
class="input-item"
|
/>
|
||||||
v-model:value="where.siteName"
|
</a-space>
|
||||||
@done="chooseSiteId"
|
<div class="mt-2">
|
||||||
/>
|
<a-space>
|
||||||
<a-range-picker
|
<a-button @click="reset">重置</a-button>
|
||||||
v-model:value="dateRange"
|
<a-button @click="setHasInvoice" :disabled="!selection?.length">设置已开票</a-button>
|
||||||
@change="search"
|
<a-button @click="openInvoiceByList" :disabled="!selection?.length" type="primary">合并开票</a-button>
|
||||||
value-format="YYYY-MM-DD"
|
</a-space>
|
||||||
class="ele-fluid"
|
</div>
|
||||||
/>
|
</div>
|
||||||
<a-input-search
|
|
||||||
allow-clear
|
|
||||||
placeholder="请输入订单号|编号|手机号"
|
|
||||||
v-model:value="where.keywords"
|
|
||||||
@pressEnter="search"
|
|
||||||
@search="search"
|
|
||||||
style="width: 380px"
|
|
||||||
/>
|
|
||||||
<a-button @click="reset">重置</a-button>
|
|
||||||
<a-button @click="setHasInvoice" :disabled="!selection?.length"
|
|
||||||
>设置已开票</a-button
|
|
||||||
>
|
|
||||||
<!-- <a-button class="ele-btn-icon" :disabled="loading" @click="handleExport">-->
|
|
||||||
<!-- <template #icon>-->
|
|
||||||
<!-- <download-outlined />-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- <span>导出订单</span>-->
|
|
||||||
<!-- </a-button>-->
|
|
||||||
</a-space>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import useSearch from '@/utils/use-search';
|
import useSearch from "@/utils/use-search";
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from "vue";
|
||||||
import { ThinkOrderInfoParam } from '@/api/think/thinkOrderInfo/model';
|
import { ThinkOrderInfoParam } from "@/api/think/thinkOrderInfo/model";
|
||||||
import { utils, writeFile } from 'xlsx';
|
import { utils, writeFile } from "xlsx";
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from "ant-design-vue";
|
||||||
import { toDateString } from 'ele-admin-pro';
|
import { toDateString } from "ele-admin-pro";
|
||||||
import dayjs from 'dayjs';
|
import dayjs from "dayjs";
|
||||||
import {
|
import { listThinkOrder, updateThinkOrder } from "@/api/think/thinkOrder";
|
||||||
listThinkOrder,
|
import { ThinkOrder, ThinkOrderParam } from "@/api/think/thinkOrder/model";
|
||||||
updateBatchThinkOrder,
|
import { ThinkSite } from "@/api/think/thinkSite/model";
|
||||||
updateThinkOrder
|
|
||||||
} from '@/api/think/thinkOrder';
|
|
||||||
import { ThinkOrder, ThinkOrderParam } from '@/api/think/thinkOrder/model';
|
|
||||||
import { ThinkSite } from '@/api/think/thinkSite/model';
|
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
// 选中的角色
|
// 选中的角色
|
||||||
selection?: ThinkOrder[];
|
selection?: ThinkOrder[];
|
||||||
}>(),
|
}>(),
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'search', where?: ThinkOrderInfoParam): void;
|
(e: "search", where?: ThinkOrderInfoParam): void;
|
||||||
(e: 'add'): void;
|
(e: "add"): void;
|
||||||
(e: 'remove'): void;
|
(e: "remove"): void;
|
||||||
(e: 'advanced'): void;
|
(e: "advanced"): void;
|
||||||
}>();
|
(e: "invoice"): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const { where, resetFields } = useSearch<ThinkOrderParam>({
|
const { where, resetFields } = useSearch<ThinkOrderParam>({
|
||||||
sid: undefined,
|
sid: undefined,
|
||||||
siteName: undefined,
|
siteName: undefined,
|
||||||
createTimeStart: undefined,
|
createTimeStart: undefined,
|
||||||
createTimeEnd: undefined,
|
createTimeEnd: undefined,
|
||||||
timeStart: undefined,
|
timeStart: undefined,
|
||||||
timeEnd: undefined,
|
timeEnd: undefined,
|
||||||
categoryId: undefined,
|
categoryId: undefined,
|
||||||
keywords: undefined,
|
keywords: undefined,
|
||||||
payStatus: undefined,
|
payStatus: undefined,
|
||||||
orderStatus: undefined,
|
orderStatus: undefined,
|
||||||
payType: undefined,
|
payType: undefined,
|
||||||
isInvoice: undefined
|
isInvoice: undefined
|
||||||
|
});
|
||||||
|
// 请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 日期范围选择
|
||||||
|
const dateRange = ref<[string, string]>(["", ""]);
|
||||||
|
const orders = ref<ThinkOrder[] | any[]>();
|
||||||
|
const xlsFileName = ref<string>();
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const search = () => {
|
||||||
|
const [d1, d2] = dateRange.value ?? [];
|
||||||
|
xlsFileName.value = `${d1}至${d2}`;
|
||||||
|
where.timeStart = d1 ? dayjs(d1).valueOf() / 1000 : undefined;
|
||||||
|
where.timeEnd = d2 ? dayjs(d2 + " 23:59:59").valueOf() / 1000 : undefined;
|
||||||
|
// where.createTimeStart = d1 ? d1 + ' 00:00:00' : undefined;
|
||||||
|
// where.createTimeEnd = d2 ? d2 + ' 00:00:00' : undefined;
|
||||||
|
emit("search", {
|
||||||
|
...where
|
||||||
});
|
});
|
||||||
// 请求状态
|
};
|
||||||
const loading = ref(false);
|
|
||||||
// 日期范围选择
|
|
||||||
const dateRange = ref<[string, string]>(['', '']);
|
|
||||||
const orders = ref<ThinkOrder[] | any[]>();
|
|
||||||
const xlsFileName = ref<string>();
|
|
||||||
|
|
||||||
/* 搜索 */
|
const chooseSiteId = (data: ThinkSite) => {
|
||||||
const search = () => {
|
where.sid = data.id;
|
||||||
const [d1, d2] = dateRange.value ?? [];
|
where.siteName = data.name;
|
||||||
xlsFileName.value = `${d1}至${d2}`;
|
search();
|
||||||
where.timeStart = d1 ? dayjs(d1).valueOf() / 1000 : undefined;
|
};
|
||||||
where.timeEnd = d2 ? dayjs(d2).valueOf() / 1000 : undefined;
|
|
||||||
// where.createTimeStart = d1 ? d1 + ' 00:00:00' : undefined;
|
|
||||||
// where.createTimeEnd = d2 ? d2 + ' 00:00:00' : undefined;
|
|
||||||
emit('search', {
|
|
||||||
...where
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const chooseSiteId = (data: ThinkSite) => {
|
/* 重置 */
|
||||||
where.sid = data.id;
|
const reset = () => {
|
||||||
where.siteName = data.name;
|
resetFields();
|
||||||
search();
|
search();
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 重置 */
|
// 导出
|
||||||
const reset = () => {
|
const handleExport = async () => {
|
||||||
resetFields();
|
loading.value = true;
|
||||||
search();
|
const array: (string | number)[][] = [
|
||||||
};
|
[
|
||||||
|
"订单号",
|
||||||
// 导出
|
"订单编号",
|
||||||
const handleExport = async () => {
|
"姓名",
|
||||||
loading.value = true;
|
"电话号码",
|
||||||
const array: (string | number)[][] = [
|
"预定信息",
|
||||||
[
|
"消费金额",
|
||||||
'订单号',
|
"实付金额",
|
||||||
'订单编号',
|
"下单日期"
|
||||||
'姓名',
|
]
|
||||||
'电话号码',
|
];
|
||||||
'预定信息',
|
if (!where.timeStart) {
|
||||||
'消费金额',
|
message.error("请选择导出的开始日期、结束日期,每次最多导出5000条记录");
|
||||||
'实付金额',
|
return false;
|
||||||
'下单日期'
|
}
|
||||||
]
|
await listThinkOrder(where)
|
||||||
];
|
.then((list) => {
|
||||||
if (!where.timeStart) {
|
orders.value = list;
|
||||||
message.error('请选择导出的开始日期、结束日期,每次最多导出5000条记录');
|
orders.value?.forEach((d: ThinkOrder) => {
|
||||||
return false;
|
array.push([
|
||||||
}
|
`${d.id}`,
|
||||||
await listThinkOrder(where)
|
`${d.orderNum}`,
|
||||||
.then((list) => {
|
`${d.name}`,
|
||||||
orders.value = list;
|
`${d.phone}`,
|
||||||
orders.value?.forEach((d: ThinkOrder) => {
|
`${d.siteName} ${d.dateTime} ${d.totalPrice}`,
|
||||||
array.push([
|
`${d.totalPrice}`,
|
||||||
`${d.id}`,
|
`${d.payPrice}`,
|
||||||
`${d.orderNum}`,
|
`${toDateString(d.payTime)}`
|
||||||
`${d.name}`,
|
]);
|
||||||
`${d.phone}`,
|
});
|
||||||
`${d.siteName} ${d.dateTime} ${d.totalPrice}`,
|
const sheetName = `订单数据导出`;
|
||||||
`${d.totalPrice}`,
|
const workbook = {
|
||||||
`${d.payPrice}`,
|
SheetNames: [sheetName],
|
||||||
`${toDateString(d.payTime)}`
|
Sheets: {}
|
||||||
]);
|
};
|
||||||
});
|
const sheet = utils.aoa_to_sheet(array);
|
||||||
const sheetName = `订单数据导出`;
|
workbook.Sheets[sheetName] = sheet;
|
||||||
const workbook = {
|
// 设置列宽
|
||||||
SheetNames: [sheetName],
|
sheet["!cols"] = [
|
||||||
Sheets: {}
|
{ wch: 10 },
|
||||||
};
|
{ wch: 10 },
|
||||||
const sheet = utils.aoa_to_sheet(array);
|
{ wch: 10 },
|
||||||
workbook.Sheets[sheetName] = sheet;
|
{ wch: 10 },
|
||||||
// 设置列宽
|
{ wch: 20 },
|
||||||
sheet['!cols'] = [
|
{ wch: 40 },
|
||||||
{ wch: 10 },
|
{ wch: 10 }
|
||||||
{ wch: 10 },
|
];
|
||||||
{ wch: 10 },
|
message.loading("正在导出...");
|
||||||
{ wch: 10 },
|
setTimeout(() => {
|
||||||
{ wch: 20 },
|
writeFile(
|
||||||
{ wch: 40 },
|
workbook,
|
||||||
{ wch: 10 }
|
`${
|
||||||
];
|
where.createTimeEnd ? xlsFileName.value + "_" : ""
|
||||||
message.loading('正在导出...');
|
}${sheetName}.xlsx`
|
||||||
setTimeout(() => {
|
);
|
||||||
writeFile(
|
|
||||||
workbook,
|
|
||||||
`${
|
|
||||||
where.createTimeEnd ? xlsFileName.value + '_' : ''
|
|
||||||
}${sheetName}.xlsx`
|
|
||||||
);
|
|
||||||
loading.value = false;
|
|
||||||
}, 2000);
|
|
||||||
})
|
|
||||||
.catch((msg) => {
|
|
||||||
message.error(msg);
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
})
|
}, 2000);
|
||||||
.finally(() => {});
|
})
|
||||||
};
|
.catch((msg) => {
|
||||||
|
message.error(msg);
|
||||||
|
loading.value = false;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const setHasInvoice = async () => {
|
const setHasInvoice = async () => {
|
||||||
const hide = message.loading('请求中..', 0);
|
const hide = message.loading("请求中..", 0);
|
||||||
if (props.selection) {
|
if (props.selection) {
|
||||||
props.selection
|
props.selection.filter(item => item.isInvoice === 2).map(async item => {
|
||||||
.filter((item) => item.isInvoice === 2)
|
item.isInvoice = 1;
|
||||||
.map(async (item) => {
|
await updateThinkOrder(item);
|
||||||
item.isInvoice = 1;
|
});
|
||||||
await updateThinkOrder(item);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
hide();
|
|
||||||
message.success('设置成功');
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(
|
}
|
||||||
() => props.selection,
|
hide();
|
||||||
() => {}
|
message.success("设置成功");
|
||||||
);
|
};
|
||||||
|
|
||||||
|
const openInvoiceByList = async () => {
|
||||||
|
emit("invoice");
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
@add="openEdit"
|
@add="openEdit"
|
||||||
@remove="removeBatch"
|
@remove="removeBatch"
|
||||||
@batchMove="openMove"
|
@batchMove="openMove"
|
||||||
|
@invoice="openInvoiceByList"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
@@ -145,7 +146,8 @@
|
|||||||
<IdcardOutlined class="tag-icon" />
|
<IdcardOutlined class="tag-icon" />
|
||||||
IC会员卡
|
IC会员卡
|
||||||
</a-tag>
|
</a-tag>
|
||||||
<a-tag v-if="record.couponType == 11" color="blue">
|
<a-tag v-if="record.couponType == 11" color="blue"
|
||||||
|
>
|
||||||
<IdcardOutlined class="tag-icon" />
|
<IdcardOutlined class="tag-icon" />
|
||||||
免费订单
|
免费订单
|
||||||
</a-tag>
|
</a-tag>
|
||||||
@@ -177,8 +179,7 @@
|
|||||||
</a-tag>
|
</a-tag>
|
||||||
<a-tag
|
<a-tag
|
||||||
v-if="record.payStatus == 3 || record.payStatus == 0"
|
v-if="record.payStatus == 3 || record.payStatus == 0"
|
||||||
color="cyan"
|
color="cyan">
|
||||||
>
|
|
||||||
<CoffeeOutlined class="tag-icon" />
|
<CoffeeOutlined class="tag-icon" />
|
||||||
未付款,占场中
|
未付款,占场中
|
||||||
</a-tag>
|
</a-tag>
|
||||||
@@ -188,29 +189,20 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'orderStatus'">
|
<template v-if="column.key === 'orderStatus'">
|
||||||
<span v-if="record.orderStatus == 1" class="ele-text-success"
|
<span v-if="record.orderStatus == 1" class="ele-text-success"
|
||||||
>已完成</span
|
>已完成</span>
|
||||||
>
|
|
||||||
<span v-if="record.orderStatus == 2" class="ele-text-placeholder"
|
<span v-if="record.orderStatus == 2" class="ele-text-placeholder"
|
||||||
>未使用</span
|
>未使用</span>
|
||||||
>
|
|
||||||
<span v-if="record.orderStatus == 3" class="ele-text-placeholder"
|
<span v-if="record.orderStatus == 3" class="ele-text-placeholder"
|
||||||
>已取消</span
|
>已取消</span>
|
||||||
>
|
|
||||||
<span v-if="record.orderStatus == 4" class="ele-text-warning"
|
<span v-if="record.orderStatus == 4" class="ele-text-warning"
|
||||||
>退款申请中</span
|
>退款申请中</span>
|
||||||
>
|
|
||||||
<span v-if="record.orderStatus == 5" class="ele-text-danger"
|
<span v-if="record.orderStatus == 5" class="ele-text-danger"
|
||||||
>退款被拒绝</span
|
>退款被拒绝</span>
|
||||||
>
|
<span v-if="record.orderStatus == 6" class="ele-text-heading">退款成功</span>
|
||||||
<span v-if="record.orderStatus == 6" class="ele-text-heading"
|
|
||||||
>退款成功</span
|
|
||||||
>
|
|
||||||
<span v-if="record.orderStatus == 7" class="ele-text-warning"
|
<span v-if="record.orderStatus == 7" class="ele-text-warning"
|
||||||
>客户端申请退款</span
|
>客户端申请退款</span>
|
||||||
>
|
|
||||||
<span v-if="record.orderStatus == 9" class="ele-text-warning"
|
<span v-if="record.orderStatus == 9" class="ele-text-warning"
|
||||||
>未完成</span
|
>未完成</span>
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'isInvoice'">
|
<template v-if="column.key === 'isInvoice'">
|
||||||
<a-tag
|
<a-tag
|
||||||
@@ -218,14 +210,14 @@
|
|||||||
color="green"
|
color="green"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
@click="openInvoicePdf(record)"
|
@click="openInvoicePdf(record)"
|
||||||
>已开票
|
>已开票
|
||||||
</a-tag>
|
</a-tag>
|
||||||
<a-tag
|
<a-tag
|
||||||
v-if="record.isInvoice == 2"
|
v-if="record.isInvoice == 2"
|
||||||
color="red"
|
color="red"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
@click="onInvoice(record)"
|
@click="onInvoice(record)"
|
||||||
>未开票
|
>未开票
|
||||||
</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>
|
||||||
@@ -237,15 +229,16 @@
|
|||||||
<a-space>
|
<a-space>
|
||||||
<a @click="openEdit(record)">详情</a>
|
<a @click="openEdit(record)">详情</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a
|
<template v-if="record.isInvoice == 2 && record.payStatus == 1 && [1, 2].includes(record.orderStatus)">
|
||||||
@click="openRefund(record)"
|
<a @click="onInvoice(record)">开票</a>
|
||||||
v-if="
|
<a-divider type="vertical" />
|
||||||
record.payStatus === 1 &&
|
</template>
|
||||||
[1, 3].includes(record.payType) &&
|
<template
|
||||||
[1, 2].includes(record.orderStatus)
|
v-if="record.payStatus === 1 && [1, 2].includes(record.orderStatus) && hasPermission('think:order:refund')">
|
||||||
"
|
<a class="ele-text-danger" @click="openRefund(record)"
|
||||||
>退款</a
|
v-if="dayjs(record.thinkOrderInfos[0].startTime * 1000).isBefore(dayjs())">退款</a>
|
||||||
>
|
<a class="ele-text-danger" @click="openRefund(record)" v-else>过期退款</a>
|
||||||
|
</template>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@@ -255,325 +248,340 @@
|
|||||||
<OrderInfo v-model:visible="showEdit" :data="current" @done="reload" />
|
<OrderInfo v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
<!-- 开具发票 -->
|
<!-- 开具发票 -->
|
||||||
<Invoice v-model:visible="showInvoice" :data="current" @done="reload" />
|
<Invoice v-model:visible="showInvoice" :data="current" @done="reload" />
|
||||||
|
<InvoiceByList v-model:visible="showInvoiceList" :data="current" @done="reload" />
|
||||||
<Refund v-model:visible="showRefund" :data="refundOrder" @done="reload" />
|
<Refund v-model:visible="showRefund" :data="refundOrder" @done="reload" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</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 {
|
import {
|
||||||
ExclamationCircleOutlined,
|
ExclamationCircleOutlined,
|
||||||
CheckOutlined,
|
CheckOutlined,
|
||||||
CloseOutlined,
|
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";
|
||||||
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 OrderInfo from './components/orderInfo.vue';
|
import OrderInfo from "./components/orderInfo.vue";
|
||||||
import Invoice from './components/invoice.vue';
|
import Invoice from "./components/invoice.vue";
|
||||||
import {
|
import InvoiceByList from "./components/invoiceByList.vue";
|
||||||
pageThinkOrder,
|
import {
|
||||||
removeThinkOrder,
|
pageThinkOrder,
|
||||||
removeBatchThinkOrder
|
removeThinkOrder,
|
||||||
} from '@/api/think/thinkOrder';
|
removeBatchThinkOrder
|
||||||
import * as InvoiceApi from '@/api/think/thinkInvoice';
|
} from "@/api/think/thinkOrder";
|
||||||
import type {
|
import * as InvoiceApi from "@/api/think/thinkInvoice";
|
||||||
ThinkOrder,
|
import type {
|
||||||
ThinkOrderParam
|
ThinkOrder,
|
||||||
} from '@/api/think/thinkOrder/model';
|
ThinkOrderParam
|
||||||
import { formatNumber } from 'ele-admin-pro/es';
|
} from "@/api/think/thinkOrder/model";
|
||||||
import type { ThinkInvoice } from '@/api/think/thinkInvoice/model';
|
import { formatNumber } from "ele-admin-pro/es";
|
||||||
import Refund from '@/views/think/thinkOrder/components/refund.vue';
|
import type { ThinkInvoice } from "@/api/think/thinkInvoice/model";
|
||||||
|
import Refund from "@/views/think/thinkOrder/components/refund.vue";
|
||||||
|
import { hasPermission } from "@/utils/permission";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import { doInvoiceByListReq } from "@/api/think/thinkInvoice";
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
// 表格选中数据
|
// 表格选中数据
|
||||||
const selection = ref<ThinkOrder[]>([]);
|
const selection = ref<ThinkOrder[]>([]);
|
||||||
// 当前编辑数据
|
// 当前编辑数据
|
||||||
const current = ref<ThinkOrder | null>(null);
|
const current = ref<ThinkOrder | null>(null);
|
||||||
// 是否显示编辑弹窗
|
// 是否显示编辑弹窗
|
||||||
const showEdit = ref(false);
|
const showEdit = ref(false);
|
||||||
// 开具发票弹窗
|
// 开具发票弹窗
|
||||||
const showInvoice = ref(false);
|
const showInvoice = 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;
|
||||||
|
}
|
||||||
|
where.forAdmin = true;
|
||||||
|
return pageThinkOrder({
|
||||||
|
...where,
|
||||||
|
...orders,
|
||||||
page,
|
page,
|
||||||
limit,
|
limit
|
||||||
where,
|
});
|
||||||
orders,
|
};
|
||||||
filters
|
|
||||||
}) => {
|
// 表格列配置
|
||||||
if (filters) {
|
const columns = ref<ColumnItem[]>([
|
||||||
where.status = filters.status;
|
{
|
||||||
}
|
title: "订单号",
|
||||||
where.forAdmin = true;
|
dataIndex: "orderNum",
|
||||||
return pageThinkOrder({
|
key: "iod",
|
||||||
...where,
|
width: 90
|
||||||
...orders,
|
},
|
||||||
page,
|
{
|
||||||
limit
|
title: "姓名",
|
||||||
|
dataIndex: "name",
|
||||||
|
key: "name",
|
||||||
|
align: "center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "手机号",
|
||||||
|
dataIndex: "phone",
|
||||||
|
key: "phone",
|
||||||
|
width: 120,
|
||||||
|
align: "center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "预约信息",
|
||||||
|
dataIndex: "dateTime",
|
||||||
|
key: "dateTime",
|
||||||
|
width: 120,
|
||||||
|
align: "center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "总额",
|
||||||
|
dataIndex: "totalPrice",
|
||||||
|
key: "totalPrice",
|
||||||
|
align: "center",
|
||||||
|
sorter: true,
|
||||||
|
customRender: ({ text }) => `¥${formatNumber(text)}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "减少金额",
|
||||||
|
dataIndex: "reducePrice",
|
||||||
|
key: "reducePrice",
|
||||||
|
align: "center",
|
||||||
|
sorter: true,
|
||||||
|
customRender: ({ text }) => `¥${formatNumber(text)}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "实付金额",
|
||||||
|
dataIndex: "payPrice",
|
||||||
|
key: "payPrice",
|
||||||
|
align: "center",
|
||||||
|
sorter: true,
|
||||||
|
customRender: ({ text }) => `¥${formatNumber(text)}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "支付方式",
|
||||||
|
dataIndex: "payType",
|
||||||
|
key: "payType",
|
||||||
|
align: "center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "IC卡号",
|
||||||
|
dataIndex: "code",
|
||||||
|
key: "code",
|
||||||
|
align: "center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "付款状态",
|
||||||
|
dataIndex: "payStatus",
|
||||||
|
key: "payStatus",
|
||||||
|
sorter: true,
|
||||||
|
align: "center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "付款时间",
|
||||||
|
dataIndex: "payTime",
|
||||||
|
key: "payTime",
|
||||||
|
sorter: true,
|
||||||
|
align: "center",
|
||||||
|
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "订单状态",
|
||||||
|
dataIndex: "orderStatus",
|
||||||
|
key: "orderStatus",
|
||||||
|
align: "center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "优惠类型",
|
||||||
|
dataIndex: "couponType",
|
||||||
|
key: "couponType",
|
||||||
|
align: "center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "开票状态",
|
||||||
|
dataIndex: "isInvoice",
|
||||||
|
key: "isInvoice",
|
||||||
|
align: "center",
|
||||||
|
sorter: true
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '类型',
|
||||||
|
// dataIndex: 'type',
|
||||||
|
// key: 'type',
|
||||||
|
// align: 'center',
|
||||||
|
// customRender: ({ text }) =>
|
||||||
|
// ['商城订单', '客户预定', '俱乐部训练场', '活动订场'][text]
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '申请退款时间',
|
||||||
|
// dataIndex: 'refundApplyTime',
|
||||||
|
// key: 'refundApplyTime',
|
||||||
|
// align: 'center',
|
||||||
|
// customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '备注',
|
||||||
|
// dataIndex: 'comments',
|
||||||
|
// key: 'comments',
|
||||||
|
// align: 'center'
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
key: "action",
|
||||||
|
width: 200,
|
||||||
|
fixed: "right",
|
||||||
|
align: "center",
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: ThinkOrderParam) => {
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: where });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: ThinkOrder) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const showRefund = ref(false);
|
||||||
|
const refundOrder = ref<ThinkOrder>();
|
||||||
|
const openRefund = (row: ThinkOrder) => {
|
||||||
|
refundOrder.value = row;
|
||||||
|
showRefund.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: ThinkOrder) => {
|
||||||
|
const hide = message.loading("请求中..", 0);
|
||||||
|
removeThinkOrder(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 表格列配置
|
/* 批量删除 */
|
||||||
const columns = ref<ColumnItem[]>([
|
const removeBatch = () => {
|
||||||
{},
|
if (!selection.value.length) {
|
||||||
{
|
message.error("请至少选择一条数据");
|
||||||
title: '订单号',
|
return;
|
||||||
dataIndex: 'id',
|
}
|
||||||
key: 'iod',
|
Modal.confirm({
|
||||||
width: 90
|
title: "提示",
|
||||||
},
|
content: "确定要删除选中的记录吗?",
|
||||||
{
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
title: '姓名',
|
maskClosable: true,
|
||||||
dataIndex: 'name',
|
onOk: () => {
|
||||||
key: 'name',
|
const hide = message.loading("请求中..", 0);
|
||||||
align: 'center'
|
removeBatchThinkOrder(selection.value.map((d) => d.id))
|
||||||
},
|
.then((msg) => {
|
||||||
{
|
hide();
|
||||||
title: '手机号',
|
message.success(msg);
|
||||||
dataIndex: 'phone',
|
reload();
|
||||||
key: 'phone',
|
})
|
||||||
width: 120,
|
.catch((e) => {
|
||||||
align: 'center'
|
hide();
|
||||||
},
|
message.error(e.message);
|
||||||
{
|
});
|
||||||
title: '预约信息',
|
|
||||||
dataIndex: 'dateTime',
|
|
||||||
key: 'dateTime',
|
|
||||||
width: 120,
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '总额',
|
|
||||||
dataIndex: 'totalPrice',
|
|
||||||
key: 'totalPrice',
|
|
||||||
align: 'center',
|
|
||||||
sorter: true,
|
|
||||||
customRender: ({ text }) => `¥${formatNumber(text)}`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '减少金额',
|
|
||||||
dataIndex: 'reducePrice',
|
|
||||||
key: 'reducePrice',
|
|
||||||
align: 'center',
|
|
||||||
sorter: true,
|
|
||||||
customRender: ({ text }) => `¥${formatNumber(text)}`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '实付金额',
|
|
||||||
dataIndex: 'payPrice',
|
|
||||||
key: 'payPrice',
|
|
||||||
align: 'center',
|
|
||||||
sorter: true,
|
|
||||||
customRender: ({ text }) => `¥${formatNumber(text)}`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '支付方式',
|
|
||||||
dataIndex: 'payType',
|
|
||||||
key: 'payType',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'IC卡号',
|
|
||||||
dataIndex: 'code',
|
|
||||||
key: 'code',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '付款状态',
|
|
||||||
dataIndex: 'payStatus',
|
|
||||||
key: 'payStatus',
|
|
||||||
sorter: true,
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '付款时间',
|
|
||||||
dataIndex: 'payTime',
|
|
||||||
key: 'payTime',
|
|
||||||
sorter: true,
|
|
||||||
align: 'center',
|
|
||||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '订单状态',
|
|
||||||
dataIndex: 'orderStatus',
|
|
||||||
key: 'orderStatus',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '优惠类型',
|
|
||||||
dataIndex: 'couponType',
|
|
||||||
key: 'couponType',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '开票状态',
|
|
||||||
dataIndex: 'isInvoice',
|
|
||||||
key: 'isInvoice',
|
|
||||||
align: 'center',
|
|
||||||
sorter: true
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// title: '类型',
|
|
||||||
// dataIndex: 'type',
|
|
||||||
// key: 'type',
|
|
||||||
// align: 'center',
|
|
||||||
// customRender: ({ text }) =>
|
|
||||||
// ['商城订单', '客户预定', '俱乐部训练场', '活动订场'][text]
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: '申请退款时间',
|
|
||||||
// dataIndex: 'refundApplyTime',
|
|
||||||
// key: 'refundApplyTime',
|
|
||||||
// align: 'center',
|
|
||||||
// customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: '备注',
|
|
||||||
// dataIndex: 'comments',
|
|
||||||
// key: 'comments',
|
|
||||||
// align: 'center'
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
key: 'action',
|
|
||||||
width: 120,
|
|
||||||
fixed: 'right',
|
|
||||||
align: 'center',
|
|
||||||
hideInSetting: true
|
|
||||||
}
|
}
|
||||||
]);
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/* 搜索 */
|
/* 开具发票 */
|
||||||
const reload = (where?: ThinkOrderParam) => {
|
const onInvoice = (row?: ThinkOrder) => {
|
||||||
selection.value = [];
|
console.log(row?.payStatus);
|
||||||
tableRef?.value?.reload({ where: where });
|
if (row?.payStatus != 1) {
|
||||||
};
|
return false;
|
||||||
|
}
|
||||||
|
current.value = row ?? null;
|
||||||
|
showInvoice.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
/* 打开编辑弹窗 */
|
const openInvoicePdf = (row?: ThinkInvoice) => {
|
||||||
const openEdit = (row?: ThinkOrder) => {
|
if (row?.id) {
|
||||||
current.value = row ?? null;
|
InvoiceApi.showInvoice(row?.id).then((res) => {
|
||||||
showEdit.value = true;
|
const parse = JSON.parse(res);
|
||||||
};
|
const pdfUrl = parse[0].pdfUrl;
|
||||||
|
window.open(pdfUrl);
|
||||||
const showRefund = ref(false);
|
|
||||||
const refundOrder = ref<ThinkOrder>();
|
|
||||||
const openRefund = (row: ThinkOrder) => {
|
|
||||||
refundOrder.value = row;
|
|
||||||
showRefund.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 打开批量移动弹窗 */
|
|
||||||
const openMove = () => {
|
|
||||||
showMove.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 删除单个 */
|
|
||||||
const remove = (row: ThinkOrder) => {
|
|
||||||
const hide = message.loading('请求中..', 0);
|
|
||||||
removeThinkOrder(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);
|
|
||||||
removeBatchThinkOrder(selection.value.map((d) => d.id))
|
|
||||||
.then((msg) => {
|
|
||||||
hide();
|
|
||||||
message.success(msg);
|
|
||||||
reload();
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
hide();
|
|
||||||
message.error(e.message);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/* 开具发票 */
|
/* 查询 */
|
||||||
const onInvoice = (row?: ThinkOrder) => {
|
const query = () => {
|
||||||
console.log(row?.payStatus);
|
loading.value = true;
|
||||||
if (row?.payStatus != 1) {
|
};
|
||||||
return false;
|
|
||||||
}
|
|
||||||
current.value = row ?? null;
|
|
||||||
showInvoice.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const openInvoicePdf = (row?: ThinkInvoice) => {
|
const showInvoiceList = ref(false);
|
||||||
if (row?.id) {
|
const openInvoiceByList = async () => {
|
||||||
InvoiceApi.showInvoice(row?.id).then((res) => {
|
const list = selection.value.filter(item => (item.isInvoice === 2 && item.payStatus === 1 && [1, 2].includes(item.orderStatus)));
|
||||||
const parse = JSON.parse(res);
|
if (!list.length) return message.error("无可开票订单");
|
||||||
const pdfUrl = parse[0].pdfUrl;
|
current.value = {
|
||||||
window.open(pdfUrl);
|
orderIdList: list.map((d) => d.id),
|
||||||
});
|
price: list.reduce((count, item) => count + parseFloat(item.payPrice), 0)
|
||||||
|
};
|
||||||
|
showInvoiceList.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: ThinkOrder) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
};
|
||||||
/* 查询 */
|
query();
|
||||||
const query = () => {
|
|
||||||
loading.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 自定义行属性 */
|
|
||||||
const customRow = (record: ThinkOrder) => {
|
|
||||||
return {
|
|
||||||
// 行点击事件
|
|
||||||
onClick: () => {
|
|
||||||
// console.log(record);
|
|
||||||
},
|
|
||||||
// 行双击事件
|
|
||||||
onDblclick: () => {
|
|
||||||
openEdit(record);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
query();
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import * as MenuIcons from '@/layout/menu-icons';
|
import * as MenuIcons from "@/layout/menu-icons";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ThinkOrder',
|
name: "ThinkOrder",
|
||||||
components: MenuIcons
|
components: MenuIcons
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.tag-icon {
|
.tag-icon {
|
||||||
padding-right: 6px;
|
padding-right: 6px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: GradeParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,233 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑Vip购卡记录' : '添加Vip购卡记录'"
|
||||||
|
: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="uid">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入"
|
||||||
|
v-model:value="form.uid"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="" name="orderNumber">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入"
|
||||||
|
v-model:value="form.orderNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="" name="wechetNumber">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入"
|
||||||
|
v-model:value="form.wechetNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="" name="amount">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入"
|
||||||
|
v-model:value="form.amount"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="" name="payStatus">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入"
|
||||||
|
v-model:value="form.payStatus"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="" name="payTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入"
|
||||||
|
v-model:value="form.payTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态, 0正常, 1冻结" name="status">
|
||||||
|
<a-radio-group v-model:value="form.status">
|
||||||
|
<a-radio :value="0">显示</a-radio>
|
||||||
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否删除, 0否, 1是"
|
||||||
|
v-model:value="form.deleted"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="修改时间" name="updateTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入修改时间"
|
||||||
|
v-model:value="form.updateTime"
|
||||||
|
/>
|
||||||
|
</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 { addThinkUsersVipBuyLog, updateThinkUsersVipBuyLog } from '@/api/think/thinkUsersVipBuyLog';
|
||||||
|
import { ThinkUsersVipBuyLog } from '@/api/think/thinkUsersVipBuyLog/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: ThinkUsersVipBuyLog | 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 images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<ThinkUsersVipBuyLog>({
|
||||||
|
id: undefined,
|
||||||
|
uid: undefined,
|
||||||
|
orderNumber: undefined,
|
||||||
|
wechetNumber: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
payStatus: undefined,
|
||||||
|
payTime: undefined,
|
||||||
|
status: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
thinkUsersVipBuyLogId: undefined,
|
||||||
|
thinkUsersVipBuyLogName: '',
|
||||||
|
status: 0,
|
||||||
|
comments: '',
|
||||||
|
sortNumber: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
thinkUsersVipBuyLogName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写Vip购卡记录名称',
|
||||||
|
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 save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value ? updateThinkUsersVipBuyLog : addThinkUsersVipBuyLog;
|
||||||
|
saveOrUpdate(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) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if(props.data.image){
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,269 @@
|
|||||||
|
<template>
|
||||||
|
<div class="page">
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="thinkUsersVipBuyLogId"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</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 === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="openEdit(record)">修改</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<ThinkUsersVipBuyLogEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from './components/search.vue';
|
||||||
|
import ThinkUsersVipBuyLogEdit from './components/thinkUsersVipBuyLogEdit.vue';
|
||||||
|
import { pageThinkUsersVipBuyLog, removeThinkUsersVipBuyLog, removeBatchThinkUsersVipBuyLog } from '@/api/think/thinkUsersVipBuyLog';
|
||||||
|
import type { ThinkUsersVipBuyLog, ThinkUsersVipBuyLogParam } from '@/api/think/thinkUsersVipBuyLog/model';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<ThinkUsersVipBuyLog[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<ThinkUsersVipBuyLog | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where,
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
if (filters) {
|
||||||
|
where.status = filters.status;
|
||||||
|
}
|
||||||
|
return pageThinkUsersVipBuyLog({
|
||||||
|
...where,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表格列配置
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: '',
|
||||||
|
dataIndex: 'id',
|
||||||
|
key: 'id',
|
||||||
|
align: 'center',
|
||||||
|
width: 90,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '',
|
||||||
|
dataIndex: 'uid',
|
||||||
|
key: 'uid',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '',
|
||||||
|
dataIndex: 'orderNumber',
|
||||||
|
key: 'orderNumber',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '',
|
||||||
|
dataIndex: 'wechetNumber',
|
||||||
|
key: 'wechetNumber',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '',
|
||||||
|
dataIndex: 'amount',
|
||||||
|
key: 'amount',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '',
|
||||||
|
dataIndex: 'payStatus',
|
||||||
|
key: 'payStatus',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '',
|
||||||
|
dataIndex: 'payTime',
|
||||||
|
key: 'payTime',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态, 0正常, 1冻结',
|
||||||
|
dataIndex: 'status',
|
||||||
|
key: 'status',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '是否删除, 0否, 1是',
|
||||||
|
dataIndex: 'deleted',
|
||||||
|
key: 'deleted',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '注册时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
align: 'center',
|
||||||
|
sorter: true,
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '修改时间',
|
||||||
|
dataIndex: 'updateTime',
|
||||||
|
key: 'updateTime',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 180,
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: ThinkUsersVipBuyLogParam) => {
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: where });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: ThinkUsersVipBuyLog) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: ThinkUsersVipBuyLog) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeThinkUsersVipBuyLog(row.thinkUsersVipBuyLogId)
|
||||||
|
.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);
|
||||||
|
removeBatchThinkUsersVipBuyLog(selection.value.map((d) => d.thinkUsersVipBuyLogId))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: ThinkUsersVipBuyLog) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'ThinkUsersVipBuyLog'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
Reference in New Issue
Block a user