From 3350f99f61d0d52d4d4f215a86ab9bd90799295c Mon Sep 17 00:00:00 2001 From: uiuJun <> Date: Sat, 4 Oct 2025 22:22:41 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix=EF=BC=9A=E6=A5=BC=E6=A0=8B=E5=88=92?= =?UTF-8?q?=E5=88=86=20bug=E3=80=81=E8=B0=83=E6=95=B4=E6=88=BF=E5=B1=8B=20?= =?UTF-8?q?show=20=E9=A1=B5=E9=9D=A2=E5=AE=9E=E7=8E=B0=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/components/schema/MyColumns.tsx | 3 +- src/components/Select.tsx | 22 +++-- .../asset/dictionary/modals/HousesShow.tsx | 62 +++++++++--- src/pages/asset/grids/index.tsx | 2 + src/pages/asset/grids/modals/GridShow.tsx | 97 +++++++++++++++++++ src/pages/asset/grids/modals/GridUpdate.tsx | 26 ++++- .../bills/summary/components/BillInfo.tsx | 15 ++- src/pages/charge/tasks/index.tsx | 19 ++++ src/pages/charge/tasks/modals/TaskShow.tsx | 11 +++ src/pages/meter/tasks/index.tsx | 54 +++++++---- src/pages/meter/tasks/modals/TaskShow.tsx | 4 +- 11 files changed, 264 insertions(+), 51 deletions(-) create mode 100644 src/pages/asset/grids/modals/GridShow.tsx diff --git a/src/common/components/schema/MyColumns.tsx b/src/common/components/schema/MyColumns.tsx index 736cc91..121a587 100644 --- a/src/common/components/schema/MyColumns.tsx +++ b/src/common/components/schema/MyColumns.tsx @@ -6,7 +6,8 @@ type ReturnType = ProColumns, 'text'>; export const MyColumns = { ID(props?: ReturnType): ReturnType { - return { title: 'ID', dataIndex: 'id', hideInSearch: true, ...props }; + // return { title: 'ID', dataIndex: 'id', hideInSearch: true, ...props }; + return { title: 'ID', dataIndex: 'id', ...props }; }, DayStatus: (start: string, end: string) => { const now = new Date(); diff --git a/src/components/Select.tsx b/src/components/Select.tsx index 0ebb2f5..76111db 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -586,14 +586,20 @@ export const Selects = { valueType: 'select', hideInTable: hideInTable, formItemProps: { ...(required ? rulesHelper.number : {}) }, - request: async (params) => - ( - await Apis.Meter.HouseMeters.List({ - keywords: params?.KeyWords, - ...params, - asset_projects_id: params?.asset_projects_id, - }) - ).data, + + request: async (params) => { + let res = await Apis.Meter.HouseMeters.List({ + keywords: params?.KeyWords, + asset_projects_id: params?.asset_projects_id, + charge_standards_id: params?.house_charge_standards_id, + ...params, + }); + res?.data?.map((l: any) => { + l.label = l.id + ':' + l.name; + l.value = l.house_meter_has_houses[0].asset_houses_id; + }); + return res?.data; + }, ...rest, fieldProps: { showSearch: true, diff --git a/src/pages/asset/dictionary/modals/HousesShow.tsx b/src/pages/asset/dictionary/modals/HousesShow.tsx index ab23e78..eaed782 100644 --- a/src/pages/asset/dictionary/modals/HousesShow.tsx +++ b/src/pages/asset/dictionary/modals/HousesShow.tsx @@ -1,5 +1,6 @@ import { MyBetaModalFormProps, renderTextHelper } from '@/common'; import { MyModal } from '@/components/MyModal'; +import { Apis } from '@/gen/Apis'; import { AssetHousesOrientationEnum, AssetHousesOwnershipTypeEnum, @@ -7,63 +8,96 @@ import { AssetHousesUsageEnum, } from '@/gen/Enums'; import { ProCard, ProDescriptions } from '@ant-design/pro-components'; +import { Space } from 'antd'; +import { useCallback, useState } from 'react'; export default function info(props: MyBetaModalFormProps) { + const [show, setShow] = useState({}); + const [loading, setLoading] = useState(false); + + const getShow = useCallback(() => { + if (loading || !props?.item?.id) return; + + setLoading(true); + Apis.Asset.AssetHouses.Show({ + id: props?.item?.id, + }) + .then((res) => { + setShow(res?.data); + }) + .catch(() => { + return false; + }) + .finally(() => { + setLoading(false); + }); + }, [props?.item?.id, loading]); + + // 只在弹窗打开时获取数据 + const handleOpen = useCallback(() => { + if (!loading) { + getShow(); + } + }, [getShow, loading]); + return ( - {props?.item?.full_name} + + 【{show?.id}】 + {show?.full_name} + - {props?.item?.name} + {show?.name} - {props?.item?.floor} + {show?.floor} - {props?.item?.built_area}m² + {show?.built_area}m² - {props?.item?.inside_area}m² + {show?.inside_area}m² - {props?.item?.chargeable_area}m² + {show?.chargeable_area}m² - {props?.item?.room || ''}房{props?.item?.hall || ''}厅 - {props?.item?.bathroom || ''}卫{props?.item?.kitchen || ''}厨 - {props?.item?.balcony || ''}阳台 + {show?.room || ''}房{show?.hall || ''}厅{show?.bathroom || ''}卫 + {show?.kitchen || ''}厨{show?.balcony || ''}阳台 diff --git a/src/pages/asset/grids/index.tsx b/src/pages/asset/grids/index.tsx index 5210c0d..c1adcb7 100644 --- a/src/pages/asset/grids/index.tsx +++ b/src/pages/asset/grids/index.tsx @@ -11,6 +11,7 @@ import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; import GridCreate from './modals/GridCreate'; import GridMannger from './modals/GridMannger'; +import GridShow from './modals/GridShow'; import GridUpdate from './modals/GridUpdate'; export default function Index({ title = '楼栋范围' }) { @@ -72,6 +73,7 @@ export default function Index({ title = '楼栋范围' }) { MyColumns.Option({ render: (_, item: any, index, action) => ( + ({}); + const getShow = () => { + Apis.Grid.Grids.Show({ + id: props?.item?.id, + }) + .then((res) => { + setShow(res?.data); + }) + .catch(() => false); + }; + + // 只在弹窗打开时获取数据 + const handleOpen = () => { + getShow(); + }; + + return ( + + + + + 【{show?.id}】 + {show?.name} + + + + {show?.name} + + + {show?.floor} + + + + + + + + + {show?.built_area}m² + + + {show?.inside_area}m² + + + {show?.chargeable_area}m² + + + + + + {show?.room || ''}房{show?.hall || ''}厅{show?.bathroom || ''}卫 + {show?.kitchen || ''}厨{show?.balcony || ''}阳台 + + + + + + + } + /> + ); +} diff --git a/src/pages/asset/grids/modals/GridUpdate.tsx b/src/pages/asset/grids/modals/GridUpdate.tsx index 2f51fb6..fff537f 100644 --- a/src/pages/asset/grids/modals/GridUpdate.tsx +++ b/src/pages/asset/grids/modals/GridUpdate.tsx @@ -39,12 +39,30 @@ export default function Update(props: MyBetaModalFormProps) { }} onFinish={async (values: any) => { console.log(values); - // values?.grid_ranges?.map((res: { asset_projects_id: string }) => { - // res.asset_projects_id = props?.item?.id; - // }); + // 确保grid_ranges是正确的对象数组格式 + if ( + values.grid_ranges && + Array.isArray(values.grid_ranges) && + typeof values.grid_ranges[0] === 'number' + ) { + // 如果是ID数组,需要转换为对象数组 + const dataSource = form.getFieldValue('_dataSource') || []; + const grid_ranges = values.grid_ranges.map((id: any) => { + const unit = dataSource.find( + (item: any) => item.asset_units_id === id.toString(), + ); + return { + asset_projects_id: props?.item?.asset_projects_id, + asset_buildings_id: unit?.asset_buildings_id, + asset_units_id: id.toString(), + }; + }); + values.grid_ranges = grid_ranges; + } + return Apis.Grid.Grids.Update({ ...values, - asset_projects_id: props?.item?.id || values?.asset_projects_id, + asset_projects_id: props?.item?.asset_projects_id, id: props?.item?.id, }) .then(() => { diff --git a/src/pages/bills/summary/components/BillInfo.tsx b/src/pages/bills/summary/components/BillInfo.tsx index ceadd72..f8955ae 100644 --- a/src/pages/bills/summary/components/BillInfo.tsx +++ b/src/pages/bills/summary/components/BillInfo.tsx @@ -1,20 +1,25 @@ import { MyBetaModalFormProps } from '@/common'; +import HousesShow from '@/pages/asset/dictionary/modals/HousesShow'; import { ProCard, ProDescriptions } from '@ant-design/pro-components'; import { Space } from 'antd'; export default function info(props: MyBetaModalFormProps) { const { item } = props; - // 添加调试日志 - console.log('BillInfo props:', props); - console.log('BillInfo 11111111:', item); - return ( - {item?.asset_house?.full_name || '-'} + + {item?.asset_house?.full_name || '-'} + {item?.asset_houses_id && ( + + )} + {item?.total_payable_sum || '-'} diff --git a/src/pages/charge/tasks/index.tsx b/src/pages/charge/tasks/index.tsx index 6ae1e83..9ffcc4d 100644 --- a/src/pages/charge/tasks/index.tsx +++ b/src/pages/charge/tasks/index.tsx @@ -11,11 +11,13 @@ import { HouseChargeTasksTypeEnum, } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; import TaskCreate from './modals/TaskCreate'; import TaskShow from './modals/TaskShow'; export default function Index({ title = '账单任务' }) { + const navigate = useNavigate(); // 注册当前页面为标签页 usePageTabs({ tabKey: 'house_charge_tasks', @@ -42,11 +44,17 @@ export default function Index({ title = '账单任务' }) { , ]} columns={[ + MyColumns.ID(), { title: '机构', dataIndex: ['company', 'name'], search: false, }, + { + title: '项目', + dataIndex: ['asset_project', 'name'], + search: false, + }, { title: '任务ID', dataIndex: 'id', @@ -66,6 +74,17 @@ export default function Index({ title = '账单任务' }) { title: '收费标准', dataIndex: ['house_charge_standard', 'name'], search: false, + render: (_, record) => ( + { + navigate( + `/charge/standard/show/${record.house_charge_standards_id}`, + ); + }} + /> + ), }, { title: '账单月份', diff --git a/src/pages/charge/tasks/modals/TaskShow.tsx b/src/pages/charge/tasks/modals/TaskShow.tsx index daf0a05..13b658f 100644 --- a/src/pages/charge/tasks/modals/TaskShow.tsx +++ b/src/pages/charge/tasks/modals/TaskShow.tsx @@ -8,9 +8,11 @@ import { MyModal } from '@/components/MyModal'; import { Apis } from '@/gen/Apis'; import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; export default function AssetInfo(props: MyBetaModalFormProps) { + const navigate = useNavigate(); return ( ( + { + navigate(`/bills/summary/show/${record.asset_houses_id}`); + }} + /> + ), }, MyColumns.EnumTag({ title: '状态', diff --git a/src/pages/meter/tasks/index.tsx b/src/pages/meter/tasks/index.tsx index e248912..42c09d1 100644 --- a/src/pages/meter/tasks/index.tsx +++ b/src/pages/meter/tasks/index.tsx @@ -8,7 +8,7 @@ import { import { Apis } from '@/gen/Apis'; import { HouseChargeTasksStatusEnum, - HouseChargeTasksTypeEnum, + HouseMeterTasksGenerationMethodEnum, } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; @@ -38,31 +38,32 @@ export default function Index({ title = '仪表账单' }) { , ]} columns={[ + MyColumns.ID(), { title: '机构', dataIndex: ['company', 'name'], search: false, }, { - title: '任务ID', - dataIndex: 'id', + title: '项目', + dataIndex: ['asset_project', 'name'], search: false, }, - MyColumns.EnumTag({ - title: '创建类型', - dataIndex: 'type', - valueEnum: HouseChargeTasksTypeEnum, - }), MyColumns.EnumTag({ title: '任务状态', dataIndex: 'status', valueEnum: HouseChargeTasksStatusEnum, }), - { - title: '收费标准', - dataIndex: ['house_charge_standard', 'name'], - search: false, - }, + MyColumns.EnumTag({ + title: '生成方式', + dataIndex: 'generation_method', + valueEnum: HouseMeterTasksGenerationMethodEnum, + }), + // { + // title: '收费标准', + // dataIndex: ['house_charge_standard', 'name'], + // search: false, + // }, { title: '账单月份', render: (_, record) => { @@ -88,19 +89,38 @@ export default function Index({ title = '仪表账单' }) { dataIndex: 'task_count', search: false, }, - // MyColumns.UpdatedAt(), - MyColumns.CreatedAt(), + MyColumns.UpdatedAt(), + // MyColumns.CreatedAt(), MyColumns.Option({ render: (_, item: any, index, action) => ( - - Apis.HouseCharage.HouseChargeTasks.Delete({ + Apis.Meter.HouseMeterTasks.ExecuteMeterTasks({ id: item.id, }).then(() => action?.reload()) } /> + {/* + Apis.Meter.HouseMeterTasks.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> */} ), }), diff --git a/src/pages/meter/tasks/modals/TaskShow.tsx b/src/pages/meter/tasks/modals/TaskShow.tsx index 9887856..9741e5b 100644 --- a/src/pages/meter/tasks/modals/TaskShow.tsx +++ b/src/pages/meter/tasks/modals/TaskShow.tsx @@ -15,9 +15,9 @@ export default function AssetInfo(props: MyBetaModalFormProps) { {...MyProTableProps.props} request={async (params, sort) => MyProTableProps.request( - { ...params, house_charge_tasks_id: props?.item?.id }, + { ...params, house_meter_task_id: props?.item?.id }, sort, - Apis.Meter.HouseMeterTasks.List, + Apis.Meter.HouseMeterTaskDetails.List, ) } columns={[ From aad0f264379cb2b975845a90add14957646f6e03 Mon Sep 17 00:00:00 2001 From: uiuJun <> Date: Sat, 4 Oct 2025 23:45:30 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E6=94=B6?= =?UTF-8?q?=E6=AC=BE=E8=B4=A6=E5=8F=B7=E8=8E=B7=E5=8F=96=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .umirc.ts | 4 +-- src/components/Select.tsx | 25 ++++++++----------- src/pages/asset/accounts/index.tsx | 11 +++++--- .../asset/accounts/modals/AccountsGet.tsx | 9 +++++-- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.umirc.ts b/.umirc.ts index 6fdf83b..318fa17 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -16,8 +16,8 @@ export default defineConfig({ '/api/': { // target: 'http://yt:8003', // target: 'http://10.39.13.78:8001/', - target: 'https://test-admin.linyikj.com.cn/', - // target: 'https://admin.linyikj.com.cn/', + // target: 'https://test-admin.linyikj.com.cn/', + target: 'https://admin.linyikj.com.cn/', // target: 'http://c789629c.natappfree.cc', changeOrigin: true, diff --git a/src/components/Select.tsx b/src/components/Select.tsx index 76111db..d956e28 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -373,24 +373,20 @@ export const Selects = { valueType: 'select', hideInTable: hideInTable, formItemProps: { ...(required ? rulesHelper.number : {}) }, - request: async (params) => { - let res = await Apis.Company.CompanyReceiptAccounts.Select({ - keywords: params?.KeyWords, - companies_id: params?.companies_id, - ...params, - }); - res?.data?.map((l: any) => { - l.label = - l.company_name + '_' + l.company_bank + '_' + l.company_account; - }); - return res?.data; - }, + request: async (params) => + ( + await Apis.Company.CompanyReceiptAccounts.Select({ + keywords: params?.KeyWords, + companies_id: params?.companies_id, + ...params, + }) + ).data, ...rest, fieldProps: { showSearch: true, fieldNames: { label: 'label', - value: 'id', + value: 'value', }, ...rest?.fieldProps, }, @@ -416,6 +412,7 @@ export const Selects = { ( await Apis.Company.CompanyProjectReceiptAccounts.Select({ keywords: params?.KeyWords, + projects_id: params?.asset_projects_id, ...params, }) ).data, @@ -570,7 +567,7 @@ export const Selects = { }, }; }, - //获取项目仪表 + //获取仪表 AssetMeters(props?: PropsType): ReturnType { const { title = '选择仪表', diff --git a/src/pages/asset/accounts/index.tsx b/src/pages/asset/accounts/index.tsx index 6ef3e7b..d47ac23 100644 --- a/src/pages/asset/accounts/index.tsx +++ b/src/pages/asset/accounts/index.tsx @@ -40,10 +40,15 @@ export default function Index({ title = '项目账户' }) { , ]} columns={[ + MyColumns.ID(), + { - title: 'ID', - dataIndex: 'id', - // width: 360, + title: '机构名称', + dataIndex: ['company', 'name'], + }, + { + title: '项目名称', + dataIndex: ['project', 'name'], }, { title: '收款名称', diff --git a/src/pages/asset/accounts/modals/AccountsGet.tsx b/src/pages/asset/accounts/modals/AccountsGet.tsx index a81bbfd..2942c52 100644 --- a/src/pages/asset/accounts/modals/AccountsGet.tsx +++ b/src/pages/asset/accounts/modals/AccountsGet.tsx @@ -28,10 +28,14 @@ export default function Create(props: MyBetaModalFormProps) { onOpenChange={(open: any) => { if (open) { form.resetFields(); // 清空表单数据 + form.setFieldsValue({ + companies_id: props?.item?.companies_id || undefined, + projects_id: props?.item?.id || undefined, + }); } }} key={new Date().getTime()} - onFinish={async (values) => + onFinish={async (values: any) => Apis.Company.CompanyProjectReceiptAccounts.Store({ ...values, companies_id: props?.item?.companies_id || values?.companies_id, @@ -89,7 +93,8 @@ export default function Create(props: MyBetaModalFormProps) { key: 'receipt_accounts_id', title: '选择收款账户', params: { - companies_id: companies_id || props?.item?.companies_id || 0, + companies_id: + companies_id || props?.item?.companies_id || undefined, }, colProps: { span: 24 }, formItemProps: { ...rulesHelper.number }, From 3f5457bf0493a3226604be3b98cb879ad44a68a9 Mon Sep 17 00:00:00 2001 From: zsqtony <450952271@qq.com> Date: Sun, 5 Oct 2025 10:39:21 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix:=E6=9B=B4=E6=96=B0=E5=BE=AA=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MyModal.tsx | 6 +- src/pages/asset/grids/modals/GridShow.tsx | 148 +++++++++++----------- 2 files changed, 79 insertions(+), 75 deletions(-) diff --git a/src/components/MyModal.tsx b/src/components/MyModal.tsx index 4e47799..f13b3f7 100644 --- a/src/components/MyModal.tsx +++ b/src/components/MyModal.tsx @@ -9,10 +9,10 @@ export function MyModal(props?: any) { }; useEffect(() => { - if (open && props?.onOpen) { - props.onOpen(); + if (open) { + props?.onOpen(true); } - }, [open, props?.onOpen]); + }, [open]); useImperativeHandle(props.myRef, () => ({ close, diff --git a/src/pages/asset/grids/modals/GridShow.tsx b/src/pages/asset/grids/modals/GridShow.tsx index 071f4d4..e772375 100644 --- a/src/pages/asset/grids/modals/GridShow.tsx +++ b/src/pages/asset/grids/modals/GridShow.tsx @@ -11,86 +11,90 @@ import { ProCard, ProDescriptions } from '@ant-design/pro-components'; import { Space } from 'antd'; import { useState } from 'react'; -export default function info(props: MyBetaModalFormProps) { - const [show, setShow] = useState({}); - const getShow = () => { - Apis.Grid.Grids.Show({ - id: props?.item?.id, - }) - .then((res) => { - setShow(res?.data); - }) - .catch(() => false); - }; +export default function Info(props: MyBetaModalFormProps) { + const [getShow, setDataShow] = useState({}); // 只在弹窗打开时获取数据 - const handleOpen = () => { - getShow(); - }; return ( { + if (e) { + return Apis.Grid.Grids.Show({ + id: props?.item?.id, + }) + .then((res) => { + console.log(res); + setDataShow(JSON.parse(JSON.stringify(res?.data))); + return false; + }) + .catch(() => false); + } + console.log(e); + }} node={ - - - - - 【{show?.id}】 - {show?.name} - - - - {show?.name} - - - {show?.floor} - - - - - - - - - {show?.built_area}m² - - - {show?.inside_area}m² - - - {show?.chargeable_area}m² - - - - - - {show?.room || ''}房{show?.hall || ''}厅{show?.bathroom || ''}卫 - {show?.kitchen || ''}厨{show?.balcony || ''}阳台 - - - - - - + <> + + + + + 【{getShow?.id}】 + {getShow?.name} + + + + {getShow?.name} + + + {getShow?.floor} + + + + + + + + + {getShow?.built_area}m² + + + {getShow?.inside_area}m² + + + {getShow?.chargeable_area}m² + + + + + + {getShow?.room || ''}房{getShow?.hall || ''}厅 + {getShow?.bathroom || ''}卫{getShow?.kitchen || ''}厨 + {getShow?.balcony || ''}阳台 + + + + + + + } /> ); From 04a716f0e0cbce9dcacc2a8524cc4bf44158a918 Mon Sep 17 00:00:00 2001 From: uiuJun <> Date: Mon, 6 Oct 2025 17:28:13 +0800 Subject: [PATCH 4/6] =?UTF-8?q?fix=EF=BC=9A=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MyModal.tsx | 2 +- src/pages/archive/components/SummaryInfo.tsx | 93 ++++++++++--------- src/pages/archive/show/$id.tsx | 15 ++- src/pages/asset/activities/index.tsx | 47 +++++++++- src/pages/asset/grids/modals/GridMannger.tsx | 6 +- src/pages/asset/grids/modals/GridShow.tsx | 79 ++++------------ src/pages/bills/summary/show/$id.tsx | 8 +- src/pages/charge/tasks/index.tsx | 6 +- src/pages/charge/tasks/modals/TaskShow.tsx | 1 + .../customer/components/CustomerHouse.tsx | 65 +++++++------ src/pages/customer/show/$id.tsx | 9 +- 11 files changed, 177 insertions(+), 154 deletions(-) diff --git a/src/components/MyModal.tsx b/src/components/MyModal.tsx index f13b3f7..c43bccb 100644 --- a/src/components/MyModal.tsx +++ b/src/components/MyModal.tsx @@ -10,7 +10,7 @@ export function MyModal(props?: any) { useEffect(() => { if (open) { - props?.onOpen(true); + props?.onOpen?.(true); } }, [open]); diff --git a/src/pages/archive/components/SummaryInfo.tsx b/src/pages/archive/components/SummaryInfo.tsx index f801d88..e7b1dd4 100644 --- a/src/pages/archive/components/SummaryInfo.tsx +++ b/src/pages/archive/components/SummaryInfo.tsx @@ -1,49 +1,56 @@ -import { MyBetaModalFormProps, MyProTableProps } from '@/common'; +import { MyBetaModalFormProps, MyButtons } from '@/common'; import { Apis } from '@/gen/Apis'; -import { ProCard, ProTable } from '@ant-design/pro-components'; +import { ProCard, ProDescriptions } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Space } from 'antd'; +import { useEffect, useState } from 'react'; + +export default function Info(props: MyBetaModalFormProps) { + const [getShow, setDataShow] = useState({}); + const navigate = useNavigate(); + + useEffect(() => { + Apis.Bill.HouseBills.SummaryShow({ + asset_houses_id: props?.item?.id, + }) + .then((res) => { + console.log(res); + setDataShow(JSON.parse(JSON.stringify(res?.data))); + return false; + }) + .catch(() => false); + }, [props?.item?.id]); -export default function info(props: MyBetaModalFormProps) { - const { item } = props; return ( - - - MyProTableProps.request( - { - ...params, - asset_houses_id: item?.asset_houses_id, - }, - sort, - Apis.Bill.HouseBills.SummaryBillList, - ) - } - search={false} - options={false} - pagination={false} - columns={[ - { - title: '账单金额合计', - dataIndex: 'payable_amount_sum', - search: false, - }, - { - title: '滞纳金合计', - dataIndex: 'late_fee_sum', - search: false, - }, - { - title: '优惠金额合计', - dataIndex: 'discount_amount_sum', - search: false, - }, - { - title: '应付合计', - dataIndex: 'total_payable_sum', - search: false, - }, - ]} - /> + + + + {getShow?.payable_amount_sum || '-'} + + + {getShow?.late_fee_sum || '-'} + + + {getShow?.discount_amount_sum || '-'} + + + + {getShow?.total_payable_sum || ''} + {getShow?.payable_amount_sum ? ( + { + navigate(`/bills/summary/show/${props?.item?.id || 0}`); + }} + /> + ) : ( + '无账单' + )} + + + ); } diff --git a/src/pages/archive/show/$id.tsx b/src/pages/archive/show/$id.tsx index eb9bdcb..6e22862 100644 --- a/src/pages/archive/show/$id.tsx +++ b/src/pages/archive/show/$id.tsx @@ -9,7 +9,6 @@ import SummaryInfo from '../components/SummaryInfo'; import OccupantsHistory from '../table/OccupantsHistory'; import OccupantsNow from '../table/OccupantsNow'; import RegistersList from '../table/RegistersList'; -import UnpaidBill from '../table/UnpaidBill'; export default function Show({ title = '房屋档案' }) { const { id } = useParams<{ id: string }>(); @@ -90,18 +89,18 @@ export default function Show({ title = '房屋档案' }) { /> ), }, - { - label: '欠费账单', - key: '4', - closable: false, - children: , - }, + // { + // label: '欠费账单', + // key: '4', + // closable: false, + // children: , + // }, ]; return ( - + {id && } diff --git a/src/pages/asset/activities/index.tsx b/src/pages/asset/activities/index.tsx index 880d7c9..43ac5cf 100644 --- a/src/pages/asset/activities/index.tsx +++ b/src/pages/asset/activities/index.tsx @@ -107,7 +107,7 @@ export default function Index({ title = '项目活动' }) { // title={title} /> )} - {(!item.end_time || new Date(item.end_time) > new Date()) && ( + {/* {(!item.end_time || new Date(item.end_time) > new Date()) && ( action?.reload()); }} /> - )} - + )} */} + { + let newStatus; + if ( + item.publish_status === + ActivitiesPublishStatusEnum.Unpublished.value + ) { + newStatus = ActivitiesPublishStatusEnum.Published.value; + } else if ( + item.publish_status === + ActivitiesPublishStatusEnum.Published.value + ) { + newStatus = ActivitiesPublishStatusEnum.Unlisted.value; + } else { + newStatus = ActivitiesPublishStatusEnum.Published.value; + } + Apis.Activity.Activities.ChangePublishStatus({ + id: item.id, + publish_status: newStatus, + }).then(() => action?.reload()); + }} + /> {item.is_enroll === 1 && ( {...MyModalFormProps.props} - title={`设置管理员`} + title={`设置楼栋管家`} wrapperCol={{ span: 24 }} width="500px" form={form} key={new Date().getTime()} - trigger={} + trigger={} request={() => Promise.resolve(props.item)} onOpenChange={(open: any) => { if (open && props.item) { @@ -49,7 +49,7 @@ export default function Create( } columns={[ Selects?.Employees({ - title: '设置网格员', + title: '设置楼栋管家', dataIndex: 'company_employees_id', colProps: { span: 24 }, formItemProps: { ...rulesHelper.text }, diff --git a/src/pages/asset/grids/modals/GridShow.tsx b/src/pages/asset/grids/modals/GridShow.tsx index e772375..6912151 100644 --- a/src/pages/asset/grids/modals/GridShow.tsx +++ b/src/pages/asset/grids/modals/GridShow.tsx @@ -1,12 +1,6 @@ -import { MyBetaModalFormProps, renderTextHelper } from '@/common'; +import { MyBetaModalFormProps } from '@/common'; import { MyModal } from '@/components/MyModal'; import { Apis } from '@/gen/Apis'; -import { - AssetHousesOrientationEnum, - AssetHousesOwnershipTypeEnum, - AssetHousesStatusEnum, - AssetHousesUsageEnum, -} from '@/gen/Enums'; import { ProCard, ProDescriptions } from '@ant-design/pro-components'; import { Space } from 'antd'; import { useState } from 'react'; @@ -14,12 +8,10 @@ import { useState } from 'react'; export default function Info(props: MyBetaModalFormProps) { const [getShow, setDataShow] = useState({}); - // 只在弹窗打开时获取数据 - return ( { if (e) { return Apis.Grid.Grids.Show({ @@ -37,60 +29,25 @@ export default function Info(props: MyBetaModalFormProps) { node={ <> - - - - 【{getShow?.id}】 - {getShow?.name} - + + + {getShow?.name} - - {getShow?.name} + + + {getShow?.grid_ranges + ?.map( + (item: any) => + item?.asset_building?.name + item?.asset_unit?.name, + ) + .join(';')} - - {getShow?.floor} + + + {getShow?.created_at} - - - - - - - - {getShow?.built_area}m² - - - {getShow?.inside_area}m² - - - {getShow?.chargeable_area}m² - - - - - - {getShow?.room || ''}房{getShow?.hall || ''}厅 - {getShow?.bathroom || ''}卫{getShow?.kitchen || ''}厨 - {getShow?.balcony || ''}阳台 - - - + + {getShow?.updated_at} diff --git a/src/pages/bills/summary/show/$id.tsx b/src/pages/bills/summary/show/$id.tsx index 634dbcd..daedc6a 100644 --- a/src/pages/bills/summary/show/$id.tsx +++ b/src/pages/bills/summary/show/$id.tsx @@ -44,7 +44,9 @@ export default function Show({ title = '账单详情' }) { key: '1', closable: false, children: ( - + ), }, { @@ -52,7 +54,7 @@ export default function Show({ title = '账单详情' }) { key: '2', closable: false, children: ( - + ), }, { @@ -61,7 +63,7 @@ export default function Show({ title = '账单详情' }) { closable: false, children: ( ), }, diff --git a/src/pages/charge/tasks/index.tsx b/src/pages/charge/tasks/index.tsx index 9ffcc4d..9343f8c 100644 --- a/src/pages/charge/tasks/index.tsx +++ b/src/pages/charge/tasks/index.tsx @@ -118,7 +118,11 @@ export default function Index({ title = '账单任务' }) { (value ? '已生成' : '未生成'), + title: '退房日期', + dataIndex: 'move_out_date', + render(_, record) { + return `${record?.move_out_date || '-'}`; + }, search: false, }, + // MyColumns.Option({ // render: (_, item: any, index, action) => ( // diff --git a/src/pages/customer/show/$id.tsx b/src/pages/customer/show/$id.tsx index 86c1fdc..094f3a9 100644 --- a/src/pages/customer/show/$id.tsx +++ b/src/pages/customer/show/$id.tsx @@ -14,7 +14,7 @@ export default function Show({ title = '客户档案' }) { // 注册标签页 const { addTab } = usePageTabs({ tabKey: `customer-detail-${id}`, - tabLabel: `${data?.name}档案` || title, + tabLabel: `客户:${data?.name}` || title, }); const loadShow = () => { @@ -56,7 +56,12 @@ export default function Show({ title = '客户档案' }) { - + ); From abfad6a3859db1a302448f4d8680740683ebb507 Mon Sep 17 00:00:00 2001 From: uiuJun <> Date: Thu, 9 Oct 2025 20:21:05 +0800 Subject: [PATCH 5/6] =?UTF-8?q?feat=EF=BC=9A=E4=BB=AA=E8=A1=A8=E6=88=BF?= =?UTF-8?q?=E5=B1=8B=E5=AF=BC=E5=85=A5=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .umirc.ts | 4 +- gencode.json | 2 +- src/components/Select.tsx | 2 +- src/gen/ApiTypes.d.ts | 7 +- src/gen/Apis.ts | 8 +- src/gen/Enums.ts | 2 +- src/pages/asset/activities/index.tsx | 14 +- .../asset/activities/modals/ActivityShow.tsx | 2 +- src/pages/charge/tasks/modals/TaskShow.tsx | 5 +- .../complaint/components/WorkLogsCreate.tsx | 82 ++++++ .../complaint/components/WorkLogsLIst.tsx | 143 ++++++++++ src/pages/complaint/index.tsx | 184 +++++++++++++ .../complaint/modals/ComplaintAssign.tsx | 88 ++++++ src/pages/complaint/modals/ComplaintShow.tsx | 251 ++++++++++++++++++ src/pages/meter/list/index.tsx | 11 +- src/pages/meter/readings/show/$id.tsx | 7 + src/pages/meter/readings/table/HasHouse.tsx | 7 - src/pages/meter/readings/table/Tasks.tsx | 111 ++++++++ src/pages/meter/tasks/index.tsx | 1 - src/pages/meter/tasks/modals/TaskShow.tsx | 60 ++++- src/pages/order/{ => list}/index.tsx | 61 ++--- src/pages/order/list/modals/Payments.tsx | 79 ++++++ src/pages/order/{payments => pay}/index.tsx | 78 +++--- 23 files changed, 1103 insertions(+), 106 deletions(-) create mode 100644 src/pages/complaint/components/WorkLogsCreate.tsx create mode 100644 src/pages/complaint/components/WorkLogsLIst.tsx create mode 100644 src/pages/complaint/index.tsx create mode 100644 src/pages/complaint/modals/ComplaintAssign.tsx create mode 100644 src/pages/complaint/modals/ComplaintShow.tsx create mode 100644 src/pages/meter/readings/table/Tasks.tsx rename src/pages/order/{ => list}/index.tsx (71%) create mode 100644 src/pages/order/list/modals/Payments.tsx rename src/pages/order/{payments => pay}/index.tsx (55%) diff --git a/.umirc.ts b/.umirc.ts index 318fa17..6fdf83b 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -16,8 +16,8 @@ export default defineConfig({ '/api/': { // target: 'http://yt:8003', // target: 'http://10.39.13.78:8001/', - // target: 'https://test-admin.linyikj.com.cn/', - target: 'https://admin.linyikj.com.cn/', + target: 'https://test-admin.linyikj.com.cn/', + // target: 'https://admin.linyikj.com.cn/', // target: 'http://c789629c.natappfree.cc', changeOrigin: true, diff --git a/gencode.json b/gencode.json index cc974bb..b5fb778 100644 --- a/gencode.json +++ b/gencode.json @@ -1,4 +1,4 @@ { - "url": "http://c789629c.natappfree.cc/api/docs/openapi", + "url": "http://10.39.13.78:8001/api/docs/openapi", "module": "Admin" } diff --git a/src/components/Select.tsx b/src/components/Select.tsx index d956e28..0dcb2e3 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -593,7 +593,7 @@ export const Selects = { }); res?.data?.map((l: any) => { l.label = l.id + ':' + l.name; - l.value = l.house_meter_has_houses[0].asset_houses_id; + l.value = l.id; }); return res?.data; }, diff --git a/src/gen/ApiTypes.d.ts b/src/gen/ApiTypes.d.ts index 67827a0..72ac280 100644 --- a/src/gen/ApiTypes.d.ts +++ b/src/gen/ApiTypes.d.ts @@ -5,6 +5,7 @@ declare namespace ApiTypes { "title"?: string; // 模糊搜索:名称 "status"?: string; // 状态,[enum:ActivitiesStatusEnum] "publish_status"?: string; // 发布状态,[enum:ActivitiesPublishStatusEnum] + "asset_projects_id"?: number; // 项目ID,[ref:asset_projects] }; type Store = { "title": string; // 活动标题 @@ -1307,7 +1308,7 @@ declare namespace ApiTypes { namespace HouseOrder { namespace HouseOrderPayments { type List = { - "house_orders_id": number; // 订单ID + "house_orders_id"?: number; // 订单ID "payment_no"?: string; // 模糊搜索:支付单号 "transaction_id"?: string; // 模糊搜索:交易号(微信、支付宝的单号 "third_trade_no"?: string; // 第三方交易号(如通联、乐刷) @@ -1358,6 +1359,9 @@ declare namespace ApiTypes { type Delete = { "id": number; // id }; + type Import = { + "upload_file"?: mimes:xlsx,xls; // 上传的时候必填文件 + }; } namespace HouseMeterReadings { type List = { @@ -1441,6 +1445,7 @@ declare namespace ApiTypes { "asset_projects_id"?: number; // 项目id,[ref:asset_projects] "project_name"?: string; // 模糊搜索:项目名称 "charge_standards_id"?: number; // 房屋收费标准id,[ref:house_charge_standards] + "meter_type"?: string; // 仪表类型,[enum:HouseMetersMeterTypeEnum] }; type Store = { "asset_projects_id": number; // 项目id,[ref:asset_projects] diff --git a/src/gen/Apis.ts b/src/gen/Apis.ts index 3de29c3..bc405aa 100644 --- a/src/gen/Apis.ts +++ b/src/gen/Apis.ts @@ -773,7 +773,7 @@ export const Apis = { }, HouseOrder: { HouseOrderPayments: { - List(data: ApiTypes.HouseOrder.HouseOrderPayments.List): Promise { + List(data?: ApiTypes.HouseOrder.HouseOrderPayments.List): Promise { return request('admin/house_order/house_order_payments/list', { data }); }, Show(data: ApiTypes.HouseOrder.HouseOrderPayments.Show): Promise { @@ -815,6 +815,12 @@ export const Apis = { Delete(data: ApiTypes.Meter.HouseMeterHasHouses.Delete): Promise { return request('admin/meter/house_meter_has_houses/delete', { data }); }, + Import(data?: ApiTypes.Meter.HouseMeterHasHouses.Import): Promise { + return request('admin/meter/house_meter_has_houses/import', { data }); + }, + DownloadTemplate(): Promise { + return request('admin/meter/house_meter_has_houses/download_template', {responseType: 'blob',}); + }, }, HouseMeterReadings: { List(data: ApiTypes.Meter.HouseMeterReadings.List): Promise { diff --git a/src/gen/Enums.ts b/src/gen/Enums.ts index 4478ebb..10a594f 100644 --- a/src/gen/Enums.ts +++ b/src/gen/Enums.ts @@ -154,7 +154,7 @@ export const BannersTypeEnum= { // 缓存类型 export const CacheTypeEnum= { - 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#dc15e2","value":"MobilePhoneVerificationCode"}, + 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#7db989","value":"MobilePhoneVerificationCode"}, }; // CompaniesMerchantTypeEnum diff --git a/src/pages/asset/activities/index.tsx b/src/pages/asset/activities/index.tsx index 43ac5cf..6e6ad53 100644 --- a/src/pages/asset/activities/index.tsx +++ b/src/pages/asset/activities/index.tsx @@ -100,13 +100,13 @@ export default function Index({ title = '项目活动' }) { render: (_, item: any, index, action) => ( - {(!item.end_time || new Date(item.end_time) > new Date()) && ( - - )} + {/* {(!item.end_time || new Date(item.end_time) > new Date()) && ( + )} */} + {/* {(!item.end_time || new Date(item.end_time) > new Date()) && ( getShow()} node={ diff --git a/src/pages/charge/tasks/modals/TaskShow.tsx b/src/pages/charge/tasks/modals/TaskShow.tsx index 9237658..9e664dc 100644 --- a/src/pages/charge/tasks/modals/TaskShow.tsx +++ b/src/pages/charge/tasks/modals/TaskShow.tsx @@ -11,7 +11,7 @@ import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; -export default function AssetInfo(props: MyBetaModalFormProps) { +export default function TaskShow(props: MyBetaModalFormProps) { const navigate = useNavigate(); return ( ( @@ -64,6 +64,7 @@ export default function AssetInfo(props: MyBetaModalFormProps) { '0', )}`; }, + search: false, }, { title: '计费周期', diff --git a/src/pages/complaint/components/WorkLogsCreate.tsx b/src/pages/complaint/components/WorkLogsCreate.tsx new file mode 100644 index 0000000..da6119e --- /dev/null +++ b/src/pages/complaint/components/WorkLogsCreate.tsx @@ -0,0 +1,82 @@ +import { + MyButtons, + MyFormItems, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { HouseWorkOrdersStatusEnum } from '@/gen/Enums'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +interface WorkLogsCreateProps { + workOrderId: number; + reload?: () => void; +} + +export default function WorkLogsCreate({ + workOrderId, + reload, +}: WorkLogsCreateProps) { + const [form] = Form.useForm(); + + return ( + + {...MyModalFormProps.props} + title={`添加处理记录`} + wrapperCol={{ span: 24 }} + width="600px" + trigger={} + onOpenChange={(open: any) => { + if (open) { + form.resetFields(); // 清空表单数据 + } + }} + key={new Date().getTime()} + form={form} + onFinish={async (values) => { + try { + await Apis.WorkOrder.HouseWorkLogs.Store({ + ...values, + house_work_orders_id: workOrderId, + }); + reload?.(); + message.success('添加处理记录成功'); + return true; + } catch (error) { + message.error('添加处理记录失败'); + return false; + } + }} + columns={[ + MyFormItems.EnumRadio({ + key: 'status', + title: '工单状态', + colProps: { span: 24 }, + valueEnum: HouseWorkOrdersStatusEnum, + required: true, + formItemProps: { ...rulesHelper.text }, + }), + { + key: 'description', + title: '进度描述', + valueType: 'textarea', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + fieldProps: { + rows: 4, + placeholder: '请输入处理进度描述', + }, + }, + MyFormItems.UploadImages({ + key: 'attachments', + title: '相关图片', + uploadType: 'file', + max: 5, + colProps: { span: 24 }, + formItemProps: { required: false }, + }), + ]} + /> + ); +} diff --git a/src/pages/complaint/components/WorkLogsLIst.tsx b/src/pages/complaint/components/WorkLogsLIst.tsx new file mode 100644 index 0000000..1cdf755 --- /dev/null +++ b/src/pages/complaint/components/WorkLogsLIst.tsx @@ -0,0 +1,143 @@ +import { MyButtons, MyColumns, MyProTableProps } from '@/common'; +import { Apis } from '@/gen/Apis'; +import { HouseWorkOrdersStatusEnum } from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { Image, Space } from 'antd'; +import { useEffect, useRef } from 'react'; +import WorkLogsCreate from './WorkLogsCreate'; + +interface WorkLogsListProps { + workOrderId: number; + reload?: () => void; +} + +export default function WorkLogsList({ + workOrderId, + reload, +}: WorkLogsListProps) { + const actionRef = useRef(); + + useEffect(() => { + actionRef?.current?.reload(); + }, [workOrderId]); + + return ( + <> + > + {...MyProTableProps.props} + actionRef={actionRef} + request={async (params, sort) => + MyProTableProps.request( + { + ...params, + house_work_orders_id: workOrderId, + }, + sort, + Apis.WorkOrder.HouseWorkLogs.List, + ) + } + toolBarRender={(action) => [ + { + action?.reload(); + reload?.(); + }} + />, + ]} + search={false} + pagination={{ + pageSize: 10, + showSizeChanger: false, + }} + columns={[ + MyColumns.ID(), + MyColumns.EnumTag({ + title: '工单状态', + dataIndex: 'status', + valueEnum: HouseWorkOrdersStatusEnum, + search: false, + }), + { + title: '进度描述', + dataIndex: 'description', + search: false, + ellipsis: true, + }, + + { + title: '附件', + dataIndex: 'attachments', + search: false, + render: (_, record) => { + if ( + !Array.isArray(record.attachments) || + record.attachments.length === 0 + ) { + return '无附件'; + } + return ( +
+ {record.attachments.map((item: any, index: number) => { + if (item.type && item.type.includes('image')) { + return ( + + ); + } else if (item.type && item.type.includes('video')) { + return ( +
+ ); + }, + }, + { + title: '创建时间', + dataIndex: 'created_at', + valueType: 'dateTime', + search: false, + width: 160, + }, + MyColumns.UpdatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + Apis.WorkOrder.HouseWorkLogs.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/complaint/index.tsx b/src/pages/complaint/index.tsx new file mode 100644 index 0000000..77fb8ec --- /dev/null +++ b/src/pages/complaint/index.tsx @@ -0,0 +1,184 @@ +import { + MyButtons, + MyColumns, + MyPageContainer, + MyProTableProps, + usePageTabs, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { + HouseWorkOrdersAssignStatusEnum, + HouseWorkOrdersLevelEnum, + HouseWorkOrdersStatusEnum, + HouseWorkOrdersTypeEnum, +} from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Image, Space } from 'antd'; +import ComplaintAssign from './modals/ComplaintAssign'; + +import ComplaintShow from './modals/ComplaintShow'; + +export default function Index({ title = '投诉列表' }) { + const navigate = useNavigate(); + + // 注册当前页面为标签页 + usePageTabs({ + tabKey: 'complaint', + tabLabel: title, + }); + + return ( + + + MyProTableProps.request( + { ...params, type: HouseWorkOrdersTypeEnum.Complaint.value }, + sort, + Apis.WorkOrder.HouseWorkOrders.List, + ) + } + // toolBarRender={(action) => [ + // , + // ]} + columns={[ + MyColumns.ID(), + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'status', + valueEnum: HouseWorkOrdersStatusEnum, + }), + { + title: '描述', + dataIndex: 'content', + width: 120, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽) + search: false, + render: (text) => ( +
+ {text} +
+ ), + }, + { + title: '附件', + dataIndex: 'attachments', + search: false, + render: (_, record) => { + if ( + !Array.isArray(record.attachments) || + record.attachments.length === 0 + ) { + return '无附件'; + } + return ( +
+ {record.attachments.map((item: any, index: number) => { + if (item.type && item.type.includes('image')) { + return ( + + ); + } else if (item.type && item.type.includes('video')) { + return ( +
+ ); + }, + }, + MyColumns.EnumTag({ + title: '分配状态', + dataIndex: 'assign_status', + valueEnum: HouseWorkOrdersAssignStatusEnum, + }), + MyColumns.EnumTag({ + title: '优先级', + dataIndex: 'level', + valueEnum: HouseWorkOrdersLevelEnum, + }), + { + title: '处理人', + dataIndex: ['assign_employee', 'name'], + search: false, + render: (_, record) => { + return `${record?.assign_employee?.name || ''}-${ + record?.assign_employee?.phone || '' + }`; + }, + }, + MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + + {item.assign_status === 'Unassigned' && ( + + )} + + + Apis.WorkOrder.HouseWorkOrders.SoftDelete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> +
+ ); +} diff --git a/src/pages/complaint/modals/ComplaintAssign.tsx b/src/pages/complaint/modals/ComplaintAssign.tsx new file mode 100644 index 0000000..301e096 --- /dev/null +++ b/src/pages/complaint/modals/ComplaintAssign.tsx @@ -0,0 +1,88 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyFormItems, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Selects } from '@/components/Select'; +import { Apis } from '@/gen/Apis'; +import { HouseWorkOrdersLevelEnum } from '@/gen/Enums'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +export default function WorkOrderAssign( + props: MyBetaModalFormProps & { item: any }, +) { + const [form] = Form.useForm(); + return ( + + {...MyModalFormProps.props} + title={`派发工单`} + wrapperCol={{ span: 24 }} + width="500px" + trigger={} + key={new Date().getTime()} + form={form} + request={async () => { + const res = await Apis.WorkOrder.HouseWorkOrders.Show({ + id: props.item.id, + }); + return { + title: res.data.title, + assign_employee_id: res.data.assign_employee_id, + }; + }} + onFinish={async (values) => + Apis.WorkOrder.HouseWorkOrders.Assign({ + ...values, + id: props.item.id, + }) + .then(() => { + props.reload?.(); + message.success('指派工单成功'); + return true; + }) + .catch(() => false) + } + columns={[ + { + key: 'content', + title: '工单描述', + colProps: { span: 24 }, + readonly: true, + fieldProps: { + disabled: true, + }, + }, + MyFormItems.EnumRadio({ + key: 'level', + title: '优先级', + colProps: { span: 24 }, + valueEnum: HouseWorkOrdersLevelEnum, + required: true, + }), + Selects?.Employees({ + title: '选择处理人', + key: 'assign_employees_id', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + params: { + companies_id: props.item.companies_id, + }, + required: true, + }), + { + key: 'assign_remark', + title: '指派备注', + valueType: 'textarea', + colProps: { span: 24 }, + fieldProps: { + rows: 3, + placeholder: '请输入指派备注(可选)', + }, + }, + ]} + /> + ); +} diff --git a/src/pages/complaint/modals/ComplaintShow.tsx b/src/pages/complaint/modals/ComplaintShow.tsx new file mode 100644 index 0000000..2f0f936 --- /dev/null +++ b/src/pages/complaint/modals/ComplaintShow.tsx @@ -0,0 +1,251 @@ +import { MyButtons } from '@/common'; +import { Apis } from '@/gen/Apis'; +import { + HouseWorkOrdersAssignStatusEnum, + HouseWorkOrdersLevelEnum, + HouseWorkOrdersStatusEnum, +} from '@/gen/Enums'; +import { ProDescriptions } from '@ant-design/pro-components'; +import { Image, Modal, Space, Tag } from 'antd'; +import { useState } from 'react'; +import WorkLogsList from '../components/WorkLogsLIst'; +import WorkOrderAssign from './ComplaintAssign'; + +interface WorkOrderShowProps { + item: any; + title?: string; + reload?: () => void; +} + +export default function ComplaintShow({ + item, + title = '投诉详情', + reload, +}: WorkOrderShowProps) { + const [open, setOpen] = useState(false); + const [data, setData] = useState(null); + + const handleOpen = async () => { + try { + const res = await Apis.WorkOrder.HouseWorkOrders.Show({ id: item.id }); + setData(res.data); + setOpen(true); + } catch (error) { + console.error('获取投诉详情失败:', error); + } + }; + + return ( + <> + + setOpen(false)} + footer={null} + width={800} + > + {data && ( + <> + ( + // + // {HouseWorkOrdersTypeEnum[ + // record.type as keyof typeof HouseWorkOrdersTypeEnum + // ]?.text || record.type} + // + // ), + // }, + // { + // title: '报修位置', + // dataIndex: 'location', + // span: 1, + // render: (_, record) => { + // const locationConfig = + // HouseWorkOrdersLocationEnum[ + // record.location as keyof typeof HouseWorkOrdersLocationEnum + // ]; + + // return {locationConfig?.text || record.location}; + // }, + // }, + + { + title: 'ID', + dataIndex: 'id', + span: 1, + }, + + { + title: '投诉描述', + dataIndex: 'content', + span: 2, + }, + + { + title: '投诉状态', + dataIndex: 'status', + span: 1, + render: (_, record) => { + const statusConfig = + HouseWorkOrdersStatusEnum[ + record.status as keyof typeof HouseWorkOrdersStatusEnum + ]; + const color = + record.status === 'Completed' + ? 'green' + : record.status === 'InProgress' + ? 'blue' + : 'default'; + return ( + + {statusConfig?.text || record.status} + + ); + }, + }, + { + title: '分配状态', + dataIndex: 'assign_status', + span: 1, + render: (_, record) => { + const assignConfig = + HouseWorkOrdersAssignStatusEnum[ + record.assign_status as keyof typeof HouseWorkOrdersAssignStatusEnum + ]; + const color = + record.assign_status === 'Assigned' ? 'green' : 'orange'; + return ( + + {assignConfig?.text || record.assign_status} + + ); + }, + }, + { + title: '优先级', + dataIndex: 'level', + span: 1, + render: (_, record) => { + const levelConfig = + HouseWorkOrdersLevelEnum[ + record.level as keyof typeof HouseWorkOrdersLevelEnum + ]; + return {levelConfig?.text || record.level}; + }, + }, + { + title: '处理人', + dataIndex: 'assign_employee_name', + span: 1, + render: (_, record) => { + const assigneeInfo = record?.assign_employee + ? `${record.assign_employee.name || ''}-${ + record.assign_employee.phone || '' + }` + : '未分配'; + return ( + + {assigneeInfo} + + + ); + }, + }, + + { + title: '创建时间', + dataIndex: 'created_at', + span: 1, + valueType: 'dateTime', + }, + { + title: '更新时间', + dataIndex: 'updated_at', + span: 1, + valueType: 'dateTime', + }, + { + title: '相关附件', + dataIndex: 'attachments', + span: 2, + render: (_, record) => { + // 检查attachments是否为数组且有数据 + if ( + !Array.isArray(record.attachments) || + record.attachments.length === 0 + ) { + return '无附件'; + } + return ( +
+ {record.attachments.map((item: any, index: number) => { + if (item.type && item.type.includes('image')) { + return ( + + ); + } else if (item.type && item.type.includes('video')) { + return ( +
+ ); + }, + }, + ]} + /> + {/* 处理记录 */} + { + handleOpen(); + reload?.(); + }} + /> + + )} +
+ + ); +} diff --git a/src/pages/meter/list/index.tsx b/src/pages/meter/list/index.tsx index c40dd5c..9e1a94b 100644 --- a/src/pages/meter/list/index.tsx +++ b/src/pages/meter/list/index.tsx @@ -44,13 +44,22 @@ export default function Index({ title = '仪表管理' }) { toolBarRender={(action) => [ , + , , ]} columns={[ diff --git a/src/pages/meter/readings/show/$id.tsx b/src/pages/meter/readings/show/$id.tsx index cef7e4e..8178d99 100644 --- a/src/pages/meter/readings/show/$id.tsx +++ b/src/pages/meter/readings/show/$id.tsx @@ -7,6 +7,7 @@ import { useEffect, useState } from 'react'; import MeteInfo from '../components/MeteInfo'; import HasHouse from '../table/HasHouse'; import ReadingLIst from '../table/ReadingLIst'; +import Tasks from '../table/Tasks'; export default function Show({ title = '仪表详情' }) { const { id } = useParams<{ id: string }>(); @@ -58,6 +59,12 @@ export default function Show({ title = '仪表详情' }) { closable: false, children: , }, + { + label: '仪表任务', + key: '3', + closable: false, + children: , + }, ]; return ( diff --git a/src/pages/meter/readings/table/HasHouse.tsx b/src/pages/meter/readings/table/HasHouse.tsx index f8aeb0e..075229c 100644 --- a/src/pages/meter/readings/table/HasHouse.tsx +++ b/src/pages/meter/readings/table/HasHouse.tsx @@ -10,7 +10,6 @@ import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; import MeterHasHouse from '../../list/modals/MeterHasHouse'; import MeterHasOne from '../../list/modals/MeterHasOne'; -import NormalReading from '../modals/NormalReading'; export default function Index(props: MyBetaModalFormProps) { return ( @@ -25,12 +24,6 @@ export default function Index(props: MyBetaModalFormProps) { ) } toolBarRender={(action) => [ - , ...(props?.item?.meter_type === HouseMetersMeterTypeEnum.HouseMeter.value ? [ diff --git a/src/pages/meter/readings/table/Tasks.tsx b/src/pages/meter/readings/table/Tasks.tsx new file mode 100644 index 0000000..dd08fd6 --- /dev/null +++ b/src/pages/meter/readings/table/Tasks.tsx @@ -0,0 +1,111 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyColumns, + MyProTableProps, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Space } from 'antd'; + +export default function Index(props: MyBetaModalFormProps) { + const navigate = useNavigate(); + return ( + <> + + MyProTableProps.request( + { ...params, id: props?.item?.id }, + sort, + Apis.Meter.HouseMeterTaskDetails.List, + ) + } + // toolBarRender={(action) => [ + // , + // , + // ]} + // search={false} + // options={false} + columns={[ + MyColumns.ID(), + { + title: '仪表名称', + dataIndex: ['meter_data', 'name'], + search: false, + }, + { + title: '关联房屋', + dataIndex: 'full_name', + search: false, + render: (_, record) => ( + { + navigate(`/bills/summary/show/${record.asset_houses_id}`); + }} + /> + ), + }, + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'status', + valueEnum: HouseChargeTaskDetailsStatusEnum, + }), + + { + title: '收费标准', + dataIndex: ['charge_standard', 'name'], + render: (_, record) => { + return `【${record.charge_standard.id}】${record.charge_standard.name}`; + }, + search: false, + }, + { + title: '账单月份', + render: (_, record) => { + return `${record.year}-${String(record.month).padStart(2, '0')}`; + }, + search: false, + }, + { + title: '完成时间', + dataIndex: 'processed_time', + search: false, + }, + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + Apis.HouseCharage.HouseChargeTaskDetails.CreateHouseBill({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/meter/tasks/index.tsx b/src/pages/meter/tasks/index.tsx index 42c09d1..27ecb12 100644 --- a/src/pages/meter/tasks/index.tsx +++ b/src/pages/meter/tasks/index.tsx @@ -95,7 +95,6 @@ export default function Index({ title = '仪表账单' }) { render: (_, item: any, index, action) => ( - ( + { + navigate(`/bills/summary/show/${record.asset_houses_id}`); + }} + /> + ), }, MyColumns.EnumTag({ title: '状态', @@ -35,7 +58,10 @@ export default function AssetInfo(props: MyBetaModalFormProps) { { title: '收费标准', - dataIndex: ['house_charge_task', 'house_charge_standard', 'name'], + dataIndex: ['charge_standard', 'name'], + render: (_, record) => { + return `【${record.charge_standard.id}】${record.charge_standard.name}`; + }, search: false, }, { @@ -46,14 +72,6 @@ export default function AssetInfo(props: MyBetaModalFormProps) { '0', )}`; }, - }, - { - title: '计费周期', - render: (_, record) => { - return `${record.house_charge_task.start_date} 至 ${String( - record.house_charge_task.end_date, - ).padStart(2, '0')}`; - }, search: false, }, { @@ -61,6 +79,24 @@ export default function AssetInfo(props: MyBetaModalFormProps) { dataIndex: 'processed_time', search: false, }, + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + Apis.HouseCharage.HouseChargeTaskDetails.CreateHouseBill({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), ]} /> } diff --git a/src/pages/order/index.tsx b/src/pages/order/list/index.tsx similarity index 71% rename from src/pages/order/index.tsx rename to src/pages/order/list/index.tsx index 51cca7e..c47e1db 100644 --- a/src/pages/order/index.tsx +++ b/src/pages/order/list/index.tsx @@ -1,4 +1,5 @@ import { + MyButtons, MyColumns, MyPageContainer, MyProTableProps, @@ -10,8 +11,10 @@ import { HouseOrdersPaymentMethodEnum, } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; +import { Space } from 'antd'; +import Payments from './modals/Payments'; -export default function Index({ title = '支付明细' }) { +export default function Index({ title = '支付订单' }) { // 注册当前页面为标签页 usePageTabs({ tabKey: 'house_order', @@ -44,10 +47,10 @@ export default function Index({ title = '支付明细' }) { // importApi={Apis.Bill.HouseBills.Import} // reload={action?.reload} // />, - // , // ]} columns={[ - // MyColumns.ID(), + MyColumns.ID(), + { title: '订单号', dataIndex: 'order_code', @@ -63,32 +66,22 @@ export default function Index({ title = '支付明细' }) { dataIndex: 'order_status', valueEnum: HouseOrdersOrderStatusEnum, }), - - // { - // title: '支付单号', - // dataIndex: 'payment_no', - // search: false, - // }, { title: '应收金额', + dataIndex: 'amount', + search: false, + }, + { + title: '实收金额', dataIndex: 'actual_paid_amount', search: false, }, { - title: '滞纳金', - dataIndex: 'late_fee', - search: false, - }, - { - title: '退款总金额', + title: '退款金额', dataIndex: 'refund_amount', search: false, }, - { - title: '实缴金额', - dataIndex: 'actual_paid_amount', - search: false, - }, + { title: '收款账号', dataIndex: ['house_order_items', 'receipt_account'], @@ -114,20 +107,20 @@ export default function Index({ title = '支付明细' }) { }, // MyColumns.CreatedAt(), - // MyColumns.Option({ - // render: (_, item: any, index, action) => ( - // - // - // - // Apis.Common.Admins.Delete({ id: item.id }).then(() => - // action?.reload(), - // ) - // } - // /> - // - // ), - // }), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + + Apis.Common.Admins.Delete({ id: item.id }).then(() => + action?.reload(), + ) + } + /> + + ), + }), ]} />
diff --git a/src/pages/order/list/modals/Payments.tsx b/src/pages/order/list/modals/Payments.tsx new file mode 100644 index 0000000..7038b7e --- /dev/null +++ b/src/pages/order/list/modals/Payments.tsx @@ -0,0 +1,79 @@ +import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common'; +import { MyModal } from '@/components/MyModal'; +import { Apis } from '@/gen/Apis'; +import { + HouseOrdersOrderStatusEnum, + HouseOrdersPaymentMethodEnum, +} from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; + +export default function TaskShow(props: MyBetaModalFormProps) { + const navigate = useNavigate(); + return ( + + MyProTableProps.request( + { ...params, house_orders_id: props?.item?.id }, + sort, + Apis.HouseOrder.HouseOrderPayments.List, + ) + } + // options={false} + columns={[ + MyColumns.ID(), + MyColumns.EnumTag({ + title: '支付状态', + dataIndex: 'payment_status', + valueEnum: HouseOrdersOrderStatusEnum, + }), + MyColumns.EnumTag({ + title: '支付方式', + dataIndex: 'payment_method', + valueEnum: HouseOrdersPaymentMethodEnum, + }), + { + title: '账单金额', + dataIndex: 'amount', + render: (value: any) => `${value / 100}元`, + search: false, + }, + { + title: '实际金额', + dataIndex: 'actual_amount', + render: (value: any) => `${value / 100}元`, + search: false, + }, + + { + title: '支付人', + render: (record: any) => + `${record?.customer?.name || ''}${ + record?.customer?.phone || '' + }`, + + search: false, + }, + { + title: '备注', + dataIndex: 'remark', + search: false, + }, + { + title: '支付单号', + dataIndex: 'payment_no', + search: false, + }, + MyColumns.UpdatedAt(), + ]} + /> + } + /> + ); +} diff --git a/src/pages/order/payments/index.tsx b/src/pages/order/pay/index.tsx similarity index 55% rename from src/pages/order/payments/index.tsx rename to src/pages/order/pay/index.tsx index e29c361..606ba55 100644 --- a/src/pages/order/payments/index.tsx +++ b/src/pages/order/pay/index.tsx @@ -5,6 +5,10 @@ import { usePageTabs, } from '@/common'; import { Apis } from '@/gen/Apis'; +import { + HouseOrdersOrderStatusEnum, + HouseOrdersPaymentMethodEnum, +} from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; export default function Index({ title = '支付明细' }) { @@ -18,7 +22,7 @@ export default function Index({ title = '支付明细' }) { , - // , // ]} columns={[ MyColumns.ID(), { - title: '房屋', - dataIndex: ['asset_house', 'full_name'], - search: { - transform: (value) => { - return { full_name: value }; - }, - }, + title: '支付订单', + dataIndex: 'house_orders_id', + search: false, + }, + MyColumns.EnumTag({ + title: '支付状态', + dataIndex: 'payment_status', + valueEnum: HouseOrdersOrderStatusEnum, + }), + MyColumns.EnumTag({ + title: '支付方式', + dataIndex: 'payment_method', + valueEnum: HouseOrdersPaymentMethodEnum, + }), + { + title: '账单金额', + dataIndex: 'amount', + render: (value: any) => `${value / 100}元`, + search: false, + }, + { + title: '实际金额', + dataIndex: 'actual_amount', + render: (value: any) => `${value / 100}元`, + search: false, + }, + + { + title: '支付人', + render: (record: any) => + `${record?.customer?.name || ''}${record?.customer?.phone || ''}`, + + search: false, + }, + { + title: '备注', + dataIndex: 'remark', + search: false, }, { title: '支付单号', dataIndex: 'payment_no', search: false, }, - { - title: '交易单号', - dataIndex: 'transaction_id', - search: false, - }, - { - title: '第三方交易号', - dataIndex: 'hird_trade_no', - search: false, - }, - MyColumns.CreatedAt(), - // MyColumns.Option({ - // render: (_, item: any, index, action) => ( - // - // - // - // Apis.Common.Admins.Delete({ id: item.id }).then(() => - // action?.reload(), - // ) - // } - // /> - // - // ), - // }), + MyColumns.UpdatedAt(), ]} /> From 092888fe192d3c19bf3e07e861713f4d90c4667f Mon Sep 17 00:00:00 2001 From: uiuJun <> Date: Thu, 9 Oct 2025 20:30:37 +0800 Subject: [PATCH 6/6] =?UTF-8?q?feat=EF=BC=9A=E4=BB=AA=E8=A1=A8=E8=B4=A6?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/meter/bills/index.tsx | 111 ++++++++++++++++++++++++++++++++ src/pages/meter/tasks/index.tsx | 2 +- 2 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 src/pages/meter/bills/index.tsx diff --git a/src/pages/meter/bills/index.tsx b/src/pages/meter/bills/index.tsx new file mode 100644 index 0000000..71e84fe --- /dev/null +++ b/src/pages/meter/bills/index.tsx @@ -0,0 +1,111 @@ +import { + MyButtons, + MyColumns, + MyPageContainer, + MyProTableProps, + usePageTabs, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Space } from 'antd'; + +export default function Index({ title = '仪表账单' }) { + const navigate = useNavigate(); + + // 注册当前页面为标签页 + usePageTabs({ + tabKey: 'house_meter_bills', + tabLabel: title, + }); + + return ( + + + MyProTableProps.request( + params, + sort, + Apis.Meter.HouseMeterTaskDetails.List, + ) + } + // toolBarRender={(action) => [ + // , + // ]} + columns={[ + MyColumns.ID(), + { + title: '仪表名称', + dataIndex: ['meter_data', 'name'], + search: false, + }, + { + title: '关联房屋', + dataIndex: 'full_name', + search: false, + render: (_, record) => ( + { + navigate(`/bills/summary/show/${record.asset_houses_id}`); + }} + /> + ), + }, + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'status', + valueEnum: HouseChargeTaskDetailsStatusEnum, + }), + + { + title: '收费标准', + dataIndex: ['charge_standard', 'name'], + render: (_, record) => { + return `【${record.charge_standard.id}】${record.charge_standard.name}`; + }, + search: false, + }, + { + title: '账单月份', + render: (_, record) => { + return `${record.year}-${String(record.month).padStart(2, '0')}`; + }, + search: false, + }, + { + title: '完成时间', + dataIndex: 'processed_time', + search: false, + }, + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + Apis.HouseCharage.HouseChargeTaskDetails.CreateHouseBill({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/meter/tasks/index.tsx b/src/pages/meter/tasks/index.tsx index 27ecb12..91cff32 100644 --- a/src/pages/meter/tasks/index.tsx +++ b/src/pages/meter/tasks/index.tsx @@ -15,7 +15,7 @@ import { Space } from 'antd'; import TaskCreate from './modals/TaskCreate'; import TaskShow from './modals/TaskShow'; -export default function Index({ title = '仪表账单' }) { +export default function Index({ title = '仪表任务' }) { // 注册当前页面为标签页 usePageTabs({ tabKey: 'house_meter_tasks',