完成访客搭建,完善之前审核界面

This commit is contained in:
Zy
2026-04-13 18:10:23 +08:00
parent d957d1a039
commit 7f152c45f5
34 changed files with 1732 additions and 1208 deletions

View File

@@ -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="type">
<template #default="scope">
<el-tag v-if="scope.row.type === 0">业主</el-tag>
<el-tag type="warning" v-else-if="scope.row.type === 1">亲属</el-tag>
<el-tag type="success" v-else-if="scope.row.type === 2">租户</el-tag>
<DictTag :value="scope.row.type" :options="com_resident_relationship"></DictTag>
</template>
</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>
</el-table-column>
<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="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">
<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="Delete" @click="handleDelete(scope.row)" v-hasPermi="['resident:resident:remove']"
>删除
@@ -94,18 +105,19 @@
</el-card>
</div>
</template>
<script setup name="Resident" lang="ts">
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 { getVillageTree } from '@/api/system/house/index';
import { getCommunitylistAPI } from '@/api/system/community';
import { convertBuildingToTree, getHousePathById } from '@/utils/house';
import { getHousePathById } from '@/utils/house';
import { useHouseStore } from '@/store/modules/house';
const houseStore = useHouseStore();
const { treedata } = storeToRefs(houseStore);
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 residentList = ref<ResidentVO[]>([]);
@@ -238,21 +250,7 @@ const handleNodeClick = (data: Tree, node) => {
};
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 = {
children: 'children',
label: 'label'
@@ -274,6 +272,8 @@ const getList = async () => {
loading.value = false;
};
getList();
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
@@ -388,8 +388,7 @@ onMounted(() => {
}
.tablebox {
height: calc(100% - 260px);
max-height: calc(100% - 260px);
height: calc(100% - 105px);
/* 空数据也不会无限变宽 */
:deep(.el-table__empty-block) {
width: 100% !important;