新增:VIP卡的上架下架功能、及是否有效属性
This commit is contained in:
+2
-2
@@ -2,10 +2,10 @@ VITE_APP_NAME=后台管理系统
|
||||
VITE_SOCKET_URL=wss://server.gxwebsoft.com
|
||||
VITE_SERVER_URL=https://gxtyzx-server.websoft.top/api
|
||||
VITE_API_URL=https://gxtyzx-modules.websoft.top/api
|
||||
VITE_THINK_URL=https://gxtyzx-api2.websoft.top/api
|
||||
#VITE_THINK_URL=https://gxtyzx-api2.websoft.top/api
|
||||
|
||||
|
||||
#VITE_SERVER_URL=http://127.0.0.1:30000/api
|
||||
#VITE_API_URL=http://127.0.0.1:9002/api
|
||||
#VITE_THINK_URL=http://127.0.0.1:9099/api
|
||||
VITE_THINK_URL=http://127.0.0.1:9099/api
|
||||
#/booking/bookingItem
|
||||
|
||||
@@ -47,6 +47,8 @@ export interface ThinkVip {
|
||||
updateTime?: number;
|
||||
// 是否有效:1是,0否
|
||||
isUse?: number;
|
||||
// 是否销售:1是,0否
|
||||
isSale?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,7 +56,10 @@ export interface ThinkVip {
|
||||
*/
|
||||
export interface ThinkVipParam{
|
||||
id?: number;
|
||||
isSale?: number;
|
||||
createTimeStart?: number;
|
||||
createTimeEnd?: number;
|
||||
timeStart?: number;
|
||||
timeEnd?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
|
||||
@@ -31,8 +31,13 @@
|
||||
</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,7 +57,9 @@
|
||||
<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>
|
||||
@@ -69,27 +76,29 @@
|
||||
</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 { 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";
|
||||
} 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";
|
||||
removeBatchThinkInvoice,
|
||||
updateThinkInvoice,
|
||||
doInvoice
|
||||
} from '@/api/think/thinkInvoice';
|
||||
import type {
|
||||
ThinkInvoice,
|
||||
ThinkInvoiceParam
|
||||
} from "@/api/think/thinkInvoice/model";
|
||||
import * as InvoiceApi from "@/api/think/thinkInvoice";
|
||||
} from '@/api/think/thinkInvoice/model';
|
||||
import * as InvoiceApi from '@/api/think/thinkInvoice';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
@@ -128,83 +137,83 @@ const datasource: DatasourceFunction = ({
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: "left",
|
||||
align: "center",
|
||||
fixed: 'left',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
},
|
||||
{
|
||||
title: "订单号",
|
||||
dataIndex: "orderNum",
|
||||
key: "oid",
|
||||
align: "center"
|
||||
title: '订单号',
|
||||
dataIndex: 'orderNum',
|
||||
key: 'oid',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "公司名称",
|
||||
dataIndex: "name",
|
||||
key: "name",
|
||||
align: "center"
|
||||
title: '公司名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "发票金额",
|
||||
dataIndex: "price",
|
||||
key: "price",
|
||||
align: "center"
|
||||
title: '发票金额',
|
||||
dataIndex: 'price',
|
||||
key: 'price',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "税号",
|
||||
dataIndex: "code",
|
||||
key: "code",
|
||||
align: "center"
|
||||
title: '税号',
|
||||
dataIndex: 'code',
|
||||
key: 'code',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "备注信息",
|
||||
dataIndex: "info",
|
||||
key: "info",
|
||||
align: "center"
|
||||
title: '备注信息',
|
||||
dataIndex: 'info',
|
||||
key: 'info',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "是否已开",
|
||||
dataIndex: "isOpen",
|
||||
key: "isOpen",
|
||||
align: "center",
|
||||
title: '是否已开',
|
||||
dataIndex: 'isOpen',
|
||||
key: 'isOpen',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "发票类型",
|
||||
dataIndex: "type",
|
||||
key: "type",
|
||||
align: "center",
|
||||
title: '发票类型',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
align: 'center',
|
||||
customRender: ({ text }) => {
|
||||
if (text === 1) {
|
||||
return "电子";
|
||||
return '电子';
|
||||
} else {
|
||||
return "纸质";
|
||||
return '纸质';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "开票类型",
|
||||
dataIndex: "invoicetype",
|
||||
key: "invoicetype",
|
||||
align: "center",
|
||||
title: '开票类型',
|
||||
dataIndex: 'invoicetype',
|
||||
key: 'invoicetype',
|
||||
align: 'center',
|
||||
customRender: ({ text }) => {
|
||||
if (text === 1) {
|
||||
return "普票";
|
||||
return '普票';
|
||||
} else {
|
||||
return "专票";
|
||||
return '专票';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "开票时间",
|
||||
dataIndex: "createTime",
|
||||
key: "createTime",
|
||||
align: "center",
|
||||
title: '开票时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -221,7 +230,7 @@ const openEdit = (row?: ThinkInvoice) => {
|
||||
};
|
||||
|
||||
const openInvoicePdf = (row: ThinkInvoice) => {
|
||||
const hide = message.loading("请求中..", 0);
|
||||
const hide = message.loading('请求中..', 0);
|
||||
InvoiceApi.showInvoice(row?.id).then((res) => {
|
||||
const parse = JSON.parse(res);
|
||||
const pdfUrl = parse[0].pdfUrl;
|
||||
@@ -237,7 +246,7 @@ const openMove = () => {
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ThinkInvoice) => {
|
||||
const hide = message.loading("请求中..", 0);
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeThinkInvoice(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
@@ -253,16 +262,16 @@ const remove = (row: ThinkInvoice) => {
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error("请至少选择一条数据");
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定要删除选中的记录吗?",
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading("请求中..", 0);
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchThinkInvoice(selection.value.map((d) => d.id))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
@@ -284,7 +293,7 @@ const query = () => {
|
||||
|
||||
const openInvoice = async (row: ThinkInvoice) => {
|
||||
await doInvoice(row);
|
||||
message.success("操作成功");
|
||||
message.success('操作成功');
|
||||
reload();
|
||||
};
|
||||
|
||||
@@ -293,7 +302,7 @@ const refuse = async (row: ThinkInvoice) => {
|
||||
id: row.id,
|
||||
status: 2
|
||||
});
|
||||
message.success("操作成功");
|
||||
message.success('操作成功');
|
||||
reload();
|
||||
};
|
||||
|
||||
@@ -315,7 +324,7 @@ query();
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "ThinkInvoice"
|
||||
name: 'ThinkInvoice'
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,13 +2,23 @@
|
||||
<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
|
||||
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
|
||||
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>
|
||||
@@ -18,7 +28,12 @@
|
||||
<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
|
||||
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>
|
||||
@@ -39,7 +54,12 @@
|
||||
<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
|
||||
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>
|
||||
@@ -65,7 +85,9 @@
|
||||
style="width: 380px"
|
||||
/>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
<a-button @click="setHasInvoice" :disabled="!selection?.length">设置已开票</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 />-->
|
||||
@@ -76,16 +98,20 @@
|
||||
</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,
|
||||
updateBatchThinkOrder,
|
||||
updateThinkOrder
|
||||
} from '@/api/think/thinkOrder';
|
||||
import { ThinkOrder, ThinkOrderParam } from '@/api/think/thinkOrder/model';
|
||||
import { ThinkSite } from '@/api/think/thinkSite/model';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -96,10 +122,10 @@ const props = withDefaults(
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "search", where?: ThinkOrderInfoParam): void;
|
||||
(e: "add"): void;
|
||||
(e: "remove"): void;
|
||||
(e: "advanced"): void;
|
||||
(e: 'search', where?: ThinkOrderInfoParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'advanced'): void;
|
||||
}>();
|
||||
|
||||
// 表单数据
|
||||
@@ -120,7 +146,7 @@ const { where, resetFields } = useSearch<ThinkOrderParam>({
|
||||
// 请求状态
|
||||
const loading = ref(false);
|
||||
// 日期范围选择
|
||||
const dateRange = ref<[string, string]>(["", ""]);
|
||||
const dateRange = ref<[string, string]>(['', '']);
|
||||
const orders = ref<ThinkOrder[] | any[]>();
|
||||
const xlsFileName = ref<string>();
|
||||
|
||||
@@ -132,7 +158,7 @@ const search = () => {
|
||||
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", {
|
||||
emit('search', {
|
||||
...where
|
||||
});
|
||||
};
|
||||
@@ -154,18 +180,18 @@ const handleExport = async () => {
|
||||
loading.value = true;
|
||||
const array: (string | number)[][] = [
|
||||
[
|
||||
"订单号",
|
||||
"订单编号",
|
||||
"姓名",
|
||||
"电话号码",
|
||||
"预定信息",
|
||||
"消费金额",
|
||||
"实付金额",
|
||||
"下单日期"
|
||||
'订单号',
|
||||
'订单编号',
|
||||
'姓名',
|
||||
'电话号码',
|
||||
'预定信息',
|
||||
'消费金额',
|
||||
'实付金额',
|
||||
'下单日期'
|
||||
]
|
||||
];
|
||||
if (!where.timeStart) {
|
||||
message.error("请选择导出的开始日期、结束日期,每次最多导出5000条记录");
|
||||
message.error('请选择导出的开始日期、结束日期,每次最多导出5000条记录');
|
||||
return false;
|
||||
}
|
||||
await listThinkOrder(where)
|
||||
@@ -191,7 +217,7 @@ const handleExport = async () => {
|
||||
const sheet = utils.aoa_to_sheet(array);
|
||||
workbook.Sheets[sheetName] = sheet;
|
||||
// 设置列宽
|
||||
sheet["!cols"] = [
|
||||
sheet['!cols'] = [
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
@@ -200,12 +226,12 @@ const handleExport = async () => {
|
||||
{ wch: 40 },
|
||||
{ wch: 10 }
|
||||
];
|
||||
message.loading("正在导出...");
|
||||
message.loading('正在导出...');
|
||||
setTimeout(() => {
|
||||
writeFile(
|
||||
workbook,
|
||||
`${
|
||||
where.createTimeEnd ? xlsFileName.value + "_" : ""
|
||||
where.createTimeEnd ? xlsFileName.value + '_' : ''
|
||||
}${sheetName}.xlsx`
|
||||
);
|
||||
loading.value = false;
|
||||
@@ -215,26 +241,25 @@ const handleExport = async () => {
|
||||
message.error(msg);
|
||||
loading.value = false;
|
||||
})
|
||||
.finally(() => {
|
||||
});
|
||||
.finally(() => {});
|
||||
};
|
||||
|
||||
const setHasInvoice = async () => {
|
||||
const hide = message.loading("请求中..", 0);
|
||||
const hide = message.loading('请求中..', 0);
|
||||
if (props.selection) {
|
||||
props.selection.filter(item => item.isInvoice === 2).map(async item => {
|
||||
props.selection
|
||||
.filter((item) => item.isInvoice === 2)
|
||||
.map(async (item) => {
|
||||
item.isInvoice = 1;
|
||||
await updateThinkOrder(item);
|
||||
});
|
||||
|
||||
}
|
||||
hide();
|
||||
message.success("设置成功");
|
||||
message.success('设置成功');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {
|
||||
}
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -145,8 +145,7 @@
|
||||
<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>
|
||||
@@ -178,7 +177,8 @@
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-if="record.payStatus == 3 || record.payStatus == 0"
|
||||
color="cyan">
|
||||
color="cyan"
|
||||
>
|
||||
<CoffeeOutlined class="tag-icon" />
|
||||
未付款,占场中
|
||||
</a-tag>
|
||||
@@ -188,20 +188,29 @@
|
||||
</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
|
||||
@@ -228,8 +237,15 @@
|
||||
<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>
|
||||
<a
|
||||
@click="openRefund(record)"
|
||||
v-if="
|
||||
record.payStatus === 1 &&
|
||||
[1, 3].includes(record.payType) &&
|
||||
[1, 2].includes(record.orderStatus)
|
||||
"
|
||||
>退款</a
|
||||
>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
@@ -245,35 +261,35 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from "vue";
|
||||
import { message, Modal } from "ant-design-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";
|
||||
} 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";
|
||||
} 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";
|
||||
} 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";
|
||||
} 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';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
@@ -313,103 +329,101 @@ const datasource: DatasourceFunction = ({
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{},
|
||||
{
|
||||
|
||||
},
|
||||
{
|
||||
title: "订单号",
|
||||
dataIndex: "id",
|
||||
key: "iod",
|
||||
title: '订单号',
|
||||
dataIndex: 'id',
|
||||
key: 'iod',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "name",
|
||||
key: "name",
|
||||
align: "center"
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "phone",
|
||||
key: "phone",
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
key: 'phone',
|
||||
width: 120,
|
||||
align: "center"
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "预约信息",
|
||||
dataIndex: "dateTime",
|
||||
key: "dateTime",
|
||||
title: '预约信息',
|
||||
dataIndex: 'dateTime',
|
||||
key: 'dateTime',
|
||||
width: 120,
|
||||
align: "center"
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "总额",
|
||||
dataIndex: "totalPrice",
|
||||
key: "totalPrice",
|
||||
align: "center",
|
||||
title: '总额',
|
||||
dataIndex: 'totalPrice',
|
||||
key: 'totalPrice',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
customRender: ({ text }) => `¥${formatNumber(text)}`
|
||||
},
|
||||
{
|
||||
title: "减少金额",
|
||||
dataIndex: "reducePrice",
|
||||
key: "reducePrice",
|
||||
align: "center",
|
||||
title: '减少金额',
|
||||
dataIndex: 'reducePrice',
|
||||
key: 'reducePrice',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
customRender: ({ text }) => `¥${formatNumber(text)}`
|
||||
},
|
||||
{
|
||||
title: "实付金额",
|
||||
dataIndex: "payPrice",
|
||||
key: "payPrice",
|
||||
align: "center",
|
||||
title: '实付金额',
|
||||
dataIndex: 'payPrice',
|
||||
key: 'payPrice',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
customRender: ({ text }) => `¥${formatNumber(text)}`
|
||||
},
|
||||
{
|
||||
title: "支付方式",
|
||||
dataIndex: "payType",
|
||||
key: "payType",
|
||||
align: "center"
|
||||
title: '支付方式',
|
||||
dataIndex: 'payType',
|
||||
key: 'payType',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "IC卡号",
|
||||
dataIndex: "code",
|
||||
key: "code",
|
||||
align: "center"
|
||||
title: 'IC卡号',
|
||||
dataIndex: 'code',
|
||||
key: 'code',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "付款状态",
|
||||
dataIndex: "payStatus",
|
||||
key: "payStatus",
|
||||
title: '付款状态',
|
||||
dataIndex: 'payStatus',
|
||||
key: 'payStatus',
|
||||
sorter: true,
|
||||
align: "center"
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "付款时间",
|
||||
dataIndex: "payTime",
|
||||
key: "payTime",
|
||||
title: '付款时间',
|
||||
dataIndex: 'payTime',
|
||||
key: 'payTime',
|
||||
sorter: true,
|
||||
align: "center",
|
||||
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||
align: 'center',
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: "订单状态",
|
||||
dataIndex: "orderStatus",
|
||||
key: "orderStatus",
|
||||
align: "center"
|
||||
title: '订单状态',
|
||||
dataIndex: 'orderStatus',
|
||||
key: 'orderStatus',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "优惠类型",
|
||||
dataIndex: "couponType",
|
||||
key: "couponType",
|
||||
align: "center"
|
||||
title: '优惠类型',
|
||||
dataIndex: 'couponType',
|
||||
key: 'couponType',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "开票状态",
|
||||
dataIndex: "isInvoice",
|
||||
key: "isInvoice",
|
||||
align: "center",
|
||||
title: '开票状态',
|
||||
dataIndex: 'isInvoice',
|
||||
key: 'isInvoice',
|
||||
align: 'center',
|
||||
sorter: true
|
||||
},
|
||||
// {
|
||||
@@ -434,11 +448,11 @@ const columns = ref<ColumnItem[]>([
|
||||
// align: 'center'
|
||||
// },
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 120,
|
||||
fixed: "right",
|
||||
align: "center",
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
@@ -469,7 +483,7 @@ const openMove = () => {
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ThinkOrder) => {
|
||||
const hide = message.loading("请求中..", 0);
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeThinkOrder(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
@@ -485,16 +499,16 @@ const remove = (row: ThinkOrder) => {
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error("请至少选择一条数据");
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定要删除选中的记录吗?",
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading("请求中..", 0);
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchThinkOrder(selection.value.map((d) => d.id))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
@@ -551,10 +565,10 @@ query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import * as MenuIcons from "@/layout/menu-icons";
|
||||
import * as MenuIcons from '@/layout/menu-icons';
|
||||
|
||||
export default {
|
||||
name: "ThinkOrder",
|
||||
name: 'ThinkOrder',
|
||||
components: MenuIcons
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
>
|
||||
<span>同步会员卡权限</span>
|
||||
</a-button>
|
||||
<a-radio-group v-model:value="where.isSale" @change="search">
|
||||
<a-radio-button :value="1">已上架</a-radio-button>
|
||||
<a-radio-button :value="0">已下架</a-radio-button>
|
||||
</a-radio-group>
|
||||
<a-input-search
|
||||
allow-clear
|
||||
placeholder="会员卡名称"
|
||||
@@ -46,7 +50,7 @@
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'search', where?: ThinkVipParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
@@ -55,6 +59,7 @@
|
||||
// 表单数据
|
||||
const { where } = useSearch<ThinkVipParam>({
|
||||
id: undefined,
|
||||
isSale: 1,
|
||||
keywords: undefined,
|
||||
timeStart: undefined,
|
||||
timeEnd: undefined
|
||||
|
||||
@@ -135,9 +135,9 @@
|
||||
{{ form.prices }}
|
||||
</a-form-item>
|
||||
<a-form-item label="是否有效" name="isUse">
|
||||
<a-radio-group v-model:value="form.isIntegral">
|
||||
<a-radio-group v-model:value="form.isUse">
|
||||
<a-radio :value="1">是</a-radio>
|
||||
<a-radio :value="2">否</a-radio>
|
||||
<a-radio :value="0">否</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
|
||||
@@ -40,6 +40,15 @@
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="updateStatus(record)">
|
||||
<span class="text-green-500" v-if="record.isSale == 1"
|
||||
>已上架</span
|
||||
>
|
||||
<span class="text-gray-400" v-if="record.isSale == 0"
|
||||
>已下架</span
|
||||
>
|
||||
</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
@@ -75,7 +84,8 @@
|
||||
import {
|
||||
pageThinkVip,
|
||||
removeThinkVip,
|
||||
removeBatchThinkVip
|
||||
removeBatchThinkVip,
|
||||
updateThinkVip
|
||||
} from '@/api/think/thinkVip';
|
||||
import type { ThinkVip, ThinkVipParam } from '@/api/think/thinkVip/model';
|
||||
|
||||
@@ -92,6 +102,7 @@
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
const isSale = ref<number>(1);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
@@ -104,6 +115,9 @@
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
if (where.isSale == undefined) {
|
||||
where.isSale = isSale.value;
|
||||
}
|
||||
return pageThinkVip({
|
||||
...where,
|
||||
...orders,
|
||||
@@ -270,6 +284,9 @@
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ThinkVipParam) => {
|
||||
if (where?.isSale) {
|
||||
isSale.value = where.isSale;
|
||||
}
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
@@ -280,6 +297,16 @@
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
const updateStatus = (row: ThinkVip) => {
|
||||
updateThinkVip({
|
||||
id: row.id,
|
||||
isSale: row.isSale == 1 ? 0 : 1
|
||||
}).then(() => {
|
||||
message.success('操作成功');
|
||||
reload();
|
||||
});
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
|
||||
Reference in New Issue
Block a user