Browse Source

Merge branch 'dev_data' of http://121.42.41.42:7070/r/esua-epdc-admin into dev_data

master
李鹏飞 6 years ago
parent
commit
e65c849517
  1. 7
      src/views/modules/organize/deptofficer.vue
  2. 8
      src/views/modules/organize/metaSysDeptManagement-add-or-update.vue
  3. 53
      src/views/modules/organize/metasysdept.vue
  4. 91
      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

8
src/views/modules/organize/metaSysDeptManagement-add-or-update.vue

@ -66,6 +66,14 @@
:min="0" :min="0"
:label="$t('dept.sort')" style="width: 75%"></el-input-number> :label="$t('dept.sort')" style="width: 75%"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item prop="sort"
label="是否显示">
<el-switch
v-model="dataForm.showFlag"
active-color="#36c6d3"
active-value="1"
inactive-value="0"></el-switch>
</el-form-item>
</el-form> </el-form>
<template slot="footer"> <template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> <el-button @click="visible = false">{{ $t('cancel') }}</el-button>

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()
} }
} }
} }

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

@ -0,0 +1,91 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__dept">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="组织架构名称" prop="name">
<el-input v-model="dataForm.name" placeholder="组织架构名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="danger" @click="deptUpdate()">同步</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border style="width: 100%;">
<el-table-column label="序号" header-align="center" align="center" width="50px">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<table-tree-column prop="name" :label="$t('dept.name')" header-align="center" align="center"></table-tree-column>
<el-table-column prop="parentName" :label="$t('dept.parentName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="sort" :label="$t('dept.sort')" 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">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:metasysdeptManagement:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-switch
v-model="scope.row.showFlag"
active-color="#36c6d3"
active-value="1"
inactive-value="0"
@change="active_text($event, scope.row)"></el-switch>
</template>
</el-table-column>
</el-table>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import TableTreeColumn from '@/components/table-tree-column'
import AddOrUpdate from './metaSysDeptManagement-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/cloudAnalysis/metaSysdeptManager/list'
}
}
},
components: {
TableTreeColumn,
AddOrUpdate
},
methods: {
active_text (value, row) {
this.$http.put(`/cloudAnalysis/metaSysdeptManager`, row).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
}).catch(() => {})
},
deptUpdate () {
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('update') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
this.$http.get(`/cloudAnalysis/metaSysdeptManager/deptUpdate`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.getDataList()
}
})
}).catch(() => { })
}).catch(() => { })
}
}
}
</script>
Loading…
Cancel
Save