Browse Source

人员管理

master
wanggongfeng 6 years ago
parent
commit
c02fdb7876
  1. 19
      src/views/modules/organize/deptofficer.vue
  2. 49
      src/views/modules/organize/metasysdept.vue

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

@ -2,6 +2,11 @@
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__deptofficer}"> <div class="mod-sys__deptofficer}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<div>
<el-form-item>
<el-button type="primary" @click="backToDeptList">返回</el-button>
</el-form-item>
</div>
<el-form-item> <el-form-item>
<el-input v-model="dataForm.id" placeholder="id" clearable></el-input> <el-input v-model="dataForm.id" placeholder="id" clearable></el-input>
</el-form-item> </el-form-item>
@ -67,11 +72,23 @@ export default {
}, },
dataForm: { dataForm: {
id: '' id: ''
},
pidList: []
} }
} },
mounted () {
this.pidList = JSON.parse(this.$route.query.pidList)
this.dataForm.deptId = this.$route.query.deptId
}, },
components: { components: {
AddOrUpdate AddOrUpdate
},
methods: {
backToDeptList () {
this.$emit('refreshDataList')
this.$parent.selectComponent = 'Metasysdept'
this.$router.push({ path: '/organize-organizedeptroute', query: { pidList: JSON.stringify(this.pidList) } })
}
} }
} }
</script> </script>

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

@ -2,7 +2,7 @@
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__metasysdept}"> <div class="mod-sys__metasysdept}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<div v-if="backBtnVisible"> <div v-if="dataForm.pid != 0">
<el-form-item> <el-form-item>
<el-button type="primary" @click="backToDeptList">返回</el-button> <el-button type="primary" @click="backToDeptList">返回</el-button>
</el-form-item> </el-form-item>
@ -23,12 +23,12 @@
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column prop="name" label="名称" header-align="center"></el-table-column> <el-table-column prop="name" label="名称" header-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" :formatter = "isOnclick"> <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="isOnclickFlag">查看</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)">管理</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>
@ -66,15 +66,14 @@ export default {
pid: '', pid: '',
name: '' name: ''
}, },
backBtnVisible: true,
isOnclickFlag: false,
pidList: [0] pidList: [0]
} }
}, },
mounted () { mounted () {
this.dataForm.pid = this.$route.query.pid if (this.$route.query.pidList !== null && this.$route.query.pidList !== undefined) {
if (this.$route.query.pid === undefined || this.pidList.length === 0) { this.pidList = JSON.parse(this.$route.query.pidList)
this.backBtnVisible = false this.dataForm.pid = this.pidList[this.pidList.length - 1]
} else {
this.dataForm.pid = 0 this.dataForm.pid = 0
} }
this.getDataList() this.getDataList()
@ -86,27 +85,35 @@ export default {
AddOrUpdate AddOrUpdate
}, },
methods: { methods: {
manageHandle (deptId) { manageHandle (deptId, pid) {
this.$parent.selectComponent = 'Deptofficer' this.$parent.selectComponent = 'Deptofficer'
this.$router.push({ path: '/organize-organizedeptroute', query: { deptId: deptId } }) this.$router.push({ path: '/organize-organizedeptroute', query: { pidList: JSON.stringify(this.pidList), deptId: deptId } })
}, },
lookHandle (id, pid) { lookHandle (id, pid) {
this.pidList.push(pid) this.pidList.push(id)
this.$parent.selectComponent = 'Metasysdept' this.$parent.selectComponent = 'Metasysdept'
this.$router.push({ path: '/organize-organizedeptroute', query: { pid: id, pidList: this.pidList } }) 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 () { backToDeptList () {
this.pidList.splice(this.pidList.length - 1, 1) var m = this.pidList.splice(this.pidList.length - 1, 1)
m.pop()
this.$emit('refreshDataList') this.$emit('refreshDataList')
this.$parent.selectComponent = 'Metasysdept' this.$parent.selectComponent = 'Metasysdept'
if (this.$route.query.backId !== undefined) { this.$router.push({ path: '/organize-organizedeptroute', query: { pidList: JSON.stringify(this.pidList) } })
this.$router.push({ path: '/organize-organizedeptroute', query: { pid: this.$route.query.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]
isOnclick (row, column) { } else {
if (row.typeKey === 'grid_party') { this.dataForm.pid = 0
this.isOnclickFlag = true
} }
this.getDataList()
} }
} }
} }

Loading…
Cancel
Save