From ff087240b3dee29ce4e14ad0836e76b9fdf312cf Mon Sep 17 00:00:00 2001 From: MrShi <1878285526@qq.com> Date: 星期二, 19 八月 2025 09:28:07 +0800 Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/lianhelihua_sh --- admin/src/views/business/companyMember.vue | 31 ++++++++++++++++++++++++------- 1 files changed, 24 insertions(+), 7 deletions(-) diff --git a/admin/src/views/business/companyMember.vue b/admin/src/views/business/companyMember.vue index 1280bff..d885ac0 100644 --- a/admin/src/views/business/companyMember.vue +++ b/admin/src/views/business/companyMember.vue @@ -17,7 +17,8 @@ style="width: 100%; height: 50px; background: rgba(242, 242, 242, 1); line-height: 50px; text-align: center; font-size: 14px;"> 浼佷笟缁勭粐</div> <div style="width: 100%; height: calc(100vh - 130px); overflow-y: scroll;"> - <Tree :list="companyTree" :alllist="companyTree" :defaultProps="{ name: 'name', status: 'fsStatus', children: 'childList', id: 'id' }" + <Tree :list="companyTree" :alllist="companyTree" + :defaultProps="{ name: 'name', status: 'fsStatus', children: 'childList', id: 'id' }" @callback="callback" /> </div> </template> @@ -75,17 +76,18 @@ import BaseTable from '@/components/base/BaseTable' import TableLayout1 from '@/layouts/TableLayout1' import Pagination from '@/components/common/Pagination' -import Tree from '@/components/common/Tree' +import Tree from '@/components/common/TreeNew' import OperaMemberWindow from '@/components/business/OperaMemberWindow' -import { treeList } from '@/api/business/company' +import { allList,treeList } from '@/api/business/company' import { memberSync} from '@/api/business/member' export default { name: 'internalMember', extends: BaseTable, - components: { TableLayout1, Pagination, Tree,OperaMemberWindow }, + components: { TableLayout1, Pagination, Tree, OperaMemberWindow }, data() { return { TreeList: [], + defaultExpanedKeys:null, // 鎼滅储 searchForm: { name: '' , @@ -96,6 +98,7 @@ loading: false, heading: false, working: false, + dataList: [], companyTree: [], department: [] } @@ -113,15 +116,26 @@ methods: { // 鑾峰彇缁勭粐鏍� getfindCompanyTreePage() { - treeList({}) + allList({}) .then(res => { + console.log(res) if (res && res.length > 0) { res[0].fsStatus = 1 + this.getCompanyList(res[0]) this.companyTree = res this.search() - this.department = this.getDepartmentTree(res) + // this.department = this.getDepartmentTree(res) } }) + }, + getCompanyList(row){ + allList({parentId:row.id}) + .then(res => { + console.log(res) + if (res && res.length > 0) { + row.childList = res + } + }) }, getDepartmentTree(tree) { if (tree == null) { @@ -153,7 +167,7 @@ this.loading = true memberSync({}) .then(res => { - this.$tip.apiSuccess(res || '鍚屾鎴愬姛') + this.$tip.apiSuccess( '鍚屾鎴愬姛') this.search() }) .catch(e => { @@ -170,6 +184,9 @@ this.searchForm.erpOrgId = row.erpId this.searchForm.companyId = row.id this.search() + if(row.hasChildren && (row.childList == null || row.childList.length == 0)){ + this.getCompanyList(row) + } } } } -- Gitblit v1.9.3