mzfHxsj.js 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. var template = ''
  2. $.ajax('../html/mzfHxsj.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-hxsj', {
  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. patientName: '', // 患者姓名
  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. loadingTwo:false,
  58. setDisabled:{
  59. disabledDate:function(time) {
  60. return time.getTime() < new Date('2023','05','26') || time.getTime() > Date.now();
  61. }
  62. },
  63. s:'',
  64. e:'',
  65. dialogVisible: false,
  66. dataInfo: [],
  67. url: '',
  68. showPdf: false
  69. }
  70. },
  71. created: function(){
  72. this.s = this.startTime.format('yyyy-MM-dd')
  73. this.e = this.endTime.format('yyyy-MM-dd')
  74. this.list.unshift({type:'0',id:'time',label:this.s +"~"+ this.e})
  75. this.findCopdHealthInfoList(1, 1 , '350200')
  76. this.cascadingFindHosptail(1, '')
  77. },
  78. watch:{
  79. 'startTime':{
  80. handler:function(o) {
  81. if(!o) {
  82. this.list.splice(0,1)
  83. }
  84. },
  85. deep: true,
  86. immediate: true
  87. },
  88. 'endTime':{
  89. handler:function(o) {
  90. if(!o) {
  91. this.list.splice(0,1)
  92. }
  93. },
  94. deep: true,
  95. immediate: true
  96. },
  97. },
  98. methods: {
  99. // 获取地区
  100. cascadingFindHosptail: function(type, val, hos) {
  101. var vm = this
  102. var data = {
  103. findType: type ? type: 1,
  104. areaCode: val.length!=0 ? val.join(',') : '',
  105. hosptialCode: hos ? hos.join(',') : ''
  106. }
  107. statisticAPI.cascadingFindHosptail({
  108. jsonStr: JSON.stringify(data)
  109. }).then(function(res){
  110. if(res.status===200) {
  111. console.log(res, 'dq');
  112. if(type == 2) {
  113. vm.communityHospitalsData = res.data
  114. } else if(type == 3) {
  115. vm.groupingData = res.data
  116. }
  117. else {
  118. vm.tertiaryHospitalsData = res.data
  119. }
  120. }
  121. })
  122. },
  123. tertiaryChange: function(val) {
  124. if(val.length == 0) {
  125. this.communityHospitals = []
  126. this.communityHospitalsData = []
  127. this.group = []
  128. this.groupingData = []
  129. }else {
  130. this.queryLevel = 2
  131. this.cascadingFindHosptail(2, val)
  132. }
  133. },
  134. comChange: function (val) {
  135. var vm = this
  136. if(val.length == 0) {
  137. vm.groupingData = []
  138. vm.group = []
  139. }else {
  140. vm.queryLevel = 3
  141. vm.cascadingFindHosptail(3, vm.tertiary , val)
  142. }
  143. },
  144. groChange: function() {
  145. var vm = this
  146. vm.queryLevel = 4
  147. },
  148. // 清除
  149. clearGroup: function() {
  150. if(this.group.length == 0) {
  151. this.queryLevel = 3
  152. }
  153. },
  154. clearCommunityHospitals:function(val) {
  155. if(this.communityHospitals.length == 0) {
  156. this.queryLevel = 2
  157. this.groupingData = []
  158. }
  159. },
  160. clearTertiary: function() {
  161. if(this.tertiary.length == 0) {
  162. this.queryLevel = 1
  163. }
  164. },
  165. findCopdHealthInfoList:function (page, queryLevel, code) {
  166. var vm = this
  167. vm.loadingTwo = true
  168. var data = {
  169. startTime:this.startTime.format('yyyy-MM-dd'),
  170. endTime:this.endTime.format('yyyy-MM-dd'),
  171. stageType: 2,
  172. findType: 5,
  173. copdState: vm.region,
  174. page: page,
  175. size: 10,
  176. searchKey: vm.patientName,
  177. queryLevel: queryLevel,
  178. queryCode: code,
  179. pageIf: "true"
  180. }
  181. statisticAPI.findCopdHealthInfoList({
  182. jsonStr:JSON.stringify(data)
  183. }).then(function(res){
  184. if(res.status == 200) {
  185. console.log(res,'hxsj');
  186. vm.loadingTwo = false
  187. vm.tableData = res.data.list
  188. vm.datatotal = res.data.count
  189. }
  190. }).catch(function(err){
  191. vm.loadingTwo = false
  192. })
  193. },
  194. startTimeChange:function(o) {
  195. if(!this.list[0] || this.list[0].type!=0) {
  196. this.list.unshift({type:'0',id:'time',label:o.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd')})
  197. }else{
  198. this.list[0].label = o.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd')
  199. }
  200. },
  201. endTimeChange:function(o) {
  202. if(!this.list[0] || this.list[0].type!=0) {
  203. this.list.unshift({type:'0',id:'time',label:this.startTime.format('yyyy-MM-dd') +"~"+ o.format('yyyy-MM-dd')})
  204. }else{
  205. this.list[0].label = this.startTime.format('yyyy-MM-dd') +"~"+ o.format('yyyy-MM-dd')
  206. }
  207. },
  208. deleteClick:function(item) {
  209. if(item.id == "time") {
  210. this.startTime = ''
  211. this.endTime = ''
  212. this.list.splice(0,1)
  213. }
  214. var index = this.list.findIndex(function(v){
  215. return item.id == v.id
  216. })
  217. this.list.splice(index,1)
  218. },
  219. // 下一页 上一页
  220. handleCurrentChange:function(val) {
  221. var vm = this
  222. vm.currentPage = val
  223. if(this.queryLevel == 1) {
  224. this.findCopdHealthInfoList(val, 1 , '350200')
  225. } else if(this.queryLevel == 2) {
  226. // 地区
  227. var areaCode = this.tertiary.join(',')
  228. this.findCopdHealthInfoList(val, this.queryLevel, areaCode)
  229. }else if(this.queryLevel == 3) {
  230. // 三级医院
  231. var areaCode = this.communityHospitals.join(',')
  232. this.findCopdHealthInfoList(val, this.queryLevel, areaCode)
  233. }else if(this.queryLevel == 4) {
  234. // 社区
  235. var areaCode = this.group.join(',')
  236. this.findCopdHealthInfoList(val, this.queryLevel, areaCode)
  237. }
  238. },
  239. change:function(val) {
  240. this.list = this.list.concat(val)
  241. },
  242. // 确定
  243. confirm:function() {
  244. // 全部 , 也是默认
  245. if(this.queryLevel == 1) {
  246. this.findCopdHealthInfoList(1, 1 , '350200')
  247. } else if(this.queryLevel == 2) {
  248. // 地区
  249. var areaCode = this.tertiary.join(',')
  250. this.findCopdHealthInfoList(1, this.queryLevel, areaCode)
  251. }else if(this.queryLevel == 3) {
  252. // 三级医院
  253. var areaCode = this.communityHospitals.join(',')
  254. this.findCopdHealthInfoList(1, this.queryLevel, areaCode)
  255. }else if(this.queryLevel == 4) {
  256. // 社区
  257. var areaCode = this.group.join(',')
  258. this.findCopdHealthInfoList(1, this.queryLevel, areaCode)
  259. }
  260. },
  261. // 取消
  262. cancel:function() {
  263. this.startTime = new Date('2023','05','26')
  264. this.endTime = new Date()
  265. this.tertiary = []
  266. this.communityHospitals = []
  267. this.group = []
  268. this.patientName = ''
  269. this.region = '8'
  270. this.queryLevel = 1
  271. },
  272. // 查看
  273. showInfo: function(item) {
  274. var vm = this
  275. vm.dialogVisible = true
  276. var data = {
  277. patientCode: item.patientCode
  278. }
  279. statisticAPI.findCopdHealthInfoByCode({
  280. jsonStr:JSON.stringify(data)
  281. }).then(function(res){
  282. if(res.status == 200) {
  283. vm.dataInfo = res.data
  284. }
  285. })
  286. },
  287. btn: function(item) {
  288. this.showPdf = true
  289. this.url = item.url
  290. },
  291. // 导出
  292. exportHandle:function() {
  293. // 全部 , 也是默认
  294. if(this.queryLevel == 1) {
  295. this.exoprtCopdHealthInfoList(1, 1 , '')
  296. } else if(this.queryLevel == 2) {
  297. // 地区
  298. var areaCode = this.tertiary.join(',')
  299. this.exoprtCopdHealthInfoList(1, this.queryLevel, areaCode)
  300. }else if(this.queryLevel == 3) {
  301. // 三级医院
  302. var areaCode = this.communityHospitals.join(',')
  303. this.exoprtCopdHealthInfoList(1, this.queryLevel, areaCode)
  304. }else if(this.queryLevel == 4) {
  305. // 社区
  306. var areaCode = this.group.join(',')
  307. this.exoprtCopdHealthInfoList(1, this.queryLevel, areaCode)
  308. }
  309. },
  310. exoprtCopdHealthInfoList: function(page, queryLevel, code) {
  311. var vm = this
  312. vm.loadingTwo = true
  313. var data = {
  314. startTime:this.startTime.format('yyyy-MM-dd'),
  315. endTime:this.endTime.format('yyyy-MM-dd'),
  316. stageType: 2,
  317. findType: 5,
  318. copdState: vm.region,
  319. page: page,
  320. size: 10,
  321. searchKey: vm.patientName,
  322. queryLevel: queryLevel,
  323. queryCode: code,
  324. pageIf: ""
  325. }
  326. var jsonStr = JSON.stringify(data)
  327. statisticAPI.exoprtCopdHealthInfoList({
  328. jsonStr: encodeURIComponent(jsonStr)
  329. },'阻肺呼吸训练数据.xls').then(function(res){
  330. vm.loadingTwo = false
  331. })
  332. }
  333. }
  334. })