mzfTimeoutStatistics.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. var template = ''
  2. $.ajax('../html/mzfTimeoutStatistics.html',{
  3. data: {},
  4. dataType: 'html',
  5. cache: false,
  6. timeout: 60000,
  7. async: false,
  8. error: function(res) {
  9. },
  10. success: function(res) {
  11. template = res
  12. }
  13. })
  14. Vue.component('mzf-timeout-statistics', {
  15. props: [],
  16. template: template,
  17. data: function() {
  18. return {
  19. tableData:[],
  20. startTime:new Date('2023','05','28'),
  21. endTime:new Date(),
  22. setDisabled:{
  23. disabledDate:function(time) {
  24. return time.getTime() < new Date('2023','05','26') || time.getTime() > Date.now();
  25. }
  26. },
  27. loadingTwo:false,
  28. }
  29. },
  30. created: function(){
  31. this.findCopdHealthInfoList()
  32. },
  33. watch:{
  34. },
  35. methods: {
  36. startTimeChange:function(o) {
  37. if(!this.list[0] || this.list[0].type!=0) {
  38. this.list.unshift({type:'0',id:'time',label:o.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd')})
  39. }else{
  40. this.list[0].label = o.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd')
  41. }
  42. },
  43. endTimeChange:function(o) {
  44. if(!this.list[0] || this.list[0].type!=0) {
  45. this.list.unshift({type:'0',id:'time',label:this.startTime.format('yyyy-MM-dd') +"~"+ o.format('yyyy-MM-dd')})
  46. }else{
  47. this.list[0].label = this.startTime.format('yyyy-MM-dd') +"~"+ o.format('yyyy-MM-dd')
  48. }
  49. },
  50. findCopdHealthInfoList:function () {
  51. var vm = this
  52. vm.loadingTwo = true
  53. var p = {
  54. startTime:this.startTime.format('yyyy-MM-dd'),
  55. endTime:this.endTime.format('yyyy-MM-dd'),
  56. }
  57. statisticAPI.getCopdCheckExamineData({jsonStr:JSON.stringify(p)}).then(function(res){
  58. if(res.status == 200) {
  59. vm.loadingTwo = false
  60. vm.tableData = res.data
  61. }
  62. }).catch(function(err){
  63. vm.loadingTwo = false
  64. })
  65. },
  66. // 查询
  67. confirm:function() {
  68. this.findCopdHealthInfoList()
  69. },
  70. // 导出
  71. exportHandle:function() {
  72. var vm = this
  73. vm.loadingTwo = true
  74. var p = {
  75. startTime:this.startTime.format('yyyy-MM-dd'),
  76. endTime:this.endTime.format('yyyy-MM-dd'),
  77. }
  78. statisticAPI.exportCopdCheckExamineData({
  79. jsonStr:JSON.stringify(p)
  80. },'慢阻肺监查、稽查情况统计.xls').then(function(res){
  81. vm.loadingTwo = false
  82. })
  83. },
  84. }
  85. })