|
|
@ -172,9 +172,12 @@ const formsSuccess = async (formType,data) => { |
|
|
|
const userStore = useUserStore() // 用户信息 |
|
|
|
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.SPECIAL_DEPT_ROLE) |
|
|
|
// 查找第一个同时存在于userStore.roles和deviceMoldTypeList中的值 |
|
|
|
const matchingRole = userStore.roles.find(role => |
|
|
|
let matchingRole = userStore.roles.find(role => |
|
|
|
deviceMoldTypeList.some(deviceMold => deviceMold.value === role) |
|
|
|
); |
|
|
|
if(matchingRole == null || matchingRole == ''){ |
|
|
|
matchingRole = userStore.getUser.id |
|
|
|
} |
|
|
|
if (formType === 'create') { |
|
|
|
data.manageDept = matchingRole |
|
|
|
await FixedAssetsApi.createFixedAssets(data) |
|
|
|