恢复代码
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ThinkInvoice, ThinkInvoiceParam } from './model';
|
||||
import { THINK_API_URL } from '@/config/setting';
|
||||
import request from "@/utils/request";
|
||||
import type { ApiResult, PageResult } from "@/api";
|
||||
import type { ThinkInvoice, ThinkInvoiceParam } from "./model";
|
||||
import { THINK_API_URL } from "@/config/setting";
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageThinkInvoice(params: ThinkInvoiceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ThinkInvoice>>>(
|
||||
THINK_API_URL + '/think/think-invoice/page',
|
||||
THINK_API_URL + "/think/think-invoice/page",
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -24,7 +24,7 @@ export async function pageThinkInvoice(params: ThinkInvoiceParam) {
|
||||
*/
|
||||
export async function listThinkInvoice(params?: ThinkInvoiceParam) {
|
||||
const res = await request.get<ApiResult<ThinkInvoice[]>>(
|
||||
THINK_API_URL + '/think/think-invoice',
|
||||
THINK_API_URL + "/think/think-invoice",
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export async function listThinkInvoice(params?: ThinkInvoiceParam) {
|
||||
*/
|
||||
export async function addThinkInvoice(data: ThinkInvoice) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
THINK_API_URL + '/think/think-invoice',
|
||||
THINK_API_URL + "/think/think-invoice",
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -54,7 +54,7 @@ export async function addThinkInvoice(data: ThinkInvoice) {
|
||||
*/
|
||||
export async function updateThinkInvoice(data: ThinkInvoice) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
THINK_API_URL + '/think/think-invoice',
|
||||
THINK_API_URL + "/think/think-invoice",
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -68,7 +68,7 @@ export async function updateThinkInvoice(data: ThinkInvoice) {
|
||||
*/
|
||||
export async function removeThinkInvoice(id?: number) {
|
||||
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) {
|
||||
return res.data.message;
|
||||
@@ -81,7 +81,7 @@ export async function removeThinkInvoice(id?: number) {
|
||||
*/
|
||||
export async function removeBatchThinkInvoice(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
THINK_API_URL + '/think/think-invoice/batch',
|
||||
THINK_API_URL + "/think/think-invoice/batch",
|
||||
{
|
||||
data
|
||||
}
|
||||
@@ -97,7 +97,17 @@ export async function removeBatchThinkInvoice(data: (number | undefined)[]) {
|
||||
*/
|
||||
export async function getThinkInvoice(id: number) {
|
||||
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) {
|
||||
return res.data.data;
|
||||
@@ -110,7 +120,18 @@ export async function getThinkInvoice(id: number) {
|
||||
*/
|
||||
export async function doInvoice(data: ThinkInvoice) {
|
||||
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
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -124,7 +145,7 @@ export async function doInvoice(data: ThinkInvoice) {
|
||||
*/
|
||||
export async function showInvoice(id: number) {
|
||||
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) {
|
||||
return res.data.data;
|
||||
|
||||
@@ -129,6 +129,16 @@ export async function thinkOrderExport(params?: ThinkOrderParam) {
|
||||
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) {
|
||||
const res = await request.get<ApiResult<ThinkOrder>>(
|
||||
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));
|
||||
}
|
||||
|
||||
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 label="价格" name="price">
|
||||
<a-input-number
|
||||
allow-clear
|
||||
placeholder="请输入价格"
|
||||
style="width: 200px"
|
||||
v-model:value="form.price"
|
||||
/>
|
||||
<a-space>
|
||||
<a-input-number
|
||||
allow-clear
|
||||
placeholder="请输入价格"
|
||||
style="width: 200px"
|
||||
v-model:value="form.price"
|
||||
/>
|
||||
<a-button type="primary" @click="openCal">查看价格日历</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="每日不同价格" name="prices">-->
|
||||
<!-- <a-input-number-->
|
||||
@@ -66,6 +69,7 @@
|
||||
<!-- v-model:value="form.halfPrices"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
|
||||
<a-form-item label="儿童价" name="childrenPrice">
|
||||
<a-input-number
|
||||
allow-clear
|
||||
@@ -83,13 +87,13 @@
|
||||
style="width: 200px"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序" name="sortNumber">
|
||||
<a-form-item label="排序" name="sort">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:max="9999"
|
||||
class="ele-fluid"
|
||||
placeholder="请输入排序号"
|
||||
v-model:value="form.sortNumber"
|
||||
v-model:value="form.sort"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否关闭" name="isStatus">
|
||||
@@ -114,173 +118,267 @@
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject } from 'ele-admin-pro';
|
||||
import {
|
||||
addThinkSiteTime,
|
||||
updateThinkSiteTime
|
||||
} from '@/api/think/thinkSiteTime';
|
||||
import { ThinkSiteTime } from '@/api/think/thinkSiteTime/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { FormInstance, RuleObject } from 'ant-design-vue/es/form';
|
||||
import { ThinkSite } from '@/api/think/thinkSite/model';
|
||||
import { ref, reactive, watch } from "vue";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import { assignObject } from "ele-admin-pro";
|
||||
import {
|
||||
addThinkSiteTime,
|
||||
updateThinkSiteTime
|
||||
} from "@/api/think/thinkSiteTime";
|
||||
import { ThinkSiteTime } from "@/api/think/thinkSiteTime/model";
|
||||
import { useThemeStore } from "@/store/modules/theme";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { FormInstance, RuleObject } from "ant-design-vue/es/form";
|
||||
import { ThinkSite } from "@/api/think/thinkSite/model";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 场馆ID
|
||||
sid?: number;
|
||||
// 场馆信息
|
||||
site?: ThinkSite | null;
|
||||
// 修改回显的数据
|
||||
data?: ThinkSiteTime | null;
|
||||
}>();
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 场馆ID
|
||||
sid?: number;
|
||||
// 场馆信息
|
||||
site?: ThinkSite | null;
|
||||
// 修改回显的数据
|
||||
data?: ThinkSiteTime | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
const emit = defineEmits<{
|
||||
(e: "done"): void;
|
||||
(e: "update:visible", visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const weekOptions = ref([
|
||||
{ label: '星期一', value: '1' },
|
||||
{ label: '星期二', value: '2' },
|
||||
{ label: '星期三', value: '3' },
|
||||
{ label: '星期四', value: '4' },
|
||||
{ label: '星期五', value: '5' },
|
||||
{ label: '星期六', value: '6' },
|
||||
{ label: '星期日', value: '7' }
|
||||
]);
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const weekOptions = ref([
|
||||
{ label: "星期一", value: "1" },
|
||||
{ label: "星期二", value: "2" },
|
||||
{ label: "星期三", value: "3" },
|
||||
{ label: "星期四", value: "4" },
|
||||
{ label: "星期五", value: "5" },
|
||||
{ label: "星期六", value: "6" },
|
||||
{ label: "星期日", value: "7" }
|
||||
]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ThinkSiteTime>({
|
||||
id: undefined,
|
||||
timePeriod: '',
|
||||
timePeriod1: undefined,
|
||||
timePeriod2: undefined,
|
||||
price: '0',
|
||||
prices: '',
|
||||
halfPrice: '0',
|
||||
halfPrices: '',
|
||||
childrenPrice: '0',
|
||||
week: undefined,
|
||||
sort: 0,
|
||||
sid: 0,
|
||||
isStatus: '1',
|
||||
isFree: '2',
|
||||
startTime: ''
|
||||
});
|
||||
// 用户信息
|
||||
const form = reactive<ThinkSiteTime>({
|
||||
id: undefined,
|
||||
timePeriod: "",
|
||||
timePeriod1: undefined,
|
||||
timePeriod2: undefined,
|
||||
price: "0",
|
||||
prices: "",
|
||||
halfPrice: "0",
|
||||
halfPrices: "",
|
||||
childrenPrice: "0",
|
||||
week: undefined,
|
||||
sort: 0,
|
||||
sid: 0,
|
||||
isStatus: "1",
|
||||
isFree: "2",
|
||||
startTime: ""
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit("update:visible", value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
period: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写时段,如红色、L码、远峰蓝、原色钛金属等',
|
||||
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;
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
period: [
|
||||
{
|
||||
required: true,
|
||||
type: "string",
|
||||
message: "请填写时段,如红色、L码、远峰蓝、原色钛金属等",
|
||||
trigger: "blur"
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
form.sid = props.sid;
|
||||
if (!form.sid || form.sid == 0) {
|
||||
return;
|
||||
],
|
||||
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);
|
||||
}
|
||||
form.week = JSON.stringify(form.week);
|
||||
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(() => {});
|
||||
};
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
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;
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = JSON.parse(JSON.stringify(form))
|
||||
formData.sid = props.sid;
|
||||
console.log(formData)
|
||||
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 {
|
||||
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 {
|
||||
resetFields();
|
||||
isUpdate.value = false;
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
:openedData="openedData"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
@@ -31,13 +32,8 @@
|
||||
</template>
|
||||
<template v-if="column.key === 'info'">
|
||||
<span v-if="record.itype !== 4">{{ record.info }}</span>
|
||||
<span v-else
|
||||
>开票金额:{{ record.price }}元,租赁面积:{{
|
||||
record.size
|
||||
}}㎡,租赁时间:{{ record.rentStartDate }}~{{
|
||||
record.rentEndDate
|
||||
}}</span
|
||||
>
|
||||
<span v-else>开票金额:{{ record.price }}元,租赁面积:{{ record.size }}㎡,租赁时间:{{ record.rentStartDate
|
||||
}}~{{ record.rentEndDate }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space v-if="record.isOpen === 1">
|
||||
@@ -52,14 +48,18 @@
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</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 @click="openInvoice(record)">开票</a>
|
||||
<a-divider type="vertical" />
|
||||
<a class="ele-text-danger" @click="refuse(record)">拒绝</a>
|
||||
</a-space>
|
||||
<span v-if="record.status === 2" class="ele-text-danger"
|
||||
>已拒绝</span
|
||||
>
|
||||
<span v-if="record.status === 2" class="ele-text-danger">已拒绝</span>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
@@ -76,256 +76,267 @@
|
||||
</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 ThinkInvoiceEdit from './components/thinkInvoiceEdit.vue';
|
||||
import {
|
||||
pageThinkInvoice,
|
||||
removeThinkInvoice,
|
||||
removeBatchThinkInvoice,
|
||||
updateThinkInvoice,
|
||||
doInvoice
|
||||
} from '@/api/think/thinkInvoice';
|
||||
import type {
|
||||
ThinkInvoice,
|
||||
ThinkInvoiceParam
|
||||
} from '@/api/think/thinkInvoice/model';
|
||||
import * as InvoiceApi from '@/api/think/thinkInvoice';
|
||||
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 ThinkInvoiceEdit from "./components/thinkInvoiceEdit.vue";
|
||||
import {
|
||||
pageThinkInvoice,
|
||||
removeThinkInvoice,
|
||||
removeBatchThinkInvoice, updateThinkInvoice, doInvoice, thinkInvoiceData
|
||||
} from "@/api/think/thinkInvoice";
|
||||
import type {
|
||||
ThinkInvoice,
|
||||
ThinkInvoiceParam
|
||||
} 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 current = ref<ThinkInvoice | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
// 表格选中数据
|
||||
const selection = ref<ThinkInvoice[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ThinkInvoice | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
where.forAdmin = true;
|
||||
getOpenedData(where);
|
||||
return pageThinkInvoice({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
where.forAdmin = true;
|
||||
return pageThinkInvoice({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'left',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
},
|
||||
{
|
||||
title: '订单号',
|
||||
dataIndex: 'orderNum',
|
||||
key: 'oid',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '公司名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '发票金额',
|
||||
dataIndex: 'price',
|
||||
key: 'price',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '税号',
|
||||
dataIndex: 'code',
|
||||
key: 'code',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '备注信息',
|
||||
dataIndex: 'info',
|
||||
key: 'info',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '是否已开',
|
||||
dataIndex: 'isOpen',
|
||||
key: 'isOpen',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '发票类型',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
align: 'center',
|
||||
customRender: ({ text }) => {
|
||||
if (text === 1) {
|
||||
return '电子';
|
||||
} else {
|
||||
return '纸质';
|
||||
}
|
||||
const openedData = ref({});
|
||||
const getOpenedData = async (where) => {
|
||||
openedData.value = await thinkInvoiceData(where);
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 180,
|
||||
fixed: "left",
|
||||
align: "center",
|
||||
hideInSetting: true
|
||||
},
|
||||
{
|
||||
title: "订单号",
|
||||
dataIndex: "orderNum",
|
||||
key: "oid",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "公司名称",
|
||||
dataIndex: "name",
|
||||
key: "name",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "发票金额",
|
||||
dataIndex: "price",
|
||||
key: "price",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "税号",
|
||||
dataIndex: "code",
|
||||
key: "code",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "备注信息",
|
||||
dataIndex: "info",
|
||||
key: "info",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "是否已开",
|
||||
dataIndex: "isOpen",
|
||||
key: "isOpen",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "发票类型",
|
||||
dataIndex: "type",
|
||||
key: "type",
|
||||
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) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
/* 搜索 */
|
||||
const reload = (where?: ThinkInvoiceParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ThinkInvoice) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ThinkInvoice) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
const openInvoicePdf = (row: ThinkInvoice) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
InvoiceApi.showInvoice(row?.id).then((res) => {
|
||||
const parse = JSON.parse(res);
|
||||
const pdfUrl = parse[0].pdfUrl;
|
||||
const openInvoicePdf = (row: ThinkInvoice) => {
|
||||
if (row.url) {
|
||||
window.open(row.url);
|
||||
return;
|
||||
}
|
||||
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();
|
||||
window.open(pdfUrl);
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ThinkInvoice) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeThinkInvoice(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
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);
|
||||
});
|
||||
}
|
||||
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 = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
const openInvoice = async (row: ThinkInvoice) => {
|
||||
await doInvoice(row);
|
||||
message.success('操作成功');
|
||||
reload();
|
||||
};
|
||||
const openInvoice = async (row: ThinkInvoice) => {
|
||||
await doInvoice(row);
|
||||
message.success("操作成功");
|
||||
reload();
|
||||
};
|
||||
|
||||
const refuse = async (row: ThinkInvoice) => {
|
||||
await updateThinkInvoice({
|
||||
id: row.id,
|
||||
status: 2
|
||||
});
|
||||
message.success('操作成功');
|
||||
reload();
|
||||
};
|
||||
const refuse = async (row: ThinkInvoice) => {
|
||||
await updateThinkInvoice({
|
||||
id: row.id,
|
||||
status: 2
|
||||
});
|
||||
message.success("操作成功");
|
||||
reload();
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ThinkInvoice) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ThinkInvoice) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
query();
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ThinkInvoice'
|
||||
};
|
||||
export default {
|
||||
name: "ThinkInvoice"
|
||||
};
|
||||
</script>
|
||||
|
||||
<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>
|
||||
<a-space class="flex items-center" :size="10" style="flex-wrap: wrap">
|
||||
<span class="text-gray-400">付款状态</span>
|
||||
<a-select
|
||||
v-model:value="where.payStatus"
|
||||
style="width: 150px"
|
||||
placeholder="付款状态筛选"
|
||||
@change="search"
|
||||
>
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option :value="1">已付款</a-select-option>
|
||||
<a-select-option :value="2">未付款</a-select-option>
|
||||
</a-select>
|
||||
<span class="text-gray-400">订单状态</span>
|
||||
<a-select
|
||||
v-model:value="where.orderStatus"
|
||||
style="width: 150px"
|
||||
placeholder="订单状态筛选"
|
||||
@change="search"
|
||||
>
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option :value="1">已完成</a-select-option>
|
||||
<a-select-option :value="2">未使用</a-select-option>
|
||||
<a-select-option :value="3">已取消</a-select-option>
|
||||
<a-select-option :value="4">退款中</a-select-option>
|
||||
<a-select-option :value="5">退款被拒</a-select-option>
|
||||
<a-select-option :value="6">退款成功</a-select-option>
|
||||
</a-select>
|
||||
<span class="text-gray-400">付款方式</span>
|
||||
<a-select
|
||||
v-model:value="where.payType"
|
||||
style="width: 150px"
|
||||
placeholder="付款方式筛选"
|
||||
@change="search"
|
||||
>
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option :value="1">微信支付</a-select-option>
|
||||
<a-select-option :value="2">余额支付</a-select-option>
|
||||
<a-select-option :value="3">支付宝</a-select-option>
|
||||
<a-select-option :value="4">现金</a-select-option>
|
||||
<a-select-option :value="5">POS机</a-select-option>
|
||||
<a-select-option :value="6">VIP月卡</a-select-option>
|
||||
<a-select-option :value="7">VIP年卡</a-select-option>
|
||||
<a-select-option :value="8">VIP次卡</a-select-option>
|
||||
<a-select-option :value="9">IC月卡</a-select-option>
|
||||
<a-select-option :value="10">IC年卡</a-select-option>
|
||||
<a-select-option :value="11">IC次卡</a-select-option>
|
||||
<a-select-option :value="12">免费</a-select-option>
|
||||
<a-select-option :value="13">VIP充值卡</a-select-option>
|
||||
<a-select-option :value="14">IC充值卡</a-select-option>
|
||||
<a-select-option :value="15">积分支付</a-select-option>
|
||||
<a-select-option :value="16">VIP季卡</a-select-option>
|
||||
<a-select-option :value="17">IC季卡</a-select-option>
|
||||
</a-select>
|
||||
<span class="text-gray-400">开票状态</span>
|
||||
<a-select
|
||||
v-model:value="where.isInvoice"
|
||||
style="width: 150px"
|
||||
placeholder="开票状态筛选"
|
||||
@change="search"
|
||||
>
|
||||
<a-select-option value="1">已开票</a-select-option>
|
||||
<a-select-option :value="2">未开票</a-select-option>
|
||||
<a-select-option :value="3">不能开票</a-select-option>
|
||||
</a-select>
|
||||
<ThinkSelectSite
|
||||
:placeholder="`选择场馆`"
|
||||
class="input-item"
|
||||
v-model:value="where.siteName"
|
||||
@done="chooseSiteId"
|
||||
/>
|
||||
<a-range-picker
|
||||
v-model:value="dateRange"
|
||||
@change="search"
|
||||
value-format="YYYY-MM-DD"
|
||||
class="ele-fluid"
|
||||
/>
|
||||
<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>
|
||||
<div class="flex flex-col justify-start items-start">
|
||||
|
||||
|
||||
<a-space class="flex items-center" :size="10" style="flex-wrap: wrap">
|
||||
<span class="text-gray-400">付款状态</span>
|
||||
<a-select v-model:value="where.payStatus" style="width: 150px" placeholder="付款状态筛选" @change="search">
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option :value="1">已付款</a-select-option>
|
||||
<a-select-option :value="2">未付款</a-select-option>
|
||||
</a-select>
|
||||
<span class="text-gray-400">订单状态</span>
|
||||
<a-select v-model:value="where.orderStatus" style="width: 150px" placeholder="订单状态筛选" @change="search">
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option :value="1">已完成</a-select-option>
|
||||
<a-select-option :value="2">未使用</a-select-option>
|
||||
<a-select-option :value="3">已取消</a-select-option>
|
||||
<a-select-option :value="4">退款中</a-select-option>
|
||||
<a-select-option :value="5">退款被拒</a-select-option>
|
||||
<a-select-option :value="6">退款成功</a-select-option>
|
||||
</a-select>
|
||||
<span class="text-gray-400">付款方式</span>
|
||||
<a-select v-model:value="where.payType" style="width: 150px" placeholder="付款方式筛选" @change="search">
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option :value="1">微信支付</a-select-option>
|
||||
<a-select-option :value="2">余额支付</a-select-option>
|
||||
<a-select-option :value="3">支付宝</a-select-option>
|
||||
<a-select-option :value="4">现金</a-select-option>
|
||||
<a-select-option :value="5">POS机</a-select-option>
|
||||
<a-select-option :value="6">VIP月卡</a-select-option>
|
||||
<a-select-option :value="7">VIP年卡</a-select-option>
|
||||
<a-select-option :value="8">VIP次卡</a-select-option>
|
||||
<a-select-option :value="9">IC月卡</a-select-option>
|
||||
<a-select-option :value="10">IC年卡</a-select-option>
|
||||
<a-select-option :value="11">IC次卡</a-select-option>
|
||||
<a-select-option :value="12">免费</a-select-option>
|
||||
<a-select-option :value="13">VIP充值卡</a-select-option>
|
||||
<a-select-option :value="14">IC充值卡</a-select-option>
|
||||
<a-select-option :value="15">积分支付</a-select-option>
|
||||
<a-select-option :value="16">VIP季卡</a-select-option>
|
||||
<a-select-option :value="17">IC季卡</a-select-option>
|
||||
</a-select>
|
||||
<span class="text-gray-400">开票状态</span>
|
||||
<a-select v-model:value="where.isInvoice" style="width: 150px" placeholder="开票状态筛选" @change="search">
|
||||
<a-select-option value="1">已开票</a-select-option>
|
||||
<a-select-option :value="2">未开票</a-select-option>
|
||||
<a-select-option :value="3">不能开票</a-select-option>
|
||||
</a-select>
|
||||
<ThinkSelectSite
|
||||
:placeholder="`选择场馆`"
|
||||
class="input-item"
|
||||
v-model:value="where.siteName"
|
||||
@done="chooseSiteId"
|
||||
/>
|
||||
<a-range-picker
|
||||
v-model:value="dateRange"
|
||||
@change="search"
|
||||
value-format="YYYY-MM-DD"
|
||||
class="ele-fluid"
|
||||
/>
|
||||
<a-input-search
|
||||
allow-clear
|
||||
placeholder="请输入订单号|编号|手机号"
|
||||
v-model:value="where.keywords"
|
||||
@pressEnter="search"
|
||||
@search="search"
|
||||
style="width: 380px"
|
||||
/>
|
||||
</a-space>
|
||||
<div class="mt-2">
|
||||
<a-space>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
<a-button @click="setHasInvoice" :disabled="!selection?.length">设置已开票</a-button>
|
||||
<a-button @click="openInvoiceByList" :disabled="!selection?.length" type="primary">合并开票</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</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 { utils, writeFile } from 'xlsx';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import dayjs from 'dayjs';
|
||||
import {
|
||||
listThinkOrder,
|
||||
updateBatchThinkOrder,
|
||||
updateThinkOrder
|
||||
} from '@/api/think/thinkOrder';
|
||||
import { ThinkOrder, ThinkOrderParam } from '@/api/think/thinkOrder/model';
|
||||
import { ThinkSite } from '@/api/think/thinkSite/model';
|
||||
import useSearch from "@/utils/use-search";
|
||||
import { ref, watch } from "vue";
|
||||
import { ThinkOrderInfoParam } from "@/api/think/thinkOrderInfo/model";
|
||||
import { utils, writeFile } from "xlsx";
|
||||
import { message } from "ant-design-vue";
|
||||
import { toDateString } from "ele-admin-pro";
|
||||
import dayjs from "dayjs";
|
||||
import { listThinkOrder, updateThinkOrder } from "@/api/think/thinkOrder";
|
||||
import { ThinkOrder, ThinkOrderParam } from "@/api/think/thinkOrder/model";
|
||||
import { ThinkSite } from "@/api/think/thinkSite/model";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: ThinkOrder[];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: ThinkOrder[];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: ThinkOrderInfoParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'advanced'): void;
|
||||
}>();
|
||||
const emit = defineEmits<{
|
||||
(e: "search", where?: ThinkOrderInfoParam): void;
|
||||
(e: "add"): void;
|
||||
(e: "remove"): void;
|
||||
(e: "advanced"): void;
|
||||
(e: "invoice"): void;
|
||||
}>();
|
||||
|
||||
// 表单数据
|
||||
const { where, resetFields } = useSearch<ThinkOrderParam>({
|
||||
sid: undefined,
|
||||
siteName: undefined,
|
||||
createTimeStart: undefined,
|
||||
createTimeEnd: undefined,
|
||||
timeStart: undefined,
|
||||
timeEnd: undefined,
|
||||
categoryId: undefined,
|
||||
keywords: undefined,
|
||||
payStatus: undefined,
|
||||
orderStatus: undefined,
|
||||
payType: undefined,
|
||||
isInvoice: undefined
|
||||
// 表单数据
|
||||
const { where, resetFields } = useSearch<ThinkOrderParam>({
|
||||
sid: undefined,
|
||||
siteName: undefined,
|
||||
createTimeStart: undefined,
|
||||
createTimeEnd: undefined,
|
||||
timeStart: undefined,
|
||||
timeEnd: undefined,
|
||||
categoryId: undefined,
|
||||
keywords: undefined,
|
||||
payStatus: undefined,
|
||||
orderStatus: undefined,
|
||||
payType: 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 search = () => {
|
||||
const [d1, d2] = dateRange.value ?? [];
|
||||
xlsFileName.value = `${d1}至${d2}`;
|
||||
where.timeStart = d1 ? dayjs(d1).valueOf() / 1000 : undefined;
|
||||
where.timeEnd = d2 ? dayjs(d2).valueOf() / 1000 : undefined;
|
||||
// where.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;
|
||||
where.siteName = data.name;
|
||||
search();
|
||||
};
|
||||
|
||||
const chooseSiteId = (data: ThinkSite) => {
|
||||
where.sid = data.id;
|
||||
where.siteName = data.name;
|
||||
search();
|
||||
};
|
||||
/* 重置 */
|
||||
const reset = () => {
|
||||
resetFields();
|
||||
search();
|
||||
};
|
||||
|
||||
/* 重置 */
|
||||
const reset = () => {
|
||||
resetFields();
|
||||
search();
|
||||
};
|
||||
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
loading.value = true;
|
||||
const array: (string | number)[][] = [
|
||||
[
|
||||
'订单号',
|
||||
'订单编号',
|
||||
'姓名',
|
||||
'电话号码',
|
||||
'预定信息',
|
||||
'消费金额',
|
||||
'实付金额',
|
||||
'下单日期'
|
||||
]
|
||||
];
|
||||
if (!where.timeStart) {
|
||||
message.error('请选择导出的开始日期、结束日期,每次最多导出5000条记录');
|
||||
return false;
|
||||
}
|
||||
await listThinkOrder(where)
|
||||
.then((list) => {
|
||||
orders.value = list;
|
||||
orders.value?.forEach((d: ThinkOrder) => {
|
||||
array.push([
|
||||
`${d.id}`,
|
||||
`${d.orderNum}`,
|
||||
`${d.name}`,
|
||||
`${d.phone}`,
|
||||
`${d.siteName} ${d.dateTime} ${d.totalPrice}`,
|
||||
`${d.totalPrice}`,
|
||||
`${d.payPrice}`,
|
||||
`${toDateString(d.payTime)}`
|
||||
]);
|
||||
});
|
||||
const sheetName = `订单数据导出`;
|
||||
const workbook = {
|
||||
SheetNames: [sheetName],
|
||||
Sheets: {}
|
||||
};
|
||||
const sheet = utils.aoa_to_sheet(array);
|
||||
workbook.Sheets[sheetName] = sheet;
|
||||
// 设置列宽
|
||||
sheet['!cols'] = [
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 20 },
|
||||
{ wch: 40 },
|
||||
{ wch: 10 }
|
||||
];
|
||||
message.loading('正在导出...');
|
||||
setTimeout(() => {
|
||||
writeFile(
|
||||
workbook,
|
||||
`${
|
||||
where.createTimeEnd ? xlsFileName.value + '_' : ''
|
||||
}${sheetName}.xlsx`
|
||||
);
|
||||
loading.value = false;
|
||||
}, 2000);
|
||||
})
|
||||
.catch((msg) => {
|
||||
message.error(msg);
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
loading.value = true;
|
||||
const array: (string | number)[][] = [
|
||||
[
|
||||
"订单号",
|
||||
"订单编号",
|
||||
"姓名",
|
||||
"电话号码",
|
||||
"预定信息",
|
||||
"消费金额",
|
||||
"实付金额",
|
||||
"下单日期"
|
||||
]
|
||||
];
|
||||
if (!where.timeStart) {
|
||||
message.error("请选择导出的开始日期、结束日期,每次最多导出5000条记录");
|
||||
return false;
|
||||
}
|
||||
await listThinkOrder(where)
|
||||
.then((list) => {
|
||||
orders.value = list;
|
||||
orders.value?.forEach((d: ThinkOrder) => {
|
||||
array.push([
|
||||
`${d.id}`,
|
||||
`${d.orderNum}`,
|
||||
`${d.name}`,
|
||||
`${d.phone}`,
|
||||
`${d.siteName} ${d.dateTime} ${d.totalPrice}`,
|
||||
`${d.totalPrice}`,
|
||||
`${d.payPrice}`,
|
||||
`${toDateString(d.payTime)}`
|
||||
]);
|
||||
});
|
||||
const sheetName = `订单数据导出`;
|
||||
const workbook = {
|
||||
SheetNames: [sheetName],
|
||||
Sheets: {}
|
||||
};
|
||||
const sheet = utils.aoa_to_sheet(array);
|
||||
workbook.Sheets[sheetName] = sheet;
|
||||
// 设置列宽
|
||||
sheet["!cols"] = [
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 20 },
|
||||
{ wch: 40 },
|
||||
{ wch: 10 }
|
||||
];
|
||||
message.loading("正在导出...");
|
||||
setTimeout(() => {
|
||||
writeFile(
|
||||
workbook,
|
||||
`${
|
||||
where.createTimeEnd ? xlsFileName.value + "_" : ""
|
||||
}${sheetName}.xlsx`
|
||||
);
|
||||
loading.value = false;
|
||||
})
|
||||
.finally(() => {});
|
||||
};
|
||||
}, 2000);
|
||||
})
|
||||
.catch((msg) => {
|
||||
message.error(msg);
|
||||
loading.value = false;
|
||||
})
|
||||
.finally(() => {
|
||||
});
|
||||
};
|
||||
|
||||
const setHasInvoice = async () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
if (props.selection) {
|
||||
props.selection
|
||||
.filter((item) => item.isInvoice === 2)
|
||||
.map(async (item) => {
|
||||
item.isInvoice = 1;
|
||||
await updateThinkOrder(item);
|
||||
});
|
||||
}
|
||||
hide();
|
||||
message.success('设置成功');
|
||||
};
|
||||
const setHasInvoice = async () => {
|
||||
const hide = message.loading("请求中..", 0);
|
||||
if (props.selection) {
|
||||
props.selection.filter(item => item.isInvoice === 2).map(async item => {
|
||||
item.isInvoice = 1;
|
||||
await updateThinkOrder(item);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
}
|
||||
hide();
|
||||
message.success("设置成功");
|
||||
};
|
||||
|
||||
const openInvoiceByList = async () => {
|
||||
emit("invoice");
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
@invoice="openInvoiceByList"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
@@ -145,7 +146,8 @@
|
||||
<IdcardOutlined class="tag-icon" />
|
||||
IC会员卡
|
||||
</a-tag>
|
||||
<a-tag v-if="record.couponType == 11" color="blue">
|
||||
<a-tag v-if="record.couponType == 11" color="blue"
|
||||
>
|
||||
<IdcardOutlined class="tag-icon" />
|
||||
免费订单
|
||||
</a-tag>
|
||||
@@ -177,8 +179,7 @@
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-if="record.payStatus == 3 || record.payStatus == 0"
|
||||
color="cyan"
|
||||
>
|
||||
color="cyan">
|
||||
<CoffeeOutlined class="tag-icon" />
|
||||
未付款,占场中
|
||||
</a-tag>
|
||||
@@ -188,29 +189,20 @@
|
||||
</template>
|
||||
<template v-if="column.key === 'orderStatus'">
|
||||
<span v-if="record.orderStatus == 1" class="ele-text-success"
|
||||
>已完成</span
|
||||
>
|
||||
>已完成</span>
|
||||
<span v-if="record.orderStatus == 2" class="ele-text-placeholder"
|
||||
>未使用</span
|
||||
>
|
||||
>未使用</span>
|
||||
<span v-if="record.orderStatus == 3" class="ele-text-placeholder"
|
||||
>已取消</span
|
||||
>
|
||||
>已取消</span>
|
||||
<span v-if="record.orderStatus == 4" class="ele-text-warning"
|
||||
>退款申请中</span
|
||||
>
|
||||
>退款申请中</span>
|
||||
<span v-if="record.orderStatus == 5" class="ele-text-danger"
|
||||
>退款被拒绝</span
|
||||
>
|
||||
<span v-if="record.orderStatus == 6" class="ele-text-heading"
|
||||
>退款成功</span
|
||||
>
|
||||
>退款被拒绝</span>
|
||||
<span v-if="record.orderStatus == 6" class="ele-text-heading">退款成功</span>
|
||||
<span v-if="record.orderStatus == 7" class="ele-text-warning"
|
||||
>客户端申请退款</span
|
||||
>
|
||||
>客户端申请退款</span>
|
||||
<span v-if="record.orderStatus == 9" class="ele-text-warning"
|
||||
>未完成</span
|
||||
>
|
||||
>未完成</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'isInvoice'">
|
||||
<a-tag
|
||||
@@ -218,14 +210,14 @@
|
||||
color="green"
|
||||
class="cursor-pointer"
|
||||
@click="openInvoicePdf(record)"
|
||||
>已开票
|
||||
>已开票
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-if="record.isInvoice == 2"
|
||||
color="red"
|
||||
class="cursor-pointer"
|
||||
@click="onInvoice(record)"
|
||||
>未开票
|
||||
>未开票
|
||||
</a-tag>
|
||||
<a-tag v-if="record.isInvoice == 3" color="purple">不能开</a-tag>
|
||||
</template>
|
||||
@@ -237,15 +229,16 @@
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">详情</a>
|
||||
<a-divider type="vertical" />
|
||||
<a
|
||||
@click="openRefund(record)"
|
||||
v-if="
|
||||
record.payStatus === 1 &&
|
||||
[1, 3].includes(record.payType) &&
|
||||
[1, 2].includes(record.orderStatus)
|
||||
"
|
||||
>退款</a
|
||||
>
|
||||
<template v-if="record.isInvoice == 2 && record.payStatus == 1 && [1, 2].includes(record.orderStatus)">
|
||||
<a @click="onInvoice(record)">开票</a>
|
||||
<a-divider type="vertical" />
|
||||
</template>
|
||||
<template
|
||||
v-if="record.payStatus === 1 && [1, 2].includes(record.orderStatus) && hasPermission('think:order:refund')">
|
||||
<a class="ele-text-danger" @click="openRefund(record)"
|
||||
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>
|
||||
</template>
|
||||
</template>
|
||||
@@ -255,325 +248,340 @@
|
||||
<OrderInfo v-model:visible="showEdit" :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" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import {
|
||||
ExclamationCircleOutlined,
|
||||
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 Search from './components/search.vue';
|
||||
import OrderInfo from './components/orderInfo.vue';
|
||||
import Invoice from './components/invoice.vue';
|
||||
import {
|
||||
pageThinkOrder,
|
||||
removeThinkOrder,
|
||||
removeBatchThinkOrder
|
||||
} from '@/api/think/thinkOrder';
|
||||
import * as InvoiceApi from '@/api/think/thinkInvoice';
|
||||
import type {
|
||||
ThinkOrder,
|
||||
ThinkOrderParam
|
||||
} from '@/api/think/thinkOrder/model';
|
||||
import { formatNumber } from 'ele-admin-pro/es';
|
||||
import type { ThinkInvoice } from '@/api/think/thinkInvoice/model';
|
||||
import Refund from '@/views/think/thinkOrder/components/refund.vue';
|
||||
import { createVNode, ref } from "vue";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import {
|
||||
ExclamationCircleOutlined,
|
||||
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 Search from "./components/search.vue";
|
||||
import OrderInfo from "./components/orderInfo.vue";
|
||||
import Invoice from "./components/invoice.vue";
|
||||
import InvoiceByList from "./components/invoiceByList.vue";
|
||||
import {
|
||||
pageThinkOrder,
|
||||
removeThinkOrder,
|
||||
removeBatchThinkOrder
|
||||
} from "@/api/think/thinkOrder";
|
||||
import * as InvoiceApi from "@/api/think/thinkInvoice";
|
||||
import type {
|
||||
ThinkOrder,
|
||||
ThinkOrderParam
|
||||
} from "@/api/think/thinkOrder/model";
|
||||
import { formatNumber } from "ele-admin-pro/es";
|
||||
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 current = ref<ThinkOrder | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 开具发票弹窗
|
||||
const showInvoice = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
// 表格选中数据
|
||||
const selection = ref<ThinkOrder[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ThinkOrder | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 开具发票弹窗
|
||||
const showInvoice = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
where.forAdmin = true;
|
||||
return pageThinkOrder({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
where.forAdmin = true;
|
||||
return pageThinkOrder({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "订单号",
|
||||
dataIndex: "orderNum",
|
||||
key: "iod",
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
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[]>([
|
||||
{},
|
||||
{
|
||||
title: '订单号',
|
||||
dataIndex: 'id',
|
||||
key: 'iod',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
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: 120,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
/* 批量删除 */
|
||||
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 reload = (where?: ThinkOrderParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
/* 开具发票 */
|
||||
const onInvoice = (row?: ThinkOrder) => {
|
||||
console.log(row?.payStatus);
|
||||
if (row?.payStatus != 1) {
|
||||
return false;
|
||||
}
|
||||
current.value = row ?? null;
|
||||
showInvoice.value = true;
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
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 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 openInvoicePdf = (row?: ThinkInvoice) => {
|
||||
if (row?.id) {
|
||||
InvoiceApi.showInvoice(row?.id).then((res) => {
|
||||
const parse = JSON.parse(res);
|
||||
const pdfUrl = parse[0].pdfUrl;
|
||||
window.open(pdfUrl);
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/* 开具发票 */
|
||||
const onInvoice = (row?: ThinkOrder) => {
|
||||
console.log(row?.payStatus);
|
||||
if (row?.payStatus != 1) {
|
||||
return false;
|
||||
}
|
||||
current.value = row ?? null;
|
||||
showInvoice.value = true;
|
||||
};
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
const openInvoicePdf = (row?: ThinkInvoice) => {
|
||||
if (row?.id) {
|
||||
InvoiceApi.showInvoice(row?.id).then((res) => {
|
||||
const parse = JSON.parse(res);
|
||||
const pdfUrl = parse[0].pdfUrl;
|
||||
window.open(pdfUrl);
|
||||
});
|
||||
const showInvoiceList = ref(false);
|
||||
const openInvoiceByList = async () => {
|
||||
const list = selection.value.filter(item => (item.isInvoice === 2 && item.payStatus === 1 && [1, 2].includes(item.orderStatus)));
|
||||
if (!list.length) return message.error("无可开票订单");
|
||||
current.value = {
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ThinkOrder) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import * as MenuIcons from '@/layout/menu-icons';
|
||||
import * as MenuIcons from "@/layout/menu-icons";
|
||||
|
||||
export default {
|
||||
name: 'ThinkOrder',
|
||||
components: MenuIcons
|
||||
};
|
||||
export default {
|
||||
name: "ThinkOrder",
|
||||
components: MenuIcons
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.tag-icon {
|
||||
padding-right: 6px;
|
||||
}
|
||||
.tag-icon {
|
||||
padding-right: 6px;
|
||||
}
|
||||
</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