|
@ -136,60 +136,98 @@ new Vue({
|
|
|
url = "comprehensive-query.html";
|
|
|
}
|
|
|
window.location.href = url;
|
|
|
}
|
|
|
},
|
|
|
mounted: function() {
|
|
|
//获取缓存里面的userRole
|
|
|
var roles = window.sessionStorage.getItem("userRole");
|
|
|
//如果没有缓存userRole,则说明是第一次进入统计页面,需要重新请求患者信息
|
|
|
if(!roles){
|
|
|
var vm = this;
|
|
|
httpRequest.getDoctorInfo().then(function(res){
|
|
|
var docInfo = res.data,
|
|
|
userRole = docInfo.userRole;
|
|
|
_.each(userRole,function(item,index){
|
|
|
if(item.areas!="350200"){
|
|
|
item.roleType='2'
|
|
|
}
|
|
|
})
|
|
|
if(docInfo.specialistRole&&docInfo.specialistRole.length){ //如果有专科权限
|
|
|
_.each(docInfo.specialistRole,function(item,index){
|
|
|
var hasIndex = _.findIndex(userRole,{areas:item.areas})
|
|
|
if(hasIndex == -1){ //去重
|
|
|
item.roleType='1'
|
|
|
userRole.push(item)
|
|
|
},
|
|
|
userRoleData:function(v) {
|
|
|
var vm = this
|
|
|
var roles = window.sessionStorage.getItem("userRole");
|
|
|
//如果没有缓存userRole,则说明是第一次进入统计页面,需要重新请求患者信息
|
|
|
if(!roles){
|
|
|
var vm = this;
|
|
|
httpRequest.getDoctorInfo().then(function(res){
|
|
|
var docInfo = res.data,
|
|
|
userRole = docInfo.userRole;
|
|
|
_.each(userRole,function(item,index){
|
|
|
if(item.areas!="350200"){
|
|
|
item.roleType='2'
|
|
|
}
|
|
|
})
|
|
|
if(docInfo.specialistRole&&docInfo.specialistRole.length){ //如果有专科权限
|
|
|
_.each(docInfo.specialistRole,function(item,index){
|
|
|
var hasIndex = _.findIndex(userRole,{areas:item.areas})
|
|
|
if(hasIndex == -1){ //去重
|
|
|
item.roleType='1'
|
|
|
userRole.push(item)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
if(userRole.length>0){
|
|
|
window.sessionStorage.setItem("userRole", JSON.stringify(userRole));
|
|
|
window.sessionStorage.setItem("docInfo", JSON.stringify(docInfo));
|
|
|
vm.roles = userRole;
|
|
|
vm.selectedRole = userRole[0].code;
|
|
|
var selected = userRole[0];
|
|
|
window.sessionStorage.setItem("selectedRole", JSON.stringify(selected));
|
|
|
$("#main").removeClass("c-hide")
|
|
|
}else{
|
|
|
top.toastr.warning("您没有权限查看该页面");
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
this.roles = JSON.parse(roles);
|
|
|
if(this.roles.length>0){
|
|
|
var selected = window.sessionStorage.getItem("selectedRole");
|
|
|
if(selected && selected!= "undefined") {
|
|
|
this.selectedRole = JSON.parse(selected).code;
|
|
|
} else {
|
|
|
this.selectedRole = this.roles[0].code;
|
|
|
var selected = this.roles[0];
|
|
|
window.sessionStorage.setItem("selectedRole", JSON.stringify(selected));
|
|
|
}
|
|
|
$("#main").removeClass("c-hide")
|
|
|
}else{
|
|
|
top.toastr.warning("您没有权限查看该页面");
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
paramClick:function(v) {
|
|
|
if(v == 'ztfx') {
|
|
|
this.showDetail(this.serviceAnalysis[0].url)
|
|
|
}else if(v == 'zxfx') {
|
|
|
this.showDetail(this.serviceAnalysis[1].url)
|
|
|
}else if(v == 'pjfx') {
|
|
|
this.showDetail(this.serviceAnalysis[2].url)
|
|
|
}else if(v == 'ccffx') {
|
|
|
this.showDetail(this.serviceAnalysis[3].url)
|
|
|
}else if(v == 'zffx') {
|
|
|
this.showDetail(this.serviceAnalysis[4].url)
|
|
|
}else if(v == 'smfw') {
|
|
|
this.showDetail(this.serviceAnalysis[5].url)
|
|
|
}else if(v == 'scfx') {
|
|
|
this.showDetail(this.serviceAnalysis[6].url)
|
|
|
}else if(v == 'zbfx') {
|
|
|
if(this.paramType) {
|
|
|
this.showDetail('special-analysis.html?type='+this.paramType)
|
|
|
}else{
|
|
|
this.showDetail(this.serviceAnalysis[7].url)
|
|
|
}
|
|
|
if(userRole.length>0){
|
|
|
window.sessionStorage.setItem("userRole", JSON.stringify(userRole));
|
|
|
window.sessionStorage.setItem("docInfo", JSON.stringify(docInfo));
|
|
|
vm.roles = userRole;
|
|
|
vm.selectedRole = userRole[0].code;
|
|
|
var selected = userRole[0];
|
|
|
window.sessionStorage.setItem("selectedRole", JSON.stringify(selected));
|
|
|
$("#main").removeClass("c-hide")
|
|
|
}else{
|
|
|
top.toastr.warning("您没有权限查看该页面");
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
this.roles = JSON.parse(roles);
|
|
|
if(this.roles.length>0){
|
|
|
var selected = window.sessionStorage.getItem("selectedRole");
|
|
|
if(selected && selected!= "undefined") {
|
|
|
this.selectedRole = JSON.parse(selected).code;
|
|
|
} else {
|
|
|
this.selectedRole = this.roles[0].code;
|
|
|
var selected = this.roles[0];
|
|
|
window.sessionStorage.setItem("selectedRole", JSON.stringify(selected));
|
|
|
}
|
|
|
$("#main").removeClass("c-hide")
|
|
|
}else{
|
|
|
top.toastr.warning("您没有权限查看该页面");
|
|
|
}
|
|
|
}
|
|
|
console.log(this.selectedRole)
|
|
|
}else if(v == 'sjcx') {
|
|
|
this.showDetail(this.dataQuery[0].url)
|
|
|
}else if(v == 'ndkhbb') {
|
|
|
this.showDetail(this.dataQuery[2].url)
|
|
|
}else if(v == 'jmfx') {
|
|
|
this.showDetail(this.signAnalysis[2].url)
|
|
|
}else if(v == 'jkgl') {
|
|
|
this.showDetail(this.signAnalysis[3].url)
|
|
|
}else if(v == 'tgq') {
|
|
|
this.showDetail(this.signAnalysis[4].url)
|
|
|
}
|
|
|
|
|
|
},
|
|
|
},
|
|
|
mounted: function() {
|
|
|
//获取缓存里面的userRole
|
|
|
this.userRoleData()
|
|
|
|
|
|
// 获取URL地址
|
|
|
var url = window.location.href;
|
|
|
// 获取参数部分
|
|
@ -209,48 +247,22 @@ new Vue({
|
|
|
},
|
|
|
watch: {
|
|
|
selectedRole: function(val) {
|
|
|
var vm = this
|
|
|
var selected = _.findWhere(this.roles, {
|
|
|
code: val
|
|
|
});
|
|
|
window.sessionStorage.setItem("selectedRole", JSON.stringify(selected));
|
|
|
getSignData(this);
|
|
|
console.log(this.selectedRole)
|
|
|
if(vm.selectedRole) {
|
|
|
vm.paramClick(vm.paramValue)
|
|
|
}
|
|
|
},
|
|
|
"paramValue":{
|
|
|
handler:function(v) {
|
|
|
if(v == 'ztfx') {
|
|
|
this.showDetail(this.serviceAnalysis[0].url)
|
|
|
}else if(v == 'zxfx') {
|
|
|
this.showDetail(this.serviceAnalysis[1].url)
|
|
|
}else if(v == 'pjfx') {
|
|
|
this.showDetail(this.serviceAnalysis[2].url)
|
|
|
}else if(v == 'ccffx') {
|
|
|
this.showDetail(this.serviceAnalysis[3].url)
|
|
|
}else if(v == 'zffx') {
|
|
|
this.showDetail(this.serviceAnalysis[4].url)
|
|
|
}else if(v == 'smfw') {
|
|
|
this.showDetail(this.serviceAnalysis[5].url)
|
|
|
}else if(v == 'scfx') {
|
|
|
this.showDetail(this.serviceAnalysis[6].url)
|
|
|
}else if(v == 'zbfx') {
|
|
|
if(this.paramType) {
|
|
|
this.showDetail('special-analysis.html?type='+this.paramType)
|
|
|
}else{
|
|
|
this.showDetail(this.serviceAnalysis[7].url)
|
|
|
}
|
|
|
}else if(v == 'sjcx') {
|
|
|
this.showDetail(this.dataQuery[0].url)
|
|
|
}else if(v == 'ndkhbb') {
|
|
|
this.showDetail(this.serviceAnalysis[2].url)
|
|
|
}else if(v == 'jmfx') {
|
|
|
this.showDetail(this.signAnalysis[2].url)
|
|
|
}else if(v == 'jkgl') {
|
|
|
this.showDetail(this.signAnalysis[3].url)
|
|
|
}else if(v == 'tgq') {
|
|
|
this.showDetail(this.signAnalysis[4].url)
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
// "paramValue":{
|
|
|
// handler:function(v) {
|
|
|
// this.paramClick(v)
|
|
|
// },
|
|
|
// },
|
|
|
|
|
|
}
|
|
|
})
|