Browse Source

人员管理树列表

master
wanggongfeng 6 years ago
parent
commit
c7db35652f
  1. 7
      src/views/modules/organize/deptofficer.vue
  2. 53
      src/views/modules/organize/metasysdept.vue
  3. 2
      src/views/modules/organize/sysdeptmanagement.vue

7
src/views/modules/organize/deptofficer.vue

@ -99,13 +99,10 @@ export default {
dataForm: { dataForm: {
id: '' id: ''
}, },
deptofficerAddVisible: false, deptofficerAddVisible: false
pidList: []
} }
}, },
mounted () { mounted () {
this.pidList = JSON.parse(this.$route.query.pidList)
console.log(this.$route.query.deptId)
this.dataForm.deptId = this.$route.query.deptId this.dataForm.deptId = this.$route.query.deptId
this.getDataList() this.getDataList()
}, },
@ -124,7 +121,7 @@ export default {
backToDeptList () { backToDeptList () {
this.$emit('refreshDataList') this.$emit('refreshDataList')
this.$parent.selectComponent = 'Metasysdept' this.$parent.selectComponent = 'Metasysdept'
this.$router.push({ path: '/organize-organizedeptroute', query: { pidList: JSON.stringify(this.pidList) } }) this.$router.push({ path: '/organize-organizedeptroute' })
}, },
deptofficerAddHandle (deptId) { deptofficerAddHandle (deptId) {
this.deptofficerAddVisible = true this.deptofficerAddVisible = true

53
src/views/modules/organize/metasysdept.vue

@ -26,27 +26,17 @@
{{scope.$index+1}} {{scope.$index+1}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="名称" header-align="center" align="center"></el-table-column> <table-tree-column prop="name" label="名称" header-align="center"></table-tree-column>
<el-table-column prop="parentName" label="上级部门" header-align="center" align="center"></el-table-column> <el-table-column prop="parentName" label="上级部门" header-align="center" align="center"></el-table-column>
<el-table-column prop="sort" label="排序" header-align="center" align="center" width="80"></el-table-column> <el-table-column prop="sort" label="排序" header-align="center" align="center" width="80"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="$hasPermission('sys:metasysdept:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> <el-button v-if="$hasPermission('sys:metasysdept:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:metasysdept:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> <el-button v-if="$hasPermission('sys:metasysdept:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-button type="text" size="small" @click="lookHandle(scope.row.id,scope.row.pid)" :disabled="scope.row.typeKey == 'grid_party'">查看</el-button>
<el-button type="text" size="small" @click="manageHandle(scope.row.id,scope.row.pid)">管理</el-button> <el-button type="text" size="small" @click="manageHandle(scope.row.id,scope.row.pid)">管理</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
@ -62,8 +52,7 @@ export default {
data () { data () {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/cloudAnalysis/metasysdept/page', getDataListURL: '/cloudAnalysis/metasysdept/list',
getDataListIsPage: true,
deleteURL: '/cloudAnalysis/metasysdept', deleteURL: '/cloudAnalysis/metasysdept',
deleteIsBatch: true deleteIsBatch: true
}, },
@ -76,16 +65,8 @@ export default {
} }
}, },
mounted () { mounted () {
if (this.$route.query.pidList !== null && this.$route.query.pidList !== undefined) {
this.pidList = JSON.parse(this.$route.query.pidList)
this.dataForm.pid = this.pidList[this.pidList.length - 1]
} else {
this.dataForm.pid = 0
}
this.getDataList() this.getDataList()
}, },
created: function () {
},
components: { components: {
TableTreeColumn, TableTreeColumn,
AddOrUpdate AddOrUpdate
@ -93,35 +74,7 @@ export default {
methods: { methods: {
manageHandle (deptId, pid) { manageHandle (deptId, pid) {
this.$parent.selectComponent = 'Deptofficer' this.$parent.selectComponent = 'Deptofficer'
this.$router.push({ path: '/organize-organizedeptroute', query: { pidList: JSON.stringify(this.pidList), deptId: deptId } }) this.$router.push({ path: '/organize-organizedeptroute', query: { deptId: deptId } })
},
lookHandle (id, pid) {
this.page = 1
this.pidList.push(id)
this.$parent.selectComponent = 'Metasysdept'
this.$router.push({ path: '/organize-organizedeptroute', query: { pidList: JSON.stringify(this.pidList) } })
if (this.$route.query.pidList !== null && this.$route.query.pidList !== undefined) {
this.pidList = JSON.parse(this.$route.query.pidList)
this.dataForm.pid = this.pidList[this.pidList.length - 1]
} else {
this.dataForm.pid = 0
}
this.getDataList()
},
backToDeptList () {
this.page = 1
var m = this.pidList.splice(this.pidList.length - 1, 1)
m.pop()
this.$emit('refreshDataList')
this.$parent.selectComponent = 'Metasysdept'
this.$router.push({ path: '/organize-organizedeptroute', query: { pidList: JSON.stringify(this.pidList) } })
if (this.$route.query.pidList !== null && this.$route.query.pidList !== undefined) {
this.pidList = JSON.parse(this.$route.query.pidList)
this.dataForm.pid = this.pidList[this.pidList.length - 1]
} else {
this.dataForm.pid = 0
}
this.getDataList()
} }
} }
} }

2
src/views/modules/organize/sysdeptmanagement.vue

@ -48,7 +48,7 @@ export default {
TableTreeColumn, TableTreeColumn,
AddOrUpdate AddOrUpdate
}, },
methods : { methods: {
active_text (value, row) { active_text (value, row) {
this.$http.put(`/cloudAnalysis/metaSysdeptManager`, row).then(({ data: res }) => { this.$http.put(`/cloudAnalysis/metaSysdeptManager`, row).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {

Loading…
Cancel
Save