appoint-doctor-detail.js 8.3 KB

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