250825
This commit is contained in:
@@ -0,0 +1,286 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="'开具发票'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="发票金额" name="price">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入发票金额"
|
||||
v-model:value="form.price"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="单位名称" name="name">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入单位名称"
|
||||
v-model:value="form.name"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="税号" name="code">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入税号"
|
||||
v-model:value="form.code"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="开户行" name="bank">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入开户行"
|
||||
v-model:value="form.bank"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="开户账号" name="account">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入开户账号"
|
||||
v-model:value="form.account"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="单位地址" name="address">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入单位地址"
|
||||
v-model:value="form.address"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="公司电话" name="tel">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入公司电话"
|
||||
v-model:value="form.tel"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="手机号码" name="phone">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入手机号码"
|
||||
v-model:value="form.phone"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="电子邮箱" name="email">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入电子邮箱"
|
||||
v-model:value="form.email"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注信息" name="info">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入备注信息"
|
||||
v-model:value="form.info"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="发票类型" name="type">
|
||||
<a-radio-group v-model:value="form.type">
|
||||
<a-radio :value="1">纸质发票</a-radio>
|
||||
<a-radio :value="2">电子发票</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="发票类型" name="itype">
|
||||
<a-radio-group v-model:value="form.itype" :disabled="true">
|
||||
<a-radio :value="1">场地发票</a-radio>
|
||||
<a-radio :value="2">vip卡发票</a-radio>
|
||||
<a-radio :value="3">IC卡发票</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="发票类型" name="invoicetype">
|
||||
<a-radio-group v-model:value="form.invoicetype" :disabled="true">
|
||||
<a-radio :value="1">普票</a-radio>
|
||||
<a-radio :value="2">专票</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import {
|
||||
addThinkInvoice,
|
||||
doInvoice,
|
||||
pageThinkInvoice,
|
||||
updateThinkInvoice
|
||||
} from '@/api/think/thinkInvoice';
|
||||
import { ThinkInvoice } from '@/api/think/thinkInvoice/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { ThinkOrder } from '@/api/think/thinkOrder/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ThinkOrder | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ThinkInvoice>({
|
||||
id: undefined,
|
||||
incoiveNum: undefined,
|
||||
incoiveCode: undefined,
|
||||
orderNum: undefined,
|
||||
oid: undefined,
|
||||
uid: undefined,
|
||||
price: undefined,
|
||||
name: undefined,
|
||||
tel: undefined,
|
||||
address: undefined,
|
||||
bank: undefined,
|
||||
account: undefined,
|
||||
code: undefined,
|
||||
phone: undefined,
|
||||
email: undefined,
|
||||
info: undefined,
|
||||
isOpen: undefined,
|
||||
type: 2,
|
||||
itype: 1,
|
||||
invoicetype: 1,
|
||||
createTime: undefined,
|
||||
updateTime: undefined
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
price: [
|
||||
{
|
||||
required: true,
|
||||
type: 'number',
|
||||
message: '请填写发票金额',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写单位名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
code: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写税号',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const onChangeInvoice = (data: ThinkInvoice) => {
|
||||
console.log(data);
|
||||
console.log(form);
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
// const saveOrUpdate = isUpdate.value
|
||||
// ? updateThinkInvoice
|
||||
// : addThinkInvoice;
|
||||
doInvoice(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
// 第一次开票
|
||||
isUpdate.value = false;
|
||||
form.oid = props.data?.id;
|
||||
form.price = props.data?.price;
|
||||
form.incoiveNum = props.data?.code;
|
||||
form.orderNum = props.data?.code;
|
||||
form.vid = props.data?.vid;
|
||||
form.phone = props.data?.phone;
|
||||
form.itype = 3;
|
||||
|
||||
// 开过票
|
||||
pageThinkInvoice({ uid: props.data?.uid, limit: 1 }).then((res) => {
|
||||
if (res && res.list.length > 0) {
|
||||
assignObject(form, res?.list[0]);
|
||||
isUpdate.value = true;
|
||||
form.oid = props.data?.id;
|
||||
form.price = props.data?.price;
|
||||
form.incoiveNum = props.data?.code;
|
||||
form.vid = props.data?.vid;
|
||||
form.phone = props.data?.phone;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
@@ -0,0 +1,101 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="'80%'"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
title="使用记录"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
:footer="null"
|
||||
@update:visible="updateVisible"
|
||||
>
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
:need-page="false"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
:loading="loading"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'order'">
|
||||
<a-tag color="green" v-if="!!record.order">已使用</a-tag>
|
||||
<a-tag color="red" v-else>未使用</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'startTime'">
|
||||
<text>{{ dayjs(record.startTime * 1000).format('YYYY-MM-DD') }}</text>
|
||||
</template>
|
||||
<template v-if="column.key === 'orderInfo'">
|
||||
<span v-if="record.order">{{ record.order.thinkOrderInfos.map(item => item.dateTime).join() }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from "vue";
|
||||
import { EleProTable } from "ele-admin-pro";
|
||||
import type { ColumnItem, DatasourceFunction } from "ele-admin-pro/es/ele-pro-table/types";
|
||||
import { listThinkOrder } from "@/api/think/thinkOrder";
|
||||
import { ThinkCard } from "@/api/think/thinkCard/model";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ThinkCard | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "done"): void;
|
||||
(e: "update:visible", visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit("update:visible", value);
|
||||
};
|
||||
|
||||
const datasource: DatasourceFunction = () => {
|
||||
return listThinkOrder({
|
||||
cid: props?.data?.id
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "日期",
|
||||
key: "startTime",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "使用场馆",
|
||||
dataIndex: "siteName",
|
||||
align: "center"
|
||||
}
|
||||
]);
|
||||
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
tableRef?.value?.reload();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
@@ -28,6 +28,8 @@
|
||||
<a-space>
|
||||
<span>{{ record.username }}</span>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="openLog(record)">使用记录</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要解除绑定吗?"
|
||||
@confirm="unBindCard(record)"
|
||||
@@ -43,6 +45,8 @@
|
||||
>
|
||||
<a class="ele-text-danger">注销</a>
|
||||
</a-popconfirm>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="onInvoice(record)" v-if="record.isInvoice === 2">开票</a>
|
||||
</a-space>
|
||||
</template>
|
||||
<template v-if="column.key === 'sid'">
|
||||
@@ -91,7 +95,9 @@
|
||||
@done="reload"
|
||||
/>
|
||||
<MakeICCard v-model:visible="showMakeCard" @done="reload" />
|
||||
<ThinkCardLog v-model:visible="showLog" :data="current" />
|
||||
</div>
|
||||
<Invoice v-model:visible="showInvoice" :data="current" @done="reload" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -115,6 +121,8 @@ import {
|
||||
} from "@/api/think/thinkCard";
|
||||
import type { ThinkCard, ThinkCardParam } from "@/api/think/thinkCard/model";
|
||||
import MakeICCard from "@/views/think/thinkCard/components/makeICCard.vue";
|
||||
import ThinkCardLog from "./components/thinkCardLog.vue";
|
||||
import Invoice from "./components/invoice.vue";
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
@@ -143,7 +151,9 @@ const payTypes = ref<string[]>([
|
||||
"支付宝支付",
|
||||
"现金",
|
||||
"POS机刷卡",
|
||||
"平安健康卡"
|
||||
"平安健康卡",
|
||||
"免费",
|
||||
"抖音支付",
|
||||
]);
|
||||
const isIntegral = ref<string[]>(["", "赠送", "不赠送"]);
|
||||
|
||||
@@ -169,12 +179,12 @@ const datasource: DatasourceFunction = ({
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "姓名",
|
||||
title: "操作",
|
||||
dataIndex: "username",
|
||||
key: "username",
|
||||
align: "center",
|
||||
fixed: "left",
|
||||
width: 280
|
||||
width: 400
|
||||
},
|
||||
{
|
||||
title: "卡号",
|
||||
@@ -346,110 +356,6 @@ const columns = ref<ColumnItem[]>([
|
||||
width: 180,
|
||||
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||
}
|
||||
// {
|
||||
// title: '微信订单号',
|
||||
// dataIndex: 'wechatOrder',
|
||||
// key: 'wechatOrder',
|
||||
// align: 'center'
|
||||
// },
|
||||
// {
|
||||
// title: '手机号码',
|
||||
// dataIndex: 'phone',
|
||||
// key: 'phone',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '会员卡介绍',
|
||||
// dataIndex: 'desc',
|
||||
// key: 'desc',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '会员卡说明',
|
||||
// dataIndex: 'info',
|
||||
// key: 'info',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '续费累加次数',
|
||||
// dataIndex: 'number',
|
||||
// key: 'number',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '付款状态,1已付款,2未付款',
|
||||
// dataIndex: 'status',
|
||||
// key: 'status',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '卡类型:1成人卡,2儿童卡',
|
||||
// dataIndex: 'cardType',
|
||||
// key: 'cardType',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: 'vip卡等级类型:1特殊vip卡,2普通vip卡',
|
||||
// dataIndex: 'vipType',
|
||||
// key: 'vipType',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '特殊卡开发凭证图',
|
||||
// dataIndex: 'pic',
|
||||
// key: 'pic',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '价格组',
|
||||
// dataIndex: 'prices',
|
||||
// key: 'prices',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '卡号',
|
||||
// dataIndex: 'cardNum',
|
||||
// key: 'cardNum',
|
||||
// align: 'center'
|
||||
// }
|
||||
// {
|
||||
// title: '密码',
|
||||
// dataIndex: 'password',
|
||||
// key: 'password',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '使用时间',
|
||||
// dataIndex: 'useTime',
|
||||
// key: 'useTime',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '',
|
||||
// dataIndex: 'updateTime',
|
||||
// key: 'updateTime',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '身份证号码',
|
||||
// dataIndex: 'idcard',
|
||||
// key: 'idcard',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '备注',
|
||||
// dataIndex: 'remark',
|
||||
// key: 'remark',
|
||||
// align: 'center',
|
||||
// },
|
||||
// {
|
||||
// title: '操作',
|
||||
// key: 'action',
|
||||
// width: 180,
|
||||
// fixed: 'right',
|
||||
// align: 'center',
|
||||
// hideInSetting: true
|
||||
// }
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
@@ -541,6 +447,18 @@ const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
const showLog = ref(false)
|
||||
const openLog = (row: ThinkCard) => {
|
||||
showLog.value = true
|
||||
current.value = row
|
||||
}
|
||||
|
||||
const showInvoice = ref(false)
|
||||
const onInvoice = (row?: ThinkCard) => {
|
||||
current.value = row ?? null;
|
||||
showInvoice.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ThinkCard) => {
|
||||
return {
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
ThinkCardLog,
|
||||
ThinkCardLogParam
|
||||
} from '@/api/think/thinkCardLog/model';
|
||||
import { listThinkCardLog } from '@/api/think/thinkCardLog';
|
||||
import { listThinkCardLog, thinkCardLogExport } from "@/api/think/thinkCardLog";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -106,74 +106,8 @@
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
loading.value = true;
|
||||
const array: (string | number)[][] = [
|
||||
[
|
||||
'卡号',
|
||||
'姓名',
|
||||
'手机号',
|
||||
'会员卡名称',
|
||||
'支付方式',
|
||||
'充值金额',
|
||||
'充值次数',
|
||||
'操作员',
|
||||
'第三方订单号',
|
||||
'充值时间'
|
||||
]
|
||||
];
|
||||
if (!where.timeStart) {
|
||||
message.error('请选择导出的开始日期、结束日期,每次最多导出5000条记录');
|
||||
return false;
|
||||
}
|
||||
await listThinkCardLog(where)
|
||||
.then((list) => {
|
||||
orders.value = list;
|
||||
orders.value?.forEach((d: ThinkCardLog) => {
|
||||
array.push([
|
||||
`${d.code}`,
|
||||
`${d.username}`,
|
||||
`${d.phone}`,
|
||||
`${d.cardName}`,
|
||||
`${payType.value[Number(d.payType)]}`,
|
||||
`${d.money}`,
|
||||
`${d.count}`,
|
||||
`${d.adminName || d.aid}`,
|
||||
`${d.wechatOrder}`,
|
||||
`${toDateString(d.createTime)}`
|
||||
]);
|
||||
});
|
||||
const sheetName = `充值记录导出`;
|
||||
const workbook = {
|
||||
SheetNames: [sheetName],
|
||||
Sheets: {}
|
||||
};
|
||||
const sheet = utils.aoa_to_sheet(array);
|
||||
workbook.Sheets[sheetName] = sheet;
|
||||
// 设置列宽
|
||||
sheet['!cols'] = [
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 20 },
|
||||
{ wch: 40 },
|
||||
{ wch: 10 }
|
||||
];
|
||||
message.loading('正在导出...');
|
||||
setTimeout(() => {
|
||||
writeFile(
|
||||
workbook,
|
||||
`${
|
||||
where.createTimeEnd ? xlsFileName.value + '_' : ''
|
||||
}${sheetName}.xlsx`
|
||||
);
|
||||
loading.value = false;
|
||||
}, 2000);
|
||||
})
|
||||
.catch((msg) => {
|
||||
message.error(msg);
|
||||
loading.value = false;
|
||||
})
|
||||
.finally(() => {});
|
||||
const res = await thinkCardLogExport(where)
|
||||
window.open(res.data.url);
|
||||
};
|
||||
|
||||
watch(
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
<a-tag v-if="record.payType === 2">支付宝支付</a-tag>
|
||||
<a-tag v-if="record.payType === 3">现金支付</a-tag>
|
||||
<a-tag v-if="record.payType === 4">POS支付</a-tag>
|
||||
<a-tag v-if="record.payType === 5">平安健康卡</a-tag>
|
||||
<a-tag v-if="record.payType === 6">对公支付</a-tag>
|
||||
<a-tag v-if="record.payType === 8">抖音支付</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'money'">
|
||||
¥{{ formatNumber(record.money) }}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
value-format="YYYY-MM-DD"
|
||||
class="ele-fluid"
|
||||
/>
|
||||
<a-button type="primary" @click="exportExcel">导出</a-button>
|
||||
</a-space>
|
||||
<p class="ele-text-danger font-bold mt-2">总金额:{{ totalAmount }}元</p>
|
||||
</div>
|
||||
@@ -17,6 +18,8 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from "vue";
|
||||
import { ThinkCardsBillsParam } from "@/api/think/thinkCardsBills/model";
|
||||
import { messageLoading } from "ele-admin-pro";
|
||||
import { thinkVipCardsBillsExport } from "@/api/think/thinkVipCardsBills";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -46,6 +49,22 @@ const search = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const exportExcel = async () => {
|
||||
let dateStart = "", dateEnd = "";
|
||||
if (dateRange.value && dateRange.value?.length > 0) {
|
||||
[dateStart, dateEnd] = dateRange.value;
|
||||
}
|
||||
const hide = messageLoading("导出中...", 0);
|
||||
const { data } = await thinkVipCardsBillsExport({
|
||||
dateStart,
|
||||
dateEnd,
|
||||
isCard: true
|
||||
});
|
||||
hide();
|
||||
window.open(data.url);
|
||||
};
|
||||
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
</template>
|
||||
<p v-else>散客</p>
|
||||
</template>
|
||||
<template v-if="column.key === 'vid'">
|
||||
<p v-if="record.card">{{ record.card.name }}</p>
|
||||
<p v-if="record.vip">{{ record.vip.name }}</p>
|
||||
</template>
|
||||
<template v-if="column.key === 'used'">
|
||||
<a-tag v-if="record.used === 1" color="green">已使用</a-tag>
|
||||
<a-tag v-if="record.used === 0" color="red">未使用</a-tag>
|
||||
@@ -61,6 +65,7 @@ import {
|
||||
thinkCardsBillsTotalAmount
|
||||
} from "@/api/think/thinkCardsBills";
|
||||
import type { ThinkCardsBills, ThinkCardsBillsParam } from "@/api/think/thinkCardsBills/model";
|
||||
import { pageThinkVipCardsBills } from "@/api/think/thinkVipCardsBills";
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
@@ -88,7 +93,8 @@ const datasource: DatasourceFunction = ({
|
||||
where.status = filters.status;
|
||||
}
|
||||
getTotalAmount(where);
|
||||
return pageThinkCardsBills({
|
||||
where.isCard = true;
|
||||
return pageThinkVipCardsBills({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
@@ -109,8 +115,7 @@ const columns = ref<ColumnItem[]>([
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "VIP卡",
|
||||
dataIndex: ["vip", "name"],
|
||||
title: "卡类型",
|
||||
key: "vid",
|
||||
align: "center"
|
||||
},
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
:max="9999"
|
||||
class="ele-fluid"
|
||||
placeholder="请输入排序号"
|
||||
v-model:value="form.sortNumber"
|
||||
v-model:value="form.sort"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
@@ -143,7 +143,7 @@
|
||||
isHalf: undefined,
|
||||
isChildren: undefined,
|
||||
num: undefined,
|
||||
sort: undefined,
|
||||
sort: 1,
|
||||
sid: undefined,
|
||||
row: undefined,
|
||||
createTime: undefined
|
||||
@@ -156,7 +156,7 @@
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
name: [
|
||||
name: [K
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
|
||||
@@ -53,6 +53,10 @@
|
||||
v-if="record.resJson && record.resJson.includes('本次操作需登录电子发票服务平台,请先使用短信验证码登录')">
|
||||
本次操作需登录电子发票服务平台,请先使用短信验证码登录
|
||||
</template>
|
||||
<template
|
||||
v-else-if="record.resJson && record.resJson.includes('发票额度已不够使用')">
|
||||
发票额度已不够使用
|
||||
</template>
|
||||
</p>
|
||||
<a-space v-if="record.isOpen === 2 && record.status === 0">
|
||||
<a @click="openInvoice(record)">开票</a>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<a-card class="order-card" :bordered="false">
|
||||
<a-descriptions title="基本信息" :column="3">
|
||||
<a-descriptions-item
|
||||
label="订单号"
|
||||
label="订单ID"
|
||||
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||
>
|
||||
{{ form.id }}
|
||||
|
||||
@@ -51,7 +51,8 @@ const form = reactive<ThinkOrderRefundLog>({
|
||||
sid: undefined,
|
||||
oid: undefined,
|
||||
status: 1,
|
||||
type: 0
|
||||
type: 0,
|
||||
isAdmin: true
|
||||
});
|
||||
|
||||
// 请求状态
|
||||
|
||||
@@ -47,6 +47,11 @@
|
||||
<a-select-option :value="2">未开票</a-select-option>
|
||||
<a-select-option :value="3">不能开票</a-select-option>
|
||||
</a-select>
|
||||
<span class="text-gray-400">对账状态</span>
|
||||
<a-select v-model:value="where.checkBill" style="width: 150px" placeholder="对账状态筛选" @change="search">
|
||||
<a-select-option value="1">已对账</a-select-option>
|
||||
<a-select-option :value="2">未对账</a-select-option>
|
||||
</a-select>
|
||||
<ThinkSelectSite
|
||||
:placeholder="`选择场馆`"
|
||||
class="input-item"
|
||||
@@ -67,6 +72,14 @@
|
||||
@search="search"
|
||||
style="width: 380px"
|
||||
/>
|
||||
<a-input-search
|
||||
allow-clear
|
||||
placeholder="请输入微信支付单号|POS流水号"
|
||||
v-model:value="where.wechatOrder"
|
||||
@pressEnter="search"
|
||||
@search="search"
|
||||
style="width: 280px"
|
||||
/>
|
||||
</a-space>
|
||||
<div class="mt-2">
|
||||
<a-space>
|
||||
@@ -120,10 +133,12 @@ const { where, resetFields } = useSearch<ThinkOrderParam>({
|
||||
timeEnd: undefined,
|
||||
categoryId: undefined,
|
||||
keywords: undefined,
|
||||
wechatOrder: undefined,
|
||||
payStatus: undefined,
|
||||
orderStatus: undefined,
|
||||
payType: undefined,
|
||||
isInvoice: undefined
|
||||
isInvoice: undefined,
|
||||
checkBill: undefined,
|
||||
});
|
||||
// 请求状态
|
||||
const loading = ref(false);
|
||||
|
||||
@@ -222,6 +222,22 @@
|
||||
</a-tag>
|
||||
<a-tag v-if="record.isInvoice == 3" color="purple">不能开</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'checkBill'">
|
||||
<template v-if="record.payStatus === 1 && record.payType === 1 && !record.wechatOrder.includes('420000')">
|
||||
<a-tag
|
||||
v-if="record.checkBill == 1"
|
||||
color="green"
|
||||
class="cursor-pointer"
|
||||
>已对账
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-if="record.checkBill == 2"
|
||||
color="red"
|
||||
class="cursor-pointer"
|
||||
>未对账
|
||||
</a-tag>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
@@ -264,7 +280,7 @@ import {
|
||||
CloseOutlined,
|
||||
AlipayCircleOutlined
|
||||
} from "@ant-design/icons-vue";
|
||||
import { EleProTable, toDateString } from "ele-admin-pro";
|
||||
import { EleProTable, messageLoading, toDateString } from "ele-admin-pro";
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
@@ -276,7 +292,7 @@ import InvoiceByList from "./components/invoiceByList.vue";
|
||||
import {
|
||||
pageThinkOrder,
|
||||
removeThinkOrder,
|
||||
removeBatchThinkOrder
|
||||
removeBatchThinkOrder, thinkOrderExport
|
||||
} from "@/api/think/thinkOrder";
|
||||
import * as InvoiceApi from "@/api/think/thinkInvoice";
|
||||
import type {
|
||||
@@ -288,7 +304,6 @@ import type { ThinkInvoice } from "@/api/think/thinkInvoice/model";
|
||||
import Refund from "@/views/think/thinkOrder/components/refund.vue";
|
||||
import { hasPermission } from "@/utils/permission";
|
||||
import dayjs from "dayjs";
|
||||
import { doInvoiceByListReq } from "@/api/think/thinkInvoice";
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
@@ -424,6 +439,11 @@ const columns = ref<ColumnItem[]>([
|
||||
align: "center",
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: "对账状态",
|
||||
key: "checkBill",
|
||||
align: "center"
|
||||
},
|
||||
// {
|
||||
// title: '类型',
|
||||
// dataIndex: 'type',
|
||||
@@ -557,69 +577,11 @@ const openInvoiceByList = async () => {
|
||||
showInvoiceList.value = true;
|
||||
};
|
||||
|
||||
const handleExport = (where: ThinkOrderParam) => {
|
||||
console.log('开始导出');
|
||||
loading.value = true;
|
||||
const array: (string | number)[][] = [
|
||||
[
|
||||
'订单号',
|
||||
'订单编号',
|
||||
'姓名',
|
||||
'电话号码',
|
||||
'预定信息',
|
||||
'消费金额',
|
||||
'实付金额',
|
||||
'付款时间',
|
||||
'下单时间'
|
||||
]
|
||||
];
|
||||
if (!where.timeStart) {
|
||||
message.error('请选择导出的开始日期、结束日期,每次最多导出5000条记录');
|
||||
return false;
|
||||
}
|
||||
pageThinkOrder(where)
|
||||
.then((data) => {
|
||||
data.list?.forEach((d: ThinkOrder) => {
|
||||
array.push([
|
||||
`${d.id}`,
|
||||
`${d.orderNum}`,
|
||||
`${d.name}`,
|
||||
`${d.phone}`,
|
||||
`${d.siteName} ${d.dateTime} ${d.totalPrice}`,
|
||||
`${d.totalPrice}`,
|
||||
`${d.payPrice}`,
|
||||
`${toDateString(d.payTime, 'YYYY年MM月dd日 HH:mm:ss')}`,
|
||||
`${toDateString(d.createTime, 'YYYY年MM月dd日 HH:mm:ss')}`
|
||||
]);
|
||||
});
|
||||
const sheetName = `订单数据导出`;
|
||||
const workbook = {
|
||||
SheetNames: [sheetName],
|
||||
Sheets: {}
|
||||
};
|
||||
const sheet = utils.aoa_to_sheet(array);
|
||||
workbook.Sheets[sheetName] = sheet;
|
||||
// 设置列宽
|
||||
sheet['!cols'] = [
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 20 },
|
||||
{ wch: 40 },
|
||||
{ wch: 10 }
|
||||
];
|
||||
message.loading('正在导出...');
|
||||
setTimeout(() => {
|
||||
writeFile(workbook, `${sheetName}.xlsx`);
|
||||
loading.value = false;
|
||||
}, 2000);
|
||||
})
|
||||
.catch((msg) => {
|
||||
message.error(msg);
|
||||
loading.value = false;
|
||||
})
|
||||
.finally(() => {});
|
||||
const handleExport = async (params: ThinkOrderParam) => {
|
||||
const hide = messageLoading("导出中...", 0);
|
||||
const res = await thinkOrderExport(params);
|
||||
hide();
|
||||
window.open(res.url);
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
|
||||
@@ -32,16 +32,15 @@
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 1" color="green">已付款</a-tag>
|
||||
<a-tag v-if="record.status === 2" color="red">未付款</a-tag>
|
||||
<a-tag v-if="record.status === 3" color="red">已退款</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
<a-popconfirm v-if="record.status === 1"
|
||||
title="确定要退款吗?"
|
||||
@confirm="refund(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
<a class="ele-text-danger">退款</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
@@ -60,257 +59,255 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import ThinkRechargeLogEdit from './components/thinkRechargeLogEdit.vue';
|
||||
import {
|
||||
pageThinkRechargeLog,
|
||||
removeThinkRechargeLog,
|
||||
removeBatchThinkRechargeLog
|
||||
} from '@/api/think/thinkRechargeLog';
|
||||
import type {
|
||||
ThinkRechargeLog,
|
||||
ThinkRechargeLogParam
|
||||
} from '@/api/think/thinkRechargeLog/model';
|
||||
import { createVNode, ref } from "vue";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||
import type { EleProTable } from "ele-admin-pro";
|
||||
import { toDateString } from "ele-admin-pro";
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from "ele-admin-pro/es/ele-pro-table/types";
|
||||
import Search from "./components/search.vue";
|
||||
import ThinkRechargeLogEdit from "./components/thinkRechargeLogEdit.vue";
|
||||
import {
|
||||
pageThinkRechargeLog,
|
||||
removeThinkRechargeLog,
|
||||
removeBatchThinkRechargeLog, thinkRechargeLogRefund
|
||||
} from "@/api/think/thinkRechargeLog";
|
||||
import type {
|
||||
ThinkRechargeLog,
|
||||
ThinkRechargeLogParam
|
||||
} from "@/api/think/thinkRechargeLog/model";
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ThinkRechargeLog[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ThinkRechargeLog | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
// 表格选中数据
|
||||
const selection = ref<ThinkRechargeLog[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ThinkRechargeLog | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageThinkRechargeLog({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageThinkRechargeLog({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 80,
|
||||
fixed: "left",
|
||||
align: "center",
|
||||
hideInSetting: true
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "phone",
|
||||
key: "phone",
|
||||
align: "center",
|
||||
fixed: "left",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
title: "订单号",
|
||||
dataIndex: "orderNum",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "真实姓名",
|
||||
dataIndex: "realName",
|
||||
key: "realName",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "VIP卡名称",
|
||||
dataIndex: "vipName",
|
||||
key: "vipName",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "可用场馆",
|
||||
dataIndex: "siteNames",
|
||||
key: "siteNames",
|
||||
align: "center",
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: "充值金额",
|
||||
dataIndex: "money",
|
||||
key: "money",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "支付状态",
|
||||
dataIndex: "status",
|
||||
key: "status",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "微信支付订单号",
|
||||
dataIndex: "wechatOrder",
|
||||
key: "wechatOrder",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "会员卡类型",
|
||||
dataIndex: "vipType",
|
||||
key: "vipType",
|
||||
align: "center",
|
||||
customRender: ({ text }) => ["", "特殊VIP卡", "普通VIP卡"][text]
|
||||
},
|
||||
{
|
||||
title: "会员卡类型",
|
||||
dataIndex: "cardType",
|
||||
key: "cardType",
|
||||
align: "center",
|
||||
customRender: ({ text }) => ["", "成人卡", "儿童卡", "不限"][text]
|
||||
},
|
||||
{
|
||||
title: "会员卡类型",
|
||||
dataIndex: "type",
|
||||
key: "type",
|
||||
align: "center",
|
||||
customRender: ({ text }) =>
|
||||
["", "年卡", "次卡", "月卡", "会员IC卡", "充值卡"][text]
|
||||
},
|
||||
// {
|
||||
// title: '是否已开具发票',
|
||||
// dataIndex: 'isInvoice',
|
||||
// key: 'isInvoice',
|
||||
// align: 'center',
|
||||
// sorter: true,
|
||||
// customRender: ({ text }) => ['', '已开票', '未开票'][text]
|
||||
// },
|
||||
{
|
||||
title: "到期时间",
|
||||
dataIndex: "expireTime",
|
||||
key: "expireTime",
|
||||
align: "center",
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||
},
|
||||
{
|
||||
title: "购卡时间",
|
||||
dataIndex: "createTime",
|
||||
key: "createTime",
|
||||
align: "center",
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ThinkRechargeLogParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ThinkRechargeLog) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
const refund = (row: ThinkRechargeLog) => {
|
||||
const hide = message.loading("请求中..", 0);
|
||||
thinkRechargeLogRefund(row)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
key: 'phone',
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
title: '微信昵称',
|
||||
dataIndex: 'username',
|
||||
key: 'username',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '真实姓名',
|
||||
dataIndex: 'realName',
|
||||
key: 'realName',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: 'VIP卡名称',
|
||||
dataIndex: 'vipName',
|
||||
key: 'vipName',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '可用场馆',
|
||||
dataIndex: 'siteNames',
|
||||
key: 'siteNames',
|
||||
align: 'center',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '充值金额',
|
||||
dataIndex: 'money',
|
||||
key: 'money',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '支付状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '微信支付订单号',
|
||||
dataIndex: 'wechatOrder',
|
||||
key: 'wechatOrder',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '会员卡类型',
|
||||
dataIndex: 'vipType',
|
||||
key: 'vipType',
|
||||
align: 'center',
|
||||
customRender: ({ text }) => ['', '特殊VIP卡', '普通VIP卡'][text]
|
||||
},
|
||||
{
|
||||
title: '会员卡类型',
|
||||
dataIndex: 'cardType',
|
||||
key: 'cardType',
|
||||
align: 'center',
|
||||
customRender: ({ text }) => ['', '成人卡', '儿童卡', '不限'][text]
|
||||
},
|
||||
{
|
||||
title: '会员卡类型',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
align: 'center',
|
||||
customRender: ({ text }) =>
|
||||
['', '年卡', '次卡', '月卡', '会员IC卡', '充值卡'][text]
|
||||
},
|
||||
// {
|
||||
// title: '是否已开具发票',
|
||||
// dataIndex: 'isInvoice',
|
||||
// key: 'isInvoice',
|
||||
// align: 'center',
|
||||
// sorter: true,
|
||||
// customRender: ({ text }) => ['', '已开票', '未开票'][text]
|
||||
// },
|
||||
{
|
||||
title: '到期时间',
|
||||
dataIndex: 'expireTime',
|
||||
key: 'expireTime',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '购卡时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error("请至少选择一条数据");
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定要删除选中的记录吗?",
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading("请求中..", 0);
|
||||
removeBatchThinkRechargeLog(
|
||||
selection.value.map((d) => d.id)
|
||||
)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
// {
|
||||
// title: '操作',
|
||||
// key: 'action',
|
||||
// width: 180,
|
||||
// fixed: 'right',
|
||||
// align: 'center',
|
||||
// hideInSetting: true
|
||||
// }
|
||||
]);
|
||||
});
|
||||
};
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ThinkRechargeLogParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ThinkRechargeLog) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ThinkRechargeLog) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeThinkRechargeLog(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ThinkRechargeLog) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchThinkRechargeLog(
|
||||
selection.value.map((d) => d.id)
|
||||
)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ThinkRechargeLog) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ThinkRechargeLog'
|
||||
};
|
||||
export default {
|
||||
name: "ThinkRechargeLog"
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
|
||||
@@ -23,10 +23,12 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="封面图" name="thumb">
|
||||
<a-avatar
|
||||
:src="form.thumb"
|
||||
size="120"
|
||||
shape="square"
|
||||
<SelectFile
|
||||
:placeholder="`请选择图片`"
|
||||
:limit="1"
|
||||
:data="images"
|
||||
@done="chooseImage"
|
||||
@del="onDeleteItem"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="每小时价格" name="price">
|
||||
@@ -43,11 +45,11 @@
|
||||
v-model:value="form.businessTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="场馆所在区域" name="address">
|
||||
<a-cascader v-model:value="city" :options="areaList" placeholder="点击选择省市"
|
||||
:field-names="areaFieldNames"
|
||||
@change="changeArea" />
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="场馆所在区域">-->
|
||||
<!-- <a-cascader v-model:value="city" :options="areaList" placeholder="点击选择省市"-->
|
||||
<!-- :field-names="areaFieldNames"-->
|
||||
<!-- @change="changeArea" />-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="场馆地址" name="address">
|
||||
<a-input
|
||||
allow-clear
|
||||
@@ -161,8 +163,16 @@
|
||||
<!-- />-->
|
||||
</a-form-item>
|
||||
<a-form-item label="周末活动订场开关" name="weekendOpen">
|
||||
<a-switch :checked="form.weekendOpen == 1" />
|
||||
<a-switch v-model:checked="form.weekendOpen" :checked-value="1" :un-checked-value="0" />
|
||||
</a-form-item>
|
||||
<template v-if="data && data.id === 37">
|
||||
<a-form-item label="开启成人手动价格">
|
||||
<a-switch v-model:checked="form.adultFree" :checked-value="1" :un-checked-value="0"/>
|
||||
</a-form-item>
|
||||
<a-form-item label="开启儿童手动价格">
|
||||
<a-switch v-model:checked="form.childFree" :checked-value="1" :un-checked-value="0"/>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<a-form-item label="每天人数上限" extra="-1为不限制">
|
||||
<a-input-number v-model:value="form.dailyMaxNum" />
|
||||
</a-form-item>
|
||||
@@ -192,6 +202,7 @@ import { uploadOss } from "@/api/system/file";
|
||||
import { TdtMap } from "vue-tianditu";
|
||||
import { listArea } from "@/api/system/area";
|
||||
import { Area } from "@/api/system/area/model";
|
||||
import { FileRecord } from "@/api/system/file/model";
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
@@ -218,7 +229,6 @@ const loading = ref(false);
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
const files = ref<ItemType[]>([]);
|
||||
// 编辑器内容,双向绑定
|
||||
const content = ref<any>("");
|
||||
@@ -230,9 +240,9 @@ const form = reactive<ThinkSite>({
|
||||
thumb: undefined,
|
||||
price: undefined,
|
||||
businessTime: undefined,
|
||||
province: undefined,
|
||||
city: undefined,
|
||||
region: undefined,
|
||||
province: '广西壮族自治区',
|
||||
city: '南宁市',
|
||||
region: '良庆区',
|
||||
address: undefined,
|
||||
rentStartDate: undefined,
|
||||
rentEndDate: undefined,
|
||||
@@ -250,7 +260,8 @@ const form = reactive<ThinkSite>({
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
weekendOpen: undefined,
|
||||
dailyMaxNum: undefined,
|
||||
dailyMaxNum: -1,
|
||||
album: '',
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
@@ -260,18 +271,59 @@ const updateVisible = (value: boolean) => {
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
thinkSiteName: [
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
type: "string",
|
||||
message: "请填写名称",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
thumb: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传图片",
|
||||
trigger: "change"
|
||||
}
|
||||
],
|
||||
price: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写价格",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
businessTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写营业时间",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
address: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写地址",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
tel: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写联系电话",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
sortNumber: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写排序",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
|
||||
realPropertyCertificate: [
|
||||
{
|
||||
required: true,
|
||||
type: "string",
|
||||
message: "请填写产权证书/不动产权证号",
|
||||
trigger: "blur"
|
||||
}
|
||||
@@ -279,7 +331,6 @@ const rules = reactive({
|
||||
rentStartDate: [
|
||||
{
|
||||
required: true,
|
||||
type: "string",
|
||||
message: "请填写租赁开始日期",
|
||||
trigger: "blur"
|
||||
}
|
||||
@@ -287,11 +338,17 @@ const rules = reactive({
|
||||
rentEndDate: [
|
||||
{
|
||||
required: true,
|
||||
type: "string",
|
||||
message: "请填写租赁结束日期",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
],
|
||||
size: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写面积",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
|
||||
});
|
||||
|
||||
@@ -416,6 +473,7 @@ const save = () => {
|
||||
info: content.value,
|
||||
files: JSON.stringify(files.value)
|
||||
};
|
||||
if (!form.lat) return message.error("请选择经纬度");
|
||||
const saveOrUpdate = isUpdate.value ? updateThinkSite : addThinkSite;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
@@ -447,6 +505,21 @@ const removeRefund = (index) => {
|
||||
moneyJson.value.splice(index, 1);
|
||||
};
|
||||
|
||||
const images = ref<ItemType[]>([]);
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: "done"
|
||||
});
|
||||
form.thumb = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.thumb = "";
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
async (visible) => {
|
||||
|
||||
@@ -161,9 +161,8 @@ const columns = ref<ColumnItem[]>([
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "微信昵称",
|
||||
dataIndex: "username",
|
||||
key: "username",
|
||||
title: "订单号",
|
||||
dataIndex: "wechatOrder",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -62,6 +62,13 @@
|
||||
<a-form-item label="可选场馆" name="sid">
|
||||
<ThinkSelectSiteMultiple v-model:value="sites" />
|
||||
</a-form-item>
|
||||
<a-form-item label="报表归属场馆" name="reportSid">
|
||||
<a-select v-model:value="form.reportSid" filter-option="label" show-search>
|
||||
<a-select-option v-for="item in siteList" :key="item.id" :value="item.id" :label="item.name">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="会员卡价格" name="price">
|
||||
<a-input
|
||||
allow-clear
|
||||
@@ -69,6 +76,13 @@
|
||||
v-model:value="form.price"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="续卡价格" name="renewPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入会员卡价格"
|
||||
v-model:value="form.renewPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="会员卡介绍" name="desc">
|
||||
<a-input
|
||||
allow-clear
|
||||
@@ -143,9 +157,9 @@
|
||||
<a-form-item label="特殊卡开发凭证图" name="pic">
|
||||
<a-avatar :src="`${IMG_URL}${form.pic}`" :size="120" />
|
||||
</a-form-item>
|
||||
<a-form-item label="VIP充值卡价格组" name="prices">
|
||||
{{ form.prices }}
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="VIP充值卡价格组" name="prices">-->
|
||||
<!-- {{ form.prices }}-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="是否有效" name="isUse">
|
||||
<a-radio-group v-model:value="form.isUse">
|
||||
<a-radio :value="1">是</a-radio>
|
||||
@@ -155,7 +169,7 @@
|
||||
<a-form-item label="是否在售" name="isSale">
|
||||
<a-radio-group v-model:value="form.isSale">
|
||||
<a-radio :value="1">是</a-radio>
|
||||
<a-radio :value="2">否</a-radio>
|
||||
<a-radio :value="0">否</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
@@ -175,6 +189,7 @@ import { FormInstance } from "ant-design-vue/es/form";
|
||||
import { FileRecord } from "@/api/system/file/model";
|
||||
import { ThinkSite } from "@/api/think/thinkSite/model";
|
||||
import { IMG_URL } from "@/config/setting";
|
||||
import { listThinkSite } from "@/api/think/thinkSite";
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
@@ -210,9 +225,11 @@ const form = reactive<ThinkVip>({
|
||||
sid: undefined,
|
||||
name: undefined,
|
||||
price: undefined,
|
||||
renewPrice: undefined,
|
||||
desc: undefined,
|
||||
info: undefined,
|
||||
discount: undefined,
|
||||
reportSid: undefined,
|
||||
count: undefined,
|
||||
eachMoney: undefined,
|
||||
term: 1,
|
||||
@@ -245,23 +262,31 @@ const rules = reactive({
|
||||
message: "请填写名称",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
],
|
||||
price: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写价格",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
renewPrice: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写续卡价格",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
reportSid: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择报表归属场馆",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: "done"
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = "";
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
@@ -300,6 +325,12 @@ const save = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const siteList = ref<ThinkSite[]>([])
|
||||
const getSiteList = async () => {
|
||||
siteList.value = await listThinkSite()
|
||||
};
|
||||
getSiteList()
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
<template v-if="column.key === 'price'">
|
||||
<span class="text-orange-500">¥{{ record.price }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'renewPrice'">
|
||||
<span class="text-orange-700">¥{{ record.renewPrice }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'siteNames'">
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>{{ record.siteNames }}</template>
|
||||
@@ -50,13 +53,13 @@
|
||||
</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
<!-- <a-divider type="vertical" />-->
|
||||
<!-- <a-popconfirm-->
|
||||
<!-- title="确定要删除此记录吗?"-->
|
||||
<!-- @confirm="remove(record)"-->
|
||||
<!-- >-->
|
||||
<!-- <a class="ele-text-danger">删除</a>-->
|
||||
<!-- </a-popconfirm>-->
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
@@ -158,6 +161,13 @@
|
||||
sorter: true,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '续卡价格',
|
||||
dataIndex: 'renewPrice',
|
||||
key: 'renewPrice',
|
||||
sorter: true,
|
||||
align: 'center'
|
||||
},
|
||||
// {
|
||||
// title: '会员卡说明',
|
||||
// dataIndex: 'info',
|
||||
|
||||
@@ -9,14 +9,17 @@
|
||||
value-format="YYYY-MM-DD"
|
||||
class="ele-fluid"
|
||||
/>
|
||||
<a-button type="primary" @click="exportExcel">导出</a-button>
|
||||
</a-space>
|
||||
<p class="ele-text-danger font-bold mt-2">总金额:{{totalAmount }}元</p>
|
||||
<p class="ele-text-danger font-bold mt-2">总金额:{{ totalAmount }}元</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from "vue";
|
||||
import { ThinkVipCardsBillsParam } from "@/api/think/thinkVipCardsBills/model";
|
||||
import { thinkVipCardsBillsExport } from "@/api/think/thinkVipCardsBills";
|
||||
import { messageLoading } from "ele-admin-pro/es";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -48,6 +51,21 @@ const search = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const exportExcel = async () => {
|
||||
let dateStart = "", dateEnd = "";
|
||||
if (dateRange.value && dateRange.value?.length > 0) {
|
||||
[dateStart, dateEnd] = dateRange.value;
|
||||
}
|
||||
const hide = messageLoading("导出中...", 0);
|
||||
const { data } = await thinkVipCardsBillsExport({
|
||||
dateStart,
|
||||
dateEnd,
|
||||
isVip: true
|
||||
});
|
||||
hide();
|
||||
window.open(data.url);
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {
|
||||
|
||||
@@ -87,6 +87,7 @@ const datasource: DatasourceFunction = ({
|
||||
where.status = filters.status;
|
||||
}
|
||||
getTotalAmount(where);
|
||||
where.isVip = true
|
||||
return pageThinkVipCardsBills({
|
||||
...where,
|
||||
...orders,
|
||||
@@ -120,8 +121,7 @@ const columns = ref<ColumnItem[]>([
|
||||
},
|
||||
{
|
||||
title: "金额",
|
||||
dataIndex: "amount",
|
||||
key: "amount",
|
||||
dataIndex: ["thinkOrder", 'payPrice'],
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user