feat:员工档案模块的接口调试接口,自测完成;

todo:员工档案带系统测试;员工概况的接口调试;
style:员工管理的代码整合优化;
This commit is contained in:
xiongchengqiang 2020-05-19 10:56:37 +08:00
parent 6e078fb38e
commit 6c958c1363
4 changed files with 187 additions and 74 deletions

View File

@ -61,9 +61,17 @@ export default {
} }
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
.contant { .contant {
margin: 16px 0; margin: 16px auto;
display: flex;
width: 80%;
&-label {
width: 120px;
padding: 0 10px;
}
&-name {
flex: 1;
}
} }
</style> </style>

View File

@ -42,6 +42,59 @@
<span class="contant-label">岗位最初从业时间</span> <span class="contant-label">岗位最初从业时间</span>
<span class="contant-name">{{info.jobBeginTime}}</span> <span class="contant-name">{{info.jobBeginTime}}</span>
</div> </div>
<div class="contant" v-if="info.workExperience">
<span class="contant-label">工作经历:</span>
<span class="contant-name" v-html="info.workExperience" style="white-space: pre-wrap;"></span>
</div>
<div class="contant">
<span class="contant-label">简历附件:</span>
<span class="contant-name">{{info.resumeUrl || "暂无"}}</span>
</div>
<div class="contant" v-if="info.projectExperiences">
<span class="contant-label">项目经历:</span>
<span class="contant-name">
<!-- info.projectExperiences" -->
<div class="contant-name-contant" v-for="(i,index) in info.projectExperiences" :key="index">
<div class="contant-name-contant-item">
<span class="contant-name-contant-item-left">项目名称</span>
<span class="contant-name-contant-item-right">{{i.projectName}}</span>
</div>
<div class="contant-name-contant-item">
<span class="contant-name-contant-item-left">时间</span>
<span
class="contant-name-contant-item-right"
>{{i.projectBeginTime || "未知"}}~{{i.projectEndTime || "未知"}}</span>
</div>
<div class="contant-name-contant-item" v-if="i.projectContent">
<span class="contant-name-contant-item-left">工作内容</span>
<span class="contant-name-contant-item-right">{{i.projectContent}}</span>
</div>
</div>
</span>
</div>
<div class="contant" v-if="info.workTransfers">
<span class="contant-label">工作调转记录:</span>
<!-- <span class="contant-name" v-html="info.workTransfers"></span> -->
<span class="contant-name">
<div class="contant-name-contant" style="padding-top:20px;">
<el-timeline>
<el-timeline-item
type="primary"
:key="index"
v-for="(i,index) in info.workTransfers"
:timestamp="i.transferTime"
placement="top"
>
<p>{{i.transferRecord}}</p>
</el-timeline-item>
</el-timeline>
</div>
</span>
</div>
</div> </div>
</template> </template>
@ -86,9 +139,33 @@ export default {
} }
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
.el-timeline {
margin: 0 0 0 -40px;
}
.contant { .contant {
margin: 16px 0; margin: 16px auto;
display: flex;
width: 80%;
&-label {
width: 160px;
padding: 0 10px;
}
&-name {
flex: 1;
&-contant {
background: rgba(242, 242, 242, 0.509804);
border-radius: 3px;
box-sizing: border-box;
padding: 6px 10px;
margin: 0 0 10px 0;
&-item {
display: flex;
&-left {
width: 80px;
}
}
}
}
} }
</style> </style>

View File

