| | |
| | | onMounted(() => { |
| | | useUserStoreHook().getRoleList(); |
| | | if (useUserStoreHook().nowRole.code) { |
| | | useUserStoreHook().changeLogoInExRule({ |
| | | ruleCode: useUserStoreHook().nowRole.code |
| | | }); |
| | | // useUserStoreHook().changeLogoInExRule({ |
| | | // ruleCode: useUserStoreHook().nowRole.code |
| | | // }); |
| | | } |
| | | }); |
| | | </script> |
| | |
| | | } |
| | | ); |
| | | }; |
| | | /**删除员工 */ |
| | | export const delCustormerUsers = data => { |
| | | return http.request<Result>( |
| | | "delete", |
| | | baseUrlApi(`/api/customer/delCustormerUsers/${data.custormerUserId}`) |
| | | ); |
| | | }; |
| | |
| | | props, |
| | | emits: ["refresh", "fullscreen"], |
| | | setup(props, { emit, slots, attrs }) { |
| | | // 密度默认值 |
| | | const size = ref("default"); |
| | | const loading = ref(false); |
| | | const checkAll = ref(true); |
| | |
| | | path: "/user", |
| | | meta: { |
| | | title: "用户管理", |
| | | icon: "mdi:chart-timeline" |
| | | icon: "streamline-logos:my-space-logo" |
| | | }, |
| | | children: [ |
| | | { |
| | |
| | | code?: string; |
| | | name?: string; |
| | | hasFlsh?: boolean; |
| | | id?: string; |
| | | }; |
| | | |
| | | export type userType = { |
| | |
| | | /** |
| | | * 交易主体 代码 同角色代码 |
| | | */ |
| | | transactionCode: string; |
| | | transactionCode?: string; |
| | | /** |
| | | * 交易主体名称 |
| | | */ |
| | |
| | | }; |
| | | // 去首页 |
| | | const toWelcome = async item => { |
| | | if (useUserStoreHook().nowRole.code !== item.code) { |
| | | // 获取后端路由 |
| | | initRouter().then(() => { |
| | | useUserStoreHook().changeLogoInExRule({ |
| | | ruleCode: item.code |
| | | }); |
| | | // if (useUserStoreHook().nowRole.code !== item.code) { |
| | | // 获取后端路由 |
| | | initRouter().then(() => { |
| | | console.log("hhhh"); |
| | | |
| | | useUserStoreHook().changeLogoInExRule({ |
| | | ruleCode: item.code |
| | | }); |
| | | } |
| | | router.push({ name: "Welcome" }); |
| | | router.push({ name: "Welcome" }); |
| | | }); |
| | | // } |
| | | }; |
| | | // 去登录 |
| | | const toLogin = item => { |
| | |
| | | ElRadioGroup, |
| | | ElRadio, |
| | | ElRow, |
| | | ElTag |
| | | ElTag, |
| | | ElCol |
| | | } from "element-plus"; |
| | | import { useLayout } from "@/layout/hooks/useLayout"; |
| | | import { useUserStoreHook } from "@/store/modules/user"; |
| | |
| | | rules: loginRules, |
| | | size: "large" |
| | | }, |
| | | [ |
| | | h(Motion, { delay: 150 }, [ |
| | | h( |
| | | ElFormItem, |
| | | { |
| | | prop: "exRoleCode", |
| | | label: "" |
| | | }, |
| | | [ |
| | | // 单选框组 - 纵向排列 |
| | | h( |
| | | ElRadioGroup, |
| | | { |
| | | modelValue: secondId.value, |
| | | "onUpdate:modelValue": val => { |
| | | secondId.value = val; |
| | | } |
| | | }, |
| | | [ |
| | | // 循环渲染单选框 - 根据每项的isManager显示标签 |
| | | state.myEnterpriseList.map(item => |
| | | { |
| | | default: () => { |
| | | return [ |
| | | h( |
| | | ElFormItem, |
| | | { prop: "exRoleCode", label: "" }, |
| | | { |
| | | default: () => { |
| | | return [ |
| | | h( |
| | | "el-row", |
| | | ElRadioGroup, |
| | | { |
| | | style: { |
| | | width: "100%" |
| | | } |
| | | modelValue: secondId.value, |
| | | "onUpdate:modelValue": val => (secondId.value = val) |
| | | }, |
| | | [ |
| | | h( |
| | | "el-col", |
| | | { |
| | | span: 24 |
| | | }, |
| | | [ |
| | | h( |
| | | ElRadio, |
| | | { |
| | | key: item.customerUserID, |
| | | value: item.customerUserID |
| | | }, |
| | | [ |
| | | // 单选框文本 |
| | | item.enterpriseName, |
| | | // 根据当前项的isManager显示标签(放在文本后面) |
| | | item.isManger |
| | | ? h( |
| | | ElTag, |
| | | { |
| | | type: "primary", |
| | | size: "small", |
| | | style: { |
| | | marginLeft: "8px", |
| | | alignSelf: "center" |
| | | } |
| | | }, |
| | | "管理员" |
| | | ) |
| | | : null |
| | | ] |
| | | ) |
| | | ] |
| | | // ElRadioGroup 的内容是循环生成的,用函数包裹 |
| | | () => |
| | | state.myEnterpriseList.map(item => |
| | | h( |
| | | ElRow, |
| | | { style: { width: "100%" } }, |
| | | { |
| | | default: () => { |
| | | return [ |
| | | h( |
| | | ElCol, |
| | | { span: 24 }, |
| | | { |
| | | default: () => { |
| | | return [ |
| | | h( |
| | | ElRadio, |
| | | { |
| | | key: item.customerUserID, |
| | | value: item.customerUserID |
| | | }, |
| | | // ElRadio 的内容是动态的,用函数包裹 |
| | | () => [ |
| | | // 文本直接返回(不要嵌套函数) |
| | | item.enterpriseName, |
| | | item.isManger |
| | | ? h( |
| | | ElTag, |
| | | { |
| | | type: "primary", |
| | | size: "small", |
| | | style: { |
| | | marginLeft: "8px", |
| | | alignSelf: "center" |
| | | } |
| | | }, |
| | | // ElTag 的内容是静态文本,直接返回 |
| | | { |
| | | default: () => "管理员" |
| | | } |
| | | ) |
| | | : null |
| | | ] |
| | | ) |
| | | ]; |
| | | } |
| | | } |
| | | ) |
| | | ]; |
| | | } |
| | | } |
| | | ) |
| | | ) |
| | | ] |
| | | ) |
| | | ) |
| | | ] |
| | | ) |
| | | ] |
| | | ) |
| | | ]) |
| | | ] |
| | | ]; |
| | | } |
| | | } |
| | | ) |
| | | ]; |
| | | } |
| | | } |
| | | ), |
| | | // jsx 语法 (注意在.vue文件启用jsx语法,需要在script开启lang="tsx") |
| | | closeCallBack: ({ options, args }) => { |
| | |
| | | import { Edit } from "@element-plus/icons-vue"; |
| | | import { enterpriseTypes } from "@/api/register/index"; |
| | | import { initRouter, getTopMenu, handleAliveRoute } from "@/router/utils"; |
| | | |
| | | const isManager = useUserStoreHook().isManager; |
| | | import { type CusExtendDto } from "@/utils/auth"; |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | const isLoading = ref(false); |
| | | const showDialog = ref(false); |
| | | const nowRole = computed(() => { |
| | | return useUserStoreHook()?.nowRole; |
| | | if (!state?.ruleForm?.exRoles) { |
| | | return {}; |
| | | } |
| | | let nowRoleLiet; |
| | | let obj = {}; |
| | | let nowRole = useUserStoreHook()?.nowRole; |
| | | if (state?.ruleForm?.exRoles.length > 1) { |
| | | nowRoleLiet = state.ruleForm.exRoles.find(item => { |
| | | return item.exRoleId == nowRole.id; |
| | | }); |
| | | obj = Object.assign(nowRole, nowRoleLiet); |
| | | } else { |
| | | obj = Object.assign(nowRole, state.ruleForm.exRoles[0]); |
| | | } |
| | | return obj; |
| | | }); |
| | | const userInfo = computed(() => { |
| | | const userInfo = computed<CusExtendDto>(() => { |
| | | let obj = useUserStoreHook().enterpriseInfo; |
| | | return obj; |
| | | }); |
| | |
| | | bankName: null, // string,可空 |
| | | // 企业银行账号 |
| | | bankAccount: null, // string,可空 |
| | | bankAccountIMG: null |
| | | bankAccountIMG: null, |
| | | exRoles: null |
| | | }, |
| | | enterpriseList: [], |
| | | type: "", |
| | |
| | | // nowRole.value = useUserStoreHook()?.nowRole; |
| | | if (nowRole.value) { |
| | | state.ruleForm.transactionCode = nowRole.value.code; |
| | | // let nowRoleLiet; |
| | | // if (state.ruleForm.exRoles.length > 1) { |
| | | // nowRoleLiet = state.ruleForm.exRoles.find(item => { |
| | | // return item.exRoleId == nowRole.value.id; |
| | | // }); |
| | | // nowRole.value = Object.assign(nowRole.value, nowRoleLiet); |
| | | // } else { |
| | | // nowRole.value = Object.assign(nowRole.value, state.ruleForm.exRoles[0]); |
| | | // } |
| | | // state.userInfo.transactionName = nowRole.value.name; |
| | | } else { |
| | | state.ruleForm.transactionCode = route.query.code; |
| | | state.userInfo.enterpriseTypeName = route.query.name; |
| | | state.ruleForm.transactionCode = route.query.code as string; |
| | | // state.userInfo.enterpriseTypeName = route.query.name; |
| | | } |
| | | let restypes = await enterpriseTypes(); |
| | | state.enterpriseList = restypes?.result; |
| | |
| | | <el-descriptions |
| | | v-if="state.userInfo.enterpriseName" |
| | | class="margin-top" |
| | | title="企业资料" |
| | | title="" |
| | | :column="3" |
| | | border |
| | | > |
| | |
| | | <div class="cell-item">交易主体</div> |
| | | </template> |
| | | {{ nowRole?.name }} |
| | | <el-tag v-if="userInfo.steps == 2" type="success">审核已通过 </el-tag> |
| | | <el-tag v-else-if="userInfo.steps == 3" type="danger" |
| | | <el-tag v-if="nowRole.steps == 2" type="success">审核已通过 </el-tag> |
| | | <el-tag v-else-if="nowRole.steps == 3" type="danger" |
| | | >资料未通过 |
| | | </el-tag> |
| | | <el-tag v-else type="warning">资料审核中 </el-tag> |
| | |
| | | </span> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <div class="m-5"> |
| | | <div v-if="isManager" class="m-5"> |
| | | <el-button type="primary" :icon="Edit" @click="() => (showDialog = true)" |
| | | >修改资料</el-button |
| | | > |
| | |
| | | :icon="useRenderIcon(EditPen)" |
| | | @click="openDialog('修改', row)" |
| | | /> |
| | | <!-- <el-popconfirm |
| | | :title="`是否确认删除用户编号为${row.id}的这条数据`" |
| | | <el-popconfirm |
| | | :title="`是否确认删除用户${row.name}?`" |
| | | @confirm="handleDelete(row)" |
| | | > |
| | | <template #reference> |
| | |
| | | :icon="useRenderIcon(Delete)" |
| | | /> |
| | | </template> |
| | | </el-popconfirm> --> |
| | | </el-popconfirm> |
| | | <!-- <el-dropdown> |
| | | <el-button |
| | | class="ml-3! mt-[2px]!" |
| | |
| | | deviceDetection |
| | | } from "@pureadmin/utils"; |
| | | import { |
| | | getRoleIds, |
| | | getDeptList, |
| | | getUserList, |
| | | creatCustormerUsers, |
| | | changeManager, |
| | | updataCustormerUsers, |
| | | getAllRoleList |
| | | delCustormerUsers |
| | | } from "@/api/system"; |
| | | import { |
| | | ElForm, |
| | |
| | | } |
| | | |
| | | function handleDelete(row) { |
| | | message(`您删除了用户编号为${row.id}的这条数据`, { type: "success" }); |
| | | onSearch(); |
| | | delCustormerUsers({ custormerUserId: row.id }).then(res => { |
| | | if (res.code == 200) { |
| | | message("删除成功!", { |
| | | type: "success" |
| | | }); |
| | | onSearch(); |
| | | } else { |
| | | message(res.message || "删除失败!", { |
| | | type: "error" |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleSizeChange(val: number) { |