diff --git a/src/gen/ApiTypes.d.ts b/src/gen/ApiTypes.d.ts index bc7fbe6..3141e45 100644 --- a/src/gen/ApiTypes.d.ts +++ b/src/gen/ApiTypes.d.ts @@ -113,17 +113,20 @@ declare namespace ApiTypes { "status"?: string; // 状态,[enum:HouseRegistersStatusEnum] "customer_info"?: string[]; // 客户信息 "ownership_info"?: string[]; // 产权信息 + "remark"?: string; // 备注 }; type Update = { "id": number; // id "type": string; // 类型,[enum:HouseRegistersTypeEnum] "customer_info"?: string[]; // 客户信息 "ownership_info"?: string[]; // 产权信息 + "remark"?: string; // 备注 }; type MoveOut = { "house_occupants_id": number; // 房客id "move_out_date"?: Date; // 搬离时间 "apply_reason"?: string; // 搬离原因 + "remark"?: string; // 备注 }; type MoveIn = { "house_occupants_id": number; // 房客id @@ -132,6 +135,7 @@ declare namespace ApiTypes { }; type RemoveOwner = { "house_occupants_id": number; // 房客id + "remark"?: string; // 备注 }; type ChangeOccupant = { "house_occupants_id": number; // 房客id @@ -151,6 +155,7 @@ declare namespace ApiTypes { "owners_id"?: number; // 产权人id,[ref:house_occupants] "relation_with_owner"?: string; // 与产权人关系,[enum:HouseOccupantsRelationWithOwnerEnum] "status"?: string; // 状态,[enum:HouseOccupantsStatusEnum] + "remark"?: string; // 备注 }; type Show = { "id": number; // id @@ -356,6 +361,9 @@ declare namespace ApiTypes { "keywords"?: string; // 关键词 "companies_id"?: number; // 机构id }; + type Import = { + "upload_file"?: mimes:xlsx,xls; // 上传的时候必填文件 + }; } namespace AssetUnits { type List = { @@ -633,6 +641,29 @@ declare namespace ApiTypes { "id": number; // id }; } + namespace Positions { + type List = { + "name"?: string; // 模糊搜索:名称 + }; + type Store = { + "name": string; // 岗位名称 + "is_use"?: number; // 是否启用,1启用,0禁用 + }; + type Update = { + "id": number; // id + "name": string; // 岗位名称 + "is_use"?: number; // 是否启用,1启用,0禁用 + }; + type Show = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + type Select = { + "keywords"?: string; // 关键词 + }; + } } namespace Company { namespace Companies { @@ -797,6 +828,10 @@ declare namespace ApiTypes { "status"?: number; // 状态 "remark"?: string; // 备注 }; + type BatchStore = { + "companies_id": number; // 所属机构id,[ref:companies] + "positions_ids": string[]; // 岗位ID + }; type Show = { "id": number; // id }; @@ -1424,6 +1459,9 @@ declare namespace ApiTypes { type Delete = { "id": number; // id }; + type Import = { + "upload_file"?: mimes:xlsx,xls; // 上传的时候必填文件 + }; } } namespace Msg { diff --git a/src/gen/Apis.ts b/src/gen/Apis.ts index f5cb3ed..cf3e4bd 100644 --- a/src/gen/Apis.ts +++ b/src/gen/Apis.ts @@ -185,6 +185,12 @@ export const Apis = { Select(data?: ApiTypes.Asset.AssetProjects.Select): Promise { return request('admin/asset/asset_projects/select', { data }); }, + Import(data?: ApiTypes.Asset.AssetProjects.Import): Promise { + return request('admin/asset/asset_projects/import', { data }); + }, + DownloadTemplate(): Promise { + return request('admin/asset/asset_projects/download_template', {responseType: 'blob',}); + }, }, AssetUnits: { List(data?: ApiTypes.Asset.AssetUnits.List): Promise { @@ -374,6 +380,26 @@ export const Apis = { return request('admin/common/convenience_services/delete', { data }); }, }, + Positions: { + List(data?: ApiTypes.Common.Positions.List): Promise { + return request('admin/common/positions/list', { data }); + }, + Store(data: ApiTypes.Common.Positions.Store): Promise { + return request('admin/common/positions/store', { data }); + }, + Update(data: ApiTypes.Common.Positions.Update): Promise { + return request('admin/common/positions/update', { data }); + }, + Show(data: ApiTypes.Common.Positions.Show): Promise { + return request('admin/common/positions/show', { data }); + }, + Delete(data: ApiTypes.Common.Positions.Delete): Promise { + return request('admin/common/positions/delete', { data }); + }, + Select(data?: ApiTypes.Common.Positions.Select): Promise { + return request('admin/common/positions/select', { data }); + }, + }, }, Company: { Companies: { @@ -461,6 +487,9 @@ export const Apis = { Update(data: ApiTypes.Company.CompanyPositions.Update): Promise { return request('admin/company/company_positions/update', { data }); }, + BatchStore(data: ApiTypes.Company.CompanyPositions.BatchStore): Promise { + return request('admin/company/company_positions/batch_store', { data }); + }, Show(data: ApiTypes.Company.CompanyPositions.Show): Promise { return request('admin/company/company_positions/show', { data }); }, @@ -845,6 +874,12 @@ export const Apis = { Delete(data: ApiTypes.Meter.HouseMeters.Delete): Promise { return request('admin/meter/house_meters/delete', { data }); }, + Import(data?: ApiTypes.Meter.HouseMeters.Import): Promise { + return request('admin/meter/house_meters/import', { data }); + }, + DownloadTemplate(): Promise { + return request('admin/meter/house_meters/download_template', {responseType: 'blob',}); + }, }, }, Msg: { diff --git a/src/gen/Enums.ts b/src/gen/Enums.ts index 9c062a6..1a7d72a 100644 --- a/src/gen/Enums.ts +++ b/src/gen/Enums.ts @@ -154,7 +154,7 @@ export const BannersTypeEnum= { // 缓存类型 export const CacheTypeEnum= { - 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#b123bc","value":"MobilePhoneVerificationCode"}, + 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#e3da02","value":"MobilePhoneVerificationCode"}, }; // CompaniesMerchantTypeEnum @@ -447,11 +447,14 @@ export const HouseOccupantsHouseRelationEnum= { // HouseOccupantsRelationWithOwnerEnum export const HouseOccupantsRelationWithOwnerEnum= { + 'Self': {"text":"本人","color":"#52c41a","value":"Self"}, 'Spouse': {"text":"配偶","color":"#2db7f5","value":"Spouse"}, 'Children': {"text":"子女","color":"#87d068","value":"Children"}, 'Parents': {"text":"父母","color":"#faad14","value":"Parents"}, 'Siblings': {"text":"兄弟姐妹","color":"#fa8c16","value":"Siblings"}, 'OtherRelatives': {"text":"其他亲属","color":"#f5222d","value":"OtherRelatives"}, + 'PrimaryTenant': {"text":"主租客","color":"#722ed1","value":"PrimaryTenant"}, + 'Tenant': {"text":"租客","color":"#1890ff","value":"Tenant"}, }; // HouseOccupantsResidentialRelationEnum @@ -463,8 +466,8 @@ export const HouseOccupantsResidentialRelationEnum= { // HouseOccupantsStatusEnum export const HouseOccupantsStatusEnum= { - 'Normal': {"text":"正常","color":"#52c41a","value":"Normal"}, - 'Unbound': {"text":"已解除","color":"#f5222d","value":"Unbound"}, + 'Normal': {"text":"绑定","color":"#52c41a","value":"Normal"}, + 'Unbound': {"text":"解绑","color":"#f5222d","value":"Unbound"}, }; // 订单状态枚举 diff --git a/src/pages/archive/index.tsx b/src/pages/archive/index.tsx index c6c8695..2d06536 100644 --- a/src/pages/archive/index.tsx +++ b/src/pages/archive/index.tsx @@ -16,7 +16,7 @@ import { useNavigate } from '@umijs/max'; import { Space, Tag } from 'antd'; import Delivery from './modals/Delivery'; -export default function Index({ title = '房屋档案' }) { +export default function Index({ title = '房客关系' }) { const navigate = useNavigate(); // 注册当前页面为标签页 usePageTabs({ @@ -140,7 +140,7 @@ export default function Index({ title = '房屋档案' }) { ) : ( '' diff --git a/src/pages/archive/modals/Delivery.tsx b/src/pages/archive/modals/Delivery.tsx index ecf078f..744d191 100644 --- a/src/pages/archive/modals/Delivery.tsx +++ b/src/pages/archive/modals/Delivery.tsx @@ -79,7 +79,7 @@ export default function Create(props: MyBetaModalFormProps) { fieldProps: { copyIconProps: false, creatorButtonProps: { - creatorButtonText: '添加产权人', + creatorButtonText: '添加业主', }, itemRender: ( { listDom, action }: any, diff --git a/src/pages/archive/table/OccupantsNow.tsx b/src/pages/archive/table/OccupantsNow.tsx index c8e00ee..5171a64 100644 --- a/src/pages/archive/table/OccupantsNow.tsx +++ b/src/pages/archive/table/OccupantsNow.tsx @@ -51,7 +51,7 @@ export default function Index({ ...rest }) { key="Delivery" item={{ ...rest.item, size: 'middle' }} reload={action?.reload} - title="添加产权人" + title="添加业主" />, !rest.item?.house_occupants?.length ? ( '' diff --git a/src/pages/archive/table/modals/Transfer.tsx b/src/pages/archive/table/modals/Transfer.tsx index 43e2d0e..916b040 100644 --- a/src/pages/archive/table/modals/Transfer.tsx +++ b/src/pages/archive/table/modals/Transfer.tsx @@ -82,7 +82,7 @@ export default function Create(props: MyBetaModalFormProps) { fieldProps: { copyIconProps: false, creatorButtonProps: { - creatorButtonText: '添加产权人', + creatorButtonText: '添加业主', }, itemRender: ( { listDom, action }: any, diff --git a/src/pages/asset/activities/modals/EnrollsList.tsx b/src/pages/asset/activities/modals/EnrollsList.tsx index a24842f..ac89d19 100644 --- a/src/pages/asset/activities/modals/EnrollsList.tsx +++ b/src/pages/asset/activities/modals/EnrollsList.tsx @@ -15,7 +15,7 @@ export default function EnrollsList(props: MyBetaModalFormProps) { - { - setParams(params); - return MyProTableProps.request( - params, - sort, - Apis.Asset.AssetHouses.List, - ); - }} - toolBarRender={() => [ - , - ]} - columns={[ - MyColumns.ID(), - { - title: '项目名称', - dataIndex: ['asset_project', 'name'], - search: { - transform: (value) => { - return { project_name: value }; - }, - }, - }, - { - title: '房屋名称', - dataIndex: 'full_name', - }, - MyColumns.EnumTag({ - title: '用途', - dataIndex: 'usage', - valueEnum: AssetHousesUsageEnum, - }), - { - title: '楼层', - dataIndex: 'floor', - render(_, record) { - return `${record?.floor}层`; - }, - search: false, - }, - - { - title: '建筑面积', - dataIndex: 'built_area', - render(_, record) { - return `${ - record?.built_area ? record?.built_area + ' m²' : '-' - } `; - }, - search: false, - }, - { - title: '套内面积', - dataIndex: 'inside_area', - render(_, record) { - return `${ - record?.inside_area ? record?.inside_area + ' m²' : '-' - } `; - }, - search: false, - }, - { - title: '计费面积', - dataIndex: 'chargeable_area', - render(_, record) { - return `${ - record?.chargeable_area ? record?.chargeable_area + ' m²' : '-' - } `; - }, - search: false, - }, - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - - Apis.Asset.AssetHouses.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - - ), - }), - ]} - /> - - ); -} diff --git a/src/pages/bills/list/index.tsx b/src/pages/bills/list/index.tsx index 06f5bce..7ee7b6c 100644 --- a/src/pages/bills/list/index.tsx +++ b/src/pages/bills/list/index.tsx @@ -7,7 +7,7 @@ import { usePageTabs, } from '@/common'; import { Apis } from '@/gen/Apis'; -import { HouseBillsTypeEnum } from '@/gen/Enums'; +import { HouseBillsBillStatusEnum, HouseBillsTypeEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; import BillCreate from './modals/BillCreate'; @@ -46,6 +46,11 @@ export default function Index({ title = '账单明细' }) { ]} columns={[ MyColumns.ID(), + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'bill_status', + valueEnum: HouseBillsBillStatusEnum, + }), MyColumns.EnumTag({ title: '类型', dataIndex: 'type', @@ -81,7 +86,11 @@ export default function Index({ title = '账单明细' }) { dataIndex: 'late_fee', search: false, }, - + { + title: '应付金额', + dataIndex: 'total_payable_amount', + search: false, + }, { title: '计费开始日期', dataIndex: 'start_date', diff --git a/src/pages/bills/summary/components/BillInfo.tsx b/src/pages/bills/summary/components/BillInfo.tsx new file mode 100644 index 0000000..ceadd72 --- /dev/null +++ b/src/pages/bills/summary/components/BillInfo.tsx @@ -0,0 +1,35 @@ +import { MyBetaModalFormProps } from '@/common'; +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?.total_payable_sum || '-'} + + + {item?.payable_amount_sum || '-'} + + + {item?.late_fee_sum || '-'} + + + {item?.discount_amount_sum || '-'} + + + + + ); +} diff --git a/src/pages/bills/summary/index.tsx b/src/pages/bills/summary/index.tsx index 40bb1c6..3a29097 100644 --- a/src/pages/bills/summary/index.tsx +++ b/src/pages/bills/summary/index.tsx @@ -1,4 +1,5 @@ import { + MyButtons, MyColumns, MyPageContainer, MyProTableProps, @@ -6,10 +7,11 @@ import { } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; -import SummaryShow from './modals/SummaryShow'; export default function Index({ title = '房屋账单' }) { + const navigate = useNavigate(); // 注册当前页面为标签页 usePageTabs({ tabKey: 'summary', @@ -32,18 +34,6 @@ export default function Index({ title = '房屋账单' }) { Apis.Bill.HouseBills.SummaryBillList, ) } - // toolBarRender={(action) => [ - // , - // , - // ]} columns={[ { title: '房屋ID', @@ -81,7 +71,12 @@ export default function Index({ title = '房屋账单' }) { MyColumns.Option({ render: (_, item: any, index, action) => ( - + { + navigate(`/bills/summary/show/${item.asset_houses_id}`); + }} + /> ), }), diff --git a/src/pages/bills/summary/modals/SummaryShow.tsx b/src/pages/bills/summary/modals/SummaryShow.tsx deleted file mode 100644 index 7d00e9f..0000000 --- a/src/pages/bills/summary/modals/SummaryShow.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common'; -import { MyModal } from '@/components/MyModal'; -import { Apis } from '@/gen/Apis'; -import { HouseBillsTypeEnum } from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import BillUpdate from '../../list/modals/BillUpdate'; - -export default function SummaryShow(props: MyBetaModalFormProps) { - return ( - - MyProTableProps.request( - { ...params, asset_houses_id: props?.item?.asset_houses_id }, - sort, - Apis.Bill.HouseBills.List, - ) - } - columns={[ - MyColumns.ID(), - MyColumns.EnumTag({ - title: '类型', - dataIndex: 'type', - valueEnum: HouseBillsTypeEnum, - }), - { - title: '房屋', - dataIndex: ['asset_house', 'full_name'], - search: { - transform: (value) => { - return { full_name: value }; - }, - }, - }, - { - title: '账单月份', - render: (_, record) => { - return `${record.year}-${String(record.month).padStart( - 2, - '0', - )}`; - }, - }, - { - title: '账单金额', - dataIndex: 'amount', - search: false, - }, - { - title: '优惠金额', - dataIndex: 'discount_amount', - search: false, - }, - { - title: '滞纳金', - dataIndex: 'late_fee', - search: false, - }, - - { - title: '计费开始日期', - dataIndex: 'start_date', - search: false, - }, - { - title: '计费结束日期', - dataIndex: 'end_date', - search: false, - }, - MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - {/* - Apis.Bill.HouseBills.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> */} - - ), - }), - ]} - /> - } - /> - ); -} diff --git a/src/pages/bills/summary/show/$id.tsx b/src/pages/bills/summary/show/$id.tsx new file mode 100644 index 0000000..634dbcd --- /dev/null +++ b/src/pages/bills/summary/show/$id.tsx @@ -0,0 +1,83 @@ +import { MyPageContainer, usePageTabs } from '@/common'; +import { Apis } from '@/gen/Apis'; +import { ProCard } from '@ant-design/pro-components'; +import { useParams } from '@umijs/max'; +import { Tabs } from 'antd'; +import { useEffect, useState } from 'react'; +import BillInfo from '../components/BillInfo'; +import CancelledBill from '../table/CancelledBill'; +import PaidBill from '../table/PaidBill'; +import UnpaidBill from '../table/UnpaidBill'; + +export default function Show({ title = '账单详情' }) { + const { id } = useParams<{ id: string }>(); + const [data, setShow] = useState({}); + + // 注册标签页 + const { addTab } = usePageTabs({ + tabKey: `bill-detail-${id}`, + tabLabel: `${data?.asset_house?.name}账单` || title, + }); + + const loadShow = () => { + let paramsId: any = { asset_houses_id: id ?? 0 }; + Apis.Bill.HouseBills.SummaryShow(paramsId).then((res) => { + setShow(res?.data); + // 更新标签页标题 + if (res?.data?.asset_house?.name) { + addTab({ + key: `bill-detail-${id}`, + label: `${data?.asset_house?.name}档案`, + path: `/bills/${id}`, + }); + } + }); + }; + + useEffect(() => { + loadShow(); + }, [id]); + + let items = [ + { + label: '欠费账单', + key: '1', + closable: false, + children: ( + + ), + }, + { + label: '已付账单', + key: '2', + closable: false, + children: ( + + ), + }, + { + label: '作废账单', + key: '3', + closable: false, + children: ( + + ), + }, + ]; + + return ( + + + + + + + ); +} diff --git a/src/pages/bills/summary/table/CancelledBill.tsx b/src/pages/bills/summary/table/CancelledBill.tsx new file mode 100644 index 0000000..1c5238d --- /dev/null +++ b/src/pages/bills/summary/table/CancelledBill.tsx @@ -0,0 +1,76 @@ +import { MyColumns, MyProTableProps } from '@/common'; +import { Apis } from '@/gen/Apis'; +import { HouseBillsBillStatusEnum, HouseBillsTypeEnum } from '@/gen/Enums'; +import BillUpdate from '@/pages/bills/list/modals/BillUpdate'; +import { ProTable } from '@ant-design/pro-components'; +import { Space } from 'antd'; +import { useEffect, useRef } from 'react'; + +export default function Index({ ...rest }) { + const actionLooks = useRef(); + useEffect(() => { + actionLooks?.current.reloadAndRest(); + }, [rest.loadmore]); + + return ( + <> + > + {...MyProTableProps.props} + actionRef={actionLooks} + request={async (params, sort) => + MyProTableProps.request( + { + ...params, + asset_houses_id: rest.item?.asset_houses_id, + bill_status: [HouseBillsBillStatusEnum.Cancelled.value], + }, + sort, + Apis.Bill.HouseBills.List, + ) + } + search={false} + columns={[ + MyColumns.ID(), + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'bill_status', + valueEnum: HouseBillsBillStatusEnum, + }), + MyColumns.EnumTag({ + title: '类型', + dataIndex: 'type', + valueEnum: HouseBillsTypeEnum, + }), + { + title: '账单月份', + render: (_, record) => { + return `${record.year}-${String(record.month).padStart(2, '0')}`; + }, + }, + { + title: '应付金额', + dataIndex: 'total_payable_amount', + search: false, + }, + { + title: '计费开始日期', + dataIndex: 'start_date', + search: false, + }, + { + title: '计费结束日期', + dataIndex: 'end_date', + search: false, + }, + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/bills/summary/table/PaidBill.tsx b/src/pages/bills/summary/table/PaidBill.tsx new file mode 100644 index 0000000..6348be6 --- /dev/null +++ b/src/pages/bills/summary/table/PaidBill.tsx @@ -0,0 +1,79 @@ +import { MyColumns, MyProTableProps } from '@/common'; +import { Apis } from '@/gen/Apis'; +import { HouseBillsBillStatusEnum, HouseBillsTypeEnum } from '@/gen/Enums'; +import BillUpdate from '@/pages/bills/list/modals/BillUpdate'; +import { ProTable } from '@ant-design/pro-components'; +import { Space } from 'antd'; +import { useEffect, useRef } from 'react'; +import BillShow from './modals/BillShow'; + +export default function Index({ ...rest }) { + const actionLooks = useRef(); + useEffect(() => { + actionLooks?.current.reloadAndRest(); + }, [rest.loadmore]); + + return ( + <> + > + {...MyProTableProps.props} + actionRef={actionLooks} + request={async (params, sort) => + MyProTableProps.request( + { + ...params, + asset_houses_id: rest.item?.asset_houses_id, + bill_status: [HouseBillsBillStatusEnum.Paid.value], + }, + sort, + Apis.Bill.HouseBills.List, + ) + } + search={false} + columns={[ + MyColumns.ID(), + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'bill_status', + valueEnum: HouseBillsBillStatusEnum, + }), + MyColumns.EnumTag({ + title: '类型', + dataIndex: 'type', + valueEnum: HouseBillsTypeEnum, + }), + { + title: '账单月份', + render: (_, record) => { + return `${record.year}-${String(record.month).padStart(2, '0')}`; + }, + }, + { + title: '应付金额', + dataIndex: 'total_payable_amount', + search: false, + }, + { + title: '计费开始日期', + dataIndex: 'start_date', + search: false, + }, + { + title: '计费结束日期', + dataIndex: 'end_date', + search: false, + }, + + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/bills/summary/table/UnpaidBill.tsx b/src/pages/bills/summary/table/UnpaidBill.tsx new file mode 100644 index 0000000..a7a3ed1 --- /dev/null +++ b/src/pages/bills/summary/table/UnpaidBill.tsx @@ -0,0 +1,80 @@ +import { MyColumns, MyProTableProps } from '@/common'; +import { Apis } from '@/gen/Apis'; +import { HouseBillsBillStatusEnum, HouseBillsTypeEnum } from '@/gen/Enums'; +import BillUpdate from '@/pages/bills/list/modals/BillUpdate'; +import { ProTable } from '@ant-design/pro-components'; +import { Space } from 'antd'; +import { useEffect, useRef } from 'react'; + +export default function Index({ ...rest }) { + const actionLooks = useRef(); + useEffect(() => { + actionLooks?.current.reloadAndRest(); + }, [rest.loadmore]); + + return ( + <> + > + {...MyProTableProps.props} + actionRef={actionLooks} + request={async (params, sort) => + MyProTableProps.request( + { + ...params, + asset_houses_id: rest.item?.asset_houses_id, + bill_status: [ + HouseBillsBillStatusEnum.PendingPayment.value, + HouseBillsBillStatusEnum.PartiallyPaid.value, + HouseBillsBillStatusEnum.Overdue.value, + ], + }, + sort, + Apis.Bill.HouseBills.List, + ) + } + search={false} + columns={[ + MyColumns.ID(), + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'bill_status', + valueEnum: HouseBillsBillStatusEnum, + }), + MyColumns.EnumTag({ + title: '类型', + dataIndex: 'type', + valueEnum: HouseBillsTypeEnum, + }), + { + title: '账单月份', + render: (_, record) => { + return `${record.year}-${String(record.month).padStart(2, '0')}`; + }, + }, + { + title: '应付金额', + dataIndex: 'total_payable_amount', + search: false, + }, + { + title: '计费开始日期', + dataIndex: 'start_date', + search: false, + }, + { + title: '计费结束日期', + dataIndex: 'end_date', + search: false, + }, + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/bills/summary/table/modals/BillShow.tsx b/src/pages/bills/summary/table/modals/BillShow.tsx new file mode 100644 index 0000000..c31c7ec --- /dev/null +++ b/src/pages/bills/summary/table/modals/BillShow.tsx @@ -0,0 +1,71 @@ +import { MyBetaModalFormProps, renderTextHelper } from '@/common'; +import { MyModal } from '@/components/MyModal'; +import { HouseBillsBillStatusEnum, HouseBillsTypeEnum } from '@/gen/Enums'; +import { ProCard, ProDescriptions } from '@ant-design/pro-components'; +import { Space } from 'antd'; + +export default function SummaryShow(props: MyBetaModalFormProps) { + return ( + + + + + {props?.item?.asset_house?.full_name || '-'} + + + + {props?.item?.amount || '-'} + + + + + {props?.item?.discount_amount || '-'} + + + {props?.item?.late_fee || '-'} + + + + {props?.item?.total_payable_amount || '-'}{' '} + + + + + + + {props?.item?.year || '-'}- + {String(props?.item?.month).padStart(2, '0')}月 + + + ( {props?.item?.start_date || '-'} 至{' '} + {props?.item?.end_date || '-'}) + + + + + + {props?.item?.receipt_account?.company_name || '-'} + {props?.item?.receipt_account?.company_bank || '-'} + {props?.item?.receipt_account?.company_account || '-'} + + + + + + } + /> + ); +} diff --git a/src/pages/charge/standard/index.tsx b/src/pages/charge/standard/index.tsx index 5c1ccca..3056a3d 100644 --- a/src/pages/charge/standard/index.tsx +++ b/src/pages/charge/standard/index.tsx @@ -140,7 +140,7 @@ export default function Index({ title = '收费标准' }) { { - navigate(`/house_charge_standard/show/${item.id}`); + navigate(`/charge/standard/show/${item.id}`); }} /> diff --git a/src/pages/company/employees/modals/EmployeeCreate.tsx b/src/pages/company/employees/modals/EmployeeCreate.tsx index 3a5e503..a904def 100644 --- a/src/pages/company/employees/modals/EmployeeCreate.tsx +++ b/src/pages/company/employees/modals/EmployeeCreate.tsx @@ -69,7 +69,7 @@ export default function Create(props: MyBetaModalFormProps) { title: '选择组织', key: 'organizations_id', params: { - companies_id: companies_id || props?.item?.companies_id || 0, + companies_id: companies_id || props?.item?.id || 0, }, colProps: { span: 24 }, formItemProps: { ...rulesHelper.text }, @@ -109,7 +109,7 @@ export default function Create(props: MyBetaModalFormProps) { Selects?.Positions({ title: '岗位', params: { - companies_id: companies_id || props?.item?.companies_id || 0, + companies_id: companies_id || props?.item?.id || 0, }, key: 'positions_id', formItemProps: { ...rulesHelper.text }, diff --git a/src/pages/company/list/table/Organizations.tsx b/src/pages/company/list/table/Organizations.tsx index ed08b33..93d4460 100644 --- a/src/pages/company/list/table/Organizations.tsx +++ b/src/pages/company/list/table/Organizations.tsx @@ -8,6 +8,7 @@ import { Apis } from '@/gen/Apis'; import { OrganizationsTypeEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; +import NextOrganizationChange from '../../organizations/modals/NextOrganizationChange'; import OrganizationChange from '../../organizations/modals/OrganizationChange'; import OrganizationCreate from '../../organizations/modals/OrganizationCreate'; import OrganizationUpdate from '../../organizations/modals/OrganizationUpdate'; @@ -60,14 +61,21 @@ export default function Organizations(props: MyBetaModalFormProps) { render: (_, item: any, index, action) => ( - + )} + diff --git a/src/pages/company/organizations/index.tsx b/src/pages/company/organizations/index.tsx index 8db39a3..06acbf8 100644 --- a/src/pages/company/organizations/index.tsx +++ b/src/pages/company/organizations/index.tsx @@ -10,6 +10,7 @@ import { OrganizationsTypeEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; +import NextOrganizationChange from './modals/NextOrganizationChange'; import OrganizationChange from './modals/OrganizationChange'; import OrganizationCreate from './modals/OrganizationCreate'; import OrganizationUpdate from './modals/OrganizationUpdate'; @@ -77,14 +78,23 @@ export default function Index({ title = '组织列表' }) { render: (_, item: any, index, action) => ( - + )} + + diff --git a/src/pages/company/organizations/modals/NextOrganizationChange.tsx b/src/pages/company/organizations/modals/NextOrganizationChange.tsx new file mode 100644 index 0000000..41ce715 --- /dev/null +++ b/src/pages/company/organizations/modals/NextOrganizationChange.tsx @@ -0,0 +1,71 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyFormItems, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Selects } from '@/components/Select'; +import { Apis } from '@/gen/Apis'; +import { OrganizationsTypeEnum } from '@/gen/Enums'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +export default function Create(props: MyBetaModalFormProps) { + const [form] = Form.useForm(); + + return ( + + {...MyModalFormProps.props} + title={`添加${props.title}`} + wrapperCol={{ span: 24 }} + width="500px" + trigger={} + key={new Date().getTime()} + form={form} + onOpenChange={(open: any) => { + if (open) { + form.resetFields(); // 清空表单数据 + } + }} + onFinish={async (values: any) => + Apis.Company.Organizations.Store({ + ...values, + companies_id: values?.companies_id || props?.item?.companies_id, + parent_id: props.item?.id, + }) + .then(() => { + props.reload?.(); + message.success(props.title + '成功'); + return true; + }) + .catch(() => false) + } + columns={[ + ...(props?.item?.id + ? [] + : [ + Selects?.Companies({ + key: 'companies_id', + title: '公司', + colProps: { span: 24 }, + required: true, + }), + ]), + MyFormItems.EnumRadio({ + key: 'type', + title: '组织类型', + colProps: { span: 24 }, + valueEnum: OrganizationsTypeEnum, + required: true, + }), + { + key: 'name', + title: '组织名称', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + }, + ]} + /> + ); +} diff --git a/src/pages/company/organizations/modals/OrganizationChange.tsx b/src/pages/company/organizations/modals/OrganizationChange.tsx index 7e26393..035a8ab 100644 --- a/src/pages/company/organizations/modals/OrganizationChange.tsx +++ b/src/pages/company/organizations/modals/OrganizationChange.tsx @@ -11,14 +11,12 @@ export default function Update(props: MyBetaModalFormProps) { {...MyModalFormProps.props} title={`${props.title}调整`} form={form} - trigger={ - - } + trigger={} wrapperCol={{ span: 24 }} width="500px" onOpenChange={(open: any) => { if (open && props.item) { - form.setFieldsValue(props.item); + form.resetFields(); // 清空表单数据 } }} onFinish={async (values: any) => @@ -40,7 +38,7 @@ export default function Update(props: MyBetaModalFormProps) { } columns={[ Selects?.OrganizationsTree({ - title: '请选择新的上级组织', + title: '请选择新的【上级组织】', key: 'parent_id', params: { companies_id: props?.item?.companies_id }, colProps: { span: 24 }, diff --git a/src/pages/company/organizations/modals/OrganizationCreate.tsx b/src/pages/company/organizations/modals/OrganizationCreate.tsx index b9432ab..aba85ff 100644 --- a/src/pages/company/organizations/modals/OrganizationCreate.tsx +++ b/src/pages/company/organizations/modals/OrganizationCreate.tsx @@ -31,7 +31,7 @@ export default function Create(props: MyBetaModalFormProps) { onFinish={async (values: any) => Apis.Company.Organizations.Store({ ...values, - companies_id: values?.companies_id || props?.item?.id, + companies_id: values?.companies_id || props?.item?.companies_id, parent_id: values?.parent_id?.[values.parent_id.length - 1], }) .then(() => { diff --git a/src/pages/mete/list/modals/MeterHasOne.tsx b/src/pages/mete/list/modals/MeterHasOne.tsx index 0528a9c..3429070 100644 --- a/src/pages/mete/list/modals/MeterHasOne.tsx +++ b/src/pages/mete/list/modals/MeterHasOne.tsx @@ -22,6 +22,8 @@ export default function ChargeStandardHasHouse(props: MyBetaModalFormProps) { // 添加 tableRef 用于操作表格 const tableRef = useRef(); + // 添加 modalRef 用于关闭窗口 + const modalRef = useRef(); const onShowContactPhone = () => { if (!selectedHouseId) { @@ -42,6 +44,8 @@ export default function ChargeStandardHasHouse(props: MyBetaModalFormProps) { setSelectedRow(null); props.reload?.(); message.success('添加成功!'); + // 关闭窗口 + modalRef.current?.close(); }) .catch((error) => { console.error('添加失败:', error); @@ -55,6 +59,7 @@ export default function ChargeStandardHasHouse(props: MyBetaModalFormProps) { title={props.title || '查看'} type="primary" width="920px" + myRef={modalRef} node={ + + MyProTableProps.request( + params, + sort, + Apis.HouseCharage.HouseChargeTasks.List, + ) + } + toolBarRender={(action) => [ + , + ]} + columns={[ + { + title: '机构', + dataIndex: ['company', 'name'], + search: false, + }, + { + title: '任务ID', + dataIndex: 'id', + search: false, + }, + MyColumns.EnumTag({ + title: '创建类型', + dataIndex: 'type', + valueEnum: HouseChargeTasksTypeEnum, + }), + MyColumns.EnumTag({ + title: '任务状态', + dataIndex: 'status', + valueEnum: HouseChargeTasksStatusEnum, + }), + { + title: '收费标准', + dataIndex: ['house_charge_standard', 'name'], + search: false, + }, + { + title: '账单月份', + render: (_, record) => { + return `${record.bill_year}-${String(record.bill_month).padStart( + 2, + '0', + )}`; + }, + }, + { + title: '计费周期', + + render: (_, record) => { + return `${record.start_date}-${String(record.end_date).padStart( + 2, + '0', + )}`; + }, + search: false, + }, + { + title: '账单数', + dataIndex: 'task_count', + search: false, + }, + // MyColumns.UpdatedAt(), + MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + + Apis.HouseCharage.HouseChargeTasks.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/mete/tasks/modals/TaskCreate.tsx b/src/pages/mete/tasks/modals/TaskCreate.tsx new file mode 100644 index 0000000..5a0dff8 --- /dev/null +++ b/src/pages/mete/tasks/modals/TaskCreate.tsx @@ -0,0 +1,122 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Selects } from '@/components/Select'; +import { Apis } from '@/gen/Apis'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +export default function Create(props: MyBetaModalFormProps) { + const [form] = Form.useForm(); + return ( + + {...MyModalFormProps.props} + title={`创建${props.title}`} + width="480px" + layout="horizontal" + labelCol={{ span: 8 }} + wrapperCol={{ span: 16 }} + labelAlign="left" + trigger={} + key={new Date().getTime()} + form={form} + onOpenChange={(open: any) => { + if (open) { + form.resetFields(); // 清空表单数据 + } + }} + onFinish={async (values) => + Apis.HouseCharage.HouseChargeTasks.Store(values) + .then(() => { + props.reload?.(); + message.success(props.title + '账单任务创建成功'); + return true; + }) + .catch(() => false) + } + columns={[ + Selects?.AssetProjects({ + title: '选择项目', + key: 'asset_projects_id', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + fieldProps: { + onChange: (val: any) => { + form.setFieldsValue({ + house_charge_standards_id: undefined, + }); + }, + }, + }), + { + valueType: 'dependency', + name: ['asset_projects_id'], + columns: ({ asset_projects_id }) => { + return [ + Selects?.ChargeStandard({ + title: '选择收费标准', + key: 'house_charge_standards_id', + params: { + asset_projects_id: asset_projects_id, + }, + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + fieldProps: { + showSearch: true, + }, + }), + ]; + }, + }, + { + key: 'month', + title: '选择生成月份', + valueType: 'date', + colProps: { span: 24 }, + fieldProps: { + picker: 'month', + format: 'YYYY-MM', + valueFormat: 'YYYY-MM', + style: { + width: '100%', + }, + onChange: (e: any, dateString: string) => { + form.setFieldsValue({ + start_date: rulesHelper.getMonthStartDate(dateString), + end_date: rulesHelper.getMonthEndDate(dateString), + }); + }, + }, + formItemProps: { ...rulesHelper.text }, + }, + { + key: 'start_date', + title: '计费开始日期', + valueType: 'date', + colProps: { span: 24 }, + fieldProps: { + style: { + width: '100%', + }, + }, + formItemProps: { ...rulesHelper.text }, + }, + { + key: 'end_date', + title: '计费结束日期', + valueType: 'date', + colProps: { span: 24 }, + fieldProps: { + style: { + width: '100%', + }, + }, + formItemProps: { ...rulesHelper.text }, + }, + ]} + /> + ); +} diff --git a/src/pages/mete/tasks/modals/TaskShow.tsx b/src/pages/mete/tasks/modals/TaskShow.tsx new file mode 100644 index 0000000..795010d --- /dev/null +++ b/src/pages/mete/tasks/modals/TaskShow.tsx @@ -0,0 +1,69 @@ +import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common'; +import { MyModal } from '@/components/MyModal'; +import { Apis } from '@/gen/Apis'; +import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; + +export default function AssetInfo(props: MyBetaModalFormProps) { + return ( + + MyProTableProps.request( + { ...params, house_charge_tasks_id: props?.item?.id }, + sort, + Apis.HouseCharage.HouseChargeTaskDetails.List, + ) + } + columns={[ + MyColumns.ID(), + { + title: '对象', + dataIndex: 'full_name', + search: false, + }, + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'status', + valueEnum: HouseChargeTaskDetailsStatusEnum, + }), + + { + title: '收费标准', + dataIndex: ['house_charge_task', 'house_charge_standard', 'name'], + search: false, + }, + { + title: '账单月份', + render: (_, record) => { + return `${record.year}-${String(record.month).padStart( + 2, + '0', + )}`; + }, + }, + { + title: '计费周期', + render: (_, record) => { + return `${record.house_charge_task.start_date} 至 ${String( + record.house_charge_task.end_date, + ).padStart(2, '0')}`; + }, + search: false, + }, + { + title: '完成时间', + dataIndex: 'processed_time', + search: false, + }, + ]} + /> + } + /> + ); +}