Commit a63138f2 authored by hanfeng zhang's avatar hanfeng zhang

Merge branch 'main' of gitlab.33.cn:HF_web/OKR

parents 75021e7c ad4af5ba
......@@ -190,7 +190,7 @@ export default Vue.extend({
parentId: this.parentId,
entId: this.entId,
hasStaff: true,
isDirect: !this.ifContainChildDep
isDirect: this.ifContainChildDep
}).then((res: any) => {
const { data } = res
this.loading = false
......
......@@ -40,7 +40,7 @@
<c-cell
dot
title="上级部门"
content="产品设计部"
:content="parentDepName"
/>
<!-- <switch-cell title="该部门包含子部门成员" :checked.sync="check" /> -->
<c-cell
......@@ -110,27 +110,35 @@ export default Vue.extend({
leaders: [] as Array<Staff>,
showContactSelector: false,
contactSelectorTitle: '',
actionType: 'add'
actionType: 'add',
parentDepName: ''
}
},
created() {
async created() {
this.depId = this.$route.params.id
this.entId = JSON.parse(localStorage.getItem('ENT_INFO') || '{}').id
this.getDepInfo()
const dep = await this.getDepInfo(this.depId)
this.depInfo = dep
this.selectedMemberId = [this.depInfo.leaderId]
if (this.depInfo.parentId === '-1') {
this.parentDepName = JSON.parse(localStorage.getItem('ENT_INFO') as string).name
} else {
const parentDep = await this.getDepInfo(this.depInfo.parentId)
this.parentDepName = parentDep.name
}
this.getStaffInfo(this.depInfo.leaderId)
},
methods: {
getDepInfo() {
getDepInfo(id: string) {
this.loading = true
this.$service.department.getDep({
return this.$service.department.getDep({
entId: this.entId,
id: this.depId
id
}).then((res: any) => {
const { data } = res
this.loading = false
if (data.code === this.$global.success) {
this.depInfo = data.data
this.selectedMemberId = [this.depInfo.leaderId]
this.getStaffInfo(this.depInfo.leaderId)
return data.data
} else {
this.$toast(data.msg)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment