index.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. }
  44. },
  45. methods: {
  46. initTime() {
  47. var vm = this
  48. var now = new Date()
  49. vm.nowyear = vm.chooseYear = now.getFullYear()
  50. vm.years = []
  51. for (i = vm.nowyear; i >= 2013; i--) {
  52. vm.years.push(i)
  53. }
  54. },
  55. getList() {
  56. var vm = this
  57. this.loading = true
  58. var params = {
  59. ...this.form,
  60. page: this.page,
  61. pageSize: this.size
  62. }
  63. if (this.yearType == '1') {
  64. params.startDate = this.chooseYear + '-01-01 00:00'
  65. params.endDate = this.chooseYear + '-12-31 23:59'
  66. } else {
  67. if (this.chooseTime) {
  68. params.startDate = this.chooseTime[0] + ' 00:00'
  69. params.endDate = this.chooseTime[1] + ' 23:59'
  70. }
  71. }
  72. httpRequest.get('statistics/bed/getFamilyBedRecord', { data: params }).then(function (res) {
  73. if (res.status == 200) {
  74. vm.tableData = res.detailModelList
  75. vm.total = res.totalCount
  76. }
  77. vm.loading = false
  78. })
  79. },
  80. queryDate() {
  81. this.page = 1
  82. this.getList()
  83. },
  84. exportTable() {
  85. var vm = this
  86. this.loading = true
  87. var params = {
  88. ...this.form,
  89. page: this.page,
  90. pageSize: this.size
  91. }
  92. if (this.yearType == '1') {
  93. params.startDate = this.chooseYear + '-01-01 00:00'
  94. params.endDate = this.chooseYear + '-12-31 23:59'
  95. } else {
  96. if (this.chooseTime) {
  97. params.startDate = this.chooseTime[0] + ' 00:00'
  98. params.endDate = this.chooseTime[1] + ' 23:59'
  99. }
  100. }
  101. this.exportLoading = true
  102. var fileName = `建床人数${new Date().getTime()}.xls`
  103. httpRequest.downLoadFileForAjax('statistics/bed/exportGetFamilyBedRecord', fileName, params).then(function () {
  104. vm.exportLoading = false
  105. })
  106. },
  107. eliminateClick() {
  108. this.yearType = '1'
  109. this.chooseYear = new Date().getFullYear()
  110. this.chooseTime = null
  111. this.form = {}
  112. },
  113. closeDialog() {
  114. this.dialogShow = false
  115. },
  116. previewRecord(row) {
  117. this.dialogShow = true
  118. },
  119. handleCurrentChange(val) {
  120. this.page = val
  121. this.getList()
  122. },
  123. handleSizeChange(val) {
  124. this.size = val
  125. this.getList()
  126. }
  127. },
  128. mounted() {
  129. this.initTime()
  130. this.getList()
  131. }
  132. })