index.js 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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','jkcopd_diagnosticBasis'],
  35. marriageArr:[],
  36. diagnosticBasisName:'',
  37. marriageName:'',
  38. symptom:'',
  39. symptomsArr:[],
  40. followupArr:[],
  41. followup:'',
  42. idCardTypeArr:[],
  43. firstAreaArr:[],
  44. firstAreaName:'',
  45. isLiveArr:[],
  46. orgLevelArr:[],
  47. orGlevelName:'',
  48. occupationArr:[],
  49. occupation:'',
  50. smokeArr:[],
  51. drinkArr:[],
  52. archivesArr:[],
  53. diseaseConversion:'',
  54. conversionArr:[],
  55. firstVisitTypeArr:[],
  56. educationalArr:[],
  57. educational:'',
  58. nationDict:[],
  59. nationName:''
  60. }
  61. },
  62. methods: {
  63. getNation(){
  64. var vm=this
  65. statisticAPI.getNationDict().then(function(res){
  66. vm.nationDict= res.data
  67. vm.nationDict.forEach(function(item){
  68. if(item.NATION_CODE==vm.followInfo.nation){
  69. vm.nationName=item.NATION_NAME
  70. }
  71. })
  72. })
  73. },
  74. setLeftHeights() {
  75. this.$nextTick(() => {
  76. this.events.forEach((event, index) => {
  77. const rightContent = document.getElementById('right-' + index);
  78. const leftContent = document.getElementById('left-' + index);
  79. if (rightContent && leftContent) {
  80. leftContent.style.height = rightContent.offsetHeight + 'px';
  81. }
  82. });
  83. });
  84. },
  85. //字典
  86. getDictByDictName(value){
  87. var vm=this
  88. statisticAPI.getDictByDictName({name:value}).then(function(res){
  89. if(value=='jkcopd_marriage'){
  90. var arr = res.list
  91. arr.forEach(function(item){
  92. if(item.code==vm.followInfo.marriage){
  93. vm.marriageName=item.value
  94. }
  95. })
  96. }else if(value=='jkcopd_smoke'){
  97. // var vm=this
  98. // vm.smokeArr=res.list
  99. }else if(value=='jkcopd_drink'){
  100. // var vm=this
  101. // vm.drinkArr=res.list
  102. }else if(value=='jkcopd_first_area'){
  103. var arr = res.list
  104. arr.forEach(function(item){
  105. if(item.code==vm.followInfo.firstVisitArea){
  106. vm.firstAreaName=item.value
  107. }
  108. })
  109. }else if(value=='jkcopd_disease_conversion'){
  110. var arr = res.list
  111. arr.forEach(function(item){
  112. if(item.code==vm.followInfo.diseaseConversion){
  113. vm.diseaseConversion=item.value
  114. }
  115. })
  116. }else if(value=='jkcopd_firstVisitType'){
  117. // vm.firstVisitTypeArr=res.list
  118. }else if(value=='jkcopd_first_org_level'){
  119. var arr = res.list
  120. arr.forEach(function(item){
  121. if(item.code==vm.followInfo.firstVisitOrgLevel){
  122. vm.orGlevelName=item.value
  123. }
  124. })
  125. }else if(value=='jkcopd_followup_status'){
  126. vm.followupArr= res.list
  127. vm.followupArr.forEach(function(item){
  128. if(item.code==vm.followInfo.status){
  129. vm.followup=item.value
  130. }
  131. })
  132. }else if(value=='idCardType'){
  133. var arr = res.list
  134. arr.forEach(function(item){
  135. if(item.code==vm.followInfo.idcardType){
  136. vm.idcardTypeName=item.value
  137. }
  138. })
  139. }else if(value=='jkcopd_occupation'){
  140. var arr = res.list
  141. arr.forEach(function(item){
  142. if(item.code==vm.followInfo.occupation){
  143. vm.occupation=item.value
  144. }
  145. })
  146. }else if(value=='jkcopd_educational'){
  147. var arr = res.list
  148. arr.forEach(function(item){
  149. if(item.code==vm.followInfo.educational){
  150. vm.educational=item.value
  151. }
  152. })
  153. }else if(value=='jkcopd_symptom'){
  154. var arr = res.list
  155. vm.symptomsArr=[]
  156. var symptoms=vm.followInfo.symptom.split(',')
  157. arr.forEach(function(item){
  158. // if(item.code==vm.followInfo.symptom){
  159. // vm.symptom=item.value
  160. // }
  161. symptoms.forEach(function(v){
  162. if(v==item.code){
  163. vm.symptomsArr.push(item.value)
  164. }
  165. })
  166. })
  167. vm.symptom=vm.symptomsArr.join()
  168. console.log('-----------------',vm.symptomsArr,vm.symptom)
  169. }
  170. else if(value=='jkcopd_diagnosticBasis'){
  171. var arr = res.list
  172. arr.forEach(function(item){
  173. if(item.code==vm.followInfo.diagnosticBasis){
  174. vm.diagnosticBasisName=item.value
  175. }
  176. })
  177. }
  178. })
  179. },
  180. recordBack(){
  181. EventBus.$emit('copd-reset-select')
  182. },
  183. getDealRecord: function () {
  184. var vm = this
  185. vm.loading = true
  186. var params = {
  187. page: vm.page,
  188. size: vm.size,
  189. patient: vm.detailInfo.patient
  190. }
  191. statisticAPI.dealRecordPage(params).then(function(res){
  192. res.detailModelList.forEach(function (item, index) {
  193. var time1 =
  194. res.detailModelList[index] &&
  195. res.detailModelList[index].createTime &&
  196. res.detailModelList[index].createTime.slice(0, 4)
  197. var time2 =
  198. res.detailModelList[index + 1] &&
  199. res.detailModelList[index + 1].createTime &&
  200. res.detailModelList[index + 1].createTime.slice(0, 4)
  201. if (index == 0) {
  202. item.flag = 1
  203. } else if (index != res.detailModelList.length - 1 && time1 == time2) {
  204. res.detailModelList[index + 1].flag = 0
  205. } else if (res.detailModelList.length - 1 == index&& res.detailModelList[index + 1] &&
  206. res.detailModelList[index + 1].createTime &&res.detailModelList[index]&&res.detailModelList[index].createTime) {
  207. if (
  208. res.detailModelList[index - 1].createTime.slice(0, 4) ==res.detailModelList[index].createTime.slice(0, 4)
  209. ) {
  210. res.detailModelList[res.detailModelList.length - 1].flag = 0
  211. } else {
  212. res.detailModelList[res.detailModelList.length - 1].flag = 1
  213. }
  214. }
  215. })
  216. vm.loading=false
  217. vm.events = res.detailModelList
  218. console.log(vm.events,'999999999999')
  219. })
  220. },
  221. showDetail(item){
  222. var vm =this
  223. statisticAPI.followupDetail({id:item.jkcopdFollowup.id}).then(function(res){
  224. console.log(res)
  225. vm.followInfo=res.obj
  226. vm.dicName.forEach(function(item) {
  227. vm.getDictByDictName(item)
  228. });
  229. vm.getNation()
  230. // statisticAPI.getDictByDictName({name:'idCardType'}).then(function(res){
  231. // res.list.forEach(function(item){
  232. // if(item.code==vm.followInfo.idcardType){
  233. // vm.idcardTypeName=item.value
  234. // }
  235. // })
  236. // })
  237. console.log(vm.followInfo,'sssss')
  238. vm.dialog=true
  239. })
  240. }
  241. },
  242. mounted() {
  243. // this.$nextTick(() => {
  244. // this.setLeftHeights();
  245. // });
  246. console.log('pppppppppppppp--------',this.detailInfo)
  247. var vm =this
  248. this.getDealRecord()
  249. },
  250. });