From ca16194e99c582b117efa22108c8233b07fef6aa Mon Sep 17 00:00:00 2001 From: QuAoLi Date: Thu, 12 May 2022 14:10:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD=20?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=BA=BA=E5=91=98=E9=A1=B9=E7=9B=AE=E5=85=B3?= =?UTF-8?q?=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/person/personOrg.js | 10 +++++++++- src/views/person/PersonList.vue | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/api/person/personOrg.js b/src/api/person/personOrg.js index d887449..5c78c44 100644 --- a/src/api/person/personOrg.js +++ b/src/api/person/personOrg.js @@ -2,7 +2,8 @@ import request from '@/utils/request' const personOrgApi = { listByOrgId: 'person/org/listByOrgId', - addPersonOrg: 'person/org/addPersonOrg' + addPersonOrg: 'person/org/addPersonOrg', + removePersonOrg: 'person/org/removePersonOrg' } export function listPersonByOrgId(params) { @@ -19,3 +20,10 @@ export function addPersonOrg(params) { data: params }) } +export function removePersonOrg(params) { + return request({ + url: personOrgApi.removePersonOrg, + method: 'post', + params: params + }) +} diff --git a/src/views/person/PersonList.vue b/src/views/person/PersonList.vue index fa88f6f..889b70b 100644 --- a/src/views/person/PersonList.vue +++ b/src/views/person/PersonList.vue @@ -101,6 +101,14 @@ 删除 + + @@ -122,6 +130,7 @@ import { orgList } from '@/api/org/org' import { listToTree } from '@/utils/util' import { personPage, personDel, personQuit, personTransferOrg, personSetAdmin, personResetPwd, personExport, personImport } from '@/api/person/person' +import { removePersonOrg } from '@/api/person/personOrg' import PersonForm from './PersonForm' import PersonDetail from './PersonDetail' import OrgTree from '../org/OrgTree' @@ -283,6 +292,21 @@ export default { 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) + }) + }, /** * 添加证书 */