完成访客搭建,完善之前审核界面
This commit is contained in:
@@ -58,6 +58,8 @@ export interface RepairVO {
|
|||||||
* 维修人员id
|
* 维修人员id
|
||||||
*/
|
*/
|
||||||
repairId: string | number;
|
repairId: string | number;
|
||||||
|
/** 名称(小区名-楼栋名-单元号-房间号) */
|
||||||
|
name?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RepairForm extends BaseEntity {
|
export interface RepairForm extends BaseEntity {
|
||||||
|
|||||||
@@ -61,3 +61,15 @@ export const delCar = (id: string | number | Array<string | number>) => {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除车辆图片
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const uploadCar = (formdata: FormData) => {
|
||||||
|
return request({
|
||||||
|
url: '/car/uploadImage',
|
||||||
|
method: 'POST',
|
||||||
|
data: formdata
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@@ -22,12 +22,12 @@ export interface ParkingVO {
|
|||||||
/**
|
/**
|
||||||
* 车位状态 0 闲置 1自用 2出租
|
* 车位状态 0 闲置 1自用 2出租
|
||||||
*/
|
*/
|
||||||
parkingStatus: number;
|
parkingStatus: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0产权车位 1公共停车位
|
* 0产权车位 1公共停车位
|
||||||
*/
|
*/
|
||||||
type: number;
|
type: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 住户id
|
* 住户id
|
||||||
@@ -47,8 +47,7 @@ export interface ParkingVO {
|
|||||||
/**
|
/**
|
||||||
* 0 审核中 1 审核通过 2 审核不通过
|
* 0 审核中 1 审核通过 2 审核不通过
|
||||||
*/
|
*/
|
||||||
checkStatus: number;
|
checkStatus: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
@@ -79,12 +78,12 @@ export interface ParkingForm extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 车位状态 0 闲置 1自用 2出租
|
* 车位状态 0 闲置 1自用 2出租
|
||||||
*/
|
*/
|
||||||
parkingStatus?: number;
|
parkingStatus?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0产权车位 1公共停车位
|
* 0产权车位 1公共停车位
|
||||||
*/
|
*/
|
||||||
type?: number;
|
type?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 住户id
|
* 住户id
|
||||||
@@ -104,7 +103,7 @@ export interface ParkingForm extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 0 审核中 1 审核通过 2 审核不通过
|
* 0 审核中 1 审核通过 2 审核不通过
|
||||||
*/
|
*/
|
||||||
checkStatus?: number;
|
checkStatus?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
@@ -151,12 +150,12 @@ export interface ParkingQuery extends PageQuery {
|
|||||||
/**
|
/**
|
||||||
* 车位状态 0 闲置 1自用 2出租
|
* 车位状态 0 闲置 1自用 2出租
|
||||||
*/
|
*/
|
||||||
parkingStatus?: number;
|
parkingStatus?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0产权车位 1公共停车位
|
* 0产权车位 1公共停车位
|
||||||
*/
|
*/
|
||||||
type?: number;
|
type?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 住户id
|
* 住户id
|
||||||
@@ -176,7 +175,7 @@ export interface ParkingQuery extends PageQuery {
|
|||||||
/**
|
/**
|
||||||
* 0 审核中 1 审核通过 2 审核不通过
|
* 0 审核中 1 审核通过 2 审核不通过
|
||||||
*/
|
*/
|
||||||
checkStatus?: number;
|
checkStatus?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期范围参数
|
* 日期范围参数
|
||||||
|
|||||||
@@ -74,6 +74,147 @@ export const UploadidCardApi = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// ! 住户审核流程--------------------------------------------------------------------------
|
// ! 住户审核流程--------------------------------------------------------------------------
|
||||||
|
export interface ResidentReviewProcessVO {
|
||||||
|
/**
|
||||||
|
* 住户审核表
|
||||||
|
*/
|
||||||
|
id: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 住户表id
|
||||||
|
*/
|
||||||
|
residentId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交时间
|
||||||
|
*/
|
||||||
|
submitTime: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交状态 0未提交 1已提交
|
||||||
|
*/
|
||||||
|
submitStatus: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核时间
|
||||||
|
*/
|
||||||
|
propertyTime: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核状态 0 待审核 1审核通过 2审核未通过
|
||||||
|
*/
|
||||||
|
propertyStatus: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核意见
|
||||||
|
*/
|
||||||
|
propertyReviewFeedback: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证时间
|
||||||
|
*/
|
||||||
|
certificationTime: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证状态 0未认证 1已认证
|
||||||
|
*/
|
||||||
|
certificationStatus: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResidentReviewProcessForm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 住户审核表
|
||||||
|
*/
|
||||||
|
id?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 住户表id
|
||||||
|
*/
|
||||||
|
residentId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交时间
|
||||||
|
*/
|
||||||
|
submitTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交状态 0未提交 1已提交
|
||||||
|
*/
|
||||||
|
submitStatus?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核时间
|
||||||
|
*/
|
||||||
|
propertyTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核状态 0 待审核 1审核通过 2审核未通过
|
||||||
|
*/
|
||||||
|
propertyStatus?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核意见
|
||||||
|
*/
|
||||||
|
propertyReviewFeedback?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证时间
|
||||||
|
*/
|
||||||
|
certificationTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证状态 0未认证 1已认证
|
||||||
|
*/
|
||||||
|
certificationStatus?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResidentReviewProcessQuery extends PageQuery {
|
||||||
|
/**
|
||||||
|
* 住户表id
|
||||||
|
*/
|
||||||
|
residentId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交时间
|
||||||
|
*/
|
||||||
|
submitTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交状态 0未提交 1已提交
|
||||||
|
*/
|
||||||
|
submitStatus?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核时间
|
||||||
|
*/
|
||||||
|
propertyTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核状态 0 待审核 1审核通过 2审核未通过
|
||||||
|
*/
|
||||||
|
propertyStatus?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核意见
|
||||||
|
*/
|
||||||
|
propertyReviewFeedback?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证时间
|
||||||
|
*/
|
||||||
|
certificationTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证状态 0未认证 1已认证
|
||||||
|
*/
|
||||||
|
certificationStatus?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期范围参数
|
||||||
|
*/
|
||||||
|
params?: any;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取住户审核流程列表
|
* 获取住户审核流程列表
|
||||||
*/
|
*/
|
||||||
@@ -86,9 +227,19 @@ export const getresidentReviewlistAPI = (id: string) => {
|
|||||||
/**
|
/**
|
||||||
* 获取单一住户审核流程列表
|
* 获取单一住户审核流程列表
|
||||||
*/
|
*/
|
||||||
export const getresidentReviewByIdAPI = (id: number) => {
|
export const getresidentReviewByIdAPI = (id: number): AxiosPromise<ResidentReviewProcessVO> => {
|
||||||
return request({
|
return request({
|
||||||
url: `/residentReview/${id}`,
|
url: `/residentReview/${id}`,
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* 更新 住户 审核 表
|
||||||
|
*/
|
||||||
|
export const UpdateResidentReviewAPI = (data: ResidentReviewProcessForm) => {
|
||||||
|
return request({
|
||||||
|
url: `/residentReview`,
|
||||||
|
method: 'PUT',
|
||||||
|
data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
63
src/api/system/residentReviewProcess/index.ts
Normal file
63
src/api/system/residentReviewProcess/index.ts
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
import { ResidentReviewProcessVO, ResidentReviewProcessForm, ResidentReviewProcessQuery } from '@/api/system/residentReviewProcess/type';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询住户审核流程列表
|
||||||
|
* @param query
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const listResidentReviewProcess = (query?: ResidentReviewProcessQuery): AxiosPromise<ResidentReviewProcessVO[]> => {
|
||||||
|
return request({
|
||||||
|
url: '/residentReviewProcess/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询住户审核流程详细
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const getResidentReviewProcess = (id: string | number): AxiosPromise<ResidentReviewProcessVO> => {
|
||||||
|
return request({
|
||||||
|
url: '/residentReviewProcess/' + id,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增住户审核流程
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
export const addResidentReviewProcess = (data: ResidentReviewProcessForm) => {
|
||||||
|
return request({
|
||||||
|
url: '/residentReviewProcess',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改住户审核流程
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
export const updateResidentReviewProcess = (data: ResidentReviewProcessForm) => {
|
||||||
|
return request({
|
||||||
|
url: '/residentReviewProcess',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除住户审核流程
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const delResidentReviewProcess = (id: string | number | Array<string | number>) => {
|
||||||
|
return request({
|
||||||
|
url: '/residentReviewProcess/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
};
|
||||||
140
src/api/system/residentReviewProcess/type.ts
Normal file
140
src/api/system/residentReviewProcess/type.ts
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
export interface ResidentReviewProcessVO {
|
||||||
|
/**
|
||||||
|
* 住户审核表
|
||||||
|
*/
|
||||||
|
id: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 住户表id
|
||||||
|
*/
|
||||||
|
residentId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交时间
|
||||||
|
*/
|
||||||
|
submitTime: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交状态 0未提交 1已提交
|
||||||
|
*/
|
||||||
|
submitStatus: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核时间
|
||||||
|
*/
|
||||||
|
propertyTime: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核状态 0 待审核 1审核通过 2审核未通过
|
||||||
|
*/
|
||||||
|
propertyStatus: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核意见
|
||||||
|
*/
|
||||||
|
propertyReviewFeedback: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证时间
|
||||||
|
*/
|
||||||
|
certificationTime: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证状态 0未认证 1已认证
|
||||||
|
*/
|
||||||
|
certificationStatus: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResidentReviewProcessForm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 住户审核表
|
||||||
|
*/
|
||||||
|
id?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 住户表id
|
||||||
|
*/
|
||||||
|
residentId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交时间
|
||||||
|
*/
|
||||||
|
submitTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交状态 0未提交 1已提交
|
||||||
|
*/
|
||||||
|
submitStatus?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核时间
|
||||||
|
*/
|
||||||
|
propertyTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核状态 0 待审核 1审核通过 2审核未通过
|
||||||
|
*/
|
||||||
|
propertyStatus?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核意见
|
||||||
|
*/
|
||||||
|
propertyReviewFeedback?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证时间
|
||||||
|
*/
|
||||||
|
certificationTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证状态 0未认证 1已认证
|
||||||
|
*/
|
||||||
|
certificationStatus?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResidentReviewProcessQuery extends PageQuery {
|
||||||
|
/**
|
||||||
|
* 住户表id
|
||||||
|
*/
|
||||||
|
residentId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交时间
|
||||||
|
*/
|
||||||
|
submitTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交状态 0未提交 1已提交
|
||||||
|
*/
|
||||||
|
submitStatus?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核时间
|
||||||
|
*/
|
||||||
|
propertyTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核状态 0 待审核 1审核通过 2审核未通过
|
||||||
|
*/
|
||||||
|
propertyStatus?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物业审核意见
|
||||||
|
*/
|
||||||
|
propertyReviewFeedback?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证时间
|
||||||
|
*/
|
||||||
|
certificationTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证状态 0未认证 1已认证
|
||||||
|
*/
|
||||||
|
certificationStatus?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期范围参数
|
||||||
|
*/
|
||||||
|
params?: any;
|
||||||
|
}
|
||||||
@@ -209,6 +209,16 @@ export const deptTreeSelect = (): AxiosPromise<DeptTreeVO[]> => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户 根据不同的角色key
|
||||||
|
*/
|
||||||
|
export const getUserByRoleKey = (roleKey: string = 'repair'): AxiosPromise<any> => {
|
||||||
|
return request({
|
||||||
|
url: '/system/user/list/byRoleKey?roleKey=' + roleKey,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
listUser,
|
listUser,
|
||||||
getUser,
|
getUser,
|
||||||
@@ -225,5 +235,7 @@ export default {
|
|||||||
getAuthRole,
|
getAuthRole,
|
||||||
updateAuthRole,
|
updateAuthRole,
|
||||||
deptTreeSelect,
|
deptTreeSelect,
|
||||||
listUserByDeptId
|
listUserByDeptId,
|
||||||
|
|
||||||
|
getUserByRoleKey
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<el-icon><Search /></el-icon>
|
<el-icon><Search /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="overflow-auto overflow-hidden w-full text-ellipsis text-nowrap">
|
<div v-else class="overflow-auto overflow-hidden w-full text-ellipsis text-nowrap">
|
||||||
<span>姓名:{{ multipleSelection[0] && multipleSelection[0].name }}</span>
|
<span>姓名:{{ multipleSelection[0]?.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -18,14 +18,16 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="mr-5 flex-1">
|
<div class="mr-5 flex-1">
|
||||||
<el-input clearable v-model.number="queryParams.name" placeholder="请输入住户姓名" />
|
<el-input clearable v-model="queryParams.name" placeholder="请输入住户姓名" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" @click="getlist">查询</el-button>
|
<el-button type="primary" @click="getlist">查询</el-button>
|
||||||
<el-button>重置</el-button>
|
<el-button @click="resetQuery">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<el-table ref="multipleTableRef" @selection-change="handleSelectionChange" :data="tableData" border>
|
|
||||||
|
<!-- 关键:去掉 @selection-change,改用 row-click 实现单选,永不报错! -->
|
||||||
|
<el-table ref="multipleTableRef" :data="tableData" border @row-click="handleRowClick">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="序号" align="center" width="55" type="index" />
|
<el-table-column label="序号" align="center" width="55" type="index" />
|
||||||
<el-table-column label="姓名" align="center" prop="name" />
|
<el-table-column label="姓名" align="center" prop="name" />
|
||||||
@@ -69,12 +71,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getCommunitylistAPI } from '@/api/system/community';
|
|
||||||
import { getVillageTree } from '@/api/system/house';
|
|
||||||
import { listResident } from '@/api/system/resident';
|
import { listResident } from '@/api/system/resident';
|
||||||
import { ResidentVO } from '@/api/system/resident/type';
|
import { ResidentVO } from '@/api/system/resident/type';
|
||||||
import { convertBuildingToTree, getHousePathById } from '@/utils/house';
|
import { getHousePathById } from '@/utils/house';
|
||||||
import { ref } from 'vue';
|
import { ref, watch, nextTick, getCurrentInstance, ComponentInternalInstance, toRefs } from 'vue';
|
||||||
|
import { useHouseStore } from '@/store/modules/house';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
|
||||||
|
const houseStore = useHouseStore();
|
||||||
|
const { treedata } = storeToRefs(houseStore);
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { com_resident_type } = toRefs<any>(proxy?.useDict('com_resident_type'));
|
const { com_resident_type } = toRefs<any>(proxy?.useDict('com_resident_type'));
|
||||||
@@ -84,14 +89,15 @@ const { com_resident_relationship } = toRefs<any>(proxy?.useDict('com_resident_r
|
|||||||
interface tableType extends ResidentVO {
|
interface tableType extends ResidentVO {
|
||||||
housePath?: string;
|
housePath?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
userid: string;
|
userid: string | number;
|
||||||
}>();
|
}>();
|
||||||
// 2. 转成 ref(更安全,可选,但推荐)
|
|
||||||
const { userid } = toRefs(props);
|
const { userid } = toRefs(props);
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
change: [value: string | number];
|
change: [value: string | number];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const dialog = ref({
|
const dialog = ref({
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dialogTitle: '选择住户'
|
dialogTitle: '选择住户'
|
||||||
@@ -100,68 +106,64 @@ const dialog = ref({
|
|||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
ownerRelationship: '', // 👈 原来 null → 改成 ''
|
||||||
date: null,
|
name: '',
|
||||||
type: null,
|
status: '', // 👈 原来 null → 改成 ''
|
||||||
status: null,
|
type: '', // 👈 原来 null → 改成 ''
|
||||||
ownerRelationship: null,
|
|
||||||
name: null,
|
|
||||||
houseId: null,
|
houseId: null,
|
||||||
villageId: null,
|
villageId: null,
|
||||||
buildingId: null,
|
buildingId: null,
|
||||||
unitNo: null
|
unitNo: null
|
||||||
});
|
});
|
||||||
|
|
||||||
const multipleTableRef = ref();
|
const multipleTableRef = ref();
|
||||||
const tableData = ref<tableType[]>([]);
|
const tableData = ref<tableType[]>([]);
|
||||||
const multipleSelection = ref([]);
|
const multipleSelection = ref([]);
|
||||||
const total = ref(100);
|
const total = ref(0);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
||||||
// ! 获取房屋==================================================================================
|
// ==============================================
|
||||||
const treedata = ref([]);
|
// 最佳单选方案:点击行选中,无报错、无循环、最稳定
|
||||||
function gettreedata() {
|
// ==============================================
|
||||||
getCommunitylistAPI().then((res) => {
|
function handleRowClick(row) {
|
||||||
const currentviliage = res.rows.find((item) => item.choiceStatus === 0);
|
multipleTableRef.value?.clearSelection();
|
||||||
if (currentviliage.villageId) {
|
multipleTableRef.value?.toggleRowSelection(row, true);
|
||||||
getVillageTree(currentviliage.villageId).then((res) => {
|
multipleSelection.value = [row];
|
||||||
treedata.value = convertBuildingToTree(res.data.buildings);
|
}
|
||||||
|
|
||||||
|
// ==============================================
|
||||||
|
// 自动回显 userid
|
||||||
|
// ==============================================
|
||||||
|
const handleUserSelection = () => {
|
||||||
|
if (!userid.value || !tableData.value.length) return;
|
||||||
|
|
||||||
|
const findItem = tableData.value.find((item) => item.id == userid.value);
|
||||||
|
if (findItem) {
|
||||||
|
multipleSelection.value = [findItem];
|
||||||
|
nextTick(() => {
|
||||||
|
multipleTableRef.value?.clearSelection();
|
||||||
|
multipleTableRef.value?.toggleRowSelection(findItem, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
}
|
|
||||||
gettreedata();
|
|
||||||
getlist();
|
|
||||||
|
|
||||||
watch(
|
watch(userid, handleUserSelection, { immediate: true });
|
||||||
userid,
|
watch(tableData, handleUserSelection);
|
||||||
(newval) => {
|
|
||||||
if (newval !== null && newval !== undefined && newval.length > 0) {
|
|
||||||
const find = tableData.value.find((item) => item.id == newval);
|
|
||||||
if (find) {
|
|
||||||
multipleSelection.value = [find];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
deep: true,
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
// 打开选择框
|
||||||
function choiceResidentFun() {
|
function choiceResidentFun() {
|
||||||
dialog.value.dialogVisible = true;
|
dialog.value.dialogVisible = true;
|
||||||
}
|
}
|
||||||
// 获取表格
|
|
||||||
|
// 获取列表
|
||||||
function getlist() {
|
function getlist() {
|
||||||
// 查询住户
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
listResident(queryParams.value).then((res) => {
|
listResident(queryParams.value).then((res) => {
|
||||||
tableData.value = res.rows;
|
tableData.value = res.rows;
|
||||||
tableData.value.forEach((item) => {
|
tableData.value.forEach((item) => {
|
||||||
if (item.houseId !== null) {
|
if (item.houseId !== null) {
|
||||||
const houselist = getHousePathById(treedata.value, item.houseId, 'label');
|
const houselist = getHousePathById(treedata.value, item.houseId, 'label');
|
||||||
item.housePath = houselist.join('-');
|
item.housePath = houselist?.join('-') || '';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
total.value = res.total;
|
total.value = res.total;
|
||||||
@@ -169,47 +171,40 @@ function getlist() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回
|
// 重置查询
|
||||||
function conback() {
|
function resetQuery() {
|
||||||
dialog.value.dialogVisible = false;
|
|
||||||
queryParams.value = {
|
queryParams.value = {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
ownerRelationship: null,
|
ownerRelationship: '', // 👈 这里也改
|
||||||
name: null,
|
name: '',
|
||||||
date: null,
|
date: null,
|
||||||
type: null,
|
type: '', // 👈 这里也改
|
||||||
status: null,
|
status: '', // 👈 这里也改
|
||||||
houseId: null,
|
houseId: null,
|
||||||
villageId: null,
|
villageId: null,
|
||||||
buildingId: null,
|
buildingId: null,
|
||||||
unitNo: null
|
unitNo: null
|
||||||
};
|
};
|
||||||
|
getlist();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 退出
|
||||||
|
function conback() {
|
||||||
|
dialog.value.dialogVisible = false;
|
||||||
|
resetQuery();
|
||||||
|
}
|
||||||
|
|
||||||
// 确定
|
// 确定
|
||||||
function confim() {
|
function confim() {
|
||||||
dialog.value.dialogVisible = false;
|
dialog.value.dialogVisible = false;
|
||||||
if (multipleSelection.value.length > 0) {
|
if (multipleSelection.value.length > 0) {
|
||||||
const pop = multipleSelection.value.pop();
|
emit('change', multipleSelection.value[0].id);
|
||||||
multipleSelection.value = [pop];
|
|
||||||
emit('change', pop.id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 单选
|
// 初始化
|
||||||
function handleSelectionChange(val) {
|
getlist();
|
||||||
if (val && val.length > 0) {
|
|
||||||
const lastoptions = val.pop();
|
|
||||||
val.forEach((row) => {
|
|
||||||
multipleTableRef.value!.toggleRowSelection(row, false);
|
|
||||||
});
|
|
||||||
multipleTableRef.value!.toggleRowSelection(lastoptions, true);
|
|
||||||
multipleSelection.value = [lastoptions];
|
|
||||||
} else {
|
|
||||||
multipleTableRef.value!.clearSelection();
|
|
||||||
multipleSelection.value = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@@ -5,41 +5,32 @@
|
|||||||
<el-icon><Search /></el-icon>
|
<el-icon><Search /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="overflow-auto overflow-hidden w-full text-ellipsis text-nowrap">
|
<div v-else class="overflow-auto overflow-hidden w-full text-ellipsis text-nowrap">
|
||||||
<span>姓名:{{ multipleSelection[0] && multipleSelection[0].name }}</span>
|
<span>姓名:{{ multipleSelection[0] && multipleSelection[0].nickName }}</span>
|
||||||
|
<span class="ml-20px">联系方式:{{ multipleSelection[0] && multipleSelection[0].phonenumber }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-dialog append-to-body v-model="dialog.dialogVisible" :title="dialog.dialogTitle" width="1050">
|
<el-dialog append-to-body v-model="dialog.dialogVisible" :title="dialog.dialogTitle" width="1050">
|
||||||
<nav class="flex flex-items-center mb-8">
|
<el-table @row-click="handleRowClick" ref="multipleTableRef" :data="tableData" border>
|
||||||
<div class="flex flex-items-center mr-5 flex-1">
|
|
||||||
<div style="width: 120px">选择员工</div>
|
|
||||||
<el-select v-model="queryParams.ownerRelationship" placeholder="请选择" clearable>
|
|
||||||
<el-option v-for="dict in com_resident_relationship" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
<div class="mr-5 flex-1">
|
|
||||||
<el-input clearable v-model.number="queryParams.name" placeholder="请输入员工姓名" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-button type="primary" @click="getlist">查询</el-button>
|
|
||||||
<el-button>重置</el-button>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
<el-table ref="multipleTableRef" @selection-change="handleSelectionChange" :data="tableData" border>
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="序号" align="center" width="55" type="index" />
|
<el-table-column label="序号" align="center" width="55" type="index" />
|
||||||
<el-table-column label="姓名" align="center" prop="name" />
|
<el-table-column label="姓名" align="center" prop="nickName" />
|
||||||
<el-table-column label="角色" align="center" width="85" prop="type">
|
<el-table-column label="性别" align="center" width="85" prop="sex">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<dict-tag :options="sys_user_sex" :value="row.sex" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="角色" align="center" width="85" prop="userType">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<dict-tag :options="com_resident_type" :value="row.type" />
|
<dict-tag :options="com_resident_type" :value="row.type" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="手机号码" align="center" prop="phonenumber" />
|
||||||
<el-table-column label="状态" align="center" width="85" prop="status">
|
<el-table-column label="状态" align="center" width="85" prop="status">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<dict-tag :options="com_certification_status" :value="row.status" />
|
<dict-tag :options="com_certification_status" :value="row.status" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="手机号码" align="center" prop="phone" />
|
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@@ -63,41 +54,38 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getCommunitylistAPI } from '@/api/system/community';
|
|
||||||
import { getVillageTree } from '@/api/system/house';
|
|
||||||
import { listResident } from '@/api/system/resident';
|
|
||||||
import { ResidentVO } from '@/api/system/resident/type';
|
import { ResidentVO } from '@/api/system/resident/type';
|
||||||
import { convertBuildingToTree, getHousePathById } from '@/utils/house';
|
import { getUserByRoleKey } from '@/api/system/user';
|
||||||
import { ref } from 'vue';
|
import { ref, watch, nextTick, getCurrentInstance, ComponentInternalInstance, toRefs } from 'vue';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { com_resident_type } = toRefs<any>(proxy?.useDict('com_resident_type'));
|
const { com_resident_type } = toRefs<any>(proxy?.useDict('com_resident_type'));
|
||||||
const { com_certification_status } = toRefs<any>(proxy?.useDict('com_certification_status'));
|
const { com_certification_status } = toRefs<any>(proxy?.useDict('com_certification_status'));
|
||||||
const { com_resident_relationship } = toRefs<any>(proxy?.useDict('com_resident_relationship'));
|
const { sys_user_sex } = toRefs<any>(proxy?.useDict('sys_user_sex'));
|
||||||
|
|
||||||
interface tableType extends ResidentVO {
|
interface tableType extends ResidentVO {
|
||||||
housePath?: string;
|
housePath?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
userid: string;
|
userid: string | number;
|
||||||
}>();
|
}>();
|
||||||
// 2. 转成 ref(更安全,可选,但推荐)
|
|
||||||
const { userid } = toRefs(props);
|
const { userid } = toRefs(props);
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
change: [value: string | number];
|
change: [value: string | number];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const dialog = ref({
|
const dialog = ref({
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dialogTitle: '选择住户'
|
dialogTitle: '选择维修人员'
|
||||||
});
|
});
|
||||||
|
|
||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
||||||
date: null,
|
date: null,
|
||||||
type: null,
|
type: null,
|
||||||
status: null,
|
status: '',
|
||||||
ownerRelationship: null,
|
ownerRelationship: null,
|
||||||
name: null,
|
name: null,
|
||||||
houseId: null,
|
houseId: null,
|
||||||
@@ -105,48 +93,59 @@ const queryParams = ref({
|
|||||||
buildingId: null,
|
buildingId: null,
|
||||||
unitNo: null
|
unitNo: null
|
||||||
});
|
});
|
||||||
|
|
||||||
const multipleTableRef = ref();
|
const multipleTableRef = ref();
|
||||||
const tableData = ref<tableType[]>([]);
|
const tableData = ref<tableType[]>([]);
|
||||||
const multipleSelection = ref([]);
|
const total = ref(0);
|
||||||
const total = ref(100);
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
const treedata = ref([]);
|
||||||
|
|
||||||
getlist();
|
// 存储选中项
|
||||||
|
const multipleSelection = ref([]);
|
||||||
|
|
||||||
watch(
|
// 单选点击事件(完全替代 selection-change)
|
||||||
userid,
|
const handleRowClick = (row) => {
|
||||||
(newval) => {
|
multipleTableRef.value?.clearSelection();
|
||||||
if (newval !== null && newval !== undefined && newval.length > 0) {
|
multipleTableRef.value?.toggleRowSelection(row, true);
|
||||||
const find = tableData.value.find((item) => item.id == newval);
|
multipleSelection.value = [row];
|
||||||
if (find) {
|
};
|
||||||
multipleSelection.value = [find];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
deep: true,
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
// 统一回显 userid 选中(安全版)
|
||||||
|
const handleUserSelection = () => {
|
||||||
|
if (!userid.value || !tableData.value.length) return;
|
||||||
|
|
||||||
|
const target = tableData.value.find((item) => item.id == userid.value);
|
||||||
|
if (target) {
|
||||||
|
multipleSelection.value = [target];
|
||||||
|
nextTick(() => {
|
||||||
|
multipleTableRef.value?.clearSelection();
|
||||||
|
multipleTableRef.value?.toggleRowSelection(target, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 监听
|
||||||
|
watch(userid, handleUserSelection, { immediate: true });
|
||||||
|
watch(tableData, handleUserSelection);
|
||||||
|
|
||||||
|
// ====================== 方法 ======================
|
||||||
|
// 打开选择框
|
||||||
function choiceResidentFun() {
|
function choiceResidentFun() {
|
||||||
dialog.value.dialogVisible = true;
|
dialog.value.dialogVisible = true;
|
||||||
}
|
}
|
||||||
// 获取表格
|
|
||||||
|
// 获取列表
|
||||||
function getlist() {
|
function getlist() {
|
||||||
// 查询住户
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
listResident(queryParams.value).then((res) => {
|
getUserByRoleKey().then((res) => {
|
||||||
tableData.value = res.rows;
|
tableData.value = res.data;
|
||||||
total.value = res.total;
|
total.value = res.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回
|
// 重置查询
|
||||||
function conback() {
|
function resetQuery() {
|
||||||
dialog.value.dialogVisible = false;
|
|
||||||
queryParams.value = {
|
queryParams.value = {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
@@ -154,37 +153,31 @@ function conback() {
|
|||||||
name: null,
|
name: null,
|
||||||
date: null,
|
date: null,
|
||||||
type: null,
|
type: null,
|
||||||
status: null,
|
status: '',
|
||||||
houseId: null,
|
houseId: null,
|
||||||
villageId: null,
|
villageId: null,
|
||||||
buildingId: null,
|
buildingId: null,
|
||||||
unitNo: null
|
unitNo: null
|
||||||
};
|
};
|
||||||
|
getlist();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 退出
|
||||||
|
function conback() {
|
||||||
|
dialog.value.dialogVisible = false;
|
||||||
|
resetQuery();
|
||||||
|
}
|
||||||
|
|
||||||
// 确定
|
// 确定
|
||||||
function confim() {
|
function confim() {
|
||||||
dialog.value.dialogVisible = false;
|
dialog.value.dialogVisible = false;
|
||||||
if (multipleSelection.value.length > 0) {
|
if (multipleSelection.value.length > 0) {
|
||||||
const pop = multipleSelection.value.pop();
|
emit('change', multipleSelection.value[0].id);
|
||||||
multipleSelection.value = [pop];
|
|
||||||
emit('change', pop.id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 单选
|
// 初始化
|
||||||
function handleSelectionChange(val) {
|
getlist();
|
||||||
if (val && val.length > 0) {
|
|
||||||
const lastoptions = val.pop();
|
|
||||||
val.forEach((row) => {
|
|
||||||
multipleTableRef.value!.toggleRowSelection(row, false);
|
|
||||||
});
|
|
||||||
multipleTableRef.value!.toggleRowSelection(lastoptions, true);
|
|
||||||
multipleSelection.value = [lastoptions];
|
|
||||||
} else {
|
|
||||||
multipleTableRef.value!.clearSelection();
|
|
||||||
multipleSelection.value = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ function addIframe() {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
background-color: #f2f1f6;
|
background-color: #f2f1f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { getCommunitylistAPI } from '@/api/system/community';
|
import { getCommunitylistAPI } from '@/api/system/community';
|
||||||
import { communitylist_rows_type } from '@/api/system/community/type';
|
import { communitylist_rows_type } from '@/api/system/community/type';
|
||||||
import { deleteHouseApi, getBuildinglistAPI, getHouselistAPI } from '@/api/system/house';
|
import { deleteHouseApi, getBuildinglistAPI, getHouselistAPI, getVillageTree } from '@/api/system/house';
|
||||||
import type { addBuildingType, BuildingUnit, BuildingVo } from '@/api/system/house/type';
|
import type { addBuildingType, BuildingUnit, BuildingVo } from '@/api/system/house/type';
|
||||||
|
import { convertBuildingToTree } from '@/utils/house';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
// 数字排序
|
// 数字排序
|
||||||
function sortNumberStr(a: string, b: string) {
|
function sortNumberStr(a: string, b: string) {
|
||||||
@@ -25,6 +26,8 @@ export const useHouseStore = defineStore(
|
|||||||
const buildingtype = ref<number>(0);
|
const buildingtype = ref<number>(0);
|
||||||
// 住宅列表
|
// 住宅列表
|
||||||
const buildingtypelist = ref([]);
|
const buildingtypelist = ref([]);
|
||||||
|
// 房屋树状结构
|
||||||
|
const treedata = ref([]);
|
||||||
|
|
||||||
// 当前小区 所有楼栋信息
|
// 当前小区 所有楼栋信息
|
||||||
const currentBuildingInfoList = ref<BuildingVo[]>([]);
|
const currentBuildingInfoList = ref<BuildingVo[]>([]);
|
||||||
@@ -154,6 +157,15 @@ export const useHouseStore = defineStore(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 房屋 树状结构类型
|
||||||
|
const getCurrentVilageTreeHouse = async () => {
|
||||||
|
const res = await getCommunitylistAPI();
|
||||||
|
const currentVilage = res.rows.find((item) => item.choiceStatus === 0);
|
||||||
|
currentVilageInfo.value = currentVilage;
|
||||||
|
getVillageTree(currentVilageInfo.value.villageId).then((res) => {
|
||||||
|
treedata.value = convertBuildingToTree(res.data.buildings);
|
||||||
|
});
|
||||||
|
};
|
||||||
return {
|
return {
|
||||||
currentVilageInfo,
|
currentVilageInfo,
|
||||||
currentBuildingInfoList,
|
currentBuildingInfoList,
|
||||||
@@ -163,12 +175,14 @@ export const useHouseStore = defineStore(
|
|||||||
checkoutHouses,
|
checkoutHouses,
|
||||||
buildingtype,
|
buildingtype,
|
||||||
buildingtypelist,
|
buildingtypelist,
|
||||||
|
treedata,
|
||||||
checkoutHousesFun,
|
checkoutHousesFun,
|
||||||
initHouse,
|
initHouse,
|
||||||
switchHouseType,
|
switchHouseType,
|
||||||
switchBuilding,
|
switchBuilding,
|
||||||
updateHouse,
|
updateHouse,
|
||||||
deleteBuildingFun
|
deleteBuildingFun,
|
||||||
|
getCurrentVilageTreeHouse
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { LoginData } from '@/api/types';
|
|||||||
import defAva from '@/assets/images/profile.jpg';
|
import defAva from '@/assets/images/profile.jpg';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import { useHouseStore } from './house';
|
||||||
|
|
||||||
export const useUserStore = defineStore('user', () => {
|
export const useUserStore = defineStore('user', () => {
|
||||||
const token = ref(getToken());
|
const token = ref(getToken());
|
||||||
@@ -39,7 +40,7 @@ export const useUserStore = defineStore('user', () => {
|
|||||||
const data = res.data;
|
const data = res.data;
|
||||||
const user = data.user;
|
const user = data.user;
|
||||||
const profile = user.avatar == '' || user.avatar == null ? defAva : user.avatar;
|
const profile = user.avatar == '' || user.avatar == null ? defAva : user.avatar;
|
||||||
|
useHouseStore().getCurrentVilageTreeHouse();
|
||||||
if (data.roles && data.roles.length > 0) {
|
if (data.roles && data.roles.length > 0) {
|
||||||
// 验证返回的roles是否是一个非空数组
|
// 验证返回的roles是否是一个非空数组
|
||||||
roles.value = data.roles;
|
roles.value = data.roles;
|
||||||
|
|||||||
@@ -125,12 +125,15 @@ export const houseUselist = ['普通住宅', '商业用地', '商住两用', '
|
|||||||
// 对字符串 图片地址,处理
|
// 对字符串 图片地址,处理
|
||||||
export function splitStringUrl(str: string, splitLabel: string = ',') {
|
export function splitStringUrl(str: string, splitLabel: string = ',') {
|
||||||
const list = str.split(splitLabel);
|
const list = str.split(splitLabel);
|
||||||
return list.map((item) => {
|
const newlist = list
|
||||||
|
.map((item) => {
|
||||||
return {
|
return {
|
||||||
name: item.split('/').pop(),
|
name: item.split('/').pop(),
|
||||||
url: item
|
url: item
|
||||||
};
|
};
|
||||||
});
|
})
|
||||||
|
.filter((item) => item.name && item.url);
|
||||||
|
return newlist;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 判断 FormData 是否有数据
|
* 判断 FormData 是否有数据
|
||||||
|
|||||||
@@ -50,14 +50,16 @@
|
|||||||
<dict-tag :options="com_parking_charge" :value="scope.row.chargeItem" />
|
<dict-tag :options="com_parking_charge" :value="scope.row.chargeItem" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="缴纳人姓名" align="center" prop="payerName" />
|
<el-table-column label="缴纳人" align="center" prop="payerName" />
|
||||||
<el-table-column label="车牌号" align="center" prop="carNum" />
|
<el-table-column label="车牌号" align="center" prop="carNum" />
|
||||||
<el-table-column label="停车时长" align="center" width="180">
|
<el-table-column label="停车时长" align="center" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ formatTimeDiff(scope.row.startTime, scope.row.endTime) }}</span>
|
<span>{{ formatTimeDiff(scope.row.startTime, scope.row.endTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="费用/元" align="center" prop="cost" />
|
<el-table-column label="费用" align="center" prop="cost">
|
||||||
|
<template #default="scope"> {{ Number(scope.row.cost).toFixed(2) }}元 </template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="缴纳状态" align="center" prop="payerStatus">
|
<el-table-column label="缴纳状态" align="center" prop="payerStatus">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="com_parking_payer_status" :value="scope.row.payerStatus" />
|
<dict-tag :options="com_parking_payer_status" :value="scope.row.payerStatus" />
|
||||||
@@ -89,57 +91,6 @@
|
|||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 添加或修改停车缴费管理对话框 -->
|
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
|
||||||
<el-form ref="parkingCostFormRef" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="区域id" prop="areaId">
|
|
||||||
<el-input v-model="form.areaId" placeholder="请输入区域id" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="车位id" prop="parkingId">
|
|
||||||
<el-input v-model="form.parkingId" placeholder="请输入车位id" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="收费项目 0临时停车" prop="chargeItem">
|
|
||||||
<el-input v-model="form.chargeItem" placeholder="请输入收费项目 0临时停车" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="缴纳人姓名" prop="payerName">
|
|
||||||
<el-input v-model="form.payerName" placeholder="请输入缴纳人姓名" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="车牌号" prop="carNum">
|
|
||||||
<el-input v-model="form.carNum" placeholder="请输入车牌号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="开始时间" prop="startTime">
|
|
||||||
<el-date-picker clearable v-model="form.startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="结束时间" prop="endTime">
|
|
||||||
<el-date-picker clearable v-model="form.endTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="费用/元" prop="cost">
|
|
||||||
<el-input v-model="form.cost" placeholder="请输入费用/元" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="缴纳状态 0待缴纳 1已缴纳" prop="payerStatus">
|
|
||||||
<el-radio-group v-model="form.payerStatus">
|
|
||||||
<el-radio v-for="dict in com_parking_payer_status" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="支付方式 0微信 1支付宝 2线下缴费" prop="payMethod">
|
|
||||||
<el-input v-model="form.payMethod" placeholder="请输入支付方式 0微信 1支付宝 2线下缴费" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="所属小区id" prop="villageId">
|
|
||||||
<el-input v-model="form.villageId" placeholder="请输入所属小区id" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -172,11 +123,6 @@ const total = ref(0);
|
|||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const parkingCostFormRef = ref<ElFormInstance>();
|
const parkingCostFormRef = ref<ElFormInstance>();
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
|
||||||
visible: false,
|
|
||||||
title: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const initFormData: ParkingCostForm = {
|
const initFormData: ParkingCostForm = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
areaId: undefined,
|
areaId: undefined,
|
||||||
@@ -219,40 +165,33 @@ const { queryParams, form, rules } = toRefs(data);
|
|||||||
|
|
||||||
const Arealist = ref([]);
|
const Arealist = ref([]);
|
||||||
const Parkinglist = ref([]);
|
const Parkinglist = ref([]);
|
||||||
|
|
||||||
/** 查询停车缴费管理列表 */
|
/** 查询停车缴费管理列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
// 车位
|
||||||
const rows = await listParking();
|
const rows = await listParking();
|
||||||
Parkinglist.value = rows.rows;
|
Parkinglist.value = rows.rows;
|
||||||
|
// 车辆区域
|
||||||
const arealist = await listArea();
|
const arealist = await listArea();
|
||||||
Arealist.value = arealist.rows;
|
Arealist.value = arealist.rows;
|
||||||
console.log(Parkinglist.value);
|
// 停车缴费
|
||||||
const res = await listParkingCost(queryParams.value);
|
const res = await listParkingCost(queryParams.value);
|
||||||
parkingCostList.value = res.rows;
|
parkingCostList.value = res.rows;
|
||||||
parkingCostList.value.forEach((parkingCost) => {
|
parkingCostList.value.forEach((parkingCost) => {
|
||||||
const find = Parkinglist.value.find((item) => item.id === parkingCost.parkingId);
|
const find = Parkinglist.value.find((item) => item.id === parkingCost.parkingId);
|
||||||
const areaFind = Arealist.value.find((item) => item.id === parkingCost.areaId);
|
const areaFind = Arealist.value.find((item) => item.id === parkingCost.areaId);
|
||||||
|
if (areaFind) {
|
||||||
parkingCost.areaName = `${areaFind.areaName}(${areaFind.areaCode})`;
|
parkingCost.areaName = `${areaFind.areaName}(${areaFind.areaCode})`;
|
||||||
|
}
|
||||||
|
if (find) {
|
||||||
parkingCost.parkingName = find.parkingCode;
|
parkingCost.parkingName = find.parkingCode;
|
||||||
console.log(find, areaFind);
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
total.value = res.total;
|
total.value = res.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 取消按钮 */
|
|
||||||
const cancel = () => {
|
|
||||||
reset();
|
|
||||||
dialog.visible = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 表单重置 */
|
|
||||||
const reset = () => {
|
|
||||||
form.value = { ...initFormData };
|
|
||||||
parkingCostFormRef.value?.resetFields();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
@@ -289,23 +228,6 @@ const handleUpdate = async (row?: ParkingCostVO) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
const submitForm = () => {
|
|
||||||
parkingCostFormRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
buttonLoading.value = true;
|
|
||||||
if (form.value.id) {
|
|
||||||
await updateParkingCost(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
} else {
|
|
||||||
await addParkingCost(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
}
|
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
|
||||||
dialog.visible = false;
|
|
||||||
await getList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (row?: ParkingCostVO) => {
|
const handleDelete = async (row?: ParkingCostVO) => {
|
||||||
const _ids = row?.id || ids.value;
|
const _ids = row?.id || ids.value;
|
||||||
@@ -315,17 +237,6 @@ const handleDelete = async (row?: ParkingCostVO) => {
|
|||||||
await getList();
|
await getList();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
const handleExport = () => {
|
|
||||||
proxy?.download(
|
|
||||||
'parkingCost/parkingCost/export',
|
|
||||||
{
|
|
||||||
...queryParams.value
|
|
||||||
},
|
|
||||||
`parkingCost_${new Date().getTime()}.xlsx`
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -95,8 +95,11 @@ import { convertBuildingToTree, hasFormData } from '@/utils/house';
|
|||||||
import Holder from '@/components/Holder/index.vue';
|
import Holder from '@/components/Holder/index.vue';
|
||||||
import { UploadProps, UploadUserFile } from 'element-plus';
|
import { UploadProps, UploadUserFile } from 'element-plus';
|
||||||
import { addRepair, getRepair, updateRepair, uploadRepairImages } from '@/api/system/Repair';
|
import { addRepair, getRepair, updateRepair, uploadRepairImages } from '@/api/system/Repair';
|
||||||
import { getRepairProject, gettreelistRepairProject } from '@/api/system/RepairProject';
|
import { gettreelistRepairProject } from '@/api/system/RepairProject';
|
||||||
|
import { useHouseStore } from '@/store/modules/house';
|
||||||
|
|
||||||
|
const houseStore = useHouseStore();
|
||||||
|
const { treedata } = storeToRefs(houseStore);
|
||||||
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/repair/uploadImages';
|
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/repair/uploadImages';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
@@ -127,17 +130,9 @@ const rules = ref({
|
|||||||
const userid = ref(null);
|
const userid = ref(null);
|
||||||
// 当前小区
|
// 当前小区
|
||||||
const currentviliage = ref();
|
const currentviliage = ref();
|
||||||
// 树形结构
|
|
||||||
const treedata = ref();
|
|
||||||
// 报修项目 tree 结构
|
// 报修项目 tree 结构
|
||||||
const maintenanceItemTreeData = ref();
|
const maintenanceItemTreeData = ref();
|
||||||
function init() {
|
function init() {
|
||||||
getCommunitylistAPI().then((res) => {
|
|
||||||
currentviliage.value = res.rows.find((item) => item.choiceStatus === 0);
|
|
||||||
getVillageTree(currentviliage.value.villageId).then((res) => {
|
|
||||||
treedata.value = convertBuildingToTree(res.data.buildings);
|
|
||||||
});
|
|
||||||
|
|
||||||
gettreelistRepairProject().then((res) => {
|
gettreelistRepairProject().then((res) => {
|
||||||
maintenanceItemTreeData.value = res.data;
|
maintenanceItemTreeData.value = res.data;
|
||||||
if (route.query.id) {
|
if (route.query.id) {
|
||||||
@@ -162,7 +157,6 @@ function init() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
|||||||
@@ -60,27 +60,22 @@
|
|||||||
<el-table-column label="维修项目" align="center" prop="maintenanceItemPath" />
|
<el-table-column label="维修项目" align="center" prop="maintenanceItemPath" />
|
||||||
<el-table-column label="问题描述" align="center" prop="problem" />
|
<el-table-column label="问题描述" align="center" prop="problem" />
|
||||||
<el-table-column label="报修人" align="center" prop="residentName" />
|
<el-table-column label="报修人" align="center" prop="residentName" />
|
||||||
<el-table-column label="维修状态" align="center" prop="problemStatus">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="com_repair_status" :value="scope.row.problemStatus"></dict-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="预约日期" align="center" prop="orderDate" width="180">
|
<el-table-column label="预约日期" align="center" prop="orderDate" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseTime(scope.row.orderDate, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.orderDate, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="维修状态" align="center" prop="problemStatus">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="com_repair_status" :value="scope.row.problemStatus || ''"></dict-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip content="分配" placement="top">
|
<el-button link type="primary" @click="handleShare(scope.row)">{{ scope.row.problemStatus === '0' ? '分配' : '详情' }}</el-button>
|
||||||
<el-button link type="primary" icon="Pointer" @click="handleShare(scope.row)"></el-button>
|
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['repair:repair:edit']">修改</el-button>
|
||||||
</el-tooltip>
|
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['repair:repair:remove']">删除</el-button>
|
||||||
<el-tooltip content="修改" placement="top">
|
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['repair:repair:edit']"></el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
<el-tooltip content="删除" placement="top">
|
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['repair:repair:remove']"></el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="ResidentMainBox p-2 w-full">
|
<div class="ResidentMainBox p-2 w-full">
|
||||||
<PageHeader title="车位详情"></PageHeader>
|
<PageHeader title="报修详情"></PageHeader>
|
||||||
<div class="ResidentMainBody">
|
<div class="ResidentMainBody">
|
||||||
<el-row :span="24" :gutter="20">
|
<el-row :span="24" :gutter="20">
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
<el-card>
|
<el-card>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span>车位信息</span>
|
<span>报修房屋</span>
|
||||||
<el-button text type="primary">编辑</el-button>
|
<span class="ml-20px color-blue cursor-pointer" @click="handleEdit">编辑</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="w-full h-full CarinfoBox">
|
<div class="w-full h-full CarinfoBox">
|
||||||
@@ -18,59 +18,44 @@
|
|||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="carinfo_item">
|
<div class="carinfo_item">
|
||||||
<div class="label">报修房屋</div>
|
<div class="label">报修房屋</div>
|
||||||
<div class="main">地下停车场A区</div>
|
<div class="main">{{ form.house }}</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="carinfo_item">
|
<div class="carinfo_item">
|
||||||
<div class="label">维修项目</div>
|
<div class="label">维修项目</div>
|
||||||
<div class="main">地下停车场A区</div>
|
<div class="main">{{ form.maintenanceItem }}</div>
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<div class="carinfo_item">
|
|
||||||
<div class="label">问题描述</div>
|
|
||||||
<div class="main">地下停车场A区</div>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row class="mb-20px">
|
<el-row class="mb-20px">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="carinfo_item">
|
<div class="carinfo_item">
|
||||||
<div class="label">报修人</div>
|
<div class="label">报修人</div>
|
||||||
<div class="main">地下停车场A区</div>
|
<div class="main">{{ form.residentName }}</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="carinfo_item">
|
<div class="carinfo_item">
|
||||||
<div class="label">手机号码</div>
|
<div class="label">手机号码</div>
|
||||||
<div class="main">地下停车场A区</div>
|
<div class="main">{{ form.phone }}</div>
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<div class="carinfo_item">
|
|
||||||
<div class="label">预约日期</div>
|
|
||||||
<div class="main">地下停车场A区</div>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row class="mb-20px">
|
<el-row class="mb-20px">
|
||||||
<el-col :span="8">
|
<el-col>
|
||||||
<div class="carinfo_item">
|
|
||||||
<div class="label">提交人</div>
|
|
||||||
<div class="main">地下停车场A区</div>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<div class="carinfo_item">
|
|
||||||
<div class="label">提交时间</div>
|
|
||||||
<div class="main">地下停车场A区</div>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<div class="carinfo_item">
|
<div class="carinfo_item">
|
||||||
<div class="label">预约日期</div>
|
<div class="label">预约日期</div>
|
||||||
<div class="main">地下停车场A区</div>
|
<div class="main">{{ form.orderDate }}</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="mb-20px">
|
||||||
|
<el-col>
|
||||||
|
<div class="carinfo_item">
|
||||||
|
<div class="label">问题描述</div>
|
||||||
|
<div class="main">{{ form.problem }}</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -79,7 +64,19 @@
|
|||||||
<div class="carinfo_item">
|
<div class="carinfo_item">
|
||||||
<div class="label">附件</div>
|
<div class="label">附件</div>
|
||||||
<div class="main fileImagebox">
|
<div class="main fileImagebox">
|
||||||
<el-image class="carinfoImage"></el-image>
|
<el-image
|
||||||
|
:preview-teleported="true"
|
||||||
|
:zoom-rate="1.2"
|
||||||
|
:max-scale="7"
|
||||||
|
:min-scale="0.2"
|
||||||
|
:preview-src-list="form.problemImageUrlList"
|
||||||
|
show-progress
|
||||||
|
:initial-index="0"
|
||||||
|
v-for="(item, index) in form.problemImageUrlList"
|
||||||
|
:key="index"
|
||||||
|
:src="item"
|
||||||
|
class="carinfoImage"
|
||||||
|
></el-image>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -100,8 +97,7 @@
|
|||||||
<repairUser :userid="userid"></repairUser>
|
<repairUser :userid="userid"></repairUser>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions mt-5">
|
<div class="actions mt-5">
|
||||||
<el-button type="primary">审核通过</el-button>
|
<el-button type="primary">确定派单</el-button>
|
||||||
<el-button type="danger">审核不通过</el-button>
|
|
||||||
<el-button>返回</el-button>
|
<el-button>返回</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -109,7 +105,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-card style="position: relative">
|
<el-card style="position: relative; height: 100%">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="asideCardHeader w-full">
|
<div class="asideCardHeader w-full">
|
||||||
<div class="cardSubtitle">
|
<div class="cardSubtitle">
|
||||||
@@ -118,7 +114,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="w-full h-50%">
|
<div class="h-full w-full">
|
||||||
<el-steps space="108px" direction="vertical" :active="activeStop">
|
<el-steps space="108px" direction="vertical" :active="activeStop">
|
||||||
<el-step>
|
<el-step>
|
||||||
<template #title>
|
<template #title>
|
||||||
@@ -156,14 +152,94 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import repairUser from '@/components/Holder/repairUser.vue';
|
import repairUser from '@/components/Holder/repairUser.vue';
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
import PageHeader from '@/components/Pageheader/index.vue';
|
||||||
|
import { getRepair } from '@/api/system/Repair';
|
||||||
|
import { getCommunitylistAPI } from '@/api/system/community';
|
||||||
|
import { getVillageTree } from '@/api/system/house';
|
||||||
|
import { convertBuildingToTree, getHousePathById } from '@/utils/house';
|
||||||
|
import { listRepairProject } from '@/api/system/RepairProject';
|
||||||
|
import { listResident } from '@/api/system/resident';
|
||||||
|
import { RepairVO } from '@/api/system/Repair/type';
|
||||||
|
import { useHouseStore } from '@/store/modules/house';
|
||||||
|
|
||||||
|
const houseStore = useHouseStore();
|
||||||
|
const { treedata } = storeToRefs(houseStore);
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
const active = ref(6);
|
const active = ref(6);
|
||||||
const activeStop = ref(4);
|
const activeStop = ref(4);
|
||||||
|
|
||||||
|
interface formType extends RepairVO {
|
||||||
|
maintenanceItem?: string;
|
||||||
|
residentName?: string;
|
||||||
|
problemImageUrlList?: string[];
|
||||||
|
house?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const form = ref<formType>({
|
||||||
|
'id': null,
|
||||||
|
'houseId': null,
|
||||||
|
'maintenanceItemId': null,
|
||||||
|
'problem': '',
|
||||||
|
'residentId': null,
|
||||||
|
'phone': null,
|
||||||
|
'orderDate': '',
|
||||||
|
'problemImageUrl': '',
|
||||||
|
'problemStatus': '0',
|
||||||
|
'repairDes': '',
|
||||||
|
'repairImageUrl': '',
|
||||||
|
'repairId': null
|
||||||
|
});
|
||||||
const userid = ref();
|
const userid = ref();
|
||||||
|
|
||||||
|
// 维修项目
|
||||||
|
const projectlist = ref([]);
|
||||||
|
// 住户
|
||||||
|
const residentList = ref([]);
|
||||||
|
// ! 房屋 ====================================================================================================
|
||||||
|
async function init() {
|
||||||
|
// 项目
|
||||||
|
const projectres = await listRepairProject();
|
||||||
|
projectlist.value = projectres.rows;
|
||||||
|
// 住户
|
||||||
|
const residentlistres = await listResident();
|
||||||
|
residentList.value = residentlistres.rows;
|
||||||
|
// 报修详情
|
||||||
|
const res = await getRepair(userid.value);
|
||||||
|
form.value = res.data;
|
||||||
|
const find = projectlist.value.find((item) => item.id === form.value.maintenanceItemId);
|
||||||
|
if (find) {
|
||||||
|
if (find.parentId) {
|
||||||
|
const find2 = projectlist.value.find((item) => item.id === find.parentId);
|
||||||
|
form.value.maintenanceItem = find2.projectName + ' - ' + find.projectName;
|
||||||
|
} else {
|
||||||
|
form.value.maintenanceItem = find.projectName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const houseinfo = getHousePathById(treedata.value, form.value.houseId, 'label');
|
||||||
|
console.log(treedata.value);
|
||||||
|
|
||||||
|
form.value.house = houseinfo.join(' - ');
|
||||||
|
|
||||||
|
const residentinfo = residentList.value.find((item) => item.id === form.value.residentId);
|
||||||
|
form.value.residentName = residentinfo.name;
|
||||||
|
|
||||||
|
form.value.problemImageUrlList = form.value.problemImageUrl.split(',').filter((item) => item);
|
||||||
|
}
|
||||||
|
|
||||||
if (route.query.id) {
|
if (route.query.id) {
|
||||||
userid.value = route.query.id;
|
userid.value = route.query.id;
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleEdit() {
|
||||||
|
router.push({
|
||||||
|
path: '/repair/addRepair',
|
||||||
|
query: {
|
||||||
|
id: form.value.id
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -173,6 +249,7 @@ if (route.query.id) {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.ResidentMainBody {
|
.ResidentMainBody {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
flex: 1;
|
||||||
.CarinfoBox {
|
.CarinfoBox {
|
||||||
&.gridbox {
|
&.gridbox {
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -192,8 +269,9 @@ if (route.query.id) {
|
|||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
.carinfoImage {
|
.carinfoImage {
|
||||||
|
margin: 10px;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 100px;
|
height: 150px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,12 +81,12 @@
|
|||||||
<el-table-column label="维修类名" align="center" prop="projectName" />
|
<el-table-column label="维修类名" align="center" prop="projectName" />
|
||||||
<el-table-column label="项目类型" align="center" prop="projectType">
|
<el-table-column label="项目类型" align="center" prop="projectType">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="com_repair_project_types" :value="scope.row.projectType"></dict-tag>
|
<dict-tag :options="com_repair_project_types" :value="scope.row.projectType || ''"></dict-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="com_repair_project_status" :value="scope.row.status"></dict-tag>
|
<dict-tag :options="com_repair_project_status" :value="scope.row.status || ''"></dict-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<div class="p-2 h-full flex flex-col">
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
@@ -19,32 +19,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
<el-card shadow="never">
|
<el-card class="flex-1" shadow="never">
|
||||||
<template #header>
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['visitor:visitor:add']">新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['visitor:visitor:edit']"
|
|
||||||
>修改</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['visitor:visitor:remove']"
|
|
||||||
>删除</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" border :data="visitorList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" border :data="visitorList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="访问房屋" align="center" prop="houseId" />
|
<el-table-column label="访问房屋" align="center" prop="houseId" />
|
||||||
<el-table-column label="访客姓名" align="center" prop="visitorName" />
|
<el-table-column label="访客姓名" align="center" prop="visitorName" />
|
||||||
<el-table-column label="访客状态 0等待来访 1已到访" align="center" prop="status" />
|
<el-table-column label="访客状态" align="center" prop="status">
|
||||||
<el-table-column label="访客性别 0男 1女 3未知" align="center" prop="visitorGender">
|
<template #default="scope">
|
||||||
|
<dict-tag :options="com_visitor_status" :value="scope.row.status" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="访客性别" align="center" prop="visitorGender">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="sys_user_sex" :value="scope.row.visitorGender" />
|
<dict-tag :options="sys_user_sex" :value="scope.row.visitorGender" />
|
||||||
</template>
|
</template>
|
||||||
@@ -57,62 +42,13 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip content="修改" placement="top">
|
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['visitor:visitor:remove']">访客详情</el-button>
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['visitor:visitor:edit']"></el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
<el-tooltip content="删除" placement="top">
|
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['visitor:visitor:remove']"></el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 添加或修改访客管理对话框 -->
|
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
|
||||||
<el-form ref="visitorFormRef" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="访问房屋id" prop="houseId">
|
|
||||||
<el-input v-model="form.houseId" placeholder="请输入访问房屋id" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="访客姓名" prop="visitorName">
|
|
||||||
<el-input v-model="form.visitorName" placeholder="请输入访客姓名" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="访客性别 0男 1女 3未知" prop="visitorGender">
|
|
||||||
<el-input v-model="form.visitorGender" placeholder="请输入访客性别 0男 1女 3未知" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="访客联系方式" prop="visitorPhone">
|
|
||||||
<el-input v-model="form.visitorPhone" placeholder="请输入访客联系方式" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="车牌号" prop="carNum">
|
|
||||||
<el-input v-model="form.carNum" placeholder="请输入车牌号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="随行人数" prop="visitorNum">
|
|
||||||
<el-input v-model="form.visitorNum" placeholder="请输入随行人数" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="来访时间" prop="startTime">
|
|
||||||
<el-date-picker clearable v-model="form.startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择来访时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="离开时间" prop="endTime">
|
|
||||||
<el-date-picker clearable v-model="form.endTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择离开时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="创建时间" prop="createTime">
|
|
||||||
<el-date-picker clearable v-model="form.createTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择创建时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="创建者(住户id)" prop="createId">
|
|
||||||
<el-input v-model="form.createId" placeholder="请输入创建者(住户id)" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -121,7 +57,9 @@ import { listVisitor, getVisitor, delVisitor, addVisitor, updateVisitor } from '
|
|||||||
import { VisitorVO, VisitorQuery, VisitorForm } from '@/api/system/Visitor/type';
|
import { VisitorVO, VisitorQuery, VisitorForm } from '@/api/system/Visitor/type';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
const { sys_user_sex } = toRefs<any>(proxy?.useDict('sys_user_sex'));
|
||||||
const { com_visitor_status } = toRefs<any>(proxy?.useDict('com_visitor_status'));
|
const { com_visitor_status } = toRefs<any>(proxy?.useDict('com_visitor_status'));
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
// com_visitor_status
|
// com_visitor_status
|
||||||
const visitorList = ref<VisitorVO[]>([]);
|
const visitorList = ref<VisitorVO[]>([]);
|
||||||
@@ -132,15 +70,9 @@ const ids = ref<Array<string | number>>([]);
|
|||||||
const single = ref(true);
|
const single = ref(true);
|
||||||
const multiple = ref(true);
|
const multiple = ref(true);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const visitorFormRef = ref<ElFormInstance>();
|
const visitorFormRef = ref<ElFormInstance>();
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
|
||||||
visible: false,
|
|
||||||
title: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const initFormData: VisitorForm = {
|
const initFormData: VisitorForm = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
houseId: undefined,
|
houseId: undefined,
|
||||||
@@ -189,18 +121,6 @@ const getList = async () => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 取消按钮 */
|
|
||||||
const cancel = () => {
|
|
||||||
reset();
|
|
||||||
dialog.visible = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 表单重置 */
|
|
||||||
const reset = () => {
|
|
||||||
form.value = { ...initFormData };
|
|
||||||
visitorFormRef.value?.resetFields();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
@@ -220,61 +140,22 @@ const handleSelectionChange = (selection: VisitorVO[]) => {
|
|||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleAdd = () => {
|
const handleMain = async (row?: VisitorVO) => {
|
||||||
reset();
|
router.push({
|
||||||
dialog.visible = true;
|
path: '/repair/visitorMain',
|
||||||
dialog.title = '添加访客管理';
|
query: {
|
||||||
};
|
id: row.id
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
const handleUpdate = async (row?: VisitorVO) => {
|
|
||||||
reset();
|
|
||||||
const _id = row?.id || ids.value[0];
|
|
||||||
const res = await getVisitor(_id);
|
|
||||||
Object.assign(form.value, res.data);
|
|
||||||
dialog.visible = true;
|
|
||||||
dialog.title = '修改访客管理';
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
const submitForm = () => {
|
|
||||||
visitorFormRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
buttonLoading.value = true;
|
|
||||||
if (form.value.id) {
|
|
||||||
await updateVisitor(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
} else {
|
|
||||||
await addVisitor(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
}
|
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
|
||||||
dialog.visible = false;
|
|
||||||
await getList();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
const handleDelete = async (row?: VisitorVO) => {
|
|
||||||
const _ids = row?.id || ids.value;
|
|
||||||
await proxy?.$modal.confirm('是否确认删除访客管理编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
|
||||||
await delVisitor(_ids);
|
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
|
||||||
await getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
const handleExport = () => {
|
|
||||||
proxy?.download(
|
|
||||||
'visitor/visitor/export',
|
|
||||||
{
|
|
||||||
...queryParams.value
|
|
||||||
},
|
|
||||||
`visitor_${new Date().getTime()}.xlsx`
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.el-table {
|
||||||
|
height: calc(100% - 100px);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
156
src/views/system/Visitor/visitorMain.vue
Normal file
156
src/views/system/Visitor/visitorMain.vue
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
<template>
|
||||||
|
<div class="ResidentMainBox p-2 w-full h-full">
|
||||||
|
<PageHeader title="访客信息"></PageHeader>
|
||||||
|
<div class="ResidentMainBody">
|
||||||
|
<el-card>
|
||||||
|
<template #header>
|
||||||
|
<div class="card-header">
|
||||||
|
<span>车位信息</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="grid grid-cols-3 grid-rows-3">
|
||||||
|
<div class="carinfo_item">
|
||||||
|
<div class="label">访问房屋:</div>
|
||||||
|
<div class="main">北境碧桂园小区A栋2单元402</div>
|
||||||
|
</div>
|
||||||
|
<div class="carinfo_item">
|
||||||
|
<div class="label">访客姓名:</div>
|
||||||
|
<div class="main">李淑一</div>
|
||||||
|
</div>
|
||||||
|
<div class="carinfo_item">
|
||||||
|
<div class="label">访客性别:</div>
|
||||||
|
<div class="main">男</div>
|
||||||
|
</div>
|
||||||
|
<div class="carinfo_item">
|
||||||
|
<div class="label">手机号码:</div>
|
||||||
|
<div class="main">15020360831</div>
|
||||||
|
</div>
|
||||||
|
<div class="carinfo_item">
|
||||||
|
<div class="label">访问日期:</div>
|
||||||
|
<div class="main">2024/05/08</div>
|
||||||
|
</div>
|
||||||
|
<div class="carinfo_item">
|
||||||
|
<div class="label">访问时长:</div>
|
||||||
|
<div class="main">3h</div>
|
||||||
|
</div>
|
||||||
|
<div class="carinfo_item">
|
||||||
|
<div class="label">访问业主:</div>
|
||||||
|
<div class="main flex align-items-center">
|
||||||
|
<div>去丽丽</div>
|
||||||
|
<div class="ml-20px color-blue cursor-pointer">住户详情</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="carinfo_item">
|
||||||
|
<div class="label">提交时间:</div>
|
||||||
|
<div class="main">2024/09/15 22:48</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="5"></el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<div>
|
||||||
|
<div>通行证</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div class="visitorlist">
|
||||||
|
<h2>访问记录</h2>
|
||||||
|
</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-table :data="tableData" style="width: 100%">
|
||||||
|
<el-table-column align="center" prop="date" label="开门位置" />
|
||||||
|
<el-table-column align="center" prop="name" label="开门时间" />
|
||||||
|
</el-table>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="mt-30px">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import PageHeader from '@/components/Pageheader/index.vue';
|
||||||
|
const tableData = [
|
||||||
|
{
|
||||||
|
date: '2016-05-03',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-02',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-04',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-01',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
function back() {
|
||||||
|
router.push({
|
||||||
|
path: '/repair/visitorlist'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.ResidentMainBox {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.ResidentMainBody {
|
||||||
|
flex: 1;
|
||||||
|
margin-top: 20px;
|
||||||
|
font-size: 15px;
|
||||||
|
|
||||||
|
.visitorlist {
|
||||||
|
margin: 20px 0;
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
.carinfo_item {
|
||||||
|
margin-bottom: 40px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.label {
|
||||||
|
width: 100px;
|
||||||
|
text-align: right;
|
||||||
|
font-weight: bolder;
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:deep(div.el-step__head.is-process) {
|
||||||
|
& > div.el-step__line {
|
||||||
|
width: 0;
|
||||||
|
border: 1px dashed gray;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&:deep(.el-step.is-vertical .el-step__line) {
|
||||||
|
top: 20px;
|
||||||
|
}
|
||||||
|
&:deep(div.el-step__head.is-finish) {
|
||||||
|
& > div.el-step__line {
|
||||||
|
width: 0;
|
||||||
|
border: 1px solid var(--el-color-primary);
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -7,48 +7,86 @@
|
|||||||
<el-form class="formBody" label-position="left" ref="formRef" :model="form" :rules="rules" label-width="130px">
|
<el-form class="formBody" label-position="left" ref="formRef" :model="form" :rules="rules" label-width="130px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="11">
|
<el-col :span="11">
|
||||||
<el-form-item label="车牌号" prop="houseId">
|
<el-form-item label="车辆区域" prop="areaId">
|
||||||
<el-input v-model.trim="form.rentalName" placeholder="请输入车牌号" />
|
<el-select @change="changeArealist" v-model="form.areaId" placeholder="请选择车辆区域">
|
||||||
|
<el-option v-for="item in carArealist" :key="item.id" :label="`${item.areaName}(${item.areaCode})`" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2"></el-col>
|
<el-col :span="2"></el-col>
|
||||||
<el-col :span="11">
|
<el-col :span="11">
|
||||||
<el-form-item label="车辆品牌" prop="rentalName">
|
<el-form-item label="车位号" prop="parkingId">
|
||||||
<el-input v-model.trim="form.rentalName" placeholder="请输入车辆品牌" />
|
<el-select v-model="form.parkingId" placeholder="请选择车位号">
|
||||||
|
<el-option v-for="item in parkinglist" :key="item.id" :label="item.parkingCode" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="11">
|
<el-col :span="11">
|
||||||
<el-form-item label="车辆型号" prop="remark">
|
<el-form-item label="车牌号" prop="carNum">
|
||||||
<el-input v-model.trim="form.supInfo" placeholder="请输入补充车辆型号" />
|
<el-input v-model.trim="form.carNum" placeholder="请输入车牌号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2"></el-col>
|
<el-col :span="2"></el-col>
|
||||||
<el-col :span="11">
|
<el-col :span="11">
|
||||||
<el-form-item label="车声颜色" prop="phone">
|
<el-form-item label="车辆品牌" prop="carBrand">
|
||||||
<el-input v-model.trim="form.phone" placeholder="请输入车声颜色" />
|
<el-input v-model.trim="form.carBrand" placeholder="请输入车辆品牌" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="11">
|
||||||
<el-form-item label="车辆照片" prop="email"> </el-form-item>
|
<el-form-item label="车辆型号" prop="carModel">
|
||||||
|
<el-input v-model.trim="form.carModel" placeholder="请输入补充车辆型号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="2"></el-col>
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item label="车身颜色" prop="carColor">
|
||||||
|
<el-input v-model.trim="form.carColor" placeholder="请输入车身颜色" />
|
||||||
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="车辆照片">
|
||||||
|
<el-upload
|
||||||
|
class="avatar-uploader"
|
||||||
|
ref="uploadRef"
|
||||||
|
accept=".png, .jpg"
|
||||||
|
:action="uploadUrl"
|
||||||
|
name="file"
|
||||||
|
:headers="headerToken()"
|
||||||
|
:show-file-list="false"
|
||||||
|
:on-success="handleAvatarSuccess"
|
||||||
|
:before-upload="beforeAvatarUpload"
|
||||||
|
>
|
||||||
|
<img v-if="form.carImageUrl" :src="form.carImageUrl" class="avatar" />
|
||||||
|
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
|
||||||
|
<template #tip>
|
||||||
|
<span>支持jpg, png等格式文件上传,文件大小不超过10MB,可上传多张 </span>
|
||||||
|
</template>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="持有人">
|
<el-form-item label="持有人">
|
||||||
<!-- 公共组件 持有人 -->
|
<!-- 公共组件 持有人 -->
|
||||||
<Holder @change="handleChange"></Holder>
|
<Holder :userid="String(form.residentId)" @change="handleChange"></Holder>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="备注" prop="email">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input type="textarea" :rows="5" v-model.trim="form.email" placeholder="请输入" />
|
<el-input type="textarea" :rows="5" v-model.trim="form.remark" placeholder="请输入" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -66,45 +104,130 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import Holder from '@/components/Holder/index.vue';
|
import Holder from '@/components/Holder/index.vue';
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
import PageHeader from '@/components/Pageheader/index.vue';
|
||||||
|
import { listArea } from '@/api/system/carArea';
|
||||||
|
import { listParking } from '@/api/system/parking';
|
||||||
|
import { UploadFiles, UploadProps, UploadRawFile, UploadUserFile } from 'element-plus';
|
||||||
|
import { addCar, getCar, updateCar, uploadCar } from '@/api/system/cars';
|
||||||
|
import { useUserStore } from '@/store/modules/user';
|
||||||
|
import { validator } from '@/utils/Reg';
|
||||||
|
|
||||||
|
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/car/uploadImage';
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const form = ref({
|
const form = ref({
|
||||||
id: null,
|
id: null,
|
||||||
houseId: null,
|
areaId: null, // 区域id
|
||||||
rentalName: '', // 租户姓名
|
residentId: null, // 车位id
|
||||||
rent: null, // 租金
|
parkingId: null, // 持有人id
|
||||||
houseFace: '', // 房屋朝向
|
carNum: '', //车牌号
|
||||||
rentalType: 0, // 整租合租
|
carBrand: '', //车辆品牌
|
||||||
phone: null, //手机号
|
carModel: '', //车辆型号
|
||||||
houseArea: null, // 房屋面积
|
carColor: '', //车身颜色
|
||||||
floorNo: null, //楼层号
|
remark: '', //备注
|
||||||
inTime: '', //入住时间
|
carImageUrl: '' //车辆图片url
|
||||||
facilities: '', //房屋设施
|
|
||||||
houseImageUrl: '', //房屋图片
|
|
||||||
supInfo: '', //补充租房信息
|
|
||||||
vx: '', //微信
|
|
||||||
houseUse: 0, //房屋用途
|
|
||||||
rentalStatus: 0, //租赁状态
|
|
||||||
email: '' //邮箱
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
houseId: [{ required: true, message: '请选择房屋', trigger: 'blur' }],
|
areaId: [{ required: true, message: '请选择区域', trigger: 'blur' }],
|
||||||
rentalName: [{ required: true, message: '请输入名称', trigger: 'blur' }]
|
residentId: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||||
|
carNum: [
|
||||||
|
{ required: true, message: '请输入车牌号', trigger: 'blur' },
|
||||||
|
{
|
||||||
|
validator: (_, value) => validator(value, 'PlateNumber'),
|
||||||
|
message: '请请输入车牌号',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
carBrand: [{ required: true, message: '请输入车辆品牌', trigger: 'blur' }]
|
||||||
});
|
});
|
||||||
const userid = ref(null);
|
function headerToken() {
|
||||||
|
const useStore = useUserStore();
|
||||||
|
return {
|
||||||
|
Authorization: 'Bearer ' + useStore.token
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const userid = ref('');
|
||||||
|
const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) => {
|
||||||
|
const type = rawFile.type.split('/').pop();
|
||||||
|
if (['png', 'jpg'].includes(type)) {
|
||||||
|
if (rawFile.size / 1024 / 1024 <= 10) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
ElMessage.warning('图片大小超过10M,请重新上传');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ElMessage.warning('图片格式不是 png/jpg 格式, 请重新上传');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleAvatarSuccess: UploadProps['onSuccess'] = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
|
||||||
|
form.value.carImageUrl = response.data.url;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 车辆区域
|
||||||
|
const carArealist = ref([]);
|
||||||
|
// 根据车辆区域 动态选择 车位
|
||||||
|
const parkinglist = ref([]);
|
||||||
|
function init() {
|
||||||
|
listArea().then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
carArealist.value = res.rows;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
init();
|
||||||
|
|
||||||
|
if (route.query.id) {
|
||||||
|
userid.value = route.query.id as string;
|
||||||
|
form.value.id = userid.value;
|
||||||
|
getCar(userid.value).then((res) => {
|
||||||
|
form.value = {
|
||||||
|
...form.value,
|
||||||
|
...res.data
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function changeArealist(val: string) {
|
||||||
|
console.log(val, typeof val);
|
||||||
|
listParking({
|
||||||
|
areaId: val,
|
||||||
|
pageSize: 9999999,
|
||||||
|
pageNum: 1
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
parkinglist.value = res.rows;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// !== 提交 =============================================================================
|
// !== 提交 =============================================================================
|
||||||
// 提交
|
// 提交
|
||||||
const submitForm = () => {
|
const submitForm = () => {
|
||||||
formRef.value?.validate(async (valid: boolean) => {
|
formRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
console.log(form.value);
|
||||||
|
if (userid.value.trim() !== '') {
|
||||||
|
console.log('edit');
|
||||||
|
updateCar(form.value).then((res) => {
|
||||||
|
ElMessage.success('编辑成功');
|
||||||
|
cancelForm();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log('add');
|
||||||
|
addCar(form.value).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
ElMessage.success('添加成功');
|
||||||
|
cancelForm();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 推出
|
// 推出
|
||||||
const cancelForm = () => {
|
const cancelForm = () => {
|
||||||
router.push({
|
router.push({
|
||||||
@@ -115,9 +238,37 @@ const cancelForm = () => {
|
|||||||
// 选择住户
|
// 选择住户
|
||||||
function handleChange(pop) {
|
function handleChange(pop) {
|
||||||
console.log(pop);
|
console.log(pop);
|
||||||
|
form.value.residentId = pop;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.avatar-uploader .avatar {
|
||||||
|
width: 178px;
|
||||||
|
height: 178px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.avatar-uploader:deep(.el-upload) {
|
||||||
|
border: 1px dashed #ccc;
|
||||||
|
margin-right: 20px;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: var(--el-transition-duration-fast);
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-uploader .el-upload:hover {
|
||||||
|
border-color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-icon.avatar-uploader-icon {
|
||||||
|
font-size: 28px;
|
||||||
|
color: #8c939d;
|
||||||
|
width: 178px;
|
||||||
|
height: 178px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.AddBuildingBox {
|
.AddBuildingBox {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
<Pageheader title="添加房屋租赁"></Pageheader>
|
<Pageheader title="车辆管理"></Pageheader>
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
<el-form-item label="持有人" prop="residentId">
|
|
||||||
<el-input v-model="queryParams.residentId" placeholder="请输入持有人id(住户表id)" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="车牌号" prop="carNum">
|
<el-form-item label="车牌号" prop="carNum">
|
||||||
<el-input v-model="queryParams.carNum" placeholder="请输入车牌号" clearable @keyup.enter="handleQuery" />
|
<el-input v-model.trim="queryParams.carNum" placeholder="请输入车牌号" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="车辆品牌" prop="carBrand">
|
||||||
|
<el-input v-model.trim="queryParams.carBrand" placeholder="请输入车辆品牌" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="车身颜色" prop="carColor">
|
||||||
|
<el-input v-model.trim="queryParams.carColor" placeholder="请输入车身颜色" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
@@ -38,12 +41,14 @@
|
|||||||
|
|
||||||
<el-table v-loading="loading" border :data="carList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" border :data="carList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="车牌号" align="center" prop="id" v-if="true" />
|
<el-table-column label="车牌号" align="center" prop="carNum" />
|
||||||
<el-table-column label="车辆品牌" align="center" prop="areaId" />
|
<el-table-column label="车辆品牌" align="center" prop="carBrand" />
|
||||||
<el-table-column label="车辆型号" align="center" prop="parkingId" />
|
<el-table-column label="车辆型号" align="center" prop="carModel" />
|
||||||
<el-table-column label="车身颜色" align="center" prop="residentId" />
|
<el-table-column label="车身颜色" align="center" prop="carColor" />
|
||||||
<el-table-column label="持有人" align="center" prop="carNum" />
|
<el-table-column label="持有人" align="center" prop="residentId">
|
||||||
<el-table-column label="备注" align="center" prop="carBrand" />
|
<template #default="scope"> {{ getResidentName(scope.row.residentId) }} </template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip content="修改" placement="top">
|
<el-tooltip content="修改" placement="top">
|
||||||
@@ -58,58 +63,6 @@
|
|||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 添加或修改车辆管理对话框 -->
|
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
|
||||||
<el-form ref="carFormRef" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="区域id" prop="areaId">
|
|
||||||
<el-input v-model="form.areaId" placeholder="请输入区域id" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="车位id" prop="parkingId">
|
|
||||||
<el-input v-model="form.parkingId" placeholder="请输入车位id" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="持有人id(住户表id)" prop="residentId">
|
|
||||||
<el-input v-model="form.residentId" placeholder="请输入持有人id(住户表id)" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="车牌号" prop="carNum">
|
|
||||||
<el-input v-model="form.carNum" placeholder="请输入车牌号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="车辆品牌" prop="carBrand">
|
|
||||||
<el-input v-model="form.carBrand" placeholder="请输入车辆品牌" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="车辆型号" prop="carModel">
|
|
||||||
<el-input v-model="form.carModel" placeholder="请输入车辆型号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="车身颜色" prop="carColor">
|
|
||||||
<el-input v-model="form.carColor" placeholder="请输入车身颜色" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="车辆图片url" prop="carImageUrl">
|
|
||||||
<el-input v-model="form.carImageUrl" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="创建者" prop="createBy">
|
|
||||||
<el-input v-model="form.createBy" placeholder="请输入创建者" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="创建时间" prop="createTime">
|
|
||||||
<el-date-picker clearable v-model="form.createTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择创建时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="修改者" prop="updateBy">
|
|
||||||
<el-input v-model="form.updateBy" placeholder="请输入修改者" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="修改时间" prop="updateTime">
|
|
||||||
<el-date-picker clearable v-model="form.updateTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择修改时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -117,6 +70,7 @@
|
|||||||
import Pageheader from '@/components/Pageheader/index.vue';
|
import Pageheader from '@/components/Pageheader/index.vue';
|
||||||
import { listCar, getCar, delCar, addCar, updateCar } from '@/api/system/cars/index';
|
import { listCar, getCar, delCar, addCar, updateCar } from '@/api/system/cars/index';
|
||||||
import { CarVO, CarQuery, CarForm } from '@/api/system/cars/type';
|
import { CarVO, CarQuery, CarForm } from '@/api/system/cars/type';
|
||||||
|
import { listResident } from '@/api/system/resident';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
|
||||||
@@ -134,11 +88,6 @@ const total = ref(0);
|
|||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const carFormRef = ref<ElFormInstance>();
|
const carFormRef = ref<ElFormInstance>();
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
|
||||||
visible: false,
|
|
||||||
title: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const initFormData: CarForm = {
|
const initFormData: CarForm = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
areaId: undefined,
|
areaId: undefined,
|
||||||
@@ -177,27 +126,24 @@ const data = reactive<PageData<CarForm, CarQuery>>({
|
|||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 持有人 */
|
||||||
|
const ResidentList = ref([]);
|
||||||
|
const getResidentName = (id: string | number) => {
|
||||||
|
const find = ResidentList.value.find((item) => item.id === id);
|
||||||
|
return find.name;
|
||||||
|
};
|
||||||
|
|
||||||
/** 查询车辆管理列表 */
|
/** 查询车辆管理列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await listCar(queryParams.value);
|
const res = await listCar(queryParams.value);
|
||||||
|
const res1 = await listResident();
|
||||||
|
ResidentList.value = res1.rows;
|
||||||
carList.value = res.rows;
|
carList.value = res.rows;
|
||||||
total.value = res.total;
|
total.value = res.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 取消按钮 */
|
|
||||||
const cancel = () => {
|
|
||||||
reset();
|
|
||||||
dialog.visible = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 表单重置 */
|
|
||||||
const reset = () => {
|
|
||||||
form.value = { ...initFormData };
|
|
||||||
carFormRef.value?.resetFields();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
@@ -234,23 +180,6 @@ const handleUpdate = async (row?: CarVO) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
const submitForm = () => {
|
|
||||||
carFormRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
buttonLoading.value = true;
|
|
||||||
if (form.value.id) {
|
|
||||||
await updateCar(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
} else {
|
|
||||||
await addCar(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
}
|
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
|
||||||
dialog.visible = false;
|
|
||||||
await getList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (row?: CarVO) => {
|
const handleDelete = async (row?: CarVO) => {
|
||||||
const _ids = row?.id || ids.value;
|
const _ids = row?.id || ids.value;
|
||||||
@@ -260,17 +189,6 @@ const handleDelete = async (row?: CarVO) => {
|
|||||||
await getList();
|
await getList();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
const handleExport = () => {
|
|
||||||
proxy?.download(
|
|
||||||
'car/car/export',
|
|
||||||
{
|
|
||||||
...queryParams.value
|
|
||||||
},
|
|
||||||
`car_${new Date().getTime()}.xlsx`
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,19 +7,167 @@
|
|||||||
<el-button type="primary" text>编辑</el-button>
|
<el-button type="primary" text>编辑</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="addBuildingFormBody">
|
<div class="addBuildingFormBody">
|
||||||
<div style="width: 50%">
|
<div class="descriptionsbox">
|
||||||
<el-descriptions>
|
<div class="label">房号:</div>
|
||||||
<el-descriptions-item label-align="right" label="房号:"> 娜美 </el-descriptions-item>
|
<div class="value">娜美</div>
|
||||||
<el-descriptions-item label-align="right" label="所属小区:">18100000000</el-descriptions-item>
|
|
||||||
<el-descriptions-item label-align="right" label="楼栋:">2栋</el-descriptions-item>
|
|
||||||
<el-descriptions-item label-align="right" label="单元:">2单元</el-descriptions-item>
|
|
||||||
<el-descriptions-item label-align="right" label="楼层:">3楼</el-descriptions-item>
|
|
||||||
<el-descriptions-item label-align="right" label="建筑面积:">112㎡</el-descriptions-item>
|
|
||||||
<el-descriptions-item label-align="right" label="公摊面积:">12㎡</el-descriptions-item>
|
|
||||||
<el-descriptions-item label-align="right" label="套内面积:">100㎡</el-descriptions-item>
|
|
||||||
<el-descriptions-item label-align="right" label="户型:">3室2厅2卫</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">所属小区:</div>
|
||||||
|
<div class="value">18100000000</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">楼栋:</div>
|
||||||
|
<div class="value">2栋</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">单元:</div>
|
||||||
|
<div class="value">2单元</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">楼层:</div>
|
||||||
|
<div class="value">3楼</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">建筑面积:</div>
|
||||||
|
<div class="value">112㎡</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">公摊面积:</div>
|
||||||
|
<div class="value">12㎡</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">户型:</div>
|
||||||
|
<div class="value">3室2厅2卫</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="AddBuildingBody">
|
||||||
|
<div class="title">
|
||||||
|
<span>储藏室信息 </span>
|
||||||
|
<el-button type="primary" text>编辑</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="addBuildingFormBody">
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">房号:</div>
|
||||||
|
<div class="value">娜美</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">所属小区:</div>
|
||||||
|
<div class="value">18100000000</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">楼栋:</div>
|
||||||
|
<div class="value">2栋</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">单元:</div>
|
||||||
|
<div class="value">2单元</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">楼层:</div>
|
||||||
|
<div class="value">3楼</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">建筑面积:</div>
|
||||||
|
<div class="value">112㎡</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">公摊面积:</div>
|
||||||
|
<div class="value">12㎡</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">户型:</div>
|
||||||
|
<div class="value">3室2厅2卫</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 车位信息 -->
|
||||||
|
<div class="AddBuildingBody">
|
||||||
|
<div class="title">
|
||||||
|
<span>车位信息</span>
|
||||||
|
<el-button type="primary" text>编辑</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="addBuildingFormBody">
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">房号:</div>
|
||||||
|
<div class="value">娜美</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">所属小区:</div>
|
||||||
|
<div class="value">18100000000</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">楼栋:</div>
|
||||||
|
<div class="value">2栋</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">单元:</div>
|
||||||
|
<div class="value">2单元</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">楼层:</div>
|
||||||
|
<div class="value">3楼</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">建筑面积:</div>
|
||||||
|
<div class="value">112㎡</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">公摊面积:</div>
|
||||||
|
<div class="value">12㎡</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">户型:</div>
|
||||||
|
<div class="value">3室2厅2卫</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 收费项目 -->
|
||||||
|
<div class="AddBuildingBody">
|
||||||
|
<div class="title">
|
||||||
|
<span>收费项目</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-table :data="tableData" style="width: 100%">
|
||||||
|
<el-table-column prop="date" label="收费项目" />
|
||||||
|
<el-table-column prop="name" label="收费标准" />
|
||||||
|
<el-table-column prop="name" label="开始时间" />
|
||||||
|
<el-table-column prop="name" label="结束时间" />
|
||||||
|
<el-table-column prop="name" label="备注" />
|
||||||
|
<el-table-column prop="address" label="操作" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 相关住户 -->
|
||||||
|
<div class="AddBuildingBody">
|
||||||
|
<div class="title">
|
||||||
|
<span>相关住户</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-table :data="tableData" style="width: 100%">
|
||||||
|
<el-table-column prop="date" label="姓名" />
|
||||||
|
<el-table-column prop="name" label="性别" />
|
||||||
|
<el-table-column prop="name" label="联系电话" />
|
||||||
|
<el-table-column prop="name" label="身份" />
|
||||||
|
<el-table-column prop="name" label="备注" />
|
||||||
|
<el-table-column prop="address" label="操作" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 缴费账单 -->
|
||||||
|
<div class="AddBuildingBody">
|
||||||
|
<div class="title">
|
||||||
|
<span>缴费账单</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-table :data="tableData" style="width: 100%">
|
||||||
|
<el-table-column prop="date" label="姓名" />
|
||||||
|
<el-table-column prop="name" label="性别" />
|
||||||
|
<el-table-column prop="name" label="联系电话" />
|
||||||
|
<el-table-column prop="name" label="身份" />
|
||||||
|
<el-table-column prop="name" label="备注" />
|
||||||
|
<el-table-column prop="address" label="操作" />
|
||||||
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -28,6 +176,28 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
import PageHeader from '@/components/Pageheader/index.vue';
|
||||||
|
const tableData = [
|
||||||
|
{
|
||||||
|
date: '2016-05-03',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-02',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-04',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-01',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
}
|
||||||
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@@ -35,6 +205,7 @@ import PageHeader from '@/components/Pageheader/index.vue';
|
|||||||
padding: 15px;
|
padding: 15px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
.AddBuildingBody {
|
.AddBuildingBody {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
@@ -47,14 +218,32 @@ import PageHeader from '@/components/Pageheader/index.vue';
|
|||||||
height: 40px;
|
height: 40px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
|
font-size: 15px;
|
||||||
background-color: rgba(255, 255, 255, 1);
|
background-color: rgba(255, 255, 255, 1);
|
||||||
color: rgba(16, 16, 16, 1);
|
color: rgba(16, 16, 16, 1);
|
||||||
border-bottom: 1px solid #bbbbbb;
|
border-bottom: 1px solid #bbbbbb;
|
||||||
margin-bottom: 60px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
.addBuildingFormBody {
|
.addBuildingFormBody {
|
||||||
font-size: large;
|
display: grid;
|
||||||
font-weight: bold;
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
grid-template-rows: repeat(3, 1fr);
|
||||||
|
|
||||||
|
.descriptionsbox {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 10px 0;
|
||||||
|
font-size: 15px;
|
||||||
|
.label {
|
||||||
|
width: 100px;
|
||||||
|
text-align: right;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
.value {
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ function contextMenuFun(val: { type: string; value: string }) {
|
|||||||
break;
|
break;
|
||||||
case 'main':
|
case 'main':
|
||||||
console.log('你选择了:', val);
|
console.log('你选择了:', val);
|
||||||
|
router.push({
|
||||||
|
path: '/house/HouseDetails',
|
||||||
|
query: {
|
||||||
|
id: val.value
|
||||||
|
}
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
console.log('你选择了:', val);
|
console.log('你选择了:', val);
|
||||||
|
|||||||
@@ -178,14 +178,15 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
import PageHeader from '@/components/Pageheader/index.vue';
|
||||||
import { HouseRentalVO } from '@/api/system/houseRental/type';
|
import { HouseRentalVO } from '@/api/system/houseRental/type';
|
||||||
import { CascaderValue, UploadFiles, UploadInstance, UploadProps, UploadRawFile, UploadUserFile } from 'element-plus';
|
import { CascaderValue, UploadInstance, UploadProps, UploadUserFile } from 'element-plus';
|
||||||
|
|
||||||
import { getCommunitylistAPI } from '@/api/system/community';
|
import { getHousePathById, hasFormData, splitStringUrl } from '@/utils/house';
|
||||||
import { getVillageTree } from '@/api/system/house';
|
|
||||||
import { convertBuildingToTree, getHousePathById, hasFormData, splitStringUrl } from '@/utils/house';
|
|
||||||
import { addHouseRental, getHouseRental, updateHouseRental, uploadHouseImage } from '@/api/system/houseRental';
|
import { addHouseRental, getHouseRental, updateHouseRental, uploadHouseImage } from '@/api/system/houseRental';
|
||||||
import { validator } from '@/utils/Reg';
|
import { validator } from '@/utils/Reg';
|
||||||
|
import { useHouseStore } from '@/store/modules/house';
|
||||||
|
|
||||||
|
const houseStore = useHouseStore();
|
||||||
|
const { treedata } = storeToRefs(houseStore);
|
||||||
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/houseRental/uploadImages';
|
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/houseRental/uploadImages';
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { com_rental_method } = toRefs<any>(proxy?.useDict('com_rental_method'));
|
const { com_rental_method } = toRefs<any>(proxy?.useDict('com_rental_method'));
|
||||||
@@ -233,15 +234,7 @@ const rules = ref({
|
|||||||
// ! 编辑租赁-=================================================================================
|
// ! 编辑租赁-=================================================================================
|
||||||
const userid = ref(null);
|
const userid = ref(null);
|
||||||
// !== 楼栋房屋 =============================================================================
|
// !== 楼栋房屋 =============================================================================
|
||||||
const treedata = ref([]);
|
|
||||||
function gettreedata() {
|
function gettreedata() {
|
||||||
getCommunitylistAPI().then((res) => {
|
|
||||||
const currentviliage = res.rows.find((item) => item.choiceStatus === 0);
|
|
||||||
if (currentviliage.villageId) {
|
|
||||||
getVillageTree(currentviliage.villageId).then((res) => {
|
|
||||||
treedata.value = convertBuildingToTree(res.data.buildings);
|
|
||||||
console.log(treedata.value);
|
|
||||||
// !== 编辑用户 =============================================================================
|
|
||||||
if (route.query.id) {
|
if (route.query.id) {
|
||||||
userid.value = route.query.id;
|
userid.value = route.query.id;
|
||||||
getHouseRental(userid.value).then((res) => {
|
getHouseRental(userid.value).then((res) => {
|
||||||
@@ -256,9 +249,6 @@ function gettreedata() {
|
|||||||
userHousepath.value = arr;
|
userHousepath.value = arr;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
gettreedata();
|
gettreedata();
|
||||||
|
|
||||||
@@ -284,6 +274,7 @@ const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => {
|
|||||||
};
|
};
|
||||||
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
|
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
|
||||||
console.log(uploadFile, uploadFiles);
|
console.log(uploadFile, uploadFiles);
|
||||||
|
fileList.value = uploadFiles;
|
||||||
};
|
};
|
||||||
|
|
||||||
// !== 家电 =============================================================================
|
// !== 家电 =============================================================================
|
||||||
@@ -321,11 +312,11 @@ const submitForm = () => {
|
|||||||
if (item.raw && item.raw instanceof File) {
|
if (item.raw && item.raw instanceof File) {
|
||||||
formdata.append('files', item.raw);
|
formdata.append('files', item.raw);
|
||||||
} else {
|
} else {
|
||||||
str += item.url;
|
str += item.url + ',';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(formdata);
|
console.log(formdata);
|
||||||
if (!hasFormData(formdata)) return sendForm();
|
if (!hasFormData(formdata)) return sendForm(str);
|
||||||
uploadHouseImage(formdata)
|
uploadHouseImage(formdata)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.success.length > 0) {
|
if (res.data.success.length > 0) {
|
||||||
@@ -343,7 +334,7 @@ const submitForm = () => {
|
|||||||
});
|
});
|
||||||
ElMessage.error('图片:' + str + ' 上传失败!');
|
ElMessage.error('图片:' + str + ' 上传失败!');
|
||||||
}
|
}
|
||||||
sendForm();
|
sendForm(str);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
if (err && err.data && err.data.error.length > 0) {
|
if (err && err.data && err.data.error.length > 0) {
|
||||||
@@ -356,16 +347,16 @@ const submitForm = () => {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
sendForm();
|
sendForm(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const sendForm = () => {
|
const sendForm = (val: string) => {
|
||||||
|
form.value.houseImageUrl = val;
|
||||||
// edit or add
|
// edit or add
|
||||||
if (userid.value) {
|
if (userid.value) {
|
||||||
console.log('edit');
|
console.log('edit');
|
||||||
console.log(form.value);
|
|
||||||
updateHouseRental(form.value).then(() => {
|
updateHouseRental(form.value).then(() => {
|
||||||
ElMessage.success('编辑成功');
|
ElMessage.success('编辑成功');
|
||||||
cancelForm();
|
cancelForm();
|
||||||
@@ -422,6 +413,7 @@ const cancelForm = () => {
|
|||||||
padding: 15px;
|
padding: 15px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
.AddBuildingBody {
|
.AddBuildingBody {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
|||||||
197
src/views/system/houseRental/houseMain.vue
Normal file
197
src/views/system/houseRental/houseMain.vue
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
<template>
|
||||||
|
<div class="AddBuildingBox">
|
||||||
|
<PageHeader title="房屋租赁管理"></PageHeader>
|
||||||
|
<div class="AddBuildingBody">
|
||||||
|
<div class="title">
|
||||||
|
<span>基础资料 </span>
|
||||||
|
<span class="ml-20px color-blue cursor-pointer" @click="hanlededit">编辑</span>
|
||||||
|
</div>
|
||||||
|
<div class="addBuildingFormBody">
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">房屋:</div>
|
||||||
|
<div class="value">{{ HouseInfo.house }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">业主姓名:</div>
|
||||||
|
<div class="value">{{ HouseInfo.rentalName }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">租金:</div>
|
||||||
|
<div class="value">{{ HouseInfo.rent }}元</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">租赁方式:</div>
|
||||||
|
<div class="value">
|
||||||
|
<DictTag :options="com_rental_method" :value="HouseInfo.rentalType"></DictTag>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">房屋朝向:</div>
|
||||||
|
<div class="value">{{ HouseInfo.houseFace }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">房屋面积:</div>
|
||||||
|
<div class="value">{{ HouseInfo.houseArea }}㎡</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">房屋楼层:</div>
|
||||||
|
<div class="value">{{ HouseInfo.floorNo }}层</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">入住时间:</div>
|
||||||
|
<div class="value">{{ HouseInfo.inTime }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">房屋设施:</div>
|
||||||
|
<div class="value">
|
||||||
|
<DictTag :options="com_house_rental_facilities" :value="HouseInfo.facilities"></DictTag>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="10">
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">房屋照片:</div>
|
||||||
|
<div class="value grid grid-cols-4 gap-4">
|
||||||
|
<el-image v-for="(item, index) in HouseInfo.houseImageUrls" :key="index" :src="item" class="houseImage"></el-image>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">租房信息:</div>
|
||||||
|
<div class="value">{{ HouseInfo.supInfo }}</div>
|
||||||
|
</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">租房电话:</div>
|
||||||
|
<div class="value">{{ HouseInfo.phone }}</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="descriptionsbox">
|
||||||
|
<div class="label">微信:</div>
|
||||||
|
<div class="value">{{ HouseInfo.vx }}</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import PageHeader from '@/components/Pageheader/index.vue';
|
||||||
|
import { getHouseRental } from '@/api/system/houseRental';
|
||||||
|
import { useHouseStore } from '@/store/modules/house';
|
||||||
|
import { getHousePathById } from '@/utils/house';
|
||||||
|
|
||||||
|
const houseStore = useHouseStore();
|
||||||
|
const { treedata } = storeToRefs(houseStore);
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
const { com_rental_method } = toRefs<any>(proxy?.useDict('com_rental_method'));
|
||||||
|
const { com_house_rental_facilities } = toRefs<any>(proxy?.useDict('com_house_rental_facilities'));
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
const houseRentalid = ref(null);
|
||||||
|
const HouseInfo = ref({
|
||||||
|
'id': '',
|
||||||
|
house: '',
|
||||||
|
'name': null,
|
||||||
|
'rentalStatus': null,
|
||||||
|
'rentalName': '',
|
||||||
|
'rent': null,
|
||||||
|
'rentalType': '',
|
||||||
|
'houseFace': '',
|
||||||
|
'houseArea': null,
|
||||||
|
'floorNo': null,
|
||||||
|
'inTime': '',
|
||||||
|
'facilities': '',
|
||||||
|
'houseImageUrl': '',
|
||||||
|
'supInfo': '',
|
||||||
|
'phone': null,
|
||||||
|
'vx': '',
|
||||||
|
'email': '',
|
||||||
|
'houseId': null,
|
||||||
|
'houseUse': '',
|
||||||
|
'pubBy': null,
|
||||||
|
'pubTime': '',
|
||||||
|
houseImageUrls: []
|
||||||
|
});
|
||||||
|
function init() {
|
||||||
|
if (route.query.id) {
|
||||||
|
houseRentalid.value = route.query.id;
|
||||||
|
}
|
||||||
|
getHouseRental(houseRentalid.value).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
HouseInfo.value = res.data;
|
||||||
|
HouseInfo.value.houseImageUrls = HouseInfo.value.houseImageUrl.split(',').filter((item) => item);
|
||||||
|
const arr = getHousePathById(treedata.value, HouseInfo.value.houseId, 'label');
|
||||||
|
HouseInfo.value.house = arr.join(' - ');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
init();
|
||||||
|
|
||||||
|
function hanlededit() {
|
||||||
|
router.push({
|
||||||
|
path: '/house/addhouseRental',
|
||||||
|
query: {
|
||||||
|
id: HouseInfo.value.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AddBuildingBox {
|
||||||
|
padding: 15px;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
.AddBuildingBody {
|
||||||
|
margin-top: 20px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: white;
|
||||||
|
padding: 15px;
|
||||||
|
.title {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
padding-left: 20px;
|
||||||
|
font-size: 15px;
|
||||||
|
background-color: rgba(255, 255, 255, 1);
|
||||||
|
color: rgba(16, 16, 16, 1);
|
||||||
|
border-bottom: 1px solid #bbbbbb;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.addBuildingFormBody {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
grid-template-rows: repeat(4, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.houseImage {
|
||||||
|
width: 200px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
.descriptionsbox {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
font-size: 15px;
|
||||||
|
.label {
|
||||||
|
width: 100px;
|
||||||
|
text-align: right;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
.value {
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -46,17 +46,18 @@
|
|||||||
|
|
||||||
<el-table class="h-full" v-loading="loading" border :data="houseRentalList" @selection-change="handleSelectionChange">
|
<el-table class="h-full" v-loading="loading" border :data="houseRentalList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="房屋信息" align="center" prop="rentalName" />
|
<el-table-column label="房屋信息" align="center" prop="name" />
|
||||||
<el-table-column label="租赁状态" align="center" prop="rent" />
|
<el-table-column label="租赁状态" align="center" prop="rentalStatus">
|
||||||
<el-table-column label="发布人" align="center" prop="rentalName" />
|
|
||||||
<el-table-column label="联系方式" align="center" prop="rent" />
|
|
||||||
<el-table-column label="发布时间" align="center" prop="pubTime" />
|
|
||||||
<el-table-column label="房屋用途" align="center" prop="rent">
|
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span v-if="row.houseUse === 0">普通住宅</span>
|
<DictTag :options="com_rental_status" :value="row.rentalStatus"></DictTag>
|
||||||
<span v-else-if="row.houseUse === 1"> 商业用地 </span>
|
</template>
|
||||||
<span v-else-if="row.houseUse === 2">商住两用</span>
|
</el-table-column>
|
||||||
<span v-else>其他</span>
|
<el-table-column label="发布人" align="center" prop="rentalName" />
|
||||||
|
<el-table-column label="联系方式" align="center" prop="phone" />
|
||||||
|
<el-table-column label="发布时间" align="center" prop="pubTime" />
|
||||||
|
<el-table-column label="房屋用途" align="center" prop="houseUse">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<DictTag :options="com_house_use" :value="row.houseUse"></DictTag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="租赁方式" align="center" prop="rentalType">
|
<el-table-column label="租赁方式" align="center" prop="rentalType">
|
||||||
@@ -67,18 +68,9 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip content="修改" placement="top">
|
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['houseRental:houseRental:edit']">详情</el-button>
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['houseRental:houseRental:edit']"></el-button>
|
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['houseRental:houseRental:edit']">修改</el-button>
|
||||||
</el-tooltip>
|
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['houseRental:houseRental:remove']">删除</el-button>
|
||||||
<el-tooltip content="删除" placement="top">
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
icon="Delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['houseRental:houseRental:remove']"
|
|
||||||
></el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -90,12 +82,12 @@
|
|||||||
|
|
||||||
<script setup name="HouseRental" lang="ts">
|
<script setup name="HouseRental" lang="ts">
|
||||||
import Pageheader from '@/components/Pageheader/index.vue';
|
import Pageheader from '@/components/Pageheader/index.vue';
|
||||||
import { listHouseRental, delHouseRental, addHouseRental, updateHouseRental } from '@/api/system/houseRental/index';
|
import { listHouseRental, delHouseRental } from '@/api/system/houseRental/index';
|
||||||
import { HouseRentalVO, HouseRentalQuery, HouseRentalForm } from '@/api/system/houseRental/type';
|
import { HouseRentalVO, HouseRentalQuery, HouseRentalForm } from '@/api/system/houseRental/type';
|
||||||
import { getDictLabel } from '@/utils/house';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { com_house_use } = toRefs<any>(proxy?.useDict('com_house_use'));
|
const { com_house_use } = toRefs<any>(proxy?.useDict('com_house_use'));
|
||||||
|
const { com_rental_status } = toRefs<any>(proxy?.useDict('com_rental_status'));
|
||||||
const { com_rental_method } = toRefs<any>(proxy?.useDict('com_rental_method'));
|
const { com_rental_method } = toRefs<any>(proxy?.useDict('com_rental_method'));
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -216,6 +208,15 @@ const handleUpdate = async (row?: HouseRentalVO) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
/** 详情按钮操作 */
|
||||||
|
const handleMain = async (row?: HouseRentalVO) => {
|
||||||
|
router.push({
|
||||||
|
path: '/house/houseMain',
|
||||||
|
query: {
|
||||||
|
id: row.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (row?: HouseRentalVO) => {
|
const handleDelete = async (row?: HouseRentalVO) => {
|
||||||
@@ -231,4 +232,8 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss">
|
||||||
|
.el-table {
|
||||||
|
height: calc(100% - 100px);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,362 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="p-2">
|
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
|
||||||
<el-card shadow="hover">
|
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
|
||||||
<el-form-item label="房屋id" prop="houseId">
|
|
||||||
<el-input v-model="queryParams.houseId" placeholder="请输入房屋id" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="租户姓名" prop="rentalName">
|
|
||||||
<el-input v-model="queryParams.rentalName" placeholder="请输入租户姓名" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="租金 单位元" prop="rent">
|
|
||||||
<el-input v-model="queryParams.rent" placeholder="请输入租金 单位元" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="租赁状态 0未租 1出租中 2退租" prop="rentalStatus">
|
|
||||||
<el-select v-model="queryParams.rentalStatus" placeholder="请选择租赁状态 0未租 1出租中 2退租" clearable >
|
|
||||||
<el-option v-for="dict in com_rental_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="房屋朝向" prop="houseFace">
|
|
||||||
<el-input v-model="queryParams.houseFace" placeholder="请输入房屋朝向" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="房屋面积" prop="houseArea">
|
|
||||||
<el-input v-model="queryParams.houseArea" placeholder="请输入房屋面积" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="楼层号" prop="floorNo">
|
|
||||||
<el-input v-model="queryParams.floorNo" placeholder="请输入楼层号" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="入住时间" prop="inTime">
|
|
||||||
<el-date-picker clearable
|
|
||||||
v-model="queryParams.inTime"
|
|
||||||
type="date"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
placeholder="请选择入住时间"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="房屋设施" prop="facilities">
|
|
||||||
<el-input v-model="queryParams.facilities" placeholder="请输入房屋设施" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="房屋照片url( "," 隔开)" prop="houseImageUrl">
|
|
||||||
<el-input v-model="queryParams.houseImageUrl" placeholder="请输入房屋照片url( "," 隔开)" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="补充租房信息" prop="supInfo">
|
|
||||||
<el-input v-model="queryParams.supInfo" placeholder="请输入补充租房信息" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="手机号" prop="phone">
|
|
||||||
<el-input v-model="queryParams.phone" placeholder="请输入手机号" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="微信" prop="vx">
|
|
||||||
<el-input v-model="queryParams.vx" placeholder="请输入微信" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="邮箱" prop="email">
|
|
||||||
<el-input v-model="queryParams.email" placeholder="请输入邮箱" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
|
|
||||||
<el-card shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['houseRental:houseRental:add']">新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['houseRental:houseRental:edit']">修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['houseRental:houseRental:remove']">删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['houseRental:houseRental:export']">导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" border :data="houseRentalList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="id 房屋租赁表id" align="center" prop="id" v-if="true" />
|
|
||||||
<el-table-column label="房屋id" align="center" prop="houseId" />
|
|
||||||
<el-table-column label="租户姓名" align="center" prop="rentalName" />
|
|
||||||
<el-table-column label="租金 单位元" align="center" prop="rent" />
|
|
||||||
<el-table-column label="0 整租 1 合租" align="center" prop="rentalType" />
|
|
||||||
<el-table-column label="租赁状态 0未租 1出租中 2退租" align="center" prop="rentalStatus">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="com_rental_status" :value="scope.row.rentalStatus"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="房屋朝向" align="center" prop="houseFace" />
|
|
||||||
<el-table-column label="房屋面积" align="center" prop="houseArea" />
|
|
||||||
<el-table-column label="楼层号" align="center" prop="floorNo" />
|
|
||||||
<el-table-column label="入住时间" align="center" prop="inTime" width="180">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ parseTime(scope.row.inTime, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="房屋设施" align="center" prop="facilities">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="com_house_rental_facilities" :value="scope.row.facilities"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="房屋照片url( "," 隔开)" align="center" prop="houseImageUrl" />
|
|
||||||
<el-table-column label="补充租房信息" align="center" prop="supInfo" />
|
|
||||||
<el-table-column label="手机号" align="center" prop="phone" />
|
|
||||||
<el-table-column label="微信" align="center" prop="vx" />
|
|
||||||
<el-table-column label="邮箱" align="center" prop="email" />
|
|
||||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-tooltip content="修改" placement="top">
|
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['houseRental:houseRental:edit']"></el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
<el-tooltip content="删除" placement="top">
|
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['houseRental:houseRental:remove']"></el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
||||||
</el-card>
|
|
||||||
<!-- 添加或修改房屋租赁管理对话框 -->
|
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
|
||||||
<el-form ref="houseRentalFormRef" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="房屋id" prop="houseId">
|
|
||||||
<el-input v-model="form.houseId" placeholder="请输入房屋id" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="租户姓名" prop="rentalName">
|
|
||||||
<el-input v-model="form.rentalName" placeholder="请输入租户姓名" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="租金 单位元" prop="rent">
|
|
||||||
<el-input v-model="form.rent" placeholder="请输入租金 单位元" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="租赁状态 0未租 1出租中 2退租" prop="rentalStatus">
|
|
||||||
<el-radio-group v-model="form.rentalStatus">
|
|
||||||
<el-radio
|
|
||||||
v-for="dict in com_rental_status"
|
|
||||||
:key="dict.value"
|
|
||||||
:value="parseInt(dict.value)"
|
|
||||||
>{{dict.label}}</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="房屋朝向" prop="houseFace">
|
|
||||||
<el-input v-model="form.houseFace" placeholder="请输入房屋朝向" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="房屋面积" prop="houseArea">
|
|
||||||
<el-input v-model="form.houseArea" placeholder="请输入房屋面积" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="楼层号" prop="floorNo">
|
|
||||||
<el-input v-model="form.floorNo" placeholder="请输入楼层号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="入住时间" prop="inTime">
|
|
||||||
<el-date-picker clearable
|
|
||||||
v-model="form.inTime"
|
|
||||||
type="datetime"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
placeholder="请选择入住时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="房屋设施" prop="facilities">
|
|
||||||
<el-input v-model="form.facilities" placeholder="请输入房屋设施" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="房屋照片url( "," 隔开)" prop="houseImageUrl">
|
|
||||||
<el-input v-model="form.houseImageUrl" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="补充租房信息" prop="supInfo">
|
|
||||||
<el-input v-model="form.supInfo" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="手机号" prop="phone">
|
|
||||||
<el-input v-model="form.phone" placeholder="请输入手机号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="微信" prop="vx">
|
|
||||||
<el-input v-model="form.vx" placeholder="请输入微信" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="邮箱" prop="email">
|
|
||||||
<el-input v-model="form.email" placeholder="请输入邮箱" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup name="HouseRental" lang="ts">
|
|
||||||
import { listHouseRental, getHouseRental, delHouseRental, addHouseRental, updateHouseRental } from '@/api/houseRental/houseRental';
|
|
||||||
import { HouseRentalVO, HouseRentalQuery, HouseRentalForm } from '@/api/houseRental/houseRental/types';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { com_rental_status } = toRefs<any>(proxy?.useDict('com_rental_status'));
|
|
||||||
|
|
||||||
const houseRentalList = ref<HouseRentalVO[]>([]);
|
|
||||||
const buttonLoading = ref(false);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const ids = ref<Array<string | number>>([]);
|
|
||||||
const single = ref(true);
|
|
||||||
const multiple = ref(true);
|
|
||||||
const total = ref(0);
|
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
|
||||||
const houseRentalFormRef = ref<ElFormInstance>();
|
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
|
||||||
visible: false,
|
|
||||||
title: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const initFormData: HouseRentalForm = {
|
|
||||||
id: undefined,
|
|
||||||
houseId: undefined,
|
|
||||||
rentalName: undefined,
|
|
||||||
rent: undefined,
|
|
||||||
rentalType: undefined,
|
|
||||||
rentalStatus: undefined,
|
|
||||||
houseFace: undefined,
|
|
||||||
houseArea: undefined,
|
|
||||||
floorNo: undefined,
|
|
||||||
inTime: undefined,
|
|
||||||
facilities: undefined,
|
|
||||||
houseImageUrl: undefined,
|
|
||||||
supInfo: undefined,
|
|
||||||
phone: undefined,
|
|
||||||
vx: undefined,
|
|
||||||
email: undefined,
|
|
||||||
}
|
|
||||||
const data = reactive<PageData<HouseRentalForm, HouseRentalQuery>>({
|
|
||||||
form: {...initFormData},
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
houseId: undefined,
|
|
||||||
rentalName: undefined,
|
|
||||||
rent: undefined,
|
|
||||||
rentalType: undefined,
|
|
||||||
rentalStatus: undefined,
|
|
||||||
houseFace: undefined,
|
|
||||||
houseArea: undefined,
|
|
||||||
floorNo: undefined,
|
|
||||||
inTime: undefined,
|
|
||||||
facilities: undefined,
|
|
||||||
houseImageUrl: undefined,
|
|
||||||
supInfo: undefined,
|
|
||||||
phone: undefined,
|
|
||||||
vx: undefined,
|
|
||||||
email: undefined,
|
|
||||||
params: {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
id: [
|
|
||||||
{ required: true, message: "id 房屋租赁表id不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
|
||||||
|
|
||||||
/** 查询房屋租赁管理列表 */
|
|
||||||
const getList = async () => {
|
|
||||||
loading.value = true;
|
|
||||||
const res = await listHouseRental(queryParams.value);
|
|
||||||
houseRentalList.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 取消按钮 */
|
|
||||||
const cancel = () => {
|
|
||||||
reset();
|
|
||||||
dialog.visible = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 表单重置 */
|
|
||||||
const reset = () => {
|
|
||||||
form.value = {...initFormData};
|
|
||||||
houseRentalFormRef.value?.resetFields();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
const handleQuery = () => {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryFormRef.value?.resetFields();
|
|
||||||
handleQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
|
||||||
const handleSelectionChange = (selection: HouseRentalVO[]) => {
|
|
||||||
ids.value = selection.map(item => item.id);
|
|
||||||
single.value = selection.length != 1;
|
|
||||||
multiple.value = !selection.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
const handleAdd = () => {
|
|
||||||
reset();
|
|
||||||
dialog.visible = true;
|
|
||||||
dialog.title = "添加房屋租赁管理";
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
const handleUpdate = async (row?: HouseRentalVO) => {
|
|
||||||
reset();
|
|
||||||
const _id = row?.id || ids.value[0]
|
|
||||||
const res = await getHouseRental(_id);
|
|
||||||
Object.assign(form.value, res.data);
|
|
||||||
dialog.visible = true;
|
|
||||||
dialog.title = "修改房屋租赁管理";
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
const submitForm = () => {
|
|
||||||
houseRentalFormRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
buttonLoading.value = true;
|
|
||||||
if (form.value.id) {
|
|
||||||
await updateHouseRental(form.value).finally(() => buttonLoading.value = false);
|
|
||||||
} else {
|
|
||||||
await addHouseRental(form.value).finally(() => buttonLoading.value = false);
|
|
||||||
}
|
|
||||||
proxy?.$modal.msgSuccess("操作成功");
|
|
||||||
dialog.visible = false;
|
|
||||||
await getList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
const handleDelete = async (row?: HouseRentalVO) => {
|
|
||||||
const _ids = row?.id || ids.value;
|
|
||||||
await proxy?.$modal.confirm('是否确认删除房屋租赁管理编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
|
||||||
await delHouseRental(_ids);
|
|
||||||
proxy?.$modal.msgSuccess("删除成功");
|
|
||||||
await getList();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
const handleExport = () => {
|
|
||||||
proxy?.download('houseRental/houseRental/export', {
|
|
||||||
...queryParams.value
|
|
||||||
}, `houseRental_${new Date().getTime()}.xlsx`)
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<el-col :span="11">
|
<el-col :span="11">
|
||||||
<el-form-item label="车位类型" prop="type">
|
<el-form-item label="车位类型" prop="type">
|
||||||
<el-radio-group v-model="form.type">
|
<el-radio-group v-model="form.type">
|
||||||
<el-radio v-for="dict in com_parking_type" :key="dict.value" :value="parseInt(dict.value)">{{ dict.label }}</el-radio>
|
<el-radio v-for="dict in com_parking_type" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="持有人" prop="residentId">
|
<el-form-item label="持有人" prop="residentId">
|
||||||
<!-- 公共组件 持有人 -->
|
<!-- 公共组件 持有人 -->
|
||||||
<Holder @change="handleChange"></Holder>
|
<Holder :userid="form.resident_id" @change="handleChange"></Holder>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -96,9 +96,9 @@ const form = ref({
|
|||||||
areaId: null, // 区域id
|
areaId: null, // 区域id
|
||||||
parkingArea: null, // 车位面积
|
parkingArea: null, // 车位面积
|
||||||
parkingFloor: null, // 车位楼层
|
parkingFloor: null, // 车位楼层
|
||||||
type: 0, // 车位类型
|
type: '0', // 车位类型
|
||||||
resident_id: null, // 住户id
|
residentId: null, // 住户id
|
||||||
parkingStatus: null, // 车位状态
|
parkingStatus: '', // 车位状态
|
||||||
remark: '', // 备注
|
remark: '', // 备注
|
||||||
parkingCode: '' // 车位编码
|
parkingCode: '' // 车位编码
|
||||||
});
|
});
|
||||||
@@ -113,7 +113,6 @@ const userid = ref(null);
|
|||||||
if (route.query.id) {
|
if (route.query.id) {
|
||||||
userid.value = route.query.id;
|
userid.value = route.query.id;
|
||||||
getParking(userid.value).then((res) => {
|
getParking(userid.value).then((res) => {
|
||||||
console.log(res);
|
|
||||||
form.value = {
|
form.value = {
|
||||||
...form.value,
|
...form.value,
|
||||||
...res.data
|
...res.data
|
||||||
@@ -143,7 +142,7 @@ function handleChange(pop) {
|
|||||||
const submitForm = () => {
|
const submitForm = () => {
|
||||||
formRef.value?.validate(async (valid: boolean) => {
|
formRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
form.value.resident_id = holderInfo.value;
|
form.value.residentId = holderInfo.value;
|
||||||
if (userid.value) {
|
if (userid.value) {
|
||||||
updateParking(form.value).then((res) => {
|
updateParking(form.value).then((res) => {
|
||||||
ElMessage.success('编辑成功');
|
ElMessage.success('编辑成功');
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
<el-form-item label="车位状态" prop="parkingStatus">
|
<el-form-item label="车位状态" prop="parkingStatus">
|
||||||
<el-select v-model="queryParams.parkingStatus" placeholder="请选择" clearable>
|
<el-select v-model="queryParams.parkingStatus" placeholder="请选择" clearable>
|
||||||
<el-option v-for="dict in com_parking_statuslist" :key="dict.value" :label="dict.label" :value="Number(dict.value)" />
|
<el-option v-for="dict in com_parking_status" :key="dict.value" :label="dict.label" :value="Number(dict.value)" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@@ -65,19 +65,19 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="车位类型" align="center" prop="type">
|
<el-table-column label="车位类型" align="center" prop="type">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="com_parking_typelist" :value="scope.row.type" />
|
<dict-tag :options="com_parking_type" :value="scope.row.type" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="持有人" align="center" prop="residentName" />
|
<el-table-column label="持有人" align="center" prop="residentName" />
|
||||||
<el-table-column label="审核状态" align="center" prop="checkStatus">
|
<el-table-column label="审核状态" align="center" prop="checkStatus">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="com_reviewlist" :value="scope.row.checkStatus" />
|
<dict-tag :options="com_review" :value="scope.row.checkStatus" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['parking:parking:edit']">审核</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleMain(scope.row)" v-hasPermi="['parking:parking:edit']">审核</el-button>
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['parking:parking:edit']">修改</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['parking:parking:edit']">修改</el-button>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['parking:parking:remove']">删除</el-button>
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['parking:parking:remove']">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -100,10 +100,6 @@ const { com_review } = toRefs<any>(proxy?.useDict('com_review'));
|
|||||||
const { com_parking_type } = toRefs<any>(proxy?.useDict('com_parking_type'));
|
const { com_parking_type } = toRefs<any>(proxy?.useDict('com_parking_type'));
|
||||||
const { com_parking_status } = toRefs<any>(proxy?.useDict('com_parking_status'));
|
const { com_parking_status } = toRefs<any>(proxy?.useDict('com_parking_status'));
|
||||||
|
|
||||||
const com_reviewlist = computed(() => com_review.value ?? []);
|
|
||||||
const com_parking_typelist = computed(() => com_parking_type.value ?? []);
|
|
||||||
const com_parking_statuslist = computed(() => com_parking_status.value ?? []);
|
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const parkingList = ref<ParkingVO[]>([]);
|
const parkingList = ref<ParkingVO[]>([]);
|
||||||
const buttonLoading = ref(false);
|
const buttonLoading = ref(false);
|
||||||
@@ -142,16 +138,13 @@ const data = reactive<PageData<ParkingForm, ParkingQuery>>({
|
|||||||
areaId: undefined,
|
areaId: undefined,
|
||||||
parkingCode: undefined,
|
parkingCode: undefined,
|
||||||
parkingArea: undefined,
|
parkingArea: undefined,
|
||||||
parkingStatus: undefined,
|
parkingStatus: '',
|
||||||
type: undefined,
|
type: undefined,
|
||||||
residentId: undefined,
|
residentId: undefined,
|
||||||
addTime: undefined,
|
addTime: undefined,
|
||||||
addBy: undefined,
|
addBy: undefined,
|
||||||
checkStatus: undefined,
|
checkStatus: undefined,
|
||||||
params: {}
|
params: {}
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
id: [{ required: true, message: 'id车位管理表不能为空', trigger: 'blur' }]
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -210,6 +203,15 @@ const handleUpdate = async (row?: ParkingVO) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
/** 审核按钮操作 */
|
||||||
|
const handleMain = async (row?: ParkingVO) => {
|
||||||
|
router.push({
|
||||||
|
path: '/carArea/parkMain',
|
||||||
|
query: {
|
||||||
|
id: row.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (row?: ParkingVO) => {
|
const handleDelete = async (row?: ParkingVO) => {
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="w-full h-50%">
|
<div class="w-full h-50%">
|
||||||
<el-steps space="200px" direction="vertical" :active="activeStop">
|
<!-- <el-steps space="200px" direction="vertical" :active="activeStop">
|
||||||
<el-step :description="reviewInfo.submitTime">
|
<el-step :description="reviewInfo.submitTime">
|
||||||
<template #title>
|
<template #title>
|
||||||
<span v-if="active === 0">未提交信息</span>
|
<span v-if="active === 0">未提交信息</span>
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
<span>审核完成</span>
|
<span>审核完成</span>
|
||||||
</template>
|
</template>
|
||||||
</el-step>
|
</el-step>
|
||||||
</el-steps>
|
</el-steps> -->
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|||||||
@@ -91,9 +91,9 @@
|
|||||||
<div class="preivewBodybox">
|
<div class="preivewBodybox">
|
||||||
<el-input v-model="reviewInfo.propertyReviewFeedback" placeholder="请输入" type="textarea" :rows="5"></el-input>
|
<el-input v-model="reviewInfo.propertyReviewFeedback" placeholder="请输入" type="textarea" :rows="5"></el-input>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<el-button type="primary">审核通过</el-button>
|
<el-button type="primary" @click="updatePass('1')">审核通过</el-button>
|
||||||
<el-button type="danger">审核不通过</el-button>
|
<el-button type="danger" @click="updatePass('2')">审核不通过</el-button>
|
||||||
<el-button>返回</el-button>
|
<el-button @click="backRoute">返回</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -114,21 +114,17 @@
|
|||||||
<el-steps space="200px" direction="vertical" :active="activeStop">
|
<el-steps space="200px" direction="vertical" :active="activeStop">
|
||||||
<el-step :description="reviewInfo.submitTime">
|
<el-step :description="reviewInfo.submitTime">
|
||||||
<template #title>
|
<template #title>
|
||||||
<span v-if="active === 0">未提交信息</span>
|
<DictTag :options="com_sub_status" :value="reviewInfo.submitStatus || '0'"></DictTag>
|
||||||
<span v-if="active >= 1">已提交信息</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-step>
|
</el-step>
|
||||||
<el-step :description="reviewInfo.propertyTime">
|
<el-step :description="reviewInfo.propertyTime">
|
||||||
<template #title>
|
<template #title>
|
||||||
<span v-if="active <= 2">待审核</span>
|
<DictTag :options="com_review" :value="reviewInfo.propertyStatus || '0'"></DictTag>
|
||||||
<span v-if="active === 3">物业审核不通过</span>
|
|
||||||
<span v-if="active >= 4">物业审核通过</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-step>
|
</el-step>
|
||||||
<el-step :description="reviewInfo.certificationTime">
|
<el-step :description="reviewInfo.certificationTime">
|
||||||
<template #title>
|
<template #title>
|
||||||
<span v-if="active <= 5">未认证</span>
|
<DictTag :options="com_certification_status" :value="reviewInfo.certificationStatus || '0'"></DictTag>
|
||||||
<span v-if="active === 6">已认证</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-step>
|
</el-step>
|
||||||
<el-step>
|
<el-step>
|
||||||
@@ -147,9 +143,14 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
import PageHeader from '@/components/Pageheader/index.vue';
|
||||||
import { getResident, getresidentReviewlistAPI } from '@/api/system/resident';
|
import { getResident, getresidentReviewlistAPI, UpdateResidentReviewAPI } from '@/api/system/resident';
|
||||||
import { ResidentVO } from '@/api/system/resident/type';
|
import { ResidentVO } from '@/api/system/resident/type';
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
const { com_review } = toRefs<any>(proxy?.useDict('com_review'));
|
||||||
|
const { com_sub_status } = toRefs<any>(proxy?.useDict('com_sub_status'));
|
||||||
|
const { com_certification_status } = toRefs<any>(proxy?.useDict('com_certification_status'));
|
||||||
|
|
||||||
const userInfo = ref<ResidentVO>({
|
const userInfo = ref<ResidentVO>({
|
||||||
code: null,
|
code: null,
|
||||||
villageId: '',
|
villageId: '',
|
||||||
@@ -171,33 +172,15 @@ const reviewInfo = ref({
|
|||||||
'id': null,
|
'id': null,
|
||||||
'residentId': null,
|
'residentId': null,
|
||||||
'submitTime': '',
|
'submitTime': '',
|
||||||
'submitStatus': 1,
|
'submitStatus': '1',
|
||||||
'propertyTime': null,
|
'propertyTime': '',
|
||||||
'propertyStatus': null,
|
'propertyStatus': '0',
|
||||||
'propertyReviewFeedback': '',
|
'propertyReviewFeedback': '', // 审核意见
|
||||||
'certificationTime': null,
|
'certificationTime': '',
|
||||||
'certificationStatus': null
|
'certificationStatus': '0'
|
||||||
});
|
});
|
||||||
/** 住户审核状态 */
|
|
||||||
enum reviewStatus {
|
const active = ref(0);
|
||||||
/** 未提交 */
|
|
||||||
unSubmit = 0,
|
|
||||||
/** 已提交 */
|
|
||||||
Submited = 1,
|
|
||||||
/** 待认证 */
|
|
||||||
awaitReview = 2,
|
|
||||||
/** 认证不通过 */
|
|
||||||
unReviewPass = 3,
|
|
||||||
/** 认证通过 */
|
|
||||||
ReviewPass = 4,
|
|
||||||
/** 未认证 */
|
|
||||||
uncertification = 5,
|
|
||||||
/** 已认证 */
|
|
||||||
Certification = 6
|
|
||||||
}
|
|
||||||
type activeType = reviewStatus;
|
|
||||||
const active = ref<activeType>(6);
|
|
||||||
const activeStop = ref(4);
|
|
||||||
const userid = ref(null);
|
const userid = ref(null);
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
if (route.query.id) {
|
if (route.query.id) {
|
||||||
@@ -205,9 +188,9 @@ if (route.query.id) {
|
|||||||
getResident(userid.value).then((res) => {
|
getResident(userid.value).then((res) => {
|
||||||
userInfo.value = res.data;
|
userInfo.value = res.data;
|
||||||
getresidentReviewlistAPI(userid.value).then((res) => {
|
getresidentReviewlistAPI(userid.value).then((res) => {
|
||||||
console.log(res);
|
|
||||||
if (res.rows[0]) {
|
if (res.rows[0]) {
|
||||||
reviewInfo.value = res.rows[0];
|
reviewInfo.value = res.rows[0];
|
||||||
|
console.log(reviewInfo.value);
|
||||||
handleActivestaus(reviewInfo.value);
|
handleActivestaus(reviewInfo.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -215,31 +198,75 @@ if (route.query.id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleActivestaus(rews) {
|
function handleActivestaus(rews) {
|
||||||
if (rews.submitStatus === reviewStatus.unSubmit) {
|
// 提交状态 0未提交 1已提交
|
||||||
activeStop.value = 0;
|
if (rews.submitStatus === '0') {
|
||||||
active.value = 0;
|
active.value = 0;
|
||||||
} else if (rews.submitStatus === reviewStatus.Submited) {
|
} else if (rews.submitStatus === '1') {
|
||||||
active.value = 1;
|
active.value = 1;
|
||||||
activeStop.value = 1;
|
// 物业审核状态 0 待审核 1审核通过 2审核未通过
|
||||||
// 待认证
|
// 待认证
|
||||||
if (rews.propertyStatus === 0) {
|
if (rews.propertyStatus === '0') {
|
||||||
active.value = reviewStatus.awaitReview;
|
active.value = 2;
|
||||||
} else if (rews.propertyStatus === 1) {
|
} else if (rews.propertyStatus === '2') {
|
||||||
active.value = reviewStatus.unReviewPass;
|
active.value = 3;
|
||||||
} else if (rews.propertyStatus === 2) {
|
} else if (rews.propertyStatus === '1') {
|
||||||
active.value = reviewStatus.ReviewPass;
|
active.value = 4;
|
||||||
activeStop.value = 2;
|
// 认证状态 0未认证 1已认证
|
||||||
|
if (rews.certificationStatus === '0') {
|
||||||
|
active.value = 5;
|
||||||
|
} else if (rews.certificationStatus === '1') {
|
||||||
|
active.value = 6;
|
||||||
|
} else if (rews.certificationStatus === '2') {
|
||||||
|
active.value = 5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// TODO 住户审核
|
||||||
|
const activeStop = computed(() => {
|
||||||
|
let status = 0;
|
||||||
|
switch (active.value) {
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
status = 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
status = 2;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
case 5:
|
||||||
|
status = 2;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
status = 4;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
});
|
||||||
|
|
||||||
if (rews.certificationStatus === 0) {
|
// 审核通过
|
||||||
active.value = reviewStatus.uncertification;
|
function updatePass(val: '0' | '1' | '2') {
|
||||||
} else if (rews.certificationStatus === 1) {
|
reviewInfo.value = {
|
||||||
active.value = reviewStatus.Certification;
|
...reviewInfo.value,
|
||||||
activeStop.value = 4;
|
'propertyTime': new Date().toLocaleString().replaceAll('/', '-'),
|
||||||
}
|
'propertyStatus': val
|
||||||
}
|
};
|
||||||
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(active.value);
|
function update() {
|
||||||
|
UpdateResidentReviewAPI(reviewInfo.value).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
backRoute();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const router = useRouter();
|
||||||
|
function backRoute() {
|
||||||
|
router.push({
|
||||||
|
path: '/house/resident'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -106,15 +106,16 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
import PageHeader from '@/components/Pageheader/index.vue';
|
||||||
import { getVillageTree } from '@/api/system/house';
|
import { getHousePathById, ownerRelationshiplist } from '@/utils/house';
|
||||||
import { convertBuildingToTree, getHousePathById, ownerRelationshiplist } from '@/utils/house';
|
|
||||||
import { ResidentForm } from '@/api/system/resident/type';
|
import { ResidentForm } from '@/api/system/resident/type';
|
||||||
import { CascaderValue, UploadFiles, UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
|
import { CascaderValue, UploadFiles, UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
|
||||||
import { genFileId } from 'element-plus';
|
import { genFileId } from 'element-plus';
|
||||||
import { getCommunitylistAPI } from '@/api/system/community';
|
|
||||||
import { addResident, getResident, updateResident } from '@/api/system/resident';
|
import { addResident, getResident, updateResident } from '@/api/system/resident';
|
||||||
import { validator } from '@/utils/Reg';
|
import { validator } from '@/utils/Reg';
|
||||||
|
import { useHouseStore } from '@/store/modules/house';
|
||||||
|
|
||||||
|
const houseStore = useHouseStore();
|
||||||
|
const { treedata } = storeToRefs(houseStore);
|
||||||
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/resident/uploadImage';
|
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/resident/uploadImage';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -159,14 +160,7 @@ const rules = ref({
|
|||||||
|
|
||||||
// !== 楼栋房屋 =============================================================================
|
// !== 楼栋房屋 =============================================================================
|
||||||
const userid = ref(null);
|
const userid = ref(null);
|
||||||
const treedata = ref([]);
|
|
||||||
function gettreedata() {
|
function gettreedata() {
|
||||||
getCommunitylistAPI().then((res) => {
|
|
||||||
const currentviliage = res.rows.find((item) => item.choiceStatus === 0);
|
|
||||||
if (currentviliage.villageId) {
|
|
||||||
getVillageTree(currentviliage.villageId).then((res) => {
|
|
||||||
treedata.value = convertBuildingToTree(res.data.buildings);
|
|
||||||
console.log(treedata.value);
|
|
||||||
// !== 编辑用户 =============================================================================
|
// !== 编辑用户 =============================================================================
|
||||||
if (route.query.id) {
|
if (route.query.id) {
|
||||||
userid.value = route.query.id;
|
userid.value = route.query.id;
|
||||||
@@ -179,9 +173,6 @@ function gettreedata() {
|
|||||||
userHousepath.value = arr;
|
userHousepath.value = arr;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
gettreedata();
|
gettreedata();
|
||||||
function handleChange(val: CascaderValue) {
|
function handleChange(val: CascaderValue) {
|
||||||
@@ -241,7 +232,6 @@ const submitForm = () => {
|
|||||||
if (!form.value.cardImageBack.trim()) {
|
if (!form.value.cardImageBack.trim()) {
|
||||||
return ElMessage.error('请上传身份证背面照片');
|
return ElMessage.error('请上传身份证背面照片');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userid.value) {
|
if (userid.value) {
|
||||||
console.log('edit');
|
console.log('edit');
|
||||||
updateResident(form.value).then(() => {
|
updateResident(form.value).then(() => {
|
||||||
@@ -252,6 +242,16 @@ const submitForm = () => {
|
|||||||
console.log('add');
|
console.log('add');
|
||||||
addResident(form.value).then(() => {
|
addResident(form.value).then(() => {
|
||||||
ElMessage.success('添加成功');
|
ElMessage.success('添加成功');
|
||||||
|
// addResidentReviewProcess({
|
||||||
|
// 'residentId': 0,
|
||||||
|
// 'submitTime': new Date().toLocaleString(),
|
||||||
|
// 'submitStatus': 0,
|
||||||
|
// 'propertyTime': null,
|
||||||
|
// 'propertyStatus': null,
|
||||||
|
// 'propertyReviewFeedback': null,
|
||||||
|
// 'certificationTime': null,
|
||||||
|
// 'certificationStatus': null
|
||||||
|
// });
|
||||||
cancelForm();
|
cancelForm();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,17 +64,28 @@
|
|||||||
<el-table-column label="姓名" min-width="120" align="center" prop="name" />
|
<el-table-column label="姓名" min-width="120" align="center" prop="name" />
|
||||||
<el-table-column label="类型" min-width="120" align="center" prop="type">
|
<el-table-column label="类型" min-width="120" align="center" prop="type">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag v-if="scope.row.type === 0">业主</el-tag>
|
<DictTag :value="scope.row.type" :options="com_resident_relationship"></DictTag>
|
||||||
<el-tag type="warning" v-else-if="scope.row.type === 1">亲属</el-tag>
|
</template>
|
||||||
<el-tag type="success" v-else-if="scope.row.type === 2">租户</el-tag>
|
</el-table-column>
|
||||||
|
<el-table-column label="状态" min-width="120" align="center" prop="status">
|
||||||
|
<template #default="scope">
|
||||||
|
<DictTag :value="scope.row.status" :options="com_review"></DictTag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="证件号" min-width="120" align="center" prop="idCard" />
|
<el-table-column label="证件号" min-width="120" align="center" prop="idCard" />
|
||||||
<el-table-column label="手机号码" min-width="120" align="center" prop="phone" />
|
<el-table-column label="手机号码" min-width="120" align="center" prop="phone" />
|
||||||
<el-table-column label="房间" min-width="120" align="center" prop="houseAddress" />
|
<el-table-column label="房间" min-width="120" align="center" prop="houseAddress" />
|
||||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" min-width="120" fixed="right" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleMain(scope.row)" v-hasPermi="['resident:resident:edit']">审核</el-button>
|
<el-button
|
||||||
|
v-if="scope.row.status === '0'"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleMain(scope.row)"
|
||||||
|
v-hasPermi="['resident:resident:edit']"
|
||||||
|
>审核</el-button
|
||||||
|
>
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['resident:resident:edit']">修改</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['resident:resident:edit']">修改</el-button>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['resident:resident:remove']"
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['resident:resident:remove']"
|
||||||
>删除
|
>删除
|
||||||
@@ -94,18 +105,19 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Resident" lang="ts">
|
<script setup name="Resident" lang="ts">
|
||||||
import Pageheader from '@/components/Pageheader/index.vue';
|
import Pageheader from '@/components/Pageheader/index.vue';
|
||||||
|
|
||||||
import { listResident, getResident, delResident, addResident, updateResident } from '@/api/system/resident/index';
|
import { listResident, delResident } from '@/api/system/resident/index';
|
||||||
import { ResidentVO, ResidentQuery, ResidentForm } from '@/api/system/resident/type';
|
import { ResidentVO, ResidentQuery, ResidentForm } from '@/api/system/resident/type';
|
||||||
import { getVillageTree } from '@/api/system/house/index';
|
import { getHousePathById } from '@/utils/house';
|
||||||
import { getCommunitylistAPI } from '@/api/system/community';
|
import { useHouseStore } from '@/store/modules/house';
|
||||||
import { convertBuildingToTree, getHousePathById } from '@/utils/house';
|
|
||||||
|
|
||||||
|
const houseStore = useHouseStore();
|
||||||
|
const { treedata } = storeToRefs(houseStore);
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { com_house_rental_facilities } = toRefs<any>(proxy?.useDict('com_house_rental_facilities'));
|
const { com_resident_relationship } = toRefs<any>(proxy?.useDict('com_resident_relationship'));
|
||||||
|
const { com_review } = toRefs<any>(proxy?.useDict('com_review'));
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const residentList = ref<ResidentVO[]>([]);
|
const residentList = ref<ResidentVO[]>([]);
|
||||||
@@ -238,21 +250,7 @@ const handleNodeClick = (data: Tree, node) => {
|
|||||||
};
|
};
|
||||||
getList();
|
getList();
|
||||||
};
|
};
|
||||||
const treedata = ref<Tree[]>([]);
|
|
||||||
|
|
||||||
function gettreedata() {
|
|
||||||
getCommunitylistAPI().then((res) => {
|
|
||||||
const currentviliage = res.rows.find((item) => item.choiceStatus === 0);
|
|
||||||
if (currentviliage.villageId) {
|
|
||||||
getVillageTree(currentviliage.villageId).then((res) => {
|
|
||||||
treedata.value = convertBuildingToTree(res.data.buildings);
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
gettreedata();
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'label'
|
label: 'label'
|
||||||
@@ -274,6 +272,8 @@ const getList = async () => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
getList();
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
@@ -388,8 +388,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tablebox {
|
.tablebox {
|
||||||
height: calc(100% - 260px);
|
height: calc(100% - 105px);
|
||||||
max-height: calc(100% - 260px);
|
|
||||||
/* 空数据也不会无限变宽 */
|
/* 空数据也不会无限变宽 */
|
||||||
:deep(.el-table__empty-block) {
|
:deep(.el-table__empty-block) {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user