完成访客搭建,完善之前审核界面
This commit is contained in:
@@ -91,9 +91,9 @@
|
||||
<div class="preivewBodybox">
|
||||
<el-input v-model="reviewInfo.propertyReviewFeedback" placeholder="请输入" type="textarea" :rows="5"></el-input>
|
||||
<div class="actions">
|
||||
<el-button type="primary">审核通过</el-button>
|
||||
<el-button type="danger">审核不通过</el-button>
|
||||
<el-button>返回</el-button>
|
||||
<el-button type="primary" @click="updatePass('1')">审核通过</el-button>
|
||||
<el-button type="danger" @click="updatePass('2')">审核不通过</el-button>
|
||||
<el-button @click="backRoute">返回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -114,21 +114,17 @@
|
||||
<el-steps space="200px" direction="vertical" :active="activeStop">
|
||||
<el-step :description="reviewInfo.submitTime">
|
||||
<template #title>
|
||||
<span v-if="active === 0">未提交信息</span>
|
||||
<span v-if="active >= 1">已提交信息</span>
|
||||
<DictTag :options="com_sub_status" :value="reviewInfo.submitStatus || '0'"></DictTag>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step :description="reviewInfo.propertyTime">
|
||||
<template #title>
|
||||
<span v-if="active <= 2">待审核</span>
|
||||
<span v-if="active === 3">物业审核不通过</span>
|
||||
<span v-if="active >= 4">物业审核通过</span>
|
||||
<DictTag :options="com_review" :value="reviewInfo.propertyStatus || '0'"></DictTag>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step :description="reviewInfo.certificationTime">
|
||||
<template #title>
|
||||
<span v-if="active <= 5">未认证</span>
|
||||
<span v-if="active === 6">已认证</span>
|
||||
<DictTag :options="com_certification_status" :value="reviewInfo.certificationStatus || '0'"></DictTag>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step>
|
||||
@@ -147,9 +143,14 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from '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';
|
||||
|
||||
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>({
|
||||
code: null,
|
||||
villageId: '',
|
||||
@@ -171,33 +172,15 @@ const reviewInfo = ref({
|
||||
'id': null,
|
||||
'residentId': null,
|
||||
'submitTime': '',
|
||||
'submitStatus': 1,
|
||||
'propertyTime': null,
|
||||
'propertyStatus': null,
|
||||
'propertyReviewFeedback': '',
|
||||
'certificationTime': null,
|
||||
'certificationStatus': null
|
||||
'submitStatus': '1',
|
||||
'propertyTime': '',
|
||||
'propertyStatus': '0',
|
||||
'propertyReviewFeedback': '', // 审核意见
|
||||
'certificationTime': '',
|
||||
'certificationStatus': '0'
|
||||
});
|
||||
/** 住户审核状态 */
|
||||
enum reviewStatus {
|
||||
/** 未提交 */
|
||||
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 active = ref(0);
|
||||
const userid = ref(null);
|
||||
const route = useRoute();
|
||||
if (route.query.id) {
|
||||
@@ -205,9 +188,9 @@ if (route.query.id) {
|
||||
getResident(userid.value).then((res) => {
|
||||
userInfo.value = res.data;
|
||||
getresidentReviewlistAPI(userid.value).then((res) => {
|
||||
console.log(res);
|
||||
if (res.rows[0]) {
|
||||
reviewInfo.value = res.rows[0];
|
||||
console.log(reviewInfo.value);
|
||||
handleActivestaus(reviewInfo.value);
|
||||
}
|
||||
});
|
||||
@@ -215,31 +198,75 @@ if (route.query.id) {
|
||||
}
|
||||
|
||||
function handleActivestaus(rews) {
|
||||
if (rews.submitStatus === reviewStatus.unSubmit) {
|
||||
activeStop.value = 0;
|
||||
// 提交状态 0未提交 1已提交
|
||||
if (rews.submitStatus === '0') {
|
||||
active.value = 0;
|
||||
} else if (rews.submitStatus === reviewStatus.Submited) {
|
||||
} else if (rews.submitStatus === '1') {
|
||||
active.value = 1;
|
||||
activeStop.value = 1;
|
||||
// 物业审核状态 0 待审核 1审核通过 2审核未通过
|
||||
// 待认证
|
||||
if (rews.propertyStatus === 0) {
|
||||
active.value = reviewStatus.awaitReview;
|
||||
} else if (rews.propertyStatus === 1) {
|
||||
active.value = reviewStatus.unReviewPass;
|
||||
} else if (rews.propertyStatus === 2) {
|
||||
active.value = reviewStatus.ReviewPass;
|
||||
activeStop.value = 2;
|
||||
|
||||
if (rews.certificationStatus === 0) {
|
||||
active.value = reviewStatus.uncertification;
|
||||
} else if (rews.certificationStatus === 1) {
|
||||
active.value = reviewStatus.Certification;
|
||||
activeStop.value = 4;
|
||||
if (rews.propertyStatus === '0') {
|
||||
active.value = 2;
|
||||
} else if (rews.propertyStatus === '2') {
|
||||
active.value = 3;
|
||||
} else if (rews.propertyStatus === '1') {
|
||||
active.value = 4;
|
||||
// 认证状态 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;
|
||||
});
|
||||
|
||||
console.log(active.value);
|
||||
// 审核通过
|
||||
function updatePass(val: '0' | '1' | '2') {
|
||||
reviewInfo.value = {
|
||||
...reviewInfo.value,
|
||||
'propertyTime': new Date().toLocaleString().replaceAll('/', '-'),
|
||||
'propertyStatus': val
|
||||
};
|
||||
update();
|
||||
}
|
||||
|
||||
function update() {
|
||||
UpdateResidentReviewAPI(reviewInfo.value).then((res) => {
|
||||
console.log(res);
|
||||
backRoute();
|
||||
});
|
||||
}
|
||||
const router = useRouter();
|
||||
function backRoute() {
|
||||
router.push({
|
||||
path: '/house/resident'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user