appoint-select.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. var Request = new Object()
  2. Request = GetRequest()
  3. var patient = Request.patient,
  4. callCode = Request.callCode,
  5. backToSynergy = Request.backToSynergy
  6. $(function () {
  7. // $('#closeBtn').click(function () {
  8. // closeLayer()
  9. // })
  10. })
  11. function closeLayer() {
  12. var index = top.layer.getFrameIndex(window.name)
  13. top.layer.close(index)
  14. }
  15. new Vue({
  16. el: '#app',
  17. data: function () {
  18. return {
  19. hospital: [],
  20. country: [],
  21. selectHospital: 1,
  22. town: '',
  23. show:0,
  24. }
  25. },
  26. mounted: function () {
  27. // top.showSuccessMessage("提交预约挂号成功!")
  28. // this.town = JSON.parse(sessionStorage.getItem('LoginUser')).town
  29. if(this.show == 1){
  30. this.initData()
  31. }else{
  32. this.initDataTwo()
  33. }
  34. },
  35. methods: {
  36. subscribe:function(num) {
  37. this.show = num
  38. if(num == 1){
  39. this.initData()
  40. }else{
  41. this.initDataTwo()
  42. }
  43. },
  44. initDataTwo:function(keyWord) {
  45. var vm = this
  46. jbscAPI.getHospitalSpecialistList({
  47. code:'gxb',
  48. hospitalName:keyWord,
  49. pageNo:'', //后端暂无分页
  50. pageSize:'' //后端暂无分页
  51. }).then(function(res){
  52. vm.hospital = res.data.hospitalSpecialistList
  53. })
  54. },
  55. initData: function (keyWord, keyWord2) {
  56. var loadingid = top.layer.load(1, {
  57. shade: [0.1, '#fff'] //0.1透明度的白色背景
  58. }),
  59. vm = this
  60. jbscAPI
  61. .getOrgList({
  62. city: '350200',
  63. filter: keyWord || '',
  64. type: 1,
  65. page: 1,
  66. pageSize: 100
  67. })
  68. .then(function (res) {
  69. if (res.status == 200) {
  70. vm.hospital = res.data
  71. jbscAPI
  72. .getOrgList({
  73. city: 350200,
  74. filter: keyWord2 || '',
  75. type: 2,
  76. page: 1,
  77. pageSize: 100
  78. })
  79. .then(function (res) {
  80. top.layer.close(loadingid)
  81. if (res.status == 200) {
  82. vm.country = res.data
  83. } else {
  84. top.showErrorMessage(res.msg || '社区列表获取失败!')
  85. }
  86. })
  87. .catch(function (e) {
  88. top.layer.close(loadingid)
  89. console && console.error(e)
  90. })
  91. } else {
  92. top.showErrorMessage(res.msg || '医院列表获取失败!')
  93. }
  94. })
  95. .catch(function (e) {
  96. top.layer.close(loadingid)
  97. console && console.error(e)
  98. })
  99. },
  100. initTypeof: function (type, keyWord) {
  101. if(this.show == 1) {
  102. var loadingid = top.layer.load(1, {
  103. shade: [0.1, '#fff'] //0.1透明度的白色背景
  104. }),
  105. vm = this
  106. jbscAPI
  107. .getOrgList({
  108. city: '350200',
  109. filter: keyWord || '',
  110. type: type,
  111. page: 1,
  112. pageSize: 100
  113. })
  114. .then(function (res) {
  115. top.layer.close(loadingid)
  116. if (res.status == 200) {
  117. if (type == 1) {
  118. vm.hospital = res.data
  119. } else {
  120. vm.country = res.data
  121. }
  122. } else {
  123. if (type == 1) {
  124. top.showErrorMessage(res.msg || '医院列表获取失败!')
  125. } else {
  126. top.showErrorMessage(res.msg || '社区列表获取失败!')
  127. }
  128. }
  129. })
  130. .catch(function (e) {
  131. top.layer.close(loadingid)
  132. console && console.error(e)
  133. })
  134. }else{
  135. this.initDataTwo(keyWord)
  136. }
  137. },
  138. changeTypeHospital(value) {
  139. this.selectHospital = value
  140. console.log('W1s1neeoe', this.selectHospital)
  141. }
  142. }
  143. })