index.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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. name: '黄小蕾',
  38. sex: '1',
  39. age: '60岁',
  40. zhuyuan: '38593246',
  41. phone: '12223456789',
  42. checkTime: '2024-04-09 10:00:00',
  43. serviceContent: '上门服务'
  44. },
  45. page: 1,
  46. size: 10,
  47. total: 0,
  48. loading: false,
  49. exportLoading: false,
  50. sexDict: {
  51. 1: '男',
  52. 2: '女'
  53. },
  54. serviceList: {}
  55. }
  56. },
  57. methods: {
  58. initTime() {
  59. var vm = this
  60. var now = new Date()
  61. vm.nowyear = vm.chooseYear = now.getFullYear()
  62. vm.years = []
  63. for (i = vm.nowyear; i >= 2013; i--) {
  64. vm.years.push(i)
  65. }
  66. },
  67. getList() {
  68. var vm = this
  69. this.loading = true
  70. var params = {
  71. ...this.form,
  72. page: this.page,
  73. pageSize: this.size,
  74. status: 1
  75. }
  76. if (this.yearType == '1') {
  77. params.startDate = this.chooseYear + '-01-01 00:00'
  78. params.endDate = this.chooseYear + '-12-31 23:59'
  79. } else {
  80. if (this.chooseTime) {
  81. params.startDate = this.chooseTime[0] + ' 00:00'
  82. params.endDate = this.chooseTime[1] + ' 23:59'
  83. }
  84. }
  85. httpRequest.get('statistics/bed/getFamilyBedPlanStatistics', { data: params }).then(function (res) {
  86. if (res.status == 200) {
  87. vm.tableData = res.detailModelList
  88. vm.total = res.totalCount
  89. }
  90. vm.loading = false
  91. })
  92. },
  93. queryDate() {
  94. this.page = 1
  95. this.getList()
  96. },
  97. exportTable() {
  98. var vm = this
  99. var params = {
  100. ...this.form,
  101. page: this.page,
  102. pageSize: this.size
  103. }
  104. if (this.yearType == '1') {
  105. params.startDate = this.chooseYear + '-01-01 00:00'
  106. params.endDate = this.chooseYear + '-12-31 23:59'
  107. } else {
  108. if (this.chooseTime) {
  109. params.startDate = this.chooseTime[0] + ' 00:00'
  110. params.endDate = this.chooseTime[1] + ' 23:59'
  111. }
  112. }
  113. this.exportLoading = true
  114. var fileName = `查床情况${new Date().getTime()}.xls`
  115. httpRequest.downLoadFileForAjax('statistics/bed/exportGetFamilyBedPlanStatistics', fileName, params).then(function () {
  116. vm.exportLoading = false
  117. })
  118. },
  119. eliminateClick() {
  120. this.form = {}
  121. this.yearType = '1'
  122. this.chooseYear = new Date().getFullYear()
  123. this.chooseTime = null
  124. },
  125. closeDialog() {
  126. this.dialogShow = false
  127. },
  128. previewRecord(row) {
  129. var vm = this
  130. this.dialogShow = true
  131. httpRequest.get('doctor/familyBed/findCheckPlanDetail', { data: {id: row.id} }).then(function (res) {
  132. if (res.status == 200) {
  133. vm.info = res.data
  134. if (res.data.planDoctorList) {
  135. vm.info.planDoctor = res.data.planDoctorList.map(function(item){return item.doctorName}).join(',')
  136. }
  137. if (res.data.signWay) {
  138. vm.info.signMethod = res.data.signWay == 1 ? '定位签到' : '拍照签到'
  139. }
  140. console.log(vm.info,"info");
  141. }
  142. })
  143. },
  144. handleCurrentChange(val) {
  145. this.page = val
  146. this.getList()
  147. },
  148. handleSizeChange(val) {
  149. this.size = val
  150. this.getList()
  151. },
  152. getDictData() {
  153. var vm = this
  154. statisticAPI.getDictByDictName({ name: 'IV_FAMILY_BED_SERVICE_TYPE' }).then(function (res) {
  155. for(var item of res.list){
  156. vm.serviceList[item.code] = item.value
  157. }
  158. })
  159. }
  160. },
  161. mounted() {
  162. this.initTime()
  163. this.getList()
  164. this.getDictData()
  165. }
  166. })