appoint-select.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. console.log('sssssssssssssssssssssssssssssssss', this.fuzhen, 'fuzhen')
  31. // top.showSuccessMessage("提交预约挂号成功!")
  32. // this.town = JSON.parse(sessionStorage.getItem('LoginUser')).town
  33. if (this.show == 1) {
  34. this.initData()
  35. } else {
  36. this.initDataTwo()
  37. }
  38. },
  39. methods: {
  40. subscribe: function (num) {
  41. this.show = num
  42. if (num == 1) {
  43. this.initData()
  44. } else {
  45. this.initDataTwo()
  46. }
  47. },
  48. initDataTwo: function (keyWord) {
  49. var vm = this
  50. jbscAPI
  51. .getHospitalSpecialistList({
  52. code: 'gxb',
  53. hospitalName: keyWord,
  54. pageNo: '', //后端暂无分页
  55. pageSize: '' //后端暂无分页
  56. })
  57. .then(function (res) {
  58. vm.hospital = res.data.hospitalSpecialistList
  59. })
  60. },
  61. initData: function (keyWord, keyWord2) {
  62. var loadingid = top.layer.load(1, {
  63. shade: [0.1, '#fff'] //0.1透明度的白色背景
  64. }),
  65. vm = this
  66. jbscAPI
  67. .getOrgList({
  68. city: '350200',
  69. filter: keyWord || '',
  70. type: 1,
  71. page: 1,
  72. pageSize: 100
  73. })
  74. .then(function (res) {
  75. if (res.status == 200) {
  76. vm.hospital = res.data
  77. jbscAPI
  78. .getOrgList({
  79. city: 350200,
  80. filter: keyWord2 || '',
  81. type: 2,
  82. page: 1,
  83. pageSize: 100
  84. })
  85. .then(function (res) {
  86. top.layer.close(loadingid)
  87. if (res.status == 200) {
  88. vm.country = res.data
  89. } else {
  90. top.showErrorMessage(res.msg || '社区列表获取失败!')
  91. }
  92. })
  93. .catch(function (e) {
  94. top.layer.close(loadingid)
  95. console && console.error(e)
  96. })
  97. } else {
  98. top.showErrorMessage(res.msg || '医院列表获取失败!')
  99. }
  100. })
  101. .catch(function (e) {
  102. top.layer.close(loadingid)
  103. console && console.error(e)
  104. })
  105. },
  106. initTypeof: function (type, keyWord) {
  107. if (this.show == 1) {
  108. var loadingid = top.layer.load(1, {
  109. shade: [0.1, '#fff'] //0.1透明度的白色背景
  110. }),
  111. vm = this
  112. jbscAPI
  113. .getOrgList({
  114. city: '350200',
  115. filter: keyWord || '',
  116. type: type,
  117. page: 1,
  118. pageSize: 100
  119. })
  120. .then(function (res) {
  121. top.layer.close(loadingid)
  122. if (res.status == 200) {
  123. if (type == 1) {
  124. vm.hospital = res.data
  125. } else {
  126. vm.country = res.data
  127. }
  128. } else {
  129. if (type == 1) {
  130. top.showErrorMessage(res.msg || '医院列表获取失败!')
  131. } else {
  132. top.showErrorMessage(res.msg || '社区列表获取失败!')
  133. }
  134. }
  135. })
  136. .catch(function (e) {
  137. top.layer.close(loadingid)
  138. console && console.error(e)
  139. })
  140. } else {
  141. this.initDataTwo(keyWord)
  142. }
  143. },
  144. changeTypeHospital(value) {
  145. this.selectHospital = value
  146. console.log('W1s1neeoe', this.selectHospital)
  147. }
  148. }
  149. })