@ -22,7 +22,7 @@
<div class="block"> <div class="block">
<el-form :inline="true"> <el-form :inline="true">
<el-form-item label="员工姓名"> <el-form-item label="员工姓名">
<el-input clearable v-model="query.name"></el-input> <el-input clearable v-model="query.name" @keyup.enter.native="getTable"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="人员状态"> <el-form-item label="人员状态">
<el-select v-model="query.staffStatus" placeholder="请选择"> <el-select v-model="query.staffStatus" placeholder="请选择">
@ -35,8 +35,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="getTable">查询</el-button> <el-button type="primary" :loading="loading" @click="getTable">查询</el-button>
<el-button @click="clear">重置</el-button> <el-button :loading="loading" @click="clear">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -57,7 +57,13 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column header-align="center" align="center" label="职位" prop="position"></el-table-column> <el-table-column header-align="center" align="center" label="职位" prop="position">
<template slot-scope="scope">
<div class="conatnt-name">
<span>{{ scope.row.position || "暂无信息" }}</span>
</div>
</template>
</el-table-column>
<el-table-column header-align="center" align="center" label="状态" prop="staffStatus"></el-table-column> <el-table-column header-align="center" align="center" label="状态" prop="staffStatus"></el-table-column>
<el-table-column header-align="center" align="center" label="操作"> <el-table-column header-align="center" align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
@ -78,7 +84,13 @@
</el-col> </el-col>
</el-row> </el-row>
</el-card> </el-card>
<el-dialog title="员工档案" :close-on-click-modal="false" :visible.sync="dialogVisible" width="60%"> <el-dialog
top="60px"
title="员工档案"
:close-on-click-modal="false"
:visible.sync="dialogVisible"
width="60%"
>
<div class="dialogVisible-tabs"> <div class="dialogVisible-tabs">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="基础信息" name="first"> <el-tab-pane label="基础信息" name="first">
@ -90,10 +102,7 @@
<div class="noInfo" v-else>暂无信息</div> <div class="noInfo" v-else>暂无信息</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="职业信息" name="third"> <el-tab-pane label="职业信息" name="third">
<professional <professional v-if="employeesInfo.occupationInfo" :info="employeesInfo.occupationInfo" />
v-if="employeesInfo.occupationInfo"
:info="occupationInfo.occupationInfo"
/>
<div class="noInfo" v-else>暂无信息</div> <div class="noInfo" v-else>暂无信息</div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -162,8 +171,9 @@ export default {
}, },
methods: { methods: {
async getEmployeesInfo (data) { async getEmployeesInfo (data) {
let result = await apiEmployeesInfo(data) const result = await apiEmployeesInfo(data)
if (result.code === 0) { if (result.code === 0) {
this.activeName = 'first'
this.dialogVisible = true this.dialogVisible = true
this.employeesInfo = result.data this.employeesInfo = result.data
} else { } else {
@ -178,7 +188,7 @@ export default {
}, },
// //
async handleGetMenuList () { async handleGetMenuList () {
let result = await apiOrganizationList() const result = await apiOrganizationList()
console.log('result: ', result) console.log('result: ', result)
this.menuList = result this.menuList = result
}, },
@ -193,7 +203,6 @@ export default {
} else { } else {
this.$message.error(result.msg) this.$message.error(result.msg)
} }
console.log('getEmployeesList: ', result)
this.loading = false this.loading = false
}, },
clear () { clear () {
@ -231,6 +240,9 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.el-tree {
font-size: 16px;
}
.conatnt-name { .conatnt-name {
position: relative; position: relative;
&-label { &-label {

View File

@ -1,6 +1,5 @@
<template> <template>
<div class="staff"> <div class="staff">
<!-- el-icon-minus -->
<el-card> <el-card>
<el-row> <el-row>
<el-col class="menu" :span="6"> <el-col class="menu" :span="6">
@ -23,7 +22,7 @@
<div class="block"> <div class="block">
<el-form :inline="true"> <el-form :inline="true">
<el-form-item label="员工姓名"> <el-form-item label="员工姓名">
<el-input v-model="query.name"></el-input> <el-input clearable v-model="query.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="人员状态"> <el-form-item label="人员状态">
<el-select v-model="query.staffStatus" placeholder="请选择"> <el-select v-model="query.staffStatus" placeholder="请选择">
@ -40,6 +39,11 @@
<el-button @click="clear">重置</el-button> <el-button @click="clear">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form :inline="true">
<el-form-item>
<el-button type="primary" icon="el-icon-plus">批量导入员工档案</el-button>
</el-form-item>
</el-form>
</div> </div>
<div class="table"> <div class="table">
<el-table <el-table
@ -50,8 +54,21 @@
height="600" height="600"
> >
<el-table-column header-align="center" align="center" label="工号" prop="staffId"></el-table-column> <el-table-column header-align="center" align="center" label="工号" prop="staffId"></el-table-column>
<el-table-column header-align="center" align="center" label="员工姓名" prop="name"></el-table-column> <el-table-column header-align="center" align="center" width="260" label="员工姓名">
<el-table-column header-align="center" align="center" label="职位" prop="position"></el-table-column> <template slot-scope="scope">
<div class="conatnt-name">
<span>{{ scope.row.name }}</span>
<span class="conatnt-name-label" v-if="scope.row.departmentLeader===1">部门负责人</span>
</div>
</template>
</el-table-column>
<el-table-column header-align="center" align="center" label="职位" prop="position">
<template slot-scope="scope">
<div class="conatnt-name">
<span>{{ scope.row.position || "暂无信息" }}</span>
</div>
</template>
</el-table-column>
<el-table-column header-align="center" align="center" label="状态" prop="staffStatus"></el-table-column> <el-table-column header-align="center" align="center" label="状态" prop="staffStatus"></el-table-column>
<el-table-column header-align="center" align="center" label="操作"> <el-table-column header-align="center" align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
@ -72,7 +89,13 @@
</el-col> </el-col>
</el-row> </el-row>
</el-card> </el-card>
<el-dialog title="员工档案" :close-on-click-modal="false" :visible.sync="dialogVisible" width="60%"> <el-dialog
top="60px"
title="员工档案"
:close-on-click-modal="false"
:visible.sync="dialogVisible"
width="60%"
>
<div class="dialogVisible-tabs"> <div class="dialogVisible-tabs">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="基础信息" name="first"> <el-tab-pane label="基础信息" name="first">
@ -87,7 +110,8 @@
</el-tabs> </el-tabs>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button> <el-button type="primary" @click="dialogVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -98,7 +122,7 @@ import menuTree from '@/components/menu-tree'
import basis from './componments/basis.vue' import basis from './componments/basis.vue'
import professional from './componments/professional' import professional from './componments/professional'
import education from './componments/education' import education from './componments/education'
import { apiOrganizationList, apiEmployeesList, apiEmployeesInfo } from '@/api/api_staff' import { apiOrganizationList, apiEmployeesList } from '@/api/api_staff'
export default { export default {
components: { components: {
menuTree, menuTree,
@ -114,16 +138,9 @@ export default {
children: 'list', children: 'list',
label: 'name' label: 'name'
}, },
employeesList: [],
menuList: [], // menuList: [], //
tableData: [], // tableData: [], //
employeesInfo: {}, // employeesInfo: {}, //
//
searchParams: {
staffName: '',
staffState: ''
},
// //
staffStateList: [ staffStateList: [
{ value: '0', label: '在职' }, { value: '0', label: '在职' },
@ -135,26 +152,13 @@ export default {
limit: 10, limit: 10,
pageTotal: 0, pageTotal: 0,
departmentId: null departmentId: null
},
deptId: '',
//
showAddDialogForm: false,
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
} }
} }
}, },
watch: { watch: {
$route: function (val) { $route: function (val) {
if (val.name === 'staff') { if (val.name === 'staff') {
this.clearData() this.clear()
this.handleGetTableList(val.query.id) this.handleGetTableList(val.query.id)
} }
} }
@ -170,17 +174,16 @@ export default {
}, },
methods: { methods: {
async getEmployeesInfo (data) { async getEmployeesInfo (data) {
let result = await apiEmployeesInfo(data) this.dialogVisible = true
if (result.code === 0) {
this.dialogVisible = true // const result = await apiEmployeesInfo(data)
this.employeesInfo = result.data // if (result.code === 0) {
} else { // this.dialogVisible = true
this.$message.error(result.msg) // this.employeesInfo = result.data
} // } else {
console.log('result: ', result) // this.$message.error(result.msg)
}, // }
setCurrentKey (key) { // console.log('result: ', result)
console.log('key: ', key)
}, },
handleNodeClick (data) { handleNodeClick (data) {
// highlight - current // highlight - current
@ -196,9 +199,14 @@ export default {
// { page: 0, limit: 5 } // { page: 0, limit: 5 }
async handleGetTableList (id) { async handleGetTableList (id) {
this.loading = true this.loading = true
let result = await apiEmployeesList(Object.assign({}, this.query, { limit: this.query.pageSize, page: this.query.page - 1 })) let result = await apiEmployeesList(Object.assign({}, this.query, { limit: this.query.pageSize }))
this.tableData = result.page.list console.log('result: ', result)
this.query.pageTotal = result.page.totalCount if (result.code === 0) {
this.tableData = result.page.list
this.query.pageTotal = result.page.totalCount
} else {
this.$message.error(result.msg)
}
console.log('getEmployeesList: ', result) console.log('getEmployeesList: ', result)
this.loading = false this.loading = false
}, },
@ -216,12 +224,6 @@ export default {
this.query.page = 1 this.query.page = 1
this.handleGetTableList() this.handleGetTableList()
}, },
clearData () {
this.tableData = []
this.currentPage = 1
this.pageTotal = 20
this.loading = true
},
handleCurrentChange (val) { handleCurrentChange (val) {
console.log('val: ', val) console.log('val: ', val)
this.query.page = val this.query.page = val
@ -236,14 +238,32 @@ export default {
console.log(tab, event) console.log(tab, event)
}, },
async handleView (data) { async handleView (data) {
this.dialogVisible = true
console.log('data: ', data) console.log('data: ', data)
// await this.getEmployeesInfo(data.staffId) this.activeName = 'first'
await this.getEmployeesInfo(data.staffId)
} }
} }
} }
</script> </script>
<style > <style lang="scss">
.custom-tree-node span {
font-size: 16px !important;
}
</style>
<style lang="scss" >
.conatnt-name {
position: relative;
&-label {
position: absolute;
font-size: 10px;
background: rgba(24, 144, 255, 1);
border-radius: 5px;
color: #fff;
padding: 0 4px;
top: -4px;
transform: scale(0.7);
}
}
.el-tree-node__content { .el-tree-node__content {
margin: 10px 0 !important; margin: 10px 0 !important;
} }
@ -253,13 +273,6 @@ export default {
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.staff {
// height: 1000px;
// background: #fff;
// padding: 10px;
// box-sizing: border-box;
// border-radius: 2px;
}
.staff .block, .staff .block,
.staff .table { .staff .table {
margin-left: 20px; margin-left: 20px;
@ -285,4 +298,7 @@ export default {
text-align: right; text-align: right;
} }
} }
.noInfo {
text-align: center;
}
</style> </style>