|
@ -62,19 +62,11 @@ Vue.component('copd-serve-num', {
|
|
|
isShowBtn: 0,
|
|
|
isGuGan: false,
|
|
|
areaList: [],
|
|
|
rangeOptions: [
|
|
|
{ label: '区', value: 'town' },
|
|
|
{ label: '社区', value: 'hospital' }
|
|
|
],
|
|
|
areaOptions: [
|
|
|
{ label: '厦门市', value: '' },
|
|
|
{ label: '思明区', value: '350203' },
|
|
|
{ label: '海沧区', value: '350205' },
|
|
|
{ label: '湖里区', value: '350206' },
|
|
|
{ label: '集美区', value: '350211' },
|
|
|
{ label: '同安区', value: '350212' },
|
|
|
{ label: '翔安区', value: '350213' }
|
|
|
rangeList: [
|
|
|
{ name: '按区', code: 'town' },
|
|
|
{ name: '按社区', code: 'hospital' }
|
|
|
],
|
|
|
areaList: [],
|
|
|
tabledata: [],
|
|
|
hospitalOptions: [],
|
|
|
tableHeader: [
|
|
@ -96,7 +88,8 @@ Vue.component('copd-serve-num', {
|
|
|
errList: [],
|
|
|
daLoading: false,
|
|
|
isShow: false,
|
|
|
datatotal: 0
|
|
|
datatotal: 0,
|
|
|
exportLoading: false
|
|
|
}
|
|
|
},
|
|
|
|
|
@ -156,15 +149,15 @@ Vue.component('copd-serve-num', {
|
|
|
vm.nowyear = vm.chooseYear = now.getFullYear()
|
|
|
// vm.chooseYear = '2022'
|
|
|
vm.nowmonth = now.getMonth() + 1
|
|
|
vm.years = ['2025']
|
|
|
vm.years = [2025]
|
|
|
// for (i = vm.nowyear; i >= 2013; i--) {
|
|
|
// vm.years.push(i)
|
|
|
// }
|
|
|
},
|
|
|
resetArea() {
|
|
|
if (this.level == 1) {
|
|
|
delete this.form.area
|
|
|
delete this.form.hospital
|
|
|
delete this.areaCode
|
|
|
delete this.hospital
|
|
|
delete this.form.team
|
|
|
} else if (this.level == 2) {
|
|
|
delete this.form.hospital
|
|
@ -176,77 +169,43 @@ Vue.component('copd-serve-num', {
|
|
|
// 数据范围初始化
|
|
|
initScope(type) {
|
|
|
var vm = this
|
|
|
var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
|
|
|
if (selectedRole.code.indexOf('350200') > -1) {
|
|
|
this.level = 1 // 市卫健委
|
|
|
this.areaOptions = [
|
|
|
{ label: '厦门市', value: '' },
|
|
|
{ label: '思明区', value: '350203' },
|
|
|
{ label: '海沧区', value: '350205' },
|
|
|
{ label: '湖里区', value: '350206' },
|
|
|
{ label: '集美区', value: '350211' },
|
|
|
{ label: '同安区', value: '350212' },
|
|
|
{ label: '翔安区', value: '350213' }
|
|
|
]
|
|
|
this.rangeOptions = [
|
|
|
{ label: '区', value: 'town' },
|
|
|
{ label: '社区', value: 'hospital' }
|
|
|
]
|
|
|
this.form = {
|
|
|
range: 'town',
|
|
|
area: ''
|
|
|
}
|
|
|
} else if (selectedRole.code.length == 6) {
|
|
|
this.level = 2 // 区管理
|
|
|
this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
|
|
|
this.form = {
|
|
|
range: 'town',
|
|
|
area: selectedRole.code
|
|
|
}
|
|
|
this.getHospital(selectedRole.code)
|
|
|
} else {
|
|
|
this.level = 3 // 社区管理
|
|
|
this.rangeOptions = [{ label: '社区', value: 'hospital' }]
|
|
|
this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code.substring(0, 6) }]
|
|
|
this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
|
|
|
this.form = {
|
|
|
range: 'hospital',
|
|
|
area: selectedRole.code.substring(0, 6),
|
|
|
hospital: selectedRole.code
|
|
|
}
|
|
|
this.getTeam(selectedRole.code)
|
|
|
}
|
|
|
return
|
|
|
|
|
|
//获得缓存中缓存的角色权限
|
|
|
var userRole = window.sessionStorage.getItem('selectedRole')
|
|
|
if (!userRole) {
|
|
|
return false
|
|
|
}
|
|
|
vm.userRole = JSON.parse(userRole)
|
|
|
//level:2、市,3、区,4、社区,5、团队
|
|
|
vm.initareaLevel = vm.areaLevel = vm.userRole.code == 'jk_350200' ? 2 : vm.userRole.code.length == 9 ? 3 : 4
|
|
|
vm.initlevel = vm.level = vm.userRole.code == 'jk_350200' ? 4 : vm.userRole.code.length == 9 ? 3 : 2
|
|
|
// vm.lowLevel = vm.initlowLevel = vm.userRole.code == '350200' ? 3 : vm.userRole.code.length == 6 ? 2 : 1;
|
|
|
vm.initarea = vm.area = vm.userRole.code
|
|
|
vm.areaTitle = vm.userRole.name
|
|
|
|
|
|
if (vm.initlevel == 4) {
|
|
|
//市获取区
|
|
|
vm.getDistrict(3, vm.initarea.substring(3), vm.areaTitle.substr(0, 3))
|
|
|
vm.rangeCode = vm.rangeList[0].code
|
|
|
} else if (vm.initlevel == 3) {
|
|
|
//区获取社区
|
|
|
vm.areaList = [{ code: vm.initarea, name: vm.areaTitle }]
|
|
|
vm.areaCode = vm.initarea
|
|
|
vm.rangeCode = vm.rangeList[0].code
|
|
|
} else if (vm.initlevel == 2) {
|
|
|
//社区获取团队
|
|
|
vm.communityList = [{ code: vm.initarea, name: vm.areaTitle }]
|
|
|
vm.communityCode = vm.initarea
|
|
|
vm.rangeList.shift()
|
|
|
vm.rangeCode = vm.rangeList[0].code
|
|
|
if (vm.isGuGan) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
if (type == 3) {
|
|
|
this.areaCode = null
|
|
|
this.communityCode = null
|
|
|
|
|
|
if (vm.userRole.code == '350200' || vm.userRole.code == 'jk_350200') {
|
|
|
vm.getDistrict(type, 350200, '厦门市')
|
|
|
} else if (vm.userRole.code.indexOf('jk_') > -1) {
|
|
|
vm.getDistrict(type, vm.userRole.code.substring(3), vm.areaTitle.substring(0, 3))
|
|
|
} else if (vm.userRole.code.length == 6) {
|
|
|
vm.getDistrict(type, vm.userRole.code, vm.areaTitle.substring(0, 3))
|
|
|
} else if (vm.userRole.code.length == 10) {
|
|
|
|
|
|
this.rangeList = [{ name: '按社区', code: 'hospital' }]
|
|
|
this.rangeCode = 'hospital'
|
|
|
this.areaList = [{ name: this.userRole.name.substring(0, 3), code: this.userRole.code.substring(0, 6) }]
|
|
|
this.areaCode = this.userRole.code.substring(0, 6)
|
|
|
this.communityList = [{ name: this.userRole.name, code: this.userRole.code }]
|
|
|
this.communityCode = this.userRole.code
|
|
|
}
|
|
|
} else {
|
|
|
this.communityCode = null
|
|
|
if (this.rangeCode == 'hospital') vm.getDistrict(type, vm.areaCode)
|
|
|
}
|
|
|
vm.range = vm.rangeCode
|
|
|
return
|
|
|
},
|
|
|
toggleField(fieldName) {
|
|
|
return this.tableFieldList.indexOf(fieldName) !== -1
|
|
@ -287,17 +246,17 @@ Vue.component('copd-serve-num', {
|
|
|
},
|
|
|
exportTable() {
|
|
|
var vm = this
|
|
|
vm.daLoading = true
|
|
|
vm.exportLoading = true
|
|
|
var params = {
|
|
|
year: this.chooseYear,
|
|
|
range: this.form.range,
|
|
|
area: this.form.area == '350200' ? '' : this.form.area === null ? '' : this.form.area
|
|
|
range: this.rangeCode,
|
|
|
area: this.areaCode == '350200' ? '' : this.areaCode === null ? '' : this.areaCode
|
|
|
}
|
|
|
if (this.form.range == 'hospital') {
|
|
|
params.hospital = this.form.hospital
|
|
|
if (this.rangeCode == 'hospital') {
|
|
|
params.hospital = this.communityCode
|
|
|
}
|
|
|
statisticAPI.exportServiceProgress(params, '服务人数配置及进度查询.xls').then(function (res) {
|
|
|
vm.daLoading = false
|
|
|
vm.exportLoading = false
|
|
|
vm.$message({
|
|
|
message: '导出成功!',
|
|
|
type: 'success'
|
|
@ -306,9 +265,9 @@ Vue.component('copd-serve-num', {
|
|
|
},
|
|
|
getHospital(code) {
|
|
|
var vm = this
|
|
|
homeAPI.getCommunityHospital({ area: vm.form.area == '350200' ? '' : vm.form.area }).then(function (res) {
|
|
|
vm.hospitalOptions = [{ code: '', name: '全部' }]
|
|
|
vm.hospitalOptions = vm.hospitalOptions.concat(res.data)
|
|
|
homeAPI.getCommunityHospital({ area: vm.areaCode == '350200' ? '' : vm.areaCode }).then(function (res) {
|
|
|
vm.communityList = [{ code: '', name: '全部' }]
|
|
|
vm.communityList = vm.communityList.concat(res.data)
|
|
|
})
|
|
|
},
|
|
|
getTeam(code) {
|
|
@ -340,6 +299,7 @@ Vue.component('copd-serve-num', {
|
|
|
this.form = {
|
|
|
range: 'town'
|
|
|
}
|
|
|
this.rangeCode = 'town'
|
|
|
} else if (this.level == 2) {
|
|
|
this.form = {
|
|
|
range: 'town',
|
|
@ -390,11 +350,11 @@ Vue.component('copd-serve-num', {
|
|
|
vm.daLoading = true
|
|
|
var params = {
|
|
|
year: this.chooseYear,
|
|
|
range: this.form.range,
|
|
|
area: this.form.area == '350200' ? '' : this.form.area === null ? '' : this.form.area
|
|
|
range: this.rangeCode,
|
|
|
area: this.areaCode == '350200' ? '' : this.areaCode === null ? '' : this.areaCode
|
|
|
}
|
|
|
if (this.form.range == 'hospital') {
|
|
|
params.hospital = this.form.hospital
|
|
|
if (this.rangeCode == 'hospital') {
|
|
|
params.hospital = this.communityCode
|
|
|
}
|
|
|
statisticAPI.getServiceProgress(params).then(function (res) {
|
|
|
vm.daLoading = false
|
|
@ -405,7 +365,6 @@ Vue.component('copd-serve-num', {
|
|
|
} else {
|
|
|
vm.$message.error(res.msg)
|
|
|
}
|
|
|
console.log(res, 'llllllllllllllllllllllllllllllll')
|
|
|
})
|
|
|
},
|
|
|
close(type) {
|
|
@ -496,7 +455,6 @@ Vue.component('copd-serve-num', {
|
|
|
|
|
|
EventBus.$on('copd-record-filter-change', function (event) {
|
|
|
vm.quotaStrArr = event
|
|
|
console.log(vm.quotaStrArr, '999sd8s9a8d9s8ad9sa89')
|
|
|
})
|
|
|
},
|
|
|
destroyed() {
|