diff --git a/src/views/modules/communityParty/partyOrg/create.vue b/src/views/modules/communityParty/partyOrg/create.vue index 511d3bcd2..81337d21d 100644 --- a/src/views/modules/communityParty/partyOrg/create.vue +++ b/src/views/modules/communityParty/partyOrg/create.vue @@ -233,6 +233,7 @@ export default { this.parentPartyOrgs = []; this.principals = []; this.xingzhengOrgs = []; + this.searchValue = null; return { partyOrgPid: null, @@ -289,6 +290,8 @@ export default { * @returns {Promise} */ async handlePartyOrgLevelSelected() { + this.dataForm.orgId = null; + // 加载上级党组织。只在新增的时候加载,新增下级的时候,不加载,init函数中已经固定了上级党组织 if (this.operation === 'createNew') { this.loadParentPartyOrgs(this.dataForm.partyOrgLevel); @@ -319,10 +322,10 @@ export default { await this.loadXingzhengOrgs(); - if (this.dataForm.partyOrgPid === '0') { - // 根级党组织 - this.dataForm.orgId = this.xingzhengOrgs[0].orgId; - } + // if (this.dataForm.partyOrgPid === '0') { + // // 根级党组织 + // this.dataForm.orgId = this.xingzhengOrgs[0].orgId; + // } }, /** @@ -505,7 +508,7 @@ export default { // 1:省委,2:市委,3:区委,4:党工委,5:党委,6:党总支,7:党支部,8:楼院党小组 // 如果是 >=6 ,那么他们对应的行政组织,就是上级党组织对应的行政组织,自动选中即可 this.$nextTick(() => { - if (this.dataForm.partyOrgLevel >= 6 && data && data.length > 0) { + if (data && data.length > 0 && (this.dataForm.partyOrgLevel >= 6 || this.dataForm.partyOrgPid === '0')) { this.dataForm.orgId = this.xingzhengOrgs[0].orgId; // 自动选择了行政组织,然后自动加载负责人列表 diff --git a/src/views/modules/communityParty/partyOrg/orgTree.vue b/src/views/modules/communityParty/partyOrg/orgTree.vue index 44d53522e..3c713efba 100644 --- a/src/views/modules/communityParty/partyOrg/orgTree.vue +++ b/src/views/modules/communityParty/partyOrg/orgTree.vue @@ -255,9 +255,12 @@ export default { this.partyOrgTree.push(data); // 默认加载2级,并且展开,从第三级开始,需要展开上一级动态查询得到 - this.$nextTick(() => { - document.getElementsByClassName('el-table__expand-icon')[0].click(); - }); + console.log(">>>>", this.partyOrgTree) + if (this.partyOrgTree.length > 0) { + this.$nextTick(() => { + document.getElementsByClassName('el-table__expand-icon')[0].click(); + }); + } }).parse(rst); }, diff --git a/src/views/modules/communityParty/partyOrg/update.vue b/src/views/modules/communityParty/partyOrg/update.vue index 92ec1a865..d0749957d 100644 --- a/src/views/modules/communityParty/partyOrg/update.vue +++ b/src/views/modules/communityParty/partyOrg/update.vue @@ -209,6 +209,7 @@ export default { */ initForm() { this.principals = []; + this.searchValue = null; return { id: null, partyOrgName: null,