commit
This commit is contained in:
@@ -9,7 +9,6 @@
|
|||||||
v-model="filterText">
|
v-model="filterText">
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-tree
|
<el-tree
|
||||||
class="filter-tree"
|
|
||||||
:data="treeData"
|
:data="treeData"
|
||||||
:props="defaultProps"
|
:props="defaultProps"
|
||||||
default-expand-all
|
default-expand-all
|
||||||
@@ -65,7 +64,7 @@
|
|||||||
label="所属部门">
|
label="所属部门">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="positionName"
|
prop="NameList"
|
||||||
label="所属岗位">
|
label="所属岗位">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@@ -83,6 +82,7 @@
|
|||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item v-if="scope.row.disableFlag === '1'" :command="[scope.row, '启用']">启用</el-dropdown-item>
|
<el-dropdown-item v-if="scope.row.disableFlag === '1'" :command="[scope.row, '启用']">启用</el-dropdown-item>
|
||||||
<el-dropdown-item v-if="scope.row.disableFlag === '0'" :command="[scope.row, '禁用']">禁用</el-dropdown-item>
|
<el-dropdown-item v-if="scope.row.disableFlag === '0'" :command="[scope.row, '禁用']">禁用</el-dropdown-item>
|
||||||
|
<el-dropdown-item :command="[scope.row, '配置岗位']">配置岗位</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
@@ -94,6 +94,36 @@
|
|||||||
<pagination :page="page" :total="total" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
|
<pagination :page="page" :total="total" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
|
||||||
</div>
|
</div>
|
||||||
<loading style="z-index: 2099;" :loading="treeLoading">导入中...</loading>
|
<loading style="z-index: 2099;" :loading="treeLoading">导入中...</loading>
|
||||||
|
<el-drawer
|
||||||
|
title="配置岗位"
|
||||||
|
:visible.sync="modalPost"
|
||||||
|
:wrapperClosable="false"
|
||||||
|
size="800px"
|
||||||
|
@close="resetFormPost"
|
||||||
|
>
|
||||||
|
<el-tree
|
||||||
|
ref="tree2"
|
||||||
|
node-key="id"
|
||||||
|
class="filter-tree"
|
||||||
|
v-if="modalPost"
|
||||||
|
:props="props"
|
||||||
|
:data="postList"
|
||||||
|
:default-checked-keys="nodeList"
|
||||||
|
check-strictly
|
||||||
|
default-expand-all
|
||||||
|
show-checkbox>
|
||||||
|
</el-tree>
|
||||||
|
<div id="roleFormButton" class="demo-drawer-footer">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
class="common-button-primary"
|
||||||
|
icon="el-icon-check"
|
||||||
|
type="primary"
|
||||||
|
@click="PostSubmit"
|
||||||
|
>确定</el-button>
|
||||||
|
<el-button size="mini" class="common-button-default" icon="el-icon-close" @click="resetFormPost">取消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-drawer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -102,6 +132,14 @@ export default {
|
|||||||
name: 'MechanismManage',
|
name: 'MechanismManage',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
userId: '',
|
||||||
|
postList: [],
|
||||||
|
props: {
|
||||||
|
children: 'children',
|
||||||
|
label: 'name'
|
||||||
|
},
|
||||||
|
nodeList: [],
|
||||||
|
modalPost: false,
|
||||||
filterText: '', // 树结构检索条件
|
filterText: '', // 树结构检索条件
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
@@ -119,6 +157,21 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
resetFormPost () {
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
handleCommand (command) {
|
handleCommand (command) {
|
||||||
switch (command[1]) {
|
switch (command[1]) {
|
||||||
case '启用':
|
case '启用':
|
||||||
@@ -127,8 +180,27 @@ export default {
|
|||||||
case '禁用':
|
case '禁用':
|
||||||
this.disableFlagEdit(command[0], 1)
|
this.disableFlagEdit(command[0], 1)
|
||||||
break
|
break
|
||||||
|
case '配置岗位':
|
||||||
|
this.postsConfigure(command[0])
|
||||||
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getTree2 () {
|
||||||
|
this.$http.get('sarPosition/position', {}, {
|
||||||
|
_this: this,
|
||||||
|
}, res=> {
|
||||||
|
this.postList = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
postsConfigure (row) {
|
||||||
|
var arr = []
|
||||||
|
this.userId = row.userId
|
||||||
|
row.positions.forEach((item) => {
|
||||||
|
arr.push(item.id)
|
||||||
|
})
|
||||||
|
this.nodeList = arr
|
||||||
|
this.modalPost= true
|
||||||
|
},
|
||||||
disableFlagEdit (row, type) {
|
disableFlagEdit (row, type) {
|
||||||
let json = {}
|
let json = {}
|
||||||
json.userId = row.userId
|
json.userId = row.userId
|
||||||
@@ -173,6 +245,16 @@ export default {
|
|||||||
_this: this,
|
_this: this,
|
||||||
loading: 'Loading'
|
loading: 'Loading'
|
||||||
}, res => {
|
}, res => {
|
||||||
|
res.data.forEach((item) => {
|
||||||
|
var NameList = ''
|
||||||
|
item.positions.forEach((items) => {
|
||||||
|
if (NameList.length > 0) {
|
||||||
|
NameList += ','
|
||||||
|
}
|
||||||
|
NameList += items.name
|
||||||
|
})
|
||||||
|
item.NameList = NameList
|
||||||
|
})
|
||||||
this.data = res.data
|
this.data = res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -194,6 +276,7 @@ export default {
|
|||||||
mounted () {
|
mounted () {
|
||||||
// 获取组织结构树
|
// 获取组织结构树
|
||||||
this.getTree()
|
this.getTree()
|
||||||
|
this.getTree2()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -263,6 +346,9 @@ export default {
|
|||||||
/deep/.width-all{
|
/deep/.width-all{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.filter-tree {
|
||||||
|
height: calc(~'100% - 50px')
|
||||||
|
}
|
||||||
.laws-tree{
|
.laws-tree{
|
||||||
/deep/.clearable {
|
/deep/.clearable {
|
||||||
top: 20px;
|
top: 20px;
|
||||||
|
|||||||
@@ -47,11 +47,26 @@
|
|||||||
label="操作时间"
|
label="操作时间"
|
||||||
width="170px">
|
width="170px">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
width="50px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div @click.stop style="display: inline-block">
|
||||||
|
<el-dropdown trigger="click" @command="handleCommand">
|
||||||
|
<i class="iconfont"></i>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item :command="[scope.row, '删除']">删除</el-dropdown-item>
|
||||||
|
<el-dropdown-item :command="[scope.row, '编辑']">编辑</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<loading :loading="Loading">加载中...</loading>
|
<loading :loading="Loading">加载中...</loading>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="新增岗位"
|
:title="dialogTitle"
|
||||||
:visible.sync="modalshowflag"
|
:visible.sync="modalshowflag"
|
||||||
:wrapperClosable="false"
|
:wrapperClosable="false"
|
||||||
size="800px"
|
size="800px"
|
||||||
@@ -113,6 +128,9 @@
|
|||||||
name: 'PostManage',
|
name: 'PostManage',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
editId: '',
|
||||||
|
type: '', // 1为新增 2为编辑
|
||||||
|
dialogTitle: '',
|
||||||
nodeList: [],
|
nodeList: [],
|
||||||
submitLoading: false,
|
submitLoading: false,
|
||||||
selectList: [],
|
selectList: [],
|
||||||
@@ -136,6 +154,33 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleCommand (command) {
|
||||||
|
switch (command[1]) {
|
||||||
|
case '删除':
|
||||||
|
this.deleteData(command[0])
|
||||||
|
break
|
||||||
|
case '编辑':
|
||||||
|
this.editData(command[0])
|
||||||
|
break
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deleteData (row) {
|
||||||
|
this.$http.delete('sarPosition/position', {
|
||||||
|
positionId: row.id
|
||||||
|
}, {}, res => {
|
||||||
|
if (res.ok) {
|
||||||
|
this.$message.success('删除成功')
|
||||||
|
this.getData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
editData (row) {
|
||||||
|
this.type = 2
|
||||||
|
this.editId = row.id
|
||||||
|
this.sarStandardsInfoEO.name = row.name
|
||||||
|
this.dialogTitle = '修改岗位信息'
|
||||||
|
this.modalshowflag = true
|
||||||
|
},
|
||||||
RoleSubmit () { // 配置角色提交
|
RoleSubmit () { // 配置角色提交
|
||||||
this.submitLoading = true
|
this.submitLoading = true
|
||||||
this.$http.postData('sarPosition/position/role', {
|
this.$http.postData('sarPosition/position/role', {
|
||||||
@@ -164,9 +209,9 @@
|
|||||||
this.selectList = val
|
this.selectList = val
|
||||||
},
|
},
|
||||||
addRole () { // 点击配置角色按钮
|
addRole () { // 点击配置角色按钮
|
||||||
this.nodeList = this.selectList[0].idList
|
|
||||||
if (this.selectList.length === 1) {
|
if (this.selectList.length === 1) {
|
||||||
this.modalRole = true
|
this.modalRole = true
|
||||||
|
this.nodeList = this.selectList[0].idList
|
||||||
} else if (this.selectList.length === 0) {
|
} else if (this.selectList.length === 0) {
|
||||||
this.$message.warning('请选择要配置角色的岗位')
|
this.$message.warning('请选择要配置角色的岗位')
|
||||||
} else {
|
} else {
|
||||||
@@ -195,6 +240,8 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
addModal () { // 点击新增按钮
|
addModal () { // 点击新增按钮
|
||||||
|
this.type = 1
|
||||||
|
this.dialogTitle = '新增岗位'
|
||||||
this.modalshowflag = true
|
this.modalshowflag = true
|
||||||
},
|
},
|
||||||
resetForm () { // 新增岗位关闭事件
|
resetForm () { // 新增岗位关闭事件
|
||||||
@@ -204,22 +251,40 @@
|
|||||||
submit () { // 新增角色确认
|
submit () { // 新增角色确认
|
||||||
this.$refs['sarStandardsInfoForm'].validate((valid) => {
|
this.$refs['sarStandardsInfoForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$http.post('sarPosition/position', {
|
if (this.type === 1) {
|
||||||
createById: this.$store.getters.userInfo.userId,
|
this.$http.post('sarPosition/position', {
|
||||||
operator: this.$store.getters.userInfo.account,
|
createById: this.$store.getters.userInfo.userId,
|
||||||
name: this.sarStandardsInfoEO.name
|
operator: this.$store.getters.userInfo.account,
|
||||||
}, {
|
name: this.sarStandardsInfoEO.name
|
||||||
_this: this,
|
}, {
|
||||||
loading: 'Loading'
|
_this: this,
|
||||||
}, res=> {
|
loading: 'Loading'
|
||||||
if (res.ok) {
|
}, res=> {
|
||||||
this.$message.success('新增成功')
|
if (res.ok) {
|
||||||
this.modalshowflag = false
|
this.$message.success('新增成功')
|
||||||
this.getData()
|
this.modalshowflag = false
|
||||||
} else {
|
this.getData()
|
||||||
this.$message.warning(res.message)
|
} else {
|
||||||
}
|
this.$message.warning(res.message)
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$http.put('sarPosition/position', {
|
||||||
|
id: this.editId,
|
||||||
|
name: this.sarStandardsInfoEO.name
|
||||||
|
}, {
|
||||||
|
_this: this,
|
||||||
|
loading: 'Loading'
|
||||||
|
}, res=> {
|
||||||
|
if (res.ok) {
|
||||||
|
this.$message.success('修改成功')
|
||||||
|
this.modalshowflag = false
|
||||||
|
this.getData()
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user