appoint-doctor-detail.js 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. var Request = new Object()
  2. Request = GetRequest()
  3. var hospital = JSON.parse(decodeURIComponent(Request.hospital)),
  4. patientCode = Request.patient,
  5. callCode = Request.callCode,
  6. backToSynergy = Request.backToSynergy
  7. var dept = null,
  8. bookDoctor = null,
  9. patientObj = null,
  10. arrangeDate = {
  11. sectionType: null,
  12. startTime: null
  13. }
  14. function closeLayer() {
  15. var index = top.layer.getFrameIndex(window.name)
  16. top.layer.close(index)
  17. }
  18. $(function () {
  19. var loadingid = top.layer.load(1, {
  20. shade: [0.1, '#fff'] //0.1透明度的白色背景
  21. })
  22. // 获取居民信息
  23. jbscAPI
  24. .findByPatient({ patient: patientCode })
  25. .then(function (res) {
  26. top.layer.close(loadingid)
  27. if (res.status == 200) {
  28. patientObj = res.data
  29. } else {
  30. top.showErrorMessage(res.msg || '居民信息获取失败!')
  31. }
  32. })
  33. .catch(function (e) {
  34. top.layer.close(loadingid)
  35. console && console.error(e)
  36. })
  37. $('.tit').html(hospital.address)
  38. $('.reback').click(function () {
  39. top.layer.open({
  40. type: 2,
  41. closeBtn: true, // 显示关闭按钮
  42. area: ['800px', '90%'],
  43. title: false,
  44. content: '../../jbsc/html/appointment/appoint-select.html?patient=' + patientCode + '&callCode=' + callCode
  45. })
  46. closeLayer()
  47. })
  48. $('.closeBtn').click(function () {
  49. closeLayer()
  50. })
  51. })
  52. new Vue({
  53. el: '#app',
  54. data: function () {
  55. return {
  56. isSelDoctor: true,
  57. doptroon: [],
  58. doctors: [],
  59. doctortime: null,
  60. visittime: {
  61. time: []
  62. },
  63. visitindex: null,
  64. detailtime: [],
  65. iswuhaoyuan: false,
  66. data: [
  67. {
  68. 'id': 2912568,
  69. 'code': '30400',
  70. 'hospitalCode': '350211A1004',
  71. 'name': '神经内科门诊'
  72. },
  73. {
  74. 'id': 2912569,
  75. 'code': '31500',
  76. 'hospitalCode': '350211A1004',
  77. 'name': '皮肤科门诊'
  78. },
  79. {
  80. 'id': 2912570,
  81. 'code': '32600',
  82. 'hospitalCode': '350211A1004',
  83. 'name': '肿瘤科门诊'
  84. },
  85. {
  86. 'id': 2912571,
  87. 'code': '33200',
  88. 'hospitalCode': '350211A1004',
  89. 'name': '疼痛门诊'
  90. },
  91. {
  92. 'id': 2912572,
  93. 'code': '335',
  94. 'hospitalCode': '350211A1004',
  95. 'name': 'PICC门诊'
  96. },
  97. {
  98. 'id': 2912573,
  99. 'code': '34600',
  100. 'hospitalCode': '350211A1004',
  101. 'name': '妇科中医门诊'
  102. },
  103. {
  104. 'id': 2912574,
  105. 'code': '369',
  106. 'hospitalCode': '350211A1004',
  107. 'name': '帕金森病专病门诊'
  108. },
  109. {
  110. 'id': 2912575,
  111. 'code': '30100',
  112. 'hospitalCode': '350211A1004',
  113. 'name': '消化内科门诊'
  114. },
  115. {
  116. 'id': 2912576,
  117. 'code': '32800',
  118. 'hospitalCode': '350211A1004',
  119. 'name': '耳鼻喉科门诊'
  120. },
  121. {
  122. 'id': 2912577,
  123. 'code': '32900',
  124. 'hospitalCode': '350211A1004',
  125. 'name': '中医肛肠科门诊'
  126. },
  127. {
  128. 'id': 2912578,
  129. 'code': '33800',
  130. 'hospitalCode': '350211A1004',
  131. 'name': '临床心理专业门诊'
  132. },
  133. {
  134. 'id': 2912579,
  135. 'code': '36300',
  136. 'hospitalCode': '350211A1004',
  137. 'name': '妇科门诊'
  138. },
  139. {
  140. 'id': 2912580,
  141. 'code': '365',
  142. 'hospitalCode': '350211A1004',
  143. 'name': '疤痕门诊'
  144. },
  145. {
  146. 'id': 2912581,
  147. 'code': '373',
  148. 'hospitalCode': '350211A1004',
  149. 'name': '肝胆胰脾门诊'
  150. },
  151. {
  152. 'id': 2912582,
  153. 'code': '31000',
  154. 'hospitalCode': '350211A1004',
  155. 'name': '骨科门诊'
  156. },
  157. {
  158. 'id': 2912583,
  159. 'code': '31800',
  160. 'hospitalCode': '350211A1004',
  161. 'name': '中医骨伤科门诊'
  162. }
  163. ]
  164. }
  165. },
  166. mounted: function () {
  167. this.initData()
  168. },
  169. methods: {
  170. initData: function (keyWord) {
  171. var loadingid = top.layer.load(1, {
  172. shade: [0.1, '#fff'] //0.1透明度的白色背景
  173. }),
  174. vm = this
  175. jbscAPI
  176. .getOrgDeptList({
  177. city: 350200,
  178. hospitalId: hospital.code,
  179. filter: keyWord || '',
  180. pageIndex: 1,
  181. pageSize: 100
  182. })
  183. .then(function (res) {
  184. top.layer.close(loadingid)
  185. if (res.status == 200) {
  186. vm.doptroon = res.data
  187. vm.doptroon = vm.data
  188. } else {
  189. top.showErrorMessage(res.msg || '预约挂号详情获取失败!')
  190. }
  191. })
  192. .catch(function (e) {
  193. top.layer.close(loadingid)
  194. console && console.error(e)
  195. })
  196. },
  197. seldoptroon: function (list) {
  198. dept = list
  199. var loadingid = top.layer.load(1, {
  200. shade: [0.1, '#fff'] //0.1透明度的白色背景
  201. }),
  202. vm = this
  203. jbscAPI
  204. .regDeptSpeDoctorList({
  205. hospitalId: hospital.code,
  206. hosDeptId: list.code
  207. })
  208. .then(function (res) {
  209. if (res.status == 200) {
  210. vm.doctors = res.data
  211. ;(vm.doctortime = []), (vm.iswuhaoyuan = vm.doctors.length > 0 ? false : true)
  212. Promise.all(
  213. _.map(vm.doctors, function (d) {
  214. return jbscAPI.getDoctorArrange({
  215. OrgCode: d.hospitalId,
  216. DeptCode: d.hosDeptId,
  217. DocCode: d.id
  218. })
  219. })
  220. )
  221. .then(function (list) {
  222. top.layer.close(loadingid)
  223. _.each(list, function (o) {
  224. vm.doctortime.push(o.data)
  225. })
  226. })
  227. .catch(function (e) {
  228. top.layer.close(loadingid)
  229. console && console.error(e)
  230. })
  231. } else {
  232. top.layer.close(loadingid)
  233. top.showErrorMessage(res.msg || '医生列表获取失败!')
  234. }
  235. })
  236. .catch(function (e) {
  237. top.layer.close(loadingid)
  238. console && console.error(e)
  239. })
  240. },
  241. seldetail: function (doc) {
  242. bookDoctor = this.doctors[doc.index]
  243. this.isSelDoctor = false
  244. tit = bookDoctor.name + ' ' + bookDoctor.title
  245. $('.tit').html(tit)
  246. this.visittime = this.doctortime[doc.index]
  247. this.visitindex = doc.ind
  248. arrangeDate.sectionType = this.doctortime[doc.index][doc.ind].time
  249. this.detailtime = this.doctortime[doc.index][doc.ind].sections
  250. window.scrollTo(0, 0)
  251. },
  252. changeReturn: function () {
  253. this.isSelDoctor = true
  254. $('.tit').html(hospital.address)
  255. window.scrollTo(0, 0)
  256. },
  257. changetime: function (data) {
  258. arrangeDate.sectionType = data.time
  259. this.detailtime = data.sections
  260. },
  261. booking: function (data) {
  262. arrangeDate.startTime = data.startTime
  263. var param = {
  264. city: 350200,
  265. hospitalId: hospital.code,
  266. hospitalName: hospital.address,
  267. hosDeptId: dept.code,
  268. hosDeptName: dept.name,
  269. doctorId: bookDoctor.id,
  270. doctorName: bookDoctor.name,
  271. arrangeDate: JSON.stringify(data),
  272. patient: patientObj.code,
  273. patientName: patientObj.name,
  274. cardNo: patientObj.idcard,
  275. clinicCard: patientObj.ssc,
  276. dcode: '',
  277. dname: '',
  278. patientPhone: patientObj.mobile,
  279. callCode: callCode || ''
  280. }
  281. var content =
  282. '../../jbsc/html/appointment/appoint-commit.html?paramStr=' + encodeURIComponent(JSON.stringify(param))
  283. if (backToSynergy) {
  284. content += '&backToSynergy=1'
  285. }
  286. top.layer.open({
  287. type: 2,
  288. title: false,
  289. closeBtn: true,
  290. area: ['600px', '800px'],
  291. content: content
  292. })
  293. closeLayer()
  294. }
  295. }
  296. })