| <template> | 
|   <TableLayout1 :permissions="['business:member:query']"> | 
|     <!-- 搜索表单 --> | 
|     <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> | 
|       <el-form-item label="" prop="queryKeyword"> | 
|         <el-input v-model="searchForm.queryKeyword" placeholder="请输入姓名/手机号/工号" @keypress.enter.native="search"></el-input> | 
|       </el-form-item> | 
|       <el-form-item label="" prop="iamUsername"> | 
|         <el-input v-model="searchForm.iamUsername" placeholder="请输入登录账号" @keypress.enter.native="search"></el-input> | 
|       </el-form-item> | 
|       <el-form-item label="" prop="shopType"> | 
|         <el-select v-model="searchForm.shopType" @change="search" style="width: 130px" clearable placeholder="一级组织类型"> | 
|           <el-option label="HR" value="1"></el-option> | 
|           <el-option label="加盟商" value="2"></el-option> | 
|           <el-option label="虚拟组织" value="3"></el-option> | 
|         </el-select> | 
|       </el-form-item> | 
|       <el-form-item label="" prop="shopSecType"> | 
|         <el-select v-model="searchForm.shopSecType" @change="search" style="width: 130px"  clearable placeholder="二级组织类型"> | 
|           <el-option label="S" value="1"></el-option> | 
|           <el-option label="F" value="2"></el-option> | 
|           <el-option label="店面" value="3"></el-option> | 
|           <el-option label="部门" value="4"></el-option> | 
|           <el-option label="虚拟店面" value="5"></el-option> | 
|         </el-select> | 
|       </el-form-item> | 
|       <el-form-item label="" prop="status"> | 
|         <el-select v-model="searchForm.status" @keypress.enter.native="search" style="width: 120px"  clearable placeholder="状态"> | 
|           <el-option label="停用" value="0"></el-option> | 
|           <el-option label="正常" value="1"></el-option> | 
|         </el-select> | 
|       </el-form-item> | 
|       <section> | 
|         <el-button type="primary" @click="search">搜索</el-button> | 
|         <el-button @click="reset">重置</el-button> | 
|       </section> | 
|     </el-form> | 
|     <template v-slot:menu> | 
|       <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;"> | 
|         <el-tree | 
|             :data="companyTree" | 
|             :highlight-current="true" | 
|             lazy | 
|             :load="loadChild" | 
|             @node-click="callback" | 
|             node-key="orgId" | 
|             :props="{children:'childList',label:'name', isLeaf: 'isLeaf'}" | 
|         > | 
|         </el-tree> | 
|       </div> | 
|     </template> | 
|     <!-- 表格和分页 --> | 
|     <template v-slot:table-wrap> | 
|       <ul class="toolbar"  style="height: 26px"> | 
|         <li><el-button type="primary" @click="$refs.OperaUserImportWindow.open('初始化导入')"  icon="el-icon-plus" v-permissions="['business:member:create']">初始化导入</el-button></li> | 
|         <!--        <li><el-button type="primary" @click="$refs.OperaMemberWindow.open('新建员工',null,department,searchForm.companyType)"  icon="el-icon-plus" v-permissions="['business:member:create']">新建员工</el-button></li> | 
|                 <li><el-button type="primary" @click="$refs.OperaMemberImportWindow.open('人员导入',searchForm.companyType)"  icon="el-icon-plus" v-permissions="['business:member:create']">人员导入</el-button></li> | 
|                 <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:member:delete']">批量删除</el-button></li> | 
|              --> | 
|         <li style="float: right;"> | 
|          <el-checkbox style="font-size: 12px"  label="1" v-model="searchForm.includeChild" key="1"  @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-column prop="name" label="姓名" fixed min-width="100px"></el-table-column> | 
|         <el-table-column prop="iamUsername" fixed label="登录账号" min-width="100px"></el-table-column> | 
|         <el-table-column prop="phone" label="手机号" fixed min-width="100px"></el-table-column> | 
|         <el-table-column label="性别" min-width="100px"> | 
|           <template slot-scope="{row}"> | 
|             <span v-if="row.sex == 0">男</span> | 
|             <span v-if="row.sex == 1">女</span> | 
|           </template> | 
|         </el-table-column> | 
|         <el-table-column prop="shopName" label="所属部门" min-width="150px"></el-table-column> | 
|         <el-table-column prop="status" label="状态" min-width="100px"> | 
|           <template slot-scope="{row}"> | 
|             <span v-if="row.status == 0" style="color: red">停用</span> | 
|             <span v-if="row.status == 1" style="color:green">启用</span> | 
|           </template> | 
|         </el-table-column> | 
|         <el-table-column prop="shopType" label="组织类型" min-width="110px"> | 
|           <template scope="{row}"> | 
|             <span v-if="row.shopType == 1">HR</span> | 
|             <span v-if="row.shopType == 2">加盟商</span> | 
|             <span v-if="row.shopType == 3">虚拟组织</span> | 
|             <span v-if="row.shopSecType == 1">-S</span> | 
|             <span v-if="row.shopSecType == 2">-F</span> | 
|             <span v-if="row.shopSecType == 3">-店面</span> | 
|             <span v-if="row.shopSecType == 4">-部门</span> | 
|             <span v-if="row.shopSecType == 5">-虚拟店面</span> | 
|           </template> | 
|         </el-table-column> | 
|         <el-table-column prop="code" label="工号" min-width="100px"></el-table-column> | 
|         <el-table-column prop="roleNames" label="人员角色" min-width="100px"></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" label="头像" align="center" min-width="100px"> | 
|           <template slot-scope="{row}"> | 
|             <el-image | 
|                 v-if="row.imgurlFull" | 
|                 style="width: 60px; height: 60px" | 
|                 :src="row.imgurlFull" | 
|                 :preview-src-list="[row.imgurlFull]"> | 
|             </el-image> | 
|           </template> | 
|         </el-table-column> | 
|         <!--      <el-table-column | 
|                v-if="containPermissions(['business:member:update', 'business:member:delete','business:empower:create'])" | 
|                label="操作" | 
|                min-width="280" | 
|                fixed="right" | 
|            > | 
|           <template slot-scope="{row}"> | 
|                <el-button type="text" icon="el-icon-edit" @click="$refs.OperaMemberWindow.open('编辑员工信息',row,department)" v-permissions="['business:empower:update']">编辑</el-button> | 
|                <el-button  type="text"  icon="el-icon-delete" @click="deleteById(row)" style="color: red" v-permissions="['business:member:delete']">删除</el-button> | 
|              </template> | 
|         </el-table-column>--> | 
|       </el-table> | 
|       <pagination | 
|           @size-change="handleSizeChange" | 
|           @current-change="handlePageChange" | 
|           :pagination="tableData.pagination" | 
|       > | 
|       </pagination> | 
|       <!--    查看人员开卡记录    --> | 
|       <OperaUserImportWindow ref="OperaUserImportWindow" @success="handlePageChange" /> | 
|     </template> | 
|   </TableLayout1> | 
| </template> | 
|   | 
| <script> | 
| import BaseTable from '@/components/base/BaseTable' | 
| import TableLayout1 from '@/layouts/TableLayout1' | 
| import Pagination from '@/components/common/Pagination' | 
| import OperaUserImportWindow from '@/components/business/OperaUserImportWindow' | 
| import { fetchListByParent } from '@/api/business/shop' | 
| export default { | 
|   name: 'internalMember', | 
|   extends: BaseTable, | 
|   components: { TableLayout1, Pagination, OperaUserImportWindow }, | 
|   data () { | 
|     return { | 
|       TreeList: [], | 
|       // 搜索 | 
|       searchForm: { | 
|         queryKeyword: '', | 
|         status: '', | 
|         iamOrgId: '', | 
|         shopName: '', | 
|         shopType: null, | 
|         shopSecType: null, | 
|         includeChild: false | 
|       }, | 
|       loading: false, | 
|       companyTree: [], | 
|       department: [] | 
|     } | 
|   }, | 
|   created () { | 
|     this.config({ | 
|       module: '人员信息表', | 
|       api: '/business/users', | 
|       'field.id': 'id', | 
|       'field.main': 'id' | 
|     }) | 
|     this.search() | 
|     // this.loadShopTree() | 
|   }, | 
|   methods: { | 
|     // 页码变更处理 | 
|     loadShopTree () { | 
|       this.__checkApi() | 
|       fetchListByParent(null) | 
|         .then(data => { | 
|           this.companyTree = data | 
|         }) | 
|         .finally(() => { | 
|         }) | 
|     }, | 
|     loadChild (row, resolve) { | 
|       // 模拟异步加载子节点数据 | 
|       fetchListByParent(row.key) | 
|         .then(data => { | 
|           resolve(data) | 
|         }) | 
|         .catch(e => { | 
|         }) | 
|         .finally(() => { | 
|         }) | 
|     }, | 
|     callback (row) { | 
|       console.log(row) | 
|       this.searchForm.iamOrgId = row.orgId | 
|       this.search() | 
|     } | 
|   } | 
| } | 
| </script> | 
|   | 
| <style lang="scss" scoped> | 
| .box { | 
|   width: 100%; | 
|   display: flex; | 
|   align-items: center; | 
|   .box_menu { | 
|     width: 100px; | 
|     height: 100%; | 
|     flex-shrink: 0; | 
|   } | 
|   .box_tab { | 
|     flex: 1; | 
|     height: 100%; | 
|   } | 
| } | 
| </style> |