|
|
|
@ -1121,11 +1121,28 @@ const PageState = () => {
|
|
|
|
|
myData.value = JSON.parse(localStorage.getItem('my_data')); //获取本地仓库信息 |
|
|
|
|
} |
|
|
|
|
// 获取登录角色权限 |
|
|
|
|
getDictionaryBiz('after_sales_visits').then(res => { |
|
|
|
|
const matchingItem = res.data.data.find( |
|
|
|
|
item => item.dictValue == JSON.parse(localStorage.getItem('TWMS-userInfo')).content.role_name |
|
|
|
|
); |
|
|
|
|
form.value.UserPermissions = matchingItem.dictValue; |
|
|
|
|
getDictionaryBiz('after_sales_visits').then(async res => { |
|
|
|
|
// const matchingItem = res.data.data.find( |
|
|
|
|
// item => item.dictValue == JSON.parse(localStorage.getItem('TWMS-userInfo')).content.role_name |
|
|
|
|
// ); |
|
|
|
|
// form.value.UserPermissions = matchingItem.dictValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取用户角色信息,并拆分为数组 |
|
|
|
|
const roleNames = await JSON.parse(localStorage.getItem('TWMS-userInfo')).content.role_name.split( |
|
|
|
|
',' |
|
|
|
|
); |
|
|
|
|
// 根据角色名称查找匹配项目 |
|
|
|
|
const matchingItem = res.data.data.find(item => roleNames.includes(item.dictValue)); |
|
|
|
|
if (matchingItem) { |
|
|
|
|
form.value.UserPermissions = matchingItem.dictValue; |
|
|
|
|
} else { |
|
|
|
|
form.value.UserPermissions = '仓库客服'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
// 内部责任划分初始化 |
|
|
|
|
responsibilities(); |
|
|
|
|