|  |  |  | 
|---|
|  |  |  | <div | 
|---|
|  |  |  | 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 - 170px); overflow-y: scroll;"> | 
|---|
|  |  |  | <Tree :list="companyTree" :defaultProps="{ name: 'name', status: 'fsStatus', children: 'childList', id: 'id' }" | 
|---|
|  |  |  | <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' }" | 
|---|
|  |  |  | @callback="callback" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | 
|---|
|  |  |  | @change="search">是否包含下级组织</el-checkbox> | 
|---|
|  |  |  | </li> | 
|---|
|  |  |  | </ul> | 
|---|
|  |  |  | <el-table   v-loading="isWorking.search" :data="tableData.list" stripe @selection-change="handleSelectionChange"> | 
|---|
|  |  |  | <el-table-column type="selection" width="55"></el-table-column> | 
|---|
|  |  |  | <el-table :height="tableHeightNew"  v-loading="isWorking.search" :data="tableData.list" stripe @selection-change="handleSelectionChange"> | 
|---|
|  |  |  | <!--        <el-table-column prop="index" label="序号" width="55" fixed="left"> | 
|---|
|  |  |  | <template slot-scope="scope">{{ scope.$index+1}}</template> | 
|---|
|  |  |  | </el-table-column>--> | 
|---|
|  |  |  | <el-table-column fixed="left" prop="name" label="姓名" min-width="80px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span>{{ row.name }}</span> | 
|---|
|  |  |  | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.sex == '1'">男</span> | 
|---|
|  |  |  | <span v-else-if="row.sex == '2' ">女</span> | 
|---|
|  |  |  | <span v-else>女</span> | 
|---|
|  |  |  | <span v-else>-</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="email" label="邮箱" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="companyName" label="所属部门" min-width="150px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="companyName" label="所属部门" min-width="150px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <div v-if="row.companyNameList && row.companyNameList.length"> | 
|---|
|  |  |  | <div  v-for="item in row.companyNameList" :key="item.id" style="display: block;margin-right: 20px">{{item}} | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="editorName" label="操作人" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="editDate" label="最后操作时间" min-width="150px"></el-table-column> | 
|---|
|  |  |  | <el-table-column fixed="right"   v-if="containPermissions(['business:member:update'])" label="操作" min-width="100"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <el-button type="text" icon="el-icon-edit" @click="$refs.OperaMemberWindow.open('编辑员工信息', row)"  v-permissions="['business:member:update']">编辑</el-button> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table> | 
|---|
|  |  |  | <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination"> | 
|---|
|  |  |  | </pagination> | 
|---|
|  |  |  | <OperaMemberWindow ref="OperaMemberWindow" @success="handlePageChange" /> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </TableLayout1> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | 
|---|
|  |  |  | import BaseTable from '@/components/base/BaseTable' | 
|---|
|  |  |  | import TableLayout1 from '@/layouts/TableLayout1' | 
|---|
|  |  |  | import Pagination from '@/components/common/Pagination' | 
|---|
|  |  |  | import Tree from '@/components/common/Tree' | 
|---|
|  |  |  | import { treeList } from '@/api/business/company' | 
|---|
|  |  |  | import Tree from '@/components/common/TreeNew' | 
|---|
|  |  |  | import OperaMemberWindow from '@/components/business/OperaMemberWindow' | 
|---|
|  |  |  | import { allList,treeList } from '@/api/business/company' | 
|---|
|  |  |  | import { memberSync} from '@/api/business/member' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'internalMember', | 
|---|
|  |  |  | extends: BaseTable, | 
|---|
|  |  |  | components: { TableLayout1, Pagination, Tree }, | 
|---|
|  |  |  | components: { TableLayout1, Pagination, Tree, OperaMemberWindow }, | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | TreeList: [], | 
|---|
|  |  |  | defaultExpanedKeys:null, | 
|---|
|  |  |  | // 搜索 | 
|---|
|  |  |  | searchForm: { | 
|---|
|  |  |  | name: '' , | 
|---|
|  |  |  | 
|---|
|  |  |  | loading: false, | 
|---|
|  |  |  | heading: false, | 
|---|
|  |  |  | working: false, | 
|---|
|  |  |  | dataList: [], | 
|---|
|  |  |  | companyTree: [], | 
|---|
|  |  |  | department: [] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | 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) { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.loading = true | 
|---|
|  |  |  | memberSync({}) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.$tip.apiSuccess(res || '同步成功') | 
|---|
|  |  |  | this.$tip.apiSuccess(  '同步成功') | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|