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

Loading…
Cancel
Save