index.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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: 'buildingDay' },
  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. this.loading = true
  93. var params = {
  94. ...this.form,
  95. page: this.page,
  96. pageSize: this.size
  97. }
  98. if (this.yearType == '1') {
  99. params.startDate = this.chooseYear + '-01-01 00:00'
  100. params.endDate = this.chooseYear + '-12-31 23:59'
  101. } else {
  102. if (this.chooseTime) {
  103. params.startDate = this.chooseTime[0] + ' 00:00'
  104. params.endDate = this.chooseTime[1]+ ' 23:59'
  105. }
  106. }
  107. this.exportLoading = true
  108. var fileName = `患者情况${new Date().getTime()}.xls`
  109. httpRequest.downLoadFileForAjax('statistics/bed/exportGetFamilyBedWithdrawalStatistics', fileName, params).then(function () {
  110. vm.exportLoading = false
  111. })
  112. },
  113. eliminateClick() {
  114. this.form = {}
  115. this.yearType = '1'
  116. this.chooseYear = new Date().getFullYear()
  117. this.chooseTime = null
  118. },
  119. closeDialog() {
  120. this.dialogShow = false
  121. },
  122. previewRecord(row) {
  123. var vm = this
  124. this.dialogShow = true
  125. httpRequest.get('doctor/familyBed/findBedWithdrawal', { data: { bedRecordCode: row.code } }).then(function (res) {
  126. vm.info = res.data
  127. })
  128. },
  129. getDictData() {
  130. var vm = this
  131. statisticAPI.getDictByDictName({ name: 'jkcopd_disease_conversion' }).then(function (res) {
  132. vm.turnOverOptions = [{ value: '全部' }]
  133. vm.turnOverOptions = vm.turnOverOptions.concat(res.list)
  134. for (var item of res.list) {
  135. vm.turnOverObj[item.code] = item.value
  136. }
  137. })
  138. },
  139. handleCurrentChange(val) {
  140. this.page = val
  141. this.getList()
  142. },
  143. handleSizeChange(val) {
  144. this.size = val
  145. this.getList()
  146. },
  147. },
  148. mounted() {
  149. this.initTime()
  150. this.getDictData()
  151. this.getList()
  152. }
  153. })