index.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. var template = ''
  2. $.ajax('../../../component/statistics/BedCheck/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('bed-check', {
  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: 'visitNo' },
  26. { label: '患者姓名', prop: 'patientName' },
  27. { label: '性别', prop: 'sex' },
  28. { label: '年龄', prop: 'age' },
  29. { label: '建床日期', prop: 'buildingTime' },
  30. { label: '计划查床时间', prop: 'checkTime' },
  31. { label: '完成时间', prop: 'checkDate' },
  32. { label: '查床人员', prop: 'doctorName' },
  33. { label: '服务内容', prop: 'diseaseCondition' }
  34. ],
  35. dialogShow: false,
  36. info: {},
  37. page: 1,
  38. size: 10,
  39. total: 0,
  40. loading: false,
  41. exportLoading: false,
  42. sexDict: {
  43. 1: '男',
  44. 2: '女'
  45. },
  46. serviceList: {}
  47. }
  48. },
  49. methods: {
  50. initTime() {
  51. var vm = this
  52. var now = new Date()
  53. vm.nowyear = vm.chooseYear = now.getFullYear()
  54. vm.years = []
  55. for (i = vm.nowyear; i >= 2013; i--) {
  56. vm.years.push(i)
  57. }
  58. },
  59. getList() {
  60. var vm = this
  61. this.loading = true
  62. var params = {
  63. ...this.form,
  64. page: this.page,
  65. pageSize: this.size,
  66. status: 1
  67. }
  68. if (this.yearType == '1') {
  69. params.startDate = this.chooseYear + '-01-01 00:00'
  70. params.endDate = this.chooseYear + '-12-31 23:59'
  71. } else {
  72. if (this.chooseTime) {
  73. params.startDate = this.chooseTime[0] + ' 00:00'
  74. params.endDate = this.chooseTime[1] + ' 23:59'
  75. }
  76. }
  77. httpRequest.get('statistics/bed/getFamilyBedPlanStatistics', { data: params }).then(function (res) {
  78. if (res.status == 200) {
  79. vm.tableData = res.detailModelList
  80. vm.total = res.totalCount
  81. }
  82. vm.loading = false
  83. })
  84. },
  85. queryDate() {
  86. this.page = 1
  87. this.getList()
  88. },
  89. exportTable() {
  90. var vm = this
  91. var params = {
  92. ...this.form,
  93. page: this.page,
  94. pageSize: this.size
  95. }
  96. if (this.yearType == '1') {
  97. params.startDate = this.chooseYear + '-01-01 00:00'
  98. params.endDate = this.chooseYear + '-12-31 23:59'
  99. } else {
  100. if (this.chooseTime) {
  101. params.startDate = this.chooseTime[0] + ' 00:00'
  102. params.endDate = this.chooseTime[1] + ' 23:59'
  103. }
  104. }
  105. this.exportLoading = true
  106. var fileName = `查床情况${new Date().getTime()}.xls`
  107. httpRequest.downLoadFileForAjax('statistics/bed/exportGetFamilyBedPlanStatistics', fileName, params).then(function () {
  108. vm.exportLoading = false
  109. })
  110. },
  111. eliminateClick() {
  112. this.form = {}
  113. this.yearType = '1'
  114. this.chooseYear = new Date().getFullYear()
  115. this.chooseTime = null
  116. },
  117. closeDialog() {
  118. this.dialogShow = false
  119. },
  120. previewRecord(row) {
  121. var vm = this
  122. this.dialogShow = true
  123. httpRequest.get('doctor/familyBed/findCheckPlanDetail', { data: {id: row.id} }).then(function (res) {
  124. if (res.status == 200) {
  125. vm.info = res.data
  126. if (res.data.planDoctorList) {
  127. vm.info.planDoctor = res.data.planDoctorList.map(function(item){return item.doctorName}).join(',')
  128. }
  129. if (res.data.signWay) {
  130. vm.info.signMethod = res.data.signWay == 1 ? '定位签到' : '拍照签到'
  131. }
  132. }
  133. })
  134. },
  135. handleCurrentChange(val) {
  136. this.page = val
  137. this.getList()
  138. },
  139. handleSizeChange(val) {
  140. this.size = val
  141. this.getList()
  142. },
  143. getDictData() {
  144. var vm = this
  145. statisticAPI.getDictByDictName({ name: 'IV_FAMILY_BED_SERVICE_TYPE' }).then(function (res) {
  146. for(var item of res.list){
  147. vm.serviceList[item.code] = item.value
  148. }
  149. })
  150. }
  151. },
  152. mounted() {
  153. this.initTime()
  154. this.getList()
  155. this.getDictData()
  156. }
  157. })