index.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. var template = ''
  2. $.ajax('../../../component/statistics/BuildBed/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('build-bed', {
  14. template: template,
  15. props: [],
  16. data: function () {
  17. return {
  18. years: [],
  19. yearType: '1',
  20. chooseYear: null,
  21. chooseTime: null,
  22. form: {},
  23. tableData: [],
  24. tableHeader: [
  25. { label: '病人姓名', prop: 'patientName', width: '90' },
  26. { label: '性别', prop: 'sex',width: '80' },
  27. { label: '年龄', prop: 'age',width:'80' },
  28. { label: '手机号', prop: 'mobile',width: '130' },
  29. { label: '身份证号', prop: 'idcard',width: '170' },
  30. { label: '住院号', prop: 'visitNo',width: '110' },
  31. { label: '护理等级', prop: 'sickTendLevelName',width: '110' },
  32. { label: '病情', prop: 'sickStateName',width: '110' },
  33. { label: '主诊断', prop: 'sickDiagnoseCodeName',width: '110' },
  34. { label: '责任医师', prop: 'adminVisitOperatorName',width: '90' },
  35. { label: '上级医师', prop: 'upperOperatorName',width: '90' },
  36. { label: '主营护士', prop: 'adminTendOperatorName',width: '90' },
  37. { label: '床位名称', prop: 'sickBedName' ,width: '110'},
  38. { label: '建床时间', prop: 'buildingTime',width: '160' }
  39. ],
  40. page: 1,
  41. size: 10,
  42. total: 0,
  43. loading: false,
  44. exportLoading: false
  45. }
  46. },
  47. methods: {
  48. initTime() {
  49. var vm = this
  50. var now = new Date()
  51. vm.nowyear = vm.chooseYear = now.getFullYear()
  52. vm.years = []
  53. for (i = vm.nowyear; i >= 2013; i--) {
  54. vm.years.push(i)
  55. }
  56. },
  57. getList() {
  58. var vm = this
  59. this.loading = true
  60. var params = {
  61. ...this.form,
  62. page: this.page,
  63. pageSize: this.size
  64. }
  65. if (this.yearType == '1') {
  66. params.startDate = this.chooseYear + '-01-01 00:00'
  67. params.endDate = this.chooseYear + '-12-31 23:59'
  68. } else {
  69. if (this.chooseTime) {
  70. params.startDate = this.chooseTime[0] + ' 00:00'
  71. params.endDate = this.chooseTime[1] + ' 23:59'
  72. }
  73. }
  74. httpRequest.get('statistics/bed/getFamilyBedRecord', { data: params }).then(function (res) {
  75. if (res.status == 200) {
  76. vm.tableData = res.detailModelList
  77. vm.total = res.totalCount
  78. }
  79. vm.loading = false
  80. })
  81. },
  82. queryDate() {
  83. this.page = 1
  84. this.getList()
  85. },
  86. exportTable() {
  87. var vm = this
  88. var params = {
  89. ...this.form,
  90. page: this.page,
  91. pageSize: this.size
  92. }
  93. if (this.yearType == '1') {
  94. params.startDate = this.chooseYear + '-01-01 00:00'
  95. params.endDate = this.chooseYear + '-12-31 23:59'
  96. } else {
  97. if (this.chooseTime) {
  98. params.startDate = this.chooseTime[0] + ' 00:00'
  99. params.endDate = this.chooseTime[1] + ' 23:59'
  100. }
  101. }
  102. this.exportLoading = true
  103. var fileName = `建床人数${new Date().getTime()}.xls`
  104. httpRequest.downLoadFileForAjax('statistics/bed/exportGetFamilyBedRecord', fileName, params).then(function () {
  105. vm.exportLoading = false
  106. })
  107. },
  108. eliminateClick() {
  109. this.yearType = '1'
  110. this.chooseYear = new Date().getFullYear()
  111. this.chooseTime = null
  112. this.form = {}
  113. },
  114. closeDialog() {
  115. this.dialogShow = false
  116. },
  117. previewRecord(row) {
  118. this.dialogShow = true
  119. },
  120. handleCurrentChange(val) {
  121. this.page = val
  122. this.getList()
  123. },
  124. handleSizeChange(val) {
  125. this.size = val
  126. this.getList()
  127. }
  128. },
  129. mounted() {
  130. this.initTime()
  131. this.getList()
  132. }
  133. })