var Request = new Object() Request = GetRequest() var hospital = JSON.parse(decodeURIComponent(Request.hospital)), patientCode = Request.patient, callCode = Request.callCode, surveyCode = Request.surveyCode, backToSynergy = Request.backToSynergy var dept = null, bookDoctor = null, patientObj = null, arrangeDate = { sectionType: null, startTime: null } function closeLayer() { var index = top.layer.getFrameIndex(window.name) top.layer.close(index) } $(function () { var loadingid = top.layer.load(1, { shade: [0.1, '#fff'] //0.1透明度的白色背景 }) // 获取居民信息 jbscAPI .findByPatient({ patient: patientCode }) .then(function (res) { top.layer.close(loadingid) if (res.status == 200) { patientObj = res.data } else { top.showErrorMessage(res.msg || '居民信息获取失败!') } }) .catch(function (e) { top.layer.close(loadingid) console && console.error(e) }) $('.tit').html(hospital.address || hospital.hospital_name) $('.reback').click(function () { // 如果是康复复诊过去预约挂号,在就诊信息页面少一个字段显示,1隐藏字段,0正常显示 sessionStorage.setItem("isFuzhen",0) top.layer.open({ type: 2, closeBtn: true, // 显示关闭按钮 area: ['800px', '90%'], title: false, content: '../../jbsc/html/appointment/appoint-select.html?patient=' + patientCode + '&callCode=' + callCode }) closeLayer() }) $('.closeBtn').click(function () { closeLayer() }) }) new Vue({ el: '#app', data: function () { return { isSelDoctor: true, doptroon: [], doctors: [], doctortime: null, visittime: { time: [] }, visitindex: null, detailtime: [], iswuhaoyuan: false, data: [ { 'id': 2912568, 'code': '30400', 'hospitalCode': '350211A1004', 'name': '神经内科门诊' }, { 'id': 2912569, 'code': '31500', 'hospitalCode': '350211A1004', 'name': '皮肤科门诊' }, { 'id': 2912570, 'code': '32600', 'hospitalCode': '350211A1004', 'name': '肿瘤科门诊' }, { 'id': 2912571, 'code': '33200', 'hospitalCode': '350211A1004', 'name': '疼痛门诊' }, { 'id': 2912572, 'code': '335', 'hospitalCode': '350211A1004', 'name': 'PICC门诊' }, { 'id': 2912573, 'code': '34600', 'hospitalCode': '350211A1004', 'name': '妇科中医门诊' }, { 'id': 2912574, 'code': '369', 'hospitalCode': '350211A1004', 'name': '帕金森病专病门诊' }, { 'id': 2912575, 'code': '30100', 'hospitalCode': '350211A1004', 'name': '消化内科门诊' }, { 'id': 2912576, 'code': '32800', 'hospitalCode': '350211A1004', 'name': '耳鼻喉科门诊' }, { 'id': 2912577, 'code': '32900', 'hospitalCode': '350211A1004', 'name': '中医肛肠科门诊' }, { 'id': 2912578, 'code': '33800', 'hospitalCode': '350211A1004', 'name': '临床心理专业门诊' }, { 'id': 2912579, 'code': '36300', 'hospitalCode': '350211A1004', 'name': '妇科门诊' }, { 'id': 2912580, 'code': '365', 'hospitalCode': '350211A1004', 'name': '疤痕门诊' }, { 'id': 2912581, 'code': '373', 'hospitalCode': '350211A1004', 'name': '肝胆胰脾门诊' }, { 'id': 2912582, 'code': '31000', 'hospitalCode': '350211A1004', 'name': '骨科门诊' }, { 'id': 2912583, 'code': '31800', 'hospitalCode': '350211A1004', 'name': '中医骨伤科门诊' } ] } }, mounted: function () { this.initData() }, methods: { initData: function (keyWord) { var loadingid = top.layer.load(1, { shade: [0.1, '#fff'] //0.1透明度的白色背景 }), vm = this jbscAPI .getOrgDeptList({ city: 350200, hospitalId: hospital.code=='gxb'?hospital.hospital:hospital.code, filter: keyWord || '', pageIndex: 1, pageSize: 100 }) .then(function (res) { top.layer.close(loadingid) if (res.status == 200) { vm.doptroon = res.data // vm.doptroon = vm.data } else { top.showErrorMessage(res.msg || '预约挂号详情获取失败!') } }) .catch(function (e) { top.layer.close(loadingid) console && console.error(e) }) }, seldoptroon: function (list) { dept = list var loadingid = top.layer.load(1, { shade: [0.1, '#fff'] //0.1透明度的白色背景 }), vm = this jbscAPI .regDeptSpeDoctorList({ hospitalId: hospital.code=='gxb'?hospital.hospital:hospital.code, hosDeptId: list.code }) .then(function (res) { if (res.status == 200) { vm.doctors = res.data ;(vm.doctortime = []), (vm.iswuhaoyuan = vm.doctors.length > 0 ? false : true) Promise.all( _.map(vm.doctors, function (d) { return jbscAPI.getDoctorArrange({ OrgCode: d.hospitalId, DeptCode: d.hosDeptId, DocCode: d.id }) }) ) .then(function (list) { top.layer.close(loadingid) _.each(list, function (o) { vm.doctortime.push(o.data) }) }) .catch(function (e) { top.layer.close(loadingid) console && console.error(e) }) } else { top.layer.close(loadingid) top.showErrorMessage(res.msg || '医生列表获取失败!') } }) .catch(function (e) { top.layer.close(loadingid) console && console.error(e) }) }, seldetail: function (doc) { bookDoctor = this.doctors[doc.index] this.isSelDoctor = false tit = bookDoctor.name + ' ' + bookDoctor.title $('.tit').html(tit) this.visittime = this.doctortime[doc.index] this.visitindex = doc.ind arrangeDate.sectionType = this.doctortime[doc.index][doc.ind].time this.detailtime = this.doctortime[doc.index][doc.ind].sections window.scrollTo(0, 0) }, changeReturn: function () { this.isSelDoctor = true $('.tit').html(hospital.address) window.scrollTo(0, 0) }, changetime: function (data) { arrangeDate.sectionType = data.time this.detailtime = data.sections }, booking: function (data) { arrangeDate.startTime = data.startTime var param = { city: 350200, hospitalId: hospital.code=='gxb'?hospital.hospital:hospital.code, hospitalName: hospital.address || hospital.hospital_name, hosDeptId: dept.code, hosDeptName: dept.name, doctorId: bookDoctor.id, doctorName: bookDoctor.name, arrangeDate: JSON.stringify(data), patient: patientObj.code, patientName: patientObj.name, cardNo: patientObj.idcard, clinicCard: patientObj.ssc, dcode: '', dname: '', patientPhone: patientObj.mobile, callCode: callCode || '', surveyCode:surveyCode || '' } var content = '../../jbsc/html/appointment/appoint-commit.html?paramStr=' + encodeURIComponent(JSON.stringify(param)) if (backToSynergy) { content += '&backToSynergy=1' } top.layer.open({ type: 2, title: false, closeBtn: true, area: ['600px', '800px'], content: content, // zIndex:'99' }) closeLayer() } } })