配置岗位多选
This commit is contained in:
@@ -68,6 +68,12 @@
|
||||
清空
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button size="mini" type="primary" @click="selectEdit">
|
||||
批量配置岗位
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table
|
||||
@@ -78,8 +84,14 @@
|
||||
style="width: 100%; flex: auto;"
|
||||
class="drag-table"
|
||||
height="100%"
|
||||
@selection-change="selectedData"
|
||||
:header-cell-style="{background: '#E8E8E8', color: '#333333', fontSize: '16px',
|
||||
fontWeight: 'bold', height: '48px'}">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="account"
|
||||
label="账号"
|
||||
@@ -177,7 +189,7 @@
|
||||
<loading style="z-index: 2099;" :loading="treeLoading">导入中...</loading>
|
||||
<el-drawer
|
||||
class="postPage"
|
||||
title="配置岗位"
|
||||
:title="drawerTitle"
|
||||
:visible.sync="modalPost"
|
||||
:wrapperClosable="false"
|
||||
size="800px"
|
||||
@@ -269,7 +281,10 @@ export default {
|
||||
data: [], // table数据
|
||||
treeLoading: false,
|
||||
Loading: false,
|
||||
id: ''
|
||||
id: '',
|
||||
// 批量配置岗位勾选暂存
|
||||
manageData: [],
|
||||
drawerTitle: '配置岗位'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -285,16 +300,30 @@ export default {
|
||||
this.modalPost = false
|
||||
},
|
||||
PostSubmit() {
|
||||
this.$http.postData('sarUser/user/position', {
|
||||
positionIds: this.$refs.tree2.getCheckedKeys(),
|
||||
userId: this.userId
|
||||
}, {}, res => {
|
||||
if (res.ok) {
|
||||
this.$message.success('配置岗位成功')
|
||||
this.modalPost = false
|
||||
this.getData()
|
||||
}
|
||||
})
|
||||
if (this.drawerTitle === '配置岗位') {
|
||||
this.$http.postData('sarUser/user/position', {
|
||||
positionIds: this.$refs.tree2.getCheckedKeys(),
|
||||
userId: this.userId
|
||||
}, {}, res => {
|
||||
if (res.ok) {
|
||||
this.$message.success('配置岗位成功')
|
||||
this.modalPost = false
|
||||
this.getData()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$http.postData('sarUser/user/positionBatch', {
|
||||
positionIds: this.$refs.tree2.getCheckedKeys(),
|
||||
userId: this.userId
|
||||
}, {}, res => {
|
||||
if (res.ok) {
|
||||
this.$message.success('配置岗位成功')
|
||||
this.modalPost = false
|
||||
this.getData()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
searchPostName() {
|
||||
this.page = 1;
|
||||
@@ -407,7 +436,6 @@ export default {
|
||||
loading: 'treeLoading'
|
||||
}, res => {
|
||||
this.treeData = res.data
|
||||
console.log(this.treeData);
|
||||
this.nodeKeyId = this.treeData[0].id
|
||||
this.$nextTick(function () {
|
||||
this.$refs.tree.setCurrentKey(this.nodeKeyId)
|
||||
@@ -493,6 +521,20 @@ export default {
|
||||
this.pageSize = pageSize
|
||||
this.getTree2()
|
||||
},
|
||||
|
||||
/** 批量编辑岗位的勾选数据 */
|
||||
selectedData(val) {
|
||||
this.manageData = val
|
||||
},
|
||||
|
||||
selectEdit() {
|
||||
this.userId = []
|
||||
this.manageData.forEach(item=>{
|
||||
this.userId.push(item.userId)
|
||||
})
|
||||
this.drawerTitle = '批量配置岗位'
|
||||
this.modalPost = true
|
||||
},
|
||||
},
|
||||
computed: {},
|
||||
watch: {
|
||||
|
||||
@@ -314,7 +314,7 @@ export default {
|
||||
},
|
||||
//清空
|
||||
clearSearch() {
|
||||
this.sarSarAccessEOSearch.projectName = ''
|
||||
this.sarSarAccessEOSearch.carType = ''
|
||||
this.sarSarAccessEOSearch.detailedListName = ''
|
||||
this.searchSarAccess()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user