接单员与财务管理

This commit is contained in:
liu
2026-06-17 10:35:13 +08:00
parent 254823e308
commit 8d52e863b9
110 changed files with 6054 additions and 570 deletions
+116
View File
@@ -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;
+142
View File
@@ -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;
+161
View File
@@ -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;
+161
View File
@@ -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;
+161
View File
@@ -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;