Browse Source

update

shibei_master
YUJT 3 years ago
parent
commit
af3b325085
  1. 119
      src/views/modules/base/organization/organization.vue

119
src/views/modules/base/organization/organization.vue

@ -63,17 +63,10 @@
>新增</el-button> >新增</el-button>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-show="agenButton" <el-button size="mini"
size="mini"
type="warning"
icon="el-icon-plus"
@click="entryAgency(scope.row)"
>进入</el-button>
<el-button v-show="agenButtonTwo"
size="mini"
type="warning" type="warning"
icon="el-icon-plus" icon="el-icon-plus"
@click="entryAgencyTwo(scope.row)" @click="entryAgency(scope.row.agencyId)"
>进入</el-button> >进入</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -98,7 +91,7 @@
size="mini" size="mini"
type="warning" type="warning"
icon="el-icon-plus" icon="el-icon-plus"
@click="entryCommunity(scope.row)" @click="entryDepartment(scope.row.departmentId)"
>进入</el-button> >进入</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -123,7 +116,7 @@
size="mini" size="mini"
type="warning" type="warning"
icon="el-icon-plus" icon="el-icon-plus"
@click="entryGrid(scope.row)" @click="entryGrid(scope.row.gridId)"
>进入</el-button> >进入</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -567,8 +560,6 @@ import { requestPost } from "@/js/dai/request";
export default { export default {
data(){ data(){
return{ return{
agenButtonTwo:false,
agenButton:true,
// //
addNewAgency:false, addNewAgency:false,
// //
@ -1177,11 +1168,11 @@ export default {
this.addNewAgency = false this.addNewAgency = false
}, },
// //
entryGrid(row){ entryGrid(gridId){
this.gridDataPeo = [] this.gridDataPeo = []
this.communityDataPeo =[] this.communityDataPeo =[]
this.agencyDataPeo = [] this.agencyDataPeo = []
this.gridOrgId = row.gridId this.gridOrgId = gridId
this.deptPeo = false this.deptPeo = false
this.GridWorkPeo = true this.GridWorkPeo = true
this.levelPeo = false this.levelPeo = false
@ -1192,14 +1183,14 @@ export default {
this.officeList = false this.officeList = false
this.GridList = false this.GridList = false
this.GridPeo() this.GridPeo()
this.assembleBreadcrumbArr(row.gridId, 'grid') this.assembleBreadcrumbArr(gridId, 'grid')
}, },
// //
entryCommunity(row){ entryDepartment(departmentId){
this.gridDataPeo = [] this.gridDataPeo = []
this.communityDataPeo = [] this.communityDataPeo = []
this.agencyDataPeo = [] this.agencyDataPeo = []
this.communityOrgId = row.departmentId this.communityOrgId = departmentId
this.levelPeo = false this.levelPeo = false
this.deptPeo = true this.deptPeo = true
this.GridWorkPeo = false this.GridWorkPeo = false
@ -1210,54 +1201,30 @@ export default {
this.OrganizationList = false this.OrganizationList = false
this.officeList = false this.officeList = false
this.communityPeo() this.communityPeo()
this.assembleBreadcrumbArr(row.departmentId, 'department') this.assembleBreadcrumbArr(departmentId, 'department')
}, },
// //
entryAgency(row){ entryAgency(agencyId){
this.tableData = []
this.communityData = []
this.gridData = []
this.gridDataPeo = []
this.agencyDataPeo = []
this.communityDataPeo = []
this.agencyId = row.agencyId
this.getCommunityList()
this.getGridList()
this.communityOpen = true
this.gridOpen = true
this.anId = row.agencyId
this.agencyPeo()
this.entry = true
this.levelPeo = true
this.agencyId = row.agencyId
this.agenButton = false
this.agenButtonTwo = true
this.getAgencyList()
this.assembleBreadcrumbArr(row.agencyId, 'agency')
},
entryAgencyTwo(row){
this.tableData = [] this.tableData = []
this.communityData = [] this.communityData = []
this.gridData = [] this.gridData = []
this.gridDataPeo = [] this.gridDataPeo = []
this.agencyDataPeo = [] this.agencyDataPeo = []
this.communityDataPeo = [] this.communityDataPeo = []
this.agencyId = row.agencyId this.agencyId = agencyId
this.getCommunityList() this.getCommunityList()
this.getGridList() this.getGridList()
this.communityOpen = true this.communityOpen = true
this.gridOpen = true this.gridOpen = true
this.anId = row.agencyId this.anId = agencyId
this.agencyPeo() this.agencyPeo()
this.entry = true this.entry = true
this.levelPeo = true this.levelPeo = true
this.agencyId = row.agencyId this.agencyId = agencyId
this.getAgencyList() this.getAgencyList()
this.assembleBreadcrumbArr(row.agencyId, 'agency') this.assembleBreadcrumbArr(agencyId, 'agency')
this.OrganizationList = false
}, },
// //
addCommunity(row){ addCommunity(row){
@ -1480,11 +1447,24 @@ export default {
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if(code === 0){ if(code === 0){
if (data.level === 'community') {
this.OrganizationList = false
} else {
this.OrganizationList = true
}
if (this.breadcrumbArr.length === 0) { if (this.breadcrumbArr.length === 0) {
this.breadcrumbArr = [{id: data.agencyId, name: data.agencyName, type: orgType}] this.breadcrumbArr = [{id: data.agencyId, name: data.agencyName, type: orgType}]
} else { } else {
let breadcrumb = {id: data.agencyId, name: data.agencyName, type: orgType} let hasBreadcrumbArr = false
this.breadcrumbArr.push(breadcrumb) this.breadcrumbArr.forEach(function (bc) {
if (bc.id === id) {
hasBreadcrumbArr = true
}
})
if (hasBreadcrumbArr === false) {
let breadcrumb = {id: data.agencyId, name: data.agencyName, type: orgType}
this.breadcrumbArr.push(breadcrumb)
}
} }
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -1499,8 +1479,16 @@ export default {
if (this.breadcrumbArr.length === 0) { if (this.breadcrumbArr.length === 0) {
this.breadcrumbArr = [{id: data.departmentId, name: data.departmentName, type: orgType}] this.breadcrumbArr = [{id: data.departmentId, name: data.departmentName, type: orgType}]
} else { } else {
let breadcrumb = {id: data.departmentId, name: data.departmentName, type: orgType} let hasBreadcrumbArr = false
this.breadcrumbArr.push(breadcrumb) this.breadcrumbArr.forEach(function (bc) {
if (bc.id === id) {
hasBreadcrumbArr = true
}
})
if (hasBreadcrumbArr === false) {
let breadcrumb = {id: data.departmentId, name: data.departmentName, type: orgType}
this.breadcrumbArr.push(breadcrumb)
}
} }
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -1515,8 +1503,16 @@ export default {
if (this.breadcrumbArr.length === 0) { if (this.breadcrumbArr.length === 0) {
this.breadcrumbArr = [{id: data.grid, name: data.gridName, type: orgType}] this.breadcrumbArr = [{id: data.grid, name: data.gridName, type: orgType}]
} else { } else {
let breadcrumb = {id: data.grid, name: data.gridName, type: orgType} let hasBreadcrumbArr = false
this.breadcrumbArr.push(breadcrumb) this.breadcrumbArr.forEach(function (bc) {
if (bc.id === id) {
hasBreadcrumbArr = true
}
})
if (hasBreadcrumbArr === false) {
let breadcrumb = {id: data.grid, name: data.gridName, type: orgType}
this.breadcrumbArr.push(breadcrumb)
}
} }
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -1525,8 +1521,19 @@ export default {
}, },
async refreshThisPage (index) { async refreshThisPage (index) {
console.log(this.currentBreadCrumbKey) const selectOrg = this.breadcrumbArr[index]
console.log(this.breadcrumbArr) this.breadcrumbArr = this.breadcrumbArr.slice(0, index + 1)
const orgId = selectOrg.id
const orgType = selectOrg.type
if (orgType === 'agency') {
this.entryAgency(orgId)
} else if (orgType === 'department') {
this.entryDepartment(orgId)
} else if (orgType === 'grid') {
this.entryGrid(orgId)
}
}, },
addAgency(row){ addAgency(row){

Loading…
Cancel
Save