appoint-select.js 3.4 KB

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