|
@@ -0,0 +1,1760 @@
|
|
|
|
+<template>
|
|
|
|
+ <div>
|
|
|
|
+ <el-alert class="diy-tip" title="温馨提示:" @close="tips_close" v-show="tips_show" type="success" description show-icon>
|
|
|
|
+ <p>第一步:添加部门</p>
|
|
|
|
+ <p>第二步:新增员工(员工可以批量导入,每次最多可以导入200个员工)</p>
|
|
|
|
+ <p>备注:(导入员工的数量不能大于购买的员工数量)</p>
|
|
|
|
+ </el-alert>
|
|
|
|
+
|
|
|
|
+ <div class="flex-box all-box br-5 boxMinHeight">
|
|
|
|
+ <div class="RuleLeft box-sizing-w scroll-bar">
|
|
|
|
+ <el-button @click="addTheDepartment" type="primary" style="margin-bottom: 10px;width:164px;height:36px;text-align: center;font-size:14px;">+添加部门</el-button>
|
|
|
|
+ <div v-loading="dept_show">
|
|
|
|
+ <div @click="handleNodeClick({ value: 0 })" class="company_name">
|
|
|
|
+ <img src="static/images/two.png" />
|
|
|
|
+ <span>{{ firstCompany.name }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div ref="ruletree" class="department_box">
|
|
|
|
+ <el-tree
|
|
|
|
+ ref="menum"
|
|
|
|
+ v-show="treedata !== null && treedata.length != 0"
|
|
|
|
+ node-key="id"
|
|
|
|
+ :accordion="true"
|
|
|
|
+ :highlight-current="true"
|
|
|
|
+ @node-expand="treeOpen"
|
|
|
|
+ :data="treedata"
|
|
|
|
+ :default-expand-all="defaultExpand"
|
|
|
|
+ :props="defaultProps"
|
|
|
|
+ @node-click="handleNodeClick"
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ content="tree"
|
|
|
|
+ v-show="treedata.length != 0"
|
|
|
|
+ class="custom-tree-node"
|
|
|
|
+ slot-scope="{ node, data }"
|
|
|
|
+ style="font-size: 14px;color: #606266; width:100%; text-align: left;"
|
|
|
|
+ >
|
|
|
|
+ <img src="static/images/one.png" />
|
|
|
|
+ <span class="name">{{ data.name }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </el-tree>
|
|
|
|
+ <div v-show="treedata !== null && treedata.length == 0 && !dept_show">
|
|
|
|
+ <p style="padding: 0 20px;margin-top: 50px;"><img src="static/images/nodata_default.png" width="100%" alt="" /></p>
|
|
|
|
+ <p style="text-align: center;margin: 50px 0;">
|
|
|
|
+ 目前没有部门,去
|
|
|
|
+ <span @click="addTheDepartment" style="color: #409EFF;">添加</span>
|
|
|
|
+ 吧
|
|
|
|
+ </p>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="RuleRight flex-1" v-loading="loading">
|
|
|
|
+ <div class="title">
|
|
|
|
+ <span class="sapn">{{ company.name }}</span>
|
|
|
|
+ (
|
|
|
|
+ <span>{{ nowEmploye }}人</span>
|
|
|
|
+ )
|
|
|
|
+ <el-button type="primary" @click="openEmploe" v-if="set_btn" style="margin-left:10px;">编辑</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="flex-box-end flex-v-ce" style="margin-top: 20px;">
|
|
|
|
+ <div class="flex-1">
|
|
|
|
+ <div class="green" v-if="company.pid == undefined">
|
|
|
|
+<!-- 创始人:
|
|
|
|
+ <el-tag :key="index" v-for="(item, index) in supermanger" :disable-transitions="false">{{ item.name }}</el-tag> -->
|
|
|
|
+ </div>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <div class="green">
|
|
|
|
+ <span>管理员:</span>
|
|
|
|
+ <el-tag :key="index" v-for="(item, index) in supermanger" closable :disable-transitions="false" @close="deleteEmployee(item)">{{ item.name }}</el-tag>
|
|
|
|
+ <el-button size="mini" type="primary" icon="el-icon-plus" plain @click="show_employee_selector = true"></el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="fontColorD" style="padding: 0 30px;padding-top: 10px;">只能选择直属部门的员工作为部门管理员</div>
|
|
|
|
+ </template>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="blue cursor" style="padding-right: 20px;" @click="$openUrl(6)"><i class="el-icon-question" style="padding-right: 5px;font-size: 16px;position: relative;top: 1px;"></i>如何邀请员工注册</div>
|
|
|
|
+ <el-button type="primary" @click="new_employee" class="fr">新成员列表</el-button>
|
|
|
|
+ <el-button type="danger" plain @click="isShowDelete=true" class="fr">离职人员列表</el-button>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="list_box">
|
|
|
|
+ <div style="margin-bottom:10px;margin-top:30px;" class="inline-block-btn-list">
|
|
|
|
+ <!-- <el-button class="first-element-btn" :disabled="multipleSelection.length == 0" @click="confirmMultipleDelete" type="danger">批量删除</el-button> -->
|
|
|
|
+ <el-button @click="EmployeeAdd" type="primary">新增员工</el-button>
|
|
|
|
+ <el-button @click="dialogExcelVisible = true">导入员工</el-button>
|
|
|
|
+ <el-button @click="exportEmploye = true">导出/修改员工</el-button>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <el-checkbox v-model="account_id" style="margin-left: 10px;">仅显示未注册</el-checkbox>
|
|
|
|
+ <div class="fr" style="display:inline-block; width:250px;">
|
|
|
|
+ <el-input placeholder="请输入名字或者手机号码" clearable v-model="filter.keywords" maxlength="20"></el-input>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <el-table @filter-change="filterHandler" ref="multipleTable" :data="tableData" tooltip-effect="dark" @selection-change="handleSelectionChange" @row-click="toDetailPage">
|
|
|
|
+ <!-- <el-table-column type="selection" width="50" :selectable="isSelectable"></el-table-column> -->
|
|
|
|
+ <el-table-column prop="name" label="姓名">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <userImage class="fl" :id="scope.row.id" :user_name="scope.row.name" :img_url="scope.row.img_url" fontSize="16" width="50px" height="50px"></userImage>
|
|
|
|
+ <span style="margin-left: 10px; line-height: 50px; display: inline-block;">{{ scope.row.name }}</span>
|
|
|
|
+ <span class="administration" v-if="scope.row.employee_detail.manage_dept_ids.length != 0">管</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="dept_list" label="部门">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <template v-if="scope.row.employee_detail.dept_list.length > 0">
|
|
|
|
+ <span v-for="(item, index) in scope.row.employee_detail.dept_list" :key="index">
|
|
|
|
+ {{ item.dept_name }}
|
|
|
|
+ <span v-if="scope.row.employee_detail.dept_list.length - index > 1">,</span>
|
|
|
|
+ </span>
|
|
|
|
+ </template>
|
|
|
|
+ <span v-else>--</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="tel" label="电话"></el-table-column>
|
|
|
|
+ <el-table-column prop="post" label="岗位">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-link v-if="scope.row.post" @click.stop="openPost(scope.row)">{{scope.row.post}}</el-link>
|
|
|
|
+ <el-link type="primary" v-else @click.stop="openPost(scope.row)">设置</el-link>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="status" width="120px" align="center">
|
|
|
|
+
|
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
|
+ <el-select v-model="status" size="mini" class="selectVal">
|
|
|
|
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div v-if="scope.row.status == 0" style="color: rgb(255 168 90);">待加入</div>
|
|
|
|
+ <div v-if="scope.row.status == 1 && scope.row.account_id >= 1" style="color: #409EFF;">在职</div>
|
|
|
|
+ <div v-if="scope.row.status == 1 && scope.row.account_id == 0" style="color: #409EFF;">
|
|
|
|
+ 在职
|
|
|
|
+ <span class="red">(未注册)</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="scope.row.status == 2" style="color: #f56c6c;">离职</div>
|
|
|
|
+ <div v-if="scope.row.status == 3" style="color: rgb(107 204 131);cursor:pointer" @click.stop="againInvite(scope.row)">再次邀请</div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+
|
|
|
|
+ <el-table-column prop="accedence_time" label="入职日期" align="center"></el-table-column>
|
|
|
|
+ <template slot="empty">
|
|
|
|
+ <NoData></NoData>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table>
|
|
|
|
+ <el-pagination
|
|
|
|
+ background
|
|
|
|
+ layout="total,sizes, prev, pager, next"
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
+ :page-size="pageLimit"
|
|
|
|
+ :page-sizes="[10, 20, 50, 100]"
|
|
|
|
+ :total="totalCount"
|
|
|
|
+ :current-page.sync="currentPage"
|
|
|
|
+ @current-change="changePage"
|
|
|
|
+ ></el-pagination>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 导入员工 -->
|
|
|
|
+ <el-dialog title="导入员工" width="600px" :visible.sync="dialogExcelVisible" :close-on-click-modal="false" :before-close="close_import">
|
|
|
|
+ <div style="padding:0 50px;">
|
|
|
|
+ <div class="align-center" style="margin-bottom:20px;">
|
|
|
|
+ <!-- <p>温馨提示:</p> -->
|
|
|
|
+ <p>
|
|
|
|
+ 1、建立公司组织架构
|
|
|
|
+ <span><span style="display: inline-block; height:36px;"></span></span>
|
|
|
|
+ </p>
|
|
|
|
+ <p>
|
|
|
|
+ 2、下载员工信息表模版,批量填写员工信息
|
|
|
|
+ <a target="_blank" :href="$serverdomain + '/excel/员工新增导入模板.xlsx'"><el-button type="primary" plain>下载模板</el-button></a>
|
|
|
|
+ </p>
|
|
|
|
+ <el-upload :limit="1" :headers="ATOKEN" ref="upload1" :action="integralUpload" :on-success="handlePictureCardPreview" :before-upload="beforeFilesUpload">
|
|
|
|
+ <p>
|
|
|
|
+ 3、上传填写好的员工信息表
|
|
|
|
+ <el-button type="primary" plain>选择文件</el-button>
|
|
|
|
+ </p>
|
|
|
|
+ </el-upload>
|
|
|
|
+ <p>4、选择文件后点击下方【上传】按钮</p>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="align-center" style="margin-bottom:20px; float:left; margin-left:10px;"></div>
|
|
|
|
+ <div class="align-center" style="margin-bottom:20px; float:left; margin-left:10px;"><!-- <el-button type="primary" @click="downloadSheet">Excel导出</el-button> --></div>
|
|
|
|
+ <div style="clear:both;"></div>
|
|
|
|
+ </div>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="close_import">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="uploadFile(1)" :loading="update_btn" plain>上传</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 导出员工 -->
|
|
|
|
+ <el-dialog title="导出/修改员工信息" width="600px" :visible.sync="exportEmploye" :close-on-click-modal="false" :before-close="close_export">
|
|
|
|
+ <div style="float: left;width:49%">
|
|
|
|
+ <div style="margin-left: 20%;">
|
|
|
|
+ <p>1.导出员工信息</p>
|
|
|
|
+ <el-button type="primary" plain @click="downloadSheet">导出</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div style="border-left: 1px solid #D8D8D8;width: 1px;height: 255px;float: left;"></div>
|
|
|
|
+
|
|
|
|
+ <div style="float: left;width:49%;">
|
|
|
|
+ <div style="margin-left: 20%;">
|
|
|
|
+ <p>2.修改员工信息</p>
|
|
|
|
+ <p>导出员工信息表进行修改</p>
|
|
|
|
+ <p>上传修改好的员工信息表</p>
|
|
|
|
+
|
|
|
|
+ <el-upload :limit="1" :headers="ATOKEN" ref="upload2" :action="integralUpload" :on-success="handlePictureCardPreview" :before-upload="beforeFilesUpload">
|
|
|
|
+ <p><el-button type="primary" plain>选择文件</el-button></p>
|
|
|
|
+ </el-upload>
|
|
|
|
+ <p>先选择文件后再完成上传</p>
|
|
|
|
+ <el-button type="primary" @click="uploadFile(2)" :loading="update_btn" plain>上传</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="align-center" style="margin-bottom:20px; float:left; margin-left:10px;"></div>
|
|
|
|
+ <div class="align-center" style="margin-bottom:20px; float:left; margin-left:10px;"></div>
|
|
|
|
+ <div style="clear:both;"></div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 添加员工 -->
|
|
|
|
+ <el-dialog :close-on-click-modal="false" ref="EditInformation_list" :title="title" width="500px" :before-close="detailFormreturn" :visible.sync="dialogTableVisible">
|
|
|
|
+ <div>
|
|
|
|
+ <EmploeAdd :managerId="managerId" :dialogTableVisibleNone="dialogTableVisibleNone" ref="EditInformation" @closeDetai="detailFormreturn" @refresh="refresh"></EmploeAdd>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 新增部门 -->
|
|
|
|
+ <el-dialog title="添加部门" width="500px" :visible.sync="dialogCreateVisible" :close-on-click-modal="false" @close="onDismissCreateDialog">
|
|
|
|
+ <el-form ref="newDeptForm" :model="newDeptForm" :rules="rules" @submit.native.prevent style="padding-right:20px;">
|
|
|
|
+ <el-form-item label="部门名称" prop="name" :label-width="formLabelWidth">
|
|
|
|
+ <el-input v-model="newDeptForm.name" placeholder="请输入部门名称" maxlength="15" show-word-limit auto-complete="off"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="上级部门" :label-width="formLabelWidth">
|
|
|
|
+ <el-input auto-complete="off" v-model="name" placeholder="请选择上级部门 (选填)"></el-input>
|
|
|
|
+ <div @click="show_dept_selector = true" style=" position: absolute; top: 0; right: 0; left: 0; bottom: 0; z-index: 9;"></div>
|
|
|
|
+ <EmployeeSelector
|
|
|
|
+ :employee_not_select="employee_not_select"
|
|
|
|
+ :can_select_employee="false"
|
|
|
|
+ :can_select_dept="true"
|
|
|
|
+ :dept_multi="false"
|
|
|
|
+ :dept_children="false"
|
|
|
|
+ :selected="dept_selected"
|
|
|
|
+ :visible.sync="show_dept_selector"
|
|
|
|
+ title="选择部门"
|
|
|
|
+ @confirm="move_confirm"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="colseCreateForm">取 消</el-button>
|
|
|
|
+ <el-button type="primary" :loading="add_dept_loading" @click="submitCreateForm('newDeptForm')">确 定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 编辑部门 -->
|
|
|
|
+ <el-dialog title="编辑部门" width="500px" :visible.sync="dialogEditVisible" :close-on-click-modal="false" @close="onDismissEditDialog">
|
|
|
|
+ <el-form v-loading="get_dept_loading" ref="deptForm" :model="deptForm" :rules="rules" @submit.native.prevent style="padding-right:20px;">
|
|
|
|
+ <el-form-item label="部门名称" prop="name" :label-width="formLabelWidth">
|
|
|
|
+ <el-input v-model="deptForm.name" auto-complete="off" placeholder="请输入部门名称" maxlength="15" show-word-limit></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="上级部门" :label-width="formLabelWidth">
|
|
|
|
+ <el-input auto-complete="off" v-model="name" placeholder="请选择上级部门"></el-input>
|
|
|
|
+ <div @click="show_dept_selector = true" style=" position: absolute; top: 0; right: 0; left: 0; bottom: 0; z-index: 9;"></div>
|
|
|
|
+ <EmployeeSelector
|
|
|
|
+ :employee_not_select="employee_not_select"
|
|
|
|
+ :can_select_employee="false"
|
|
|
|
+ :can_select_dept="true"
|
|
|
|
+ :dept_children="false"
|
|
|
|
+ :dept_multi="false"
|
|
|
|
+ :selected="dept_selected"
|
|
|
|
+ :visible.sync="show_dept_selector"
|
|
|
|
+ title="选择部门"
|
|
|
|
+ @confirm="move_confirm"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="danger" @click="deleteD" plain>删除部门</el-button>
|
|
|
|
+ <el-button @click="delteManger">取 消</el-button>
|
|
|
|
+ <el-button type="primary" :loading="add_dept_loading" @click="submitEditForm('deptForm')">确 定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <el-dialog title="导入结果" :visible.sync="error_list_show" :append-to-body="true" @close="error_list_SX" width="700px" :close-on-click-modal="false">
|
|
|
|
+ <el-table :data="error_list">
|
|
|
|
+ <el-table-column prop="line" label="行数">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div>第{{ scope.row.line }}行</div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="errors" label="备注信息"></el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 设置主管 -->
|
|
|
|
+ <EmployeeSelector
|
|
|
|
+ :multi="false"
|
|
|
|
+ :deptId="filter.dept_id"
|
|
|
|
+ :isChecKedAll="false"
|
|
|
|
+ :child="false"
|
|
|
|
+ title="设置管理员"
|
|
|
|
+ :visible.sync="show_employee_selector"
|
|
|
|
+ @confirm="move_employee_confirm"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ <!-- 选择岗位 -->
|
|
|
|
+ <el-dialog title="选择岗位" :visible.sync="isShowRule" class="fromNormGain_sty" top="12vh" width="1000px" append-to-body>
|
|
|
|
+ <div class="flex-box">
|
|
|
|
+ <div class="flex-2 kh-left">
|
|
|
|
+ <ul class="scroll-bar ul" v-if="tabs.length > 0" style="height: 440px;overflow: auto;">
|
|
|
|
+ <li class="flex-box-ce li" v-for="(item, index) in tabs" :key="index" :class="[tabItem.id == item.id ? 'isActiveLi' : '']" @click="activeLi(item, index)">
|
|
|
|
+ <div class="index-name font-flex-word"><i class="el-icon-s-help" v-if="item.id==-1"></i> {{ item.name }}</div>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="flex-4">
|
|
|
|
+ <el-input style="width: 200px;" size="small" maxlength="100" show-word-limit v-model="postName" clearable placeholder="搜索"/>
|
|
|
|
+ <div class="table-box">
|
|
|
|
+ <el-table :data="list" stripe fit v-loading="table_loading" style="cursor: pointer;" @row-click="clickdatail">
|
|
|
|
+ <el-table-column width="40" fixed>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div style="width: 40px;text-align: center;position: relative;">
|
|
|
|
+ <el-checkbox v-model="scope.row.checked"></el-checkbox>
|
|
|
|
+ <div style="width: 40px;height: 40px;position: absolute;top: -10px;z-index: 999;"></div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="岗位名称" prop="name"></el-table-column>
|
|
|
|
+ <el-table-column label="岗位职责" prop="desc_1" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <template slot="empty">
|
|
|
|
+ <NoData></NoData>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table>
|
|
|
|
+ <center>
|
|
|
|
+ <el-pagination
|
|
|
|
+ small
|
|
|
|
+ :page-size="page_size"
|
|
|
|
+ :current-page="page"
|
|
|
|
+ layout="prev, pager, next"
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
+ :total="total">
|
|
|
|
+ </el-pagination>
|
|
|
|
+ </center>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <div class="mainEl" style="border-left: 1px solid #f1f1f1;width: 240px;padding: 10px;">
|
|
|
|
+ <div class="mainHead flex-box flex-d-center" v-if="selectItem.length > 0">
|
|
|
|
+ <span>已选择{{ selectItem.length }}个</span>
|
|
|
|
+ <span @click="Empty">清空</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="mainTag">
|
|
|
|
+ <el-tag v-for="(item, index) in selectItem" :key="index" closable :disable-transitions="true" @close="TagClose(item, index)">{{ item.name }}</el-tag>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <span slot="footer">
|
|
|
|
+ <el-button @click="isShowRule=false">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="ruleConfirm">确认</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 离职人员列表 -->
|
|
|
|
+ <el-dialog title="离职人员列表" :visible.sync="isShowDelete" top="5vh" width="800px">
|
|
|
|
+ <el-table :data="deleteUserList" style="max-height: 600px;overflow-y: scroll;">
|
|
|
|
+ <el-table-column prop="name" label="姓名">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div class="flex-box-ce">
|
|
|
|
+ <userImage :id="scope.row.id" :user_name="scope.row.name" :img_url="scope.row.img_url" fontSize="16" width="50px" height="50px"></userImage>
|
|
|
|
+ <span style="margin-left: 10px; line-height: 50px; display: inline-block;">{{ scope.row.name }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="dept_list" label="部门">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <template v-if="scope.row.employee_detail.dept_list.length > 0">
|
|
|
|
+ <span v-for="(item, index) in scope.row.employee_detail.dept_list" :key="index">
|
|
|
|
+ {{ item.dept_name }}
|
|
|
|
+ <span v-if="scope.row.employee_detail.dept_list.length - index > 1">,</span>
|
|
|
|
+ </span>
|
|
|
|
+ </template>
|
|
|
|
+ <span v-else>--</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="tel" label="电话"></el-table-column>
|
|
|
|
+ <el-table-column prop="post" label="岗位">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{scope.row.post||'--'}}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="操作" width="80">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button size="small" plain type="danger" @click="delteOpert(scope.row.id)">删除</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <template slot="empty"><NoData></NoData></template>
|
|
|
|
+ </el-table>
|
|
|
|
+ <center>
|
|
|
|
+ <el-pagination
|
|
|
|
+ :current-page.sync="delete_page"
|
|
|
|
+ :page-sizes="[10]"
|
|
|
|
+ layout="total,prev,pager,next"
|
|
|
|
+ :total="delete_total"
|
|
|
|
+ @size-change="handleSizeChange2"
|
|
|
|
+ @current-change="handleCurrentChange2"
|
|
|
|
+ :page-size="delete_page_size">
|
|
|
|
+ </el-pagination>
|
|
|
|
+ </center>
|
|
|
|
+ <span slot="footer">
|
|
|
|
+ <el-button @click="isShowDelete=false">关 闭</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+import EmploeAdd from '@/components/organization/EmploeAdd';
|
|
|
|
+import EmployeeSelector from '@/components/EmployeeSelector';
|
|
|
|
+import qs from 'qs';
|
|
|
|
+import {_debounce} from '@/utils/auth';
|
|
|
|
+export default {
|
|
|
|
+ components: {
|
|
|
|
+ EmploeAdd,
|
|
|
|
+ EmployeeSelector
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ selectedByDefault: {},
|
|
|
|
+ integralUpload: this.$serverdomain + '/api/pro/upload/excel',
|
|
|
|
+ dialogTableVisibleNone: false, //是否显示 员工标识
|
|
|
|
+
|
|
|
|
+ get_dept_loading: false,
|
|
|
|
+ titleManger: false,
|
|
|
|
+ nowEmploye: 0,
|
|
|
|
+ ATOKEN: { 'A-TOKEN': this.$getToken() },
|
|
|
|
+ file: '', // 文件地址
|
|
|
|
+
|
|
|
|
+ title: '添加员工',
|
|
|
|
+ managerId: 0, // 员工id
|
|
|
|
+ firstCompany: {},
|
|
|
|
+ supermanger: {}, //管理者列表
|
|
|
|
+ company: {},
|
|
|
|
+ pid: '',
|
|
|
|
+ name: '',
|
|
|
|
+ manager: '',
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ treedata: [], // 菜单栏数组
|
|
|
|
+ exportEmploye: false, // 导出员工信息
|
|
|
|
+
|
|
|
|
+ rules: {
|
|
|
|
+ name: [{ required: true, message: '请输入名称'}, { min: 1, max: 15, message: '长度在 1 到 15 个字符'}]
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ defaultExpand: false,
|
|
|
|
+
|
|
|
|
+ show3: false,
|
|
|
|
+ textTip: '选择部门进行筛选',
|
|
|
|
+ loading: false,
|
|
|
|
+
|
|
|
|
+ dialogTableVisible: false,
|
|
|
|
+ filter: {
|
|
|
|
+ dept_id: 0,
|
|
|
|
+ keywords: ''
|
|
|
|
+ },
|
|
|
|
+ totalCount: 0,
|
|
|
|
+ pageLimit: 10,
|
|
|
|
+ currentPage: 1, // 不缓存页面,因为el-pagination此处有一个bug,规定页面从0开始
|
|
|
|
+ tableData: null,
|
|
|
|
+ multipleSelection: [],
|
|
|
|
+ dialogExcelVisible: false,
|
|
|
|
+ deptTree: [],
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ defaultProps: {
|
|
|
|
+ children: 'children',
|
|
|
|
+ label: 'label'
|
|
|
|
+ },
|
|
|
|
+ formLabelWidth: '100px',
|
|
|
|
+
|
|
|
|
+ dialogCreateVisible: false, // 新增部门
|
|
|
|
+ dialogEditVisible: false, // 编辑部门
|
|
|
|
+ // 新增部门
|
|
|
|
+ newDeptForm: {
|
|
|
|
+ name: '',
|
|
|
|
+ pid: ''
|
|
|
|
+ },
|
|
|
|
+ // 编辑部门
|
|
|
|
+ deptForm: {
|
|
|
|
+ name: '',
|
|
|
|
+ pid: ''
|
|
|
|
+ },
|
|
|
|
+ add_dept_loading: false,
|
|
|
|
+
|
|
|
|
+ error_list_show: false,
|
|
|
|
+ error_list: [],
|
|
|
|
+ dept_show: false,
|
|
|
|
+ update_btn: false,
|
|
|
|
+ selected: [],
|
|
|
|
+
|
|
|
|
+ employee_not_select: [],
|
|
|
|
+ show_dept_selector: false,
|
|
|
|
+ show_employee_selector: false,
|
|
|
|
+ dept_selected: { employee: [], dept: [] },
|
|
|
|
+ manager_selected: { employee: [], dept: [] },
|
|
|
|
+ tips_show: false,
|
|
|
|
+ set_btn: false,
|
|
|
|
+
|
|
|
|
+ options: [
|
|
|
|
+ // {
|
|
|
|
+ // value: '-1',
|
|
|
|
+ // label: '全部'
|
|
|
|
+ // },
|
|
|
|
+ {
|
|
|
|
+ value: '1',
|
|
|
|
+ label: '在职'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: '0',
|
|
|
|
+ label: '待加入'
|
|
|
|
+ },
|
|
|
|
+ // {
|
|
|
|
+ // value: '2',
|
|
|
|
+ // label: '离职'
|
|
|
|
+ // },
|
|
|
|
+ {
|
|
|
|
+ value: '3',
|
|
|
|
+ label: '再次邀请'
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ status: '1',
|
|
|
|
+ account_id:false,
|
|
|
|
+
|
|
|
|
+ total: 0,
|
|
|
|
+ page: 1,
|
|
|
|
+ page_size: 7,
|
|
|
|
+ tabItem:{name:'销售'},
|
|
|
|
+ tabs:[{name:'全部分类',id:-1}],
|
|
|
|
+ table_loading:false,
|
|
|
|
+ list:[],
|
|
|
|
+ isShowRule:false,
|
|
|
|
+ selectItem:[],
|
|
|
|
+ selectId:'',
|
|
|
|
+ postName:'',
|
|
|
|
+
|
|
|
|
+ deleteLoading:false,
|
|
|
|
+ deleteUserList:[],
|
|
|
|
+ isShowDelete:false,
|
|
|
|
+ delete_total: 0,
|
|
|
|
+ delete_page: 1,
|
|
|
|
+ delete_page_size: 10,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ 'filter.keywords': _debounce(function(val) {
|
|
|
|
+ this.onFilterChanged();
|
|
|
|
+ }),
|
|
|
|
+
|
|
|
|
+ isShowDelete(val){
|
|
|
|
+ if(val){
|
|
|
|
+ this.delete_page=1;
|
|
|
|
+ this.getDeleteUserList();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ postName: {
|
|
|
|
+ deep: true,
|
|
|
|
+ handler: _debounce(function(val) {
|
|
|
|
+ this.page=1;
|
|
|
|
+ this.page_size=7;
|
|
|
|
+ this.getTableData();
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ status(val) {
|
|
|
|
+ this.currentPage = 1;
|
|
|
|
+ this.loadEmployeeList();
|
|
|
|
+ },
|
|
|
|
+ account_id(val){
|
|
|
|
+ if(val){
|
|
|
|
+ this.status='1';
|
|
|
|
+ this.currentPage = 1;
|
|
|
|
+ this.loadEmployeeList();
|
|
|
|
+ }else{
|
|
|
|
+ this.loadEmployeeList();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ // 获取员工列表
|
|
|
|
+ getDeleteUserList() {
|
|
|
|
+ this.deleteLoading = true;
|
|
|
|
+ let params = {
|
|
|
|
+ page: this.delete_page,
|
|
|
|
+ page_size: this.delete_page_size,
|
|
|
|
+ status: 2
|
|
|
|
+ };
|
|
|
|
+ this.$axiosUser('get', '/api/pro/employee/index', params, 'v2').then((res)=> {
|
|
|
|
+ this.delete_total = res.data.data.total;
|
|
|
|
+ this.deleteUserList = res.data.data.list;
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ this.deleteLoading = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 删除员工
|
|
|
|
+ delteOpert(id) {
|
|
|
|
+ this.$confirm('删除员工后,此员工的相关数据将被清空,请确认系统中的数据和操作执行人转交完毕后再进行删除操作?', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.$axiosUser('post', '' + '/api/pro/employee/delete?id=' + id).then(res => {
|
|
|
|
+ this.$message({message: '删除成功',type: 'success'});
|
|
|
|
+ this.getDeleteUserList();
|
|
|
|
+ });
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ },
|
|
|
|
+ openPost(item){
|
|
|
|
+ this.selectItem=JSON.parse(JSON.stringify(item.post_info));
|
|
|
|
+ this.selectId=item.id;
|
|
|
|
+ this.postName="";
|
|
|
|
+ this.isShowRule=true;
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ TagClose(item, index) {
|
|
|
|
+ //清除右侧tag
|
|
|
|
+ this.selectItem.splice(index, 1);
|
|
|
|
+ },
|
|
|
|
+ Empty() {
|
|
|
|
+ this.selectItem = [];
|
|
|
|
+ this.list.forEach(item=>{
|
|
|
|
+ item.checked=false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ clickdatail(item){
|
|
|
|
+ item.checked=!item.checked;
|
|
|
|
+ if(item.checked){
|
|
|
|
+ this.selectItem.push(item);
|
|
|
|
+ }else{
|
|
|
|
+ this.selectItem.forEach((e, index) => {
|
|
|
|
+ if (e.id == item.id) {
|
|
|
|
+ this.selectItem.splice(index, 1);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ activeLi(item, index) {
|
|
|
|
+ this.tabItem = JSON.parse(JSON.stringify(item));
|
|
|
|
+ this.page=1;
|
|
|
|
+ this.page_size=7;
|
|
|
|
+ this.getTableData();
|
|
|
|
+ },
|
|
|
|
+ getList() {
|
|
|
|
+ this.tabs=[{name:'全部分类',id:-1}];
|
|
|
|
+ this.$axiosUser('get', '/api/pro/post/post_cate_list').then(res => {
|
|
|
|
+ this.tabs.push(...res.data.data)
|
|
|
|
+ this.tabItem = JSON.parse(JSON.stringify(this.tabs[0]));
|
|
|
|
+ this.getTableData();
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getTableData() {
|
|
|
|
+ this.table_loading=true;
|
|
|
|
+ let data={
|
|
|
|
+ page:this.page,
|
|
|
|
+ page_size:this.page_size,
|
|
|
|
+ cate_id:this.tabItem.id,
|
|
|
|
+ name:this.postName
|
|
|
|
+ }
|
|
|
|
+ this.$axiosUser('get', '/api/pro/post/cate_post_list',data).then(res => {
|
|
|
|
+ let list=res.data.data.list;
|
|
|
|
+ let selectItem=this.selectItem;
|
|
|
|
+ list.forEach(item=>{
|
|
|
|
+ item.checked=false
|
|
|
|
+ for (var i in selectItem) {
|
|
|
|
+ if (selectItem[i].id == item.id) {
|
|
|
|
+ item.checked = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.list=list;
|
|
|
|
+ this.total=res.data.data.total
|
|
|
|
+ }).finally(()=>{
|
|
|
|
+ this.table_loading=false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ ruleConfirm(){
|
|
|
|
+ if(this.selectItem.length>3){
|
|
|
|
+ this.$message.warning('关联岗位数量不能超过3个');
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ let post_ids=this.selectItem.map(e=>{
|
|
|
|
+ return e.id
|
|
|
|
+ })
|
|
|
|
+ let data={
|
|
|
|
+ employee_id:this.selectId,
|
|
|
|
+ post_ids:JSON.stringify(post_ids)
|
|
|
|
+ }
|
|
|
|
+ this.$axiosUser('post', '/api/pro/post/bind_post',data).then(res => {
|
|
|
|
+ this.$message.success('已编辑');
|
|
|
|
+ this.loadEmployeeList();
|
|
|
|
+ this.isShowRule=false;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleSizeChange2(val) {
|
|
|
|
+ this.delete_page=1;
|
|
|
|
+ this.delete_page_size = val;
|
|
|
|
+ this.getDeleteUserList()
|
|
|
|
+ },
|
|
|
|
+ // 页面跳转
|
|
|
|
+ handleCurrentChange2(val) {
|
|
|
|
+ this.delete_page = val;
|
|
|
|
+ this.getDeleteUserList()
|
|
|
|
+ },
|
|
|
|
+ // 页面变更
|
|
|
|
+ handleCurrentChange(val) {
|
|
|
|
+ this.page = val;
|
|
|
|
+ this.getTableData();
|
|
|
|
+ },
|
|
|
|
+ // 页面跳转
|
|
|
|
+ handleSizeChange(val) {
|
|
|
|
+ this.page_size = val;
|
|
|
|
+ this.getTableData();
|
|
|
|
+ },
|
|
|
|
+ //添加管理者
|
|
|
|
+ move_employee_confirm(data) {
|
|
|
|
+ var that = this;
|
|
|
|
+ that.$axiosUser('POST', '/api/pro/department/manage/add', { employee_id: data.employee[0].id, dept_id: that.filter.dept_id }).then(res => {
|
|
|
|
+ if (res.data.code == 1) {
|
|
|
|
+ that.$message.success('添加成功');
|
|
|
|
+ that.loadEmployeeList();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //删除管理者
|
|
|
|
+ deleteEmployee(tag) {
|
|
|
|
+ var that = this;
|
|
|
|
+ this.$confirm('是否删除该管理者?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ var data = {
|
|
|
|
+ employee_id: tag.id,
|
|
|
|
+ dept_id: that.filter.dept_id
|
|
|
|
+ };
|
|
|
|
+ that.$axiosUser('DELETE', '/api/pro/department/manage', data).then(res => {
|
|
|
|
+ if (res.data.code == 1) {
|
|
|
|
+ that.$message.success('删除成功');
|
|
|
|
+ that.loadEmployeeList();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {});
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //再次邀请
|
|
|
|
+ againInvite(item) {
|
|
|
|
+ let site_id = this.$getCache('site_info').id;
|
|
|
|
+ this.$axiosUser('post', '/api/pro/invite/again', { site_id: site_id, employee_id: item.id }).then(res => {
|
|
|
|
+ if (res.data.code == 1) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.data.msg,
|
|
|
|
+ type: 'success'
|
|
|
|
+ });
|
|
|
|
+ this.loadEmployeeList();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //添加部门点击
|
|
|
|
+ addTheDepartment() {
|
|
|
|
+ this.name = '';
|
|
|
|
+ this.manager = '';
|
|
|
|
+ this.manager_selected = { employee: [], dept: [] };
|
|
|
|
+ if (this.selectedByDefault.id) {
|
|
|
|
+ //默认上级未目前所选择的部门
|
|
|
|
+ this.name = this.selectedByDefault.name;
|
|
|
|
+ this.newDeptForm.pid = this.selectedByDefault.id;
|
|
|
|
+ this.dept_selected.dept = [{ dept_name: this.selectedByDefault.name, dept_id: this.selectedByDefault.id }];
|
|
|
|
+ } else {
|
|
|
|
+ this.dept_selected = { employee: [], dept: [] };
|
|
|
|
+ }
|
|
|
|
+ this.dialogCreateVisible = true;
|
|
|
|
+ },
|
|
|
|
+ tips_close() {
|
|
|
|
+ this.$setCache('employee_table_tips', 'true');
|
|
|
|
+ this.tips_show = false;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 递归判断列表,把最后的children设为undefined
|
|
|
|
+ getTreeData(data) {
|
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
|
+ if (data[i].children.length < 1) {
|
|
|
|
+ data[i].children = undefined;
|
|
|
|
+ } else {
|
|
|
|
+ this.getTreeData(data[i].children);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return data;
|
|
|
|
+ },
|
|
|
|
+ move_confirm(data) {
|
|
|
|
+ if (data.dept !== null && data.dept.length != 0) {
|
|
|
|
+ this.name = data.dept[0].dept_name;
|
|
|
|
+ this.newDeptForm.pid = data.dept[0].dept_id;
|
|
|
|
+ this.deptForm.pid = data.dept[0].dept_id;
|
|
|
|
+ this.dept_selected.dept = [{ dept_name: data.dept[0].dept_name, dept_id: data.dept[0].dept_id }];
|
|
|
|
+ } else {
|
|
|
|
+ this.name = '';
|
|
|
|
+ this.deptForm.pid = 0;
|
|
|
|
+ this.newDeptForm.pid=0;
|
|
|
|
+ this.dept_selected = { employee: [], dept: [] };
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 关闭上传窗口
|
|
|
|
+ remove(file, fileList) {},
|
|
|
|
+
|
|
|
|
+ // 新成员列表
|
|
|
|
+ new_employee() {
|
|
|
|
+ this.$router.push('/new_employee');
|
|
|
|
+ },
|
|
|
|
+ // 关闭导入
|
|
|
|
+ close_import() {
|
|
|
|
+ this.dialogExcelVisible = false;
|
|
|
|
+ this.$refs.upload1.clearFiles();
|
|
|
|
+ this.file = '';
|
|
|
|
+ },
|
|
|
|
+ // 关闭导出
|
|
|
|
+ close_export() {
|
|
|
|
+ this.exportEmploye = false;
|
|
|
|
+ this.$refs.upload2.clearFiles();
|
|
|
|
+ this.file = '';
|
|
|
|
+ },
|
|
|
|
+ //关闭错误信息时的回调
|
|
|
|
+ error_list_SX() {
|
|
|
|
+ this.set_btn = false;
|
|
|
|
+ this.loadBaseData();
|
|
|
|
+ this.loadEmployeeList();
|
|
|
|
+ },
|
|
|
|
+ // 导入 新增
|
|
|
|
+ uploadFile: function(type) {
|
|
|
|
+ let params = {};
|
|
|
|
+ params.type = type;
|
|
|
|
+ params.file = this.file;
|
|
|
|
+ this.update_btn = true;
|
|
|
|
+ this.$axiosUser('post', '/api/pro/employee/import', params).then(res => {
|
|
|
|
+ if (res.data.code == 1) {
|
|
|
|
+ if (type == 1) {
|
|
|
|
+ this.close_import();
|
|
|
|
+ } else if (type == 2) {
|
|
|
|
+ this.close_export();
|
|
|
|
+ }
|
|
|
|
+ this.$message.success({
|
|
|
|
+ type: '上传成功',
|
|
|
|
+ message: res.data.msg
|
|
|
|
+ });
|
|
|
|
+ if (res.data.data.length != 0 && res.data.data.length != undefined) {
|
|
|
|
+ this.error_list_show = true;
|
|
|
|
+ this.error_list = res.data.data;
|
|
|
|
+ } else {
|
|
|
|
+ this.set_btn = false;
|
|
|
|
+ this.loadBaseData();
|
|
|
|
+ this.loadEmployeeList();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.update_btn = false;
|
|
|
|
+ }, 3000);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ handlePictureCardPreview(response) {
|
|
|
|
+ if (response.code == 1) {
|
|
|
|
+ this.file = response.data;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ beforeFilesUpload(file) {
|
|
|
|
+ const $ext_list = ['xlsx', 'xls', 'XLSX', 'XLS'];
|
|
|
|
+ let len = file.name.split('.').length - 1;
|
|
|
|
+ const $ext_name = file.name.split('.')[len];
|
|
|
|
+ if ($ext_list.indexOf($ext_name) != -1) {
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.warning('文件格式上传错误,仅支持上传xlsx,xls)');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 获取回传的上级部门id
|
|
|
|
+ check(val) {
|
|
|
|
+ if (this.firstCompany.name == val[0].label) {
|
|
|
|
+ this.newDeptForm.pid = 0;
|
|
|
|
+ this.deptForm.pid = 0;
|
|
|
|
+ } else {
|
|
|
|
+ this.newDeptForm.pid = val[0].id;
|
|
|
|
+ this.deptForm.pid = val[0].id;
|
|
|
|
+ }
|
|
|
|
+ this.name = val[0].label; // 部门名称
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ refresh() {
|
|
|
|
+ this.loadEmployeeList();
|
|
|
|
+ },
|
|
|
|
+ // 删除部门
|
|
|
|
+ deleteD() {
|
|
|
|
+ this.$confirm('确定要删除此部门吗?', '删除部门', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.deleteDepart();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 折叠菜单栏
|
|
|
|
+ setCheckedKeys() {
|
|
|
|
+ this.defaultExpand = false;
|
|
|
|
+ for (var i = 0; i < this.$refs.menum.store._getAllNodes().length; i++) {
|
|
|
|
+ this.$refs.menum.store._getAllNodes()[i].expanded = false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleNodeClick(data) {
|
|
|
|
+
|
|
|
|
+ if (data.value == 0) {
|
|
|
|
+ this.company = this.firstCompany;
|
|
|
|
+ this.selectedByDefault = {};
|
|
|
|
+ this.filter.dept_id = 0;
|
|
|
|
+ this.set_btn = false;
|
|
|
|
+ this.setCheckedKeys();
|
|
|
|
+ this.$refs.menum.setCheckedKeys([]);
|
|
|
|
+ } else {
|
|
|
|
+ this.selectedByDefault = data;
|
|
|
|
+ this.set_btn = true;
|
|
|
|
+ this.company = data;
|
|
|
|
+ this.filter.dept_id = data.id;
|
|
|
|
+ }
|
|
|
|
+ this.status = '1';
|
|
|
|
+ this.onFilterChanged();
|
|
|
|
+ this.showpull = false;
|
|
|
|
+ },
|
|
|
|
+ // 节点展开
|
|
|
|
+ treeOpen() {
|
|
|
|
+ let that = this;
|
|
|
|
+ setTimeout(function() {
|
|
|
|
+ that.getHeight();
|
|
|
|
+ }, 500);
|
|
|
|
+ },
|
|
|
|
+ onDismissCreateDialog: function() {
|
|
|
|
+ //更新树形图
|
|
|
|
+ var form = this.$refs['newDeptForm'];
|
|
|
|
+ form.clearValidate();
|
|
|
|
+ this.newDeptForm = {
|
|
|
|
+ name: '',
|
|
|
|
+ pid: []
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ // 关闭编辑弹框
|
|
|
|
+ onDismissEditDialog: function() {
|
|
|
|
+ var form = this.$refs['deptForm'];
|
|
|
|
+ form.clearValidate();
|
|
|
|
+ this.deptForm = {
|
|
|
|
+ id: '',
|
|
|
|
+ name: '',
|
|
|
|
+ pid: []
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ // 删除部门
|
|
|
|
+ deleteDepart() {
|
|
|
|
+ let self = this;
|
|
|
|
+ let id = this.company.id;
|
|
|
|
+ this.$axiosUser('post', '/api/pro/department/delete', { id: id }, 'v2').then(res => {
|
|
|
|
+ if (res.data.code == 1) {
|
|
|
|
+ localStorage.removeItem('dept_tree');
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '删除成功',
|
|
|
|
+ type: 'success'
|
|
|
|
+ });
|
|
|
|
+ self.dialogEditVisible = false;
|
|
|
|
+ self.wipe_data();
|
|
|
|
+ self.setCheckedKeys();
|
|
|
|
+ self.loadReftList();
|
|
|
|
+ self.loadBaseData();
|
|
|
|
+ this.set_btn = false;
|
|
|
|
+ this.company.name = this.firstCompany.name;
|
|
|
|
+ this.filter.dept_id = 0;
|
|
|
|
+ this.selectedByDefault = {};
|
|
|
|
+ self.loadEmployeeList();
|
|
|
|
+ } else {
|
|
|
|
+ self.$message({
|
|
|
|
+ message: res.data.msg,
|
|
|
|
+ type: 'error'
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 关闭编辑部门的弹框
|
|
|
|
+ delteManger() {
|
|
|
|
+ let self = this;
|
|
|
|
+ self.dialogEditVisible = false;
|
|
|
|
+ self.name = '';
|
|
|
|
+ self.manager = '';
|
|
|
|
+ },
|
|
|
|
+ // 编辑部门
|
|
|
|
+ submitEditForm: function(formName) {
|
|
|
|
+ var form = this.$refs[formName];
|
|
|
|
+ var self = this;
|
|
|
|
+ form.validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ if (form) {
|
|
|
|
+ self.sendEditRequest(form);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 编辑部门方法
|
|
|
|
+ sendEditRequest: function() {
|
|
|
|
+ var self = this;
|
|
|
|
+ self.add_dept_loading = true;
|
|
|
|
+ let id = this.company.id;
|
|
|
|
+ if (this.deptForm.pid == '') {
|
|
|
|
+ this.deptForm.pid = 0;
|
|
|
|
+ }
|
|
|
|
+ this.deptForm.id = id;
|
|
|
|
+ this.$axiosUser('post', '/api/pro/department/update', this.deptForm, 'v2')
|
|
|
|
+ .then(function(res) {
|
|
|
|
+ if (res.data.code == 1) {
|
|
|
|
+ self.filter.dept_id = 0;
|
|
|
|
+ localStorage.removeItem('dept_tree');
|
|
|
|
+ self.loadEmployeeList();
|
|
|
|
+ self.loadBaseData();
|
|
|
|
+ self.dialogEditVisible = false;
|
|
|
|
+ self.$message({
|
|
|
|
+ message: '编辑成功',
|
|
|
|
+ type: 'success'
|
|
|
|
+ });
|
|
|
|
+ self.wipe_data();
|
|
|
|
+ self.handleNodeClick({ value: 0 });
|
|
|
|
+ } else {
|
|
|
|
+ self.$message({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: res.data.msg
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ self.add_dept_loading = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 新增部门
|
|
|
|
+ sendCreateRequest: function() {
|
|
|
|
+ this.add_dept_loading = true;
|
|
|
|
+ if (this.newDeptForm.pid == '') {
|
|
|
|
+ this.newDeptForm.pid = 0;
|
|
|
|
+ }
|
|
|
|
+ this.$axiosUser('post', '/api/pro/department/create', this.newDeptForm, 'v2').then((res)=> {
|
|
|
|
+ localStorage.removeItem('dept_tree');
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '新建部门成功',
|
|
|
|
+ type: 'success'
|
|
|
|
+ });
|
|
|
|
+ this.filter.dept_id = 0;
|
|
|
|
+ this.company.name = this.firstCompany.name;
|
|
|
|
+ this.currentPage = 1;
|
|
|
|
+ this.set_btn = false;
|
|
|
|
+ this.setCheckedKeys();
|
|
|
|
+ this.loadReftList();
|
|
|
|
+ this.loadBaseData();
|
|
|
|
+ this.dialogCreateVisible = false;
|
|
|
|
+ this.loadEmployeeList();
|
|
|
|
+ this.wipe_data();
|
|
|
|
+ this.$refs.newDeptForm.resetFields();
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ this.add_dept_loading = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 提交表单
|
|
|
|
+ submitCreateForm: function(formName) {
|
|
|
|
+ let form = this.$refs[formName];
|
|
|
|
+ var self = this;
|
|
|
|
+ form.validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ self.sendCreateRequest();
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ colseCreateForm() {
|
|
|
|
+ this.dialogCreateVisible = false;
|
|
|
|
+ this.wipe_data();
|
|
|
|
+ },
|
|
|
|
+ //获取部门列表
|
|
|
|
+ loadReftList: function() {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ var self = this;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ managerType(row, column, cellValue) {
|
|
|
|
+ return row.is_admin == 1 ? '超级管理员' : cellValue;
|
|
|
|
+ },
|
|
|
|
+ handleCheck(target, param) {
|
|
|
|
+ this.textTip = '';
|
|
|
|
+ const textTip = [];
|
|
|
|
+ this.$refs.tree.getCheckedNodes().forEach(item => {
|
|
|
|
+ textTip.push(item.label);
|
|
|
|
+ });
|
|
|
|
+ this.textTip = textTip.join('、');
|
|
|
|
+ if (param.checkedKeys.length == 0) {
|
|
|
|
+ this.textTip = '选择部门进行筛选';
|
|
|
|
+ // this.show3 = false;
|
|
|
|
+ }
|
|
|
|
+ this.filter.dept_id = param.checkedKeys;
|
|
|
|
+ this.onFilterChanged();
|
|
|
|
+ this.show3 = false;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ filterHandler(value) {
|
|
|
|
+ if (typeof value.dept !== 'undefined' && value.dept.length == 0) {
|
|
|
|
+ this.filter.dept_id = 0;
|
|
|
|
+ }
|
|
|
|
+ if (typeof value.dept !== 'undefined' && value.dept.length > 0) {
|
|
|
|
+ this.filter.dept_id = value.dept;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.onFilterChanged();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ EmployeeAdd() {
|
|
|
|
+ this.dialogTableVisible = true;
|
|
|
|
+ this.dialogTableVisibleNone = false;
|
|
|
|
+ this.title = '添加员工';
|
|
|
|
+ const self = this;
|
|
|
|
+ self.managerId = 0;
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ self.$refs['EditInformation'].editMode = false;
|
|
|
|
+ self.$refs['EditInformation'].clearForm();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ handleSizeChange(val) {
|
|
|
|
+ this.pageLimit = val;
|
|
|
|
+ this.onFilterChanged();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ onFilterChanged: function() {
|
|
|
|
+ this.currentPage = 1;
|
|
|
|
+ this.loadEmployeeList();
|
|
|
|
+ },
|
|
|
|
+ checkSelectable(row) {
|
|
|
|
+ return;
|
|
|
|
+ },
|
|
|
|
+ handleSelectionChange: function(val) {
|
|
|
|
+ this.multipleSelection = val;
|
|
|
|
+ },
|
|
|
|
+ isSelectable: function(row, index) {
|
|
|
|
+ return row.status != '1';
|
|
|
|
+ },
|
|
|
|
+ toSexName: function(row, column, cellValue) {
|
|
|
|
+ return cellValue == '1' ? '女' : '男';
|
|
|
|
+ },
|
|
|
|
+ dateFormatter: function(row, column, cellValue) {
|
|
|
|
+ return this.$moment(cellValue * 1000).format('YYYY年MM月DD日');
|
|
|
|
+ },
|
|
|
|
+ // 获取基本数据
|
|
|
|
+ loadBaseData: function() {
|
|
|
|
+ var self = this;
|
|
|
|
+ this.dept_show = true;
|
|
|
|
+ this.$axiosUser('get', '/api/pro/department/tree', '', 'v2')
|
|
|
|
+ .then(function(response) {
|
|
|
|
+ if (response.status == 200) {
|
|
|
|
+ var jsonData = response.data;
|
|
|
|
+ try {
|
|
|
|
+ self.deptTree = self.getTreeData(response.data.data.list);
|
|
|
|
+ self.company = response.data.data.company;
|
|
|
|
+ self.firstCompany = response.data.data.company;
|
|
|
|
+ self.treedata = self.deptTree;
|
|
|
|
+ } catch (err) {}
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ this.dept_show = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 获取员工列表
|
|
|
|
+ loadEmployeeList: function() {
|
|
|
|
+ var self = this;
|
|
|
|
+ self.loading = true;
|
|
|
|
+ let params = {
|
|
|
|
+ page: this.currentPage,
|
|
|
|
+ page_size: this.pageLimit,
|
|
|
|
+ dept_id: this.filter.dept_id,
|
|
|
|
+ keywords: this.filter.keywords,
|
|
|
|
+ status: this.status,
|
|
|
|
+ };
|
|
|
|
+ if (this.status == 1) {
|
|
|
|
+ params.account_id = this.account_id? 1:0;
|
|
|
|
+ }
|
|
|
|
+ this.$axiosUser('get', '/api/pro/employee/index', params, 'v2')
|
|
|
|
+ .then(function(res) {
|
|
|
|
+ if (res.data.code == 1) {
|
|
|
|
+ self.totalCount = res.data.data.total;
|
|
|
|
+ self.nowEmploye = res.data.data.total;
|
|
|
|
+ self.tableData = res.data.data.list;
|
|
|
|
+ self.supermanger = res.data.data.managers;
|
|
|
|
+ if (self.supermanger != undefined && self.supermanger.length > 0 && self.supermanger[0].dept_list == '[]') {
|
|
|
|
+ self.titleManger = true;
|
|
|
|
+ } else {
|
|
|
|
+ self.titleManger = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ self.loading = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ changePage: function(current) {
|
|
|
|
+ this.loadEmployeeList();
|
|
|
|
+ },
|
|
|
|
+ delEmployee: function(employeeId) {
|
|
|
|
+ let self = this;
|
|
|
|
+ self
|
|
|
|
+ .$confirm('确定要删除此员工吗?', '删除员工', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ self
|
|
|
|
+ .$axiosUser('POST', '/api/pro/employee/delete', { id: employeeId })
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res.data.code == 1) {
|
|
|
|
+ self.$message.success(res.data.msg);
|
|
|
|
+ self.loadEmployeeList();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(e => {
|
|
|
|
+ self.$message.error(e.data.msg);
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ self.role_loading = false;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ confirmMultipleDelete: function() {
|
|
|
|
+ if (this.multipleSelection.length < 1) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ this.$confirm('确定要删除选中的员工吗?', '批量删除员工', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ const targetArr = [];
|
|
|
|
+ for (const index in this.multipleSelection) {
|
|
|
|
+ targetArr.push(this.multipleSelection[index].id);
|
|
|
|
+ }
|
|
|
|
+ this.$axiosUser('post', '/api/pro/employee/delete-many', { id: targetArr }).then(res => {
|
|
|
|
+ if (res.data.code == 1) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '批量删除成功'
|
|
|
|
+ });
|
|
|
|
+ this.loadEmployeeList();
|
|
|
|
+ this.multipleSelection = [];
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: res.data.msg
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {});
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ detailFormreturn: function() {
|
|
|
|
+ this.dialogTableVisible = false;
|
|
|
|
+ // this.$refs['EditInformation'].discardBack();
|
|
|
|
+ },
|
|
|
|
+ // 获取部门详情
|
|
|
|
+ openEmploe: function() {
|
|
|
|
+ this.dialogEditVisible = true;
|
|
|
|
+ this.get_dept_loading = true;
|
|
|
|
+ let id = this.company.id;
|
|
|
|
+ this.$axiosUser('get', '/api/pro/department/info', { id: id }, 'v2')
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res.data.code == 1) {
|
|
|
|
+ let data = res.data.data;
|
|
|
|
+ this.deptForm.name = data.name;
|
|
|
|
+ if (data.super_department != null) {
|
|
|
|
+ this.deptForm.pid = data.super_department.id; // 上级部门id
|
|
|
|
+ this.name = data.super_department.name;
|
|
|
|
+ this.dept_selected.dept = [{ name: data.super_department.name, id: data.super_department.id }];
|
|
|
|
+ } else {
|
|
|
|
+ if (data.pid == 0) {
|
|
|
|
+ this.deptForm.pid = 0;
|
|
|
|
+ this.name = this.firstCompany.name;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (data.manager.length > 0) {
|
|
|
|
+ let newmangerId = [];
|
|
|
|
+ let newmanger = [];
|
|
|
|
+ for (let i = 0; i < data.manager.length; i++) {
|
|
|
|
+ newmangerId.push(data.manager[i].id);
|
|
|
|
+ newmanger.push(data.manager[i].name);
|
|
|
|
+ }
|
|
|
|
+ this.manager = newmanger.toString();
|
|
|
|
+ let managerSelecteds = [];
|
|
|
|
+ for (let i in data.manager) {
|
|
|
|
+ managerSelecteds.push({
|
|
|
|
+ name: data.manager[i].name,
|
|
|
|
+ id: data.manager[i].id,
|
|
|
|
+ img_url: data.manager[i].img_url
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ this.manager_selected.employee = managerSelecteds;
|
|
|
|
+ } else {
|
|
|
|
+ this.manager = '';
|
|
|
|
+ this.manager_selected.employee = data.manager;
|
|
|
|
+ }
|
|
|
|
+ if (data.super_department) {
|
|
|
|
+ this.dept_selected.dept = [{ dept_name: data.super_department.name, dept_id: data.super_department.id }];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ this.get_dept_loading = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 编辑员工
|
|
|
|
+ toDetailPage: function(item, column, event) {
|
|
|
|
+ this.managerId = item.id;
|
|
|
|
+ this.title = '编辑员工';
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs['EditInformation'].clearForm();
|
|
|
|
+ this.$refs['EditInformation'].loadEmployeeDetail(item.id);
|
|
|
|
+ this.$refs['EditInformation'].editMode = true;
|
|
|
|
+ });
|
|
|
|
+ // 编辑打开添加员工窗口
|
|
|
|
+ this.dialogTableVisible = true;
|
|
|
|
+ this.dialogTableVisibleNone = true;
|
|
|
|
+ },
|
|
|
|
+ saveStorage: function() {
|
|
|
|
+ const storage = {
|
|
|
|
+ filter: this.filter
|
|
|
|
+ };
|
|
|
|
+ this.$emit('set-storage', storage);
|
|
|
|
+ },
|
|
|
|
+ // 导出员工信息
|
|
|
|
+ downloadSheet: function() {
|
|
|
|
+ let params = {};
|
|
|
|
+ if (this.filter.dept_id != '') {
|
|
|
|
+ params.dept_id = this.filter.dept_id;
|
|
|
|
+ } else if (this.filter.keywords != '') {
|
|
|
|
+ params.keywords = this.filter.keywords;
|
|
|
|
+ }
|
|
|
|
+ this.$axiosUser('get', '/api/pro/employee/export', params).then(res => {
|
|
|
|
+ if (res) {
|
|
|
|
+ if (res.data.code == 1) {
|
|
|
|
+ let path = res.data.data.path;
|
|
|
|
+ window.open(this.$serverdomain + '/api/pro/employee/download?path=' + path + '&type=1');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ getHeight() {},
|
|
|
|
+ wipe_data() {
|
|
|
|
+ this.pid = '';
|
|
|
|
+ this.name = '';
|
|
|
|
+ this.manager = '';
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ let that = this;
|
|
|
|
+ setTimeout(function() {
|
|
|
|
+ that.getHeight();
|
|
|
|
+ }, 500);
|
|
|
|
+ if (this.$getCache('employee_table_tips')) {
|
|
|
|
+ that.tips_show = false;
|
|
|
|
+ } else {
|
|
|
|
+ that.tips_show = true;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ if (this.$route.query.is) {
|
|
|
|
+ this.$router.push({ path: '/new_employee' });
|
|
|
|
+ }
|
|
|
|
+ this.loadBaseData();
|
|
|
|
+ this.loadEmployeeList();
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ document.querySelector('#app').addEventListener('click', () => {
|
|
|
|
+ if (this.show3) {
|
|
|
|
+ this.show3 = false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ beforeDestroy(){
|
|
|
|
+ this.$store.dispatch('get_dept_tree',true).then((res) => {}) // 获取部门树型结构列表
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.selectVal /deep/ .el-input__inner {
|
|
|
|
+ border: none;
|
|
|
|
+}
|
|
|
|
+.selectVal /deep/ .el-select__caret {
|
|
|
|
+ color: #409EFF;
|
|
|
|
+}
|
|
|
|
+.el-tag + .el-tag {
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+}
|
|
|
|
+.name {
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ display: inline-block;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ width: 120px;
|
|
|
|
+}
|
|
|
|
+.administration {
|
|
|
|
+ color: #e6a23c;
|
|
|
|
+ border: 1px solid #e6a23c;
|
|
|
|
+ border-radius: 2px;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ margin-left: 4px;
|
|
|
|
+ padding: 2px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.el-table th > .cell {
|
|
|
|
+ font-weight: normal;
|
|
|
|
+}
|
|
|
|
+.el-table .has-gutter th > .cell {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ color: #909399;
|
|
|
|
+ font-weight: normal;
|
|
|
|
+}
|
|
|
|
+.title {
|
|
|
|
+ color: #303133;
|
|
|
|
+ font-size: 20px;
|
|
|
|
+}
|
|
|
|
+.el-button--text {
|
|
|
|
+ color: #606266;
|
|
|
|
+}
|
|
|
|
+.add {
|
|
|
|
+ color: #409EFF;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+}
|
|
|
|
+.el-pagination {
|
|
|
|
+ text-align: center;
|
|
|
|
+ margin-top: 15px;
|
|
|
|
+}
|
|
|
|
+.arrRotation {
|
|
|
|
+ transform: rotate(180deg);
|
|
|
|
+}
|
|
|
|
+.treeActice {
|
|
|
|
+ color: #606266;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.treeIcon {
|
|
|
|
+ display: none;
|
|
|
|
+}
|
|
|
|
+.custom-tree-node {
|
|
|
|
+ margin-left: -4px;
|
|
|
|
+}
|
|
|
|
+.custom-tree-node * {
|
|
|
|
+ vertical-align: middle;
|
|
|
|
+}
|
|
|
|
+.custom-tree-node:hover {
|
|
|
|
+ .treeIcon {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 55%;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.item:hover {
|
|
|
|
+ .blueTree {
|
|
|
|
+ display: block;
|
|
|
|
+ }
|
|
|
|
+ .iconTree {
|
|
|
|
+ display: none;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.blueTree {
|
|
|
|
+ display: none;
|
|
|
|
+}
|
|
|
|
+el-tooltip {
|
|
|
|
+ display: none;
|
|
|
|
+}
|
|
|
|
+.add {
|
|
|
|
+ color: #409EFF;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+}
|
|
|
|
+.all-box {
|
|
|
|
+ text-align: center;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+}
|
|
|
|
+.all-box .RuleLine {
|
|
|
|
+ display: table-cell;
|
|
|
|
+ width: 1px;
|
|
|
|
+ min-height: 600px;
|
|
|
|
+ background: #efefef;
|
|
|
|
+}
|
|
|
|
+.all-box .RuleLeft {
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding: 20px 10px;
|
|
|
|
+ overflow: auto;
|
|
|
|
+ max-height: 700px;
|
|
|
|
+}
|
|
|
|
+.all-box .RuleLeft .company_name {
|
|
|
|
+ position: relative;
|
|
|
|
+ display: block;
|
|
|
|
+ font-family: 'Microsoft YaHei';
|
|
|
|
+ text-align: left;
|
|
|
|
+ padding: 15px 28px 17px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ border-bottom: 1px #f8f8f8 solid;
|
|
|
|
+}
|
|
|
|
+.all-box .RuleLeft .company_name img {
|
|
|
|
+ position: relative;
|
|
|
|
+ display: inline-block;
|
|
|
|
+ top: 2px;
|
|
|
|
+ width: 18px;
|
|
|
|
+ height: 18px;
|
|
|
|
+ margin-right: 4px;
|
|
|
|
+}
|
|
|
|
+.all-box .RuleLeft /deep/ .el-button {
|
|
|
|
+ margin-bottom: 16px !important;
|
|
|
|
+}
|
|
|
|
+.all-box .RuleRight {
|
|
|
|
+ position: relative;
|
|
|
|
+ text-align: left;
|
|
|
|
+ padding: 20px;
|
|
|
|
+ min-width: 600px;
|
|
|
|
+}
|
|
|
|
+.all-box .RuleRight .title span .sapn {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ vertical-align: middle;
|
|
|
|
+ max-width: 600px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+}
|
|
|
|
+.all-box .RuleRight:after {
|
|
|
|
+ content: ' ';
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ width: 1px;
|
|
|
|
+ background: #ebeef5;
|
|
|
|
+}
|
|
|
|
+.all-box /deep/ .el-table__row {
|
|
|
|
+ cursor: pointer;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.all-box .department_box /deep/ .el-tree-node {
|
|
|
|
+ display: block;
|
|
|
|
+ text-align: center;
|
|
|
|
+}
|
|
|
|
+.all-box .department_box /deep/ .el-tree-node__content {
|
|
|
|
+ height: auto !important;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.all-box .department_box /deep/ .el-tree-node .el-icon-caret-right {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ color: #909399;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ padding: 6px 8px;
|
|
|
|
+}
|
|
|
|
+.all-box .department_box /deep/ .el-tree-node .el-icon-caret-right.is-leaf {
|
|
|
|
+ color: transparent;
|
|
|
|
+ cursor: default;
|
|
|
|
+}
|
|
|
|
+.all-box .department_box /deep/ .el-tree-node .custom-tree-node img {
|
|
|
|
+ margin-top: 0px;
|
|
|
|
+ width: 20px;
|
|
|
|
+}
|
|
|
|
+.all-box .department_box /deep/ .el-tree-node .custom-tree-node span {
|
|
|
|
+}
|
|
|
|
+.all-box .department_box /deep/ .el-tree-node__content {
|
|
|
|
+ padding: 12px 0;
|
|
|
|
+ border-bottom: 1px #f8f8f8 solid;
|
|
|
|
+}
|
|
|
|
+.all-box .department_box /deep/ .el-tree-node__content:hover {
|
|
|
|
+ background: #ecf5ff;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+}
|
|
|
|
+.all-box .department_box /deep/ .is-focusable .is-current {
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+}
|
|
|
|
+.all-box .department_box /deep/ .is-focusable .is-current .name {
|
|
|
|
+ color: #409EFF;
|
|
|
|
+ font-weight: normal;
|
|
|
|
+ transition: 0.35s ease-in-out;
|
|
|
|
+}
|
|
|
|
+.diy-tip {
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+ border: 1px solid #67c23a;
|
|
|
|
+ padding: 20px 16px;
|
|
|
|
+ p {
|
|
|
|
+ color: #67c23a !important;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ margin: 0 !important;
|
|
|
|
+ padding: 4px 0;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+ .kh-right {
|
|
|
|
+ padding: 0 10px;
|
|
|
|
+ }
|
|
|
|
+ .pagination {
|
|
|
|
+ position: relative;
|
|
|
|
+ left: -10px;
|
|
|
|
+ }
|
|
|
|
+ .liAction {
|
|
|
|
+ background-color: #ebeef5;
|
|
|
|
+ color: #409EFF;
|
|
|
|
+ }
|
|
|
|
+ .kh-title {
|
|
|
|
+ text-align: center;
|
|
|
|
+ font-weight: 700;
|
|
|
|
+ border-bottom: 1px solid #ebeef5;
|
|
|
|
+ padding-bottom: 10px;
|
|
|
|
+ }
|
|
|
|
+ .kh-left {
|
|
|
|
+ border-right: 1px solid #ebeef5;
|
|
|
|
+ }
|
|
|
|
+ .kh-left li {
|
|
|
|
+ padding: 10px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ border-bottom: 1px solid #ebeef5;
|
|
|
|
+ }
|
|
|
|
+ .kh-left li:hover {
|
|
|
|
+ background-color: #ebeef5;
|
|
|
|
+ }
|
|
|
|
+ .kh-Box {
|
|
|
|
+ // height: 430px;
|
|
|
|
+ }
|
|
|
|
+.bmxx .el-dialog__body {
|
|
|
|
+ padding: 30px 100px 20px 10px !important;
|
|
|
|
+}
|
|
|
|
+.el-form-item__label {
|
|
|
|
+ font-weight: normal;
|
|
|
|
+}
|
|
|
|
+.li:hover {
|
|
|
|
+ background-color: #f5f7fa;
|
|
|
|
+}
|
|
|
|
+.li:hover .el-icon-more {
|
|
|
|
+ display: block;
|
|
|
|
+}
|
|
|
|
+.index-name {
|
|
|
|
+ width: 170px;
|
|
|
|
+}
|
|
|
|
+.ul {
|
|
|
|
+ max-height: calc(100vh - 230px);
|
|
|
|
+ overflow: auto;
|
|
|
|
+}
|
|
|
|
+.ul::-webkit-scrollbar {
|
|
|
|
+ width: 6px;
|
|
|
|
+ height: 6px;
|
|
|
|
+}
|
|
|
|
+.ul:hover::-webkit-scrollbar-thumb {
|
|
|
|
+ background-color: #ccc;
|
|
|
|
+}
|
|
|
|
+.ul::-webkit-scrollbar-track {
|
|
|
|
+ width: 6px;
|
|
|
|
+ background-color: #f1f1f1;
|
|
|
|
+ -webkit-border-radius: 2em;
|
|
|
|
+ -moz-border-radius: 2em;
|
|
|
|
+ border-radius: 2em;
|
|
|
|
+}
|
|
|
|
+.isActiveLi {
|
|
|
|
+ background-color: #f5f7fa;
|
|
|
|
+ color: #409EFF !important;
|
|
|
|
+ position: relative;
|
|
|
|
+}
|
|
|
|
+.isActiveLi::after {
|
|
|
|
+ width: 3px;
|
|
|
|
+ content: ' ';
|
|
|
|
+ background-color: #409EFF;
|
|
|
|
+ left: 0;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ top: 0;
|
|
|
|
+ position: absolute;
|
|
|
|
+}
|
|
|
|
+/deep/ .el-dialog__body {
|
|
|
|
+ padding: 20px;
|
|
|
|
+}
|
|
|
|
+.inputBox {
|
|
|
|
+ height: 36px;
|
|
|
|
+ line-height: 36px;
|
|
|
|
+ padding-right: 30px;
|
|
|
|
+ -webkit-appearance: none;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ background-image: none;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ border: 1px solid #dcdfe6;
|
|
|
|
+ -webkit-box-sizing: border-box;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ color: #606266;
|
|
|
|
+ display: inline-block;
|
|
|
|
+ font-size: inherit;
|
|
|
|
+ width: 336px;
|
|
|
|
+ outline: 0;
|
|
|
|
+ padding: 0 15px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ -webkit-transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
|
|
+ transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
|
|
+}
|
|
|
|
+.mainEl {
|
|
|
|
+ .mainHead {
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+ span:nth-child(2) {
|
|
|
|
+ color: #409EFF;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .mainTag {
|
|
|
|
+ height: 400px;
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ /deep/ .el-tag--medium {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ border: 1px solid #e4e4e4;
|
|
|
|
+ border-radius: 20px;
|
|
|
|
+ color: #4c4c4c;
|
|
|
|
+ margin: 5px 5px 5px 0;
|
|
|
|
+ max-width: 240px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ position: relative;
|
|
|
|
+ padding: 0 20px 0 10px;
|
|
|
|
+ }
|
|
|
|
+ .el-tag--medium /deep/ i {
|
|
|
|
+ color: #8f8f8f;
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 5px;
|
|
|
|
+ top: 5px;
|
|
|
|
+ }
|
|
|
|
+ .el-tag--medium /deep/ i:hover {
|
|
|
|
+ background-color: #9b9b9b;
|
|
|
|
+ color: #fff;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|