index.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. var template = ''
  2. $.ajax('../../../component/statistics/GxbManage/index.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('gxb-manage', {
  14. template: template,
  15. props: [],
  16. data: function () {
  17. return {
  18. years: [],
  19. yearType: '1',
  20. chooseYear: null,
  21. chooseTime: null,
  22. dialogExportLoading: false,
  23. rangeOptions: [
  24. { label: '区', value: 'town' },
  25. { label: '社区', value: 'hospital' },
  26. { label: '团队', value: 'team' }
  27. ],
  28. areaOptions: [
  29. { label: '思明区', value: '350203' },
  30. { label: '海沧区', value: '350205' },
  31. { label: '湖里区', value: '350206' },
  32. { label: '集美区', value: '350211' },
  33. { label: '同安区', value: '350212' },
  34. { label: '翔安区', value: '350213' }
  35. ],
  36. hospitalOptions: [],
  37. teamOptions: [],
  38. form: {
  39. range: 'town'
  40. },
  41. loading: false,
  42. exportLoading: false,
  43. tableData: [],
  44. constantHeader: [
  45. { label: '已评估人数', prop: 'totalNum', width: '90' },
  46. { label: '已上转人数', prop: 'turnUpNum', width: '90' },
  47. { label: '上转转门诊', prop: 'mzNum', width: '110' },
  48. { label: '门诊转住院', prop: 'zyNum', width: '110' },
  49. { label: '下转管理人数', prop: 'turnDownNum', width: '110' },
  50. { label: '评估已登记随访', prop: 'followUpNum', width: '110' }
  51. // { label: '随访已达标', prop: 'standardNum', width: '110' }
  52. ],
  53. tableHeader: [],
  54. loadingTwo: false,
  55. mzTableHeader: [
  56. { label: '姓名', prop: 'name', width: '90' },
  57. { label: '性别', prop: 'sex', width: '90' },
  58. { label: '年龄', prop: 'age', width: '90' },
  59. { label: '手机号', prop: 'mobile', width: '90' },
  60. { label: '证件号码', prop: 'idcard', width: '90' },
  61. { label: '社区医院', prop: 'signHospitalName', width: '90' },
  62. { label: '签约医生', prop: 'signDoctorName', width: '90' },
  63. { label: '最近一次上传时间', prop: 'czrq', width: '90' },
  64. { label: '最近一次上转科室', prop: 'deptName', width: '90' },
  65. { label: '最近一次门诊下转时间', prop: 'createTime', width: '90' },
  66. { label: '最近一次门诊下转诊断', prop: 'diagnosisName', width: '90' }
  67. ],
  68. turnDownTableHeader: [
  69. { label: '姓名', prop: 'name', width: '90' },
  70. { label: '性别', prop: 'sex', width: '90' },
  71. { label: '年龄', prop: 'age', width: '90' },
  72. { label: '手机号', prop: 'mobile', width: '90' },
  73. { label: '最近一次下转医院', prop: 'hospitalName', width: '90' },
  74. { label: '最近一次下转医生', prop: 'hospitalDoctor', width: '90' },
  75. { label: '最近一次下转时间', prop: 'zyCreateTime', width: '90' },
  76. { label: '出院下转次数', prop: 'turnDownTimes', width: '90' },
  77. { label: '康复计划数量', prop: 'rehabilitationTimes', width: '90' }
  78. ],
  79. totalNumTableHeader: [
  80. { label: '姓名', prop: 'name' },
  81. { label: '性别', prop: 'sex' },
  82. { label: '年龄', prop: 'age' },
  83. { label: '评估结果', prop: 'screenResult' },
  84. { label: '评估医生', prop: 'doctorName' },
  85. { label: '评估时间', prop: 'czrq' },
  86. { label: '手机号', prop: 'mobile' },
  87. { label: '证件号码', prop: 'idcard' },
  88. { label: '签约社区', prop: 'signHospitalName' },
  89. { label: '签约医生', prop: 'signDoctorName' }
  90. ],
  91. turnUpNumTableHeader: [
  92. { label: '姓名', prop: 'name' },
  93. { label: '性别', prop: 'sex' },
  94. { label: '年龄', prop: 'age' },
  95. { label: '社区医院', prop: 'signHospitalName' },
  96. { label: '签约医生', prop: 'signDoctorName' },
  97. { label: '手机号', prop: 'mobile' },
  98. { label: '证件号码', prop: 'idcard' },
  99. { label: '预约医院', prop: 'orgName' },
  100. { label: '预约医生', prop: 'dName' },
  101. { label: '预约科室', prop: 'deptName' },
  102. { label: '预约时间', prop: 'orderTime' },
  103. { label: '数据来源', prop: 'sourceType' }
  104. ],
  105. dialogTableHeader: [],
  106. page: 1,
  107. size: 10,
  108. total: 0,
  109. level: 0,
  110. mzDialogVisible: false,
  111. query: {
  112. sex: ''
  113. },
  114. dataInfo: [],
  115. title: '',
  116. dataRangeOption: []
  117. }
  118. },
  119. methods: {
  120. gotoDetail(row, column) {
  121. var vm = this
  122. this.query = { sex: '' }
  123. switch (column) {
  124. case 'mzNum':
  125. vm.dialogTableHeader = vm.mzTableHeader
  126. this.title = '上转转门诊明细'
  127. break
  128. case 'zyNum':
  129. vm.dialogTableHeader = vm.mzTableHeader
  130. this.title = '门诊转住院明细'
  131. break
  132. case 'turnDownNum':
  133. vm.dialogTableHeader = vm.turnDownTableHeader
  134. this.title = '下转管理明细'
  135. break
  136. case 'totalNum':
  137. this.query = { sex: '', screenResultCode: '' }
  138. vm.dialogTableHeader = vm.totalNumTableHeader
  139. this.title = '个案数据列表'
  140. break
  141. case 'turnUpNum':
  142. vm.dialogTableHeader = vm.turnUpNumTableHeader
  143. this.title = '上转预约明细列表'
  144. break
  145. }
  146. var len = row.code.length
  147. if (len == 6) {
  148. this.query.range = 'town'
  149. this.query.area = row.code
  150. } else if (len == 10) {
  151. this.query.range = 'hospital'
  152. this.query.hospital = row.code
  153. } else {
  154. this.query.range = 'team'
  155. this.query.team = row.code
  156. }
  157. this.dataRangeOption = [{ label: row.name, value: row.code }]
  158. if (column == 'mzNum' || column == 'zyNum') {
  159. this.mzDialogVisible = true
  160. this.turnUpToMzDetailPage()
  161. } else if (column == 'turnDownNum') {
  162. this.mzDialogVisible = true
  163. this.turnDownManageDetailPage()
  164. } else if (column == 'totalNum') {
  165. this.mzDialogVisible = true
  166. this.gxbCaseDataPage()
  167. } else if (column == 'turnUpNum') {
  168. this.mzDialogVisible = true
  169. this.gxbTurnUpInfoPage()
  170. }
  171. },
  172. gxbTurnUpInfoPage() {
  173. var vm = this
  174. this.loadingTwo = true
  175. var params = JSON.parse(JSON.stringify(this.query))
  176. params.page = this.page
  177. params.pageSize = this.size
  178. if (this.yearType == '1') {
  179. params.startDate = this.chooseYear + '-01-01'
  180. params.endDate = this.chooseYear + '-12-31'
  181. } else {
  182. if (this.chooseTime) {
  183. params.startDate = this.chooseTime[0]
  184. params.endDate = this.chooseTime[1]
  185. }
  186. }
  187. httpRequest.get('statistics/collaborate/gxbTurnUpInfoPage', { data: params }).then(function (res) {
  188. if (res.status == 200) {
  189. vm.dataInfo = res.detailModelList
  190. vm.total = res.totalCount
  191. }
  192. vm.loadingTwo = false
  193. })
  194. },
  195. gxbCaseDataPage() {
  196. var vm = this
  197. this.loadingTwo = true
  198. var params = JSON.parse(JSON.stringify(this.query))
  199. params.page = this.page
  200. params.pageSize = this.size
  201. if (this.yearType == '1') {
  202. params.startDate = this.chooseYear + '-01-01'
  203. params.endDate = this.chooseYear + '-12-31'
  204. } else {
  205. if (this.chooseTime) {
  206. params.startDate = this.chooseTime[0]
  207. params.endDate = this.chooseTime[1]
  208. }
  209. }
  210. httpRequest.get('statistics/collaborate/gxbCaseDataPage', { data: params }).then(function (res) {
  211. if (res.status == 200) {
  212. vm.dataInfo = res.detailModelList
  213. vm.total = res.totalCount
  214. }
  215. vm.loadingTwo = false
  216. })
  217. },
  218. turnDownManageDetailPage() {
  219. var vm = this
  220. this.loadingTwo = true
  221. var url = ''
  222. var params = JSON.parse(JSON.stringify(this.query))
  223. params.page = this.page
  224. params.pageSize = this.size
  225. if (this.yearType == '1') {
  226. params.startDate = this.chooseYear + '-01-01'
  227. params.endDate = this.chooseYear + '-12-31'
  228. } else {
  229. if (this.chooseTime) {
  230. params.startDate = this.chooseTime[0]
  231. params.endDate = this.chooseTime[1]
  232. }
  233. }
  234. httpRequest.get('statistics/collaborate/turnDownManageDetailPage', { data: params }).then(function (res) {
  235. if (res.status == 200) {
  236. vm.dataInfo = res.detailModelList
  237. vm.total = res.totalCount
  238. }
  239. vm.loadingTwo = false
  240. })
  241. },
  242. turnUpToMzDetailPage() {
  243. var vm = this
  244. this.loadingTwo = true
  245. var params = JSON.parse(JSON.stringify(this.query))
  246. params.page = this.page
  247. params.pageSize = this.size
  248. if (this.yearType == '1') {
  249. params.startDate = this.chooseYear + '-01-01'
  250. params.endDate = this.chooseYear + '-12-31'
  251. } else {
  252. if (this.chooseTime) {
  253. params.startDate = this.chooseTime[0]
  254. params.endDate = this.chooseTime[1]
  255. }
  256. }
  257. httpRequest.get('statistics/collaborate/turnUpToMzDetailPage', { data: params }).then(function (res) {
  258. if (res.status == 200) {
  259. vm.dataInfo = res.detailModelList
  260. vm.total = res.totalCount
  261. }
  262. vm.loadingTwo = false
  263. })
  264. },
  265. closeDialog() {
  266. this.mzDialogVisible = false
  267. },
  268. dialogSearchFn() {
  269. this.page = 1
  270. if (this.title == '上转转门诊明细' || this.title == '门诊转住院明细') {
  271. this.turnUpToMzDetailPage()
  272. }
  273. },
  274. dialogExportFn() {
  275. this.dialogExportLoading = true
  276. var vm = this
  277. var params = {
  278. ...this.query
  279. }
  280. if (this.yearType == '1') {
  281. params.startDate = this.chooseYear + '-01-01'
  282. params.endDate = this.chooseYear + '-12-31'
  283. } else {
  284. if (this.chooseTime) {
  285. params.startDate = this.chooseTime[0]
  286. params.endDate = this.chooseTime[1]
  287. }
  288. }
  289. if (this.title == '上转转门诊明细') {
  290. var fileName = `上转转门诊明细${new Date().getTime()}.xls`
  291. httpRequest.downLoadFileForAjax('statistics/collaborate/exportTurnUpToMzDetailPage', fileName, params).then(function () {
  292. vm.dialogExportLoading = false
  293. })
  294. } else if (this.title == '门诊转住院明细') {
  295. var fileName = `门诊转住院明细${new Date().getTime()}.xls`
  296. httpRequest.downLoadFileForAjax('statistics/collaborate/exportMzToInHopistalDetailPage', fileName, params).then(function () {
  297. vm.dialogExportLoading = false
  298. })
  299. } else if (this.title == '个案数据列表') {
  300. var fileName = `个案数据列表${new Date().getTime()}.xls`
  301. httpRequest.downLoadFileForAjax('statistics/collaborate/exportGxbCaseDataPage', fileName, params).then(function () {
  302. vm.dialogExportLoading = false
  303. })
  304. } else if (this.title == '上转预约明细列表') {
  305. var fileName = `上转预约明细列表${new Date().getTime()}.xls`
  306. httpRequest.downLoadFileForAjax('statistics/collaborate/exportGxbTurnUpInfoPage', fileName, params).then(function () {
  307. vm.dialogExportLoading = false
  308. })
  309. }
  310. },
  311. dialogReset() {
  312. var params = {
  313. ...this.query
  314. }
  315. if (this.title == '个案数据列表') {
  316. this.query = {
  317. sex: '',
  318. screenResultCode: '',
  319. range: params.range,
  320. area: params.area,
  321. hospital: params.hospital,
  322. team: params.team
  323. }
  324. } else {
  325. this.query = {
  326. sex: '',
  327. range: params.range,
  328. area: params.area,
  329. hospital: params.hospital,
  330. team: params.team
  331. }
  332. }
  333. },
  334. init() {
  335. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  336. if (selectedRole.code.indexOf('350200') > -1) {
  337. this.level = 1 // 市卫健委
  338. this.areaOptions = [
  339. { label: '思明区', value: '350203' },
  340. { label: '海沧区', value: '350205' },
  341. { label: '湖里区', value: '350206' },
  342. { label: '集美区', value: '350211' },
  343. { label: '同安区', value: '350212' },
  344. { label: '翔安区', value: '350213' }
  345. ]
  346. } else if (selectedRole.code.length == 6) {
  347. this.level = 2 // 区管理
  348. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  349. this.form = {
  350. range: 'town',
  351. area: selectedRole.code
  352. }
  353. this.getHospital(selectedRole.code)
  354. } else {
  355. this.level = 3 // 社区管理
  356. this.rangeOptions = [
  357. { label: '社区', value: 'hospital' },
  358. { label: '团队', value: 'team' }
  359. ]
  360. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code.substring(0, 6) }]
  361. this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
  362. this.form = {
  363. range: 'hospital',
  364. area: selectedRole.code.substring(0, 6),
  365. hospital: selectedRole.code
  366. }
  367. this.getTeam(selectedRole.code)
  368. }
  369. this.initTime()
  370. this.getList()
  371. },
  372. initTime() {
  373. var vm = this
  374. var now = new Date()
  375. vm.nowyear = vm.chooseYear = now.getFullYear()
  376. vm.years = []
  377. for (i = vm.nowyear; i >= 2013; i--) {
  378. vm.years.push(i)
  379. }
  380. },
  381. resetArea() {
  382. if (this.level == 1) {
  383. delete this.form.area
  384. delete this.form.hospital
  385. delete this.form.team
  386. } else if (this.level == 2) {
  387. delete this.form.hospital
  388. delete this.form.team
  389. } else {
  390. delete this.form.team
  391. }
  392. },
  393. load(row, treeNode, resolve) {
  394. var params = {}
  395. var len = row.code.length
  396. if (len == 6) {
  397. params.range = 'hospital'
  398. params.area = row.code
  399. } else if (len == 10) {
  400. params.range = 'team'
  401. params.hospital = row.code
  402. }
  403. if (this.yearType == '1') {
  404. params.startDate = this.chooseYear + '-01-01'
  405. params.endDate = this.chooseYear + '-12-31'
  406. } else {
  407. if (this.chooseTime) {
  408. params.startDate = this.chooseTime[0]
  409. params.endDate = this.chooseTime[1]
  410. }
  411. }
  412. httpRequest.get('statistics/collaborate/gxbScreenClosedLoop', { data: params }).then(function (res) {
  413. if (res.status == 200) {
  414. var children = res.detailModelList.map(function (item) {
  415. var data = JSON.parse(JSON.stringify(item))
  416. if (len == 6) {
  417. data.areaCode = row.code
  418. data.hospital = item.name
  419. data.hasChildren = true
  420. } else if (len == 10) {
  421. data.hospitalCode = row.code
  422. data.team = item.name
  423. }
  424. return data
  425. })
  426. resolve(children)
  427. }
  428. })
  429. },
  430. getList() {
  431. var vm = this
  432. this.loading = true
  433. var params = {
  434. ...this.form
  435. }
  436. if (this.yearType == '1') {
  437. params.startDate = this.chooseYear + '-01-01'
  438. params.endDate = this.chooseYear + '-12-31'
  439. } else {
  440. if (this.chooseTime) {
  441. params.startDate = this.chooseTime[0]
  442. params.endDate = this.chooseTime[1]
  443. }
  444. }
  445. if (this.form.range == 'town') {
  446. this.tableHeader = getTownHeader().concat(this.constantHeader)
  447. } else if (this.form.range == 'hospital') {
  448. this.tableHeader = getHospitalHeader().concat(this.constantHeader)
  449. } else {
  450. this.tableHeader = getTeamHeader().concat(this.constantHeader)
  451. }
  452. httpRequest.get('statistics/collaborate/gxbScreenClosedLoop', { data: params }).then(function (res) {
  453. vm.tableData = res.detailModelList.map(function (item) {
  454. var data = JSON.parse(JSON.stringify(item))
  455. if (vm.form.range == 'town') {
  456. data.town = item.name
  457. data.hasChildren = true
  458. } else if (vm.form.range == 'hospital') {
  459. data.hospital = item.name
  460. data.hasChildren = true
  461. } else if (vm.form.range == 'team') {
  462. data.team = item.name
  463. }
  464. return data
  465. })
  466. console.log('1111111111111111', vm.tableData)
  467. vm.loading = false
  468. })
  469. },
  470. queryDate() {
  471. this.page = 1
  472. this.getList()
  473. },
  474. exportTable() {
  475. var vm = this
  476. var params = {
  477. ...this.form
  478. }
  479. if (this.yearType == '1') {
  480. params.startDate = this.chooseYear + '-01-01'
  481. params.endDate = this.chooseYear + '-12-31'
  482. } else {
  483. if (this.chooseTime) {
  484. params.startDate = this.chooseTime[0]
  485. params.endDate = this.chooseTime[1]
  486. }
  487. }
  488. this.exportLoading = true
  489. var fileName = `冠心病管理全流程闭环情况${new Date().getTime()}.xls`
  490. httpRequest.downLoadFileForAjax('statistics/collaborate/exportGxbScreenClosedLoop', fileName, params).then(function () {
  491. vm.exportLoading = false
  492. })
  493. },
  494. eliminateClick() {
  495. this.resetArea()
  496. this.yearType = '1'
  497. this.chooseYear = new Date().getFullYear()
  498. this.chooseTime = null
  499. this.$forceUpdate()
  500. },
  501. getHospital(code) {
  502. var vm = this
  503. delete this.form.hospital
  504. delete this.form.team
  505. var params = {
  506. type: 5,
  507. code: code
  508. }
  509. httpRequest.post('common/district', { data: params }).then(function (res) {
  510. vm.hospitalOptions = [{ code: '', name: '全部' }]
  511. vm.hospitalOptions = vm.hospitalOptions.concat(res.list)
  512. })
  513. },
  514. getTeam(code) {
  515. var vm = this
  516. delete this.form.team
  517. var params = {
  518. hospital: code,
  519. area: this.form.area
  520. }
  521. httpRequest.get('statisticsExport/teamList', { data: params }).then(function (res) {
  522. vm.teamOptions = [{ id: '', name: '全部' }]
  523. vm.teamOptions = vm.teamOptions.concat(res.data)
  524. })
  525. },
  526. handleCurrentChange(val) {
  527. this.page = val
  528. this.getList()
  529. },
  530. handleSizeChange(val) {
  531. this.size = val
  532. this.getList()
  533. },
  534. renderHeader: function (h, item) {
  535. var index = item.$index
  536. var column = item.column
  537. var content = {
  538. 3: '已上转人数',
  539. 4: '上转转门诊',
  540. 5: '门诊转住院',
  541. 6: '下转管理人数',
  542. 7: '评估已门诊下转',
  543. 8: '评估已出院下转'
  544. }
  545. var tooltip = {
  546. 3: '统计查询时间内,已筛查的患者中,预约了专科医院的患者人数',
  547. 4: '统计查询时间内,已上转的患者中,到院就诊的患者人数',
  548. 5: '统计查询时间内,已上转的患者中,到院就诊的患者人数',
  549. 6: '统计查询时间内,筛查时间在下转时间前的患者人数',
  550. 7: '统计查询时间内,筛查时间在门诊下转时间前的患者人数',
  551. 8: '统计查询时间内,筛查时间在出院下转时间前的患者人数'
  552. }
  553. if ([3, 4, 5, 6, 7, 8].indexOf(index) > -1) {
  554. return [
  555. content[index],
  556. h(
  557. 'el-tooltip',
  558. {
  559. props: {
  560. content: (function () {
  561. return tooltip[index]
  562. })(),
  563. placement: 'top'
  564. }
  565. },
  566. [
  567. h('span', {
  568. class: {
  569. 'el-icon-question': true
  570. }
  571. })
  572. ]
  573. )
  574. ]
  575. } else {
  576. return [column.label]
  577. }
  578. }
  579. },
  580. mounted() {
  581. this.init()
  582. }
  583. })