zbfzDetail.js 4.0 KB

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