index.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. var template = ''
  2. $.ajax('../../../component/statistics/Referral/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('referral', {
  14. template: template,
  15. props: [],
  16. data: function () {
  17. return {
  18. years: [],
  19. yearType: '1',
  20. chooseYear: null,
  21. chooseTime: null,
  22. turnOverOptions: [],
  23. form: {},
  24. tableData: [],
  25. tableHeader: [
  26. { label: '住院号', prop: 'visitNo' },
  27. { label: '病人姓名', prop: 'patientName' },
  28. { label: '性别', prop: 'sex' },
  29. { label: '年龄', prop: 'age' },
  30. { label: '建床诊断', prop: 'diagnoseName' },
  31. { label: '建床日期', prop: 'buildingDate', width: '140' },
  32. { label: '建床天数', prop: 'buildingDays' },
  33. { label: '撤床日期', prop: 'withdrawalTime', width: '140' },
  34. { label: '撤床诊断', prop: 'sickOutDiagnoseName' },
  35. { label: '转归情况', prop: 'turnOver' }
  36. ],
  37. dialogShow: false,
  38. info: {},
  39. page: 1,
  40. size: 10,
  41. total: 0,
  42. loading: false,
  43. exportLoading: false,
  44. sexDict: {
  45. 1: '男',
  46. 2: '女'
  47. },
  48. turnOverObj: {}
  49. }
  50. },
  51. methods: {
  52. initTime() {
  53. var vm = this
  54. var now = new Date()
  55. vm.nowyear = vm.chooseYear = now.getFullYear()
  56. vm.years = []
  57. for (i = vm.nowyear; i >= 2013; i--) {
  58. vm.years.push(i)
  59. }
  60. },
  61. getList() {
  62. var vm = this
  63. this.loading = true
  64. var params = {
  65. ...this.form,
  66. page: this.page,
  67. pageSize: this.size
  68. }
  69. if (this.yearType == '1') {
  70. params.startDate = this.chooseYear + '-01-01 00:00'
  71. params.endDate = this.chooseYear + '-12-31 23:59'
  72. } else {
  73. if (this.chooseTime) {
  74. params.startDate = this.chooseTime[0] + ' 00:00'
  75. params.endDate = this.chooseTime[1] + ' 23:59'
  76. }
  77. }
  78. httpRequest.get('statistics/bed/getFamilyBedWithdrawalStatistics', { data: params }).then(function (res) {
  79. if (res.status == 200) {
  80. vm.tableData = res.detailModelList
  81. vm.total = res.totalCount
  82. }
  83. vm.loading = false
  84. })
  85. },
  86. queryDate() {
  87. this.page = 1
  88. this.getList()
  89. },
  90. exportTable() {
  91. var vm = this
  92. var params = {
  93. ...this.form,
  94. page: this.page,
  95. pageSize: this.size
  96. }
  97. if (this.yearType == '1') {
  98. params.startDate = this.chooseYear + '-01-01 00:00'
  99. params.endDate = this.chooseYear + '-12-31 23:59'
  100. } else {
  101. if (this.chooseTime) {
  102. params.startDate = this.chooseTime[0] + ' 00:00'
  103. params.endDate = this.chooseTime[1] + ' 23:59'
  104. }
  105. }
  106. this.exportLoading = true
  107. var fileName = `患者情况${new Date().getTime()}.xls`
  108. httpRequest.downLoadFileForAjax('statistics/bed/exportGetFamilyBedWithdrawalStatistics', fileName, params).then(function () {
  109. vm.exportLoading = false
  110. })
  111. },
  112. eliminateClick() {
  113. this.form = {}
  114. this.yearType = '1'
  115. this.chooseYear = new Date().getFullYear()
  116. this.chooseTime = null
  117. },
  118. closeDialog() {
  119. this.dialogShow = false
  120. },
  121. previewRecord(row) {
  122. var vm = this
  123. this.dialogShow = true
  124. httpRequest.get('doctor/familyBed/findBedWithdrawal', { data: { bedRecordCode: row.code } }).then(function (res) {
  125. vm.info = res.data
  126. })
  127. },
  128. getDictData() {
  129. var vm = this
  130. statisticAPI.getDictByDictName({ name: 'jkcopd_disease_conversion' }).then(function (res) {
  131. vm.turnOverOptions = [{ value: '全部' }]
  132. vm.turnOverOptions = vm.turnOverOptions.concat(res.list)
  133. for (var item of res.list) {
  134. vm.turnOverObj[item.code] = item.value
  135. }
  136. })
  137. },
  138. handleCurrentChange(val) {
  139. this.page = val
  140. this.getList()
  141. },
  142. handleSizeChange(val) {
  143. this.size = val
  144. this.getList()
  145. },
  146. getImgUrl(url) {
  147. return httpRequest.getImgUrl(url)
  148. }
  149. },
  150. mounted() {
  151. this.initTime()
  152. this.getDictData()
  153. this.getList()
  154. }
  155. })