From 16719bf5fd8e6f35b15c545ad34ff5f8f7603d7b Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 27 Apr 2026 10:37:21 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=9B=B4=E6=96=B0BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gen/ApiTypes.d.ts | 18 +- src/gen/Apis.ts | 20 + src/gen/Enums.ts | 2 +- src/pages/asset/grids/modals/GridCreate.tsx | 2 +- .../bills/house_bills/modals/BillRefund.tsx | 5 +- src/pages/contract/contract_borrows/index.tsx | 292 +++++++------- src/pages/quality/emergency/index.tsx | 312 +++++++------- src/pages/quality/renovation/index.tsx | 380 +++++++++--------- .../managers/modals/ManagersCreate.tsx | 20 +- 9 files changed, 556 insertions(+), 495 deletions(-) diff --git a/src/gen/ApiTypes.d.ts b/src/gen/ApiTypes.d.ts index 9684a94..49d8b40 100644 --- a/src/gen/ApiTypes.d.ts +++ b/src/gen/ApiTypes.d.ts @@ -510,6 +510,11 @@ declare namespace ApiTypes { "company_employees_id": number; // 员工id,[ref:company_employees] "type": string; // 类型,[enum:HouseWorkOrdersTypeEnum] }; + type BatchStore = { + "asset_projects_id": number; // 项目id,[ref:asset_projects] + "company_employees_id": number; // 员工id,[ref:company_employees] + "types": string[]; // 类型数组 + }; type Show = { "id": number; // id }; @@ -925,7 +930,8 @@ declare namespace ApiTypes { "has_overdue"?: boolean; // 是否欠费:true-欠费, false-清欠 }; type Store = { - "asset_houses_id": number; // 资产房屋id,[ref:asset_houses] + "asset_houses_id"?: number; // 资产房屋id,[ref:asset_houses](与asset_car_ports_id互斥) + "asset_car_ports_id"?: number; // 车位ID,[ref:asset_car_ports](与asset_houses_id互斥) "company_receipt_accounts_id": number; // 公司收款账户id,[ref:company_receipt_accounts] "type": string; // 账单类型,[enum:HouseBillsTypeEnum] "amount": number; // 金额 @@ -940,6 +946,7 @@ declare namespace ApiTypes { }; type Update = { "id": number; // id + "asset_car_ports_id"?: number; // 车位ID,[ref:asset_car_ports] "company_receipt_accounts_id": number; // 公司收款账户id,[ref:company_receipt_accounts] "type": string; // 账单类型,[enum:HouseBillsTypeEnum] "amount": number; // 金额 @@ -3785,6 +3792,15 @@ declare namespace ApiTypes { namespace Statistics { namespace ContractsCount { } + namespace HouseBillsCount { + type PaidAmountTrend = { + "start_date"?: Date; // 开始日期(可选,默认6个月前) + "end_date"?: Date; // 结束日期(可选,默认今天) + }; + type ClearCache = { + "type"?: string; // 缓存类型 + }; + } namespace IndexCount { } } diff --git a/src/gen/Apis.ts b/src/gen/Apis.ts index afdc650..bbf7f8a 100644 --- a/src/gen/Apis.ts +++ b/src/gen/Apis.ts @@ -270,6 +270,9 @@ export const Apis = { Store(data: ApiTypes.Asset.AssetProjectAdmins.Store): Promise { return request('company/asset/asset_project_admins/store', { data }); }, + BatchStore(data: ApiTypes.Asset.AssetProjectAdmins.BatchStore): Promise { + return request('company/asset/asset_project_admins/batch_store', { data }); + }, Show(data: ApiTypes.Asset.AssetProjectAdmins.Show): Promise { return request('company/asset/asset_project_admins/show', { data }); }, @@ -2085,6 +2088,23 @@ export const Apis = { return request('company/statistics/contracts_count/clear_cache', {}); }, }, + HouseBillsCount: { + OverviewStatistics(): Promise { + return request('company/statistics/house_bills_count/overview_statistics', {}); + }, + ProjectDataByMonth(): Promise { + return request('company/statistics/house_bills_count/project_data_by_month', {}); + }, + PaidAmountTrend(data?: ApiTypes.Statistics.HouseBillsCount.PaidAmountTrend): Promise { + return request('company/statistics/house_bills_count/paid_amount_trend', { data }); + }, + ProjectPaymentRanking(): Promise { + return request('company/statistics/house_bills_count/project_payment_ranking', {}); + }, + ClearCache(data?: ApiTypes.Statistics.HouseBillsCount.ClearCache): Promise { + return request('company/statistics/house_bills_count/clear_cache', { data }); + }, + }, IndexCount: { FinancialAnalysis(): Promise { return request('company/statistics/index_count/financial_analysis', {}); diff --git a/src/gen/Enums.ts b/src/gen/Enums.ts index a03a32f..6c82b8b 100644 --- a/src/gen/Enums.ts +++ b/src/gen/Enums.ts @@ -333,7 +333,7 @@ export const BillsStatusEnum= { // 缓存类型 export const CacheTypeEnum= { - 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#32265e","value":"MobilePhoneVerificationCode"}, + 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#f33535","value":"MobilePhoneVerificationCode"}, }; // CompaniesMerchantTypeEnum diff --git a/src/pages/asset/grids/modals/GridCreate.tsx b/src/pages/asset/grids/modals/GridCreate.tsx index 9435225..e8104cf 100644 --- a/src/pages/asset/grids/modals/GridCreate.tsx +++ b/src/pages/asset/grids/modals/GridCreate.tsx @@ -71,7 +71,7 @@ export default function Create(props: MyBetaModalFormProps) { key: 'grid_mark', title: '范围标识', params: { - asset_projects_id: projectId, + asset_projects_id: projectId || '', }, colProps: { span: 24 }, formItemProps: { ...rulesHelper.text }, diff --git a/src/pages/bills/house_bills/modals/BillRefund.tsx b/src/pages/bills/house_bills/modals/BillRefund.tsx index 6bcdcfa..7b77408 100644 --- a/src/pages/bills/house_bills/modals/BillRefund.tsx +++ b/src/pages/bills/house_bills/modals/BillRefund.tsx @@ -7,6 +7,7 @@ import { } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; +import { ApprovalTemplateNodesNodeTypeEnum } from '@/gen/Enums'; import { BetaSchemaForm } from '@ant-design/pro-components'; import { Form, message } from 'antd'; import { useState } from 'react'; @@ -22,7 +23,7 @@ export default function Update(props: MyBetaModalFormProps) { trigger={ } layout="horizontal" @@ -161,7 +162,7 @@ export default function Update(props: MyBetaModalFormProps) { MyFormItems.EnumSelect({ key: 'node_type', // title: `类型`, - // valueEnum: ApprovalTemplateNodesNodeTypeEnum, + valueEnum: ApprovalTemplateNodesNodeTypeEnum, colProps: { span: 5 }, formItemProps: { ...rulesHelper.text, diff --git a/src/pages/contract/contract_borrows/index.tsx b/src/pages/contract/contract_borrows/index.tsx index d6cd38a..6d5c6a3 100644 --- a/src/pages/contract/contract_borrows/index.tsx +++ b/src/pages/contract/contract_borrows/index.tsx @@ -1,6 +1,7 @@ import { MyButtons, MyColumns, + MyPageContainer, MyProTableProps, MyTableActions, MyToolBarActions, @@ -15,148 +16,159 @@ import Show from './modals/Show'; import Update from './modals/Update'; import Read from './read/modals/Read'; -export default function Index({ title = '合同借用' }) { +export default function Index({ title = '合同档案借用' }) { return ( - - MyProTableProps.request( - params, - sort, - Apis.Contract.ContractArchiveBorrows.List, - ) - } - headerTitle="合同借用列表" - toolBarRender={(action) => [ - , - read: , - }} - />, - ]} - columns={[ - MyColumns.ID({ - search: false, - }), - MyColumns.EnumTag({ - title: '借用状态', - dataIndex: 'borrow_status', - valueEnum: ContractArchiveBorrowStatusEnum, - }), - // MyColumns.EnumTag({ - // title: '归还状态', - // dataIndex: 'return_status', - // valueEnum: ContractArchiveFileReturnStatusEnum, - // }), - { - title: '档案编号', - dataIndex: ['contract_archive', 'code'], - render: (_, item: any) => ( - - ), - }, - { - title: '借用信息', - search: false, - render: (_, item: any) => { - if (!item?.contract_archive_borrow_files) { - return '-'; - } - return ( -
- {item.contract_archive_borrow_files.map( - (res: any, index: number) => ( -
- 文件: {res?.contract_archive_file?.name},借用: - {res?.contract_archive_file?.borrow_number},遗失: - {res?.contract_archive_file?.lost_number},损坏: - { - res?.contract_archive_file?.contract_archive_file - ?.lost_number - } - ,损坏: {res?.contract_archive_file?.damaged_number} -
- ), - )} -
- ); + + + MyProTableProps.request( + params, + sort, + Apis.Contract.ContractArchiveBorrows.List, + ) + } + headerTitle="合同借用列表" + toolBarRender={(action) => [ + + ), + read: ( + + ), + }} + />, + ]} + columns={[ + MyColumns.ID({ + search: false, + }), + MyColumns.EnumTag({ + title: '借用状态', + dataIndex: 'borrow_status', + valueEnum: ContractArchiveBorrowStatusEnum, + }), + // MyColumns.EnumTag({ + // title: '归还状态', + // dataIndex: 'return_status', + // valueEnum: ContractArchiveFileReturnStatusEnum, + // }), + { + title: '档案编号', + dataIndex: ['contract_archive', 'code'], + render: (_, item: any) => ( + + ), + }, + { + title: '借用信息', + search: false, + render: (_, item: any) => { + if (!item?.contract_archive_borrow_files) { + return '-'; + } + return ( +
+ {item.contract_archive_borrow_files.map( + (res: any, index: number) => ( +
+ 文件: {res?.contract_archive_file?.name},借用: + {res?.contract_archive_file?.borrow_number},遗失: + {res?.contract_archive_file?.lost_number},损坏: + { + res?.contract_archive_file?.contract_archive_file + ?.lost_number + } + ,损坏: {res?.contract_archive_file?.damaged_number} +
+ ), + )} +
+ ); + }, + }, + { + title: '借用人', + dataIndex: 'borrower_name', + search: false, + render: (_, item: any) => ( + + ), }, - }, - { - title: '借用人', - dataIndex: 'borrower_name', - search: false, - render: (_, item: any) => ( - - ), - }, - { - title: '借用日期', - dataIndex: 'borrow_date', - search: false, - }, - { - title: '应归还日期', - dataIndex: 'expected_return_date', - search: false, - }, - MyColumns.Boolean({ - title: '需要归还', - dataIndex: 'is_need_return', - search: false, - }), - { - title: '登记人', - dataIndex: ['registrar', 'name'], - search: false, - render: (_, item: any) => ( - - ), - }, - // MyColumns.CreatedAt(), - MyColumns.UpdatedAt(), - MyColumns.Option({ - width: 100, - render: (_, item: any, _index, action) => ( - - ), - record: ( - - Apis.Contract.ContractArchiveBorrows.Borrow({ - id: item.id, - }).then(() => action?.reload()) - } - /> - ), - update: ( - - ), - }} - /> - ), - }), - ]} - /> + { + title: '借用日期', + dataIndex: 'borrow_date', + search: false, + }, + { + title: '应归还日期', + dataIndex: 'expected_return_date', + search: false, + }, + MyColumns.Boolean({ + title: '需要归还', + dataIndex: 'is_need_return', + search: false, + }), + { + title: '登记人', + dataIndex: ['registrar', 'name'], + search: false, + render: (_, item: any) => ( + + ), + }, + // MyColumns.CreatedAt(), + MyColumns.UpdatedAt(), + MyColumns.Option({ + width: 100, + render: (_, item: any, _index, action) => ( + + ), + record: ( + + Apis.Contract.ContractArchiveBorrows.Borrow({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + update: ( + + ), + }} + /> + ), + }), + ]} + /> +
); } diff --git a/src/pages/quality/emergency/index.tsx b/src/pages/quality/emergency/index.tsx index cf7e487..7aec841 100644 --- a/src/pages/quality/emergency/index.tsx +++ b/src/pages/quality/emergency/index.tsx @@ -1,6 +1,7 @@ import { MyButtons, MyColumns, + MyPageContainer, MyProTableProps, MyTableActions, MyToolBarActions, @@ -22,157 +23,168 @@ export default function Index({ title = '突发事件' }) { const navigate = useNavigate(); return ( - - MyProTableProps.request( - params, - sort, - Apis.Emergency.EmergencyEvents.List, - ) - } - headerTitle={`${title}列表`} - toolBarRender={(action: any) => [ - - ), - teams: ( - { - navigate('/quality/emergency/teams'); - }} - title="应急小组" - /> - ), - categories: ( - { - navigate('/quality/emergency/categories'); - }} - title="事件分类" - /> - ), - levels: ( - { - navigate('/quality/emergency/levels'); - }} - title="级别配置" - /> - ), - }} - />, - ]} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '名称', - dataIndex: 'name', - }, - { - title: '所属项目', - dataIndex: ['asset_project', 'name'], - search: false, - }, - MyColumns.EnumTag({ - title: '状态', - dataIndex: 'status', - valueEnum: EmergencyEventsStatusEnum, - }), - MyColumns.EnumTag({ - title: '赔偿方', - dataIndex: 'compensation_type', - valueEnum: EmergencyEventsCompensationTypeEnum, - }), - { - title: '赔偿事项', - search: false, - render: (_, item: any) => { - return ( -
-
赔偿比例:{item?.compensation_rate}%
-
赔偿金额:{item?.compensation_amount}元
-
已支付赔偿金额:{item?.compensation_paid_amount}元
-
- ); + + + MyProTableProps.request( + params, + sort, + Apis.Emergency.EmergencyEvents.List, + ) + } + headerTitle={`${title}列表`} + toolBarRender={(action: any) => [ + + ), + teams: ( + { + navigate('/quality/emergency/teams'); + }} + title="应急小组" + /> + ), + categories: ( + { + navigate('/quality/emergency/categories'); + }} + title="事件分类" + /> + ), + levels: ( + { + navigate('/quality/emergency/levels'); + }} + title="级别配置" + /> + ), + }} + />, + ]} + columns={[ + MyColumns.ID({ + search: false, + }), + { + title: '名称', + dataIndex: 'name', }, - }, - { - title: '分类', - search: false, - render: (_, item: any) => { - return `${item?.one_emergency_categories_name} / ${item?.two_emergency_categories_name}`; + { + title: '所属项目', + dataIndex: ['asset_project', 'name'], + search: false, }, - }, - { - title: '等级', - dataIndex: 'emergency_event_levels_name', - search: false, - }, - MyColumns.UpdatedAt(), - MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - ), - close: ( - - ), - update: ( - - ), - audit: ( - - ), - delete: ( - - Apis.Emergency.EmergencyEvents.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - ), - }} - maxVisible={3} - /> - - ), - }), - ]} - /> + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'status', + valueEnum: EmergencyEventsStatusEnum, + }), + MyColumns.EnumTag({ + title: '赔偿方', + dataIndex: 'compensation_type', + valueEnum: EmergencyEventsCompensationTypeEnum, + }), + { + title: '赔偿事项', + search: false, + render: (_, item: any) => { + return ( +
+
赔偿比例:{item?.compensation_rate}%
+
赔偿金额:{item?.compensation_amount}元
+
已支付赔偿金额:{item?.compensation_paid_amount}元
+
+ ); + }, + }, + { + title: '分类', + search: false, + render: (_, item: any) => { + return `${item?.one_emergency_categories_name} / ${item?.two_emergency_categories_name}`; + }, + }, + { + title: '等级', + dataIndex: 'emergency_event_levels_name', + search: false, + }, + MyColumns.UpdatedAt(), + MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + ), + close: ( + + ), + update: ( + + ), + audit: ( + + ), + delete: ( + + Apis.Emergency.EmergencyEvents.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + maxVisible={3} + /> + + ), + }), + ]} + /> +
); } diff --git a/src/pages/quality/renovation/index.tsx b/src/pages/quality/renovation/index.tsx index 628f9d4..f2afc78 100644 --- a/src/pages/quality/renovation/index.tsx +++ b/src/pages/quality/renovation/index.tsx @@ -1,6 +1,7 @@ import { MyButtons, MyColumns, + MyPageContainer, MyProTableProps, MyTableActions, MyToolBarActions, @@ -19,197 +20,204 @@ import DepositPay from './modals/DepositPay'; import DepositRefund from './modals/DepositRefund'; import MyWorkerCreate from './modals/WorkerCreate'; -export default function Index() { +export default function Index({ title = '装修管理' }) { const navigate = useNavigate(); return ( - - MyProTableProps.request( - params, - sort, - Apis.Renovation.RenovationApplies.List, - ) - } - headerTitle="装修申请列表" - toolBarRender={(action) => [ - } - onClick={() => { - navigate('/quality/renovation/pages/create'); - }} - title="装修申请" - /> - ), - rules: ( - { - navigate('/quality/renovation/inspection_rules'); - }} - title="巡检配置" - /> - ), - audit: ( - { - navigate('/quality/renovation/audit'); - }} - title="资料审核" - /> - ), - }} - />, - ]} - columns={[ - MyColumns.ID({ search: false }), - Selects?.AssetProjects({ - title: '选择项目', - key: 'id', - hidden: true, - }), - MyColumns.EnumTag({ - title: '登记状态', - dataIndex: 'status', - valueEnum: RenovationAppliesStatusEnum, - search: false, - }), - { - title: '关联项目', - dataIndex: ['asset_project', 'name'], - search: false, - }, - { - title: '房屋', - dataIndex: ['asset_house', 'full_name'], - search: { - transform: (value) => { - return { full_name: value }; + + + MyProTableProps.request( + params, + sort, + Apis.Renovation.RenovationApplies.List, + ) + } + headerTitle="装修申请列表" + toolBarRender={(action) => [ + } + onClick={() => { + navigate('/quality/renovation/pages/create'); + }} + title="装修申请" + /> + ), + rules: ( + { + navigate('/quality/renovation/inspection_rules'); + }} + title="巡检配置" + /> + ), + audit: ( + { + navigate('/quality/renovation/audit'); + }} + title="资料审核" + /> + ), + }} + />, + ]} + columns={[ + MyColumns.ID({ search: false }), + Selects?.AssetProjects({ + title: '选择项目', + key: 'id', + hidden: true, + }), + MyColumns.EnumTag({ + title: '登记状态', + dataIndex: 'status', + valueEnum: RenovationAppliesStatusEnum, + search: false, + }), + { + title: '关联项目', + dataIndex: ['asset_project', 'name'], + search: false, + }, + { + title: '房屋', + dataIndex: ['asset_house', 'full_name'], + search: { + transform: (value) => { + return { full_name: value }; + }, }, }, - }, - { - title: '装修人', - dataIndex: 'owner_name', - }, - { - title: '装修公司', - dataIndex: 'company_name', - search: false, - }, - { - title: '施工负责人', - dataIndex: 'construction_principal_name', - search: false, - }, - MyColumns.EnumTag({ - title: '施工状态', - dataIndex: 'construction_status', - valueEnum: RenovationAppliesConstructionStatusEnum, - search: false, - }), - { - title: '保证金', - dataIndex: 'deposit_amount', - search: false, - }, - { - title: '施工时间', - search: false, - render: (_, item: any) => { - return ( -
- {item?.construction_start_date || ''} 至 - {item?.construction_end_date || ''} -
- ); + { + title: '装修人', + dataIndex: 'owner_name', }, - }, - MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - { - navigate( - `/quality/renovation/pages/show?id=${item.id}`, - ); - }} - title="查看" - /> - ), - worker: ( - - ), - update: ( - { - navigate( - `/quality/renovation/pages/update?id=${item.id}`, - ); - }} - title="编辑" - /> - ), - pay: ( - - ), - refund: ( - - ), - delete: ( - - Apis.Renovation.RenovationApplies.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - ), - }} - maxVisible={3} - /> - - ), - }), - ]} - /> + { + title: '装修公司', + dataIndex: 'company_name', + search: false, + }, + { + title: '施工负责人', + dataIndex: 'construction_principal_name', + search: false, + }, + MyColumns.EnumTag({ + title: '施工状态', + dataIndex: 'construction_status', + valueEnum: RenovationAppliesConstructionStatusEnum, + search: false, + }), + { + title: '保证金', + dataIndex: 'deposit_amount', + search: false, + }, + { + title: '施工时间', + search: false, + render: (_, item: any) => { + return ( +
+ {item?.construction_start_date || ''} 至 + {item?.construction_end_date || ''} +
+ ); + }, + }, + MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + { + navigate( + `/quality/renovation/pages/show?id=${item.id}`, + ); + }} + title="查看" + /> + ), + worker: ( + + ), + update: ( + { + navigate( + `/quality/renovation/pages/update?id=${item.id}`, + ); + }} + title="编辑" + /> + ), + pay: ( + + ), + refund: ( + + ), + delete: ( + + Apis.Renovation.RenovationApplies.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + maxVisible={3} + /> + + ), + }), + ]} + /> +
); } diff --git a/src/pages/work_order/managers/modals/ManagersCreate.tsx b/src/pages/work_order/managers/modals/ManagersCreate.tsx index 756b28a..249e7e0 100644 --- a/src/pages/work_order/managers/modals/ManagersCreate.tsx +++ b/src/pages/work_order/managers/modals/ManagersCreate.tsx @@ -28,23 +28,15 @@ export default function Create(props: MyBetaModalFormProps) { form.resetFields(); } }} - onFinish={async (values: any) => { - const { type, ...restValues } = values; - const promises = (type || []).map((t: any) => - Apis.Asset.AssetProjectAdmins.Store({ - ...restValues, - type: t, - }), - ); - - return Promise.all(promises) + onFinish={async (values: any) => + Apis.Asset.AssetProjectAdmins.BatchStore(values) .then(() => { props.reload?.(); - message.success(props.title + '成功'); + message.success('提交成功'); return true; }) - .catch(() => false); - }} + .catch(() => false) + } columns={[ Selects?.AssetProjects({ title: '选择项目', @@ -67,7 +59,7 @@ export default function Create(props: MyBetaModalFormProps) { required: true, }), MyFormItems.EnumCheckbox({ - key: 'type', + key: 'types', title: '工单类型', colProps: { span: 24 }, valueEnum: HouseWorkOrdersTypeEnum, -- 2.47.2