From 786a48fe998b97d506f9f3ce6fa150ed918a2687 Mon Sep 17 00:00:00 2001 From: uiuJun <> Date: Tue, 9 Sep 2025 19:02:49 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E4=BF=AE=E6=94=B9=E4=BD=8F?= =?UTF-8?q?=E6=88=B7=E4=BF=A1=E6=81=AF=E3=80=81=E4=BF=AE=E6=94=B9=E4=BD=8F?= =?UTF-8?q?=E6=88=B7=E7=94=B5=E8=AF=9D=E3=80=81=E4=BF=AE=E6=94=B9=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gen/ApiTypes.d.ts | 38 ++++- src/gen/Apis.ts | 16 ++ src/gen/Enums.ts | 10 +- src/pages/archive/components/OccupantsNow.tsx | 14 +- .../archive/components/modals/ChangePhone.tsx | 59 +++++++ .../archive/components/modals/OwnerUpdate.tsx | 106 ++++++++++++ src/pages/asset_houses_bill/index.tsx | 128 +++++++++++++++ src/pages/customer_opinions/index.tsx | 154 ++++++++++++++++++ .../modals/CustomerOpinionShow.tsx | 92 +++++++++++ .../house_registers_audit/modals/Audit.tsx | 89 +++++++--- 10 files changed, 680 insertions(+), 26 deletions(-) create mode 100644 src/pages/archive/components/modals/ChangePhone.tsx create mode 100644 src/pages/archive/components/modals/OwnerUpdate.tsx create mode 100644 src/pages/asset_houses_bill/index.tsx create mode 100644 src/pages/customer_opinions/index.tsx create mode 100644 src/pages/customer_opinions/modals/CustomerOpinionShow.tsx diff --git a/src/gen/ApiTypes.d.ts b/src/gen/ApiTypes.d.ts index acf9f43..768203b 100644 --- a/src/gen/ApiTypes.d.ts +++ b/src/gen/ApiTypes.d.ts @@ -71,6 +71,24 @@ declare namespace ApiTypes { type RemoveOwner = { "house_occupants_id": number; // 房客id }; + type ChangeOccupant = { + "house_occupants_id": number; // 房客id + "type": string; // 类型,[enum:HouseRegistersTypeEnum + "update_info": string[]; // 要修改的信息 + "update_info.phone"?: phone|required_if:type,UpdatePhone; // 客户手机号 + "update_info.reserve_phone"?: phone; // 客户备用电话 + "update_info.card_type"?: string; // 证件类型,[enum:HouseOccupantsCardTypeEnum] + "update_info.id_card"?: string; // 客户身份证号 + "update_info.card_front_image"?: string[]; // 身份证正面图片 + "update_info.card_back_image"?: string[]; // 身份证反面图片 + "update_info.address"?: string; // 客户地址 + "update_info.ownership_info"?: string[]; // 产权信息 + "house_relation"?: string; // 房客关系,[enum:HouseOccupantsHouseRelationEnum] + "residential_relation"?: string; // 居住关系,[enum:HouseOccupantsResidentialRelationEnum] + "owners_id"?: number; // 产权人id,[ref:house_occupants] + "relation_with_owner"?: string; // 与产权人关系,[enum:HouseOccupantsRelationWithOwnerEnum] + "status"?: string; // 状态,[enum:HouseOccupantsStatusEnum] + }; type Show = { "id": number; // id }; @@ -224,7 +242,7 @@ declare namespace ApiTypes { "charge"?: string; // 收费方式,[enum:AssetProjectsChargeEnum] "takeover_date"?: Date; // 接管日期 "closure_date"?: Date; // 封园日期 - "company_property_brands_id"?: string; // 物业品牌id,[ref:company_property_brands] + "company_property_brands_id"?: number; // 物业品牌id,[ref:company_property_brands] }; type Update = { "id": number; // id @@ -249,7 +267,7 @@ declare namespace ApiTypes { "charge"?: string; // 收费方式,[enum:AssetProjectsChargeEnum] "takeover_date"?: Date; // 接管日期 "closure_date"?: Date; // 封园日期 - "company_property_brands_id"?: string; // 物业品牌id,[ref:company_property_brands] + "company_property_brands_id"?: number; // 物业品牌id,[ref:company_property_brands] }; type BindCompany = { "projects_id": number; // 项目id @@ -518,6 +536,8 @@ declare namespace ApiTypes { namespace ConvenienceServices { type List = { "name"?: string; // 模糊搜索:名称 + "asset_projects_id"?: number; // 项目ID + "project_name"?: string; // 项目名称 }; type Store = { "asset_projects_id": number; // 项目ID @@ -870,6 +890,20 @@ declare namespace ApiTypes { }; } } + namespace Customer { + namespace CustomerOpinions { + type List = { + "type"?: string; // 类型,[enum:CustomerOpinionsTypeEnum] + "content"?: string; // 模糊搜索:内容 + }; + type Show = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + } + } namespace Grid { namespace Grids { type List = { diff --git a/src/gen/Apis.ts b/src/gen/Apis.ts index c4e0d9a..64afa06 100644 --- a/src/gen/Apis.ts +++ b/src/gen/Apis.ts @@ -45,6 +45,9 @@ export const Apis = { RemoveOwner(data: ApiTypes.Archive.HouseRegisters.RemoveOwner): Promise { return request('admin/archive/house_registers/remove_owner', { data }); }, + ChangeOccupant(data: ApiTypes.Archive.HouseRegisters.ChangeOccupant): Promise { + return request('admin/archive/house_registers/change_occupant', { data }); + }, Show(data: ApiTypes.Archive.HouseRegisters.Show): Promise { return request('admin/archive/house_registers/show', { data }); }, @@ -516,6 +519,19 @@ export const Apis = { }, }, }, + Customer: { + CustomerOpinions: { + List(data?: ApiTypes.Customer.CustomerOpinions.List): Promise { + return request('admin/customer/customer_opinions/list', { data }); + }, + Show(data: ApiTypes.Customer.CustomerOpinions.Show): Promise { + return request('admin/customer/customer_opinions/show', { data }); + }, + Delete(data: ApiTypes.Customer.CustomerOpinions.Delete): Promise { + return request('admin/customer/customer_opinions/delete', { data }); + }, + }, + }, Grid: { Grids: { List(data?: ApiTypes.Grid.Grids.List): Promise { diff --git a/src/gen/Enums.ts b/src/gen/Enums.ts index 1259f9f..0e065c9 100644 --- a/src/gen/Enums.ts +++ b/src/gen/Enums.ts @@ -126,7 +126,7 @@ export const BannersTypeEnum= { // 缓存类型 export const CacheTypeEnum= { - 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#5b3d89","value":"MobilePhoneVerificationCode"}, + 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#81d182","value":"MobilePhoneVerificationCode"}, }; // CompaniesMerchantTypeEnum @@ -189,6 +189,12 @@ export const CustomerBacklogsTypeEnum= { 'ContractTodo': {"text":"合同待办","color":"#722ed1","value":"ContractTodo"}, }; +// CustomerOpinionsTypeEnum +export const CustomerOpinionsTypeEnum= { + 'FeatureException': {"text":"功能异常","color":"#ff0000","value":"FeatureException"}, + 'FeatureSuggestion': {"text":"新功能建议","color":"#00bfff","value":"FeatureSuggestion"}, +}; + // 账单状态枚举 export const HouseBillsBillStatusEnum= { 'PendingPayment': {"text":"待支付","color":"#facc15","value":"PendingPayment"}, @@ -404,6 +410,8 @@ export const HouseRegistersTypeEnum= { 'RemoveOccupant': {"text":"移除住户","color":"#fa8c16","value":"RemoveOccupant"}, 'MoveOut': {"text":"搬离登记","color":"#f50","value":"MoveOut"}, 'MoveIn': {"text":"搬入登记","color":"#ffc53d","value":"MoveIn"}, + 'UpdateInfo': {"text":"修改信息","color":"#722ed1","value":"UpdateInfo"}, + 'UpdatePhone': {"text":"修改电话","color":"#13c2c2","value":"UpdatePhone"}, }; // HouseRegistersUsagePlanEnum diff --git a/src/pages/archive/components/OccupantsNow.tsx b/src/pages/archive/components/OccupantsNow.tsx index 7066593..c8e00ee 100644 --- a/src/pages/archive/components/OccupantsNow.tsx +++ b/src/pages/archive/components/OccupantsNow.tsx @@ -10,10 +10,12 @@ import { Popconfirm, Space, Tag } from 'antd'; import { useEffect, useRef } from 'react'; import Delivery from '../modals/Delivery'; import AddOccupant from './modals/AddOccupant'; +import ChangePhone from './modals/ChangePhone'; import MoveIn from './modals/MoveIn'; import MoveOut from './modals/MoveOut'; import OccupantShow from './modals/OccupantShow'; import OccupantsUpdate from './modals/OccupantsUpdate'; +import OwnerUpdate from './modals/OwnerUpdate'; import RemoveOwner from './modals/RemoveOwner'; import Transfer from './modals/Transfer'; @@ -152,8 +154,16 @@ export default function Index({ ...rest }) { render: (_, item: any, index, action) => ( - - {!item?.is_live_in && ( + {item?.house_relation !== + HouseOccupantsHouseRelationEnum.NonOwner.value && ( + + )} + {item?.house_relation === + HouseOccupantsHouseRelationEnum.NonOwner.value && ( + + )} + + {!item?.move_in_date && ( )} {item?.move_in_date && ( diff --git a/src/pages/archive/components/modals/ChangePhone.tsx b/src/pages/archive/components/modals/ChangePhone.tsx new file mode 100644 index 0000000..0e08498 --- /dev/null +++ b/src/pages/archive/components/modals/ChangePhone.tsx @@ -0,0 +1,59 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { HouseRegistersTypeEnum } from '@/gen/Enums'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +export default function Update(props: MyBetaModalFormProps) { + const [form] = Form.useForm(); + + return ( + + {...MyModalFormProps.props} + title={`修改电话`} + wrapperCol={{ span: 24 }} + width="360px" + trigger={} + key={new Date().getTime()} + form={form} + onOpenChange={(open: any) => { + if (open) { + form.setFieldsValue(props?.item); // 编辑赋值 + } + }} + onFinish={async (values: any) => { + const requestData: any = { + house_occupants_id: props?.item?.id, + type: HouseRegistersTypeEnum.UpdatePhone.value, + house_relation: props?.item?.house_relation, + update_info: { + phone: values.phone, + }, + }; + return Apis.Archive.HouseRegisters.ChangeOccupant(requestData) + .then(() => { + props.reload?.(); + message.success('电话修改成功'); + return true; + }) + .catch(() => false); + }} + columns={[ + { + title: '手机号', + dataIndex: 'phone', + colProps: { span: 24 }, + fieldProps: { + maxLength: 11, + }, + formItemProps: { ...rulesHelper.phone }, + }, + ]} + /> + ); +} diff --git a/src/pages/archive/components/modals/OwnerUpdate.tsx b/src/pages/archive/components/modals/OwnerUpdate.tsx new file mode 100644 index 0000000..5a81da0 --- /dev/null +++ b/src/pages/archive/components/modals/OwnerUpdate.tsx @@ -0,0 +1,106 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyFormItems, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { + HouseOccupantsCardTypeEnum, + HouseRegistersTypeEnum, +} from '@/gen/Enums'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +export default function Update(props: MyBetaModalFormProps) { + const [form] = Form.useForm(); + + return ( + + {...MyModalFormProps.props} + title={`修改信息`} + wrapperCol={{ span: 24 }} + width="600px" + trigger={} + key={new Date().getTime()} + form={form} + onOpenChange={(open: any) => { + if (open) { + form.setFieldsValue(props?.item); // 编辑赋值 + } + }} + onFinish={async (values: any) => { + const requestData: any = { + house_occupants_id: props?.item?.id, + type: HouseRegistersTypeEnum.UpdateInfo.value, + house_relation: props?.item?.house_relation, + update_info: { + name: values.name || props?.item, + card_type: values.card_type, + id_card: values.id_card, + card_front_image: values.card_front_image, + card_back_image: values.card_back_image, + }, + }; + return Apis.Archive.HouseRegisters.ChangeOccupant(requestData) + .then(() => { + props.reload?.(); + message.success('信息编辑成功'); + return true; + }) + .catch(() => false); + }} + columns={[ + { + valueType: 'group', + columns: [ + { + title: '名称', + dataIndex: 'name', + colProps: { span: 6 }, + formItemProps: { ...rulesHelper.text }, + }, + MyFormItems.EnumSelect({ + key: 'card_type', + title: '证件类型', + colProps: { span: 10 }, + valueEnum: HouseOccupantsCardTypeEnum, + required: true, + }), + { + title: '证件号码', + dataIndex: 'id_card', + colProps: { span: 8 }, + fieldProps: { + maxLength: 18, + }, + formItemProps: { ...rulesHelper.text }, + }, + { + valueType: 'group', + columns: [ + MyFormItems.UploadImages({ + key: 'card_front_image', + title: '证件正面', + // uploadType: 'file', + required: true, + max: 1, + colProps: { span: 6 }, + }), + MyFormItems.UploadImages({ + key: 'card_back_image', + title: '证件反面', + // uploadType: 'file', + required: true, + max: 1, + colProps: { span: 6 }, + }), + ], + }, + ], + }, + ]} + /> + ); +} diff --git a/src/pages/asset_houses_bill/index.tsx b/src/pages/asset_houses_bill/index.tsx new file mode 100644 index 0000000..2def0c0 --- /dev/null +++ b/src/pages/asset_houses_bill/index.tsx @@ -0,0 +1,128 @@ +import { + MyButtons, + MyColumns, + MyPageContainer, + MyProTableProps, + usePageTabs, +} from '@/common'; +import { MyExport } from '@/components/MyExport'; +import { Apis } from '@/gen/Apis'; +import { AssetHousesUsageEnum } from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Space } from 'antd'; +import { useState } from 'react'; +import HousesShow from '../asset/components/modals/HousesShow'; +import HousesUpdate from '../asset/components/modals/HousesUpdate'; + +export default function Index({ title = '房屋列表' }) { + const [getParams, setParams] = useState({}); + + const navigate = useNavigate(); + // 注册当前页面为标签页 + usePageTabs({ + tabKey: 'asset-houses', + tabLabel: title, + }); + return ( + + { + 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/customer_opinions/index.tsx b/src/pages/customer_opinions/index.tsx new file mode 100644 index 0000000..9b1a4ea --- /dev/null +++ b/src/pages/customer_opinions/index.tsx @@ -0,0 +1,154 @@ +import { + MyColumns, + MyPageContainer, + MyProTableProps, + usePageTabs, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { CustomerOpinionsTypeEnum } from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { Image } from 'antd'; + +export default function Index({ title = '投诉建议' }) { + // 注册当前页面为标签页 + usePageTabs({ + tabKey: 'customer_opinions', + tabLabel: title, + }); + + return ( + + + MyProTableProps.request( + params, + sort, + Apis.Customer.CustomerOpinions.List, + ) + } + // toolBarRender={(action) => [ + // , + // , + // ]} + columns={[ + MyColumns.ID(), + // MyColumns.EnumTag({ + // title: '反馈来源', + // dataIndex: 'payment_method', + // valueEnum: HouseOrdersPaymentMethodEnum, + // }), + MyColumns.EnumTag({ + title: '反馈类型', + dataIndex: 'type', + valueEnum: CustomerOpinionsTypeEnum, + }), + { + title: '反馈内容', + dataIndex: 'content', + search: false, + }, + { + title: '反馈内容', + dataIndex: 'content', + width: 120, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽) + render: (text) => ( +
+ {text} +
+ ), + }, + { + title: '附件', + dataIndex: 'images', + search: false, + render: (_, record) => { + if (!Array.isArray(record.images) || record.images.length === 0) { + return '无附件'; + } + return ( +
+ {record.images.map((item: any, index: number) => { + if (item.type && item.type.includes('image')) { + return ( + + ); + } else if (item.type && item.type.includes('video')) { + return ( +
+ ); + }, + }, + MyColumns.CreatedAt(), + // MyColumns.Option({ + // render: (_, item: any, index, action) => ( + // + // + // + // Apis.Common.Admins.Delete({ id: item.id }).then(() => + // action?.reload(), + // ) + // } + // /> + // + // ), + // }), + ]} + /> +
+ ); +} diff --git a/src/pages/customer_opinions/modals/CustomerOpinionShow.tsx b/src/pages/customer_opinions/modals/CustomerOpinionShow.tsx new file mode 100644 index 0000000..7f49348 --- /dev/null +++ b/src/pages/customer_opinions/modals/CustomerOpinionShow.tsx @@ -0,0 +1,92 @@ +import { MyBetaModalFormProps, renderTextHelper } from '@/common'; +import { MyModal } from '@/components/MyModal'; +import { + AssetProjectsChargeEnum, + AssetProjectsEntrustTypeEnum, + AssetProjectsPropertyTypeEnum, + AssetProjectsStatusEnum, +} from '@/gen/Enums'; +import { ProCard, ProDescriptions } from '@ant-design/pro-components'; +import { Space } from 'antd'; + +export default function AssetInfo(props: MyBetaModalFormProps) { + return ( + + + + + +
+ {props?.item?.name} + {props?.item?.alias_name + ? `(${props?.item?.alias_name})` + : ''} +
+
+
+ + +
{props?.item?.company?.name}
+
+
+ + + {props?.item?.province || ''} + {props?.item?.city || ''} + {props?.item?.district || ''} + {props?.item?.address || ''} + + + + + + + + + + + + + + + + {props?.item?.takeover_date} + + + {props?.item?.closure_date} + + + {/* + {props?.item?.created_at} + */} + + {props?.item?.updated_at} + +
+
+
+ } + /> + ); +} diff --git a/src/pages/examine/house_registers_audit/modals/Audit.tsx b/src/pages/examine/house_registers_audit/modals/Audit.tsx index 9da4e5f..670f921 100644 --- a/src/pages/examine/house_registers_audit/modals/Audit.tsx +++ b/src/pages/examine/house_registers_audit/modals/Audit.tsx @@ -70,18 +70,20 @@ export default function Update(props: MyBetaModalFormProps) { {props?.item?.asset_house?.full_name || '-'} - {/* - - */} + + + {props?.item?.created_at || '-'} @@ -100,20 +102,10 @@ export default function Update(props: MyBetaModalFormProps) { rowKey={(record, index) => record?.id_card || index} size="small" columns={[ - MyColumns.EnumTag({ - title: '居住关系', - dataIndex: 'residential_relation', - valueEnum: HouseOccupantsResidentialRelationEnum, - }), // MyColumns.EnumTag({ - // title: - // props?.item?.status === 'Rented' - // ? '与主租人关系' - // : '与产权人关系', - // // title: '关系说明', - // dataIndex: 'relation_with_owner', - // valueEnum: HouseOccupantsRelationWithOwnerEnum, - // search: false, + // title: '居住关系', + // dataIndex: 'residential_relation', + // valueEnum: HouseOccupantsResidentialRelationEnum, // }), { title: '姓名', @@ -159,7 +151,62 @@ export default function Update(props: MyBetaModalFormProps) { /> )} - + {(props?.item?.type === 'UpdateInfo' || + props?.item?.type === 'UpdatePhone') && ( + + record?.id_card || index} + size="small" + columns={[ + { + title: '姓名', + dataIndex: 'name', + }, + { + title: '手机号', + dataIndex: 'phone', + }, + MyColumns.EnumTag({ + title: '证件类型', + dataIndex: 'card_type', + valueEnum: HouseOccupantsCardTypeEnum, + }), + { + title: '证件号码', + dataIndex: 'id_card', + }, + { + title: '证件资料', + render: (_, item) => { + return ( + + {item?.card_front_image?.[0] && ( + + )} + {item?.card_back_image?.[0] && ( + + )} + + ); + }, + }, + ]} + /> + + )} {props?.item?.type === 'AddOwner' && props?.item?.ownership_info && props?.item?.ownership_info?.length > 0 && ( @@ -170,7 +217,7 @@ export default function Update(props: MyBetaModalFormProps) { (res: any, index: number) => (