mzfHzcx.js 9.4 KB

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