index.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. var template = ''
  2. $.ajax('../../../component/statistics/FollowRecord/index.html', {
  3. data: {},
  4. dataType: 'html',
  5. cache: false,
  6. timeout: 60000,
  7. async: false,
  8. error: function (res) {},
  9. success: function (res) {
  10. template = res
  11. }
  12. })
  13. Vue.component('follow-record', {
  14. template: template,
  15. props: [],
  16. data: function () {
  17. return {
  18. years: [],
  19. yearType: '1',
  20. chooseYear: null,
  21. chooseTime: null,
  22. rangeOptions: [
  23. { label: '区', value: 'town' },
  24. { label: '社区', value: 'hospital' },
  25. { label: '团队', value: 'team' }
  26. ],
  27. areaOptions: [
  28. { label: '思明区', value: '350203' },
  29. { label: '海沧区', value: '350205' },
  30. { label: '湖里区', value: '350206' },
  31. { label: '集美区', value: '350211' },
  32. { label: '同安区', value: '350212' },
  33. { label: '翔安区', value: '350213' }
  34. ],
  35. hospitalOptions: [],
  36. teamOptions: [],
  37. form: {
  38. range: 'town'
  39. },
  40. loading: false,
  41. exportLoading: false,
  42. tableData: [],
  43. tableHeader: [
  44. { label: '居民', prop: 'name', width: '100' },
  45. { label: '年龄', prop: 'age', width: '90' },
  46. { label: '性别', prop: 'sex', width: '90' },
  47. { label: '手机号', prop: 'mobile', width: '110' },
  48. { label: '下转医院', prop: 'turnHospitalName', width: '130' },
  49. { label: '下转医生', prop: 'turnDoctorName', width: '90' },
  50. { label: '下转时间', prop: 'createTime', width: '140' },
  51. { label: '所属机构', prop: 'hospitalName', width: '130' },
  52. { label: '随访医生', prop: 'doctorName', width: '90' },
  53. { label: '计划随访时间', prop: 'followupPlanDate', width: '140' },
  54. { label: '实际随访时间', prop: 'followupDate', width: '140' }
  55. ],
  56. page: 1,
  57. size: 10,
  58. total: 0,
  59. level: 0,
  60. visible: false,
  61. record: {},
  62. selectTak: [],
  63. takingListChecked: [],
  64. takingList: [],
  65. selectAdverse: [],
  66. adverseEventArr: [],
  67. badEventList1: [
  68. { name: '无不良事件', checkBox: false, key: 'badEventNo' },
  69. { name: '心源性原因再次入院', checkBox: false, key: 'badEventCardiac' },
  70. { name: '再发心梗', checkBox: false, key: 'badEventMyocardial' },
  71. { name: '脑卒中', checkBox: false, key: 'badEventStroke' },
  72. { name: '严重出血', checkBox: false, key: 'badEventBleeding' },
  73. { name: '外周血管栓塞', checkBox: false, key: 'badEventVascular' },
  74. { name: '恶性心律失常(室速/室颤)', checkBox: false, key: 'badEventMalignant' },
  75. { name: '左室附壁血栓', checkBox: false, key: 'badEventBlood' },
  76. { name: '死亡', checkBox: false, key: 'badEventBusy' },
  77. { name: '其他', checkBox: false, key: 'badEventOther' }
  78. ],
  79. info: {}
  80. }
  81. },
  82. methods: {
  83. init() {
  84. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  85. if (selectedRole.code.indexOf('350200') > -1) {
  86. this.level = 1 // 市卫健委
  87. this.areaOptions = [
  88. { label: '思明区', value: '350203' },
  89. { label: '海沧区', value: '350205' },
  90. { label: '湖里区', value: '350206' },
  91. { label: '集美区', value: '350211' },
  92. { label: '同安区', value: '350212' },
  93. { label: '翔安区', value: '350213' }
  94. ]
  95. } else if (selectedRole.code.length == 6) {
  96. this.level = 2 // 区管理
  97. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  98. this.form = {
  99. range: 'town',
  100. area: selectedRole.code
  101. }
  102. this.getHospital(selectedRole.code)
  103. } else {
  104. this.level = 3 // 社区管理
  105. this.rangeOptions = [
  106. { label: '社区', value: 'hospital' },
  107. { label: '团队', value: 'team' }
  108. ]
  109. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  110. this.hospital = [{ label: selectedRole.name, value: selectedRole.code }]
  111. this.form = {
  112. range: 'hospital',
  113. area: selectedRole.code.substring(0, 6),
  114. hospital: selectedRole.code
  115. }
  116. this.getTeam(selectedRole.code)
  117. }
  118. this.initTime()
  119. this.getList()
  120. },
  121. initTime() {
  122. var vm = this
  123. var now = new Date()
  124. vm.nowyear = vm.chooseYear = now.getFullYear()
  125. vm.years = []
  126. for (i = vm.nowyear; i >= 2013; i--) {
  127. vm.years.push(i)
  128. }
  129. },
  130. resetArea() {
  131. if (this.level == 1) {
  132. delete this.form.area
  133. delete this.form.hospital
  134. delete this.form.team
  135. } else if (this.level == 2) {
  136. delete this.form.hospital
  137. delete this.form.team
  138. } else {
  139. delete this.form.team
  140. }
  141. },
  142. getList() {
  143. var vm = this
  144. this.loading = true
  145. var params = {
  146. ...this.form,
  147. page: this.page,
  148. pageSize: this.size
  149. }
  150. if (this.yearType == '1') {
  151. params.startDate = this.chooseYear + '-01-01'
  152. params.endDate = this.chooseYear + '-12-31'
  153. } else {
  154. if (this.chooseTime) {
  155. params.startDate = this.chooseTime[0]
  156. params.endDate = this.chooseTime[1]
  157. }
  158. }
  159. httpRequest.get('statistics/collaborate/gxbRehabilitationFollowupRecord', { data: params }).then(function (res) {
  160. if (res.status == 200) {
  161. vm.tableData = res.detailModelList
  162. vm.total = res.totalCount
  163. }
  164. vm.loading = false
  165. })
  166. },
  167. queryDate() {
  168. this.page = 1
  169. this.getList()
  170. },
  171. exportTable() {
  172. var vm = this
  173. var params = {
  174. ...this.form,
  175. page: this.page,
  176. pageSize: this.size
  177. }
  178. if (this.yearType == '1') {
  179. params.startDate = this.chooseYear + '-01-01'
  180. params.endDate = this.chooseYear + '-12-31'
  181. } else {
  182. if (this.chooseTime) {
  183. params.startDate = this.chooseTime[0]
  184. params.endDate = this.chooseTime[1]
  185. }
  186. }
  187. this.exportLoading = true
  188. var fileName = `康复随访记录${new Date().getTime()}.xls`
  189. httpRequest.downLoadFileForAjax('statistics/collaborate/exportGxbRehabilitationFollowupRecord', fileName, params).then(function () {
  190. vm.exportLoading = false
  191. })
  192. },
  193. eliminateClick() {
  194. this.resetArea()
  195. this.yearType = '1'
  196. this.chooseYear = new Date().getFullYear()
  197. this.chooseTime = null
  198. delete this.form.isSign
  199. delete this.form.name
  200. delete this.form.eventType
  201. this.$forceUpdate()
  202. },
  203. getHospital(code) {
  204. var vm = this
  205. delete this.form.hospital
  206. delete this.form.team
  207. var params = {
  208. type: 5,
  209. code: code
  210. }
  211. httpRequest.post('common/district', { data: params }).then(function (res) {
  212. vm.hospitalOptions = res.list
  213. })
  214. },
  215. getTeam(code) {
  216. var vm = this
  217. delete this.form.team
  218. var params = {
  219. hospital: code
  220. }
  221. httpRequest.get('statisticsExport/teamList', { data: params }).then(function (res) {
  222. vm.teamOptions = res.data
  223. })
  224. },
  225. getDictByDictName: function () {
  226. var vm = this
  227. httpRequest.get('/common/getDictByDictName', { data: { name: 'CurrentlyTakingMedication' } }).then(function (res) {
  228. if (res.status == 200) {
  229. var data = res.list
  230. data.forEach(function (v) {
  231. v.checkBox = false
  232. })
  233. vm.takingList = data
  234. }
  235. })
  236. },
  237. handleCurrentChange(val) {
  238. this.page = val
  239. this.getList()
  240. },
  241. handleSizeChange(val) {
  242. this.size = val
  243. this.getList()
  244. },
  245. openDialog(scope) {
  246. var vm = this
  247. this.visible = true
  248. this.info = {
  249. sex: scope.row.sex,
  250. name: scope.row.name,
  251. age: scope.row.age,
  252. doctorName: scope.row.doctorName
  253. }
  254. httpRequest.get('doctor/visitDetail/selectFollowupDiseaseById', { data: { type: 'XiaXinCoronaryHear', followupId: scope.row.id } }).then(function (res) {
  255. if (res.status == 200) {
  256. var data = res.data
  257. console.log(data, 'Data')
  258. // vm.record = data.followup
  259. if (data.content) {
  260. vm.record = data.content
  261. vm.$set(vm, 'takingListChecked', data.content && data.content.takeMedicine.split(','))
  262. vm.$set(vm, 'adverseEventArr', data.content && data.content.adverseEvent.split(','))
  263. vm.flag = '2'
  264. vm.selectTak = vm.takingListChecked.map(function (index) {
  265. vm.takingList[index].index = index
  266. return vm.takingList[index]
  267. })
  268. vm.selectAdverse = vm.adverseEventArr.map(function (index) {
  269. vm.badEventList1[index].index = index
  270. return vm.badEventList1[index]
  271. })
  272. }
  273. return
  274. vm.followData = res.data
  275. vm.form.sex = data.sex
  276. vm.followup = {
  277. followup_id: code,
  278. // status: data.status,
  279. // patientName: vm.serviceInfo.patientName,
  280. followupNextDate: data.followupNextDate,
  281. followupType: data.followupType,
  282. followupClass: data.followupClass,
  283. jwDoctorWorkType: data.jwDoctorWorkType,
  284. followupDate: data.followupDate,
  285. doctorName: data.doctorName,
  286. orgName: data.orgName
  287. // type: vm.serviceInfo.type
  288. }
  289. console.log(vm.followup, '我是vm.followup')
  290. }
  291. })
  292. },
  293. closeDialog() {
  294. this.visible = false
  295. }
  296. },
  297. mounted() {
  298. this.init()
  299. this.getDictByDictName()
  300. }
  301. })