分配添加部门
This commit is contained in:
@@ -95,3 +95,7 @@ export const updateUserStatus = (id: number, status: number) => {
|
|||||||
export const getSimpleUserList = (): Promise<UserVO[]> => {
|
export const getSimpleUserList = (): Promise<UserVO[]> => {
|
||||||
return request.get({ url: '/system/user/simple-list' })
|
return request.get({ url: '/system/user/simple-list' })
|
||||||
}
|
}
|
||||||
|
// 获取用户精简信息列表
|
||||||
|
export const getSimpleUserListPage = (params: PageParam): Promise<UserVO[]> => {
|
||||||
|
return request.get({ url: '/system/user/page', params })
|
||||||
|
}
|
||||||
|
|||||||
@@ -486,6 +486,7 @@ export default {
|
|||||||
invitationType: 'Invitation Type',
|
invitationType: 'Invitation Type',
|
||||||
placeInvitationType: 'Please select invitation type',
|
placeInvitationType: 'Please select invitation type',
|
||||||
allocationUser: 'Assigned Employee',
|
allocationUser: 'Assigned Employee',
|
||||||
|
placeAllocationDept: 'Please select assigned department',
|
||||||
placeAllocationUser: 'Please select assigned employee',
|
placeAllocationUser: 'Please select assigned employee',
|
||||||
yesterdayCoins: 'YesterdayCoins',
|
yesterdayCoins: 'YesterdayCoins',
|
||||||
search: 'Search',
|
search: 'Search',
|
||||||
|
|||||||
@@ -486,6 +486,7 @@ export default {
|
|||||||
invitationType: '邀请类型',
|
invitationType: '邀请类型',
|
||||||
placeInvitationType: '请选择邀请类型',
|
placeInvitationType: '请选择邀请类型',
|
||||||
allocationUser: '分配员工',
|
allocationUser: '分配员工',
|
||||||
|
placeAllocationDept: '请选择部门',
|
||||||
placeAllocationUser: '请选择分配的员工',
|
placeAllocationUser: '请选择分配的员工',
|
||||||
yesterdayCoins: '昨日金币',
|
yesterdayCoins: '昨日金币',
|
||||||
search: '搜索',
|
search: '搜索',
|
||||||
|
|||||||
@@ -201,10 +201,16 @@
|
|||||||
<!-- <div style="padding: 0px 0px 30px 0px ;">
|
<!-- <div style="padding: 0px 0px 30px 0px ;">
|
||||||
<el-alert title="分配成功数量可能会小于选择数量,同id主播无法被重复分配" type="warning" />
|
<el-alert title="分配成功数量可能会小于选择数量,同id主播无法被重复分配" type="warning" />
|
||||||
</div> -->
|
</div> -->
|
||||||
|
<div style="display: flex;">
|
||||||
|
<el-select v-if="wsCache.get('roleRouters').find(item => item.id === 1).children.find(item => item.id === 103)"
|
||||||
|
v-model="allocationDept" :placeholder="t('newHosts.placeAllocationDept')" clearable
|
||||||
|
@change="getAllocationUserList">
|
||||||
|
<el-option v-for="(dept, index) in allocationdeptList" :key="index" :label="dept.name" :value="dept.id" />
|
||||||
|
</el-select>
|
||||||
<el-select v-model="allocationUser" :placeholder="t('newHosts.placeAllocationUser')" clearable>
|
<el-select v-model="allocationUser" :placeholder="t('newHosts.placeAllocationUser')" clearable>
|
||||||
<el-option v-for="(user, index) in allocationUserList" :key="index" :label="user.label" :value="user.value" />
|
<el-option v-for="(user, index) in allocationUserList" :key="index" :label="user.label" :value="user.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogAllocation = false">{{ t('newHosts.cancel') }}</el-button>
|
<el-button @click="dialogAllocation = false">{{ t('newHosts.cancel') }}</el-button>
|
||||||
@@ -224,12 +230,14 @@ import { getIntDictOptions, DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
|||||||
import { dateFormatter } from '@/utils/formatTime'
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
import { NewHostsApi, NewHostsVO } from '@/api/server/newhosts'
|
import { NewHostsApi, NewHostsVO } from '@/api/server/newhosts'
|
||||||
import { getAllocation, getSimpleUserList } from '@/api/system/user'
|
import { getAllocation, getSimpleUserList, getSimpleUserListPage } from '@/api/system/user'
|
||||||
import NewHostsForm from './NewHostsForm.vue'
|
import NewHostsForm from './NewHostsForm.vue'
|
||||||
import { useCache } from '@/hooks/web/useCache'
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
|
import * as DeptApi from '@/api/system/dept'
|
||||||
|
|
||||||
import { func } from 'vue-types'
|
import { func } from 'vue-types'
|
||||||
const { wsCache } = useCache()
|
const { wsCache } = useCache()
|
||||||
|
// console.log("===================================", wsCache.get('roleRouters').find(item => item.id === 1).children)
|
||||||
/** 主播数据管理 列表 */
|
/** 主播数据管理 列表 */
|
||||||
defineOptions({ name: 'NewHosts' })
|
defineOptions({ name: 'NewHosts' })
|
||||||
|
|
||||||
@@ -265,12 +273,19 @@ const exportLoading = ref(false) // 导出的加载中
|
|||||||
let dialogAllocation = ref(false)//分配弹窗
|
let dialogAllocation = ref(false)//分配弹窗
|
||||||
let selectHostList = ref([]) //选中的主播列表
|
let selectHostList = ref([]) //选中的主播列表
|
||||||
let allocationUser = ref('') //选中的分配用户
|
let allocationUser = ref('') //选中的分配用户
|
||||||
|
let allocationDept = ref('') //选中的分配部门
|
||||||
let allocationUserList = ref([
|
let allocationUserList = ref([
|
||||||
{
|
{
|
||||||
label: '分配用户1',
|
label: '分配用户1',
|
||||||
value: 1
|
value: 1
|
||||||
}
|
}
|
||||||
]) //选中的分配用户
|
]) //选中的分配用户
|
||||||
|
let allocationdeptList = ref([
|
||||||
|
{
|
||||||
|
name: '分配用户1',
|
||||||
|
id: 1
|
||||||
|
}
|
||||||
|
]) //选中的分配部门
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
@@ -308,6 +323,28 @@ const getAllocationList = async () => {
|
|||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const getAllocationUserList = async () => {
|
||||||
|
const data = await getSimpleUserListPage({ pageSize: 1000, pageNo: 1, deptId: allocationDept.value })
|
||||||
|
allocationUserList.value = []
|
||||||
|
console.log("----------------------------------------------------", data.list)
|
||||||
|
data.list.forEach((item) => {
|
||||||
|
allocationUserList.value.push({
|
||||||
|
label: item.nickname,
|
||||||
|
value: item.id
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/** 查询部门 */
|
||||||
|
const getAlldeptList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await DeptApi.getDeptPage(queryParams)
|
||||||
|
allocationdeptList.value = data
|
||||||
|
// console.log('=========================================', allocationdeptList)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
queryParams.pageNo = 1
|
queryParams.pageNo = 1
|
||||||
@@ -435,5 +472,9 @@ function handleCopy(text) {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
getAllocationList();
|
getAllocationList();
|
||||||
|
if (wsCache.get('roleRouters').find(item => item.id === 1).children.find(item => item.id === 103)) {
|
||||||
|
getAlldeptList();
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user