var template = '' $.ajax('../../../component/statistics/OutsideHospitalManage/index.html', { data: {}, dataType: 'html', cache: false, timeout: 60000, async: false, error: function(res) {}, success: function(res) { template = res } }) Vue.component('outside-hospital-manage', { template: template, props: [], data: function() { return { years: [], hospitalList:[], yearType: '1', chooseYear: null, chooseTime: null, chooseHospital:null, rangeOptions: [{ label: '区', value: 'town' }, { label: '医院', value: 'hospital' }, { label: '团队', value: 'team' }], hospitalOptions: [], teamOptions: [], form: { range: 'town' }, loading: false, exportLoading: false, tableData: [ { patientName: '11', idcard: '11', hospitalName: '11', doctorName: '', code: '11', v1Num: 1, vd1Num: 1 } ], tableHeader: [ { label: '医院名称', prop: 'name', width: '110' }, { label: '患者总数', prop: 'total', width: '110' }, { label: '康复管理人数', prop: 'planNum', width: '180' }, { label: '康复计划数量', prop: 'planTimes', width: '110' } ], tableHeaderChildren: [ { label: '复诊1', children: [ { label: '应服务人次', prop: 'v1Num', width: '130' }, { label: '已服务人次', prop: 'vd1Num', width: '130' } ] }, { label: '复诊2', children: [ { label: '应服务人次', prop: 'v2Num', width: '130' }, { label: '已服务人次', prop: 'vd2Num', width: '130' } ] }, { label: '复诊3', children: [ { label: '应服务人次', prop: 'v3Num', width: '130' }, { label: '已服务人次', prop: 'vd3Num', width: '130' } ] }, { label: '复诊4', children: [ { label: '应服务人次', prop: 'v4Num', width: '130' }, { label: '已服务人次', prop: 'vd4Num', width: '130' } ] } ], page: 1, size: 10, total: 0, level: 0, dialogPage:1, dialogSize:10, dialogTotal:0, messageVisible: false, messTxt: '', paramsObj: { name: '', type: '', signDoctorName: '', hospitalName: '' }, dialogHeader: [], visible: false, // 详情 query: { name: '', mobile: '', sex: '', eventType: '', hospital: '', isRehabilitation:'', reservationType:'', doctorName:'', }, dialogTableData: [ { name: '11', sex: '男', age: 18, phoen: 1254813 } ], dialogLoading: false, dialogHeader: [], title: '', dialogExportLoading: false, reservationTypes:[ { name: '全部', code: '' }, { name: '代预约', code: '4' }, { name: '电话短信提醒', code: '5' }, ], sexs: [ { name: '全部', code: '' }, { name: '男', code: '1' }, { name: '女', code: '2' } ], eventTypes: [ { name: '全部', code: '' }, { name: '门诊', code: '1' }, { name: '住院', code: '2' }, ], isRehabilitations: [ { name: '全部', code: '' }, { name: '是', code: '1' }, { name: '否', code: '0' }, ], prop:'' } }, methods: { closeMessageDialog() { this.messageVisible = false }, init() { var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole')) if (selectedRole.code.indexOf('350200') > -1) { this.level = 1 // 市卫健委 this.areaOptions = [ { label: '思明区', value: '350203' }, { label: '海沧区', value: '350205' }, { label: '湖里区', value: '350206' }, { label: '集美区', value: '350211' }, { label: '同安区', value: '350212' }, { label: '翔安区', value: '350213' } ] } else if (selectedRole.code.length == 6) { this.level = 2 // 区管理 this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }] this.form = { range: 'town', area: selectedRole.code } this.getHospital(selectedRole.code) } else { this.level = 3 // 社区管理 this.rangeOptions = [{ label: '医院', value: 'hospital' }, { label: '团队', value: 'team' }] this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }] this.hospital = [{ label: selectedRole.name, value: selectedRole.code }] this.form = { range: 'hospital', area: selectedRole.code.substring(0, 6), hospital: selectedRole.code } this.getTeam(selectedRole.code) } this.initTime() this.getList() this.initHospitalList(); }, initTime() { var vm = this var now = new Date() vm.nowyear = vm.chooseYear = now.getFullYear() vm.years = [] for (i = vm.nowyear; i >= 2013; i--) { vm.years.push(i) } console.log('years',vm.years) }, initHospitalList() { var vm = this; vm.hospitalList=[{code:'',name:'全部'}]; outsideHospitalAPI.ydManageHospitalList().then(function(res){ if(res.status == 200){ res.detailModelList.forEach(item => { vm.hospitalList.push(item) }); } }) }, resetArea() { if (this.level == 1) { delete this.form.area delete this.form.hospital delete this.form.team } else if (this.level == 2) { delete this.form.hospital delete this.form.team } else { delete this.form.team } }, getList() { var vm = this this.loading = true var params = { } if (this.yearType == '1') { params.startDate = this.chooseYear + '-01-01' params.endDate = this.chooseYear + '-12-31' } else if (this.yearType == '2'){ params.startDate = this.chooseTime[0] params.endDate = this.chooseTime[1] } params.hospital = this.chooseHospital outsideHospitalAPI.ydRehabilitationInfo(params).then(function(res) { if (res.status == 200) { vm.tableData = res.detailModelList if (res.detailModelList.length == 0) { vm.$message.warning('暂无数据!') } vm.total = res.detailModelList.length } vm.loading = false }) }, queryDate() { this.page = 1 this.getList() }, exportTable() { var vm = this this.exportLoading = true var params = { } if (this.yearType == '1') { params.startDate = this.chooseYear + '-01-01' params.endDate = this.chooseYear + '-12-31' } else if (this.yearType == '2'){ params.startDate = this.chooseTime[0] params.endDate = this.chooseTime[1] } params.hospital = this.chooseHospital this.exportLoading = true var fileName = `异地医院管理情况统计.xls` outsideHospitalAPI.exportYdRehabilitationInfo(fileName,params).then(function(){ vm.exportLoading = false }) }, showInfo(item) { this.messTxt = item.content this.messageVisible = true }, eliminateClick() { this.yearType = '1' this.paramsObj = { name: '', type: '', signDoctorName: '', hospitalName: '' } this.chooseYear = new Date().getFullYear() this.chooseTime = null this.chooseHospital = null this.$forceUpdate() }, handleCurrentChange(val) { this.page = val this.getList() }, handleSizeChange(val) { this.size = val this.getList() }, handleCurrentDialogChange(val) { console.log('44444444444444444444',val) this.dialogPage = val if( this.title == '康复复诊记录明细'){ this.ydRehabilitationFz() }else{ this.ydTurnDownDataPage() } }, handleDialogSizeChange(val) { this.dialogSize = val if( this.title == '康复复诊记录明细'){ this.ydRehabilitationFz() }else{ this.ydTurnDownDataPage() } }, //详情 openDialog(row, prop) { console.log(prop) this.query = { name: '', mobile: '', sex: '', eventType: '', hospital: '', isRehabilitation:'', reservationType:'', doctorName:'', } this.prop = ''; if (prop == 'total' || prop == 'planNum') { this.title = '下转情况数据列表' this.dialogHeader = [ { label: '姓名', prop: 'name', width: '110' }, { label: '性别', prop: 'sex', width: '110' }, { label: '年龄', prop: 'age', width: '110' }, { label: '手机号', prop: 'mobile', width: '110' }, { label: '下转次数', prop: 'num', width: '110' }, { label: '最近一次下转诊断', prop: 'diagnosisName', width: '110' }, { label: '最近一次下转时间', prop: 'turnDownTime', width: '110' }, { label: '最近一次下转类型', prop: 'eventType', width: '110' } ] if(prop=='planNum'){ this.query.isRehabilitation = '1'; this.prop= prop } this.ydTurnDownDataPage() this.visible = true } else if (prop == 'vd1Num' || prop == 'vd4Num' || prop == 'vd2Num'|| prop == 'vd3Num') { this.title = '康复复诊记录明细' this.dialogHeader = [ { label: '姓名', prop: 'name' }, { label: '性别', prop: 'sex' }, { label: '年龄', prop: 'age' }, { label: '手机号', prop: 'mobile' }, { label: '管理医院', prop: 'hospitalName' }, { label: '管理医生', prop: 'doctorName' }, { label: '服务方式', prop: 'reservationType' }, { label: '服务时间', prop: 'finishTime' } ] this.prop = prop console.log('111111111111111',this.prop) this.ydRehabilitationFz() this.visible = true } }, ydTurnDownDataPage(){ vm = this; vm.dialogTableData = []; var params ={ page:this.dialogPage, pageSize:this.dialogSize, ...this.query } if (this.yearType == '1') { params.startDate = this.chooseYear + '-01-01' params.endDate = this.chooseYear + '-12-31' } else if (this.yearType == '2'){ params.startDate = this.chooseTime[0] params.endDate = this.chooseTime[1] } params.hospital = this.chooseHospital outsideHospitalAPI.ydTurnDownDataPage(params).then(function(res){ if(res.status == 200){ vm.dialogTableData = res.detailModelList vm.dialogTotal = res.totalCount } }) }, ydRehabilitationFz(){ vm = this; vm.dialogTableData = []; var params ={ page:this.dialogPage, pageSize:this.dialogSize, ...this.query } if (this.prop == 'vd1Num') { params.visitCount = 1 }else if(this.prop == 'vd4Num'){ params.visitCount = 4 }else if(this.prop == 'vd2Num'){ params.visitCount = 2 }else if(this.prop == 'vd3Num'){ params.visitCount = 3 } if (this.yearType == '1') { params.startDate = this.chooseYear + '-01-01' params.endDate = this.chooseYear + '-12-31' } else if (this.yearType == '2'){ params.startDate = this.chooseTime[0] params.endDate = this.chooseTime[1] } params.hospital = this.chooseHospital outsideHospitalAPI.ydRehabilitationFz(params).then(function(res){ if(res.status == 200){ vm.dialogTableData = res.detailModelList vm.dialogTotal = res.totalCount } }) }, closeDialog() { this.visible = false }, dialogReset() { var params = { ...this.query } this.query = { name: '', mobile: '', sex: '', eventType: '', hospital: '', isRehabilitation:'', reservationType:'', doctorName:'', } if(this.prop=='planNum'){ this.query.isRehabilitation = '1'; } this.dialogSearchFn(); }, dialogExportFn() { var vm = this vm.dialogExportLoading = true if (this.title == '康复复诊记录明细') { var params ={ page:this.dialogPage, pageSize:9999, ...this.query } if (this.yearType == '1') { params.startDate = this.chooseYear + '-01-01' params.endDate = this.chooseYear + '-12-31' } else if (this.yearType == '2'){ params.startDate = this.chooseTime[0] params.endDate = this.chooseTime[1] } params.hospital = this.chooseHospital if (this.prop == 'vd1Num') { params.visitCount = 1 }else if(this.prop == 'vd4Num'){ params.visitCount = 4 }else if(this.prop == 'vd2Num'){ params.visitCount = 2 }else if(this.prop == 'vd3Num'){ params.visitCount = 3 } var fileName = `康复复诊记录明细${new Date().getTime()}.xls` outsideHospitalAPI.exportYdRehabilitationFz(fileName, params).then(function() { vm.dialogExportLoading = false }) } else { vm = this; var params ={ page:this.dialogPage, pageSize:9999, ...this.query } if (this.yearType == '1') { params.startDate = this.chooseYear + '-01-01' params.endDate = this.chooseYear + '-12-31' } else if (this.yearType == '2'){ params.startDate = this.chooseTime[0] params.endDate = this.chooseTime[1] } params.hospital = this.chooseHospital var fileName = `下转情况数据列表${new Date().getTime()}.xls` outsideHospitalAPI.exportYdTurnDownDataPage(fileName, params).then(function() { vm.dialogExportLoading = false }) } }, dialogSearchFn() { this.page = 1 this.dialogSearch() }, dialogSearch() { console.log(this,'this') if (this.title == '康复复诊记录明细') { this.ydRehabilitationFz() } else { this.ydTurnDownDataPage() } }, renderHeader: function(h, item) { var label = item.column.label var column = item.column var tooltip = { 签约社区: '显示为该患者当前的签约社区医院名称', 社区医院: '显示为该患者当前的签约社区医院名称', 签约医院: '显示为该患者当前的签约社区医院名称', 签约医生: '显示为该患者当前的签约社区医生名称', 家庭医生: '显示为该患者当前的签约社区医生名称' } if (label == '签约社区' || label == '签约医生' || label == '签约医院' || label == '家庭医生' || label == '社区医院') { return [ label, h( 'el-tooltip', { props: { content: (function() { return tooltip[label] })(), placement: 'top' } }, [ h('span', { class: { 'el-icon-question': true } }) ] ) ] } else { return [column.label] } }, // 个人案 seePatientDetail(row, prop) { if (prop == 'name') { if(this.title == '康复复诊记录明细'){ EventBus.$emit('preview-person-info', { type: '5', code: row.patient||row.id,flag:'yd' }) }else{ EventBus.$emit('preview-person-info', { type: '4', code: row.patient||row.id,flag:'yd' }) } } } }, mounted() { this.init() } })