mzfHzcx.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. var template = ''
  2. $.ajax('../html/mzfHzcx.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-hzcx', {
  15. props: [],
  16. template: template,
  17. data: function() {
  18. return {
  19. mzfHzcxData:[{name: '测试数据'}],
  20. list:[],
  21. startTime:new Date('2023','05','26'),
  22. endTime:new Date(),
  23. regionList:[],
  24. regionData:[
  25. {label:'全市',id:'1',type:'1'}
  26. ],
  27. regionListList:[],
  28. tertiaryHospitalsData:[
  29. {label:'全部',id:'1',type:'2'}
  30. ],
  31. communityHospitalsList:[],
  32. communityHospitalsData:[
  33. {label:'全部',id:'1',type:'3'}
  34. ],
  35. groupingList:[],
  36. groupingData:[
  37. {label:'全部',id:'1',type:'4'}
  38. ],
  39. administrationStatusList:[],
  40. administrationStatusData:[
  41. {label:'全部',id:'1',type:'5'}
  42. ],
  43. show:false,
  44. showTwo:false,
  45. showThree:false,
  46. currentPage:1,
  47. currentSize:10,
  48. datatotal:0, //总数
  49. loadingTwo:false,
  50. setDisabled:{
  51. disabledDate(time) {
  52. return time.getTime() < new Date('2023','05','26') || time.getTime() > Date.now();
  53. }
  54. },
  55. s:'',
  56. e:'',
  57. dialogVisible: false,
  58. num: ''
  59. }
  60. },
  61. created: function(){
  62. this.s = this.startTime.format('yyyy-MM-dd')
  63. this.e = this.endTime.format('yyyy-MM-dd')
  64. this.list.unshift({type:'0',id:'time',label:this.s +"~"+ this.e})
  65. // this.hospitalWorkStatistics()
  66. },
  67. watch:{
  68. 'startTime':{
  69. handler:function(o) {
  70. if(!o) {
  71. this.list.splice(0,1)
  72. }
  73. },
  74. deep: true,
  75. immediate: true
  76. },
  77. 'endTime':{
  78. handler:function(o) {
  79. if(!o) {
  80. this.list.splice(0,1)
  81. }
  82. },
  83. deep: true,
  84. immediate: true
  85. },
  86. },
  87. methods: {
  88. hospitalWorkStatistics:function() {
  89. var vm = this
  90. vm.loadingTwo = true
  91. statisticAPI.hospitalWorkStatistics({
  92. startDate:this.startTime.format('yyyy-MM-dd'),
  93. endDate:this.endTime.format('yyyy-MM-dd')
  94. }).then(function(res){
  95. if(res.status == 200) {
  96. vm.loadingTwo = false
  97. vm.mzfHzcxData = res.data
  98. }
  99. }).catch(function(err){
  100. vm.loadingTwo = false
  101. })
  102. },
  103. startTimeChange:function(o) {
  104. if(!this.list[0] || this.list[0].type!=0) {
  105. this.list.unshift({type:'0',id:'time',label:o.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd')})
  106. }else{
  107. this.list[0].label = o.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd')
  108. }
  109. },
  110. endTimeChange:function(o) {
  111. if(!this.list[0] || this.list[0].type!=0) {
  112. this.list.unshift({type:'0',id:'time',label:this.startTime.format('yyyy-MM-dd') +"~"+ o.format('yyyy-MM-dd')})
  113. }else{
  114. this.list[0].label = this.startTime.format('yyyy-MM-dd') +"~"+ o.format('yyyy-MM-dd')
  115. }
  116. },
  117. deleteClick:function(item) {
  118. if(item.id == "time") {
  119. this.startTime = ''
  120. this.endTime = ''
  121. this.list.splice(0,1)
  122. }
  123. var index = this.list.findIndex(function(v){
  124. return item.id == v.id
  125. })
  126. this.list.splice(index,1)
  127. },
  128. // 下一页 上一页
  129. handleCurrentChange:function(val) {
  130. var vm = this
  131. vm.currentPage = val
  132. },
  133. change:function(val) {
  134. this.list = this.list.concat(val)
  135. },
  136. // 确定
  137. confirm:function() {
  138. this.hospitalWorkStatistics()
  139. },
  140. // 取消
  141. cancel:function() {
  142. this.startTime = new Date('2023','05','26')
  143. this.endTime = new Date()
  144. if(!this.list[0] || this.list[0].type!=0) {
  145. this.list.unshift({type:'0',id:'time',label:this.startTime.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd')})
  146. }else{
  147. this.list[0].label = this.startTime.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd')
  148. }
  149. },
  150. // 导出
  151. exportHandle:function() {
  152. var vm = this
  153. vm.loadingTwo = true
  154. statisticAPI.exportHospitalWorkStatistics({
  155. startDate:this.startTime.format('yyyy-MM-dd'),
  156. endDate:this.endTime.format('yyyy-MM-dd')
  157. },'慢阻肺医院工作量表.xls').then(function(res){
  158. vm.loadingTwo = false
  159. })
  160. },
  161. // 计划/记录
  162. showSfjh: function(num,id) {
  163. var vm = this
  164. vm.num = num
  165. this.dialogVisible = true
  166. }
  167. }
  168. })