index.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. this.loading = true
  100. var params = {
  101. ...this.form,
  102. page: this.page,
  103. pageSize: this.size
  104. }
  105. if (this.yearType == '1') {
  106. params.startDate = this.chooseYear + '-01-01 00:00'
  107. params.endDate = this.chooseYear + '-12-31 23:59'
  108. } else {
  109. if (this.chooseTime) {
  110. params.startDate = this.chooseTime[0] + ' 00:00'
  111. params.endDate = this.chooseTime[1] + ' 23:59'
  112. }
  113. }
  114. this.exportLoading = true
  115. var fileName = `查床情况${new Date().getTime()}.xls`
  116. httpRequest.downLoadFileForAjax('statistics/bed/exportGetFamilyBedPlanStatistics', fileName, params).then(function () {
  117. vm.exportLoading = false
  118. })
  119. },
  120. eliminateClick() {
  121. this.form = {}
  122. this.yearType = '1'
  123. this.chooseYear = new Date().getFullYear()
  124. this.chooseTime = null
  125. },
  126. closeDialog() {
  127. this.dialogShow = false
  128. },
  129. previewRecord(row) {
  130. var vm = this
  131. this.dialogShow = true
  132. httpRequest.get('doctor/familyBed/findCheckPlanDetail', { data: {id: row.id} }).then(function (res) {
  133. if (res.status == 200) {
  134. vm.info = res.data
  135. if (res.data.planDoctorList) {
  136. vm.info.planDoctor = res.data.planDoctorList.map(function(item){return item.doctorName}).join(',')
  137. }
  138. if (res.data.signWay) {
  139. vm.info.signMethod = res.data.signWay == 1 ? '定位签到' : '拍照签到'
  140. }
  141. console.log(vm.info,"info");
  142. }
  143. })
  144. },
  145. handleCurrentChange(val) {
  146. this.page = val
  147. this.getList()
  148. },
  149. handleSizeChange(val) {
  150. this.size = val
  151. this.getList()
  152. },
  153. getDictData() {
  154. var vm = this
  155. statisticAPI.getDictByDictName({ name: 'IV_FAMILY_BED_SERVICE_TYPE' }).then(function (res) {
  156. for(var item of res.list){
  157. vm.serviceList[item.code] = item.value
  158. }
  159. })
  160. }
  161. },
  162. mounted() {
  163. this.initTime()
  164. this.getList()
  165. this.getDictData()
  166. }
  167. })