|
@@ -43,7 +43,6 @@
|
|
|
@pageHandleChange="handleChangePage"
|
|
|
>
|
|
|
<template #actions="{ item }">
|
|
|
- <!-- <v-btn color="primary" variant="text" @click="handleBinding(item)">{{ $t('enterprise.userManagement.jobBinding') }}</v-btn> -->
|
|
|
<v-btn v-if="item.status === '1' && item.userType !== '1'" color="primary" variant="text" @click="handleAction('', 0, item)">{{ $t('enterprise.userManagement.enable') }}</v-btn>
|
|
|
<v-btn v-if="item.status === '0' && item.userType !== '1'" color="primary" variant="text" @click="handleAction('', 1, item)">{{ $t('enterprise.userManagement.disable') }}</v-btn>
|
|
|
<v-btn color="primary" variant="text" @click="handleChangeEmail(item)">修改员工邮箱</v-btn>
|
|
@@ -53,9 +52,6 @@
|
|
|
</v-row>
|
|
|
</v-card>
|
|
|
|
|
|
- <CtDialog :visible="show" :widthType="2" titleClass="text-h6" :title="$t('enterprise.userManagement.selectBinding')" @close="handleClose" @submit="handleSubmit">
|
|
|
- <CtForm ref="formPageRef" :items="formItems"></CtForm>
|
|
|
- </CtDialog>
|
|
|
<CtDialog :visible="showEditEmail" :widthType="2" titleClass="text-h6" title="修改员工邮箱" @close="showEditEmail = false" @submit="handleEditEmailSubmit">
|
|
|
<CtForm ref="editEmailFormRef" class="mt-3" :items="emailFormItems"></CtForm>
|
|
|
</CtDialog>
|
|
@@ -66,14 +62,12 @@ defineOptions({ name: 'group-account'})
|
|
|
import { ref } from 'vue'
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
|
import { timesTampChange } from '@/utils/date'
|
|
|
-import { getEnterprisePostPage } from '@/api/recruit/enterprise/system/post'
|
|
|
import { getEnterpriseTree } from '@/api/recruit/enterprise/system/group'
|
|
|
-import { getEnterpriseUserList, systemUserEnable, systemUserDisable, systemUserBindingPost } from '@/api/recruit/enterprise/system/user'
|
|
|
+import { getEnterpriseUserList, systemUserEnable, systemUserDisable } from '@/api/recruit/enterprise/system/user'
|
|
|
import Confirm from '@/plugins/confirm'
|
|
|
import Snackbar from '@/plugins/snackbar'
|
|
|
import { checkEmail } from '@/utils/validate'
|
|
|
import { entUpdateEmail } from '@/api/enterprise'
|
|
|
-// import { useRouter } from 'vue-router'; const router = useRouter()
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
const total = ref(0)
|
|
@@ -89,7 +83,7 @@ const treeData = ref([])
|
|
|
const headers = [
|
|
|
{ title: t('login.username'), key: 'name', sortable: false },
|
|
|
{ title: t('enterprise.userManagement.affiliatedEnterprise'), key: 'enterpriseAnotherName', sortable: false },
|
|
|
- { title: t('enterprise.userManagement.post'), key: 'post.nameCn', sortable: false },
|
|
|
+ { title: t('enterprise.userManagement.post'), key: 'postName', sortable: false },
|
|
|
{ title: t('enterprise.userManagement.phone'), key: 'phone', sortable: false },
|
|
|
{ title: t('enterprise.userManagement.email'), key: 'email', sortable: false },
|
|
|
{ title: t('enterprise.userManagement.accountType'), key: 'userType', value: item => item.userType === '1' ? t('enterprise.userManagement.administrators') : t('enterprise.userManagement.regularUser'), sortable: false },
|
|
@@ -104,26 +98,6 @@ const textItem = ref({
|
|
|
label: '请输入用户名称搜索'
|
|
|
})
|
|
|
|
|
|
-const show = ref(false)
|
|
|
-const formPageRef = ref()
|
|
|
-const bindQuery = ref({})
|
|
|
-const postList = ref([])
|
|
|
-const formItems = ref({
|
|
|
- options: [
|
|
|
- {
|
|
|
- type: 'autocomplete',
|
|
|
- key: 'postId',
|
|
|
- value: null,
|
|
|
- label: '岗位 *',
|
|
|
- noAttach: false,
|
|
|
- itemText: 'nameCn',
|
|
|
- itemValue: 'id',
|
|
|
- rules: [v => !!v || '请选择要绑定的岗位'],
|
|
|
- items: []
|
|
|
- }
|
|
|
- ]
|
|
|
-})
|
|
|
-
|
|
|
// 获取用户列表
|
|
|
const getUserList = async () => {
|
|
|
loading.value = true
|
|
@@ -160,12 +134,6 @@ const handleClick = (e) => {
|
|
|
getUserList()
|
|
|
}
|
|
|
|
|
|
-const getPostList = async () => {
|
|
|
- const res = await getEnterprisePostPage({ pageNo: 1, pageSize: 100 })
|
|
|
- postList.value = res.list
|
|
|
-}
|
|
|
-getPostList()
|
|
|
-
|
|
|
const apiList = [
|
|
|
{ api: systemUserEnable, desc: t('enterprise.userManagement.enableAccount') },
|
|
|
{ api: systemUserDisable, desc: t('enterprise.userManagement.disableAccount') }
|
|
@@ -182,39 +150,11 @@ const handleAction = (type, index, item) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// 绑定岗位
|
|
|
-// const handleBinding = async (item) => {
|
|
|
-// if (!postList.value.length) {
|
|
|
-// Snackbar.warning(t('enterprise.userManagement.postNodataToAdd'))
|
|
|
-// return
|
|
|
-// }
|
|
|
-// bindQuery.value.id = item.id
|
|
|
-// const obj = formItems.value.options.find(e => e.key === 'postId')
|
|
|
-// obj.items = postList.value
|
|
|
-// obj.value = item.postId
|
|
|
-// show.value = true
|
|
|
-// }
|
|
|
-
|
|
|
const handleAdd = (type) => {
|
|
|
// type: 类型(0 邀请同事 | 1 邀请子公司)
|
|
|
window.open(`/recruit/enterprise/systemManagement/groupAccount/invite/${type}`)
|
|
|
}
|
|
|
|
|
|
-const handleClose = () => {
|
|
|
- show.value = false
|
|
|
- query.value = {}
|
|
|
-}
|
|
|
-
|
|
|
-const handleSubmit = async () => {
|
|
|
- const { valid } = await formPageRef.value.formRef.validate()
|
|
|
- if (!valid) return
|
|
|
- const postId = formItems.value.options.find(e => e.key === 'postId').value
|
|
|
- await systemUserBindingPost(bindQuery.value.id, postId)
|
|
|
- Snackbar.success(t('common.operationSuccessful'))
|
|
|
- handleClose()
|
|
|
- getUserList()
|
|
|
-}
|
|
|
-
|
|
|
const emailFormItems = ref({
|
|
|
options: [
|
|
|
{
|