From c2e2509c944ac0bf6a3ce0f5602d5fa32e2028f2 Mon Sep 17 00:00:00 2001 From: zhouyanli <593579392@qq.com> Date: Tue, 20 Oct 2026 08:09:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E8=8F=9C=E5=8D=95=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=90=AD=E5=BB=BA=EF=BC=8C=E5=BC=80=E5=8F=91=E6=88=BF?= =?UTF-8?q?=E5=B1=8B=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E3=80=81=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/SdbElectricityDevice/type.ts | 5 + src/api/system/electricityShare/index.ts | 63 ++ src/api/system/electricityShare/types.ts | 108 ++++ src/api/system/house/index.ts | 30 +- src/api/system/house/type.ts | 125 +++- src/api/system/houseRental/index.ts | 131 ---- src/api/system/houseRental/type.ts | 219 ------- src/utils/house.ts | 15 +- .../system/Sdb/SdbElectricityDevice/index.vue | 4 +- .../system/Sdb/SdbElectricityShare/index.vue | 244 +++++++ src/views/system/house/HouseDetails.vue | 467 ++++---------- src/views/system/house/addResident.vue | 289 +++++++++ .../system/house/components/building.vue | 120 ---- .../house/components/components/houseItem.vue | 131 ---- .../house/components/components/table.vue | 168 ----- src/views/system/house/components/unit.vue | 275 -------- src/views/system/house/index.vue | 576 +++++++++++++++-- .../system/houseRental/addhouseResident.vue | 599 ------------------ src/views/system/houseRental/houseMain.vue | 231 ------- src/views/system/houseRental/index.vue | 554 ---------------- src/views/system/resident/addResident.vue | 424 ------------- src/views/system/resident/index.vue | 380 ----------- src/views/system/statistics-summary/index.vue | 10 + src/views/system/storeroom/addStoreRoom.vue | 316 --------- src/views/system/storeroom/index.vue | 203 ------ 25 files changed, 1524 insertions(+), 4163 deletions(-) create mode 100644 src/api/system/electricityShare/index.ts create mode 100644 src/api/system/electricityShare/types.ts delete mode 100644 src/api/system/houseRental/index.ts delete mode 100644 src/api/system/houseRental/type.ts create mode 100644 src/views/system/Sdb/SdbElectricityShare/index.vue create mode 100644 src/views/system/house/addResident.vue delete mode 100644 src/views/system/house/components/building.vue delete mode 100644 src/views/system/house/components/components/houseItem.vue delete mode 100644 src/views/system/house/components/components/table.vue delete mode 100644 src/views/system/house/components/unit.vue delete mode 100644 src/views/system/houseRental/addhouseResident.vue delete mode 100644 src/views/system/houseRental/houseMain.vue delete mode 100644 src/views/system/houseRental/index.vue delete mode 100644 src/views/system/resident/addResident.vue delete mode 100644 src/views/system/resident/index.vue create mode 100644 src/views/system/statistics-summary/index.vue delete mode 100644 src/views/system/storeroom/addStoreRoom.vue delete mode 100644 src/views/system/storeroom/index.vue diff --git a/src/api/system/SdbElectricityDevice/type.ts b/src/api/system/SdbElectricityDevice/type.ts index 4cb479d..80fdfb1 100644 --- a/src/api/system/SdbElectricityDevice/type.ts +++ b/src/api/system/SdbElectricityDevice/type.ts @@ -62,6 +62,11 @@ export interface ElectricityDeviceForm extends BaseEntity { */ deviceCode?: string; + /** + * 房屋id(更新户号时传递) + */ + houseId?: string; + /** * 安装地址 */ diff --git a/src/api/system/electricityShare/index.ts b/src/api/system/electricityShare/index.ts new file mode 100644 index 0000000..cbe75a9 --- /dev/null +++ b/src/api/system/electricityShare/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ElectricityShareVO, ElectricityShareForm, ElectricityShareQuery } from '@/api/electricityShare/electricityShare/types'; + +/** + * 查询公摊电表配置列表 + * @param query + * @returns {*} + */ + +export const listElectricityShare = (query?: ElectricityShareQuery): AxiosPromise => { + return request({ + url: '/electricityShare/list', + method: 'get', + params: query + }); +}; + +/** + * 查询公摊电表配置详细 + * @param id + */ +export const getElectricityShare = (id: string | number): AxiosPromise => { + return request({ + url: '/electricityShare/' + id, + method: 'get' + }); +}; + +/** + * 新增公摊电表配置 + * @param data + */ +export const addElectricityShare = (data: ElectricityShareForm) => { + return request({ + url: '/electricityShare', + method: 'post', + data: data + }); +}; + +/** + * 修改公摊电表配置 + * @param data + */ +export const updateElectricityShare = (data: ElectricityShareForm) => { + return request({ + url: '/electricityShare', + method: 'put', + data: data + }); +}; + +/** + * 删除公摊电表配置 + * @param id + */ +export const delElectricityShare = (id: string | number | Array) => { + return request({ + url: '/electricityShare/' + id, + method: 'delete' + }); +}; diff --git a/src/api/system/electricityShare/types.ts b/src/api/system/electricityShare/types.ts new file mode 100644 index 0000000..ec3a605 --- /dev/null +++ b/src/api/system/electricityShare/types.ts @@ -0,0 +1,108 @@ +export interface ElectricityShareVO { + /** + * 主键 + */ + id: string | number; + + /** + * 小区id + */ + villageId: string | number; + + /** + * 公摊电表设备id + */ + deviceId: string | number; + + /** + * 公摊电表设备编码 + */ + deviceCode: string; + + /** + * 分摊方式(1按建筑面积) + */ + shareMode: string; + + /** + * 状态(0正常 1停用) + */ + status: string; + + /** + * 备注 + */ + remark: string; + +} + +export interface ElectricityShareForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 小区id + */ + villageId?: string | number; + + /** + * 公摊电表设备id + */ + deviceId?: string | number; + + /** + * 公摊电表设备编码 + */ + deviceCode?: string; + + /** + * 分摊方式(1按建筑面积) + */ + shareMode?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 备注 + */ + remark?: string; + +} + +export interface ElectricityShareQuery extends PageQuery { + + /** + * 小区id + */ + villageId?: string | number; + + /** + * 公摊电表设备id + */ + deviceId?: string | number; + + /** + * 公摊电表设备编码 + */ + deviceCode?: string; + + /** + * 分摊方式(1按建筑面积) + */ + shareMode?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/system/house/index.ts b/src/api/system/house/index.ts index 9fc629d..44f65e3 100644 --- a/src/api/system/house/index.ts +++ b/src/api/system/house/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { addBuildingType, addHouseType, BuildingUnit, BuildingVo } from './type'; +import { addBuildingType, addHouseType, BuildingUnit, BuildingVo, HouseListPageVO, HouseListQuery } from './type'; // 楼栋--------------------------------------------------------------------------------------- @@ -53,11 +53,31 @@ export function deleteBuildingApi(id: string) { } // 房屋---------------------------------------------------------------------------------------------- -/** 根据 楼栋id 查询房屋信息 */ -export function getHouselistAPI(buildingId: string, houseName: string = '', houseUseTypeId: string = ''): AxiosPromise { +/** 根据 楼栋id 查询房屋信息(支持分页) */ +export function getHouselistAPI( + buildingId: string, + houseName?: string, + houseUseTypeId?: string, + pageNum?: number, + pageSize?: number +): AxiosPromise { return request({ - url: `/house/groupByUnitTree/${buildingId}?houseName=${houseName}&houseUseTypeId=${houseUseTypeId}`, - method: 'get' + url: `/house/groupByUnitTree/${buildingId}`, + method: 'get', + params: { + ...(houseName ? { houseName } : {}), + ...(houseUseTypeId ? { houseUseTypeId } : {}), + pageNum, + pageSize + } + }); +} +/** 查询房屋管理列表(分页) */ +export function getHouseListAPI(query: HouseListQuery = {}): AxiosPromise { + return request({ + url: '/house/list', + method: 'get', + params: query }); } // 添加房屋 diff --git a/src/api/system/house/type.ts b/src/api/system/house/type.ts index 4c38c70..a837a60 100644 --- a/src/api/system/house/type.ts +++ b/src/api/system/house/type.ts @@ -42,12 +42,20 @@ export interface BuildingVo { villageName?: string; } -// 楼栋总信息 +// 楼栋总信息(楼栋树数据) export interface BuildingUnit { buildingId: number; buildingName: string; floorCount: number; - units: BuildingUnitlist[]; + units?: BuildingUnitlist[]; + /** + * 楼栋下所有房屋(平铺) + */ + houses?: HouseListVO[]; + /** + * 总记录数 + */ + total?: number; } // 单元 export interface BuildingUnitlist { @@ -77,6 +85,119 @@ export interface addBuildingType { unitCount?: number; } +// 房屋管理列表 +export interface HouseListVO { + /** + * 房屋id + */ + houseId: string; + /** + * 小区id + */ + villageId: string; + /** + * 楼栋id + */ + buildingId: string; + /** + * 楼栋名称(区号) + */ + buildingName?: string | null; + /** + * 楼层 + */ + floorNo: number; + /** + * 房号 + */ + houseNo: string; + /** + * 房屋类型 + */ + houseType: string; + /** + * 建筑面积 + */ + houseArea: string; + /** + * 公摊面积 + */ + shareArea: string; + /** + * 套内面积 + */ + internalArea: string; + /** + * 房屋用途类型id + */ + houseUseTypeId: string; + /** + * 房屋状态 + */ + houseStatus: string; + /** + * 住户id + */ + residentId: string | null; + /** + * 业主姓名 + */ + landlordName: string | null; + /** + * 业主电话 + */ + landlordPhone: string | null; + /** + * 租户姓名 + */ + lesseeName: string | null; + /** + * 租户电话 + */ + lesseePhone: string | null; + /** + * 状态 + */ + status: string; + /** + * 备注 + */ + remark: string | null; +} + +// 房屋管理列表查询参数 +export interface HouseListQuery { + /** + * 当前页数 + */ + pageNum?: number; + /** + * 分页大小 + */ + pageSize?: number; + buildingId?: string | null; + unitNoId?: string | null; + houseId?: string | null; + houseNo?: string | null; + landlordName?: string | null; + lesseeName?: string | null; + houseUseTypeId?: string | null; +} + +// 房屋管理列表分页响应 +export interface HouseListPageVO { + code: number; + msg: string; + /** + * 当前页数据 + */ + rows: HouseListVO[]; + /** + * 总记录数 + */ + total: number; +} + export interface addHouseType { 'houseId'?: string; 'buildingId'?: string; diff --git a/src/api/system/houseRental/index.ts b/src/api/system/houseRental/index.ts deleted file mode 100644 index 5578dcb..0000000 --- a/src/api/system/houseRental/index.ts +++ /dev/null @@ -1,131 +0,0 @@ -import request from '@/utils/request'; -import { AxiosPromise } from 'axios'; -import { HouseRentalVO, HouseRentalForm, HouseRentalQuery, HouseRentalSigningVO } from '@/api/system/houseRental/type'; - -/** - * 查询房屋租赁管理列表 - * @param query - * @returns {*} - */ - -export const listHouseRental = (query?: HouseRentalQuery): AxiosPromise => { - return request({ - url: '/houseRental/list', - method: 'get', - params: query - }); -}; - -/** - * 查询房屋租赁管理详细 - * @param id - */ -export const getHouseRental = (id: string | number): AxiosPromise => { - return request({ - url: '/houseRental/' + id, - method: 'get' - }); -}; - -/** - * 新增房屋租赁管理 - * @param data - */ -export const addHouseRental = (data: HouseRentalForm) => { - return request({ - url: '/houseRental', - method: 'post', - data: data - }); -}; - -/** - * 修改房屋租赁管理 - * @param data - */ -export const updateHouseRental = (data: HouseRentalForm) => { - return request({ - url: '/houseRental', - method: 'put', - data: data - }); -}; - -/** - * 删除房屋租赁管理 - * @param id - */ -export const delHouseRental = (id: string | number | Array) => { - return request({ - url: '/houseRental/' + id, - method: 'delete' - }); -}; - -/** - * 上传房屋图片 - * @param id - */ -interface uploadHouseImagetype { - 'success': { - 'url': 'string'; - 'fileName': 'string'; - 'ossId': 'string'; - }[]; - 'error': string[]; -} -export const uploadHouseImage = (formData: FormData): AxiosPromise => { - return request({ - url: '/houseRental/uploadImages', - method: 'POST', - data: formData - }); -}; -export const getHouseOwnUser = ( - houseId: string -): AxiosPromise<{ - floorNo: number; - houseArea: number; - ownerName: string; -}> => { - return request({ - url: `/houseRental/ownerName/${houseId}`, - method: 'GET' - }); -}; - -/** - * 房屋租赁管理 改变状态 0:下架 1:上架 - * @param houseId - * */ -export const changeHouseRedientStatus = (houseId: string): AxiosPromise => { - return request({ - url: `/houseRental/changeStatus/${houseId}`, - method: 'PUT' - }); -}; - -/** - * 房屋租赁管理 签约 - * @param data - */ -export const HouseRedientSign = (data: HouseRentalSigningVO): AxiosPromise => { - return request({ - url: `/houseRental/sign`, - method: 'POST', - data: data - }); -}; - -/** - * 房屋租赁管理 签约上传 - * @param url - * @param data - */ -export const HouseRedientSignUpload = (url: string, data: FormData) => { - return request({ - url: url, - method: 'POST', - data: data - }); -}; diff --git a/src/api/system/houseRental/type.ts b/src/api/system/houseRental/type.ts deleted file mode 100644 index 9275a84..0000000 --- a/src/api/system/houseRental/type.ts +++ /dev/null @@ -1,219 +0,0 @@ -export interface HouseRentalVO { - /** - * id 房屋租赁表id - */ - id: string; - - /** - * 租户姓名 - */ - rentalName: string; - - /** - * 租金 单位元 - */ - rent: number; - - /** - * 0 整租 1 合租 - */ - rentalType: string; - - /** - * 房屋朝向 - */ - houseFace: string; - - /** - * 房屋面积 - */ - houseArea: number; - - /** - * 楼层号 - */ - floorNo: number; - - /** - * 入住时间 - */ - inTime: string; - - /** - * 房屋设施(“,”隔开) - */ - facilities: string; - - /** - * 房屋照片url( "," 隔开) - */ - houseImageUrl: string; - - /** - * 补充租房信息 - */ - supInfo: string; - - /** - * 手机号 - */ - phone: string; - - /** - * 微信 - */ - vx: string; - - /** - * 邮箱 - */ - email: string; - - /** - * 房屋id - */ - houseId: string; - /** - * 房屋用途 - */ - houseUse: string; - /** - * 租赁状态 - */ - rentalStatus: number; - - house: string; - name: string; - pubBy: string; - pubTime: string; - houseImageUrls: string[]; - facilitieslist: string[]; - signingList?: HouseRentalSigningVO[]; -} - -export interface HouseRentalForm extends BaseEntity { - id: string; - houseId: string; - rentalName: string; // 租户姓名 - rent: string; // 租金 - houseFace: string; // 房屋朝向 - rentalType: string; // 整租合租 - phone: string; //手机号 - houseArea: number; // 房屋面积 - floorNo: number; //楼层号 - inTime: string; //入住时间 - facilities: string; //房屋设施 - houseImageUrl: string; //房屋图片 - supInfo: string; //补充租房信息 - vx: string; //微信 - houseUse?: string; //房屋用途 - rentalStatus: number; //租赁状态 - buildingId: string; //楼栋id - unitNoId: string; //单元id - email: string; //邮箱 - /** - * 小区id - */ - villageId?: string; -} -export interface HouseRentalSigningVO { - rentAmount: string | number; - depositAmount: string | number; - 'id': string; - 'rentalId': string; - 'contractNo': string; - 'tenantName': string; - 'tenantPhone': string; - 'chargeMode': string; - 'chargeStandard': string; - 'contractName': string; - 'contractStatus': string; - 'leaseStartDate': string; - 'leaseEndDate': string; - 'houseId': string; - contractUrl: string; - 'villageId': string; - 'remark': string; - 'createTime': string; -} - -export interface HouseRentalQuery extends PageQuery { - /** - * 房屋用途 - */ - houseUse?: string; - /** - * 租户姓名 - */ - rentalName?: string; - - /** - * 租金 单位元 - */ - rent?: number; - - /** - * 0 整租 1 合租 - */ - rentalType?: string; - - /** - * 房屋朝向 - */ - houseFace?: string; - - /** - * 房屋面积 - */ - houseArea?: number; - - /** - * 楼层号 - */ - floorNo?: number; - - /** - * 入住时间 - */ - inTime?: string; - - /** - * 房屋设施(“,”隔开) - */ - facilities?: string; - - /** - * 房屋照片url( "," 隔开) - */ - houseImageUrl?: string; - - /** - * 补充租房信息 - */ - supInfo?: string; - - /** - * 手机号 - */ - phone?: number; - - /** - * 微信 - */ - vx?: string; - - /** - * 邮箱 - */ - email?: string; - - /** - * 房屋id - */ - houseId?: string | number; - - /** - * 日期范围参数 - */ - params?: any; -} diff --git a/src/utils/house.ts b/src/utils/house.ts index f28a32c..0cdcd82 100644 --- a/src/utils/house.ts +++ b/src/utils/house.ts @@ -18,7 +18,7 @@ export function convertBuildingToTree(buildings: any[]): Tree[] { const buildingTree: Tree = { label: building.buildingName || '未知楼栋', type: 'buildingId', - value: building.buildingId, + value: building.buildingId ?? building.id, children: [] }; @@ -27,7 +27,7 @@ export function convertBuildingToTree(buildings: any[]): Tree[] { const unitTrees = units.map((unit: any) => { const unitTree: Tree = { label: unit.unitNoName, - value: unit.unitNoId, + value: unit.unitNoId ?? unit.id ?? unit.unitId, type: 'unitNoId', children: [] }; @@ -45,7 +45,7 @@ export function convertBuildingToTree(buildings: any[]): Tree[] { // 房屋直接挂在单元下 unitTree.children = allHouses.map((house: any) => ({ label: house.houseNo || '未知房屋', - value: house.houseId, + value: house.houseId ?? house.id, type: 'houseId' })); // ====================================================== @@ -53,7 +53,14 @@ export function convertBuildingToTree(buildings: any[]): Tree[] { return unitTree; }); - buildingTree.children = unitTrees; + // 3. 兼容接口直接返回楼栋下平铺房屋(无单元层级)的情况 + const buildingHouses = (building.houses || []).map((house: any) => ({ + label: house.houseNo || '未知房屋', + value: house.houseId ?? house.id, + type: 'houseId' + })); + + buildingTree.children = [...unitTrees, ...buildingHouses]; return buildingTree; }); } diff --git a/src/views/system/Sdb/SdbElectricityDevice/index.vue b/src/views/system/Sdb/SdbElectricityDevice/index.vue index a687535..5bbde13 100644 --- a/src/views/system/Sdb/SdbElectricityDevice/index.vue +++ b/src/views/system/Sdb/SdbElectricityDevice/index.vue @@ -504,7 +504,9 @@ const houseStore = useHouseStore(); const userHousePath = ref([]); function handleChange(val: CascaderValue) { userHousePath.value = val; - EditHouseForm.value.houseId = val[2]; + // 兼容有单元/无单元两种树结构,最后一级即房屋id + const path = Array.isArray(val) ? val : []; + EditHouseForm.value.houseId = (path[path.length - 1] ?? '') as string; } // * house diff --git a/src/views/system/Sdb/SdbElectricityShare/index.vue b/src/views/system/Sdb/SdbElectricityShare/index.vue new file mode 100644 index 0000000..8238a45 --- /dev/null +++ b/src/views/system/Sdb/SdbElectricityShare/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/system/house/HouseDetails.vue b/src/views/system/house/HouseDetails.vue index 3b9e612..d13bc04 100644 --- a/src/views/system/house/HouseDetails.vue +++ b/src/views/system/house/HouseDetails.vue @@ -1,378 +1,149 @@ - diff --git a/src/views/system/house/components/building.vue b/src/views/system/house/components/building.vue deleted file mode 100644 index ad8a87f..0000000 --- a/src/views/system/house/components/building.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - - - diff --git a/src/views/system/house/components/components/houseItem.vue b/src/views/system/house/components/components/houseItem.vue deleted file mode 100644 index 48ebce7..0000000 --- a/src/views/system/house/components/components/houseItem.vue +++ /dev/null @@ -1,131 +0,0 @@ - - - - - diff --git a/src/views/system/house/components/components/table.vue b/src/views/system/house/components/components/table.vue deleted file mode 100644 index 0b81798..0000000 --- a/src/views/system/house/components/components/table.vue +++ /dev/null @@ -1,168 +0,0 @@ - - - - - diff --git a/src/views/system/house/components/unit.vue b/src/views/system/house/components/unit.vue deleted file mode 100644 index 1403fa9..0000000 --- a/src/views/system/house/components/unit.vue +++ /dev/null @@ -1,275 +0,0 @@ - - - - - diff --git a/src/views/system/house/index.vue b/src/views/system/house/index.vue index 5d51e5a..494bd14 100644 --- a/src/views/system/house/index.vue +++ b/src/views/system/house/index.vue @@ -1,72 +1,544 @@