var httpData=GetRequest(), doctorInfo = JSON.parse(window.localStorage.getItem('wlyyAgent')) function showSuccessMessage(msg) { layer.msg(msg, { icon: 1 }) } function showErrorMessage(msg) { layer.msg(msg, { icon: 5 }) } function showWarningMessage(msg) { layer.msg(msg, { icon: 2 }) } function showInfoMessage(msg) { layer.msg(msg, { icon: 6 }) } new Vue({ el: "#app", data: { isLeader: null, isShowList1: false, isShowList2: false, isShowList3: false, isShowList4:false, isJudgeHealthDoctor: null, isJudgezkDoctor:null, isJudgeDoctor: null, isJudgeExpense: null, isSaveBtn: false, isSaveBtn1: false, isSaveBtn2: false, isSaveBtn3:false, patientInfo: {jtSign:{}}, doctorTeam: {}, patientInfo: null, doctorTeam: null, doctorList: null, memberList: null, zkDoctorList:null, dictList: null, adminTeamCode: null, fileList: null, serverName: null, isShowzkdoctor:false, }, mounted: function() { this.patientSign(); this.patientTeam(); this.getDictByDictName(); this.findPatientSignServerBySignCode() }, methods: { patientSign: function() { var vm = this, loadding = layer.load(0, {shade: false}), params = { code: httpData.patientCode } signAPI.patientSign(params).then(function(res) { layer.close(loadding) if(res.status == 200) { vm.patientInfo = res.data vm.jsJudgeExpense = res.data.jtSign.expensesType } else { showErrorMessage(res.msg); } }) }, patientTeam: function() { var vm = this, loadding = layer.load(0, {shade: false}), params = { code: httpData.patientCode } signAPI.patientTeam(params).then(function(res) { layer.close(loadding) if(res.status == 200) { vm.doctorTeam = res.data vm.isJudgeHealthDoctor = vm.doctorTeam.healthDoctorCode vm.isJudgezkDoctor=vm.doctorTeam.specialist vm.isJudgeDoctor = vm.doctorTeam.doctorCode vm.isLeader = vm.doctorTeam.isLeader if(vm.isLeader) { vm.teamMember() } } else { showErrorMessage(res.msg); } }) }, getDictByDictName: function() { var vm =this, loadding = layer.load(0, {shade: false}), params = { name: "SIGN_EXPENSES" } signAPI.getDictByDictName(params).then(function(res) { layer.close(loadding) if(res.status == 200) { vm.dictList = res.list } else { showErrorMessage(res.msg); } }) }, findPatientSignServerBySignCode: function() { var vm =this, loadding = layer.load(0, {shade: false}), params = { signCode: httpData.signCode }; signAPI.findPatientSignServerBySignCode(params).then(function(res) { layer.close(loadding) if(res.status == 200) { vm.fileList = []; var len = res.data.length; if(res.data.length > 0) { vm.serverName = ""; for(var i = 0; i < len; i++) { if(i == 0) { vm.serverName += res.data[i].serverTypeName } else { vm.serverName += ',' + res.data[i].serverTypeName } } if(vm.serverName.split(',').indexOf('高血压')>-1 || vm.serverName.split(',').indexOf('糖尿病')>-1){ console.log('服务类型存在高血压,糖尿病') vm.isShowzkdoctor=true }else{ vm.isShowzkdoctor=false } } $.each(res.data, function(i, v) { if(v.serverType == 8 || v.serverType == 9 || v.serverType == 11) { vm.fileList.push(v); } }); } else { showErrorMessage(res.msg); } }) }, teamMember: function() { var vm = this, loadding = layer.load(0, {shade: false}), params = { teamId: vm.doctorTeam.teamId } signAPI.teamMember(params).then(function(res) { layer.close(loadding) vm.memberList = [] vm.doctorList = [] vm.zkDoctorList=[] if(res.status == 200) { $.each(res.data, function(i, v) { if(v.available && (v.level == 3 || v.level == 2)) {vm.memberList.push(v);} if(v.available && v.level == 2) {vm.doctorList.push(v);} vm.zkDoctorList.push(v) }); } else { showErrorMessage(res.msg); } }) }, selectStatus: function(num) { if (num == 1) { this.isShowList3 = false; this.isShowList2 = false; this.isShowList4 = false; this.isShowList1 = !this.isShowList1; } else if (num == 2) { this.isShowList3 = false; this.isShowList1 = false; this.isShowList4 = false; this.isShowList2 = !this.isShowList2; }else if(num==4){ this.isShowList1=false this.isShowList2=false this.isShowList3=false this.isShowList4=!this.isShowList4 } else { this.isShowList1 = false; this.isShowList2 = false; this.isShowList4 = false; this.isShowList3 = !this.isShowList3; } }, selectLi: function(num, data) { if(num == 1) { this.isShowList1 = false; if(data.code == this.isJudgeDoctor) { this.isSaveBtn = false } else { this.isSaveBtn = true } this.doctorTeam.doctorCode = data.code; this.doctorTeam.doctorName = data.name; } if(num == 2) { this.isShowList2 = false; if(data.code == this.isJudgeHealthDoctor) { this.isSaveBtn1 = false } else { this.isSaveBtn1 = true } this.doctorTeam.healthDoctorCode = data.code; this.doctorTeam.healthDoctorName = data.name; } if(num == 3) { this.isShowList3 = false; if(data.code == this.jsJudgeExpense) { this.isSaveBtn2 = false } else { this.isSaveBtn2 = true } this.patientInfo.jtSign.expensesType = data.code } if(num == 4){ this.isShowList4=false if(data.code==this.isJudgezkDoctor){ this.isSaveBtn3=false }else{ this.isSaveBtn3=true } this.doctorTeam.specialist = data.code; this.doctorTeam.specialistName = data.name; } }, // 把原来下拉选择框变成可搜索下拉选择框 changeSelect4:function(val){ var obj = {}; obj = this.doctorList.find(function(item){ return item.code === val; }); this.doctorTeam.doctorName=obj.name if(val == this.isJudgeDoctor) { this.isSaveBtn = false } else { this.isSaveBtn = true } }, changeSelect2:function(val){ var obj = {}; obj = this.memberList.find(function(item){ return item.code === val; }); this.doctorTeam.healthDoctorName=obj.name if(val == this.isJudgeHealthDoctor) { this.isSaveBtn1 = false } else { this.isSaveBtn1 = true } }, changeSelect5:function(val){ var obj = {}; obj = this.zkDoctorList.find(function(item){ return item.code === val; }); this.doctorTeam.specialistName=obj.name if(val==this.isJudgezkDoctor){ this.isSaveBtn3=false }else{ this.isSaveBtn3=true } }, showExpensesName: function(code) { var expensesName; if(!this.dictList) { return "请选择补贴类型"; } for(var i = 0, len = this.dictList.length; i < len; i++) { if(code == this.dictList[i].code) { expensesName = this.dictList[i].value; } } return expensesName }, handleExpensesStatus: function(status) { if(status == 0) return " 未缴费"; if(status == 1) return " 已缴费"; if(status == 2) return " 已退费"; if(!status) return ""; }, setPatImg: function(str) { var imgStr = httpRequest.getImgUrl(str); if (imgStr == "") { return '../../../images/p-female.png'; } else { return imgStr; } }, lookPhoto: function(data) { layer.open({ type: 2, area: ['100%', '100%'], title: "凭证预览", shade: 0.5, shadeClose: true, content: '../html/photo_show.html?serverType=' + data.serverType + '&patientCode=' + httpData.patientCode }) }, saveChange: function() { if(!this.isSaveBtn && !this.isSaveBtn1 && !this.isSaveBtn2 && !this.isSaveBtn3) { return false; } var vm = this, loadding = layer.load(0, {shade: false}), params = { patient: httpData.patientCode } if(this.isSaveBtn) { params.doctor = this.doctorTeam.doctorCode } if(this.isSaveBtn1) { params.healthDoctor = this.doctorTeam.healthDoctorCode } if(this.isSaveBtn3){ params.specialist=this.doctorTeam.specialist } if(this.isSaveBtn2) { params.expensesType = this.patientInfo.jtSign.expensesType } signAPI.saveChange(params).then(function(res) { layer.close(loadding) if(res.status == 200) { showSuccessMessage(res.msg); vm.patientSign(); vm.patientTeam(); vm.isSaveBtn = false vm.isSaveBtn1 = false vm.isSaveBtn2 = false vm.isSaveBtn3 = false } else { showErrorMessage(res.msg); } }) }, showProject: function() { layer.open({ type: 1, area: ['400px', '600px'], shade: 0.5, title: '个性化服务项目', shift: 2, closeBtn: 1, shadeClose: true, //点击遮罩关闭层 content: '