1.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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. stageType: '0,1,2,10,20',// 阶段
  46. // 0:慢阻肺测试患者 1:第一阶段 2:第二阶段 10:测试账号 20:其他' 全部 0,1,2,10,20
  47. stageData: [
  48. {label:'全部',value:'0,1,2,10,20'},
  49. {label:'慢阻肺测试患者',value:'0'},
  50. {label:'第二阶段 ',value:'1'},
  51. {label:'测试账号',value:'10'},
  52. {label:'其他',value:'20'},
  53. ],
  54. queryLevel: 1, // :1.全部 2.区 3.等级医院 4.社区医院
  55. patientName: '', // 患者姓名
  56. administrationStatusList:[],
  57. administrationStatusData:[
  58. {label:'全部',id:'1',type:'5'}
  59. ],
  60. show:false,
  61. showTwo:false,
  62. showThree:false,
  63. currentPage:1,
  64. currentSize:10,
  65. datatotal:0, //总数
  66. loadingTwo:false,
  67. setDisabled:{
  68. disabledDate:function(time) {
  69. return time.getTime() < new Date('2023','05','26') || time.getTime() > Date.now();
  70. }
  71. },
  72. s:'',
  73. e:'',
  74. dialogVisible: false,
  75. dataInfo: [],
  76. dialogVisible1: false,
  77. dataJl: []
  78. }
  79. },
  80. created: function(){
  81. this.s = this.startTime.format('yyyy-MM-dd')
  82. this.e = this.endTime.format('yyyy-MM-dd')
  83. this.list.unshift({type:'0',id:'time',label:this.s +"~"+ this.e})
  84. this.getCopdPatientInfoList(1, 1, '350200')
  85. this.cascadingFindHosptail(1, '')
  86. },
  87. watch:{
  88. 'startTime':{
  89. handler:function(o) {
  90. if(!o) {
  91. this.list.splice(0,1)
  92. }
  93. },
  94. deep: true,
  95. immediate: true
  96. },
  97. 'endTime':{
  98. handler:function(o) {
  99. if(!o) {
  100. this.list.splice(0,1)
  101. }
  102. },
  103. deep: true,
  104. immediate: true
  105. },
  106. },
  107. methods: {
  108. // 获取地区
  109. cascadingFindHosptail: function(type, val, hos) {
  110. var vm = this
  111. var data = {
  112. findType: type ? type: 1,
  113. areaCode: val.length!=0 ? val.join(',') : '',
  114. hosptialCode: hos ? hos.join(',') : ''
  115. }
  116. statisticAPI.cascadingFindHosptail({
  117. jsonStr: JSON.stringify(data)
  118. }).then(function(res){
  119. if(res.status===200) {
  120. console.log(res, 'dq');
  121. if(type == 2) {
  122. vm.communityHospitalsData = res.data
  123. } else if(type == 3) {
  124. vm.groupingData = res.data
  125. }
  126. else {
  127. vm.tertiaryHospitalsData = res.data
  128. }
  129. }
  130. })
  131. },
  132. tertiaryChange: function(val) {
  133. console.log(val, 'xz');
  134. var vm = this
  135. vm.queryLevel = 2
  136. vm.cascadingFindHosptail(2, val)
  137. },
  138. comChange: function (val) {
  139. console.log(val, 'xz');
  140. var vm = this
  141. vm.queryLevel = 3
  142. vm.cascadingFindHosptail(3, vm.tertiary , val)
  143. },
  144. groChange() {
  145. var vm = this
  146. vm.queryLevel = 4
  147. },
  148. getCopdPatientInfoList:function (page, queryLevel, code) {
  149. var vm = this
  150. vm.loadingTwo = true
  151. var data = {
  152. startTime:this.startTime.format('yyyy-MM-dd'),
  153. endTime:this.endTime.format('yyyy-MM-dd'),
  154. stageType: vm.stageType,
  155. findType: 2,
  156. copdState: vm.region,
  157. page: page,
  158. size: 10,
  159. searchKey: vm.patientName,
  160. queryLevel: queryLevel,
  161. queryCode: code,
  162. hosptialCode: '', // 医院code
  163. pageIf: "true"
  164. }
  165. statisticAPI.getCopdPatientInfoList({
  166. json:JSON.stringify(data)
  167. }).then(function(res){
  168. if(res.status == 200) {
  169. console.log(res,'hc');
  170. vm.loadingTwo = false
  171. vm.tableData = res.data.list
  172. vm.datatotal = res.data.count
  173. }
  174. }).catch(function(err){
  175. vm.loadingTwo = false
  176. })
  177. },
  178. startTimeChange:function(o) {
  179. if(!this.list[0] || this.list[0].type!=0) {
  180. this.list.unshift({type:'0',id:'time',label:o.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd')})
  181. }else{
  182. this.list[0].label = o.format('yyyy-MM-dd') +"~"+ this.endTime.format('yyyy-MM-dd')
  183. }
  184. },
  185. endTimeChange:function(o) {
  186. if(!this.list[0] || this.list[0].type!=0) {
  187. this.list.unshift({type:'0',id:'time',label:this.startTime.format('yyyy-MM-dd') +"~"+ o.format('yyyy-MM-dd')})
  188. }else{
  189. this.list[0].label = this.startTime.format('yyyy-MM-dd') +"~"+ o.format('yyyy-MM-dd')
  190. }
  191. },
  192. deleteClick:function(item) {
  193. if(item.id == "time") {
  194. this.startTime = ''
  195. this.endTime = ''
  196. this.list.splice(0,1)
  197. }
  198. var index = this.list.findIndex(function(v){
  199. return item.id == v.id
  200. })
  201. this.list.splice(index,1)
  202. },
  203. // 下一页 上一页
  204. handleCurrentChange:function(val) {
  205. var vm = this
  206. vm.currentPage = val
  207. vm.getCopdPatientInfoList(val)
  208. },
  209. change:function(val) {
  210. this.list = this.list.concat(val)
  211. },
  212. // 确定
  213. confirm:function() {
  214. // 全部 , 也是默认
  215. if(this.queryLevel == 1) {
  216. this.findCopdHealthInfoList(1, 1 , '')
  217. } else if(this.queryLevel == 2) {
  218. // 地区
  219. var areaCode = this.tertiary.join(',')
  220. this.findCopdHealthInfoList('', this.queryLevel, areaCode)
  221. }else if(this.queryLevel == 3) {
  222. // 三级医院
  223. var areaCode = this.communityHospitals.join(',')
  224. this.findCopdHealthInfoList('', this.queryLevel, areaCode)
  225. }else if(this.queryLevel == 4) {
  226. // 社区
  227. var areaCode = this.group.join(',')
  228. this.findCopdHealthInfoList('', this.queryLevel, areaCode)
  229. }
  230. },
  231. // 取消
  232. cancel:function() {
  233. this.startTime = new Date('2023','05','26')
  234. this.endTime = new Date()
  235. this.tertiary = '',
  236. this.communityHospitals = ''
  237. this.group = ''
  238. this.queryLevel = 1
  239. },
  240. // 查看
  241. showInfo: function(item) {
  242. var vm = this
  243. vm.dialogVisible = true
  244. // patientCode
  245. var data = {
  246. patientCode: item.patientCode
  247. }
  248. statisticAPI.findCopdHealthInfoByCode({
  249. jsonStr:JSON.stringify(data)
  250. }).then(function(res){
  251. if(res.status == 200) {
  252. console.log(res,'info');
  253. }
  254. })
  255. },
  256. // 记录
  257. showJl: function() {
  258. var vm = this
  259. vm.dialogVisible1 = true
  260. // patientCode
  261. var data = {
  262. patientCode: item.patientCode
  263. }
  264. statisticAPI.findCopdHealthInfoByCode({
  265. jsonStr:JSON.stringify(data)
  266. }).then(function(res){
  267. if(res.status == 200) {
  268. console.log(res,'info');
  269. }
  270. })
  271. },
  272. // 导出
  273. exportHandle:function() {
  274. var vm = this
  275. vm.loadingTwo = true
  276. statisticAPI.exportHospitalWorkStatistics({
  277. startDate:this.startTime.format('yyyy-MM-dd'),
  278. endDate:this.endTime.format('yyyy-MM-dd')
  279. },'慢阻肺入组进度表.xls').then(function(res){
  280. vm.loadingTwo = false
  281. })
  282. },
  283. }
  284. })