|
@@ -1,7 +1,8 @@
|
|
|
import { BasicColumn } from '/@/components/Table';
|
|
|
import { FormSchema } from '/@/components/Table';
|
|
|
-import { h } from 'vue';
|
|
|
-import { TableColumnType } from 'ant-design-vue';
|
|
|
+import { h, VNode } from 'vue';
|
|
|
+import { TableColumnType, Image, Tag } from 'ant-design-vue';
|
|
|
+import dayjs from 'dayjs';
|
|
|
//列表数据
|
|
|
export const columns: BasicColumn[] = [
|
|
|
{
|
|
@@ -144,30 +145,35 @@ 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,
|
|
|
},
|
|
|
|
|
|
{
|
|
|
dataIndex: 'orderStatus',
|
|
|
title: '订单状态',
|
|
|
align: 'center',
|
|
|
- customRender: ({ text }) => {
|
|
|
- return orderStatus[text];
|
|
|
+ customRender: ({ text, record }) => {
|
|
|
+ return record.type != 6 ? orderStatus[text] : '无';
|
|
|
},
|
|
|
+ width: 180,
|
|
|
},
|
|
|
{
|
|
|
dataIndex: 'quantity',
|
|
|
title: '数量',
|
|
|
align: 'center',
|
|
|
+ width: 180,
|
|
|
},
|
|
|
{
|
|
|
dataIndex: 'price',
|
|
@@ -176,28 +182,178 @@ export const orderColum: TableColumnType[] = [
|
|
|
customRender: ({ record }) => {
|
|
|
return (record.originalPrice || 0) * record.quantity;
|
|
|
},
|
|
|
+ width: 180,
|
|
|
},
|
|
|
];
|
|
|
|
|
|
-export const useRecord: TableColumnType[] = [
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @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,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 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);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ console.log(colum, '数据');
|
|
|
+
|
|
|
+ return colum;
|
|
|
+}
|
|
|
+
|
|
|
+export const verificationRecordColumns: TableColumnType[] = [
|
|
|
{
|
|
|
- dataIndex: 'isinCode',
|
|
|
- title: '卷号',
|
|
|
+ dataIndex: 'familyUserName',
|
|
|
+ title: '上课时间',
|
|
|
align: 'center',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return `${dayjs(record.coursesStartTime).format('YYYY-MM-DD HH:mm')} ${dayjs(record.coursesEndTime).format('HH:mm')}`;
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
- dataIndex: 'useUserName',
|
|
|
- title: '使用地点',
|
|
|
+ dataIndex: 'coursesName',
|
|
|
+ title: '课时名称',
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
dataIndex: 'useUserName',
|
|
|
- title: '核验人员 ',
|
|
|
+ title: '使用人',
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
- dataIndex: 'useUserName',
|
|
|
- title: '使用时间',
|
|
|
+ dataIndex: 'verifyStatus',
|
|
|
+ title: '核销状态',
|
|
|
+ align: 'left',
|
|
|
+ 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',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'isinCode',
|
|
|
+ title: '核验照片',
|
|
|
+ align: 'center',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return record.verifyImage ? h(Image, { src: record.verifyImage, width: 100, height: 100 }) : '';
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'verifyTime',
|
|
|
+ title: '核验时间',
|
|
|
align: 'center',
|
|
|
},
|
|
|
];
|