This commit is contained in:
zhangdingyu
2019-01-26 10:52:01 +08:00
3 changed files with 76 additions and 46 deletions

View File

@@ -64,7 +64,7 @@ export default {
var nian = str.substr(0, 4)
var yue = str.substr(5, 2)
var ri = str.substr(8, 2)
if (str.substr(5, 1) === '0') {
if (str.substr(5, 1) === '0') {z
yue = yue.replace('0', '')
}
if (str.substr(8, 1) === '0') {

View File

@@ -17,36 +17,36 @@
<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>-->
<el-button v-popover:popover4 :disabled="disabledMove" type="success" icon="el-icon-sort" size="small" @click="moveGroup">移动
</el-button>
<!--<el-button size="small" @click="postMaintain()">岗位维护</el-button>-->
<!--<el-popover-->
<!--ref="popover4"-->
<!--width="178"-->
<!--placement="right"-->
<!--trigger="click"-->
<!--@hide="hide()">-->
<!--<el-dropdown size="small" placement="bottom-start" style="margin-right: 0">-->
<!--<el-input-->
<!--v-model="nodeName1"-->
<!--:disabled="true"-->
<!--size="small"-->
<!--placeholder="请选择部门"/>-->
<!--<el-button type="text" size="small" style="margin-left: 60px; margin-top: 15px" @click="moveGroupConfim">-->
<!--确认-->
<!--</el-button>-->
<!--<el-dropdown-menu slot="dropdown">-->
<!--<el-tree-->
<!--ref="treeForm"-->
<!--:data="departmentData"-->
<!--:props="defaultProps"-->
<!--style="width: 150px"-->
<!--node-key="id"-->
<!--accordion-->
<!--@node-click="NodeClick"/>-->
<!--</el-dropdown-menu>-->
<!--</el-dropdown>-->
<!--</el-popover>-->
<el-popover
ref="popover4"
width="178"
placement="right"
trigger="click"
@hide="hide()">
<el-dropdown size="small" placement="bottom-start" style="margin-right: 0">
<el-input
v-model="nodeName1"
:disabled="true"
size="small"
placeholder="请选择部门"/>
<el-button type="text" size="small" style="margin-left: 60px; margin-top: 15px" @click="moveGroupConfim">
确认
</el-button>
<el-dropdown-menu slot="dropdown">
<el-tree
ref="treeForm"
:data="departmentData"
:props="defaultProps"
style="width: 150px"
node-key="id"
accordion
@node-click="NodeClick"/>
</el-dropdown-menu>
</el-dropdown>
</el-popover>
</el-card>
</el-col>
</el-row>
@@ -124,12 +124,12 @@
</el-table-column>
<el-table-column align="center" label="入职时间" width="100">
<template slot-scope="scope">
{{ scope.row.入公司时间 }}
{{ scope.row.入公司时间 !== '' && scope.row.入公司时间 !== null ? scope.row.入公司时间 = scope.row.入公司时间.split(' ')[0]: scope.row.入公司时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="出生日期" width="100">
<template slot-scope="scope">
{{ scope.row.出生日期 }}
{{ scope.row.出生日期 !== '' && scope.row.出生日期 !== null ? scope.row.出生日期 = scope.row.出生日期.split(' ')[0]: scope.row.出生日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="联系方式" width="110">
@@ -170,7 +170,7 @@
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="PageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@@ -345,12 +345,12 @@
</el-table-column>
<el-table-column align="center" label="入职时间" width="100">
<template slot-scope="scope">
{{ scope.row.入公司时间 }}
{{ scope.row.入公司时间 !== '' && scope.row.入公司时间 !== null ? scope.row.入公司时间 = scope.row.入公司时间.split(' ')[0]: scope.row.入公司时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="出生日期" width="100">
<template slot-scope="scope">
{{ scope.row.出生日期 }}
{{ scope.row.出生日期 !== '' && scope.row.出生日期 !== null ? scope.row.出生日期 = scope.row.出生日期.split(' ')[0]: scope.row.出生日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="联系方式" width="110">
@@ -368,7 +368,7 @@
{{ scope.row.民族 }}
</template>
</el-table-column>
<el-table-column align="center" label="家庭住址" width="200">
<el-table-column align="center" label="家庭住址">
<template slot-scope="scope">
{{ scope.row.家庭住址 }}
</template>
@@ -389,10 +389,11 @@
</template>
<script>
import { getTree, tree, getTablePeople, getTablePeopleForName, addDepartmentName, delList, editList, delPeopleList, fetchEducationData, fetchPostData, addPeople, editPeople, quit, searchLeavingList } from '@/api/BasicData/PersonnelManagement'
import { moveGroups, getTree, tree, getTablePeople, getTablePeopleForName, addDepartmentName, delList, editList, delPeopleList, fetchEducationData, fetchPostData, addPeople, editPeople, quit, searchLeavingList } from '@/api/BasicData/PersonnelManagement'
export default {
data() {
return {
disabledMove: true,
PageCurrentN: 1,
PageSizeN: 10,
totalN: null,
@@ -403,7 +404,7 @@ export default {
i: 1,
id: '',
PageCurrent: 1,
PageSize: 10,
PageSize: 50,
List: [],
total: null,
nodeName: '',
@@ -729,6 +730,7 @@ export default {
},
handleSelectionChange(val) {
this.multipleSelection = val
this.multipleSelection.length === 0 ? this.disabledMove = true : this.disabledMove = false
},
Quit() {
if (this.multipleSelection.length === 0) {
@@ -761,6 +763,34 @@ export default {
searchLeavingList() {
this.LeavingListVisiable = true
this.getTable(searchLeavingList, [this.PageCurrentN, this.PageSizeN], ['LeavingList', 'totalN'])
},
moveGroupConfim() {
this.id = this.node
for (let i = 0; i < this.multipleSelection.length; i++) {
moveGroups(this.multipleSelection[i].人员编号, this.node).then(response => {
if (response.data[0].result === '1') {
this.handleNodeClick()
if (i === this.multipleSelection.length - 1) {
this.$message.success('移组成功')
}
} else {
this.$message.error('更新失败')
}
})
}
},
hide() {
this.nodeName1 = ''
this.node = ''
},
moveGroup() {
if (this.multipleSelection.length === 0) {
this.$message.warning('请至少选择一个人员')
}
},
NodeClick(data) {
this.node = data.id
this.nodeName1 = data.label
}
}
}