1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654 |
- Vue.use(Vuedals.default);
- new Vue({
- el: "#main",
- data: {
- height:"",
- isloading:false, //加载中
- start:"",
- end:"",
- tabledata:[], //表格数据
- levelList:[{level:"4",areaLevel:"2"},{level:"3",areaLevel:"3"},{level:"2",areaLevel:"4"}], //两种搜索,地区等级对比
- areaLevel:"", // 2、市,3、区,4、社区,5、团队
- initareaLevel:"",
- initlevel: '',
- initarea: '',
- level: '',
- area: '',
- areaTitle: '',
- index: '121',
- lowLevel: '',
- initlowLevel:"",
- years:[],
- chooseYear: '',
- userRole: '',
- treedata: [],
- tableHeader:[],
- defaultProps: {
- children: 'children',
- label: 'label'
- },
- pickerOptions:{
- disabledDate:function(time) {
- return time.getTime() > Date.now()
- },
- },
- radio:'1',
- timeLevel: 2,
- searchJson:{},
- currentPage:1,
- currentSize:10,
- datatotal:0,
- rangeList:[],
- rangeCode:"",
- areaList:[],
- areaCode:"",
- communityList:[{code:"",name:"全部"}],
- communityCode:"",
- teamList:[{code:"",name:"全部"}],
- teamCode:"",
- detailInquire: [{
- label: '明细查询',
- children: [
- {label: '咨询分析', id:'33'},
- {label: '签约分析', id:'34'},
- {label: '专病分析', id:'35'},
- {label: '生日祝福分析', id:'36'},
- {label: '上门服务分析', id:'37'},
- {label: '长处方分析', id:'38'},
- {label: '体征数据分析', id:'39'},
- {label: '上转预约明细', id:'40'},
- {label: '微信绑定明细', id:'41'},
- ]
- }],
- handleNodeShow:1,
- handleNodeId:0,
- radio1:'',
- radio2:'',
- radio3:'',
- radio4:'',
- radio5:'',
- radio6:'',
- radio7:'',
- radio8:'',
- radio9:'',
- cities:[{value:'高血压',num:'4'},
- {value:'糖尿病',num:'5'},
- {value:'65岁以上人群',num:'3'},
- {value:'0-6岁小孩',num:'7'},
- {value:'计划生育家庭',num:'9'},
- {value:'严重精神障碍',num:'10'},
- {value:'残疾人',num:'11'},
- {value:'普通人群',num:'1'},
- {value:'结核病',num:'12'},
- {value:'低保人群',num:'8'},
- {value:'孕产妇',num:'6'},
- ],
- checkedCities: [],
- specialCities:[],
- specialCheckedCities:[],
- serveCities:[{value:'残疾人',num:'1'},
- {value:'失能/半失能老人',num:'5'},
- {value:'80岁以上老人',num:'7'},
- {value:'肺结核患者',num:'2'},
- {value:'计生特殊家庭',num:'3'},
- {value:'重性精神病',num:'4'},
- {value:'其他',num:'6'},
- ],
- serveSpecialCities:[],
- options: [{
- value: '1',
- label: '是'
- }, {
- value: '0',
- label: '否'
- },],
- value: '',
- form:{
- endorseTheTicket:'',
- renew:'',
- backToSign:'',
- WeChat:'',
- },
- form2:{
- juniorCollege:'',
- family:'',
- resident:'',
- },
- form3:{
- family:'',
- resident:'',
- },
- form4:{
- family:'',
- resident:'',
- },
- form5:{
- family:'',
- resident:'',
- },
- handleData:[],
- diseaseData:[],
- serviceTypeData:[],
- analyseData:[], //分析数据
- searchJsonTime:undefined,
- loadingTwo:false,
- radio1Show:null,
- serverType:'',
- diseaseDataType:'',
- serviceTypeDataType:'',
- fullscreenLoading:false,
- derive:'',
- tabsList:[
- {id:'1',text:'综合查询',show:true},
- {id:'2',text:'明细查询',show:false},
- {id:'3',text:'汇总数据',show:false},
- ],
- tabsId:'1',
- facility:'', //体征数据分析 - 设备类型
- illness:'', //体征数据分析 - 疾病类型
- form6:{
- resident:'',
- doctor:'',
- },
- form7:{
- resident:'',
- doctorOne:'',
- hospital:'',
- doctorTwo:'',
- administrativeOffice:'',
- },
- getHealthData:[],
- form8:{
- renew:'',
- },
- reservationData:[],
- wexinBindingData:[],
- hospitalData:[],
- administrativeOffice:[],
- collect:[
- {
- id: "kfxzrs,kfxzrc,szrs,szrc",
- label: "专病汇总",
- code:'1',
- children:[
- {id: "kfxzrs",label:'康复下转人数',code:'1',},
- {id: "kfxzrc",label:'康复下转人次',code:'1',},
- {id: "szrs",label:'上转人数',code:'1',},
- {id: "szrc",label:'上转人数',code:'1',},
- ],
- },
- {
- id: "scsbs,scrc,yctzrc,gyrc",
- label: "体征数据汇总",
- code:'2',
- children:[
- {id: "scsbs",label:'上传设备数',code:'2'},
- {id: "scrc",label:'上传人次',code:'2'},
- {id: "yctzrc",label:'异常体征人次',code:'2'},
- {id: "gyrc",label:'干预人次',code:'2'},
- ],
- },
- {
- id: "fwgd",
- label: "上门服务汇总",
- code:'3',
- children:[
- {id: "fwgd",label:'服务工单',code:'3'}
- ],
- },
- ],
- specHosName:'',
- specHosList:[],
- collectCode:'',
- diseaseReport:[],
- diseaseColumn:[],
- diseaseHeader:[],
- facilitySign:'',
- getDeviceReport:[],
- getDeviceColumn:[],
- getDeviceHeader:[],
- getDoorReport:[],
- getDoorColumn:[],
- getDoorHeader:[],
-
- isCheck: false,
- },
- components: {
- vuedals: Vuedals.Component
- },
- watch: {
- rangeCode: function (val) {
- var vm=this
- if(vm.initlevel != 2){
- vm.communityCode=""
- }
- vm.teamCode=""
- vm.getTreeList()
- },
- areaCode:function(val){
- var vm=this
- vm.selChange(3)
- },
- communityCode:function(val){
- var vm=this
- vm.selChange(5)
- },
- },
- mounted: function () {
- var vm=this
- //初始化数据
- initData(vm);
- vm.getDiseaseTypeList()
- vm.height = document.body.offsetHeight - 85
- window.onresize = function () {
- vm.height = document.body.offsetHeight - 85
- }
- },
- methods: {
- reset:function() {
- if(this.tabsId == 1) {
- this.getTreeList()
- }else{
- this.collect = [
- {
- id: "kfxzrs,kfxzrc,szrs,szrc",
- label: "专病汇总",
- code:'1',
- children:[
- {id: "kfxzrs",label:'康复下转人数',code:'1'},
- {id: "kfxzrc",label:'康复下转人次',code:'1'},
- {id: "szrs",label:'下转人数',code:'1'},
- {id: "szrc",label:'下转人数',code:'1'},
- ],
- },
- {
- id: "scsbs,scrc,yctzrc,gyrc",
- label: "体征数据汇总",
- code:'2',
- children:[
- {id: "scsbs",label:'上传设备数',code:'2'},
- {id: "scrc",label:'上传人次',code:'2'},
- {id: "yctzrc",label:'异常体征人次',code:'2'},
- {id: "gyrc",label:'干预人次',code:'2'},
- ],
- },
- {
- id: "fwgd",
- label: "上门服务汇总",
- code:'3',
- children:[
- {id: "fwgd",label:'服务工单',code:'3'}
- ],
- },
- ]
- }
- },
- // 清除
- eliminateClick:function() {
- this.radio = '1'
- this.radio1 = ''
- this.radio2 = ''
- this.radio3 = ''
- this.radio4 = ''
- this.radio5 = ''
- this.radio6 = ''
- this.radio7 = ''
- this.radio8 = ''
- this.radio9 = ''
- this.form = {
- endorseTheTicket:'',
- renew:'',
- backToSign:'',
- WeChat:'',
- }
- this.form2 = {
- juniorCollege:'',
- family:'',
- resident:'',
- }
- this.form3 = {
- family:'',
- resident:'',
- }
- this.form4 = {
- family:'',
- resident:'',
- }
- this.form5 = {
- family:'',
- resident:'',
- }
- this.facility = '' //体征数据分析 - 设备类型
- this.illness = '' //体征数据分析 - 疾病类型
- this.form6 = {
- resident:'',
- doctor:'',
- }
- this.form7 = {
- resident:'',
- doctorOne:'',
- hospital:'',
- doctorTwo:'',
- administrativeOffice:'',
- }
- this.form8 = {
- renew : ''
- }
- this.facilitySign = ''
- initData(this)
- // initTime(this)
- // initScope(this)
-
- },
- tabsClick:function(item) {
- var vm = this
- vm.tabsId = item.id
- vm.tabsList.forEach(function(res){
- if(res.id == item.id) {
- res.show = true
- }else{
- res.show = false
- }
- })
- vm.eliminateClick()
- },
- // 获取汇总数据的专科医院
- specHosData:function() {
- var vm = this
- statisticAPI.getSpecialHospital().then(function(res){
- if(res.status == 200) {
- res.data.forEach(function(item){
- vm.specHosList.push(
- {code:item.code,name:item.name}
- )
- })
- }
- })
- },
- getDiseaseTypeList:function() {
- var vm = this
- statisticAPI.getDiseaseTypeList({}).then(function(res){
- if(res.status == 200) {
- vm.specialCities = res.list
- }
- })
- },
- // 签约人群
- handleCheckedCitiesChange:function(value) {
- var vm = this
- vm.handleData = value
- },
- // 下转病种
- diseaseChange:function(value) {
- var vm = this
- vm.diseaseData = value
- },
- // 服务类型
- serviceTypeChange:function(value) {
- var vm = this
- vm.serviceTypeData = value
- },
-
-
- // 综合析树形图
- treedataClick:function(name,data) {
- var vm = this
- vm.handleNodeShow = 1
- vm.handleNodeId = 0
- vm.currentPage = 1
- vm.radio = '1' //签约年度 --创建时间
- // initTime(vm)
- // initScope(vm)
- },
- // 汇总树形图
- collectClick:function(data,isCheck) {
- var vm = this
- vm.derive = data.label
- vm.handleNodeShow = 3
- vm.currentPage = 1
- vm.radio = '1' //签约年度 --创建时间
- vm.isCheck = isCheck
- },
- collCheck:function(data,name) {
- // console.log(arguments)
- var vm = this
- vm.diseaseReport = []
- vm.datatotal = 0
- vm.collect.forEach(function(item){
- item.children.forEach(function(o) {
- if(o.code != data.code) {
- vm.$refs.collectTree.setChecked(o, false, true)
- }
- })
- if(data.id == item.id) {
- vm.$refs.collectTree.setChecked(item, vm.isCheck, true)
- } else {
- item.children.forEach(function(o) {
- if(data.id == o.id) {
- vm.$refs.collectTree.setChecked(o, vm.isCheck, true)
- }
- })
- }
- })
-
- vm.handleNodeId = 'huizongshuju'
- vm.collectCode = data.code
- if(data.code == 1) {
- vm.rangeList=[{name:"按区",code:"town"},{name:"按社区",code:"hospital"},{name:"按团队",code:"team"},{name:"按专科医院",code:"specHos"}]
- vm.specHosData()
- }else{
- vm.rangeList=[{name:"按区",code:"town"},{name:"按社区",code:"hospital"},{name:"按团队",code:"team"}]
- }
- },
- // 点击明细查询树形图
- handleNodeClick:function(name,data) {
- var vm = this
- vm.handleNodeId = 0
- vm.derive = name.label
- if(data.id>=33) { //明细查询以下
- vm.handleNodeShow = 2 // 明细查询tabs为2
- vm.tableHeader = [] // 选择统计的数组
- vm.analyseData = [] // 明细查询数组
- }
- vm.handleNodeId = data.data.id //切换后的id
- vm.radio = '1' //签约年度 --创建时间
- vm.radio1 = '' //咨询分析咨询状态
- vm.radio2 = ''
- vm.radio3 = ''
- vm.radio4 = ''
- vm.radio5 = ''
- vm.radio6 = ''
- vm.radio7 = ''
- vm.radio8 = ''
- vm.checkedCities = [] //签约人群清空
- vm.specialCheckedCities = [] //下转病种清空
- vm.serveSpecialCities = [] //服务类型清空
- vm.diseaseReport = []
- vm.datatotal = 0
- vm.form = {
- endorseTheTicket:'',
- renew:'',
- backToSign:'',
- WeChat:'',
- }
- vm.form2 = {
- juniorCollege:'',
- family:'',
- resident:'',
- }
- vm.form3 = {
- family:'',
- resident:'',
- },
- vm.form4 = {
- family:'',
- resident:'',
- },
- vm.form5 = {
- family:'',
- resident:'',
- },
- initTime(vm) //时间初始化
- initScope(vm) //数据范围初始化
- vm.currentPage = 1
-
- vm.analysFunction(vm.handleNodeId) //明细查询列表查询
- },
- analysFunction:function(id) {
- var vm = this
- // idcard = idcard.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2") 身份证 医保卡 脱敏显示
-
- if(id == 33) {
- // 咨询分析
- vm.getConsultList()
- }else if(id == 34) {
- // 签约分析
- vm.getSignList()
- }else if(id == 35) {
- // 专病分析
- vm.getSickList()
- }else if(id == 36) {
- // 生日祝福分析
- vm.getBirthdayPatientList()
- }else if(id == 37) {
- // 上门服务分析
- vm.getDoorServiceList()
- }else if(id == 38) {
- // 长处方分析
- vm.getPrescriptionList()
- }else if(id == 39) {
- // 体征数据
- vm.physicalSignData()
- }else if(id == 40) {
- // 上转预约
- vm.upTransferAppointment()
- }else if(id == 41) {
- // 微信绑定
- vm.wechatBinding()
- }
- },
- // 下转预约获取医生,科室
- getReservationHosAndDept:function(data) {
- var vm = this
- statisticAPI.getReservationHosAndDept({
- hospital:data?data:'',
- type:data?'2':'',
- }).then(function(res){
- if(res.status == 200) {
- if(data) {
- vm.administrativeOffice = []
- res.data.forEach(function(item){
- vm.administrativeOffice.push({
- value: item.code,
- label: item.name
- })
- })
- }else{
- vm.hospitalData = []
- res.data.forEach(function(item){
- vm.hospitalData.push({
- value: item.code,
- label: item.name
- })
- })
- }
- }
- })
- },
- hospitalChange:function(data) {
- var vm = this
- vm.getReservationHosAndDept(data)
- },
-
-
- // 咨询分析
- getConsultList:function() {
- var vm = this
- vm.loadingTwo = true
- statisticAPI.getConsultList({
- year :vm.radio=='1'?vm.chooseYear:'', //签约年度
- startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
- endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
- status :vm.radio1, //咨询状态,1已回复,0未回复,2未及时回复
- team :vm.teamCode, //团队
- area :vm.areaCode, //地区
- hospital :vm.communityCode, //社区
- rang :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
- pageSize:vm.currentSize,
- page:vm.currentPage,
- }).then(function(res){
- // console.log(res,"咨询分析")
- if(res.status == 200) {
- vm.analyseData = res.data.list
- vm.datatotal = res.data.total
- vm.loadingTwo = false
- }
- if(res.status == -1) {
- vm.loadingTwo = false
- vm.$message.error(res.msg)
- }
- })
- },
- // 签约分析
- getSignList:function() {
- var vm = this
- vm.loadingTwo = true
- var handleDataList = []
- vm.serverType = ''
- vm.handleData.forEach(function(res){
- handleDataList.push(res.num)
- })
- vm.serverType = handleDataList.join(',')
- statisticAPI.getSignList({
- year :vm.radio=='1'?vm.chooseYear:'', //签约年度
- startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
- endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
- serverType:vm.serverType, //签约人群
- status :vm.radio2, //签约状态,1已签约,0待审核,2代缴费
- isUpdate:vm.form.endorseTheTicket, //是否改签 1是0否
- isAdd:vm.form.renew, //是否续签 1是0否
- isOut:vm.form.backToSign, //是否退签 1是0否
- isBindWX:vm.form.WeChat, //是否绑定微信 1是0否
- team :vm.teamCode, //团队
- area :vm.areaCode=='350200'?'':vm.areaCode, //地区
- hospital :vm.communityCode, //社区
- rang :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
- pageSize:vm.currentSize,
- page:vm.currentPage,
- }).then(function(res){
- // console.log(res,"签约分析")
- if(res.status == 200) {
- res.data.list.forEach(function(item){
- item.sscNum = item.sscNum.replace(/^(.{4})(?:\d+)(.{1})$/,"$1****$2")
- item.idcardNum = item.idcardNum.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2")
- })
- vm.analyseData = res.data.list
- vm.datatotal = res.data.total
- vm.loadingTwo = false
- }
- if(res.status == -1) {
- vm.loadingTwo = false
- vm.$message.error(res.msg)
- }
- })
- },
- // 专病分析
- getSickList:function() {
- var vm = this
- // vm.diseaseData
- vm.loadingTwo = true
- var handleDataList = []
- vm.diseaseDataType = ''
- vm.diseaseData.forEach(function(res){
- handleDataList.push(res.code)
- })
- vm.diseaseDataType = handleDataList.join(',')
- statisticAPI.getSickList({
- year :vm.radio=='1'?vm.chooseYear:'', //年度
- startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
- endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
- diseaseType:vm.diseaseDataType, //病种类型
- status :vm.radio3, //下转状态,1已接受,0未接受,2未管理
- doctorName:vm.form2.juniorCollege, //专科医生
- familyDoctorName:vm.form2.family, //家庭医生名字
- patientName:vm.form2.resident, // 居民姓名
- team :vm.teamCode, //团队
- area :vm.areaCode=='350200'?'':vm.areaCode, //地区
- hospital :vm.communityCode, //社区
- rang :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
- pageSize:vm.currentSize,
- page:vm.currentPage,
- }).then(function(res){
- // console.log(res,"专病分析")
- if(res.status == 200) {
- res.data.list.forEach(function(item){
- item.sscNum = item.sscNum.replace(/^(.{4})(?:\d+)(.{1})$/,"$1****$2")
- item.idcardNum = item.idcardNum.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2")
- })
- vm.analyseData = res.data.list
- vm.datatotal = res.data.total
- vm.loadingTwo = false
- }
- if(res.status == -1) {
- vm.loadingTwo = false
- vm.$message.error(res.msg)
- }
- })
- },
- // 生日祝福分析明细
- getBirthdayPatientList:function() {
- var vm = this
- vm.loadingTwo = true
- statisticAPI.getBirthdayPatientList({
- patientName:vm.form3.resident, // 居民姓名
- doctorName:vm.form3.family, //医生姓名
- signYear :vm.radio=='1'?vm.chooseYear:'', //签约年度
- startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
- endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
- status :vm.radio4, //状态(不传为全部,1、已发送,2、未发送)
- team :vm.teamCode, //团队
- area :vm.areaCode=='350200'?'':vm.areaCode, //地区
- hospital :vm.communityCode, //社区
- range :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
- pageSize:vm.currentSize,
- page:vm.currentPage,
- }).then(function(res){
- if(res.status == 200) {
- // console.log(res,"Sddddd")
- res.data.detailModelList.forEach(function(item){
- item.ssc = item.ssc.replace(/^(.{4})(?:\d+)(.{1})$/,"$1****$2")
- item.idcard = item.idcard.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2")
- })
- vm.analyseData = res.data.detailModelList
- vm.datatotal = res.data.total
- vm.loadingTwo = false
- }
- if(res.status == -1) {
- vm.loadingTwo = false
- vm.$message.error(res.msg)
- }
- })
- },
- // 长处方分析明细
- getPrescriptionList:function() {
- var vm = this
- vm.loadingTwo = true
- statisticAPI.getPrescriptionList({
- patientName:vm.form5.resident, // 居民姓名
- doctorName :vm.form5.family, //医生姓名
- signYear :vm.radio=='1'?vm.chooseYear:'', //签约年度
- startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
- endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
- status :vm.radio6, //续方状态 0待审核 20药师审核中 40待支付 100已完成 999其他
- diagnosis :vm.radio7, //续方疾病类型1高血压2糖尿病3其他
- dispensaryType :vm.radio8, // 取药方式1自取2快递3健管师配送
- team :vm.teamCode, //团队
- area :vm.areaCode=='350200'?'':vm.areaCode, //地区
- hospital :vm.communityCode, //社区
- range :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
- pageSize:vm.currentSize,
- page:vm.currentPage,
- }).then(function(res){
- if(res.status == 200) {
- res.data.detailModelList.forEach(function(item){
- // console.log(item.finish_time,"长处方分析")
- item.ssc = item.ssc.replace(/^(.{4})(?:\d+)(.{1})$/,"$1****$2")
- item.idcard = item.idcard.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2")
- })
- vm.analyseData = res.data.detailModelList
- vm.datatotal = res.data.total
- vm.loadingTwo = false
- }
- if(res.status == -1) {
- vm.loadingTwo = false
- vm.$message.error(res.msg)
- }
- })
- },
- // 上门服务分析明细
- getDoorServiceList:function() {
- var vm = this
- vm.loadingTwo = true
- var handleDataList = []
- vm.serviceTypeDataType = ''
- vm.serviceTypeData.forEach(function(res){
- handleDataList.push(res.num)
- })
- vm.serviceTypeDataType = handleDataList.join(',')
- statisticAPI.getDoorServiceList({
- patientName:vm.form4.resident, // 居民姓名
- doctorName :vm.form4.family, //医生姓名
- signYear :vm.radio=='1'?vm.chooseYear:'', //签约年度
- startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
- endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
- status :vm.radio5, //工单状态 -1已取消,1待派单、2待接单、3已接单、4待服务、5待评价
- type :vm.serviceTypeDataType, //服务类型 1残疾人,2肺结核患者,3计生特殊家庭,4重性精神病,5失能/半失能老人,6其他,7 80岁以上老人
- team :vm.teamCode, //团队
- area :vm.areaCode=='350200'?'':vm.areaCode, //地区
- hospital :vm.communityCode, //社区
- range :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
- pageSize:vm.currentSize,
- page:vm.currentPage,
- }).then(function(res){
- if(res.status == 200) {
- // console.log(res,"上门服务分析明细")
- res.data.detailModelList.forEach(function(item){
- item.ssc = item.ssc.replace(/^(.{4})(?:\d+)(.{1})$/,"$1****$2")
- item.idcard = item.idcard.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2")
- })
- vm.analyseData = res.data.detailModelList
- vm.datatotal = res.data.total
- vm.loadingTwo = false
- }
- if(res.status == -1) {
- vm.loadingTwo = false
- vm.$message.error(res.msg)
- }
- })
- },
- //体征数据分析传参
- getHealthParameter:function() {
- var vm = this
- return {
- signYear :vm.radio=='1'?vm.chooseYear:'', //签约年度
- team :vm.teamCode, //团队
- area :vm.areaCode=='350200'?'':vm.areaCode, //地区
- hospital :vm.communityCode, //社区
- range :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
- startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
- endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
- name:vm.form6.resident, // 居民姓名
- category :vm.facility, //设备类型
- doctorName:vm.form6.doctor, //医生姓名
- serverType:vm.illness, //签约疾病类型
- pageSize:vm.currentSize,
- page:vm.currentPage,
-
-
- }
- },
- //体征数据分析
- physicalSignData:function() {
- var vm = this
- vm.loadingTwo = true
- statisticAPI.getHealthList(vm.getHealthParameter()).then(function(res){
- if(res.status == 200) {
- // console.log(res,"体征数据")
- vm.getHealthData = res.data.detailModelList
- vm.datatotal = res.data.total
- vm.loadingTwo = false
- }
- if(res.status == -1) {
- vm.loadingTwo = false
- vm.$message.error(res.msg)
- }
- })
- },
- //上转预约传参
- reservationParameter:function() {
- var vm = this
- return {
- signYear :vm.radio=='1'?vm.chooseYear:'', //签约年度
- team :vm.teamCode, //团队
- area :vm.areaCode=='350200'?'':vm.areaCode, //地区
- hospital :vm.communityCode, //社区
- range :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
- startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
- endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
- name:vm.form7.resident, // 居民姓名
- doctorName:vm.form7.doctorOne, //签约医生姓名
- reservationHospital:vm.form7.hospital, //签约医院
- reservationDept:vm.form7.administrativeOffice, //预约科室
- reservationDoctorName:vm.form7.doctorTwo, //预约医生
- pageSize:vm.currentSize,
- page:vm.currentPage,
-
-
- }
- },
- // 上转预约
- upTransferAppointment:function() {
- var vm = this
- vm.loadingTwo = true
- statisticAPI.getDoctorReservationList(vm.reservationParameter()).then(function(res){
- if(res.status == 200) {
- // console.log(res,"上转预约")
- vm.reservationData = res.data.detailModelList
- vm.datatotal = res.data.total
- vm.loadingTwo = false
- vm.getReservationHosAndDept()
- }
- if(res.status == -1) {
- vm.loadingTwo = false
- vm.$message.error(res.msg)
- }
- })
- },
- //微信绑定传参
- wexinBindingParameter:function() {
- var vm = this
- return {
- signYear :vm.radio=='1'?vm.chooseYear:'', //签约年度
- team :vm.teamCode, //团队
- area :vm.areaCode=='350200'?'':vm.areaCode, //地区
- hospital :vm.communityCode, //社区
- range :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
- startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
- endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
- binging:vm.form8.renew, //是否绑定微信
- pageSize:vm.currentSize,
- page:vm.currentPage,
-
- }
- },
- // 微信绑定
- wechatBinding:function() {
- var vm = this
- vm.loadingTwo = true
- statisticAPI.getWexinBindingList(vm.wexinBindingParameter()).then(function(res){
- if(res.status == 200) {
- // console.log(res,"微信绑定")
- res.data.detailModelList.forEach(function(res){
- res.sex = res.sex==1?'男':'女'
- res.apply_date = new Date(res.apply_date).format('yyyy-MM-dd HH:mm:ss')
- })
- vm.wexinBindingData = res.data.detailModelList
- vm.datatotal = res.data.total
- vm.loadingTwo = false
- }
- if(res.status == -1) {
- vm.loadingTwo = false
- vm.$message.error(res.msg)
- }
- })
- },
- //专病汇总传参
- getSpecialParameter:function() {
- var vm = this
- var parameter = {
- signYear:vm.radio=='1'?vm.chooseYear:'', //签约年度
- team:vm.teamCode, //团队
- area:vm.areaCode=='350200'?'':vm.areaCode, //地区
- hospital :vm.specHosName?vm.specHosName:vm.communityCode, //专病医院
- range:vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
- startDate:vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
- endDate:vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
- menu:vm.beforeReq().checked,
- // pageSize:vm.currentSize,
- // page:vm.currentPage,
- }
- return parameter
- },
- // 专病汇总
- getSpecialDiseaseReport:function() {
- var vm = this
- vm.loadingTwo = true
- statisticAPI.getSpecialDiseaseReport(vm.getSpecialParameter()).then(function(res){
- if(res.status == 200) {
- vm.loadingTwo = false
- vm.diseaseReport = res.data.list
- vm.diseaseColumn = res.data.column
- vm.diseaseHeader = res.data.header
- vm.datatotal = res.data.list.length
- }else{
- vm.loadingTwo = false
- vm.$message.error(res.msg)
- }
- })
- },
-
-
- //体征分析传参
- getDeviceParameter:function() {
- var vm = this
- var parameter = {
- signYear:vm.radio=='1'?vm.chooseYear:'', //签约年度
- team:vm.teamCode, //团队
- area:vm.areaCode=='350200'?'':vm.areaCode, //地区
- hospital :vm.communityCode, //医院
- range:vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
- startDate:vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
- endDate:vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
- category:vm.facilitySign,
- menu:vm.beforeReq().checked,
- // pageSize:vm.currentSize,
- // page:vm.currentPage,
- }
- return parameter
- },
-
- // 体征分析数据
- getDeviceHealthReport:function() {
- var vm = this
- vm.loadingTwo = true
- statisticAPI.getDeviceHealthReport(vm.getDeviceParameter()).then(function(res){
- if(res.status == 200) {
- vm.loadingTwo = false
- // console.log(res,"sss")
- vm.getDeviceReport = res.data.list
- vm.getDeviceColumn = res.data.column
- vm.getDeviceHeader = res.data.header
- vm.datatotal = res.data.list.length
- } else {
- vm.loadingTwo = false
- vm.$message.error(res.msg)
- }
- })
- },
- //上门汇总传参
- getDoorParameter:function() {
- var vm = this
- var parameter = {
- signYear:vm.radio=='1'?vm.chooseYear:'', //签约年度
- team:vm.teamCode, //团队
- area:vm.areaCode=='350200'?'':vm.areaCode, //地区
- hospital :vm.communityCode, //医院
- status:vm.radio9,
- range:vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
- startDate:vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
- endDate:vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
- menu:vm.beforeReq().checked,
- // pageSize:vm.currentSize,
- // page:vm.currentPage,
- }
- return parameter
- },
- // 上门汇总
- getDoorServerOrderReport:function() {
- var vm = this
- vm.loadingTwo = true
- statisticAPI.getDoorServerOrderReport(vm.getDoorParameter()).then(function(res){
- if(res.status == 200) {
- vm.loadingTwo = false
- // console.log(res,"sss")
- vm.getDoorReport = res.data.list
- vm.getDoorColumn = res.data.column
- vm.getDoorHeader = res.data.header
- vm.datatotal = res.data.list.length
- }else{
- vm.loadingTwo = false
- vm.$message.error(res.msg)
- }
- })
- },
-
-
- getTreeList:function(){
- var vm=this
- statisticAPI.exportTreeList({rang:vm.rangeCode}).then(function(res){
- if(res.status == 200){
- // console.log(res,"Sddd")
- vm.treedata = [],jindex=0
- _.each(res.data,function(item,index){
- vm.treedata.push({
- id:"p_"+jindex,
- label:index,
- children:[]
- })
- _.each(item,function(citem,cindex){
- vm.treedata[jindex].children.push({
- id:cindex,
- label:citem,
- })
- })
- jindex++
- })
- }
- })
-
- },
- beforeReq:function(flag){
- var vm=this,startDate="",endDate="",checked=[]
- if(vm.radio=="1"){
- if(vm.chooseYear == 2022) {
- startDate = '2022-07-01'
- endDate = '2022-12-31'
- }else if(vm.chooseYear > 2022) {
- startDate = vm.chooseYear + '-01-01'
- endDate = getEndDate(vm.chooseYear)
- }else{
- startDate = getStartDate(vm.chooseYear)
- endDate = getEndDate(vm.chooseYear)
- }
- vm.timeLevel = 2
- }else{
- if(!vm.start&&!vm.end){
- this.$message({
- message: '请选择创建时间',
- type: 'warning'
- });
- return false
- }else{
- if(vm.start>vm.end){
- this.$message({
- message: '开始时间应早于结束时间',
- type: 'warning'
- });
- return false
- }else{
- startDate = vm.start
- endDate = vm.end
- vm.timeLevel = 1
- }
- }
- }
- if(vm.handleNodeId == 0 || vm.handleNodeId == 'huizongshuju') {
- var checkTree
- if(vm.tabsId == 1) {
- checkTree = vm.$refs.tree.getCheckedNodes(true);
- }else{
- checkTree = vm.$refs.collectTree.getCheckedNodes(true);
- }
- if(checkTree.length){
- if(!flag){
- vm.tableHeader = []
- }
- _.each(checkTree,function(item,index){
- if(!flag){
- vm.tableHeader.push({prop:item.label,label:item.label})
- }
- checked.push(item.id)
- })
- }else{
- this.$message({
- message: '请选择搜索指标!',
- type: 'warning'
- });
- return false
- }
- }else if(vm.handleNodeId == 2) {
- this.$message({
- message: '请选择明细查询!',
- type: 'warning'
- });
- return false
- }
-
- return {start:startDate,end:endDate,checked:checked.join(",")}
- },
- // 查询
- searchHandle:function(){
- // console.log(this.beforeReq())
- var vm = this
- vm.searchJsonTime = vm.beforeReq()
- vm.currentPage = 1
- if(this.radio1 == 1) {this.radio1Show = true}else{this.radio1Show = false}
- if(vm.handleNodeId == 0) {
- if(vm.searchJsonTime){
- vm.searchJson = {
- startDate:vm.searchJsonTime.start,
- endDate:vm.searchJsonTime.end,
- quotaStr:vm.searchJsonTime.checked,
- range:vm.rangeCode,
- team:vm.teamCode,
- hospital:vm.communityCode,
- area:vm.areaCode=="350200"?"":vm.areaCode,
- size:vm.currentSize,
- page:vm.currentPage,
- timeLevel: vm.timeLevel
- }
- vm.getStatisticDataList()
- }
- }else if(vm.handleNodeId == 33) {
- // 咨询分析
- vm.getConsultList()
- }else if(vm.handleNodeId == 34) {
- // 签约分析
- vm.getSignList()
- }else if(vm.handleNodeId == 35) {
- // 专病分析
- vm.getSickList()
- }else if(vm.handleNodeId == 36) {
- // 生日祝福分析
- vm.getBirthdayPatientList()
- }else if(vm.handleNodeId == 37) {
- // 上门服务分析
- vm.getDoorServiceList()
- }else if(vm.handleNodeId == 38) {
- // 长处方分析
- vm.getPrescriptionList()
- }else if(vm.handleNodeId == 39) {
- // 体征数据
- vm.physicalSignData()
- }else if(vm.handleNodeId == 40) {
- // 上转预约
- vm.upTransferAppointment()
- }else if(vm.handleNodeId == 41) {
- // 微信绑定
- vm.wechatBinding()
- }else if(vm.collectCode == 1) {
- // 专病汇总
- vm.getSpecialDiseaseReport()
- }else if(vm.collectCode == 2) {
- // 体征数据汇总
- vm.getDeviceHealthReport()
- }else if(vm.collectCode == 3) {
- // 上门服务汇总
- vm.getDoorServerOrderReport()
- }
- },
- getStatisticDataList:function(){
- var vm = this
- vm.isloading = true
- var params=JSON.parse(JSON.stringify(vm.searchJson))
- params.page = vm.currentPage
- statisticAPI.getStatisticDataList(params).then(function(res){
- if(res.status == 200) {
- vm.tabledata = res.data.data
- vm.datatotal = res.data.total
- if(vm.tabledata.length){
- vm.tableHeader=[]
- _.each(vm.tabledata[0],function(item,index){
- if(index!="town"&&index!="townName"&&index!="hospital"&&index!="hospitalName"&&index!="area"&&index!="areaName"&&index!="code"&&index!="name")
- vm.tableHeader.push({prop:index,label:index})
- })
- }
- } else {
- vm.$message.error(res.msg)
- }
- vm.isloading = false
- })
- },
- // 导出
- exportHandle:function(){
- // var uid = JSON.parse(window.localStorage.getItem('wlyyAgentForDoc')).uid
- // var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
- // saveAs(blob, "hello world.txt");
- // return
- var vm =this
- var vm = this,searchJson=undefined
- vm.fullscreenLoading = true
- searchJson = vm.beforeReq('export')
- var areaCode = vm.areaCode=="350200"?"":vm.areaCode
- var chooseYear = vm.radio=='1'?vm.chooseYear:'' //年份
- var startDate = vm.radio=='2'?vm.searchJsonTime.start:''
- var endDate = vm.radio=='2'?vm.searchJsonTime.end:''
- if(vm.handleNodeId == 0) {
- if(searchJson){
- statisticAPI.statisticsExportExport({
- startDate: searchJson.start,
- endDate: searchJson.end,
- quotaStr: searchJson.checked,
- range: vm.rangeCode,
- area: areaCode,
- hospital: vm.communityCode,
- team: vm.teamCode,
- timeLevel: vm.timeLevel,
- }, "综合查询.xls").then(function(res){
- vm.fullscreenLoading = false
- // toastr.info("导出成功")
-
- // var blob = new Blob(["Hello, world!"]);
- // FileSaver.saveAs(blob, "hello world.txt");
-
- // console.log(res)
- // FileSaver()
- })
- .catch(function(err){
- console.error(err)
- })
- // let str = httpRequest.server + 'statisticsExport/export?startDate='+searchJson.start+'&endDate='+searchJson.end+'"aStr='+searchJson.checked+'&range='+vm.rangeCode+'&area='+areaCode+'&hospital='+vm.communityCode+'&team='+vm.teamCode+'&timeLevel='+vm.timeLevel
- // window.location.href = str
- }
- }else if(vm.handleNodeId == 33) {
- // 咨询分析
- if(vm.analyseData.length!=0) {
- statisticAPI.statisticsExportExportConsultList({
- year: chooseYear,
- startDate: startDate,
- endDate: endDate,
- status: vm.radio1,
- area: areaCode,
- hospital: vm.communityCode,
- rang:vm.rangeCode,
- team: vm.teamCode,
- },vm.derive+".xls").then(function(res){
- vm.fullscreenLoading = false
- // var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
- // FileSaver.saveAs(blob, "hello world.txt");
- // FileSaver()
- })
- .catch(function(err){
- toastr.info(err)
- vm.fullscreenLoading = false
- console.error(err)
- })
-
- // var str = httpRequest.server + 'statisticsExport/exportConsultList?year='+chooseYear+'&startDate='+startDate+'&endDate='+endDate+
- // '&status='+vm.radio1+'&area='+areaCode+'&hospital='+vm.communityCode+'&rang='+vm.rangeCode+'&team='+vm.teamCode
- // window.location.href = str
- }else{vm.fullscreenLoading = false}
-
- }else if(vm.handleNodeId == 34) {
- // 签约分析
- if(vm.analyseData.length!=0) {
- statisticAPI.statisticsExportExportSignList({
- year: chooseYear,
- startDate: startDate,
- endDate: endDate,
- serverType:vm.serverType,
- status:vm.radio2,
- isUpdate:vm.form.endorseTheTicket,
- isAdd:vm.form.renew,
- isOut:vm.form.backToSign,
- isBindWX:vm.form.WeChat,
- area: areaCode,
- hospital: vm.communityCode,
- rang:vm.rangeCode,
- team: vm.teamCode,
- },vm.derive+".xls").then(function(res){
- vm.fullscreenLoading = false
- })
- .catch(function(err){
- toastr.info(err)
- vm.fullscreenLoading = false
- console.error(err)
- })
- }else{vm.fullscreenLoading = false}
-
- }else if(vm.handleNodeId == 35) {
- // 专病分析
- if(vm.analyseData.length!=0) {
- statisticAPI.statisticsExportExportSickList({
- year: chooseYear,
- startDate: startDate,
- endDate: endDate,
- diseaseType:vm.diseaseDataType,
- status:vm.radio3,
- doctorName:vm.form2.juniorCollege,
- familyDoctorName:vm.form2.family,
- patientName:vm.form2.resident,
- area: areaCode,
- hospital: vm.communityCode,
- rang:vm.rangeCode,
- team: vm.teamCode,
- },vm.derive+".xls").then(function(res){
- vm.fullscreenLoading = false
- })
- .catch(function(err){
- toastr.info(err)
- vm.fullscreenLoading = false
- console.error(err)
- })
- }else{vm.fullscreenLoading = false}
-
- }else if(vm.handleNodeId == 36) {
- // 生日祝福分析
- if(vm.analyseData.length!=0) {
- statisticAPI.statisticsExportGetBirthdayPatientListExport({
- signYear: chooseYear,
- startDate: startDate,
- endDate: endDate,
- patientName:vm.form3.resident,
- doctorName:vm.form3.family,
- status:vm.radio4,
- area: areaCode,
- hospital: vm.communityCode,
- range:vm.rangeCode,
- team: vm.teamCode,
- pageSize:'50000',
- page:vm.currentPage,
- },vm.derive+".xls").then(function(res){
- vm.fullscreenLoading = false
- })
- .catch(function(err){
- toastr.info(err)
- vm.fullscreenLoading = false
- console.error(err)
- })
- }else{vm.fullscreenLoading = false}
-
- }else if(vm.handleNodeId == 37) {
- // 上门服务分析
- if(vm.analyseData.length!=0) {
- statisticAPI.statisticsExportExportDoorServiceList({
- signYear: chooseYear,
- startDate: startDate,
- endDate: endDate,
- patientName:vm.form4.resident,
- doctorName:vm.form4.family,
- status:vm.radio5,
- type:vm.serviceTypeDataType,
- area: areaCode,
- hospital: vm.communityCode,
- range:vm.rangeCode,
- team: vm.teamCode,
- pageSize:vm.currentSize,
- page:vm.currentPage,
- },vm.derive+".xls").then(function(res){
- vm.fullscreenLoading = false
- })
- .catch(function(err){
- toastr.info(err)
- vm.fullscreenLoading = false
- console.error(err)
- })
- }else{vm.fullscreenLoading = false}
-
- }else if(vm.handleNodeId == 38) {
- // 长处方分析
- if(vm.analyseData.length!=0) {
- statisticAPI.statisticsExportExportPrescriptionList({
- signYear: chooseYear,
- startDate: startDate,
- endDate: endDate,
- patientName:vm.form5.resident,
- doctorName:vm.form5.family,
- status:vm.radio6,
- diagnosisName:vm.radio7,
- dispensaryType:vm.radio8,
- area: areaCode,
- hospital: vm.communityCode,
- range:vm.rangeCode,
- team: vm.teamCode,
- pageSize:vm.currentSize,
- page:vm.currentPage,
- },vm.derive+".xls").then(function(res){
- vm.fullscreenLoading = false
- })
- .catch(function(err){
- toastr.info(err)
- vm.fullscreenLoading = false
- console.error(err)
- })
-
- }else{vm.fullscreenLoading = false}
-
- }else if(vm.handleNodeId == 39) {
- // 体征数据
- if(vm.getHealthData.length!=0) {
- statisticAPI.exportHealthList(vm.getHealthParameter(),vm.derive+".xls").then(function(res){
- vm.fullscreenLoading = false
- })
- .catch(function(err){
- toastr.info(err)
- vm.fullscreenLoading = false
- console.error(err)
- })
-
- }else{vm.fullscreenLoading = false}
-
- }else if(vm.handleNodeId == 40) {
- // 上转预约
- if(vm.reservationData.length!=0) {
- statisticAPI.exportDoctorReservationList(vm.reservationParameter(),vm.derive+".xls").then(function(res){
- vm.fullscreenLoading = false
- })
- .catch(function(err){
- toastr.info(err)
- vm.fullscreenLoading = false
- console.error(err)
- })
-
- }else{vm.fullscreenLoading = false}
-
- }else if(vm.handleNodeId == 41) {
- // 微信绑定数据
- if(vm.wexinBindingData.length!=0) {
- statisticAPI.exportWexinBindingList(vm.wexinBindingParameter(),vm.derive+".xls").then(function(res){
- vm.fullscreenLoading = false
- })
- .catch(function(err){
- toastr.info(err)
- vm.fullscreenLoading = false
- console.error(err)
- })
-
- }else{vm.fullscreenLoading = false}
-
- }else if(vm.collectCode == 1) {
- // 专病汇总
- if(vm.diseaseReport.length!=0) {
- statisticAPI.exportSpecialDiseaseReport(vm.getSpecialParameter(),vm.derive+".xls").then(function(res){
- vm.fullscreenLoading = false
- })
- .catch(function(err){
- toastr.info(err)
- vm.fullscreenLoading = false
- console.error(err)
- })
-
- }else{vm.fullscreenLoading = false}
- }else if(vm.collectCode == 2) {
- // 体征分析
- if(vm.getDeviceReport.length!=0) {
- statisticAPI.exportDeviceHealthReport(vm.getDeviceParameter(),vm.derive+".xls").then(function(res){
- vm.fullscreenLoading = false
- })
- .catch(function(err){
- toastr.info(err)
- vm.fullscreenLoading = false
- console.error(err)
- })
-
- }else{vm.fullscreenLoading = false}
- }else if(vm.collectCode == 3) {
- // 上门汇总
- if(vm.getDoorReport.length!=0) {
- statisticAPI.exportDoorServerOrderReport(vm.getDoorParameter(),vm.derive+".xls").then(function(res){
- vm.fullscreenLoading = false
- })
- .catch(function(err){
- toastr.info(err)
- vm.fullscreenLoading = false
- console.error(err)
- })
-
- }else{vm.fullscreenLoading = false}
- }
- },
- backClick:function(){
- history.go(-1);
- },
- bindEvent:function(){
- var vm=this
- //监听后退按钮的操作
- EventBus.$on("back-click", function (arg) {
- EventBus.$emit('update-statistics-time', {}); //更新统计时间
- vm.backClick()
- });
- //监听页面刷新
- EventBus.$on("refresh-click", function (arg) {
- EventBus.$emit('update-statistics-time', {}); //更新统计时间
- initData(vm)
- });
- $("#main").removeClass("c-hide");
- },
- // 下一页 上一页
- handleCurrentChange:function(val) {
- var vm = this
- vm.currentPage = val
- if(vm.handleNodeId == 0) {
- vm.getStatisticDataList()
- }else if(vm.handleNodeId == 33) {
- // 咨询分析
- vm.getConsultList()
- }else if(vm.handleNodeId == 34) {
- // 签约分析
- vm.getSignList()
- }else if(vm.handleNodeId == 35) {
- // 专病分析
- vm.getSickList()
- }else if(vm.handleNodeId == 36) {
- // 生日祝福分析
- vm.getBirthdayPatientList()
- }else if(vm.handleNodeId == 37) {
- // 上门服务分析
- vm.getDoorServiceList()
- }else if(vm.handleNodeId == 38) {
- // 长处方分析
- vm.getPrescriptionList()
- }else if(vm.handleNodeId == 39) {
- // 体征数据
- vm.physicalSignData()
- }else if(vm.handleNodeId == 40) {
- // 上转预约
- vm.upTransferAppointment()
- }else if(vm.handleNodeId == 41) {
- // 微信绑定
- vm.wechatBinding()
- }
- },
- //获取省市区 type:区3
- getDistrict: function(type,code,name) {
- var vm=this,list = [],param=""
- if(type == 3){
- list = [{code:code,name:name}]
- param = "area"
- }else if(type == 5){
- list = [{code:"",name:"全部"}]
- param = "community"
- }
- var params={
- type:type,code:code
- }
- homeAPI.getDistrict(params).then(function(res) {
- if(res.status == 200) {
- vm[param+"List"]=list.concat(res.list)
- vm[param+"Code"]=vm[param+"List"][0].code
- } else {
- vm.$message.error(res.msg)
- }
- })
- },
- selChange:function(type){
- var vm=this,name=""
- if(type == 3){
- vm.initSelOption("community")
- vm.initSelOption("team")
- vm.getCommunityHospital()
- }else if(type == 5){
- vm.initSelOption("team")
- vm.teamListByArea()
- }
- },
- initSelOption:function(param){
- var vm=this
- vm[param+"List"]=[{code:"",name:"全部"}]
- if(param == "team"){
- vm[param+"List"]=[{id:"",name:"全部"}]
- }
- vm[param+"Code"]=vm[param+"List"][0].code||vm[param+"List"][0].id
- },
- getCommunityHospital:function() {
- var vm=this,list = [{code:"",name:"全部"}],param="community"
- homeAPI.getCommunityHospital({area:vm.areaCode=='350200'?"":vm.areaCode}).then(function(res) {
- if(res.status == 200) {
- vm[param+"List"]=list.concat(res.data)
- vm[param+"Code"]=vm[param+"List"][0].code
- } else {
- vm.$message.error(res.msg)
- }
- })
- },
- teamListByArea:function() {
- var vm=this,list = [{id:"",name:"全部"}],param="team"
- homeAPI.teamListByArea({area:vm.areaCode=='350200'?"":vm.areaCode,hospital:vm.communityCode}).then(function(res) {
- if(res.status == 200) {
- vm[param+"List"]=list.concat(res.data)
- vm[param+"Code"]=vm[param+"List"][0].id
- } else {
- vm.$message.error(res.msg)
- }
- })
- }
- },
- })
- // 初始化时间
- function initTime(vm){
- var now = new Date();
- vm.end = now.format("yyyy-MM-dd")
- var start = now.getTime() - 30*24*60*60*1000
- vm.start = new Date(start).format("yyyy-MM-dd")
-
- vm.nowyear = vm.chooseYear = now.getFullYear()
- vm.nowmonth = now.getMonth()+1
- vm.years = []
- for(i=vm.nowyear; i>=2016; i--){
- vm.years.push(i)
- }
- }
- // 数据范围初始化
- function initScope(vm) {
- //获得缓存中缓存的角色权限
- var userRole = window.sessionStorage.getItem("selectedRole");
- if (!userRole) {
- return false;
- }
- vm.userRole = JSON.parse(userRole);
- //level:2、市,3、区,4、社区,5、团队
- vm.initareaLevel = vm.areaLevel = vm.userRole.code == '350200' ? 2 : vm.userRole.code.length == 6 ? 3 : 4;
- vm.initlevel = vm.level = vm.userRole.code == '350200' ? 4 : vm.userRole.code.length == 6 ? 3 : 2;
- // vm.lowLevel = vm.initlowLevel = vm.userRole.code == '350200' ? 3 : vm.userRole.code.length == 6 ? 2 : 1;
-
- vm.initarea =vm.area = vm.userRole.code;
- vm.areaTitle = vm.userRole.name;
-
- vm.rangeList=[{name:"按区",code:"town"},{name:"按社区",code:"hospital"},{name:"按团队",code:"team"}]
-
- if(vm.initlevel == 4){ //市获取区
- vm.getDistrict(3,vm.initarea,vm.areaTitle.substr(0,3))
- vm.rangeCode = vm.rangeList[0].code
- }else if(vm.initlevel == 3){ //区获取社区
- vm.areaList = [{code:vm.initarea,name:vm.areaTitle}]
- vm.areaCode = vm.initarea
- vm.rangeCode = vm.rangeList[0].code
- }else if(vm.initlevel == 2){ //社区获取团队
- vm.communityList = [{code:vm.initarea,name:vm.areaTitle}]
- vm.communityCode = vm.initarea
- vm.rangeList.shift()
- vm.rangeCode = vm.rangeList[0].code
- }
- vm.searchJson.range = vm.rangeCode
- }
- function initData(vm) {
- initScope(vm)
-
- //初始化时间
- initTime(vm)
-
- vm.tabledata = []
- vm.bindEvent()
- }
|