祖安之光
4 天以前 4d99171d6e935ba2060ae0af723a8e2db72d22d6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<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 = '/course';
    }
  }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>