新增功能 移除人员项目关联

This commit is contained in:
QuAoLi 2022-05-12 14:10:28 +08:00
parent 29c9711e12
commit ca16194e99
2 changed files with 33 additions and 1 deletions

View File

@ -2,7 +2,8 @@ import request from '@/utils/request'
const personOrgApi = { const personOrgApi = {
listByOrgId: 'person/org/listByOrgId', listByOrgId: 'person/org/listByOrgId',
addPersonOrg: 'person/org/addPersonOrg' addPersonOrg: 'person/org/addPersonOrg',
removePersonOrg: 'person/org/removePersonOrg'
} }
export function listPersonByOrgId(params) { export function listPersonByOrgId(params) {
@ -19,3 +20,10 @@ export function addPersonOrg(params) {
data: params data: params
}) })
} }
export function removePersonOrg(params) {
return request({
url: personOrgApi.removePersonOrg,
method: 'post',
params: params
})
}

View File

@ -101,6 +101,14 @@
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
</a-menu-item> </a-menu-item>
<template v-if="orgType === 2">
<a-menu-item v-if="hasPerm('person:org:remove')">
<a-popconfirm placement="topRight" title="确认移除?" @confirm="() => personRemove(record)">
<a>移除</a>
</a-popconfirm>
</a-menu-item>
</template>
</a-menu> </a-menu>
</a-dropdown> </a-dropdown>
</span> </span>
@ -122,6 +130,7 @@ import { orgList } from '@/api/org/org'
import { listToTree } from '@/utils/util' import { listToTree } from '@/utils/util'
import { personPage, personDel, personQuit, personTransferOrg, personSetAdmin, personResetPwd, import { personPage, personDel, personQuit, personTransferOrg, personSetAdmin, personResetPwd,
personExport, personImport } from '@/api/person/person' personExport, personImport } from '@/api/person/person'
import { removePersonOrg } from '@/api/person/personOrg'
import PersonForm from './PersonForm' import PersonForm from './PersonForm'
import PersonDetail from './PersonDetail' import PersonDetail from './PersonDetail'
import OrgTree from '../org/OrgTree' import OrgTree from '../org/OrgTree'
@ -283,6 +292,21 @@ export default {
this.$message.error('删除错误:' + err.msg) this.$message.error('删除错误:' + err.msg)
}) })
}, },
/**
* 移除项目
*/
personRemove (record) {
removePersonOrg({ personId: record.id, orgId: this.orgId }).then((res) => {
if (res.code === 200) {
this.$message.success('移除成功')
this.$refs.table.refresh()
} else {
this.$message.error('移除失败:' + res.msg)
}
}).catch((err) => {
this.$message.error('移除错误:' + err.msg)
})
},
/** /**
* 添加证书 * 添加证书
*/ */