123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- var Request = new Object()
- Request = GetRequest()
- var patient = Request.patient,
- callCode = Request.callCode,
- surveyCode = Request.surveyCode,
- backToSynergy = Request.backToSynergy
- $(function () {
- // $('#closeBtn').click(function () {
- // closeLayer()
- // })
- })
- function closeLayer() {
- var index = top.layer.getFrameIndex(window.name)
- top.layer.close(index)
- }
- new Vue({
- el: '#app',
- data: function () {
- return {
- hospital: [],
- country: [],
- selectHospital: 1,
- town: '',
- show:0,
- }
- },
- mounted: function () {
- // top.showSuccessMessage("提交预约挂号成功!")
- // this.town = JSON.parse(sessionStorage.getItem('LoginUser')).town
- if(this.show == 1){
- this.initData()
- }else{
- this.initDataTwo()
- }
- },
- methods: {
- subscribe:function(num) {
- this.show = num
- if(num == 1){
- this.initData()
- }else{
- this.initDataTwo()
- }
- },
- initDataTwo:function(keyWord) {
- var vm = this
- jbscAPI.getHospitalSpecialistList({
- code:'gxb',
- hospitalName:keyWord,
- pageNo:'', //后端暂无分页
- pageSize:'' //后端暂无分页
- }).then(function(res){
- vm.hospital = res.data.hospitalSpecialistList
- })
- },
- initData: function (keyWord, keyWord2) {
- var loadingid = top.layer.load(1, {
- shade: [0.1, '#fff'] //0.1透明度的白色背景
- }),
- vm = this
- jbscAPI
- .getOrgList({
- city: '350200',
- filter: keyWord || '',
- type: 1,
- page: 1,
- pageSize: 100
- })
- .then(function (res) {
- if (res.status == 200) {
- vm.hospital = res.data
- jbscAPI
- .getOrgList({
- city: 350200,
- filter: keyWord2 || '',
- type: 2,
- page: 1,
- pageSize: 100
- })
- .then(function (res) {
- top.layer.close(loadingid)
- if (res.status == 200) {
- vm.country = res.data
- } else {
- top.showErrorMessage(res.msg || '社区列表获取失败!')
- }
- })
- .catch(function (e) {
- top.layer.close(loadingid)
- console && console.error(e)
- })
- } else {
- top.showErrorMessage(res.msg || '医院列表获取失败!')
- }
- })
- .catch(function (e) {
- top.layer.close(loadingid)
- console && console.error(e)
- })
- },
- initTypeof: function (type, keyWord) {
- if(this.show == 1) {
- var loadingid = top.layer.load(1, {
- shade: [0.1, '#fff'] //0.1透明度的白色背景
- }),
- vm = this
- jbscAPI
- .getOrgList({
- city: '350200',
- filter: keyWord || '',
- type: type,
- page: 1,
- pageSize: 100
- })
- .then(function (res) {
- top.layer.close(loadingid)
- if (res.status == 200) {
- if (type == 1) {
- vm.hospital = res.data
- } else {
- vm.country = res.data
- }
- } else {
- if (type == 1) {
- top.showErrorMessage(res.msg || '医院列表获取失败!')
- } else {
- top.showErrorMessage(res.msg || '社区列表获取失败!')
- }
- }
- })
- .catch(function (e) {
- top.layer.close(loadingid)
- console && console.error(e)
- })
- }else{
- this.initDataTwo(keyWord)
- }
- },
- changeTypeHospital(value) {
- this.selectHospital = value
- console.log('W1s1neeoe', this.selectHospital)
- }
- }
- })
|