index.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // 慢阻肺患者档案-服务档案
  2. var template = ''
  3. $.ajax('../../../component/statistics/CopdServiceRecord/index.html',{
  4. data: {},
  5. dataType: 'html',
  6. cache: false,
  7. timeout: 60000,
  8. async: false,
  9. error: function(res) {
  10. },
  11. success: function(res) {
  12. template = res
  13. }
  14. })
  15. Vue.component('copd-service-record', {
  16. template: template,
  17. props: ['detailInfo'],
  18. data() {
  19. return {
  20. dialog: false,
  21. loading:false,
  22. page:1,
  23. size:999,
  24. followInfo:{},
  25. events: [
  26. {date: '2023年'},
  27. {title: 'Event 1', date: '05-11 17:00:01', description: 'Description for event 1'},
  28. {date: '2024年', description: 'Description for event 2'},
  29. {date: '2025年', description: 'Description for event 3'},
  30. {date: '2026年', description: 'Description for event 4'},
  31. {title: 'Event 5', date: '2027年', description: 'Description for event 5'}
  32. ]
  33. }
  34. },
  35. methods: {
  36. setLeftHeights() {
  37. this.$nextTick(() => {
  38. this.events.forEach((event, index) => {
  39. const rightContent = document.getElementById('right-' + index);
  40. const leftContent = document.getElementById('left-' + index);
  41. if (rightContent && leftContent) {
  42. leftContent.style.height = rightContent.offsetHeight + 'px';
  43. }
  44. });
  45. });
  46. },
  47. recordBack(){
  48. EventBus.$emit('copd-reset-select')
  49. },
  50. getDealRecord: function () {
  51. var vm = this
  52. vm.loading = true
  53. var params = {
  54. page: vm.page,
  55. size: vm.size,
  56. patient: vm.detailInfo.patient
  57. }
  58. statisticAPI.dealRecordPage(params).then(function(res){
  59. res.detailModelList.forEach(function (item, index) {
  60. var time1 =
  61. res.detailModelList[index] &&
  62. res.detailModelList[index].createTime &&
  63. res.detailModelList[index].createTime.slice(0, 4)
  64. var time2 =
  65. res.detailModelList[index + 1] &&
  66. res.detailModelList[index + 1].createTime &&
  67. res.detailModelList[index + 1].createTime.slice(0, 4)
  68. if (index == 0) {
  69. item.flag = 1
  70. } else if (index != res.detailModelList.length - 1 && time1 == time2) {
  71. res.detailModelList[index + 1].flag = 0
  72. } else if (res.detailModelList.length - 1 == index&& res.detailModelList[index + 1] &&
  73. res.detailModelList[index + 1].createTime &&res.detailModelList[index]&&res.detailModelList[index].createTime) {
  74. if (
  75. res.detailModelList[index - 1].createTime.slice(0, 4) ==res.detailModelList[index].createTime.slice(0, 4)
  76. ) {
  77. res.detailModelList[res.detailModelList.length - 1].flag = 0
  78. } else {
  79. res.detailModelList[res.detailModelList.length - 1].flag = 1
  80. }
  81. }
  82. })
  83. vm.loading=false
  84. vm.events = res.detailModelList
  85. console.log(vm.events,'999999999999')
  86. })
  87. },
  88. showDetail(item){
  89. var vm =this
  90. console.log(item,'oooooooooooooo')
  91. statisticAPI.followupDetail({id:item.jkcopdFollowup.id}).then(function(res){
  92. console.log(res)
  93. vm.followInfo=res.obj
  94. console.log(vm.followInfo,'sssss')
  95. vm.dialog=true
  96. })
  97. }
  98. },
  99. mounted() {
  100. // this.$nextTick(() => {
  101. // this.setLeftHeights();
  102. // });
  103. this.getDealRecord()
  104. },
  105. });