index.js 4.3 KB

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