人员管理

This commit is contained in:
caoxinyu
2018-12-05 20:03:10 +08:00
parent 4bfc5961f9
commit 628ec49496
4 changed files with 169 additions and 32 deletions

View File

@@ -330,3 +330,25 @@ export function delPost(num1) {
} }
}) })
} }
export function quit(num1) {
return request({
url: '',
method: 'post',
data: {
type: 2,
name: '人事档案管理_人员_离职操作',
param: '人员编号=' + num1 + '=int'
}
})
}
export function searchLeavingList(pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: 1,
name: '人事档案管理_人员_离职人员查询',
pagination: pageCurrent + '&' + pageSize
}
})
}

View File

@@ -10,22 +10,7 @@ export const name = `OP8888`
export const upload = `http://localhost:8411/submit/uploadFile.ashx` export const upload = `http://localhost:8411/submit/uploadFile.ashx`
export const download = `http://localhost:8411/submit/downloadFile.ashx` export const download = `http://localhost:8411/submit/downloadFile.ashx`
const service = axios.create({ const service = axios.create({
<<<<<<< HEAD
baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`, baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`,
=======
// baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`,
>>>>>>> 7cdb10d153358b72f95165dd7f3a12ad7675f14d
// baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`,
baseURL: `http://192.168.0.105:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://192.168.137.85:8411/submit/MESCommonBase.ashx`, // 李鑫
// baseURL: `http://192.168.1.112:8411/submit/MESCommonBase.ashx`,
timeout: 1500000 // 请求超时时间 timeout: 1500000 // 请求超时时间
}) })

View File

