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

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

@@ -106,15 +106,16 @@
<script setup lang="ts">
import { ref } from 'vue';
import PageHeader from '@/components/Pageheader/index.vue';
import { getVillageTree } from '@/api/system/house';
import { convertBuildingToTree, getHousePathById, ownerRelationshiplist } from '@/utils/house';
import { getHousePathById, ownerRelationshiplist } from '@/utils/house';
import { ResidentForm } from '@/api/system/resident/type';
import { CascaderValue, UploadFiles, UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
import { genFileId } from 'element-plus';
import { getCommunitylistAPI } from '@/api/system/community';
import { addResident, getResident, updateResident } from '@/api/system/resident';
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 router = useRouter();
@@ -159,29 +160,19 @@ const rules = ref({
// !== 楼栋房屋 =============================================================================
const userid = ref(null);
const treedata = ref([]);
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) {
userid.value = route.query.id;
getResident(userid.value).then((res) => {
form.value = {
...res.data
};
const arr = getHousePathById(treedata.value, form.value.houseId);
console.log(arr);
userHousepath.value = arr;
});
}
});
}
});
// !== 编辑用户 =============================================================================
if (route.query.id) {
userid.value = route.query.id;
getResident(userid.value).then((res) => {
form.value = {
...res.data
};
const arr = getHousePathById(treedata.value, form.value.houseId);
console.log(arr);
userHousepath.value = arr;
});
}
}
gettreedata();
function handleChange(val: CascaderValue) {
@@ -241,7 +232,6 @@ const submitForm = () => {
if (!form.value.cardImageBack.trim()) {
return ElMessage.error('请上传身份证背面照片');
}
if (userid.value) {
console.log('edit');
updateResident(form.value).then(() => {
@@ -252,6 +242,16 @@ const submitForm = () => {
console.log('add');
addResident(form.value).then(() => {
ElMessage.success('添加成功');
// addResidentReviewProcess({
// 'residentId': 0,
// 'submitTime': new Date().toLocaleString(),
// 'submitStatus': 0,
// 'propertyTime': null,
// 'propertyStatus': null,
// 'propertyReviewFeedback': null,
// 'certificationTime': null,
// 'certificationStatus': null
// });
cancelForm();
});
}