完成访客搭建,完善之前审核界面
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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user