appoint-doctor-detail.js 8.1 KB

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