mzfHzcx.js 11 KB

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