var template = '' $.ajax('../html/mzfTimeoutStatistics.html',{ data: {}, dataType: 'html', cache: false, timeout: 60000, async: false, error: function(res) { }, success: function(res) { template = res } }) Vue.component('mzf-timeout-statistics', { props: [], template: template, data: function() { return { tableData:[], startTime:new Date('2023','05','28'), endTime:new Date(), setDisabled:{ disabledDate:function(time) { return time.getTime() < new Date('2023','05','26') || time.getTime() > Date.now(); } }, loadingTwo:false, } }, created: function(){ this.findCopdHealthInfoList() }, watch:{ }, methods: { startTimeChange:function(o) { if(!this.list[0] || this.list[0].type!=0) { this.list.unshift({type:'0',id:'time',label:o.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd')}) }else{ this.list[0].label = o.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd') } }, endTimeChange:function(o) { if(!this.list[0] || this.list[0].type!=0) { this.list.unshift({type:'0',id:'time',label:this.startTime.format('yyyy-MM-dd') +"~"+ o.format('yyyy-MM-dd')}) }else{ this.list[0].label = this.startTime.format('yyyy-MM-dd') +"~"+ o.format('yyyy-MM-dd') } }, findCopdHealthInfoList:function () { var vm = this vm.loadingTwo = true var p = { startTime:this.startTime.format('yyyy-MM-dd'), endTime:this.endTime.format('yyyy-MM-dd'), } statisticAPI.getCopdCheckExamineData({jsonStr:JSON.stringify(p)}).then(function(res){ if(res.status == 200) { vm.loadingTwo = false vm.tableData = res.data } }).catch(function(err){ vm.loadingTwo = false }) }, // 查询 confirm:function() { this.findCopdHealthInfoList() }, // 导出 exportHandle:function() { var vm = this vm.loadingTwo = true var p = { startTime:this.startTime.format('yyyy-MM-dd'), endTime:this.endTime.format('yyyy-MM-dd') } var jsonStr = JSON.stringify(p) statisticAPI.exportCopdCheckExamineData({ jsonStr: encodeURIComponent(jsonStr) },'慢阻肺监查、稽查情况统计.xls').then(function(res){ vm.loadingTwo = false }) }, } })