mzfWatches.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. var template = ''
  2. $.ajax('../html/mzfWatches.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-watches', {
  15. props: [],
  16. template: template,
  17. data: function() {
  18. return {
  19. tableData:[],
  20. testArr1: [],
  21. testArr2: [],
  22. testPosition1: 0,
  23. testPosition2: 0,
  24. list:[],
  25. startTime:new Date('2023','05','26'),
  26. endTime:new Date(),
  27. regionData:[
  28. {label:'全部',value:'8'},
  29. {label:'未管理',value:'0'},
  30. {label:'在管',value:'1'},
  31. {label:'失访',value:'2'},
  32. {label:'出组',value:'3'},
  33. {label:'不纳入管理 ',value:'4'},
  34. {label:'入组 ',value:'5'},
  35. {label:'死亡 ',value:'6'},
  36. {label:'已管理 ',value:'7'},
  37. ],
  38. // region: '8', //管理状态
  39. tertiaryHospitalsData:[],
  40. tertiary: [], //地区
  41. communityHospitalsData:[],
  42. communityHospitals: [], // 三级医院
  43. groupingData:[],
  44. group: [], // 社区
  45. queryLevel: 1, // :1.全部 2.区 3.等级医院 4.社区医院
  46. patient: '', // 患者姓名
  47. administrationStatusList:[],
  48. administrationStatusData:[
  49. {label:'全部',id:'1',type:'5'}
  50. ],
  51. show:false,
  52. showTwo:false,
  53. showThree:false,
  54. currentPage:1,
  55. currentSize:10,
  56. datatotal:0, //总数
  57. datatotalTwo:0,
  58. currentPageTwo:1,
  59. currentSizeTwo:10,
  60. loadingTwo:false,
  61. setDisabled:{
  62. disabledDate:function(time) {
  63. return time.getTime() < new Date('2023','05','26') || time.getTime() > Date.now();
  64. }
  65. },
  66. s:'',
  67. e:'',
  68. dialogVisible: false,
  69. dataInfo: [],
  70. url: '',
  71. showPdf: false,
  72. watchPageCode:'',
  73. copdListTbas:[
  74. {id:'1',name:'运动'},
  75. {id:'2',name:'睡眠'},
  76. {id:'3',name:'心率'},
  77. {id:'4',name:'PAI'},
  78. {id:'5',name:'血氧'},
  79. {id:'6',name:'健康分'},
  80. ],
  81. copdListIndex:'1',
  82. copdListData:[],
  83. }
  84. },
  85. created: function(){
  86. this.findCopdHealthInfoList()
  87. },
  88. watch:{
  89. },
  90. methods: {
  91. tabClick:function(index) {
  92. this.copdListIndex = index
  93. this.currentPageTwo = 1
  94. this.copdList()
  95. },
  96. findCopdHealthInfoList:function () {
  97. var vm = this
  98. vm.loadingTwo = true
  99. statisticAPI.watchStatisticsList({
  100. startDate:this.startTime.format('yyyy-MM-dd'),
  101. endDate:this.endTime.format('yyyy-MM-dd'),
  102. }).then(function(res){
  103. if(res.status == 200) {
  104. // console.log(res,'hxsj');
  105. vm.loadingTwo = false
  106. vm.tableData = res.data
  107. // vm.datatotal = res.data.length
  108. }
  109. }).catch(function(err){
  110. vm.loadingTwo = false
  111. })
  112. },
  113. watchPage:function() {
  114. var vm = this
  115. vm.loadingTwo = true
  116. statisticAPI.watchPage({
  117. startDate:this.startTime.format('yyyy-MM-dd'),
  118. endDate:this.endTime.format('yyyy-MM-dd'),
  119. page:vm.currentPage,
  120. size:vm.currentSize,
  121. area:vm.watchPageCode,
  122. }).then(function(res){
  123. if(res.status == 200) {
  124. console.log(res,'hxsj');
  125. vm.loadingTwo = false
  126. vm.dataInfo = res.detailModelList
  127. vm.datatotal = res.totalCount
  128. }
  129. }).catch(function(err){
  130. vm.loadingTwo = false
  131. })
  132. },
  133. copdList:function() {
  134. var vm = this
  135. vm.loadingTwo = true
  136. statisticAPI.copdList({
  137. patient:vm.patient,
  138. type:vm.copdListIndex,
  139. begin:this.startTime.format('yyyy-MM-dd'),
  140. end:this.endTime.format('yyyy-MM-dd'),
  141. page:vm.currentPageTwo,
  142. size:vm.currentSizeTwo,
  143. }).then(function(res){
  144. if(res.status == 200) {
  145. console.log(res,'shahshas');
  146. vm.loadingTwo = false
  147. vm.copdListData = res.detailModelList
  148. vm.datatotalTwo = res.totalCount
  149. }
  150. }).catch(function(err){
  151. vm.loadingTwo = false
  152. })
  153. },
  154. startTimeChange:function(o) {
  155. if(!this.list[0] || this.list[0].type!=0) {
  156. this.list.unshift({type:'0',id:'time',label:o.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd')})
  157. }else{
  158. this.list[0].label = o.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd')
  159. }
  160. },
  161. endTimeChange:function(o) {
  162. if(!this.list[0] || this.list[0].type!=0) {
  163. this.list.unshift({type:'0',id:'time',label:this.startTime.format('yyyy-MM-dd') +"~"+ o.format('yyyy-MM-dd')})
  164. }else{
  165. this.list[0].label = this.startTime.format('yyyy-MM-dd') +"~"+ o.format('yyyy-MM-dd')
  166. }
  167. },
  168. // 下一页 上一页
  169. handleCurrentChange:function(val) {
  170. var vm = this
  171. vm.currentPage = val
  172. this.watchPage()
  173. },
  174. handleCurrentChangeTwo:function() {
  175. var vm = this
  176. vm.currentPageTwo = val
  177. this.copdList()
  178. },
  179. // change:function(val) {
  180. // this.list = this.list.concat(val)
  181. // },
  182. // 查询
  183. confirm:function() {
  184. this.findCopdHealthInfoList()
  185. },
  186. // 恢复默认
  187. // cancel:function() {
  188. // this.startTime = new Date('2023','05','26')
  189. // this.endTime = new Date()
  190. // this.tertiary = []
  191. // this.communityHospitals = []
  192. // this.group = []
  193. // this.region = '8'
  194. // this.queryLevel = 1
  195. // },
  196. // 查看
  197. showInfo: function(item) {
  198. this.dialogVisible = true
  199. this.watchPageCode = item.code=='合计'?'':item.code
  200. this.watchPage()
  201. },
  202. // 弹框再次查看
  203. btn: function(item) {
  204. this.showPdf = true
  205. this.patient = item.patient
  206. this.copdListIndex = '1'
  207. this.copdList()
  208. },
  209. // 导出
  210. exportHandle:function() {
  211. var vm = this
  212. vm.loadingTwo = true
  213. statisticAPI.exportWatchStatisticsList({
  214. startDate:this.startTime.format('yyyy-MM-dd'),
  215. endDate:this.endTime.format('yyyy-MM-dd'),
  216. },'手表亚组数据.xls').then(function(res){
  217. vm.loadingTwo = false
  218. })
  219. },
  220. // 居民列表导出
  221. exportHandleList:function() {
  222. var vm = this
  223. vm.loadingTwo = true
  224. statisticAPI.exportWatchPage({
  225. startDate:this.startTime.format('yyyy-MM-dd'),
  226. endDate:this.endTime.format('yyyy-MM-dd'),
  227. area:vm.watchPageCode,
  228. },'手表亚组居民数据.xls').then(function(res){
  229. vm.loadingTwo = false
  230. })
  231. },
  232. // 居民体征导出
  233. exportcopdListData:function() {
  234. var vm = this
  235. vm.loadingTwo = true
  236. var name = vm.copdListIndex==1?'运动数据':vm.copdListIndex==2?'睡眠数据':vm.copdListIndex==3?'心率数据':vm.copdListIndex==4?'PAI数据':vm.copdListIndex==5?'血氧数据':'健康分数据'
  237. statisticAPI.exportWatchPage({
  238. patient:vm.patient,
  239. type:vm.copdListIndex,
  240. begin:this.startTime.format('yyyy-MM-dd'),
  241. end:this.endTime.format('yyyy-MM-dd'),
  242. },name+'.xls').then(function(res){
  243. vm.loadingTwo = false
  244. })
  245. },
  246. }
  247. })