<template>
|
<div class="app-container">
|
<div style="display: flex;align-items: center">
|
<span style="font-size: 18px">当前帐号状态:</span>
|
<el-tag :type=" data.state == 0 ? 'info' : data.state == 1 ? '' : data.state == 2 ?'success': data.state == 3 || data.state == 4 ?'danger':''">
|
{{data.stateMsg}}
|
</el-tag>
|
</div>
|
<span style="font-size: 25px;font-weight: 600;margin-top: 20px">请<span v-if="data.state ===3">整改提交后</span>联系监管部门审核</span>
|
</div>
|
</template>
|
|
<script setup>
|
import {getCurrentInstance, onMounted, reactive, ref, toRefs, watch} from "vue";
|
import Cookies from "js-cookie";
|
import {getUserById} from "@/api/sysUsers";
|
import {ElMessage} from "element-plus";
|
// import menu from "@/layout/components/Sidebar/menu";
|
const { proxy } = getCurrentInstance();
|
const data = reactive({
|
state: null,
|
stateMsg: ''
|
});
|
|
const userInfo = ref();
|
//页面加载
|
onMounted( () => {
|
userInfo.value = JSON.parse(Cookies.get('userInfo'))
|
getState();
|
});
|
const sidebarRouters = ref([])
|
const getState = async () => {
|
console.log('menu')
|
const param = {
|
userId: userInfo.value.id
|
}
|
const res = await getUserById(param)
|
if(res.code == 200){
|
data.state = res.data.state;
|
data.stateMsg = res.data.state === 0?'暂存':res.data.state === 1 ? '审核中':res.data.state === 2 ? '审批通过':res.data.state === 3? '审批驳回':'已作废';
|
if(res.data.state === 2) {
|
sidebarRouters.value = menu.agencyMenu
|
Cookies.set('routers',JSON.stringify(sidebarRouters.value))
|
location.href = '/project';
|
}
|
}else{
|
ElMessage({
|
type: 'warning',
|
message: res.message
|
})
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.app-container{
|
margin-top: 10%;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
flex-direction: column;
|
}
|
</style>
|