|
@@ -0,0 +1,392 @@
|
|
|
+import { BasicColumn } from '/@/components/Table';
|
|
|
+import { FormSchema } from '/@/components/Table';
|
|
|
+import { h, VNode } from 'vue';
|
|
|
+import { TableColumnType, Image, Tag } from 'ant-design-vue';
|
|
|
+import dayjs from 'dayjs';
|
|
|
+//列表数据
|
|
|
+export const columns: BasicColumn[] = [
|
|
|
+ {
|
|
|
+ title: '商品',
|
|
|
+ align: 'left',
|
|
|
+ dataIndex: 'userName',
|
|
|
+ width: 820,
|
|
|
+ slots: { customRender: 'goods' },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '价格/数量',
|
|
|
+ align: 'left',
|
|
|
+ dataIndex: 'phone',
|
|
|
+ width: 120,
|
|
|
+ slots: { customRender: 'price' },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '使用人',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'feedbackType',
|
|
|
+ width: 120,
|
|
|
+ slots: { customRender: 'user' },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '订单状态',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'status',
|
|
|
+ width: 120,
|
|
|
+ slots: { customRender: 'status' },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '售后状态',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'feedbackImgList',
|
|
|
+ width: 120,
|
|
|
+ slots: { customRender: 'After' },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '分账状态',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'profitSharingStatus',
|
|
|
+ width: 120,
|
|
|
+ slots: { customRender: 'sharing' },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '实付金额',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'createTime',
|
|
|
+ width: 120,
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return h('div', {}, [h('div', {}, `¥${record.price || 0}`), h('div', { class: 'text-gray' }, `共${record.orderProInfoList.length}件`)]);
|
|
|
+ },
|
|
|
+ },
|
|
|
+];
|
|
|
+//查询数据
|
|
|
+export const searchFormSchema: FormSchema[] = [
|
|
|
+ {
|
|
|
+ label: '手机号码',
|
|
|
+ field: 'userPhone',
|
|
|
+ component: 'Input',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '退款编号',
|
|
|
+ field: 'orderCode',
|
|
|
+ component: 'Input',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '订单编号',
|
|
|
+ field: 'orderCode',
|
|
|
+ component: 'Input',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '下单时间',
|
|
|
+ field: 'time',
|
|
|
+ component: 'RangePicker',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: ['开始时间', '结束时间'],
|
|
|
+ },
|
|
|
+ },
|
|
|
+];
|
|
|
+//表单数据
|
|
|
+export const formSchema: FormSchema[] = [
|
|
|
+ // TODO 主键隐藏字段,目前写死为ID
|
|
|
+ {
|
|
|
+ label: '',
|
|
|
+ field: 'id',
|
|
|
+ component: 'Input',
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+];
|
|
|
+
|
|
|
+/**
|
|
|
+ * 商品类型(1-场地 2-赛事 3-课程 4-保险)
|
|
|
+ */
|
|
|
+
|
|
|
+export const goodsType = [
|
|
|
+ { label: '学校', value: 1 },
|
|
|
+ { label: '包场', value: 2 },
|
|
|
+ { label: '无固定场', value: 3 },
|
|
|
+ { label: '个人赛', value: 4 },
|
|
|
+ { label: '团队赛', value: 5 },
|
|
|
+ { label: '课程', value: 6 },
|
|
|
+ { label: '保险', value: 7 },
|
|
|
+];
|
|
|
+
|
|
|
+/**
|
|
|
+ * 售后状态 0-暂无售后 1-待退款 1-已退款
|
|
|
+ */
|
|
|
+export const afterSaleStatus = ['暂无售后', '待退款', '已退款'];
|
|
|
+
|
|
|
+/**
|
|
|
+ * 0-待付款 1-待使用 2-已使用 3-已到期 4-已取消 5-退款中 6已退款
|
|
|
+ */
|
|
|
+export const orderStatus = ['待付款', '待使用', '已使用', '已到期', '已取消', '退款中', '已退款'];
|
|
|
+
|
|
|
+export const orderColum: TableColumnType[] = [
|
|
|
+ {
|
|
|
+ dataIndex: 'productName',
|
|
|
+ title: '商品名称',
|
|
|
+ align: 'center',
|
|
|
+ width: 280,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'ticketNo',
|
|
|
+ title: '券号',
|
|
|
+ align: 'center',
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'originalPrice',
|
|
|
+ title: '原价/元',
|
|
|
+ align: 'center',
|
|
|
+ width: 180,
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return record.originalPrice || 0;
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ dataIndex: 'orderStatus',
|
|
|
+ title: '订单状态',
|
|
|
+ align: 'center',
|
|
|
+ customRender: ({ text, record }) => {
|
|
|
+ return record.type != 6 ? orderStatus[text] : '无';
|
|
|
+ },
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'quantity',
|
|
|
+ title: '数量',
|
|
|
+ align: 'center',
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'price',
|
|
|
+ title: '小计/元',
|
|
|
+ align: 'center',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return (record.originalPrice ? record.originalPrice : 0) * record.quantity;
|
|
|
+ },
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+];
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @param type 订单类型:0-学校 1-包场 2-无固定场 3-个人赛 4-团队赛 5-课程
|
|
|
+ */
|
|
|
+export function getColumText(type: number) {
|
|
|
+ let colum: TableColumnType[] = [];
|
|
|
+ const commonColum: TableColumnType[] = [
|
|
|
+ {
|
|
|
+ dataIndex: 'familyUserName',
|
|
|
+ title: '使用人',
|
|
|
+ align: 'center',
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'userPhone',
|
|
|
+ title: '手机号',
|
|
|
+ align: 'center',
|
|
|
+ width: 180,
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return record.isinList[0].userPhone;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'isinCode',
|
|
|
+ title: '劵号',
|
|
|
+ align: 'center',
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'isinCode',
|
|
|
+ title: '使用地点',
|
|
|
+ align: 'center',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ const viewList: VNode[] = [];
|
|
|
+ record.isinList.forEach((it) => {
|
|
|
+ viewList.push(h('div', it.useAddress));
|
|
|
+ });
|
|
|
+ return h('div', viewList);
|
|
|
+ },
|
|
|
+ width: 280,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'isinCode',
|
|
|
+ title: '使用时间',
|
|
|
+ align: 'center',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ const viewList: VNode[] = [];
|
|
|
+ record.isinList.forEach((it) => {
|
|
|
+ viewList.push(h('div', it.useTime));
|
|
|
+ });
|
|
|
+ return h('div', viewList);
|
|
|
+ },
|
|
|
+ width: 280,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ if (type == 0) {
|
|
|
+ colum = [...commonColum];
|
|
|
+ }
|
|
|
+ if (type == 1 || type == 2) {
|
|
|
+ //包场和无固定场显示一样的,
|
|
|
+ colum = [
|
|
|
+ {
|
|
|
+ dataIndex: 'isinCode',
|
|
|
+ title: '劵号',
|
|
|
+ align: 'center',
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'isinCode',
|
|
|
+ title: '使用地点',
|
|
|
+ align: 'center',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ const viewList: VNode[] = [];
|
|
|
+ record.isinList.forEach((it) => {
|
|
|
+ viewList.push(h('div', it.useAddress));
|
|
|
+ });
|
|
|
+ return h('div', viewList);
|
|
|
+ },
|
|
|
+ width: 280,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'isinCode',
|
|
|
+ title: '核验人员',
|
|
|
+ align: 'center',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ const viewList: VNode[] = [];
|
|
|
+ record.isinList.forEach((it) => {
|
|
|
+ viewList.push(h('div', it.verifyUserName));
|
|
|
+ });
|
|
|
+ return h('div', viewList);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'isinCode',
|
|
|
+ title: '使用时间',
|
|
|
+ align: 'center',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ const viewList: VNode[] = [];
|
|
|
+ record.isinList.forEach((it) => {
|
|
|
+ viewList.push(h('div', it.useTime));
|
|
|
+ });
|
|
|
+ return h('div', viewList);
|
|
|
+ },
|
|
|
+ width: 280,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ if (type == 5) {
|
|
|
+ colum = [...commonColum];
|
|
|
+ colum.splice(3, 0, {
|
|
|
+ dataIndex: 'isinCode',
|
|
|
+ title: '核验人员',
|
|
|
+ align: 'center',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ const viewList: VNode[] = [];
|
|
|
+ record.isinList.forEach((it) => {
|
|
|
+ viewList.push(h('div', it.verifyUserName));
|
|
|
+ });
|
|
|
+ return h('div', viewList);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (type == 3 || type == 4) {
|
|
|
+ colum = [...commonColum];
|
|
|
+ colum.splice(3, 0, {
|
|
|
+ dataIndex: 'isinCode',
|
|
|
+ title: '核验人员/使用照片',
|
|
|
+ align: 'center',
|
|
|
+ width: 280,
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ const viewList: VNode[] = [];
|
|
|
+ record.isinList.forEach((it) => {
|
|
|
+ viewList.push(h('div', it.verifyUserName));
|
|
|
+ });
|
|
|
+ return h('div', viewList);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return colum;
|
|
|
+}
|
|
|
+
|
|
|
+export const verificationRecordColumns: TableColumnType[] = [
|
|
|
+ {
|
|
|
+ dataIndex: 'familyUserName',
|
|
|
+ title: '上课时间',
|
|
|
+ align: 'center',
|
|
|
+ width: 220,
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return `${dayjs(record.coursesStartTime).format('YYYY-MM-DD HH:mm')} ${dayjs(record.coursesEndTime).format('HH:mm')}`;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'coursesName',
|
|
|
+ title: '课时名称',
|
|
|
+ align: 'center',
|
|
|
+ width: 420,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'useUserName',
|
|
|
+ title: '使用人',
|
|
|
+ align: 'center',
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'verifyStatus',
|
|
|
+ title: '核销状态',
|
|
|
+ align: 'left',
|
|
|
+ width: 180,
|
|
|
+
|
|
|
+ customRender: ({ text, record }) => {
|
|
|
+ const Viewtext = h('div', { class: 'mr2' }, text == 1 ? '已核销' : '未核销');
|
|
|
+ return record.orPostpone == 0 ? Viewtext : h('div', { class: 'flex items-center' }, [Viewtext, h(Tag, { color: 'green' }, () => '已延课')]);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'verifyUserName',
|
|
|
+ title: '核验人',
|
|
|
+ align: 'center',
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'isinCode',
|
|
|
+ title: '核验照片',
|
|
|
+ align: 'center',
|
|
|
+ width: 180,
|
|
|
+
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return record.verifyImage ? h(Image, { src: record.verifyImage, width: 100, height: 100 }) : '';
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'verifyTime',
|
|
|
+ title: '核验时间',
|
|
|
+ align: 'center',
|
|
|
+ width: 280,
|
|
|
+ },
|
|
|
+];
|
|
|
+
|
|
|
+export const gameScheduleVOListColumns: TableColumnType[] = [
|
|
|
+ {
|
|
|
+ title: '比赛项目',
|
|
|
+ dataIndex: 'name',
|
|
|
+ align: 'center',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '时间段',
|
|
|
+ dataIndex: 'startTime',
|
|
|
+ align: 'center',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return `${record.startTime} - ${record.endTime}`;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '安排',
|
|
|
+ dataIndex: 'arrange',
|
|
|
+ align: 'center',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '比赛状态',
|
|
|
+ dataIndex: 'startStatus',
|
|
|
+ align: 'center',
|
|
|
+ },
|
|
|
+];
|