人员管理增加移动功能

This commit is contained in:
caoxinyu
2019-01-25 10:43:10 +08:00
parent 146e17fc2f
commit 8a18e826e4
2 changed files with 59 additions and 31 deletions

View File

@@ -20,7 +20,7 @@ const service = axios.create({
// baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`,
baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`,
baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://localhost:8077/submit/MESCommonBase.ashx`,
// baseURL: `http://192.168.0.112:8411/submit/MESCommonBase.ashx`,
timeout: 1500000 // 请求超时时间

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 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>
@@ -389,7 +389,7 @@
</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 {
@@ -761,6 +761,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
}
}
}