diff --git a/src/api/deps/index.js b/src/api/deps/index.js
index f7659f4..60bc0b9 100644
--- a/src/api/deps/index.js
+++ b/src/api/deps/index.js
@@ -34,6 +34,14 @@ export const departmentV2TreeAll2 = (data) => {
data,
})
}
+// 查询是否有权限
+export const userHasPermission = (data) => {
+ return request({
+ url: '/api/v1/contact/check/erp/rule',
+ method: 'POST',
+ data,
+ })
+}
//获取指定部门下的所有岗位
export const v2TreePositionByDepartment = (data) => {
diff --git a/src/pages/chooseGroupType/index.vue b/src/pages/chooseGroupType/index.vue
index 90c3051..f7d908c 100644
--- a/src/pages/chooseGroupType/index.vue
+++ b/src/pages/chooseGroupType/index.vue
@@ -33,6 +33,7 @@
{
-
+
})
+const isHasPermission = ref(false)
+onShow( async() =>{
+ const isHasRes = await userHasPermission({
+ erpUserId: userInfo?.value?.ID,
+ ruleUrl: [
+ "auth_chat_app_create_all_dept",
+ "auth_chat_app_create_limit_dept"
+ ]
+ })
+ if (isHasRes.code === 200) {
+ if (isHasRes.data.auth_chat_app_create_all_dept || isHasRes.data.auth_chat_app_create_limit_dept) {
+ isHasPermission.value = true
+ } else{
+ isHasPermission.value = false
+ }
+ }
+})
+
const confirmBtnStatus = computed(() => {
let disabledT = false
switch (groupActiveIndex.value) {
@@ -210,10 +230,10 @@ const handleConfirm = () => {
border-radius: 12rpx;
&.firstPanel {
background-image: url('@/static/image/chatList/zu6033@2x.png');
+ margin-bottom: 28rpx;
}
&.secondPanel {
background-image: url('@/static/image/chatList/zu6031@2x.png');
- margin-top: 28rpx;
margin-bottom: 28rpx;
}
&.thirdPanel {
diff --git a/src/store/groupType/index.js b/src/store/groupType/index.js
index 7ea9e78..2bd9b0b 100644
--- a/src/store/groupType/index.js
+++ b/src/store/groupType/index.js
@@ -11,10 +11,12 @@ import {
groupCreateDept,
departmentV2TreeAll,
departmentV2TreeAll2,
+ userHasPermission,
userV2List,
v2TreePositionByDepartment,
} from '@/api/deps/index.js'
-
+import { useAuth } from '@/store/auth'
+const { userInfo } = useAuth()
export const useGroupTypeStore = createGlobalState(() => {
const groupName = ref('')
const groupActiveIndex = ref(-1) // 当前激活的分组索引
@@ -35,9 +37,34 @@ export const useGroupTypeStore = createGlobalState(() => {
depTreeMyList.value = res.data.nodes
}
}
-
+// userInfo?.value?.ID
const getDepsTreeMy2 = async () => {
- const res = await departmentV2TreeAll2()
+ const isHasRes = await userHasPermission({
+ erpUserId: userInfo?.value?.ID,
+ ruleUrl: [
+ "auth_chat_app_create_all_dept",
+ "auth_chat_app_create_limit_dept"
+ ]
+ })
+ let pramas = { nowUserId : 0 }
+ if (isHasRes.code === 200) {
+ if (isHasRes.data.auth_chat_app_create_all_dept) {
+ pramas = {
+ nowUserId : 0
+ }
+ } else{
+ if (isHasRes.data.auth_chat_app_create_limit_dept) {
+ pramas = {
+ nowUserId : userInfo?.value?.ID
+ }
+ } else {
+ pramas = {
+ nowUserId : 0
+ }
+ }
+ }
+ }
+ const res = await departmentV2TreeAll2(pramas)
if (res.status === 0) {
depTreeMyList.value = res.data.nodes
}