From 646123cbbe83908eaaa681f8c0792830406affd4 Mon Sep 17 00:00:00 2001 From: "aoli.qu" <408346101@qq.com> Date: Tue, 23 Nov 2021 21:05:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=A1=B9=E7=9B=AE=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/person/personOrg.js | 21 +++ src/views/org/OrgForm.vue | 4 +- src/views/org/OrgList.vue | 4 +- src/views/person/PersonForm.vue | 2 + src/views/person/PersonList.vue | 41 +++-- src/views/person/PersonOrgForm.vue | 254 +++++++++++++++++++++++++++++ 6 files changed, 308 insertions(+), 18 deletions(-) create mode 100644 src/api/person/personOrg.js create mode 100644 src/views/person/PersonOrgForm.vue diff --git a/src/api/person/personOrg.js b/src/api/person/personOrg.js new file mode 100644 index 0000000..d887449 --- /dev/null +++ b/src/api/person/personOrg.js @@ -0,0 +1,21 @@ +import request from '@/utils/request' + +const personOrgApi = { + listByOrgId: 'person/org/listByOrgId', + addPersonOrg: 'person/org/addPersonOrg' +} + +export function listPersonByOrgId(params) { + return request({ + url: personOrgApi.listByOrgId, + method: 'get', + params: params + }) +} +export function addPersonOrg(params) { + return request({ + url: personOrgApi.addPersonOrg, + method: 'post', + data: params + }) +} diff --git a/src/views/org/OrgForm.vue b/src/views/org/OrgForm.vue index eea5757..b9de120 100644 --- a/src/views/org/OrgForm.vue +++ b/src/views/org/OrgForm.vue @@ -193,7 +193,7 @@ this.$emit('ok', values) this.form.resetFields() } else { - this.$message.error('编辑失败:' + res.message) + this.$message.error('编辑失败:' + res.msg) } }).finally((res) => { this.confirmLoading = false @@ -208,7 +208,7 @@ this.$emit('ok', values) this.form.resetFields() } else { - this.$message.error('新增失败:' + res.message) + this.$message.error('新增失败:' + res.msg) } }).finally((res) => { this.confirmLoading = false diff --git a/src/views/org/OrgList.vue b/src/views/org/OrgList.vue index fdfeaca..10639d7 100644 --- a/src/views/org/OrgList.vue +++ b/src/views/org/OrgList.vue @@ -132,10 +132,10 @@ this.getOrgTree() this.$refs.table.clearRefreshSelected() } else { - this.$message.error('删除失败:' + res.message) + this.$message.error('删除失败:' + res.msg) } }).catch((err) => { - this.$message.error('删除错误:' + err.message) + this.$message.error('删除错误:' + err.msg) }) }, handleOk () { diff --git a/src/views/person/PersonForm.vue b/src/views/person/PersonForm.vue index 5582560..446f517 100644 --- a/src/views/person/PersonForm.vue +++ b/src/views/person/PersonForm.vue @@ -430,6 +430,8 @@ }, handleCancel () { this.form.resetFields() + this.fileList = [] + this.fileList2 = [] this.visible = false } } diff --git a/src/views/person/PersonList.vue b/src/views/person/PersonList.vue index d37038b..5b47638 100644 --- a/src/views/person/PersonList.vue +++ b/src/views/person/PersonList.vue @@ -5,10 +5,12 @@
@@ -37,7 +39,7 @@ 查询 - 重置 + 重置 @@ -171,6 +173,7 @@ selectedRowKeys: [], selectedRows: [], defaultExpandedKeys: [], + defaultSelectedKeys: [], treeLoading: true, simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, replaceFields: { @@ -206,13 +209,16 @@ return } this.defaultExpandedKeys = [] + this.defaultSelectedKeys = [] this.orgTree = listToTree(res.data, [], rootParentId) this.orgId = this.orgTree[0].id + this.defaultSelectedKeys.push(this.orgId) for (var item of this.orgTree) { if (item.pid === 0) { this.defaultExpandedKeys.push(item.id) } } + console.log(this.defaultExpandedKeys) }) }, async changeOrgType () { @@ -230,7 +236,7 @@ this.$message.success('重置成功') // this.$refs.table.refresh() } else { - this.$message.error('重置失败:' + res.message) + this.$message.error('重置失败:' + res.msg) } }) }, @@ -243,10 +249,10 @@ this.$message.success('删除成功') this.$refs.table.refresh() } else { - this.$message.error('删除失败:' + res.message) + this.$message.error('删除失败:' + res.msg) } }).catch((err) => { - this.$message.error('删除错误:' + err.message) + this.$message.error('删除错误:' + err.msg) }) }, quit () { @@ -265,10 +271,10 @@ this.$message.success('操作成功') this.$refs.table.refresh() } else { - this.$message.error('操作失败:' + res.message) + this.$message.error('操作失败:' + res.msg) } }).catch((err) => { - this.$message.error('操作错误:' + err.message) + this.$message.error('操作错误:' + err.msg) }) }, onCancel () { @@ -294,10 +300,10 @@ this.$message.success('操作成功') this.$refs.table.refresh() } else { - this.$message.error('操作失败:' + res.message) + this.$message.error('操作失败:' + res.msg) } }).catch((err) => { - this.$message.error('操作错误:' + err.message) + this.$message.error('操作错误:' + err.msg) }) }, onCancel () { @@ -320,10 +326,10 @@ this.$message.success('操作成功') this.$refs.table.refresh() } else { - this.$message.error('操作失败:' + res.message) + this.$message.error('操作失败:' + res.msg) } }).catch((err) => { - this.$message.error('操作错误:' + err.message) + this.$message.error('操作错误:' + err.msg) }) }, onCancel () { @@ -331,10 +337,17 @@ }) }, personRegister () { - this.$router.push({ - path: '/person/personRegister', - query: { orgId: this.orgId } - }) + if (this.orgType === 1) { + this.$router.push({ + path: '/person/personRegister', + query: { orgId: this.orgId } + }) + } else { + this.$router.push({ + path: '/person/personOrg', + query: { orgId: this.orgId } + }) + } }, /** * 点击左侧机构树查询列表 diff --git a/src/views/person/PersonOrgForm.vue b/src/views/person/PersonOrgForm.vue new file mode 100644 index 0000000..7845854 --- /dev/null +++ b/src/views/person/PersonOrgForm.vue @@ -0,0 +1,254 @@ + + + +