appoint-select.js 3.5 KB

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