2026-05-07 14:23:01 +08:00
|
|
|
|
import { MyColumns, MyPageContainer, MyProTableProps } from '@/common';
|
2026-05-07 10:16:48 +08:00
|
|
|
|
import { Selects } from '@/components/Select';
|
|
|
|
|
|
import { Apis } from '@/gen/Apis';
|
|
|
|
|
|
import {
|
|
|
|
|
|
HouseWorkOrdersAssignStatusEnum,
|
|
|
|
|
|
HouseWorkOrdersLevelEnum,
|
|
|
|
|
|
HouseWorkOrdersTypeEnum,
|
|
|
|
|
|
} from '@/gen/Enums';
|
|
|
|
|
|
import WorkOrderShow from '@/pages/work_order/list/modals/WorkOrderShow';
|
|
|
|
|
|
import { ProTable } from '@ant-design/pro-components';
|
|
|
|
|
|
import { Space } from 'antd';
|
|
|
|
|
|
import RenovationAssign from './modals/RenovationAssign';
|
|
|
|
|
|
|
|
|
|
|
|
export const RenovationWorkOrdersStatusEnum = {
|
|
|
|
|
|
Pending: { text: '待处理', color: '#FFA500', value: 'Pending' },
|
|
|
|
|
|
Processing: { text: '处理中', color: '#1E90FF', value: 'Processing' },
|
|
|
|
|
|
Completed: { text: '已完成', color: '#28A745', value: 'Completed' },
|
|
|
|
|
|
Closed: { text: '已关闭', color: '#6C757D', value: 'Closed' },
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-07 14:23:01 +08:00
|
|
|
|
export default function Index({ title = '装修验收' }) {
|
2026-05-07 10:16:48 +08:00
|
|
|
|
return (
|
2026-05-07 14:23:01 +08:00
|
|
|
|
<MyPageContainer
|
|
|
|
|
|
title={title}
|
|
|
|
|
|
enableTabs={true}
|
|
|
|
|
|
tabKey="renovation_inspection_list"
|
|
|
|
|
|
tabLabel={title}
|
|
|
|
|
|
>
|
|
|
|
|
|
<ProTable<Record<any, any>>
|
|
|
|
|
|
{...MyProTableProps.props}
|
|
|
|
|
|
headerTitle={title}
|
|
|
|
|
|
request={async (params, sort) => {
|
|
|
|
|
|
return MyProTableProps.request(
|
|
|
|
|
|
{
|
|
|
|
|
|
...params,
|
|
|
|
|
|
type: [
|
|
|
|
|
|
HouseWorkOrdersTypeEnum.RenovationInspection.value,
|
|
|
|
|
|
HouseWorkOrdersTypeEnum.RenovationAcceptance.value,
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
sort,
|
|
|
|
|
|
Apis.WorkOrder.HouseWorkOrders.List,
|
|
|
|
|
|
);
|
|
|
|
|
|
}}
|
|
|
|
|
|
// toolBarRender={(action) => [toolBarRender(action)]}
|
|
|
|
|
|
columns={[
|
|
|
|
|
|
MyColumns.ID({ search: false }),
|
|
|
|
|
|
Selects?.AssetProjects({
|
|
|
|
|
|
title: '选择项目',
|
|
|
|
|
|
key: 'asset_projects_id',
|
|
|
|
|
|
hidden: true,
|
|
|
|
|
|
}),
|
|
|
|
|
|
MyColumns.EnumTag({
|
|
|
|
|
|
title: '处理状态',
|
|
|
|
|
|
dataIndex: 'status',
|
|
|
|
|
|
valueEnum: RenovationWorkOrdersStatusEnum,
|
|
|
|
|
|
}),
|
2026-05-07 10:16:48 +08:00
|
|
|
|
{
|
2026-05-07 14:23:01 +08:00
|
|
|
|
title: '项目名称',
|
|
|
|
|
|
dataIndex: 'project_name',
|
|
|
|
|
|
hidden: true,
|
2026-05-07 10:16:48 +08:00
|
|
|
|
},
|
2026-05-07 14:23:01 +08:00
|
|
|
|
MyColumns.EnumTag({
|
|
|
|
|
|
title: '分配状态',
|
|
|
|
|
|
dataIndex: 'assign_status',
|
|
|
|
|
|
valueEnum: HouseWorkOrdersAssignStatusEnum,
|
|
|
|
|
|
}),
|
|
|
|
|
|
MyColumns.EnumTag({
|
|
|
|
|
|
title: '工单类型',
|
|
|
|
|
|
dataIndex: 'type',
|
|
|
|
|
|
valueEnum: HouseWorkOrdersTypeEnum,
|
|
|
|
|
|
search: false,
|
|
|
|
|
|
}),
|
|
|
|
|
|
// MyColumns.EnumTag({
|
|
|
|
|
|
// title: '报修位置',
|
|
|
|
|
|
// dataIndex: 'location',
|
|
|
|
|
|
// valueEnum: HouseWorkOrdersLocationEnum,
|
|
|
|
|
|
// search: false,
|
|
|
|
|
|
// }),
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '位置信息',
|
|
|
|
|
|
dataIndex: ['asset_house', 'full_name'],
|
|
|
|
|
|
render: (_, record) => {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
{record?.asset_house?.full_name
|
|
|
|
|
|
? record?.asset_house?.full_name
|
|
|
|
|
|
: record?.asset_project?.name}
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
);
|
|
|
|
|
|
},
|
|
|
|
|
|
search: {
|
|
|
|
|
|
transform: (value) => {
|
|
|
|
|
|
return { house_name: value };
|
|
|
|
|
|
},
|
2026-05-07 10:16:48 +08:00
|
|
|
|
},
|
|
|
|
|
|
},
|
2026-05-07 14:23:01 +08:00
|
|
|
|
// {
|
|
|
|
|
|
// title: '工单描述',
|
|
|
|
|
|
// dataIndex: 'content',
|
|
|
|
|
|
// search: false,
|
|
|
|
|
|
// width: 200, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽)
|
|
|
|
|
|
// render: (text) => (
|
|
|
|
|
|
// <div
|
|
|
|
|
|
// style={{
|
|
|
|
|
|
// width: '100%', // 继承列宽
|
|
|
|
|
|
// // height: '60px', // 设置固定高度,约显示3行文本
|
|
|
|
|
|
// overflow: 'hidden', // 超出隐藏
|
|
|
|
|
|
// textOverflow: 'ellipsis', // 省略号
|
|
|
|
|
|
// display: '-webkit-box',
|
|
|
|
|
|
// WebkitBoxOrient: 'vertical',
|
|
|
|
|
|
// WebkitLineClamp: 3, // 显示3行
|
|
|
|
|
|
// }}
|
|
|
|
|
|
// >
|
|
|
|
|
|
// {text}
|
|
|
|
|
|
// </div>
|
|
|
|
|
|
// ),
|
|
|
|
|
|
// },
|
|
|
|
|
|
MyColumns.EnumTag({
|
|
|
|
|
|
title: '优先级',
|
|
|
|
|
|
dataIndex: 'level',
|
|
|
|
|
|
valueEnum: HouseWorkOrdersLevelEnum,
|
|
|
|
|
|
search: false,
|
|
|
|
|
|
}),
|
2026-05-07 10:16:48 +08:00
|
|
|
|
|
2026-05-07 14:23:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
title: '处理人',
|
|
|
|
|
|
dataIndex: ['assign_employee', 'name'],
|
|
|
|
|
|
search: false,
|
|
|
|
|
|
render: (_, record) => {
|
|
|
|
|
|
return `${record?.assign_employee?.name || ''}-${
|
|
|
|
|
|
record?.assign_employee?.phone || ''
|
|
|
|
|
|
}`;
|
|
|
|
|
|
},
|
2026-05-07 10:16:48 +08:00
|
|
|
|
},
|
2026-05-07 14:23:01 +08:00
|
|
|
|
MyColumns.CreatedAt(),
|
|
|
|
|
|
MyColumns.Option({
|
|
|
|
|
|
render: (_, item: any, index, action) => (
|
|
|
|
|
|
<Space key={index}>
|
|
|
|
|
|
<WorkOrderShow
|
|
|
|
|
|
item={item}
|
|
|
|
|
|
title="详情"
|
|
|
|
|
|
reload={action?.reload}
|
|
|
|
|
|
/>
|
|
|
|
|
|
<RenovationAssign
|
|
|
|
|
|
item={item}
|
|
|
|
|
|
reload={action?.reload}
|
|
|
|
|
|
title="指派"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
),
|
|
|
|
|
|
}),
|
|
|
|
|
|
]}
|
|
|
|
|
|
/>
|
|
|
|
|
|
</MyPageContainer>
|
2026-05-07 10:16:48 +08:00
|
|
|
|
);
|
|
|
|
|
|
}
|