接单员与财务管理
This commit is contained in:
@@ -0,0 +1,155 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type IDepositPayment from '@/domain/iDepositPayment';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<IDepositPayment>[] = [
|
||||
{
|
||||
title: t('finance.deposit_payment.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit_payment.payment_no'),
|
||||
dataIndex: 'payment_no',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit_payment.deposit_id'),
|
||||
dataIndex: 'deposit_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit_payment.user_id'),
|
||||
dataIndex: 'user_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit_payment.payment_transaction_id'),
|
||||
dataIndex: 'payment_transaction_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit_payment.amount'),
|
||||
dataIndex: 'amount',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit_payment.pay_type'),
|
||||
dataIndex: 'pay_type',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit_payment.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 0, label: t('finance.deposit_payment.status.0') },
|
||||
{ value: 1, label: t('finance.deposit_payment.status.1') },
|
||||
{ value: 2, label: t('finance.deposit_payment.status.2') },
|
||||
],
|
||||
},
|
||||
render: (value: number) => {
|
||||
if (value === 1) return <Tag color="success">{t('finance.deposit_payment.status.1')}</Tag>;
|
||||
if (value === 2) return <Tag color="warning">{t('finance.deposit_payment.status.2')}</Tag>;
|
||||
return <Tag color="default">{t('finance.deposit_payment.status.0')}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: t('finance.deposit_payment.status.0'), value: 0 },
|
||||
{ text: t('finance.deposit_payment.status.1'), value: 1 },
|
||||
{ text: t('finance.deposit_payment.status.2'), value: 2 },
|
||||
],
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit_payment.paid_at'),
|
||||
dataIndex: 'paid_at',
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit_payment.refund_at'),
|
||||
dataIndex: 'refund_at',
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit_payment.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit_payment.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<IDepositPayment> = {
|
||||
api: '/runner/deposit-payment',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'runner.deposit_payment',
|
||||
addShow: false,
|
||||
editShow: false,
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('finance.deposit_payment.page.title')}</Title>
|
||||
<Text type="secondary">{t('finance.deposit_payment.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<IDepositPayment> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,158 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type IRunnerDeposit from '@/domain/iRunnerDeposit';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<IRunnerDeposit>[] = [
|
||||
{
|
||||
title: t('finance.deposit.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit.deposit_no'),
|
||||
dataIndex: 'deposit_no',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit.worker_id'),
|
||||
dataIndex: 'worker_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit.user_id'),
|
||||
dataIndex: 'user_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit.amount'),
|
||||
dataIndex: 'amount',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 0, label: t('finance.deposit.status.0') },
|
||||
{ value: 1, label: t('finance.deposit.status.1') },
|
||||
{ value: 2, label: t('finance.deposit.status.2') },
|
||||
{ value: 3, label: t('finance.deposit.status.3') },
|
||||
],
|
||||
},
|
||||
render: (value: number) => {
|
||||
if (value === 1) return <Tag color="success">{t('finance.deposit.status.1')}</Tag>;
|
||||
if (value === 2) return <Tag color="warning">{t('finance.deposit.status.2')}</Tag>;
|
||||
if (value === 3) return <Tag color="error">{t('finance.deposit.status.3')}</Tag>;
|
||||
return <Tag color="default">{t('finance.deposit.status.0')}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: t('finance.deposit.status.0'), value: 0 },
|
||||
{ text: t('finance.deposit.status.1'), value: 1 },
|
||||
{ text: t('finance.deposit.status.2'), value: 2 },
|
||||
{ text: t('finance.deposit.status.3'), value: 3 },
|
||||
],
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit.deduct_reason'),
|
||||
dataIndex: 'deduct_reason',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit.paid_at'),
|
||||
dataIndex: 'paid_at',
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit.refund_at'),
|
||||
dataIndex: 'refund_at',
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit.deducted_at'),
|
||||
dataIndex: 'deducted_at',
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('finance.deposit.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<IRunnerDeposit> = {
|
||||
api: '/runner/deposit',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'runner.deposit',
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('finance.deposit.page.title')}</Title>
|
||||
<Text type="secondary">{t('finance.deposit.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<IRunnerDeposit> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,155 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type ITaskPayment from '@/domain/iTaskPayment';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<ITaskPayment>[] = [
|
||||
{
|
||||
title: t('finance.task_payment.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('finance.task_payment.payment_no'),
|
||||
dataIndex: 'payment_no',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.task_payment.order_id'),
|
||||
dataIndex: 'order_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.task_payment.user_id'),
|
||||
dataIndex: 'user_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.task_payment.payment_transaction_id'),
|
||||
dataIndex: 'payment_transaction_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('finance.task_payment.amount'),
|
||||
dataIndex: 'amount',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.task_payment.pay_type'),
|
||||
dataIndex: 'pay_type',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.task_payment.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 0, label: t('finance.task_payment.status.0') },
|
||||
{ value: 1, label: t('finance.task_payment.status.1') },
|
||||
{ value: 2, label: t('finance.task_payment.status.2') },
|
||||
],
|
||||
},
|
||||
render: (value: number) => {
|
||||
if (value === 1) return <Tag color="success">{t('finance.task_payment.status.1')}</Tag>;
|
||||
if (value === 2) return <Tag color="warning">{t('finance.task_payment.status.2')}</Tag>;
|
||||
return <Tag color="default">{t('finance.task_payment.status.0')}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: t('finance.task_payment.status.0'), value: 0 },
|
||||
{ text: t('finance.task_payment.status.1'), value: 1 },
|
||||
{ text: t('finance.task_payment.status.2'), value: 2 },
|
||||
],
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.task_payment.paid_at'),
|
||||
dataIndex: 'paid_at',
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('finance.task_payment.refund_at'),
|
||||
dataIndex: 'refund_at',
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('finance.task_payment.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('finance.task_payment.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<ITaskPayment> = {
|
||||
api: '/task/payment',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'task.payment',
|
||||
addShow: false,
|
||||
editShow: false,
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('finance.task_payment.page.title')}</Title>
|
||||
<Text type="secondary">{t('finance.task_payment.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<ITaskPayment> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,197 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type IPaymentTransaction from '@/domain/iPaymentTransaction';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const statusMap: Record<number, { color: string; text: string }> = {
|
||||
0: { color: 'processing', text: '待支付' },
|
||||
1: { color: 'success', text: '支付成功' },
|
||||
2: { color: 'error', text: '支付失败' },
|
||||
3: { color: 'warning', text: '已退款' },
|
||||
};
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<IPaymentTransaction>[] = [
|
||||
{
|
||||
title: t('finance.transaction.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('finance.transaction.transaction_no'),
|
||||
dataIndex: 'transaction_no',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
width: 220,
|
||||
},
|
||||
{
|
||||
title: t('finance.transaction.out_trade_no'),
|
||||
dataIndex: 'out_trade_no',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: t('finance.transaction.pay_type'),
|
||||
dataIndex: 'pay_type',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 'wechat', label: t('finance.transaction.pay_type.wechat') },
|
||||
{ value: 'alipay', label: t('finance.transaction.pay_type.alipay') },
|
||||
],
|
||||
},
|
||||
render: (value: string) => (
|
||||
<Tag>{value === 'wechat' ? t('finance.transaction.pay_type.wechat') : t('finance.transaction.pay_type.alipay')}</Tag>
|
||||
),
|
||||
filters: [
|
||||
{ text: t('finance.transaction.pay_type.wechat'), value: 'wechat' },
|
||||
{ text: t('finance.transaction.pay_type.alipay'), value: 'alipay' },
|
||||
],
|
||||
align: 'center',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('finance.transaction.amount'),
|
||||
dataIndex: 'amount',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
render: (value: string) => `¥${value || '0.00'}`,
|
||||
},
|
||||
{
|
||||
title: t('finance.transaction.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 0, label: '待支付' },
|
||||
{ value: 1, label: '支付成功' },
|
||||
{ value: 2, label: '支付失败' },
|
||||
{ value: 3, label: '已退款' },
|
||||
],
|
||||
},
|
||||
render: (value: number) => {
|
||||
const item = statusMap[value] || { color: 'default', text: '未知' };
|
||||
return <Tag color={item.color}>{item.text}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: '待支付', value: 0 },
|
||||
{ text: '支付成功', value: 1 },
|
||||
{ text: '支付失败', value: 2 },
|
||||
{ text: '已退款', value: 3 },
|
||||
],
|
||||
align: 'center',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('finance.transaction.business_type'),
|
||||
dataIndex: 'business_type',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 'task', label: t('finance.transaction.business_type.task') },
|
||||
{ value: 'deposit', label: t('finance.transaction.business_type.deposit') },
|
||||
{ value: 'order', label: t('finance.transaction.business_type.order') },
|
||||
],
|
||||
},
|
||||
render: (value: string) => {
|
||||
const labels: Record<string, string> = {
|
||||
task: t('finance.transaction.business_type.task'),
|
||||
deposit: t('finance.transaction.business_type.deposit'),
|
||||
order: t('finance.transaction.business_type.order'),
|
||||
};
|
||||
return <Tag>{labels[value] || value}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: t('finance.transaction.business_type.task'), value: 'task' },
|
||||
{ text: t('finance.transaction.business_type.deposit'), value: 'deposit' },
|
||||
{ text: t('finance.transaction.business_type.order'), value: 'order' },
|
||||
],
|
||||
align: 'center',
|
||||
width: 110,
|
||||
},
|
||||
{
|
||||
title: t('finance.transaction.business_id'),
|
||||
dataIndex: 'business_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: t('finance.transaction.user_id'),
|
||||
dataIndex: 'user_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: t('finance.transaction.paid_at'),
|
||||
dataIndex: 'paid_at',
|
||||
valueType: 'date',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
width: 180,
|
||||
render: (value: string) => (value ? dayjs(value).format('YYYY-MM-DD HH:mm:ss') : '-'),
|
||||
},
|
||||
{
|
||||
title: t('finance.transaction.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
width: 160,
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<IPaymentTransaction> = {
|
||||
api: '/finance/payment-transaction',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'finance.transaction',
|
||||
addShow: false,
|
||||
editShow: false,
|
||||
scroll: { x: 1500 },
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('finance.transaction.page.title')}</Title>
|
||||
<Text type="secondary">{t('finance.transaction.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<IPaymentTransaction> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,158 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type IRunnerWithdrawal from '@/domain/iRunnerWithdrawal';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<IRunnerWithdrawal>[] = [
|
||||
{
|
||||
title: t('finance.withdrawal.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('finance.withdrawal.withdraw_no'),
|
||||
dataIndex: 'withdraw_no',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.withdrawal.user_id'),
|
||||
dataIndex: 'user_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.withdrawal.worker_id'),
|
||||
dataIndex: 'worker_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.withdrawal.amount'),
|
||||
dataIndex: 'amount',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.withdrawal.fee'),
|
||||
dataIndex: 'fee',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.withdrawal.channel'),
|
||||
dataIndex: 'channel',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.withdrawal.account_info'),
|
||||
dataIndex: 'account_info',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('finance.withdrawal.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 0, label: t('finance.withdrawal.status.0') },
|
||||
{ value: 1, label: t('finance.withdrawal.status.1') },
|
||||
{ value: 2, label: t('finance.withdrawal.status.2') },
|
||||
],
|
||||
},
|
||||
render: (value: number) => {
|
||||
if (value === 1) return <Tag color="success">{t('finance.withdrawal.status.1')}</Tag>;
|
||||
if (value === 2) return <Tag color="error">{t('finance.withdrawal.status.2')}</Tag>;
|
||||
return <Tag color="processing">{t('finance.withdrawal.status.0')}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: t('finance.withdrawal.status.0'), value: 0 },
|
||||
{ text: t('finance.withdrawal.status.1'), value: 1 },
|
||||
{ text: t('finance.withdrawal.status.2'), value: 2 },
|
||||
],
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('finance.withdrawal.remark'),
|
||||
dataIndex: 'remark',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('finance.withdrawal.processed_at'),
|
||||
dataIndex: 'processed_at',
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('finance.withdrawal.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('finance.withdrawal.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<IRunnerWithdrawal> = {
|
||||
api: '/runner/withdrawal',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'runner.withdrawal',
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('finance.withdrawal.page.title')}</Title>
|
||||
<Text type="secondary">{t('finance.withdrawal.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<IRunnerWithdrawal> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,161 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type IRunnerApplication from '@/domain/iRunnerApplication';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<IRunnerApplication>[] = [
|
||||
{
|
||||
title: t('runner.application.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('runner.application.user_id'),
|
||||
dataIndex: 'user_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.application.real_name'),
|
||||
dataIndex: 'real_name',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.application.mobile'),
|
||||
dataIndex: 'mobile',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.application.resume'),
|
||||
dataIndex: 'resume',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.application.id_card'),
|
||||
dataIndex: 'id_card',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.application.id_card_front'),
|
||||
dataIndex: 'id_card_front',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.application.id_card_back'),
|
||||
dataIndex: 'id_card_back',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.application.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 0, label: t('runner.application.status.0') },
|
||||
{ value: 1, label: t('runner.application.status.1') },
|
||||
{ value: 2, label: t('runner.application.status.2') },
|
||||
],
|
||||
},
|
||||
render: (value: number) => {
|
||||
if (value === 1) return <Tag color="success">{t('runner.application.status.1')}</Tag>;
|
||||
if (value === 2) return <Tag color="error">{t('runner.application.status.2')}</Tag>;
|
||||
return <Tag color="warning">{t('runner.application.status.0')}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: t('runner.application.status.0'), value: 0 },
|
||||
{ text: t('runner.application.status.1'), value: 1 },
|
||||
{ text: t('runner.application.status.2'), value: 2 },
|
||||
],
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.application.review_remark'),
|
||||
dataIndex: 'review_remark',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.application.reviewed_at'),
|
||||
dataIndex: 'reviewed_at',
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('runner.application.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('runner.application.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<IRunnerApplication> = {
|
||||
api: '/runner/application',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'runner.application',
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('runner.application.page.title')}</Title>
|
||||
<Text type="secondary">{t('runner.application.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<IRunnerApplication> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,141 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type IRunnerComplaintAppeal from '@/domain/iRunnerComplaintAppeal';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<IRunnerComplaintAppeal>[] = [
|
||||
{
|
||||
title: t('runner.complaint_appeal.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint_appeal.complaint_id'),
|
||||
dataIndex: 'complaint_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint_appeal.worker_id'),
|
||||
dataIndex: 'worker_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint_appeal.content'),
|
||||
dataIndex: 'content',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint_appeal.images'),
|
||||
dataIndex: 'images',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint_appeal.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 0, label: t('runner.complaint_appeal.status.0') },
|
||||
{ value: 1, label: t('runner.complaint_appeal.status.1') },
|
||||
{ value: 2, label: t('runner.complaint_appeal.status.2') },
|
||||
],
|
||||
},
|
||||
render: (value: number) => {
|
||||
if (value === 1) return <Tag color="success">{t('runner.complaint_appeal.status.1')}</Tag>;
|
||||
if (value === 2) return <Tag color="error">{t('runner.complaint_appeal.status.2')}</Tag>;
|
||||
return <Tag color="warning">{t('runner.complaint_appeal.status.0')}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: t('runner.complaint_appeal.status.0'), value: 0 },
|
||||
{ text: t('runner.complaint_appeal.status.1'), value: 1 },
|
||||
{ text: t('runner.complaint_appeal.status.2'), value: 2 },
|
||||
],
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint_appeal.reply'),
|
||||
dataIndex: 'reply',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint_appeal.reviewed_at'),
|
||||
dataIndex: 'reviewed_at',
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint_appeal.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint_appeal.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<IRunnerComplaintAppeal> = {
|
||||
api: '/runner/complaint-appeal',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'runner.complaint_appeal',
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('runner.complaint_appeal.page.title')}</Title>
|
||||
<Text type="secondary">{t('runner.complaint_appeal.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<IRunnerComplaintAppeal> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,164 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type IRunnerComplaint from '@/domain/iRunnerComplaint';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<IRunnerComplaint>[] = [
|
||||
{
|
||||
title: t('runner.complaint.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint.complaint_no'),
|
||||
dataIndex: 'complaint_no',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint.user_id'),
|
||||
dataIndex: 'user_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint.worker_id'),
|
||||
dataIndex: 'worker_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint.order_id'),
|
||||
dataIndex: 'order_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint.type'),
|
||||
dataIndex: 'type',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint.content'),
|
||||
dataIndex: 'content',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint.images'),
|
||||
dataIndex: 'images',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 0, label: t('runner.complaint.status.0') },
|
||||
{ value: 1, label: t('runner.complaint.status.1') },
|
||||
],
|
||||
},
|
||||
render: (value: number) => {
|
||||
return value === 1
|
||||
? <Tag color="success">{t('runner.complaint.status.1')}</Tag>
|
||||
: <Tag color="warning">{t('runner.complaint.status.0')}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: t('runner.complaint.status.0'), value: 0 },
|
||||
{ text: t('runner.complaint.status.1'), value: 1 },
|
||||
],
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint.result'),
|
||||
dataIndex: 'result',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint.result_remark'),
|
||||
dataIndex: 'result_remark',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint.handled_at'),
|
||||
dataIndex: 'handled_at',
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('runner.complaint.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<IRunnerComplaint> = {
|
||||
api: '/runner/complaint',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'runner.complaint',
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('runner.complaint.page.title')}</Title>
|
||||
<Text type="secondary">{t('runner.complaint.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<IRunnerComplaint> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,124 @@
|
||||
import { Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type IRunnerCreditLog from '@/domain/iRunnerCreditLog';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<IRunnerCreditLog>[] = [
|
||||
{
|
||||
title: t('runner.credit_log.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('runner.credit_log.worker_id'),
|
||||
dataIndex: 'worker_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.credit_log.score'),
|
||||
dataIndex: 'score',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.credit_log.score_after'),
|
||||
dataIndex: 'score_after',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.credit_log.type'),
|
||||
dataIndex: 'type',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.credit_log.description'),
|
||||
dataIndex: 'description',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.credit_log.related_type'),
|
||||
dataIndex: 'related_type',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.credit_log.related_id'),
|
||||
dataIndex: 'related_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.credit_log.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('runner.credit_log.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<IRunnerCreditLog> = {
|
||||
api: '/runner/credit-log',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'runner.credit_log',
|
||||
addShow: false,
|
||||
editShow: false,
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('runner.credit_log.page.title')}</Title>
|
||||
<Text type="secondary">{t('runner.credit_log.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<IRunnerCreditLog> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,159 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type IRunnerWorker from '@/domain/iRunnerWorker';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<IRunnerWorker>[] = [
|
||||
{
|
||||
title: t('runner.worker.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('runner.worker.user_id'),
|
||||
dataIndex: 'user_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.worker.real_name'),
|
||||
dataIndex: 'real_name',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.worker.mobile'),
|
||||
dataIndex: 'mobile',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.worker.id_card'),
|
||||
dataIndex: 'id_card',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.worker.total_income'),
|
||||
dataIndex: 'total_income',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.worker.total_order'),
|
||||
dataIndex: 'total_order',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.worker.cancel_order'),
|
||||
dataIndex: 'cancel_order',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.worker.credit_score'),
|
||||
dataIndex: 'credit_score',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('runner.worker.verified_at'),
|
||||
dataIndex: 'verified_at',
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('runner.worker.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 0, label: t('runner.worker.status.0') },
|
||||
{ value: 1, label: t('runner.worker.status.1') },
|
||||
],
|
||||
},
|
||||
render: (value: number) => {
|
||||
return value === 1
|
||||
? <Tag color="success">{t('runner.worker.status.1')}</Tag>
|
||||
: <Tag color="error">{t('runner.worker.status.0')}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: t('runner.worker.status.0'), value: 0 },
|
||||
{ text: t('runner.worker.status.1'), value: 1 },
|
||||
],
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('runner.worker.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('runner.worker.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<IRunnerWorker> = {
|
||||
api: '/runner/worker',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'runner.worker',
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('runner.worker.page.title')}</Title>
|
||||
<Text type="secondary">{t('runner.worker.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<IRunnerWorker> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,116 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type ITaskBid from '@/domain/iTaskBid';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<ITaskBid>[] = [
|
||||
{
|
||||
title: t('task.bid.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('task.bid.task_id'),
|
||||
dataIndex: 'task_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.bid.user_id'),
|
||||
dataIndex: 'user_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.bid.price'),
|
||||
dataIndex: 'price',
|
||||
hideInForm: true,
|
||||
align: 'center',
|
||||
render: (value: string) => `¥${value || '0.00'}`,
|
||||
},
|
||||
{
|
||||
title: t('task.bid.message'),
|
||||
dataIndex: 'message',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.bid.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.bid.accepted_at'),
|
||||
dataIndex: 'accepted_at',
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('task.bid.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('task.bid.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<ITaskBid> = {
|
||||
api: '/task/bid',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'task.bid',
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('task.bid.page.title')}</Title>
|
||||
<Text type="secondary">{t('task.bid.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<ITaskBid> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,142 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type ITaskCategory from '@/domain/iTaskCategory';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<ITaskCategory>[] = [
|
||||
{
|
||||
title: t('task.category.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('task.category.name'),
|
||||
dataIndex: 'name',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
required: true,
|
||||
rules: [{ required: true, message: t('task.category.name.required') }],
|
||||
},
|
||||
{
|
||||
title: t('task.category.slug'),
|
||||
dataIndex: 'slug',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
required: true,
|
||||
rules: [{ required: true, message: t('task.category.slug.required') }],
|
||||
},
|
||||
{
|
||||
title: t('task.category.description'),
|
||||
dataIndex: 'description',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('task.category.icon'),
|
||||
dataIndex: 'icon',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('task.category.form_schema'),
|
||||
dataIndex: 'form_schema',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('task.category.sort'),
|
||||
dataIndex: 'sort',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: t('task.category.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 0, label: t('task.category.status.0') },
|
||||
{ value: 1, label: t('task.category.status.1') },
|
||||
],
|
||||
},
|
||||
render: (value: number) => {
|
||||
return value === 1
|
||||
? <Tag color="success">{t('task.category.status.1')}</Tag>
|
||||
: <Tag color="error">{t('task.category.status.0')}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: t('task.category.status.0'), value: 0 },
|
||||
{ text: t('task.category.status.1'), value: 1 },
|
||||
],
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.category.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('task.category.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<ITaskCategory> = {
|
||||
api: '/task/category',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'task.category',
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 600,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('task.category.page.title')}</Title>
|
||||
<Text type="secondary">{t('task.category.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<ITaskCategory> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,161 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type ITaskOrder from '@/domain/iTaskOrder';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<ITaskOrder>[] = [
|
||||
{
|
||||
title: t('task.order_errand.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('task.order_errand.order_no'),
|
||||
dataIndex: 'order_no',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_errand.user_id'),
|
||||
dataIndex: 'user_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_errand.runner_id'),
|
||||
dataIndex: 'runner_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_errand.title'),
|
||||
dataIndex: 'title',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_errand.price'),
|
||||
dataIndex: 'price',
|
||||
hideInForm: true,
|
||||
align: 'center',
|
||||
render: (value: string) => `¥${value || '0.00'}`,
|
||||
},
|
||||
{
|
||||
title: t('task.order_errand.contact_name'),
|
||||
dataIndex: 'contact_name',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_errand.contact_mobile'),
|
||||
dataIndex: 'contact_mobile',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_errand.deadline'),
|
||||
dataIndex: 'deadline',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_errand.pay_type'),
|
||||
dataIndex: 'pay_type',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_errand.pay_status'),
|
||||
dataIndex: 'pay_status',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 0, label: t('task.order_errand.pay_status.0') },
|
||||
{ value: 1, label: t('task.order_errand.pay_status.1') },
|
||||
],
|
||||
},
|
||||
render: (value: number) => {
|
||||
return value === 1
|
||||
? <Tag color="success">{t('task.order_errand.pay_status.1')}</Tag>
|
||||
: <Tag color="error">{t('task.order_errand.pay_status.0')}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: t('task.order_errand.pay_status.0'), value: 0 },
|
||||
{ text: t('task.order_errand.pay_status.1'), value: 1 },
|
||||
],
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_errand.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_errand.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('task.order_errand.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<ITaskOrder> = {
|
||||
api: '/task/order',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'task.order',
|
||||
requestParams: { category_slug: 'errand' },
|
||||
scroll: { x: 1400 },
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('task.order_errand.page.title')}</Title>
|
||||
<Text type="secondary">{t('task.order_errand.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<ITaskOrder> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,161 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type ITaskOrder from '@/domain/iTaskOrder';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<ITaskOrder>[] = [
|
||||
{
|
||||
title: t('task.order_pickup.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('task.order_pickup.order_no'),
|
||||
dataIndex: 'order_no',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_pickup.user_id'),
|
||||
dataIndex: 'user_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_pickup.runner_id'),
|
||||
dataIndex: 'runner_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_pickup.title'),
|
||||
dataIndex: 'title',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_pickup.price'),
|
||||
dataIndex: 'price',
|
||||
hideInForm: true,
|
||||
align: 'center',
|
||||
render: (value: string) => `¥${value || '0.00'}`,
|
||||
},
|
||||
{
|
||||
title: t('task.order_pickup.contact_name'),
|
||||
dataIndex: 'contact_name',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_pickup.contact_mobile'),
|
||||
dataIndex: 'contact_mobile',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_pickup.deadline'),
|
||||
dataIndex: 'deadline',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_pickup.pay_type'),
|
||||
dataIndex: 'pay_type',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_pickup.pay_status'),
|
||||
dataIndex: 'pay_status',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 0, label: t('task.order_pickup.pay_status.0') },
|
||||
{ value: 1, label: t('task.order_pickup.pay_status.1') },
|
||||
],
|
||||
},
|
||||
render: (value: number) => {
|
||||
return value === 1
|
||||
? <Tag color="success">{t('task.order_pickup.pay_status.1')}</Tag>
|
||||
: <Tag color="error">{t('task.order_pickup.pay_status.0')}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: t('task.order_pickup.pay_status.0'), value: 0 },
|
||||
{ text: t('task.order_pickup.pay_status.1'), value: 1 },
|
||||
],
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_pickup.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_pickup.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('task.order_pickup.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<ITaskOrder> = {
|
||||
api: '/task/order',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'task.order',
|
||||
requestParams: { category_slug: 'pickup' },
|
||||
scroll: { x: 1400 },
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('task.order_pickup.page.title')}</Title>
|
||||
<Text type="secondary">{t('task.order_pickup.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<ITaskOrder> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
@@ -0,0 +1,161 @@
|
||||
import { Tag, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import XinTable from '@/components/XinTable';
|
||||
import type { XinTableColumn, XinTableProps } from '@/components/XinTable/typings';
|
||||
import type ITaskOrder from '@/domain/iTaskOrder';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const Table: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns: XinTableColumn<ITaskOrder>[] = [
|
||||
{
|
||||
title: t('task.order_rental.id'),
|
||||
dataIndex: 'id',
|
||||
hideInForm: true,
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: t('task.order_rental.order_no'),
|
||||
dataIndex: 'order_no',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_rental.user_id'),
|
||||
dataIndex: 'user_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_rental.runner_id'),
|
||||
dataIndex: 'runner_id',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_rental.title'),
|
||||
dataIndex: 'title',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_rental.price'),
|
||||
dataIndex: 'price',
|
||||
hideInForm: true,
|
||||
align: 'center',
|
||||
render: (value: string) => `¥${value || '0.00'}`,
|
||||
},
|
||||
{
|
||||
title: t('task.order_rental.contact_name'),
|
||||
dataIndex: 'contact_name',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_rental.contact_mobile'),
|
||||
dataIndex: 'contact_mobile',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_rental.deadline'),
|
||||
dataIndex: 'deadline',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_rental.pay_type'),
|
||||
dataIndex: 'pay_type',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_rental.pay_status'),
|
||||
dataIndex: 'pay_status',
|
||||
valueType: 'radioButton',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ value: 0, label: t('task.order_rental.pay_status.0') },
|
||||
{ value: 1, label: t('task.order_rental.pay_status.1') },
|
||||
],
|
||||
},
|
||||
render: (value: number) => {
|
||||
return value === 1
|
||||
? <Tag color="success">{t('task.order_rental.pay_status.1')}</Tag>
|
||||
: <Tag color="error">{t('task.order_rental.pay_status.0')}</Tag>;
|
||||
},
|
||||
filters: [
|
||||
{ text: t('task.order_rental.pay_status.0'), value: 0 },
|
||||
{ text: t('task.order_rental.pay_status.1'), value: 1 },
|
||||
],
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_rental.status'),
|
||||
dataIndex: 'status',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('task.order_rental.created_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'created_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
{
|
||||
title: t('task.order_rental.updated_at'),
|
||||
hideInForm: true,
|
||||
hideInSearch: true,
|
||||
dataIndex: 'updated_at',
|
||||
align: 'center',
|
||||
render: (value: string) => (value ? dayjs(value).fromNow() : '-'),
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: XinTableProps<ITaskOrder> = {
|
||||
api: '/task/order',
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
accessName: 'task.order',
|
||||
requestParams: { category_slug: 'rental' },
|
||||
scroll: { x: 1400 },
|
||||
formProps: {
|
||||
grid: true,
|
||||
colProps: { span: 12 },
|
||||
rowProps: { gutter: [30, 0] },
|
||||
layout: 'vertical',
|
||||
},
|
||||
modalProps: {
|
||||
width: 800,
|
||||
},
|
||||
cardProps: {
|
||||
variant: 'borderless',
|
||||
},
|
||||
pagination: {
|
||||
size: 'small',
|
||||
style: { marginBottom: 0 },
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="mb-5">
|
||||
<Title level={3}>{t('task.order_rental.page.title')}</Title>
|
||||
<Text type="secondary">{t('task.order_rental.page.description')}</Text>
|
||||
</div>
|
||||
<XinTable<ITaskOrder> {...tableProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Table;
|
||||
Reference in New Issue
Block a user