From ac8fe80b617b94daa026f4fa54399ff1e8e28a74 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 27 Jan 2026 15:21:16 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=9B=B4=E6=96=B0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Select.tsx | 37 +++++++++ src/gen/ApiTypes.d.ts | 26 +++++- src/gen/Apis.ts | 24 ++++++ src/gen/Enums.ts | 12 ++- .../bills/summary/components/SearchInfo.tsx | 83 +++++++++++++++++-- src/pages/bills/summary/index.tsx | 6 ++ .../list/components/WorkLogsCreate.tsx | 2 +- src/pages/work_order/visited/index.tsx | 12 ++- 8 files changed, 183 insertions(+), 19 deletions(-) diff --git a/src/components/Select.tsx b/src/components/Select.tsx index d8bf8b5..d1da7e4 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -339,6 +339,43 @@ export const Selects = { }, }; }, + //收款账号 + ProjectReceiptAccountsSelect(props?: PropsType): ReturnType { + const { + title = '收款账户', + key = 'company_project_receipt_accounts_id', + required = false, + hideInTable = true, + ...rest + } = props ?? {}; + + return { + title: title, + key: key, + valueType: 'select', + hideInTable: hideInTable, + formItemProps: { ...(required ? rulesHelper.number : {}) }, + request: async (params) => + ( + await Apis.Company.CompanyProjectReceiptAccounts.ProjectReceiptAccountsSelect( + { + keywords: params?.keyWords, + projects_id: params?.asset_projects_id, + ...params, + }, + ) + ).data, + ...rest, + fieldProps: { + showSearch: true, + fieldNames: { + label: 'label', + value: 'value', + }, + ...rest?.fieldProps, + }, + }; + }, //机构收款账户 CompanyAccounts(props?: PropsType): ReturnType { const { diff --git a/src/gen/ApiTypes.d.ts b/src/gen/ApiTypes.d.ts index 523f7f7..9337a58 100644 --- a/src/gen/ApiTypes.d.ts +++ b/src/gen/ApiTypes.d.ts @@ -195,7 +195,7 @@ declare namespace ApiTypes { namespace HouseRegisters { type List = { "house_name"?: string; // 模糊搜索:房屋名称 - "type"?: string; // 类型,[enum:HouseRegistersTypeEnum] + "type"?: string[]; // 类型,[enum:HouseRegistersTypeEnum] "status"?: string; // 状态,[enum:HouseRegistersStatusEnum] "asset_houses_id"?: number; // 房屋ID }; @@ -340,6 +340,17 @@ declare namespace ApiTypes { "asset_parking_places_id"?: number; // 所属车场id,[ref:asset_parking_places] "keywords"?: string; // 关键词 }; + type Import = { + "asset_projects_id": number; // 所属项目id,[ref:asset_projects] + "upload_file": mimes:xlsx,xls; // 上传的Excel文件 + }; + type Export = { + "asset_projects_id"?: number; // 所属项目id,[ref:asset_projects] + "asset_parking_places_id"?: number; // 所属车场id,[ref:asset_parking_places] + "full_name"?: string; // 模糊搜索:名称 + "current"?: number; // 页码 + "download_type": string; // 下载类型:page 当前页(含查询条件),query 所有页(含查询条件),all所有记录 + }; } namespace AssetHouses { type List = { @@ -660,6 +671,7 @@ declare namespace ApiTypes { "year"?: number; // 账单年份 "month"?: number; // 账单月份 "type"?: string; // 账单类型,[enum:HouseBillsTypeEnum] + "has_refunding"?: boolean; // 是否有退款中:false-无,true-有 }; type SummaryBillList = { "project_name"?: string; // 模糊搜索:项目名称 @@ -905,6 +917,9 @@ declare namespace ApiTypes { type Select = { "projects_id"?: number; // 所属项目id,[ref:asset_projects] }; + type ProjectReceiptAccountsSelect = { + "projects_id"?: number; // 所属项目id,[ref:asset_projects] + }; } namespace CompanyPropertyBrands { type List = { @@ -1397,6 +1412,9 @@ declare namespace ApiTypes { "ids": string[]; // 订单ID数组 "serial_number": string; // 流水号 }; + type ImportSerialNumber = { + "upload_file": mimes:xlsx,xls; // 上传文件 + }; type GetPayCode = { "amount": number; // 金额 "discount_amount"?: number; // 优惠金额 @@ -1531,6 +1549,9 @@ declare namespace ApiTypes { type Delete = { "id": number; // id }; + type Import = { + "upload_file": mimes:xlsx,xls; // 上传文件 + }; } namespace HouseMeterTaskDetails { type List = { @@ -1760,6 +1781,9 @@ declare namespace ApiTypes { "status": string; // 工单状态,[enum:HouseWorkOrdersStatusEnum] "description"?: string; // 进度描述 "attachments"?: string[]; // 附件 + "is_fee"?: boolean; // 是否收费 + "amount"?: number; // 收费金额 + "company_project_receipt_accounts_id"?: number; // 收款账号id,[ref:company_project_receipt_accounts] }; type Show = { "id": number; // id diff --git a/src/gen/Apis.ts b/src/gen/Apis.ts index 5e49099..8e4a4dd 100644 --- a/src/gen/Apis.ts +++ b/src/gen/Apis.ts @@ -195,6 +195,15 @@ export const Apis = { Select(data?: ApiTypes.Asset.AssetCarPorts.Select): Promise { return request('company/asset/asset_car_ports/select', { data }); }, + Import(data: ApiTypes.Asset.AssetCarPorts.Import): Promise { + return request('company/asset/asset_car_ports/import', { data }); + }, + DownloadTemplate(): Promise { + return request('company/asset/asset_car_ports/download_template', {responseType: 'blob',}); + }, + Export(data: ApiTypes.Asset.AssetCarPorts.Export): Promise { + return request('company/asset/asset_car_ports/export', { responseType: 'blob',data }); + }, }, AssetHouses: { List(data?: ApiTypes.Asset.AssetHouses.List): Promise { @@ -472,6 +481,9 @@ export const Apis = { Select(data?: ApiTypes.Company.CompanyProjectReceiptAccounts.Select): Promise { return request('company/company/company_project_receipt_accounts/select', { data }); }, + ProjectReceiptAccountsSelect(data?: ApiTypes.Company.CompanyProjectReceiptAccounts.ProjectReceiptAccountsSelect): Promise { + return request('company/company/company_project_receipt_accounts/project_receipt_accounts_select', { data }); + }, }, CompanyPropertyBrands: { List(data?: ApiTypes.Company.CompanyPropertyBrands.List): Promise { @@ -763,6 +775,12 @@ export const Apis = { BatchUpdateSerialNumber(data: ApiTypes.HouseOrder.HouseOrders.BatchUpdateSerialNumber): Promise { return request('company/house_order/house_orders/batch_update_serial_number', { data }); }, + ImportSerialNumber(data: ApiTypes.HouseOrder.HouseOrders.ImportSerialNumber): Promise { + return request('company/house_order/house_orders/import_serial_number', { data }); + }, + DownloadSerialNumberTemplate(): Promise { + return request('company/house_order/house_orders/download_serial_number_template', {responseType: 'blob',}); + }, GetPayCode(data: ApiTypes.HouseOrder.HouseOrders.GetPayCode): Promise { return request('company/house_order/house_orders/get_pay_code', { data }); }, @@ -855,6 +873,12 @@ export const Apis = { Delete(data: ApiTypes.Meter.HouseMeterReadings.Delete): Promise { return request('company/meter/house_meter_readings/delete', { data }); }, + Import(data: ApiTypes.Meter.HouseMeterReadings.Import): Promise { + return request('company/meter/house_meter_readings/import', { data }); + }, + DownloadTemplate(): Promise { + return request('company/meter/house_meter_readings/download_template', {responseType: 'blob',}); + }, }, HouseMeterTaskDetails: { List(data?: ApiTypes.Meter.HouseMeterTaskDetails.List): Promise { diff --git a/src/gen/Enums.ts b/src/gen/Enums.ts index 144edc3..2d0a7cf 100644 --- a/src/gen/Enums.ts +++ b/src/gen/Enums.ts @@ -251,7 +251,7 @@ export const BannersTypeEnum= { // 缓存类型 export const CacheTypeEnum= { - 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#bba798","value":"MobilePhoneVerificationCode"}, + 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#63f8de","value":"MobilePhoneVerificationCode"}, }; // CompaniesMerchantTypeEnum @@ -406,9 +406,10 @@ export const GoodsReleasesStatusEnum= { // 账单状态枚举 export const HouseBillsBillStatusEnum= { - 'PendingPayment': {"text":"待支付","color":"#facc15","value":"PendingPayment"}, - 'PartiallyPaid': {"text":"部分支付","color":"#60a5fa","value":"PartiallyPaid"}, - 'Paid': {"text":"已支付","color":"#10b981","value":"Paid"}, + 'PendingPayment': {"text":"待收款","color":"#facc15","value":"PendingPayment"}, + 'ToBeConfirmed': {"text":"待确认","color":"#fb923c","value":"ToBeConfirmed"}, + 'PartiallyPaid': {"text":"部分收款","color":"#60a5fa","value":"PartiallyPaid"}, + 'Paid': {"text":"已收款","color":"#10b981","value":"Paid"}, 'Overdue': {"text":"已逾期","color":"#ef4444","value":"Overdue"}, 'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"}, }; @@ -422,6 +423,7 @@ export const HouseBillsTypeEnum= { 'SharedWaterFee': {"text":"公摊水费","color":"#8b5cf6","value":"SharedWaterFee"}, 'SharedElectricityFee': {"text":"公摊电费","color":"#ec4899","value":"SharedElectricityFee"}, 'CarPortFee': {"text":"车位费","color":"#f59e0b","value":"CarPortFee"}, + 'WorkOrderRepairFee': {"text":"工单维修费","color":"#f97316","value":"WorkOrderRepairFee"}, }; // HouseChargeStandardsApportionmentMethodEnum @@ -593,6 +595,7 @@ export const HouseOccupantsRelationWithOwnerEnum= { // HouseOccupantsResidentialRelationEnum export const HouseOccupantsResidentialRelationEnum= { + 'PropertyOwner': {"text":"产权人","color":"#722ed1","value":"PropertyOwner"}, 'Resident': {"text":"住户","color":"#2db7f5","value":"Resident"}, 'PrimaryTenant': {"text":"主租人","color":"#87d068","value":"PrimaryTenant"}, 'Tenant': {"text":"租客","color":"#fa8c16","value":"Tenant"}, @@ -624,6 +627,7 @@ export const HouseOrdersAuditStatusEnum= { // 订单状态枚举 export const HouseOrdersOrderStatusEnum= { 'Pending': {"text":"待支付","color":"#facc15","value":"Pending"}, + 'ToBeConfirmed': {"text":"待确认","color":"#fb923c","value":"ToBeConfirmed"}, 'Paid': {"text":"已支付","color":"#10b981","value":"Paid"}, 'Refunded': {"text":"已退款","color":"#60a5fa","value":"Refunded"}, 'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"}, diff --git a/src/pages/bills/summary/components/SearchInfo.tsx b/src/pages/bills/summary/components/SearchInfo.tsx index 0c5c4ce..ef3fcee 100644 --- a/src/pages/bills/summary/components/SearchInfo.tsx +++ b/src/pages/bills/summary/components/SearchInfo.tsx @@ -1,29 +1,30 @@ import { Apis } from '@/gen/Apis'; import { ProFormSelect, QueryFilter } from '@ant-design/pro-components'; import { Form } from 'antd'; +import { useState } from 'react'; type Props = { onChange?: (value: any) => void; }; export default function Search(props: Props) { const [form] = Form.useForm(); + const [assetProjectsId, setAssetProjectsId] = useState(); + const [assetBuildingsId, setAssetBuildingsId] = useState(); + const [assetUnitsId, setAssetUnitsId] = useState(); return ( { props?.onChange?.(form?.getFieldsValue() || {}); }} > { let res = await Apis.Asset.AssetProjects.Select({ keywords: params?.keyWords, @@ -31,6 +32,76 @@ export default function Search(props: Props) { }); return res?.data; }} + fieldProps={{ + showSearch: true, + }} + onChange={(e: any) => { + console.log(e, 'e'); + setAssetProjectsId(e); + }} + placeholder="请选择项目" + /> + { + setAssetBuildingsId(e); + }} + request={async (params) => { + let res = await Apis.Asset.AssetBuildings.Select({ + keywords: params?.keyWords, + ...params, + }); + return res?.data; + }} + placeholder="请选择楼栋" + /> + { + setAssetUnitsId(e); + }} + request={async (params) => { + let res = await Apis.Asset.AssetUnits.Select({ + keywords: params?.keyWords, + ...params, + }); + return res?.data; + }} + placeholder="请选择单元" + /> + { + let res = await Apis.Asset.AssetHouses.Select({ + keywords: params?.keyWords, + ...params, + }); + return res?.data; + }} placeholder="请选择房屋" /> diff --git a/src/pages/bills/summary/index.tsx b/src/pages/bills/summary/index.tsx index 1ab6599..9622160 100644 --- a/src/pages/bills/summary/index.tsx +++ b/src/pages/bills/summary/index.tsx @@ -72,10 +72,16 @@ export default function Index({ title = '房屋账单' }) { onChange={(values) => { setParams({ asset_houses_id: values?.asset_houses_id || '', + asset_projects_id: values?.asset_projects_id || '', + asset_buildings_id: values?.asset_buildings_id || '', + asset_units_id: values?.asset_units_id || '', page: 1, }); getSummaryBillList({ asset_houses_id: values?.asset_houses_id || '', + asset_projects_id: values?.asset_projects_id || '', + asset_buildings_id: values?.asset_buildings_id || '', + asset_units_id: values?.asset_units_id || '', page: 1, }); }} diff --git a/src/pages/work_order/list/components/WorkLogsCreate.tsx b/src/pages/work_order/list/components/WorkLogsCreate.tsx index 77cc2cd..543f9b7 100644 --- a/src/pages/work_order/list/components/WorkLogsCreate.tsx +++ b/src/pages/work_order/list/components/WorkLogsCreate.tsx @@ -128,7 +128,7 @@ export default function WorkLogsCreate({ placeholder: '请输入客户需支付的金额', }, }, - Selects?.ProjectAccounts({ + Selects?.ProjectReceiptAccountsSelect({ key: 'company_project_receipt_accounts_id', title: '选择账户', params: { diff --git a/src/pages/work_order/visited/index.tsx b/src/pages/work_order/visited/index.tsx index 98dbef2..1b6f524 100644 --- a/src/pages/work_order/visited/index.tsx +++ b/src/pages/work_order/visited/index.tsx @@ -1,4 +1,4 @@ -import { MyPageContainer, useCurrentPermissions } from '@/common'; +import { MyPageContainer } from '@/common'; import { useNavigate, useSearchParams } from '@umijs/max'; import type { TabsProps } from 'antd'; import { Button, Tabs } from 'antd'; @@ -7,23 +7,21 @@ import IsVisited from './components/IsVisited'; import NoVisited from './components/NoVisited'; export default function Index({ title = '工单回访' }) { - const getCurrentPermissions = useCurrentPermissions(); - const [searchParams] = useSearchParams(); const [activeKey, setActiveKey] = useState('1'); const navigate = useNavigate(); - const items: TabsProps['items'] = getCurrentPermissions({ - NoVisited: { + const items: TabsProps['items'] = [ + { key: 'NoVisited', label: '未回访工单', children: , }, - IsVisited: { + { key: 'IsVisited', label: '已回访工单', children: , }, - }); + ]; useEffect(() => { if (searchParams?.get('key')) {