index.js 8.3 KB

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