|
@@ -1,123 +1,125 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-
|
|
|
|
|
import { onMounted } from 'vue'
|
|
import { onMounted } from 'vue'
|
|
|
import { clientDownloadExcel, clientGet, clientPost } from '@/utils/request.ts'
|
|
import { clientDownloadExcel, clientGet, clientPost } from '@/utils/request.ts'
|
|
|
import { ElLoading, ElMessage } from 'element-plus'
|
|
import { ElLoading, ElMessage } from 'element-plus'
|
|
|
|
|
|
|
|
interface Property {
|
|
interface Property {
|
|
|
- id: string; // 主键
|
|
|
|
|
- receiptNumber?: string; // 收据号
|
|
|
|
|
- building?: string; // 楼栋
|
|
|
|
|
- roomNumber?: string; // 房号
|
|
|
|
|
- collectionTime?: Date; // 收取时间
|
|
|
|
|
- rent?: number; // 房租
|
|
|
|
|
- deposit?: number; // 押金
|
|
|
|
|
- waterFee?: number; // 水费
|
|
|
|
|
- electricityFee?: number; // 电费
|
|
|
|
|
- propertyManagementFee?: number; // 物业管理费
|
|
|
|
|
- rentPeriod?: string; // 租金收取时段
|
|
|
|
|
- handler?: string; // 经手人
|
|
|
|
|
- remarks?: string; // 备注
|
|
|
|
|
- createTime?: Date; // 创建时间
|
|
|
|
|
- createBy?: string; // 创建人
|
|
|
|
|
- updateTime?: Date; // 修改时间
|
|
|
|
|
- updateBy?: string; // 修改人
|
|
|
|
|
|
|
+ id: string // 主键
|
|
|
|
|
+ receiptNumber?: string // 收据号
|
|
|
|
|
+ building?: string // 楼栋
|
|
|
|
|
+ roomNumber?: string // 房号
|
|
|
|
|
+ collectionTime?: Date // 收取时间
|
|
|
|
|
+ rent?: number // 房租
|
|
|
|
|
+ deposit?: number // 押金
|
|
|
|
|
+ waterFee?: number // 水费
|
|
|
|
|
+ electricityFee?: number // 电费
|
|
|
|
|
+ propertyManagementFee?: number // 物业管理费
|
|
|
|
|
+ rentPeriod?: string // 租金收取时段
|
|
|
|
|
+ handler?: string // 经手人
|
|
|
|
|
+ remarks?: string // 备注
|
|
|
|
|
+ createTime?: Date // 创建时间
|
|
|
|
|
+ createBy?: string // 创建人
|
|
|
|
|
+ updateTime?: Date // 修改时间
|
|
|
|
|
+ updateBy?: string // 修改人
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-interface PropertyOneResponse extends BaseResponse{
|
|
|
|
|
- data: Property;
|
|
|
|
|
|
|
+interface PropertyOneResponse extends BaseResponse {
|
|
|
|
|
+ data: Property
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-interface PropertyListResponse extends BaseResponse{
|
|
|
|
|
- data: PageType<Property>;
|
|
|
|
|
|
|
+interface PropertyListResponse extends BaseResponse {
|
|
|
|
|
+ data: PageType<Property>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
interface AddProperty {
|
|
interface AddProperty {
|
|
|
- receiptNumber?: string; // 收据号
|
|
|
|
|
- building?: string; // 楼栋
|
|
|
|
|
- roomNumber?: string; // 房号
|
|
|
|
|
- collectionTime?: Date; // 收取时间
|
|
|
|
|
- rent?: number; // 房租
|
|
|
|
|
- deposit?: number; // 押金
|
|
|
|
|
- waterFee?: number; // 水费
|
|
|
|
|
- electricityFee?: number; // 电费
|
|
|
|
|
- propertyManagementFee?: number; // 物业管理费
|
|
|
|
|
- rentPeriod?: string; // 租金收取时段
|
|
|
|
|
- handler?: string; // 经手人
|
|
|
|
|
- remarks?: string; // 备注
|
|
|
|
|
|
|
+ receiptNumber?: string // 收据号
|
|
|
|
|
+ building?: string // 楼栋
|
|
|
|
|
+ roomNumber?: string // 房号
|
|
|
|
|
+ collectionTime?: Date // 收取时间
|
|
|
|
|
+ rent?: number // 房租
|
|
|
|
|
+ deposit?: number // 押金
|
|
|
|
|
+ waterFee?: number // 水费
|
|
|
|
|
+ electricityFee?: number // 电费
|
|
|
|
|
+ propertyManagementFee?: number // 物业管理费
|
|
|
|
|
+ rentPeriod?: string // 租金收取时段
|
|
|
|
|
+ handler?: string // 经手人
|
|
|
|
|
+ remarks?: string // 备注
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
interface UpdateProperty {
|
|
interface UpdateProperty {
|
|
|
- id?: string;
|
|
|
|
|
- receiptNumber?: string; // 收据号
|
|
|
|
|
- building?: string; // 楼栋
|
|
|
|
|
- roomNumber?: string; // 房号
|
|
|
|
|
- collectionTime?: Date; // 收取时间
|
|
|
|
|
- rent?: number; // 房租
|
|
|
|
|
- deposit?: number; // 押金
|
|
|
|
|
- waterFee?: number; // 水费
|
|
|
|
|
- electricityFee?: number; // 电费
|
|
|
|
|
- propertyManagementFee?: number; // 物业管理费
|
|
|
|
|
- rentPeriod?: string; // 租金收取时段
|
|
|
|
|
- handler?: string; // 经手人
|
|
|
|
|
- remarks?: string; // 备注
|
|
|
|
|
|
|
+ id?: string
|
|
|
|
|
+ receiptNumber?: string // 收据号
|
|
|
|
|
+ building?: string // 楼栋
|
|
|
|
|
+ roomNumber?: string // 房号
|
|
|
|
|
+ collectionTime?: Date // 收取时间
|
|
|
|
|
+ rent?: number // 房租
|
|
|
|
|
+ deposit?: number // 押金
|
|
|
|
|
+ waterFee?: number // 水费
|
|
|
|
|
+ electricityFee?: number // 电费
|
|
|
|
|
+ propertyManagementFee?: number // 物业管理费
|
|
|
|
|
+ rentPeriod?: string // 租金收取时段
|
|
|
|
|
+ handler?: string // 经手人
|
|
|
|
|
+ remarks?: string // 备注
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
//新增
|
|
//新增
|
|
|
-const add = async (data:AddProperty) =>{
|
|
|
|
|
- const res = await clientPost<AddProperty,BaseResponse>('/apublicRentalHousing/save',{
|
|
|
|
|
- ...data
|
|
|
|
|
|
|
+const add = async (data: AddProperty) => {
|
|
|
|
|
+ const res = await clientPost<AddProperty, BaseResponse>('/equarterlyElectricityBill/save', {
|
|
|
|
|
+ ...data,
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- if(res.code !== 200){
|
|
|
|
|
- ElMessage.error(res.msg);
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ if (res.code !== 200) {
|
|
|
|
|
+ ElMessage.error(res.msg)
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ElMessage.success(res.msg);
|
|
|
|
|
|
|
+ ElMessage.success(res.msg)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//根据id获取数据
|
|
//根据id获取数据
|
|
|
-const getById = async (id:string) =>{
|
|
|
|
|
- const res = await clientGet<null,PropertyOneResponse>('/apublicRentalHousing/getById/'+id);
|
|
|
|
|
- if(res.code !== 200){
|
|
|
|
|
- ElMessage.error(res.msg);
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+const getById = async (id: string) => {
|
|
|
|
|
+ const res = await clientGet<null, PropertyOneResponse>('/equarterlyElectricityBill/getById/' + id)
|
|
|
|
|
+ if (res.code !== 200) {
|
|
|
|
|
+ ElMessage.error(res.msg)
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
- console.log(res.data);
|
|
|
|
|
|
|
+ console.log(res.data)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//分页获取数据
|
|
//分页获取数据
|
|
|
-const getList = async () =>{
|
|
|
|
|
- const res = await clientGet<{
|
|
|
|
|
- pageNum: number;
|
|
|
|
|
- pageSize: number;
|
|
|
|
|
- receiptNumber?: string;
|
|
|
|
|
- roomNumber?: string;
|
|
|
|
|
- building?: string;
|
|
|
|
|
- },PropertyListResponse>('/apublicRentalHousing/findByPage',{
|
|
|
|
|
- params:{
|
|
|
|
|
|
|
+const getList = async () => {
|
|
|
|
|
+ const res = await clientGet<
|
|
|
|
|
+ {
|
|
|
|
|
+ pageNum: number
|
|
|
|
|
+ pageSize: number
|
|
|
|
|
+ receiptNumber?: string
|
|
|
|
|
+ roomNumber?: string
|
|
|
|
|
+ building?: string
|
|
|
|
|
+ },
|
|
|
|
|
+ PropertyListResponse
|
|
|
|
|
+ >('/equarterlyElectricityBill/findByPage', {
|
|
|
|
|
+ params: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
- building:'',//这是模糊搜索的值(如果没有值就不要传个空的过去)
|
|
|
|
|
- roomNumber:'',//这是模糊搜索的值(如果没有值就不要传个空的过去)
|
|
|
|
|
- receiptNumber:''//这是模糊搜索的值(如果没有值就不要传个空的过去)
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- if(res.code !== 200){
|
|
|
|
|
- ElMessage.error(res.msg);
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ building: '', //这是模糊搜索的值(如果没有值就不要传个空的过去)
|
|
|
|
|
+ roomNumber: '', //这是模糊搜索的值(如果没有值就不要传个空的过去)
|
|
|
|
|
+ receiptNumber: '', //这是模糊搜索的值(如果没有值就不要传个空的过去)
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ if (res.code !== 200) {
|
|
|
|
|
+ ElMessage.error(res.msg)
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
- console.log(res.data);
|
|
|
|
|
|
|
+ console.log(res.data)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//批量删除
|
|
//批量删除
|
|
|
const delBatch = async (ids: string[]) => {
|
|
const delBatch = async (ids: string[]) => {
|
|
|
- const res = await clientPost<string, BaseResponse>('/apublicRentalHousing/deleteBatch', JSON.stringify(ids));
|
|
|
|
|
|
|
+ const res = await clientPost<string, BaseResponse>(
|
|
|
|
|
+ '/equarterlyElectricityBill/deleteBatch',
|
|
|
|
|
+ JSON.stringify(ids),
|
|
|
|
|
+ )
|
|
|
if (res.code !== 200) {
|
|
if (res.code !== 200) {
|
|
|
ElMessage.error(res.msg)
|
|
ElMessage.error(res.msg)
|
|
|
return
|
|
return
|
|
@@ -126,16 +128,16 @@ const delBatch = async (ids: string[]) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//修改
|
|
//修改
|
|
|
-const update = async (updateId:string,data:UpdateProperty) =>{
|
|
|
|
|
- const res = await clientPost<UpdateProperty,BaseResponse>('/apublicRentalHousing/update',{
|
|
|
|
|
|
|
+const update = async (updateId: string, data: UpdateProperty) => {
|
|
|
|
|
+ const res = await clientPost<UpdateProperty, BaseResponse>('/equarterlyElectricityBill/update', {
|
|
|
...data,
|
|
...data,
|
|
|
- id:updateId
|
|
|
|
|
|
|
+ id: updateId,
|
|
|
})
|
|
})
|
|
|
- if(res.code !== 200){
|
|
|
|
|
- ElMessage.error(res.msg);
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ if (res.code !== 200) {
|
|
|
|
|
+ ElMessage.error(res.msg)
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
- ElMessage.success(res.msg);
|
|
|
|
|
|
|
+ ElMessage.success(res.msg)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//导出为excel
|
|
//导出为excel
|
|
@@ -148,11 +150,11 @@ const exportExcel = async () => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- await clientDownloadExcel('/apublicRentalHousing/exportData', {
|
|
|
|
|
|
|
+ await clientDownloadExcel('/equarterlyElectricityBill/exportData', {
|
|
|
params: {
|
|
params: {
|
|
|
- roomNumber: '',//这是模糊搜索的值(如果没有值就不要传个空的过去)
|
|
|
|
|
- building: '',//这是模糊搜索的值(如果没有值就不要传个空的过去)
|
|
|
|
|
- receiptNumber: '',//这是模糊搜索的值(如果没有值就不要传个空的过去)
|
|
|
|
|
|
|
+ roomNumber: '', //这是模糊搜索的值(如果没有值就不要传个空的过去)
|
|
|
|
|
+ building: '', //这是模糊搜索的值(如果没有值就不要传个空的过去)
|
|
|
|
|
+ receiptNumber: '', //这是模糊搜索的值(如果没有值就不要传个空的过去)
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -165,27 +167,24 @@ const exportExcel = async () => {
|
|
|
|
|
|
|
|
//excel导入
|
|
//excel导入
|
|
|
const importExcel = async (file: File) => {
|
|
const importExcel = async (file: File) => {
|
|
|
- const res = await clientPost<{file: File},BaseResponse>('/apublicRentalHousing/importData',{
|
|
|
|
|
- file
|
|
|
|
|
- })
|
|
|
|
|
- if(res.code !== 200){
|
|
|
|
|
- ElMessage.error(res.msg);
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ const res = await clientPost<{ file: File }, BaseResponse>(
|
|
|
|
|
+ '/equarterlyElectricityBill/importData',
|
|
|
|
|
+ {
|
|
|
|
|
+ file,
|
|
|
|
|
+ },
|
|
|
|
|
+ )
|
|
|
|
|
+ if (res.code !== 200) {
|
|
|
|
|
+ ElMessage.error(res.msg)
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
- ElMessage.success(res.msg);
|
|
|
|
|
|
|
+ ElMessage.success(res.msg)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const init = () => {}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-const init = () => {
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-onMounted(()=>{
|
|
|
|
|
- init();
|
|
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ init()
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|