index.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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. idcardTypeName:'',
  25. followInfo:{},
  26. events: [
  27. {date: '2023年'},
  28. {title: 'Event 1', date: '05-11 17:00:01', description: 'Description for event 1'},
  29. {date: '2024年', description: 'Description for event 2'},
  30. {date: '2025年', description: 'Description for event 3'},
  31. {date: '2026年', description: 'Description for event 4'},
  32. {title: 'Event 5', date: '2027年', description: 'Description for event 5'}
  33. ],
  34. dicName:['jkcopd_followup_status','jkcopd_symptom','jkcopd_isLive','jkcopd_first_area','jkcopd_first_org_level', 'jkcopd_marriage','jkcopd_occupation','jkcopd_smoke','jkcopd_drink','jkcopd_archivesStatus','jkcopd_disease_conversion','jkcopd_firstVisitType','jkcopd_educational','idCardType'],
  35. marriageArr:[],
  36. marriageName:'',
  37. symptom:'',
  38. followupArr:[],
  39. followup:'',
  40. idCardTypeArr:[],
  41. firstAreaArr:[],
  42. isLiveArr:[],
  43. orgLevelArr:[],
  44. occupationArr:[],
  45. occupation:'',
  46. smokeArr:[],
  47. drinkArr:[],
  48. archivesArr:[],
  49. diseaseConversion:'',
  50. conversionArr:[],
  51. firstVisitTypeArr:[],
  52. educationalArr:[],
  53. educational:''
  54. }
  55. },
  56. methods: {
  57. setLeftHeights() {
  58. this.$nextTick(() => {
  59. this.events.forEach((event, index) => {
  60. const rightContent = document.getElementById('right-' + index);
  61. const leftContent = document.getElementById('left-' + index);
  62. if (rightContent && leftContent) {
  63. leftContent.style.height = rightContent.offsetHeight + 'px';
  64. }
  65. });
  66. });
  67. },
  68. //字典
  69. getDictByDictName(value){
  70. var vm=this
  71. statisticAPI.getDictByDictName({name:value}).then(function(res){
  72. if(value=='jkcopd_marriage'){
  73. var arr = res.list
  74. arr.forEach(function(item){
  75. if(item.code==vm.followInfo.marriage){
  76. vm.marriageName=item.value
  77. }
  78. })
  79. }else if(value=='jkcopd_smoke'){
  80. vm.smokeArr=res.list
  81. }else if(value=='jkcopd_drink'){
  82. vm.drinkArr=res.list
  83. }else if(value=='jkcopd_first_area'){
  84. vm.areaArr=res.list
  85. }else if(value=='jkcopd_disease_conversion'){
  86. var arr = res.list
  87. arr.forEach(function(item){
  88. if(item.code==vm.followInfo.diseaseConversion){
  89. vm.diseaseConversion=item.value
  90. }
  91. })
  92. }else if(value=='jkcopd_firstVisitType'){
  93. vm.firstVisitTypeArr=res.list
  94. }else if(value=='jkcopd_first_org_level'){
  95. vm.orGlevelArr=res.list
  96. }else if(value=='jkcopd_followup_status'){
  97. vm.followupArr= res.list
  98. vm.followupArr.forEach(function(item){
  99. if(item.code==vm.followInfo.status){
  100. vm.followup=item.value
  101. }
  102. })
  103. }else if(value=='idCardType'){
  104. var arr = res.list
  105. arr.forEach(function(item){
  106. if(item.code==vm.followInfo.idcardType){
  107. vm.idcardTypeName=item.value
  108. }
  109. })
  110. }else if(value=='jkcopd_occupation'){
  111. var arr = res.list
  112. arr.forEach(function(item){
  113. if(item.code==vm.followInfo.occupation){
  114. vm.occupation=item.value
  115. }
  116. })
  117. }else if(value=='jkcopd_educational'){
  118. var arr = res.list
  119. arr.forEach(function(item){
  120. if(item.code==vm.followInfo.educational){
  121. vm.educational=item.value
  122. }
  123. })
  124. }else if(value=='jkcopd_symptom'){
  125. var arr = res.list
  126. arr.forEach(function(item){
  127. if(item.code==vm.followInfo.symptom){
  128. vm.symptom=item.value
  129. }
  130. })
  131. }
  132. })
  133. },
  134. recordBack(){
  135. EventBus.$emit('copd-reset-select')
  136. },
  137. getDealRecord: function () {
  138. var vm = this
  139. vm.loading = true
  140. var params = {
  141. page: vm.page,
  142. size: vm.size,
  143. patient: vm.detailInfo.patient
  144. }
  145. statisticAPI.dealRecordPage(params).then(function(res){
  146. res.detailModelList.forEach(function (item, index) {
  147. var time1 =
  148. res.detailModelList[index] &&
  149. res.detailModelList[index].createTime &&
  150. res.detailModelList[index].createTime.slice(0, 4)
  151. var time2 =
  152. res.detailModelList[index + 1] &&
  153. res.detailModelList[index + 1].createTime &&
  154. res.detailModelList[index + 1].createTime.slice(0, 4)
  155. if (index == 0) {
  156. item.flag = 1
  157. } else if (index != res.detailModelList.length - 1 && time1 == time2) {
  158. res.detailModelList[index + 1].flag = 0
  159. } else if (res.detailModelList.length - 1 == index&& res.detailModelList[index + 1] &&
  160. res.detailModelList[index + 1].createTime &&res.detailModelList[index]&&res.detailModelList[index].createTime) {
  161. if (
  162. res.detailModelList[index - 1].createTime.slice(0, 4) ==res.detailModelList[index].createTime.slice(0, 4)
  163. ) {
  164. res.detailModelList[res.detailModelList.length - 1].flag = 0
  165. } else {
  166. res.detailModelList[res.detailModelList.length - 1].flag = 1
  167. }
  168. }
  169. })
  170. vm.loading=false
  171. vm.events = res.detailModelList
  172. console.log(vm.events,'999999999999')
  173. })
  174. },
  175. showDetail(item){
  176. var vm =this
  177. statisticAPI.followupDetail({id:item.jkcopdFollowup.id}).then(function(res){
  178. console.log(res)
  179. vm.followInfo=res.obj
  180. vm.dicName.forEach(function(item) {
  181. vm.getDictByDictName(item)
  182. });
  183. // statisticAPI.getDictByDictName({name:'idCardType'}).then(function(res){
  184. // res.list.forEach(function(item){
  185. // if(item.code==vm.followInfo.idcardType){
  186. // vm.idcardTypeName=item.value
  187. // }
  188. // })
  189. // })
  190. console.log(vm.followInfo,'sssss')
  191. vm.dialog=true
  192. })
  193. }
  194. },
  195. mounted() {
  196. // this.$nextTick(() => {
  197. // this.setLeftHeights();
  198. // });
  199. console.log('pppppppppppppp--------',this.detailInfo)
  200. var vm =this
  201. this.getDealRecord()
  202. },
  203. });