var httpData=GetRequest(), doctorInfo = JSON.parse(window.localStorage.getItem('wlyyAgent')); var refuseReason = null; 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 }) } function getReason(ele) { if(ele.hasClass("active")) { ele.removeClass("active") refuseReason = null return false; } ele.addClass("active").siblings().removeClass("active"); refuseReason = ele.html(); } new Vue({ el: "#app", data: { doctorType: doctorInfo.doctorType, isShowList1: false, isShowList2: false, isShowList3: false, isShowList4: false, showTit3: "请选择补贴类型", showTit4: "请选择服务类型", showTit5: "请选择居民标签", patientInfo: null, teamList: null, memberList: null, // 团队成员列表 doctorList: null, // 全科医生列表 dictList: null, fileList: null, signInfo: { signType: 1, majorDoctor: null, majorDoctorName: null, healthLabel: null, customLabel: null, disease: null, patientIDcard: null, // 必填 adminTeamCode: null, msgid: httpData.msgId, // 消息id(必填) patient: httpData.patientCode, healthDoctor: null, healthDoctorName: null, type: 1, expenses: null, group: null, //添加服务类型数据 sevId: null, // 拒绝参数 // adminTeamCode:0, // type: 2, refuseReason: null }, }, mounted: function() { if (httpData.status == 0) { this.signing() } else { this.signOuttime(); } this.getDictByDictName(); this.teamLimit(); this.findPatientSignServerBySignCode(); }, methods: { signing: function() { var vm = this, loadding = layer.load(0, {shade: false}), params = { patient: httpData.patientCode } signAPI.signing(params).then(function(res) { layer.close(loadding) if(res.status == 200) { vm.patientInfo = res.data } else { showErrorMessage(res.msg); } }) }, signOuttime: function() { var vm = this, loadding = layer.load(0, {shade: false}), params = { patient: httpData.patientCode } signAPI.signOuttime(params).then(function(res) { layer.close(loadding) if(res.status == 200) { vm.patientInfo = res.data vm.signInfo.adminTeamCode = vm.patientInfo.jtSign.adminTeamId vm.signInfo.healthDoctorName = vm.patientInfo.jtSign.doctorHealthName vm.signInfo.healthDoctor = vm.patientInfo.jtSign.doctorHealth vm.signInfo.expenses = vm.patientInfo.jtSign.expensesType 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); } }) }, teamLimit: function() { var vm = this, loadding = layer.load(0, {shade: false}), params = { doctorId: doctorInfo.uid } signAPI.teamLimit(params).then(function(res) { layer.close(loadding) if(res.status == 200) { vm.teamList = res.data } 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 = [] $.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.signInfo.adminTeamCode } signAPI.teamMember(params).then(function(res) { layer.close(loadding) vm.memberList = []; vm.doctorList = []; if(res.status == 200) { $.each(res.data, function(i, v) { if(v.level == 3 || v.level == 2) {vm.memberList.push(v);} if(v.level == 2) {vm.doctorList.push(v);} }); } else { showErrorMessage(res.msg); } }) }, selectStatus: function(num) { if(num == 1) { this.isShowList2 = false; this.isShowList3 = false; this.isShowList4 = false; this.isShowList1 = !this.isShowList1; } else if (num == 2) { if(!this.signInfo.adminTeamCode) { showWarningMessage("请先选择签约团队") return false; } this.isShowList1 = false; this.isShowList3 = false; this.isShowList4 = false; this.isShowList2 = !this.isShowList2; } else if (num == 3) { this.isShowList1 = false; this.isShowList2 = false; this.isShowList4 = false; this.isShowList3 = !this.isShowList3; } else { this.isShowList1 = false; this.isShowList2 = false; this.isShowList3 = false; this.isShowList4 = !this.isShowList4; } }, selectLi: function(num, data) { if(num == 1) { // 选择签约团队 this.isShowList1 = false; this.signInfo.adminTeamCode = data.id; if(!this.memberList || !this.doctorList) { this.teamMember() } } if(num == 2) { // 选择健管师 this.isShowList2 = false; this.signInfo.healthDoctorName = data.name this.signInfo.healthDoctor = data.code } if(num == 3) { this.isShowList3 = false; this.signInfo.expenses = data.code; } if(num == 4) { // 选择全科医生 this.isShowList2 = false; this.signInfo.healthDoctorName = data.name this.signInfo.healthDoctor = data.code } }, showTeamName: function(teamCode) { var teamName; if(!this.teamList) { return "请选择签约团队"; } for(var i = 0, len = this.teamList.length; i < len; i++) { if(teamCode == this.teamList[i].id) { teamName = this.teamList[i].name; } } return teamName }, 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 }, 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, shift: 2, content: '../html/photo_show.html?serverType=' + data.serverType + '&patientCode=' + httpData.patientCode }) }, refuse: function() { var vm = this; layer.open({ type: 1, area: ['400px', '300px'], shade: 0.5, title: '拒绝签约原因', shift: 2, shadeClose: false, //点击遮罩关闭层 content: '