add:机构管理增加根据部门批量配置岗位功能

This commit is contained in:
zyd
2022-08-30 23:59:46 +08:00
parent e31fdacb4c
commit 806dd53e32
@@ -72,6 +72,9 @@
<el-button size="mini" type="primary" @click="selectEdit" v-btn-permission="'786a941b255a4fe4d13b7e67f100a4e5'"> <el-button size="mini" type="primary" @click="selectEdit" v-btn-permission="'786a941b255a4fe4d13b7e67f100a4e5'">
批量配置岗位 批量配置岗位
</el-button> </el-button>
<el-button size="mini" type="primary" @click="selectEditOfOrg" v-btn-permission="'786a941b255a4fe4d13b7e67f100a4e5'">
根据部门批量配置岗位
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@@ -186,7 +189,6 @@
<loading :loading="Loading">加载中...</loading> <loading :loading="Loading">加载中...</loading>
<pagination :page="page" :total="total" :pageSize="pageSize" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination> <pagination :page="page" :total="total" :pageSize="pageSize" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
</div> </div>
<loading style="z-index: 2099;" :loading="treeLoading">导入中...</loading>
<el-drawer <el-drawer
class="postPage" class="postPage"
:title="drawerTitle" :title="drawerTitle"
@@ -236,12 +238,14 @@
class="common-button-primary" class="common-button-primary"
icon="el-icon-check" icon="el-icon-check"
type="primary" type="primary"
:loading="butionLoading"
@click="PostSubmit" @click="PostSubmit"
>确定 >确定
</el-button> </el-button>
<el-button size="mini" class="common-button-default" icon="el-icon-close" @click="resetFormPost">取消</el-button> <el-button size="mini" class="common-button-default" icon="el-icon-close" @click="resetFormPost">取消</el-button>
</div> </div>
</el-drawer> </el-drawer>
<loading style="z-index: 2099;" :loading="treeLoading">导入中...</loading>
</div> </div>
</template> </template>
@@ -284,9 +288,11 @@ export default {
data: [], // table数据 data: [], // table数据
treeLoading: false, treeLoading: false,
Loading: false, Loading: false,
butionLoading: false,
id: '', id: '',
// 批量配置岗位勾选暂存 // 批量配置岗位勾选暂存
manageData: [], manageData: [],
configOrgManage:false,
drawerTitle: '配置岗位' drawerTitle: '配置岗位'
} }
}, },
@@ -301,26 +307,43 @@ export default {
}, },
resetFormPost() { resetFormPost() {
this.modalPost = false this.modalPost = false
this.postList = []
this.page1 = 1 this.page1 = 1
}, },
PostSubmit() { PostSubmit() {
this.butionLoading = true
if (this.drawerTitle === '配置岗位') { if (this.drawerTitle === '配置岗位') {
this.$http.postData('sarUser/user/position', { this.$http.postData('sarUser/user/position', {
positionIds: this.$refs.tree2.getCheckedKeys(), positionIds: this.$refs.tree2.getCheckedKeys(),
userId: this.userId userId: this.userId
}, {}, res => { }, {}, res => {
if (res.ok) { if (res.ok) {
this.butionLoading = false
this.$message.success('配置岗位成功') this.$message.success('配置岗位成功')
this.modalPost = false this.modalPost = false
this.getData() this.getData()
} }
}) })
} else { } else if(this.configOrgManage){
//批量配置岗位信息
this.$http.postData('sarUser/user/positionBatchByOrgId', {
positionIds: this.$refs.tree2.getCheckedKeys(),
orgId: this.id
}, {}, res => {
if (res.ok) {
this.butionLoading = false
this.$message.success('批量配置岗位成功')
this.modalPost = false
this.getData()
}
})
}else{
this.$http.postData('sarUser/user/positionBatch', { this.$http.postData('sarUser/user/positionBatch', {
positionIds: this.$refs.tree2.getCheckedKeys(), positionIds: this.$refs.tree2.getCheckedKeys(),
userId: this.userId userId: this.userId
}, {}, res => { }, {}, res => {
if (res.ok) { if (res.ok) {
this.butionLoading = false
this.$message.success('配置岗位成功') this.$message.success('配置岗位成功')
this.modalPost = false this.modalPost = false
this.getData() this.getData()
@@ -539,6 +562,7 @@ export default {
}, },
selectEdit() { selectEdit() {
this.configOrgManage = false
this.getTree2() this.getTree2()
if(this.manageData.length){ if(this.manageData.length){
this.userId = [] this.userId = []
@@ -551,6 +575,13 @@ export default {
this.$message.warning('请选择需要批量配置岗位的角色') this.$message.warning('请选择需要批量配置岗位的角色')
} }
}, },
selectEditOfOrg() {
this.configOrgManage = true
this.getTree2()
this.drawerTitle = '批量配置岗位'
this.modalPost = true
},
}, },
computed: {}, computed: {},
watch: { watch: {