index.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. var template = ''
  2. $.ajax('../../../component/statistics/PlanService/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('plan-service', {
  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', width: '140' },
  30. { label: '查床周期', prop: 'checkBedCircleName' },
  31. { label: '查床开始日期', prop: 'checkTime' },
  32. { label: '查床人员', prop: 'doctorName' }
  33. ],
  34. dialogShow: false,
  35. planList: [
  36. { checkTime: '2024-11-01 9:30', patientName: '黄小蕾', checkPlanStatusName: '计划中', color: '#0099ff' },
  37. { checkTime: '2024-11-02 9:30', patientName: '黄小蕾', checkPlanStatusName: '已完成', color: '#099d09' },
  38. { checkTime: '2024-11-03 9:30', patientName: '黄小蕾', checkPlanStatusName: '计划超时', color: '#ff0000' },
  39. { checkTime: '2024-11-04 9:30', patientName: '黄小蕾', checkPlanStatusName: '计划中', color: '#0099ff' }
  40. ],
  41. page: 1,
  42. size: 10,
  43. total: 0,
  44. loading: false,
  45. exportLoading: false
  46. }
  47. },
  48. methods: {
  49. initTime() {
  50. var vm = this
  51. var now = new Date()
  52. vm.nowyear = vm.chooseYear = now.getFullYear()
  53. vm.years = []
  54. for (i = vm.nowyear; i >= 2013; i--) {
  55. vm.years.push(i)
  56. }
  57. },
  58. getList() {
  59. var vm = this
  60. this.loading = true
  61. var params = {
  62. ...this.form,
  63. page: this.page,
  64. pageSize: this.size
  65. }
  66. if (this.yearType == '1') {
  67. params.startDate = this.chooseYear + '-01-01 00:00'
  68. params.endDate = this.chooseYear + '-12-31 23:59'
  69. } else {
  70. if (this.chooseTime) {
  71. params.startDate = this.chooseTime[0] + ' 00:00'
  72. params.endDate = this.chooseTime[1]+ ' 23:59'
  73. }
  74. }
  75. httpRequest.get('statistics/bed/getFamilyBedRecordPlanStatistics', { data: params }).then(function (res) {
  76. if (res.status == 200) {
  77. vm.tableData = res.detailModelList
  78. vm.total = res.totalCount
  79. }
  80. vm.loading = false
  81. })
  82. },
  83. queryDate() {
  84. this.page = 1
  85. this.getList()
  86. },
  87. exportTable() {
  88. var vm = this
  89. var params = {
  90. ...this.form,
  91. page: this.page,
  92. pageSize: this.size
  93. }
  94. if (this.yearType == '1') {
  95. params.startDate = this.chooseYear + '-01-01 00:00'
  96. params.endDate = this.chooseYear + '-12-31 23:59'
  97. } else {
  98. if (this.chooseTime) {
  99. params.startDate = this.chooseTime[0] + ' 00:00'
  100. params.endDate = this.chooseTime[1]+ ' 23:59'
  101. }
  102. }
  103. this.exportLoading = true
  104. var fileName = `计划服务${new Date().getTime()}.xls`
  105. httpRequest.downLoadFileForAjax('statistics/bed/exportGetFamilyBedRecordPlanStatistics', fileName, params).then(function () {
  106. vm.exportLoading = false
  107. })
  108. },
  109. eliminateClick() {
  110. this.form = {}
  111. this.yearType = '1'
  112. this.chooseYear = new Date().getFullYear()
  113. this.chooseTime = null
  114. },
  115. closeDialog() {
  116. this.dialogShow = false
  117. },
  118. previewRecord(row) {
  119. var vm = this
  120. this.dialogShow = true
  121. vm.planList = []
  122. httpRequest.get('doctor/familyBed/findBedCheckPlanList', { data: { bedRecordCode: row.code,bedTeamId:row.adminTeamId } }).then(function (res) {
  123. vm.planList = res.data
  124. })
  125. },
  126. handleCurrentChange(val) {
  127. this.page = val
  128. this.getList()
  129. },
  130. handleSizeChange(val) {
  131. this.size = val
  132. this.getList()
  133. },
  134. getStatusTextColor: function (status) {
  135. switch (status) {
  136. case '0':
  137. return 'c-ff5e6c'
  138. case '1':
  139. return 'c-17b3ec'
  140. case '2':
  141. return 'c-20d7ad'
  142. }
  143. },
  144. getStatusCircleColor: function (status) {
  145. switch (status) {
  146. case '0':
  147. return 'bg-ff5e6c'
  148. case '1':
  149. return 'bg-17b3ec'
  150. case '2':
  151. return 'bg-20d7ad'
  152. }
  153. },
  154. },
  155. mounted() {
  156. this.initTime()
  157. this.getList()
  158. }
  159. })