|
@@ -78,12 +78,12 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="accedence_time" label="入职时间"></el-table-column>
|
|
|
- <el-table-column prop="id" label="员工标识" width="80">
|
|
|
+ <!-- <el-table-column prop="id" label="员工标识" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button size="mini" type="primary" @click="copyId(scope.row.id)">复制</el-button>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="是否参与排名" align="center">
|
|
|
+ </el-table-column> -->
|
|
|
+ <!-- <el-table-column label="是否参与排名" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<template v-if="scope.row.is_creator != 1">
|
|
|
<span
|
|
@@ -96,7 +96,7 @@
|
|
|
</template>
|
|
|
<span v-else class="fontColorB">不参与</span>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column label="启用积分管理">
|
|
|
<template slot="header" slot-scope="scope">
|
|
|
<el-popover placement="top-start" width="300" trigger="manual" v-model="visible">
|
|
@@ -123,10 +123,16 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="管理上级" align="center" width="80">
|
|
|
+ <!-- <el-table-column label="管理上级" align="center" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.is_creator != 1 && scope.row.is_official != 0" class="participateRank" style="color:#409eff;" @click="setSuperior(scope.row)">设置</span>
|
|
|
</template>
|
|
|
+ </el-table-column> -->
|
|
|
+
|
|
|
+ <el-table-column prop="id" label="操作" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link type="primary" @click="moreMessage(scope.row.id)" :underline="false">更多信息</el-link>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<template slot="empty">
|
|
|
<noData></noData>
|
|
@@ -148,6 +154,67 @@
|
|
|
<!-- 隐藏文本,用于复制ID -->
|
|
|
<input v-model="copyIds" id="biao" style="opacity:0"/>
|
|
|
</div>
|
|
|
+
|
|
|
+ <el-dialog :close-on-click-modal="false" ref="EditInformation_list" title="员工详情" width="500px" :before-close="detailFormreturn" :visible.sync="diaTableVisible">
|
|
|
+ <div style="padding-right:50px;">
|
|
|
+ <!-- <el-table-column prop="id" label="员工标识" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="primary">复制</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+
|
|
|
+ <el-form ref="detailForm" :model="messageMore" @submit.native.prevent v-loading="show_loading">
|
|
|
+ <el-form-item label="员工标识" prop="id" :label-width="'100px'">
|
|
|
+ <el-input v-model="copyIds" disabled auto-complete="off"></el-input>
|
|
|
+ <span style="position:absolute;top:1px;right:7px;font-size:12px;color:#61aeff;cursor:pointer;" @click="copyToClipboard()">点击复制</span>
|
|
|
+ <!-- <el-button size="mini" type="primary" @click="copyId(messageMore.id)">复制</el-button> -->
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="姓名" prop="name" :label-width="'100px'">
|
|
|
+ <el-input v-model="messageMore.name" disabled ref="inputName" auto-complete="off"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="入职时间" prop="accedence_time" :label-width="'100px'">
|
|
|
+ <el-date-picker
|
|
|
+ style="width:100%;"
|
|
|
+ v-model="messageMore.accedence_time"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择日期"
|
|
|
+ disabled
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="部门" prop="name" :label-width="'100px'">
|
|
|
+ <el-input v-model="deptList" disabled ref="inputName" placeholder="暂无部门" auto-complete="off"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="是否参与排名" prop="name" :label-width="'100px'">
|
|
|
+ <span v-if="messageMore.is_creator != 1"
|
|
|
+ class="participateRank"
|
|
|
+ :style="messageMore.is_ranking == 1 ? 'color:#409eff' : 'color:#F56C6C'"
|
|
|
+ @click="rankingtakePartIn(messageMore.id, messageMore.is_ranking)">
|
|
|
+ {{ messageMore.is_ranking == 1 ? '参与' : '不参与' }}
|
|
|
+ </span>
|
|
|
+ <span v-else class="fontColorB">不参与</span>
|
|
|
+ <!-- <div class="rankingcla">参与排名在排名中显示此人</div> -->
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="管理上级" prop="name" :label-width="'100px'">
|
|
|
+ <el-input auto-complete="off" v-model="propList" :disabled="messageMore.is_creator == 1 || messageMore.is_official == 0" placeholder="暂无管理上级"></el-input>
|
|
|
+ <div
|
|
|
+ @click="setSuperior(messageMore)"
|
|
|
+ v-if="messageMore.is_creator != 1 && messageMore.is_official != 0"
|
|
|
+ style=" position: absolute; top: 0; right: 0; left: 0; bottom: 0; z-index: 9;"
|
|
|
+ ></div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="直属上级" prop="name" :label-width="'100px'">
|
|
|
+ <el-input auto-complete="off" v-model="dirSupervisor.name" :disabled="messageMore.is_creator == 1 || messageMore.is_official == 0" placeholder="暂无直属上级"></el-input>
|
|
|
+ <div
|
|
|
+ @click="dirSuperior(messageMore)"
|
|
|
+ v-if="messageMore.is_creator != 1 && messageMore.is_official != 0"
|
|
|
+ style=" position: absolute; top: 0; right: 0; left: 0; bottom: 0; z-index: 9;"
|
|
|
+ ></div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<el-dialog title="设置是否参与排名" :visible.sync="dialogVisible" top="30vh" width="520px" :before-close="handleClose">
|
|
|
<div style="margin-left:20px;">
|
|
|
<el-radio v-for="(item, index) in radioLi" :key="index" v-model="radio" :label="item.id">
|
|
@@ -197,6 +264,21 @@
|
|
|
<el-button type="primary" :loading="scope_loading" :disabled="scope_loading" @click="sub_manageScope">完成</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="设置直属上级" :visible.sync="dirSupScope_show" :before-close="publicClose3" top="5vh" width="700px">
|
|
|
+ <EmployeeSelector
|
|
|
+ v-if="dirSupScope_show"
|
|
|
+ :max="1"
|
|
|
+ ref="Employee3"
|
|
|
+ :employee_list="dirSupList"
|
|
|
+ isCreatorSelect
|
|
|
+ :selected="selected_dirSup"
|
|
|
+ @confirm="dirSup_confirm"
|
|
|
+ ></EmployeeSelector>
|
|
|
+ <span slot="footer">
|
|
|
+ <el-button @click="publicClose3()">取消</el-button>
|
|
|
+ <el-button type="primary" :loading="scope_loading" :disabled="scope_loading" @click="dir_SupScope">完成</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -264,6 +346,16 @@ export default {
|
|
|
file: null,
|
|
|
action: process.env.VUE_APP_BASE_API + 'api/employee/enable_import',
|
|
|
ATOKEN: { 'A-TOKEN': this.$getToken()},
|
|
|
+ diaTableVisible: false,
|
|
|
+ messageMore: {},
|
|
|
+ deptList: '',
|
|
|
+ propList: '',
|
|
|
+ dirSupervisor: {},
|
|
|
+ dirSupScope_show: false,
|
|
|
+ show_loading: false,
|
|
|
+ newId: 0,
|
|
|
+ dirSupList: [],
|
|
|
+ selected_dirSup: { employee: [], dept: [] },
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
@@ -313,6 +405,22 @@ export default {
|
|
|
if(res.data.code == 1){
|
|
|
this.manageScope_show = false
|
|
|
this.$message.success('设置成功');
|
|
|
+ this.moreMessage();
|
|
|
+ }
|
|
|
+ }).finally(_=>{
|
|
|
+ this.scope_loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ dirSup_confirm(date){
|
|
|
+ let data = {
|
|
|
+ employee_ids: [this.newId],
|
|
|
+ superior_id: date.employee[0].id
|
|
|
+ }
|
|
|
+ this.$axios('post','/api/employee/directly_superior',data).then(res =>{
|
|
|
+ if(res.data.code == 1){
|
|
|
+ this.dirSupScope_show = false
|
|
|
+ this.$message.success('设置成功');
|
|
|
+ this.moreMessage();
|
|
|
}
|
|
|
}).finally(_=>{
|
|
|
this.scope_loading = false
|
|
@@ -322,41 +430,118 @@ export default {
|
|
|
this.scope_loading = true
|
|
|
this.$refs.Employee2.confirm();
|
|
|
},
|
|
|
- setSuperior(row){
|
|
|
- console.log(row)
|
|
|
- if(this.clickone){
|
|
|
- return false
|
|
|
+ dir_SupScope(){
|
|
|
+ this.scope_loading = true
|
|
|
+ this.$refs.Employee3.confirm();
|
|
|
+ },
|
|
|
+ detailFormreturn() {
|
|
|
+ this.diaTableVisible = false
|
|
|
+ },
|
|
|
+ nameStrList(list,Str){
|
|
|
+ let deptarr = ''
|
|
|
+ list.forEach((x, y) =>{
|
|
|
+ deptarr += x[Str] + ' ';
|
|
|
+
|
|
|
+ })
|
|
|
+ return deptarr
|
|
|
+ },
|
|
|
+ moreMessage(id) {
|
|
|
+ let isId = 0;
|
|
|
+ if(id){
|
|
|
+ this.newId = id
|
|
|
+ isId = id
|
|
|
+ }else{
|
|
|
+ isId = this.newId
|
|
|
}
|
|
|
+ this.diaTableVisible = true
|
|
|
+ this.show_loading = true
|
|
|
+ let http1 = this.$axios('get', '/api/employee/info', { id: isId })
|
|
|
+ let http2 = this.$axios('get', '/api/employee/code', { employee_id: isId })
|
|
|
+ Promise.all([http1, http2]).then(res =>{
|
|
|
+ if(res[0]){
|
|
|
+ if (res[0].data.code == 1) {
|
|
|
+ let data = res[0].data.data
|
|
|
+ if(data.employee_detail.dept_list){
|
|
|
+ this.deptList = this.nameStrList(data.employee_detail.dept_list, 'dept_name');
|
|
|
+ }
|
|
|
+ if(data.employee_detail.superior_list){
|
|
|
+ let employeeD = data.employee_detail
|
|
|
+ if(employeeD.superior_id != 0){
|
|
|
+ this.dirSupervisor = employeeD.superior_list.filter(x => x.id == employeeD.superior_id)[0]
|
|
|
+ }else{
|
|
|
+ this.dirSupervisor = {}
|
|
|
+ }
|
|
|
+ this.propList = this.nameStrList(employeeD.superior_list, 'name');
|
|
|
+ }
|
|
|
+ this.messageMore = data
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(res[1]){
|
|
|
+ if (res[1].data.code == 1) {
|
|
|
+ this.copyIds = res[1].data.data.encrypt_code;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).finally(() =>{
|
|
|
+ this.show_loading = false
|
|
|
+ })
|
|
|
+ // this.$axios('get', '/api/employee/info', { id: isId })
|
|
|
+ // .then(res => {
|
|
|
+ // if (res.data.code == 1) {
|
|
|
+ // let data = res.data.data
|
|
|
+ // if(data.employee_detail.dept_list){
|
|
|
+ // this.deptList = this.nameStrList(data.employee_detail.dept_list, 'dept_name');
|
|
|
+ // }
|
|
|
+ // if(data.employee_detail.superior_list){
|
|
|
+ // let employeeD = data.employee_detail
|
|
|
+ // if(employeeD.superior_id != 0){
|
|
|
+ // this.dirSupervisor = employeeD.superior_list.filter(x => x.id == employeeD.superior_id)[0]
|
|
|
+ // console.log(this.dirSupervisor)
|
|
|
+ // }
|
|
|
+ // this.propList = this.nameStrList(employeeD.superior_list, 'name');
|
|
|
+ // }
|
|
|
+ // this.messageMore = data
|
|
|
+ // }
|
|
|
+ // }).finally(()=>{
|
|
|
+ // this.show_loading = false
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ setSuperior(row){
|
|
|
this.mangeId = row.id
|
|
|
let createData = {}
|
|
|
createData = this.manageData.filter(x => x.is_creator == 1)
|
|
|
let list = this.manageData.filter(x => x.id != row.id && x.is_creator != 1)
|
|
|
this.employeeList = list
|
|
|
- this.clickone = true
|
|
|
- this.$axios('get', '/api/employee/info', { id: row.id })
|
|
|
- .then(res => {
|
|
|
- if (res.data.code == 1) {
|
|
|
- let supList = res.data.data.employee_detail.superior_list
|
|
|
- if(createData[0]){
|
|
|
- supList.some(item =>{
|
|
|
- if(item.id == createData[0].id){
|
|
|
- item.is_creator = true
|
|
|
- return true
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- this.selected_manage.employee = supList
|
|
|
- this.manageScope_show = true
|
|
|
- }
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.clickone = false
|
|
|
- });
|
|
|
+ let supList = row.employee_detail.superior_list
|
|
|
+ if(createData[0]){
|
|
|
+ supList.forEach(item =>{
|
|
|
+ createData.some(arr =>{
|
|
|
+ if(item.id == arr.id){
|
|
|
+ item.is_creator = true
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.selected_manage.employee = supList
|
|
|
+ this.manageScope_show = true
|
|
|
+ },
|
|
|
+ dirSuperior(row){
|
|
|
+ this.dirSupList = row.employee_detail.superior_list
|
|
|
+ if(this.dirSupervisor.name){
|
|
|
+ let arr = []
|
|
|
+ arr.push(this.dirSupervisor)
|
|
|
+ this.selected_dirSup.employee = arr
|
|
|
+ }
|
|
|
+ this.dirSupScope_show = true
|
|
|
},
|
|
|
publicClose2() {
|
|
|
this.$refs.Employee2.close();
|
|
|
this.manageScope_show = false;
|
|
|
},
|
|
|
+ publicClose3() {
|
|
|
+ this.$refs.Employee3.close();
|
|
|
+ this.dirSupScope_show = false
|
|
|
+ },
|
|
|
//管理列表
|
|
|
manageList(){
|
|
|
let params = {
|
|
@@ -376,7 +561,6 @@ export default {
|
|
|
htmls.forEach(item => {
|
|
|
str += `<div>${item.姓名}:${item.line_err}</div>`;
|
|
|
});
|
|
|
- console.log(str);
|
|
|
this.$notify.error({
|
|
|
title: '导入错误',
|
|
|
dangerouslyUseHTMLString: true,
|
|
@@ -445,7 +629,6 @@ export default {
|
|
|
},
|
|
|
copyToClipboard() {
|
|
|
var Url2=document.getElementById("biao");
|
|
|
- console.log(Url2)
|
|
|
Url2.select(); // 选择对象
|
|
|
document.execCommand("Copy"); // 执行浏览器复制命令
|
|
|
this.$message.success('已复制');
|
|
@@ -493,7 +676,7 @@ export default {
|
|
|
.then(res => {
|
|
|
if (res.data.code == 1) {
|
|
|
this.$message.success({ message: res.data.msg });
|
|
|
- this.getEmployee();
|
|
|
+ this.moreMessage();
|
|
|
}
|
|
|
})
|
|
|
.finally(() => {
|
|
@@ -816,4 +999,8 @@ export default {
|
|
|
line-height: 14px;
|
|
|
text-align: center;
|
|
|
}
|
|
|
+.rankingcla{
|
|
|
+ font-size: 13px;
|
|
|
+ color: #959595;
|
|
|
+}
|
|
|
</style>
|