123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- // 慢阻肺患者档案-服务档案
- var template = ''
- $.ajax('../../../component/statistics/CopdServiceRecord/index.html',{
- data: {},
- dataType: 'html',
- cache: false,
- timeout: 60000,
- async: false,
- error: function(res) {
- },
- success: function(res) {
- template = res
- }
- })
-
- Vue.component('copd-service-record', {
- template: template,
- props: ['detailInfo'],
- data() {
- return {
- dialog: false,
- loading:false,
- page:1,
- size:999,
-
- idcardTypeName:'',
- followInfo:{},
- events: [
- {date: '2023年'},
- {title: 'Event 1', date: '05-11 17:00:01', description: 'Description for event 1'},
- {date: '2024年', description: 'Description for event 2'},
- {date: '2025年', description: 'Description for event 3'},
- {date: '2026年', description: 'Description for event 4'},
- {title: 'Event 5', date: '2027年', description: 'Description for event 5'}
- ],
- 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'],
- marriageArr:[],
- backTypeName:'',
- diagnosticBasisName:'',
- marriageName:'',
- symptom:'',
- symptomsArr:[],
- followupArr:[],
- followup:'',
- idCardTypeArr:[],
- firstAreaArr:[],
- firstAreaName:'',
- isLiveArr:[],
- orgLevelArr:[],
- orGlevelName:'',
- occupationArr:[],
- occupation:'',
- smokeArr:[],
- drinkArr:[],
- archivesArr:[],
- diseaseConversion:'',
- conversionArr:[],
- firstVisitTypeArr:[],
- educationalArr:[],
- educational:'',
- nationDict:[],
- nationName:''
- }
- },
- methods: {
- getNation(){
- var vm=this
- statisticAPI.getNationDict().then(function(res){
- vm.nationDict= res.data
- vm.nationDict.forEach(function(item){
- if(item.NATION_CODE==vm.followInfo.nation){
- vm.nationName=item.NATION_NAME
- }
- })
- })
- },
- setLeftHeights() {
- this.$nextTick(() => {
- this.events.forEach((event, index) => {
- const rightContent = document.getElementById('right-' + index);
- const leftContent = document.getElementById('left-' + index);
- if (rightContent && leftContent) {
- leftContent.style.height = rightContent.offsetHeight + 'px';
- }
- });
- });
- },
- //字典
- getDictByDictName(value){
- var vm=this
- statisticAPI.getDictByDictName({name:value}).then(function(res){
- if(value=='jkcopd_marriage'){
- var arr = res.list
- arr.forEach(function(item){
- if(item.code==vm.followInfo.marriage){
- vm.marriageName=item.value
- }
- })
- }else if(value=='jkcopd_smoke'){
- // var vm=this
- // vm.smokeArr=res.list
- }else if(value=='jkcopd_drink'){
- // var vm=this
- // vm.drinkArr=res.list
- }else if(value=='jkcopd_first_area'){
- var arr = res.list
- arr.forEach(function(item){
- if(item.code==vm.followInfo.firstVisitArea){
- vm.firstAreaName=item.value
- }
- })
- }else if(value=='jkcopd_disease_conversion'){
- var arr = res.list
- arr.forEach(function(item){
- if(item.code==vm.followInfo.diseaseConversion){
- vm.diseaseConversion=item.value
- }
- })
- }else if(value=='jkcopd_firstVisitType'){
- // vm.firstVisitTypeArr=res.list
- }else if(value=='jkcopd_first_org_level'){
- var arr = res.list
- arr.forEach(function(item){
- if(item.code==vm.followInfo.firstVisitOrgLevel){
- vm.orGlevelName=item.value
- }
- })
-
- }else if(value=='jkcopd_followup_status'){
- vm.followupArr= res.list
- vm.followupArr.forEach(function(item){
- if(item.code==vm.followInfo.status){
- vm.followup=item.value
- }
- })
- }else if(value=='idCardType'){
- var arr = res.list
- arr.forEach(function(item){
- if(item.code==vm.followInfo.idcardType){
- vm.idcardTypeName=item.value
- }
- })
- }else if(value=='jkcopd_occupation'){
- var arr = res.list
- arr.forEach(function(item){
- if(item.code==vm.followInfo.occupation){
- vm.occupation=item.value
- }
- })
- }else if(value=='jkcopd_educational'){
- var arr = res.list
- arr.forEach(function(item){
- if(item.code==vm.followInfo.educational){
- vm.educational=item.value
- }
- })
- }else if(value=='jkcopd_symptom'){
- var arr = res.list
- vm.symptomsArr=[]
- var symptoms=vm.followInfo.symptom.split(',')
- arr.forEach(function(item){
- symptoms.forEach(function(v){
- if(v==item.code){
- vm.symptomsArr.push(item.value)
- }
- })
- })
- vm.symptom=vm.symptomsArr.join()
- }
- else if(value=='jkcopd_diagnosticBasis'){
- var arr = res.list
- arr.forEach(function(item){
- if(item.code==vm.followInfo.diagnosticBasis){
- vm.diagnosticBasisName=item.value
- }
- })
- }
- // }else if(value=='jkcopd_back_type'){
- // var arr = res.list
- // arr.forEach(function(item){
- // if(item.code==vm.followInfo.backType){
- // vm.backTypeName=item.value
- // console.log('wwwwwwwwwwwwwwwwwwwww',vm.backTypeName)
- // }
- // })
- // }
-
-
- })
-
- },
- recordBack(){
- EventBus.$emit('copd-reset-select')
- },
- getDealRecord: function () {
- var vm = this
- vm.loading = true
- var params = {
- page: vm.page,
- size: vm.size,
- patient: vm.detailInfo.patient
- }
- statisticAPI.dealRecordPage(params).then(function(res){
- res.detailModelList.forEach(function (item, index) {
- var time1 =
- res.detailModelList[index] &&
- res.detailModelList[index].createTime &&
- res.detailModelList[index].createTime.slice(0, 4)
- var time2 =
- res.detailModelList[index + 1] &&
- res.detailModelList[index + 1].createTime &&
- res.detailModelList[index + 1].createTime.slice(0, 4)
- if (index == 0) {
- item.flag = 1
- } else if (index != res.detailModelList.length - 1 && time1 == time2) {
- res.detailModelList[index + 1].flag = 0
- } else if (res.detailModelList.length - 1 == index&& res.detailModelList[index + 1] &&
- res.detailModelList[index + 1].createTime &&res.detailModelList[index]&&res.detailModelList[index].createTime) {
- if (
- res.detailModelList[index - 1].createTime.slice(0, 4) ==res.detailModelList[index].createTime.slice(0, 4)
- ) {
- res.detailModelList[res.detailModelList.length - 1].flag = 0
- } else {
- res.detailModelList[res.detailModelList.length - 1].flag = 1
- }
- }
- })
- vm.loading=false
- vm.events = res.detailModelList
- console.log(vm.events,'999999999999')
- })
- },
- showDetail(item){
- var vm =this
- statisticAPI.followupDetail({id:item.jkcopdFollowup.id}).then(function(res){
- console.log(res)
- vm.followInfo=res.obj
- vm.dicName.forEach(function(item) {
- vm.getDictByDictName(item)
- });
- vm.getNation()
- // statisticAPI.getDictByDictName({name:'idCardType'}).then(function(res){
- // res.list.forEach(function(item){
- // if(item.code==vm.followInfo.idcardType){
- // vm.idcardTypeName=item.value
- // }
- // })
- // })
- console.log(vm.followInfo,'sssss')
- vm.dialog=true
- })
- }
- },
- mounted() {
- // this.$nextTick(() => {
- // this.setLeftHeights();
- // });
- console.log('pppppppppppppp--------',this.detailInfo)
- var vm =this
- this.getDealRecord()
-
- },
- });
|