// 慢阻肺患者档案-服务档案 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: '', communityArr: [], yearList: [{ label: '全部年份',value: "" }], nodeList: [ { label: '全部节点', value: "" }, { label: '下转患者', value: 1 }, { label: '医生接收', value: 2 }, { label: '居民流转', value: 3 }, { label: '医生退回', value: 4 }, { label: '医生随访', value: 5 }, { label: '档案修改', value: 6 }, { label: '档案同步', value: 7 }, { label: '分配患者', value: 8 }, { label: '添加患者', value: 9 }, ], serviceYear: "", customizeYear: [], serviceNode: "" } }, 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 } }) } }) }, recordBack() { this.$emit('back') EventBus.$emit('copd-reset-select') }, getDealRecord () { var vm = this vm.loading = true var params = { page: vm.page, size: vm.size, patient: vm.detailInfo.patient, type: vm.serviceNode } if(vm.serviceYear == 'customize'){ params.startTime = vm.customizeYear[0] params.endTime = vm.customizeYear[1] }else if(vm.serviceYear != ''){ params.startTime = vm.serviceYear + "-01-01" params.endTime = vm.serviceYear + "-12-31" } else{ params.startTime = '' params.endTime = '' } 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 }) }, showDetail(item) { var vm = this statisticAPI.followupDetail({ id: item.jkcopdFollowup.id }).then(function (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 // } // }) // }) vm.dialog = true }) }, getYearList() { for (var i = 0; i < 6; i++) { var year = new Date().getFullYear() - i this.yearList.push({ label: year, value: year }) } this.yearList.push({ label: '自定义', value: 'customize' }) }, getTypeName(type){ return this.nodeList.find(function(item){return item.value == type})?.label } }, mounted() { // this.$nextTick(() => { // this.setLeftHeights(); // }); var vm = this this.getDealRecord() this.getYearList() } })