Merge pull request 'master' (#705) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/705
This commit is contained in:
2024-08-12 15:26:25 +00:00
2 changed files with 37 additions and 42 deletions

View File

@@ -392,6 +392,7 @@ const handleDownload = (row) => {
onActivated(()=>{ onActivated(()=>{
handleSearch() handleSearch()
getTagsOption()
}) })
handleSearch() handleSearch()
getTagsOption() getTagsOption()

View File

@@ -37,7 +37,19 @@ const localData = reactive({
roleOpt: [], roleOpt: [],
jobOpt: [] jobOpt: []
}) })
const openChangeRoleDialog = (selectRoleId, data) => {
ElMessageBox.confirm(`${getRoleName(selectRoleId)} 角色存在对应人员:${data[selectRoleId][0].nickName},您确定要替换为 ${form.value.getValues().nickName}?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
}).catch((action) => {
if (action == 'cancel') {
form.value.getValues().roleIds = form.value.getValues().roleIds.filter(roleItem => roleItem != selectRoleId);
}
})
}
const schame = computed(() => { const schame = computed(() => {
let arr = [ let arr = [
{ {
@@ -124,49 +136,31 @@ const schame = computed(() => {
change: async (val) => { change: async (val) => {
const {code, data} = await judgeIsSameRole(form.value.getValues().userId) const {code, data} = await judgeIsSameRole(form.value.getValues().userId)
if (code === 1000) { if (code === 1000) {
console.log('currentRoleArray.value', currentRoleArray.value) // console.log('currentRoleArray.value', currentRoleArray.value)
console.log('data,val', data, val) // console.log('data,val', data, val)
let selectRoleLast = val[val?.length - 1]
if (currentRoleArray.value.length !== 0) {//当前用户存在角色 if (currentRoleArray.value.length !== 0) {//当前用户存在角色
val.forEach(selectItem => {
currentRoleArray.value?.forEach(currentItem => { currentRoleArray.value?.forEach(currentItem => {
if (selectItem != currentItem) {
console.log('currentItem', currentItem, data[currentItem], form.value.getValues().userId) console.log('currentItem', currentItem, data[currentItem], form.value.getValues().userId)
//当前用户已经选择科创部对接人/财务对接人时移除角色不出现替换弹窗
if (currentItem && data[currentItem] && data[currentItem].length > 0 && data[currentItem][0].userId == form.value.getValues().userId) { if (currentItem && data[currentItem] && data[currentItem].length > 0 && data[currentItem][0].userId == form.value.getValues().userId) {
console.log('已选择对接人')
//选择两个对接人
if (data[selectRoleLast]?.length > 0 && data[selectRoleLast][0].userId !== form.value.getValues().userId) {
console.log('选择两个对接人')
openChangeRoleDialog(selectRoleLast, data)
}
} else { } else {
if (data[selectItem]?.length > 0 ) { //当前用户未选择对接人
ElMessageBox.confirm(`${getRoleName(selectItem)}角色存在对应人员:${data[selectItem][0].nickName},您确定要替换为 ${form.value.getValues().nickName}?`, "提示", { if (data[selectRoleLast]?.length > 0) {
confirmButtonText: "确定", openChangeRoleDialog(selectRoleLast, data)
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
}).catch((action) => {
if (action == 'cancel') {
form.value.getValues().roleIds = form.value.getValues().roleIds.filter(roleItem => roleItem != selectItem);
}
})
}
} }
} }
}) })
}) } else {//当前用户未分配角色
} else { if (data[selectRoleLast]?.length > 0) {
val.forEach(selectItem => { openChangeRoleDialog(selectRoleLast, data)
if (data[selectItem]?.length > 0) {
ElMessageBox.confirm(`此角色存在对应人员:${data[selectItem][0].nickName},您确定要替换该人员?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
}).catch((action) => {
if (action == 'cancel') {
form.value.getValues().roleIds = form.value.getValues().roleIds.filter(roleItem => roleItem != selectItem);
} }
})
}
})
} }
} }
} }