@@ -15,6 +15,8 @@
<el-button slot="append" icon="el-icon-search" @click="fetchPeopleForName"/> <el-button slot="append" icon="el-icon-search" @click="fetchPeopleForName"/>
</el-input> </el-input>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addPeople()">新增</el-button> <el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addPeople()">新增</el-button>
<el-button type="danger" icon="el-icon-circle-close-outline" size="small" @click="Quit()">离职</el-button>
<el-button type="text" size="small" style="float: right" @click="searchLeavingList">离职名单</el-button>
<!--<el-button v-popover:popover4 type="success" icon="el-icon-sort" size="small" @click="moveGroup">移动--> <!--<el-button v-popover:popover4 type="success" icon="el-icon-sort" size="small" @click="moveGroup">移动-->
<!--</el-button>--> <!--</el-button>-->
<!--<el-button size="small" @click="postMaintain()">岗位维护</el-button>--> <!--<el-button size="small" @click="postMaintain()">岗位维护</el-button>-->
@@ -51,7 +53,7 @@
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-card class="box-card" style="min-height: 743px; max-height: 743px"> <el-card class="box-card" style="min-height: 700px; max-height: 743px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>部门维护</span> <span>部门维护</span>
<el-button style="float: right; padding: 3px 0" type="text" @click="expandALL()">展开</el-button> <el-button style="float: right; padding: 3px 0" type="text" @click="expandALL()">展开</el-button>
@@ -77,9 +79,10 @@
stripe stripe
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
height="679" height="659"
highlight-current-row highlight-current-row
border border
size="mini"
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
<el-table-column <el-table-column
type="selection" type="selection"
@@ -168,7 +171,7 @@
<el-pagination <el-pagination
:current-page="PageCurrent" :current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40]" :page-sizes="[10, 20, 30, 40]"
:page-size="10" :page-size="PageSize"
:total="total" :total="total"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@@ -291,14 +294,108 @@
<el-button v-else-if="people_title === '编辑人员'" type="primary" @click="submitEditPeople">确定</el-button> <el-button v-else-if="people_title === '编辑人员'" type="primary" @click="submitEditPeople">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--离职名单-->
<el-dialog :visible.sync="LeavingListVisiable" title="离职名单" center style="height: 800px" width="80%">
<el-table
:data="LeavingList"
stripe
tooltip-effect="dark"
style="width: 100%"
height="500"
highlight-current-row
border
size="mini">
<el-table-column align="center" label="部门名称" width="100">
<template slot-scope="scope">
{{ scope.row.节点名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="考勤编号" width="100">
<template slot-scope="scope">
{{ scope.row.考勤编号 }}
</template>
</el-table-column>
<el-table-column align="center" label="密码" width="100">
<template slot-scope="scope">
{{ scope.row.密码 }}
</template>
</el-table-column>
<el-table-column align="center" label="姓名" width="100">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column align="center" label="性别" width="100">
<template slot-scope="scope">
{{ scope.row.性别 }}
</template>
</el-table-column>
<el-table-column align="center" label="身份证号" width="165">
<template slot-scope="scope">
{{ scope.row.身份证号 }}
</template>
</el-table-column>
<el-table-column align="center" label="学历" width="100">
<template slot-scope="scope">
{{ scope.row.学历名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="入职时间" width="100">
<template slot-scope="scope">
{{ scope.row.入公司时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="出生日期" width="100">
<template slot-scope="scope">
{{ scope.row.出生日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="联系方式" width="110">
<template slot-scope="scope">
{{ scope.row.联系电话 }}
</template>
</el-table-column>
<el-table-column align="center" label="岗位工种" width="100">
<template slot-scope="scope">
{{ scope.row.岗位名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="民族" width="100">
<template slot-scope="scope">
{{ scope.row.民族 }}
</template>
</el-table-column>
<el-table-column align="center" label="家庭住址" width="200">
<template slot-scope="scope">
{{ scope.row.家庭住址 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrentN"
:page-sizes="[10, 20, 30, 40]"
:page-size="PageSizeN"
:total="totalN"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChangeN"
@current-change="handleCurrentChangeN"/>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getTree, tree, getTablePeople, getTablePeopleForName, addDepartmentName, delList, editList, delPeopleList, fetchEducationData, fetchPostData, addPeople, editPeople } from '@/api/BasicData/PersonnelManagement' import { getTree, tree, getTablePeople, getTablePeopleForName, addDepartmentName, delList, editList, delPeopleList, fetchEducationData, fetchPostData, addPeople, editPeople, quit, searchLeavingList } from '@/api/BasicData/PersonnelManagement'
export default { export default {
data() { data() {
return { return {
PageCurrentN: 1,
PageSizeN: 10,
totalN: null,
LeavingList: [],
LeavingListVisiable: false,
departmentData: [], departmentData: [],
expandAll: true, expandAll: true,
i: 1, i: 1,
@@ -449,6 +546,7 @@ export default {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.getTreeData() this.getTreeData()
this.$message.success('添加成功') this.$message.success('添加成功')
this.i = 0
} else { } else {
this.$message.error('添加失败') this.$message.error('添加失败')
} }
@@ -458,6 +556,7 @@ export default {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.getTreeData() this.getTreeData()
this.$message.success('添加成功') this.$message.success('添加成功')
this.i = 1
} else { } else {
this.$message.error('添加失败') this.$message.error('添加失败')
} }
@@ -538,21 +637,9 @@ export default {
}, },
addPeople() { addPeople() {
if (this.id) { if (this.id) {
<<<<<<< HEAD
addPeople(this.id, this.people_form.Sex, this.people_form.Education, this.people_form.Address, this.people_form.Nation, this.people_form.Post, this.people_form.AccountNumber, this.people_form.Password, this.people_form.Name, this.people_form.IDcard, this.people_form.TimeOfEntry, this.people_form.Birthday, this.people_form.ContactInformation).then(response => {
if (response.data[0].result === '1') {
this.i = 1
this.handleNodeClick()
this.$message.success('添加成功')
} else {
this.$message.error('添加失败')
}
})
=======
this.people_title = '新增人员' this.people_title = '新增人员'
this.people_DFV = true this.people_DFV = true
this.addForm('people_form') this.addForm('people_form')
>>>>>>> 7cdb10d153358b72f95165dd7f3a12ad7675f14d
} else { } else {
this.$message.warning(`请选择部门名称`) this.$message.warning(`请选择部门名称`)
} }
@@ -561,7 +648,7 @@ export default {
this.people_DFV = false this.people_DFV = false
addPeople(this.id, this.people_form.Sex, this.people_form.Education, this.people_form.Address, this.people_form.Nation, this.people_form.Post, this.people_form.AccountNumber, this.people_form.Password, this.people_form.Name, this.people_form.IDcard, this.people_form.TimeOfEntry, this.people_form.Birthday, this.people_form.ContactInformation).then(response => { addPeople(this.id, this.people_form.Sex, this.people_form.Education, this.people_form.Address, this.people_form.Nation, this.people_form.Post, this.people_form.AccountNumber, this.people_form.Password, this.people_form.Name, this.people_form.IDcard, this.people_form.TimeOfEntry, this.people_form.Birthday, this.people_form.ContactInformation).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.i = 1 this.i = 0
this.handleNodeClick() this.handleNodeClick()
this.$message.success('添加成功') this.$message.success('添加成功')
} else { } else {
@@ -604,6 +691,7 @@ export default {
}, },
deletePeopleTable(row) { deletePeopleTable(row) {
this.deleteRow(delPeopleList, row.人员编号, function() { this.id ? this.handleNodeClick() : this.feathPeopleForName() }) this.deleteRow(delPeopleList, row.人员编号, function() { this.id ? this.handleNodeClick() : this.feathPeopleForName() })
this.i = 0
}, },
postMaintain() { postMaintain() {
@@ -623,8 +711,49 @@ export default {
this.total = response.data.total this.total = response.data.total
}) })
}, },
handleSizeChangeN(val) {
this.PageSizeN = val
this.PageCurrentN = 1
this.getTable(searchLeavingList, [this.PageCurrentN, this.PageSizeN], ['LeavingList', 'totalN'])
},
handleCurrentChangeN(val) {
this.PageCurrentN = val
this.getTable(searchLeavingList, [this.PageCurrentN, this.PageSizeN], ['LeavingList', 'totalN'])
},
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val
},
Quit() {
if (this.multipleSelection.length === 0) {
this.$message.warning('请选择进行离职操作的员工')
} else {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
for (let i = 0; i < this.multipleSelection.length; i++) {
quit(this.multipleSelection[i].人员编号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('离职成功')
getTablePeople(this.id, this.PageCurrent, this.PageSize).then(response => {
this.List = response.data.rows
this.total = response.data.total
})
} else { this.$message.error('离职失败') }
})
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消离职操作'
})
})
}
},
searchLeavingList() {
this.LeavingListVisiable = true
this.getTable(searchLeavingList, [this.PageCurrentN, this.PageSizeN], ['LeavingList', 'totalN'])
} }
} }
} }

View File

@@ -277,6 +277,7 @@ export default {
this.check2 = 0 this.check2 = 0
} }
searchTable(this.check1, this.staffName, this.check2, this.roleName, this.pageCurrent1, this.pageSize1).then(response => { searchTable(this.check1, this.staffName, this.check2, this.roleName, this.pageCurrent1, this.pageSize1).then(response => {
console.log(response)
this.tableData = response.data.rows this.tableData = response.data.rows
this.total1 = response.data.total this.total1 = response.data.total
}) })