index.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. var template = ''
  2. $.ajax('../../../component/statistics/LascProgress/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('lasc-progress', {
  14. template: template,
  15. props: [],
  16. data: function () {
  17. return {
  18. years: [],
  19. yearType: '1',
  20. chooseYear: null,
  21. chooseTime: null,
  22. rangeOptions: [
  23. { label: '区', value: 'town' },
  24. { label: '社区', value: 'hospital' },
  25. { label: '团队', value: 'team' }
  26. ],
  27. areaOptions: [
  28. { label: '思明区', value: '350203' },
  29. { label: '海沧区', value: '350205' },
  30. { label: '湖里区', value: '350206' },
  31. { label: '集美区', value: '350211' },
  32. { label: '同安区', value: '350212' },
  33. { label: '翔安区', value: '350213' }
  34. ],
  35. hospitalOptions: [],
  36. teamOptions: [],
  37. form: {
  38. range: 'town'
  39. },
  40. loading: false,
  41. exportLoading: false,
  42. tableData: [],
  43. tableHeader: [
  44. { label: '机构', prop: 'name' },
  45. { label: '筛查总人数', prop: 'sex' },
  46. { label: '待评估人数', prop: 'age' },
  47. { label: '已评估人数', prop: 'mobile' },
  48. { label: '已评估且管理人数', prop: 'hospitalName' },
  49. { label: '宫颈待完善乳腺待完善人数', prop: 'hospitalDoctor' },
  50. { label: '宫颈待完善乳腺完成筛查人数', prop: 'createTime' },
  51. { label: '宫颈完成筛查乳腺待完善人数', prop: 'patientType' }
  52. ],
  53. level: 0,
  54. visible: false,
  55. query: {},
  56. page: 1,
  57. size: 10,
  58. total: 0,
  59. messageVisible: false,
  60. messInfo: null,
  61. remind: '',
  62. dialogLoading: false,
  63. dialogExportLoading: false,
  64. statusOptions: [],
  65. rehabilitationHospital: [],
  66. archiveList: [],
  67. inviteStatus: [
  68. { value: '', label: '全部' },
  69. { value: '1', label: '门诊患者' },
  70. { value: '2', label: '出院患者' }
  71. ],
  72. communityHospitals: [],
  73. title: '',
  74. dialogVisible: false,
  75. signatoryList: []
  76. }
  77. },
  78. methods: {
  79. init() {
  80. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  81. if (selectedRole.code.indexOf('350200') > -1) {
  82. this.level = 1 // 市卫健委
  83. this.areaOptions = [
  84. { label: '厦门市', value: '' },
  85. { label: '思明区', value: '350203' },
  86. { label: '海沧区', value: '350205' },
  87. { label: '湖里区', value: '350206' },
  88. { label: '集美区', value: '350211' },
  89. { label: '同安区', value: '350212' },
  90. { label: '翔安区', value: '350213' }
  91. ]
  92. } else if (selectedRole.code.length == 6) {
  93. this.level = 2 // 区管理
  94. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  95. this.form = {
  96. range: 'town',
  97. area: selectedRole.code
  98. }
  99. this.getHospital(selectedRole.code)
  100. } else {
  101. this.level = 3 // 社区管理
  102. this.rangeOptions = [
  103. { label: '社区', value: 'hospital' },
  104. { label: '团队', value: 'team' }
  105. ]
  106. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  107. this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
  108. this.form = {
  109. range: 'hospital',
  110. area: selectedRole.code.substring(0, 6),
  111. hospital: selectedRole.code
  112. }
  113. this.getTeam(selectedRole.code)
  114. }
  115. this.initTime()
  116. this.searchFn()
  117. this.getDictData()
  118. this.hospitalsByType()
  119. },
  120. initTime() {
  121. var vm = this
  122. var now = new Date()
  123. vm.nowyear = vm.chooseYear = now.getFullYear()
  124. vm.years = []
  125. for (i = vm.nowyear; i >= 2013; i--) {
  126. vm.years.push(i)
  127. }
  128. },
  129. resetArea() {
  130. if (this.level == 1) {
  131. delete this.form.area
  132. delete this.form.hospital
  133. delete this.form.team
  134. } else if (this.level == 2) {
  135. delete this.form.hospital
  136. delete this.form.team
  137. } else {
  138. delete this.form.team
  139. }
  140. },
  141. getDictData() {
  142. var vm = this
  143. statisticAPI.getDictByDictName({ name: 'rehabilitation_status' }).then(function (res) {
  144. vm.statusOptions = [{ value: '全部', code: '' }]
  145. vm.statusOptions = vm.statusOptions.concat(res.list)
  146. })
  147. statisticAPI.getDictByDictName({ name: 'rehabilitation_hospital' }).then(function (res) {
  148. vm.rehabilitationHospital = [{ value: '全部', code: '' }]
  149. vm.rehabilitationHospital = vm.rehabilitationHospital.concat(res.list)
  150. })
  151. statisticAPI.getDictByDictName({ name: 'archive_status' }).then(function (res) {
  152. vm.archiveList = [{ value: '全部', code: '' }]
  153. vm.archiveList = vm.archiveList.concat(res.list)
  154. })
  155. },
  156. searchFn() {
  157. var vm = this
  158. this.loading = true
  159. var params = {
  160. ...this.form,
  161. isTotal: 1
  162. }
  163. vm.tableData = []
  164. if (this.yearType == '1') {
  165. params.startDate = this.chooseYear + '-01-01'
  166. params.endDate = this.chooseYear + '-12-31'
  167. } else {
  168. if (this.chooseTime) {
  169. params.startDate = this.chooseTime[0]
  170. params.endDate = this.chooseTime[1]
  171. }
  172. }
  173. if (this.form.range == 'town') {
  174. this.tableHeader = getTownHeader().concat(this.constantHeader)
  175. } else if (this.form.range == 'hospital') {
  176. this.tableHeader = getHospitalHeader().concat(this.constantHeader)
  177. } else {
  178. this.tableHeader = getTeamHeader().concat(this.constantHeader)
  179. }
  180. httpRequest.get('statistics/collaborate/gxbTurnDownInfo', { data: params }).then(function (res) {
  181. if (res.status == 200) {
  182. vm.tableData = res.detailModelList.map(function (item) {
  183. var data = JSON.parse(JSON.stringify(item))
  184. if (vm.form.range == 'town') {
  185. data.town = item.name
  186. data.hasChildren = data.code && true
  187. } else if (vm.form.range == 'hospital') {
  188. data.hospital = item.name
  189. data.hasChildren = data.code && true
  190. } else if (vm.form.range == 'team') {
  191. data.team = item.name
  192. }
  193. return data
  194. })
  195. }
  196. vm.loading = false
  197. })
  198. },
  199. exportTable() {
  200. var vm = this
  201. var params = {
  202. ...this.form
  203. }
  204. if (this.yearType == '1') {
  205. params.startDate = this.chooseYear + '-01-01'
  206. params.endDate = this.chooseYear + '-12-31'
  207. } else {
  208. if (this.chooseTime) {
  209. params.startDate = this.chooseTime[0]
  210. params.endDate = this.chooseTime[1]
  211. }
  212. }
  213. this.exportLoading = true
  214. var fileName = `冠心病门诊下转统计表${new Date().getTime()}.xls`
  215. httpRequest.downLoadFileForAjax('statistics/collaborate/exportGxbTurnDownInfo', fileName, params).then(function () {
  216. vm.exportLoading = false
  217. })
  218. },
  219. eliminateClick() {
  220. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  221. if (this.level == 1) {
  222. this.form = {
  223. range: 'town'
  224. }
  225. } else if (this.level == 2) {
  226. this.form = {
  227. range: 'town',
  228. area: selectedRole.code
  229. }
  230. this.getHospital(selectedRole.code)
  231. } else {
  232. this.form = {
  233. range: 'hospital',
  234. area: selectedRole.code.substring(0, 6),
  235. hospital: selectedRole.code
  236. }
  237. this.getTeam(selectedRole.code)
  238. }
  239. this.yearType = '1'
  240. this.chooseYear = new Date().getFullYear()
  241. this.chooseTime = null
  242. this.$forceUpdate()
  243. },
  244. getHospital(code, flag = true) {
  245. var vm = this
  246. if (flag) {
  247. delete this.form.hospital
  248. delete this.form.team
  249. }
  250. var params = {
  251. type: 5,
  252. code: code
  253. }
  254. if (!code) {
  255. vm.hospitalOptions = [{ name: '全部', value: '' }]
  256. vm.teamOptions = [{ name: '全部', value: '' }]
  257. return false
  258. }
  259. httpRequest.post('common/district', { data: params }).then(function (res) {
  260. vm.hospitalOptions = res.list
  261. })
  262. },
  263. getTeam(code, flag = true) {
  264. var vm = this
  265. if (flag) {
  266. delete this.form.team
  267. }
  268. var params = {
  269. hospital: code
  270. }
  271. httpRequest.get('statisticsExport/teamList', { data: params }).then(function (res) {
  272. vm.teamOptions = res.data
  273. })
  274. },
  275. load(row, treeNode, resolve) {
  276. var params = {}
  277. var len = row.code.length
  278. if (len == 6) {
  279. params.range = 'hospital'
  280. params.area = row.code
  281. } else if (len == 10) {
  282. params.range = 'team'
  283. params.hospital = row.code
  284. }
  285. if (this.yearType == '1') {
  286. params.startDate = this.chooseYear + '-01-01'
  287. params.endDate = this.chooseYear + '-12-31'
  288. } else {
  289. if (this.chooseTime) {
  290. params.startDate = this.chooseTime[0]
  291. params.endDate = this.chooseTime[1]
  292. }
  293. }
  294. httpRequest.get('statistics/collaborate/gxbTurnDownInfo', { data: params }).then(function (res) {
  295. if (res.status == 200) {
  296. var children = res.detailModelList.map(function (item) {
  297. var data = JSON.parse(JSON.stringify(item))
  298. if (len == 6) {
  299. data.hospital = item.name
  300. data.hasChildren = true
  301. } else if (len == 10) {
  302. data.team = item.name
  303. }
  304. return data
  305. })
  306. resolve(children)
  307. }
  308. })
  309. },
  310. dialogSearchFn() {
  311. this.page = 1
  312. if (this.title == '康复下转明细列表') {
  313. this.rehabilitationPatientInfo()
  314. } else if (this.title == '下转情况数据列表') {
  315. this.turnDownDataPage()
  316. }
  317. },
  318. dialogExportFn() {
  319. var vm = this
  320. var params = {
  321. ...this.query
  322. }
  323. if (this.title == '康复下转明细列表') {
  324. if (this.yearType == '1') {
  325. params.startTime = this.chooseYear + '-01-01'
  326. params.endTime = this.chooseYear + '-12-31'
  327. } else {
  328. if (this.chooseTime) {
  329. params.startTime = this.chooseTime[0]
  330. params.endTime = this.chooseTime[1]
  331. }
  332. }
  333. this.dialogExportLoading = true
  334. var fileName = `康复下转明细列表${new Date().getTime()}.xls`
  335. httpRequest.downLoadFileForAjax('doctor/specialist/rehabilitation/exportRehabilitationPatientInfo', fileName, params).then(function () {
  336. vm.dialogExportLoading = false
  337. })
  338. } else {
  339. if (this.yearType == '1') {
  340. params.startDate = this.chooseYear + '-01-01'
  341. params.endDate = this.chooseYear + '-12-31'
  342. } else {
  343. if (this.chooseTime) {
  344. params.startDate = this.chooseTime[0]
  345. params.endDate = this.chooseTime[1]
  346. }
  347. }
  348. this.dialogExportLoading = true
  349. var fileName = `冠心病下转情况统计表${new Date().getTime()}.xls`
  350. httpRequest.downLoadFileForAjax('statistics/collaborate/exportTurnDownDataPage', fileName, params).then(function () {
  351. vm.dialogExportLoading = false
  352. })
  353. }
  354. },
  355. dialogReset() {
  356. var params = {
  357. ...this.query
  358. }
  359. if (this.title == '康复下转明细列表') {
  360. this.query = {
  361. status: '',
  362. hospitalCode: '',
  363. orgCode: '',
  364. archiveStatus: '',
  365. patientType: '',
  366. range: typeof params.range == 'undefined' ? '' : params.range,
  367. area: typeof params.area == 'undefined' ? '' : params.area,
  368. hospital: typeof params.hospital == 'undefined' ? '' : params.hospital,
  369. team: typeof params.team == 'undefined' ? '' : params.team
  370. }
  371. } else if (this.title == '下转情况数据列表') {
  372. this.query = {
  373. sex: '',
  374. isSign: '',
  375. eventType: '',
  376. range: params.range,
  377. area: params.area,
  378. hospital: params.hospital,
  379. team: params.team
  380. }
  381. }
  382. },
  383. handleCurrentChange(val) {
  384. this.page = val
  385. if (this.title == '康复下转明细列表') {
  386. this.rehabilitationPatientInfo()
  387. } else if (this.title == '下转情况数据列表') {
  388. this.turnDownDataPage()
  389. }
  390. },
  391. handleSizeChange(val) {
  392. this.size = val
  393. if (this.title == '康复下转明细列表') {
  394. this.rehabilitationPatientInfo()
  395. } else if (this.title == '下转情况数据列表') {
  396. this.turnDownDataPage()
  397. }
  398. },
  399. // 获取社区医院
  400. hospitalsByType() {
  401. var vm = this
  402. // var code
  403. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  404. if (selectedRole.code.indexOf('350200') > -1) {
  405. code = '350200' // 市卫健委
  406. } else if (selectedRole.code.length == 6) {
  407. code = selectedRole.code
  408. } else {
  409. this.level = 3 // 社区管理
  410. }
  411. if (selectedRole.code.length > 6) {
  412. this.communityHospitals = [{ label: selectedRole.name, value: selectedRole.code }]
  413. } else {
  414. var type = 1
  415. if (selectedRole.code.indexOf('350200') > -1) {
  416. type = 1 // 市卫健委
  417. } else if (selectedRole.code.length == 6) {
  418. type = 2
  419. }
  420. statisticAPI
  421. .hospitalsByType({
  422. type: type,
  423. code: selectedRole.code
  424. })
  425. .then(function (res) {
  426. if (res.status == 200) {
  427. vm.communityHospitals = [{ label: '全部', value: '' }]
  428. res.list.forEach(function (v) {
  429. vm.communityHospitals.push({
  430. value: v.code,
  431. label: v.name
  432. })
  433. })
  434. }
  435. })
  436. .catch(function (err) {
  437. console.log(err, 'Errr')
  438. })
  439. }
  440. },
  441. // 康复下转操作
  442. operation(num, item) {
  443. var vm = this
  444. if (num != 2) {
  445. statisticAPI
  446. .synchronizePationSingle({ id: item.id })
  447. .then(function (res) {
  448. if (res.status == 200) {
  449. vm.$message.success('操作成功')
  450. } else {
  451. vm.$message.error(res.msg)
  452. }
  453. })
  454. .catch(function (err) {
  455. console.log(err, 'Errr')
  456. })
  457. } else {
  458. vm.signatoryList = []
  459. statisticAPI
  460. .kangfuGetSignInfo({ idcard: item.idcard })
  461. .then(function (res) {
  462. if (res.status == 200) {
  463. if (res.data != null) {
  464. vm.signatoryList.push(res.data)
  465. }
  466. }
  467. })
  468. .catch(function (err) {
  469. console.log(err, 'Errr')
  470. })
  471. vm.dialogVisible = true
  472. }
  473. },
  474. rehabilitationPatientInfo() {
  475. var vm = this
  476. var params = {
  477. ...this.query,
  478. page: this.page,
  479. size: this.size,
  480. disease: 3
  481. }
  482. if (this.yearType == '1') {
  483. params.startTime = this.chooseYear + '-01-01'
  484. params.endTime = this.chooseYear + '-12-31'
  485. } else {
  486. if (this.chooseTime) {
  487. params.startTime = this.chooseTime[0]
  488. params.endTime = this.chooseTime[1]
  489. }
  490. }
  491. this.dialogLoading = true
  492. statisticAPI.rehabilitationPatientInfo(params).then(function (res) {
  493. if (res.status == 200) {
  494. res.detailModelList.forEach(function (v) {
  495. v.sex = v.sex == 1 ? '男' : '女'
  496. })
  497. vm.dialogTableData = res.detailModelList
  498. vm.total = res.totalCount
  499. } else {
  500. vm.$message.error(res.msg)
  501. }
  502. vm.dialogLoading = false
  503. })
  504. },
  505. turnDownDataPage() {
  506. var vm = this
  507. var params = {
  508. ...this.query,
  509. page: this.page,
  510. pageSize: this.size
  511. }
  512. if (this.yearType == '1') {
  513. params.startDate = this.chooseYear + '-01-01'
  514. params.endDate = this.chooseYear + '-12-31'
  515. } else {
  516. if (this.chooseTime) {
  517. params.startDate = this.chooseTime[0]
  518. params.endDate = this.chooseTime[1]
  519. }
  520. }
  521. this.dialogLoading = true
  522. httpRequest.get('statistics/collaborate/turnDownDataPage', { data: params }).then(function (res) {
  523. if (res.status == 200) {
  524. vm.dialogTableData = res.detailModelList
  525. vm.total = res.totalCount
  526. }
  527. vm.dialogLoading = false
  528. })
  529. },
  530. closeDialog() {
  531. this.visible = false
  532. },
  533. closeDialog1() {
  534. this.dialogVisible = false
  535. },
  536. getData(data) {
  537. if (data) {
  538. this.yearType = data.yearType
  539. this.form.range = data.range
  540. this.form.area = data.area
  541. this.form.hospital = data.hospital
  542. this.form.team = data.team
  543. if (this.yearType == 1) {
  544. this.chooseYear = data.time
  545. } else {
  546. this.chooseTime = data.time
  547. }
  548. if (this.form.hospital) {
  549. // 如果有社区code传过来就调社区医院列表接口
  550. this.getHospital(data.area, false)
  551. }
  552. if (this.form.team) {
  553. // 如果有团队code传过来就调团队列表接口
  554. this.getTeam(data.hospital, false)
  555. }
  556. this.searchFn()
  557. } else {
  558. this.init()
  559. }
  560. },
  561. seePatientDetail(row, prop) {
  562. console.log('uuuuuuuuuuuuuuuuu', row, prop)
  563. if (prop == 'name') {
  564. if (row.patient && this.title == '康复下转明细列表') {
  565. EventBus.$emit('preview-person-info', { type: '4', code: row.patient })
  566. } else if (row.code && this.title == '下转情况数据列表') {
  567. EventBus.$emit('preview-person-info', { type: '4', code: row.code })
  568. } else {
  569. this.$message.warning('未查询到该患者信息')
  570. }
  571. }
  572. },
  573. renderHeader: function (h, item) {
  574. var label = item.column.label
  575. var column = item.column
  576. var tooltip = {
  577. '签约社区': '显示为该患者当前的签约社区医院名称',
  578. '社区医院': '显示为该患者当前的签约社区医院名称',
  579. '签约医院': '显示为该患者当前的签约社区医院名称',
  580. '签约医生': '显示为该患者当前的签约社区医生名称',
  581. '家庭医生': '显示为该患者当前的签约社区医生名称'
  582. }
  583. if (label == '签约社区' || label == '签约医生' || label == '签约医院' || label == '家庭医生' || label == '社区医院') {
  584. return [
  585. label,
  586. h(
  587. 'el-tooltip',
  588. {
  589. props: {
  590. content: (function () {
  591. return tooltip[label]
  592. })(),
  593. placement: 'top'
  594. }
  595. },
  596. [
  597. h('span', {
  598. class: {
  599. 'el-icon-question': true
  600. }
  601. })
  602. ]
  603. )
  604. ]
  605. } else {
  606. return [column.label]
  607. }
  608. }
  609. },
  610. mounted() {}
  611. })