appoint-select.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. }
  24. },
  25. mounted: function () {
  26. // top.showSuccessMessage("提交预约挂号成功!")
  27. // this.town = JSON.parse(sessionStorage.getItem('LoginUser')).town
  28. this.initData()
  29. },
  30. methods: {
  31. initData: function (keyWord, keyWord2) {
  32. var loadingid = top.layer.load(1, {
  33. shade: [0.1, '#fff'] //0.1透明度的白色背景
  34. }),
  35. vm = this
  36. jbscAPI
  37. .getOrgList({
  38. city: '350200',
  39. filter: keyWord || '',
  40. type: 1,
  41. page: 1,
  42. pageSize: 100
  43. })
  44. .then(function (res) {
  45. if (res.status == 200) {
  46. vm.hospital = res.data
  47. jbscAPI
  48. .getOrgList({
  49. city: 350200,
  50. filter: keyWord2 || '',
  51. type: 2,
  52. page: 1,
  53. pageSize: 100
  54. })
  55. .then(function (res) {
  56. top.layer.close(loadingid)
  57. if (res.status == 200) {
  58. vm.country = res.data
  59. } else {
  60. top.showErrorMessage(res.msg || '社区列表获取失败!')
  61. }
  62. })
  63. .catch(function (e) {
  64. top.layer.close(loadingid)
  65. console && console.error(e)
  66. })
  67. } else {
  68. top.showErrorMessage(res.msg || '医院列表获取失败!')
  69. }
  70. })
  71. .catch(function (e) {
  72. top.layer.close(loadingid)
  73. console && console.error(e)
  74. })
  75. },
  76. initTypeof: function (type, keyWord) {
  77. var loadingid = top.layer.load(1, {
  78. shade: [0.1, '#fff'] //0.1透明度的白色背景
  79. }),
  80. vm = this
  81. jbscAPI
  82. .getOrgList({
  83. city: '350200',
  84. filter: keyWord || '',
  85. type: type,
  86. page: 1,
  87. pageSize: 100
  88. })
  89. .then(function (res) {
  90. top.layer.close(loadingid)
  91. if (res.status == 200) {
  92. if (type == 1) {
  93. vm.hospital = res.data
  94. } else {
  95. vm.country = res.data
  96. }
  97. } else {
  98. if (type == 1) {
  99. top.showErrorMessage(res.msg || '医院列表获取失败!')
  100. } else {
  101. top.showErrorMessage(res.msg || '社区列表获取失败!')
  102. }
  103. }
  104. })
  105. .catch(function (e) {
  106. top.layer.close(loadingid)
  107. console && console.error(e)
  108. })
  109. },
  110. changeTypeHospital(value) {
  111. this.selectHospital = value
  112. console.log('W1s1neeoe', this.selectHospital)
  113. }
  114. }
  115. })