|
@ -26,6 +26,7 @@ Vue.component('copd-patient-record', {
|
|
|
currentEditData: null,
|
|
|
// 编辑页面是否显示
|
|
|
editViewVisable: false,
|
|
|
userRoleCode:'',
|
|
|
//服务记录是否显示
|
|
|
serviceRecordVisable: false,
|
|
|
transferStatusOptions:[{code:'',value:'全部'}],
|
|
@ -40,6 +41,8 @@ Vue.component('copd-patient-record', {
|
|
|
size: 50,
|
|
|
currentSize:50,
|
|
|
currentPage: 1,
|
|
|
rangeList:[ {name: '按区', code: 'town'}],
|
|
|
rangeCode:'town',
|
|
|
totalPage: 0,
|
|
|
totalCount: 0,
|
|
|
name:'',
|
|
@ -60,6 +63,9 @@ Vue.component('copd-patient-record', {
|
|
|
endTime:'',
|
|
|
chooseYear: '',
|
|
|
nowyear:'',
|
|
|
areaList:[],
|
|
|
areaCode:"",
|
|
|
communityCode:'',
|
|
|
fileList: [],
|
|
|
file: undefined,
|
|
|
isProgressShow: false,
|
|
@ -93,7 +99,10 @@ Vue.component('copd-patient-record', {
|
|
|
},
|
|
|
mounted() {
|
|
|
var vm = this
|
|
|
var userRole = window.sessionStorage.getItem('selectedRole');
|
|
|
vm.userRoleCode = JSON.parse(userRole).code;
|
|
|
this.initTime(vm)
|
|
|
this.initScope(this)
|
|
|
this.hospitalList()
|
|
|
EventBus.$on('copd-reset-select', function () {
|
|
|
vm.currentEditData = null
|
|
@ -141,6 +150,40 @@ Vue.component('copd-patient-record', {
|
|
|
vm.years.push(i);
|
|
|
}
|
|
|
},
|
|
|
// 数据范围初始化
|
|
|
initScope(vm) {
|
|
|
//获得缓存中缓存的角色权限
|
|
|
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 == '350200' ? 2 : vm.userRole.code.length == 6 ? 3 : 4;
|
|
|
vm.initlevel = vm.level = vm.userRole.code == '350200' ? 4 : vm.userRole.code.length == 6 ? 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, 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;
|
|
|
}
|
|
|
vm.range = vm.rangeCode;
|
|
|
},
|
|
|
handlePreview(value) {
|
|
|
var vm = this
|
|
|
var file = value.target.files[0]
|
|
@ -178,9 +221,34 @@ Vue.component('copd-patient-record', {
|
|
|
// })
|
|
|
}
|
|
|
},
|
|
|
//获取省市区 type:区3
|
|
|
getDistrict: function (type, code, name) {
|
|
|
var vm = this,
|
|
|
list = [],
|
|
|
param = '';
|
|
|
if (type == 3) {
|
|
|
list = [{code: code, name: name}];
|
|
|
param = 'area';
|
|
|
} else if (type == 5) {
|
|
|
list = [{code: '', name: '全部'}];
|
|
|
param = 'community';
|
|
|
}
|
|
|
var params = {
|
|
|
type: type,
|
|
|
code: code
|
|
|
};
|
|
|
homeAPI.getDistrict(params).then(function (res) {
|
|
|
if (res.status == 200) {
|
|
|
vm[param + 'List'] = list.concat(res.list);
|
|
|
vm[param + 'Code'] = vm[param + 'List'][0].code;
|
|
|
} else {
|
|
|
vm.$message.error(res.msg);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
hospitalList(){
|
|
|
var vm=this
|
|
|
statisticAPI.hospitalList().then(function(res){
|
|
|
statisticAPI.hospitalList({queryArea:vm.userRoleCode}).then(function(res){
|
|
|
vm.receivingHospitalList=vm.receivingHospitalList&& vm.receivingHospitalList.concat(res.detailModelList)
|
|
|
})
|
|
|
},
|
|
@ -197,7 +265,8 @@ Vue.component('copd-patient-record', {
|
|
|
hospital:this.hospital,
|
|
|
doctorName:this.doctorName,
|
|
|
isLive: this.isLive,
|
|
|
firstOrg: this.firstOrg
|
|
|
firstOrg: this.firstOrg,
|
|
|
queryArea:this.userRoleCode
|
|
|
}
|
|
|
statisticAPI.exportJkCopdAchives(params,'居民档案.xls').then(
|
|
|
function(res){
|
|
@ -376,6 +445,7 @@ openURL (url) {
|
|
|
hospital:this.hospital,
|
|
|
doctorName:this.doctorName,
|
|
|
isLive: this.isLive,
|
|
|
queryArea:this.userRoleCode,
|
|
|
firstOrg: this.firstOrg,
|
|
|
startTime: this.chooseYear=='全部'?"": this.chooseYear+'-01-01',
|
|
|
endTime:this.chooseYear=='全部'?"": this.chooseYear+'-12-31',
|