MrShi
2025-08-19 ff087240b3dee29ce4e14ad0836e76b9fdf312cf
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,9 +76,9 @@
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',
@@ -86,6 +87,7 @@
  data() {
    return {
      TreeList: [],
      defaultExpanedKeys:null,
      // 搜索
      searchForm: {
        name: '' ,
@@ -96,6 +98,7 @@
      loading: false,
      heading: false,
      working: false,
      dataList: [],
      companyTree: [],
      department: []
    }
@@ -113,13 +116,24 @@
  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
          }
        })
    },
@@ -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)
      }
    }
  }
}