|  |  |  | 
|---|
|  |  |  | <el-form-item label="" prop="keyword"> | 
|---|
|  |  |  | <el-input v-model="searchForm.keyword" placeholder="请输入姓名/手机号/工号" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="" prop="status"> | 
|---|
|  |  |  | <el-select v-model="searchForm.status" @keypress.enter.native="search" placeholder="是否有人脸"> | 
|---|
|  |  |  | <el-form-item label="" prop="hasFace"> | 
|---|
|  |  |  | <el-select v-model="searchForm.hasFace" @keypress.enter.native="search" placeholder="是否有人脸"> | 
|---|
|  |  |  | <el-option label="无" value="0"></el-option> | 
|---|
|  |  |  | <el-option label="有" value="1"></el-option> | 
|---|
|  |  |  | </el-select> | 
|---|
|  |  |  | 
|---|
|  |  |  | <el-option label="拉黑/冻结" value="2"></el-option> | 
|---|
|  |  |  | </el-select> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="" prop="hkStatus"> | 
|---|
|  |  |  | <el-select v-model="searchForm.hkStatus" @keypress.enter.native="search" placeholder="海康同步状态"> | 
|---|
|  |  |  | <el-option label="待同步" value="0"></el-option> | 
|---|
|  |  |  | <el-option label="同步成功" value="1"></el-option> | 
|---|
|  |  |  | <el-option label="同步失败" value="2"></el-option> | 
|---|
|  |  |  | </el-select> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <section> | 
|---|
|  |  |  | <el-button type="primary" @click="search">搜索</el-button> | 
|---|
|  |  |  | <el-button @click="reset">重置</el-button> | 
|---|
|  |  |  | 
|---|
|  |  |  | </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> | 
|---|
|  |  |  | <Tree :list="companyTree" :defaultProps="{name: 'name', status: 'status', children: 'companyDTOList', id: 'id'}" @callback="callback" /> | 
|---|
|  |  |  | <div style="width: 100%; height: calc(100vh - 170px); overflow-y: scroll;"> | 
|---|
|  |  |  | <Tree :list="companyTree" :defaultProps="{name: 'name', status: 'status', children: 'childList', id: 'erpId'}" @callback="callback" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <!-- 表格和分页 --> | 
|---|
|  |  |  | <template v-slot:table-wrap> | 
|---|
|  |  |  | <ul class="toolbar" v-permissions="['business:member:delete']"> | 
|---|
|  |  |  | <ul class="toolbar" v-permissions="['business:member:delete','business:member:sync']"> | 
|---|
|  |  |  | <li><el-button type="primary">门禁授权</el-button></li> | 
|---|
|  |  |  | <li><el-button type="primary">同步</el-button></li> | 
|---|
|  |  |  | <li><el-button type="primary" v-permissions="['business:member:sync']" :loading="loading" @click="synchronous()">同步</el-button></li> | 
|---|
|  |  |  | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:member:delete']">删除</el-button></li> | 
|---|
|  |  |  | </ul> | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | 
|---|
|  |  |  | <el-table-column type="selection" width="55"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="name" label="姓名" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="phone" label="手机号" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="sex" label="性别" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column label="性别" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.sex == 1">男</span> | 
|---|
|  |  |  | <span v-if="row.sex == 2">女</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="companyName" label="所属部门" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="status" label="状态" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.status === 0">正常</span> | 
|---|
|  |  |  | <span v-if="row.status === 1">禁用</span> | 
|---|
|  |  |  | <span v-if="row.status === 2">拉黑/冻结</span> | 
|---|
|  |  |  | <span v-if="row.status == 0" style="color: green">正常</span> | 
|---|
|  |  |  | <span v-if="row.status == 1" style="color: red">禁用</span> | 
|---|
|  |  |  | <span v-if="row.status == 2" style="color: red">拉黑/冻结</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="code" label="工号" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="code" label="部门" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="code" label="可拜访" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="roleId" label="门禁角色" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column fixed="right" prop="faceImg" label="人脸信息" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column fixed="right" prop="faceImg" label="卡片信息" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column label="可拜访" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.canVisit != 1">否</span> | 
|---|
|  |  |  | <span v-if="row.canVisit == 1">是</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="海康同步状态" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.hkStatus == 0" style="color: #435EBE">待同步</span> | 
|---|
|  |  |  | <span v-if="row.hkStatus == 1" style="color: green">同步成功</span> | 
|---|
|  |  |  | <span v-if="row.hkStatus == 2" style="color: red">同步失败</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="门禁角色" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span>{{row.roleNames.join(',')}}</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column fixed="right" label="人脸信息" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <el-image | 
|---|
|  |  |  | style="width: 100px; height: 100px" | 
|---|
|  |  |  | :src="row.faceImg" | 
|---|
|  |  |  | :preview-src-list="[row.faceImg]"> | 
|---|
|  |  |  | </el-image> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column fixed="right" label="卡片信息" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <el-image | 
|---|
|  |  |  | style="width: 100px; height: 100px" | 
|---|
|  |  |  | :src="row.faceImg" | 
|---|
|  |  |  | :preview-src-list="[row.faceImg]"> | 
|---|
|  |  |  | </el-image> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <!--                <el-table-column--> | 
|---|
|  |  |  | <!--                    v-if="containPermissions(['business:member:update', 'business:member:delete'])"--> | 
|---|
|  |  |  | <!--                    label="操作"--> | 
|---|
|  |  |  | 
|---|
|  |  |  | import TableLayout1 from '@/layouts/TableLayout1' | 
|---|
|  |  |  | import Pagination from '@/components/common/Pagination' | 
|---|
|  |  |  | import Tree from '@/components/common/Tree' | 
|---|
|  |  |  | import { findCompanyTreePage } from '@/api/business/company' | 
|---|
|  |  |  | import { fetchList } from '@/api/business/company' | 
|---|
|  |  |  | import { memberSync } from '@/api/business/member' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'internalMember', | 
|---|
|  |  |  | extends: BaseTable, | 
|---|
|  |  |  | components: { TableLayout1, Pagination, Tree }, | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | TreeList: [ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | name: '华晨', | 
|---|
|  |  |  | status: '', | 
|---|
|  |  |  | id: 1, | 
|---|
|  |  |  | children: [ | 
|---|
|  |  |  | { name: '行政部', status: '', id: 2 }, | 
|---|
|  |  |  | { name: '信息部', status: '', id: 3 }, | 
|---|
|  |  |  | { name: '项目部', status: '', id: 4 } | 
|---|
|  |  |  | ] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ], | 
|---|
|  |  |  | TreeList: [], | 
|---|
|  |  |  | // 搜索 | 
|---|
|  |  |  | searchForm: { | 
|---|
|  |  |  | name: '', | 
|---|
|  |  |  | status: '', | 
|---|
|  |  |  | hkStatus: '', | 
|---|
|  |  |  | canVisit: '', | 
|---|
|  |  |  | companyId: '', | 
|---|
|  |  |  | keyword: '', | 
|---|
|  |  |  | type: 2 | 
|---|
|  |  |  | type: 2, | 
|---|
|  |  |  | erpOrgId: '', | 
|---|
|  |  |  | companyId: '', | 
|---|
|  |  |  | hasFace: '' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | loading:false, | 
|---|
|  |  |  | companyTree: [] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | // 获取组织树 | 
|---|
|  |  |  | getfindCompanyTreePage () { | 
|---|
|  |  |  | findCompanyTreePage(1) | 
|---|
|  |  |  | fetchList(1) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.companyTree = res | 
|---|
|  |  |  | this.searchForm.companyId = res[0].id | 
|---|
|  |  |  | // this.searchForm.erpOrgId = res[0].erpId | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 同步信息 | 
|---|
|  |  |  | async synchronous () { | 
|---|
|  |  |  | this.$dialog.actionConfirm('操作确认提醒', '您确认同步全部信息吗?') | 
|---|
|  |  |  | .then(() => { | 
|---|
|  |  |  | this.loading = true | 
|---|
|  |  |  | memberSync({}) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.$tip.apiSuccess(res || '同步成功') | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$tip.apiFailed(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.loading = false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(() => {}) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | callback (row) { | 
|---|
|  |  |  | console.log(row) | 
|---|
|  |  |  | this.searchForm.erpOrgId = row.erpId | 
|---|
|  |  |  | this.searchForm.companyId = row.id | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | } | 
|---|