index.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. var template = ''
  2. $.ajax('../../../component/statistics/OutsideHospitalManage/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('outside-hospital-manage', {
  14. template: template,
  15. props: [],
  16. data: function() {
  17. return {
  18. years: [],
  19. hospitalList:[],
  20. yearType: '1',
  21. chooseYear: null,
  22. chooseTime: null,
  23. chooseHospital:null,
  24. rangeOptions: [{ label: '区', value: 'town' }, { label: '医院', value: 'hospital' }, { label: '团队', value: 'team' }],
  25. hospitalOptions: [],
  26. teamOptions: [],
  27. form: {
  28. range: 'town'
  29. },
  30. loading: false,
  31. exportLoading: false,
  32. tableData: [
  33. {
  34. patientName: '11',
  35. idcard: '11',
  36. hospitalName: '11',
  37. doctorName: '',
  38. code: '11',
  39. v1Num: 1,
  40. vd1Num: 1
  41. }
  42. ],
  43. tableHeader: [
  44. { label: '医院名称', prop: 'name', width: '110' },
  45. { label: '患者总数', prop: 'total', width: '110' },
  46. { label: '康复管理人数', prop: 'planNum', width: '180' },
  47. { label: '康复计划数量', prop: 'planTimes', width: '110' }
  48. ],
  49. tableHeaderChildren: [
  50. {
  51. label: '复诊1',
  52. children: [
  53. {
  54. label: '应服务人次',
  55. prop: 'v1Num',
  56. width: '130'
  57. },
  58. {
  59. label: '已服务人次',
  60. prop: 'vd1Num',
  61. width: '130'
  62. }
  63. ]
  64. },
  65. {
  66. label: '复诊2',
  67. children: [
  68. {
  69. label: '应服务人次',
  70. prop: 'v2Num',
  71. width: '130'
  72. },
  73. {
  74. label: '已服务人次',
  75. prop: 'vd2Num',
  76. width: '130'
  77. }
  78. ]
  79. },
  80. {
  81. label: '复诊3',
  82. children: [
  83. {
  84. label: '应服务人次',
  85. prop: 'v3Num',
  86. width: '130'
  87. },
  88. {
  89. label: '已服务人次',
  90. prop: 'vd3Num',
  91. width: '130'
  92. }
  93. ]
  94. },
  95. {
  96. label: '复诊4',
  97. children: [
  98. {
  99. label: '应服务人次',
  100. prop: 'v4Num',
  101. width: '130'
  102. },
  103. {
  104. label: '已服务人次',
  105. prop: 'vd4Num',
  106. width: '130'
  107. }
  108. ]
  109. }
  110. ],
  111. page: 1,
  112. size: 10,
  113. total: 0,
  114. level: 0,
  115. dialogPage:1,
  116. dialogSize:10,
  117. dialogTotal:0,
  118. messageVisible: false,
  119. messTxt: '',
  120. paramsObj: {
  121. name: '',
  122. type: '',
  123. signDoctorName: '',
  124. hospitalName: ''
  125. },
  126. dialogHeader: [],
  127. visible: false,
  128. // 详情
  129. query: {
  130. name: '',
  131. mobile: '',
  132. sex: '',
  133. eventType: '',
  134. hospital: '',
  135. isRehabilitation:'',
  136. reservationType:'',
  137. doctorName:'',
  138. },
  139. dialogTableData: [
  140. {
  141. name: '11',
  142. sex: '男',
  143. age: 18,
  144. phoen: 1254813
  145. }
  146. ],
  147. dialogLoading: false,
  148. dialogHeader: [],
  149. title: '',
  150. dialogExportLoading: false,
  151. reservationTypes:[
  152. { name: '全部', code: '' },
  153. { name: '代预约', code: '4' },
  154. { name: '电话短信提醒', code: '5' },
  155. ],
  156. sexs: [
  157. { name: '全部', code: '' },
  158. { name: '男', code: '1' },
  159. { name: '女', code: '2' }
  160. ],
  161. eventTypes: [
  162. { name: '全部', code: '' },
  163. { name: '门诊', code: '1' },
  164. { name: '住院', code: '2' },
  165. ],
  166. isRehabilitations: [
  167. { name: '全部', code: '' },
  168. { name: '是', code: '1' },
  169. { name: '否', code: '0' },
  170. ],
  171. prop:''
  172. }
  173. },
  174. methods: {
  175. closeMessageDialog() {
  176. this.messageVisible = false
  177. },
  178. init() {
  179. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  180. if (selectedRole.code.indexOf('350200') > -1) {
  181. this.level = 1 // 市卫健委
  182. this.areaOptions = [
  183. { label: '思明区', value: '350203' },
  184. { label: '海沧区', value: '350205' },
  185. { label: '湖里区', value: '350206' },
  186. { label: '集美区', value: '350211' },
  187. { label: '同安区', value: '350212' },
  188. { label: '翔安区', value: '350213' }
  189. ]
  190. } else if (selectedRole.code.length == 6) {
  191. this.level = 2 // 区管理
  192. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  193. this.form = {
  194. range: 'town',
  195. area: selectedRole.code
  196. }
  197. this.getHospital(selectedRole.code)
  198. } else {
  199. this.level = 3 // 社区管理
  200. this.rangeOptions = [{ label: '医院', value: 'hospital' }, { label: '团队', value: 'team' }]
  201. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  202. this.hospital = [{ label: selectedRole.name, value: selectedRole.code }]
  203. this.form = {
  204. range: 'hospital',
  205. area: selectedRole.code.substring(0, 6),
  206. hospital: selectedRole.code
  207. }
  208. this.getTeam(selectedRole.code)
  209. }
  210. this.initTime()
  211. this.getList()
  212. this.initHospitalList();
  213. },
  214. initTime() {
  215. var vm = this
  216. var now = new Date()
  217. vm.nowyear = vm.chooseYear = now.getFullYear()
  218. vm.years = []
  219. for (i = vm.nowyear; i >= 2013; i--) {
  220. vm.years.push(i)
  221. }
  222. console.log('years',vm.years)
  223. },
  224. initHospitalList() {
  225. var vm = this;
  226. vm.hospitalList=[{code:'',name:'全部'}];
  227. outsideHospitalAPI.ydManageHospitalList().then(function(res){
  228. if(res.status == 200){
  229. res.detailModelList.forEach(item => {
  230. vm.hospitalList.push(item)
  231. });
  232. }
  233. })
  234. },
  235. resetArea() {
  236. if (this.level == 1) {
  237. delete this.form.area
  238. delete this.form.hospital
  239. delete this.form.team
  240. } else if (this.level == 2) {
  241. delete this.form.hospital
  242. delete this.form.team
  243. } else {
  244. delete this.form.team
  245. }
  246. },
  247. getList() {
  248. var vm = this
  249. this.loading = true
  250. var params = {
  251. }
  252. if (this.yearType == '1') {
  253. params.startDate = this.chooseYear + '-01-01'
  254. params.endDate = this.chooseYear + '-12-31'
  255. } else if (this.yearType == '2'){
  256. params.startDate = this.chooseTime[0]
  257. params.endDate = this.chooseTime[1]
  258. }
  259. params.hospital = this.chooseHospital
  260. outsideHospitalAPI.ydRehabilitationInfo(params).then(function(res) {
  261. if (res.status == 200) {
  262. vm.tableData = res.detailModelList
  263. if (res.detailModelList.length == 0) {
  264. vm.$message.warning('暂无数据!')
  265. }
  266. vm.total = res.detailModelList.length
  267. }
  268. vm.loading = false
  269. })
  270. },
  271. queryDate() {
  272. this.page = 1
  273. this.getList()
  274. },
  275. exportTable() {
  276. var vm = this
  277. this.exportLoading = true
  278. var params = {
  279. }
  280. if (this.yearType == '1') {
  281. params.startDate = this.chooseYear + '-01-01'
  282. params.endDate = this.chooseYear + '-12-31'
  283. } else if (this.yearType == '2'){
  284. params.startDate = this.chooseTime[0]
  285. params.endDate = this.chooseTime[1]
  286. }
  287. params.hospital = this.chooseHospital
  288. this.exportLoading = true
  289. var fileName = `异地医院管理情况统计.xls`
  290. outsideHospitalAPI.exportYdRehabilitationInfo(fileName,params).then(function(){
  291. vm.exportLoading = false
  292. })
  293. },
  294. showInfo(item) {
  295. this.messTxt = item.content
  296. this.messageVisible = true
  297. },
  298. eliminateClick() {
  299. this.yearType = '1'
  300. this.paramsObj = {
  301. name: '',
  302. type: '',
  303. signDoctorName: '',
  304. hospitalName: ''
  305. }
  306. this.chooseYear = new Date().getFullYear()
  307. this.chooseTime = null
  308. this.chooseHospital = null
  309. this.$forceUpdate()
  310. },
  311. handleCurrentChange(val) {
  312. this.page = val
  313. this.getList()
  314. },
  315. handleSizeChange(val) {
  316. this.size = val
  317. this.getList()
  318. },
  319. handleCurrentDialogChange(val) {
  320. console.log('44444444444444444444',val)
  321. this.dialogPage = val
  322. if( this.title == '康复复诊记录明细'){
  323. this.ydRehabilitationFz()
  324. }else{
  325. this.ydTurnDownDataPage()
  326. }
  327. },
  328. handleDialogSizeChange(val) {
  329. this.dialogSize = val
  330. if( this.title == '康复复诊记录明细'){
  331. this.ydRehabilitationFz()
  332. }else{
  333. this.ydTurnDownDataPage()
  334. }
  335. },
  336. //详情
  337. openDialog(row, prop) {
  338. console.log(prop)
  339. this.query = {
  340. name: '',
  341. mobile: '',
  342. sex: '',
  343. eventType: '',
  344. hospital: '',
  345. isRehabilitation:'',
  346. reservationType:'',
  347. doctorName:'',
  348. }
  349. this.prop = '';
  350. if (prop == 'total' || prop == 'planNum') {
  351. this.title = '下转情况数据列表'
  352. this.dialogHeader = [
  353. { label: '姓名', prop: 'name', width: '110' },
  354. { label: '性别', prop: 'sex', width: '110' },
  355. { label: '年龄', prop: 'age', width: '110' },
  356. { label: '手机号', prop: 'mobile', width: '110' },
  357. { label: '下转次数', prop: 'num', width: '110' },
  358. { label: '最近一次下转诊断', prop: 'diagnosisName', width: '110' },
  359. { label: '最近一次下转时间', prop: 'turnDownTime', width: '110' },
  360. { label: '最近一次下转类型', prop: 'eventType', width: '110' }
  361. ]
  362. if(prop=='planNum'){
  363. this.query.isRehabilitation = '1';
  364. this.prop= prop
  365. }
  366. this.ydTurnDownDataPage()
  367. this.visible = true
  368. } else if (prop == 'vd1Num' || prop == 'vd4Num' || prop == 'vd2Num'|| prop == 'vd3Num') {
  369. this.title = '康复复诊记录明细'
  370. this.dialogHeader = [
  371. { label: '姓名', prop: 'name' },
  372. { label: '性别', prop: 'sex' },
  373. { label: '年龄', prop: 'age' },
  374. { label: '手机号', prop: 'mobile' },
  375. { label: '管理医院', prop: 'hospitalName' },
  376. { label: '管理医生', prop: 'doctorName' },
  377. { label: '服务方式', prop: 'reservationType' },
  378. { label: '服务时间', prop: 'finishTime' }
  379. ]
  380. this.prop = prop
  381. console.log('111111111111111',this.prop)
  382. this.ydRehabilitationFz()
  383. this.visible = true
  384. }
  385. },
  386. ydTurnDownDataPage(){
  387. vm = this;
  388. vm.dialogTableData = [];
  389. var params ={
  390. page:this.dialogPage,
  391. pageSize:this.dialogSize,
  392. ...this.query
  393. }
  394. if (this.yearType == '1') {
  395. params.startDate = this.chooseYear + '-01-01'
  396. params.endDate = this.chooseYear + '-12-31'
  397. } else if (this.yearType == '2'){
  398. params.startDate = this.chooseTime[0]
  399. params.endDate = this.chooseTime[1]
  400. }
  401. params.hospital = this.chooseHospital
  402. outsideHospitalAPI.ydTurnDownDataPage(params).then(function(res){
  403. if(res.status == 200){
  404. vm.dialogTableData = res.detailModelList
  405. vm.dialogTotal = res.totalCount
  406. }
  407. })
  408. },
  409. ydRehabilitationFz(){
  410. vm = this;
  411. vm.dialogTableData = [];
  412. var params ={
  413. page:this.dialogPage,
  414. pageSize:this.dialogSize,
  415. ...this.query
  416. }
  417. if (this.prop == 'vd1Num') {
  418. params.visitCount = 1
  419. }else if(this.prop == 'vd4Num'){
  420. params.visitCount = 4
  421. }else if(this.prop == 'vd2Num'){
  422. params.visitCount = 2
  423. }else if(this.prop == 'vd3Num'){
  424. params.visitCount = 3
  425. }
  426. if (this.yearType == '1') {
  427. params.startDate = this.chooseYear + '-01-01'
  428. params.endDate = this.chooseYear + '-12-31'
  429. } else if (this.yearType == '2'){
  430. params.startDate = this.chooseTime[0]
  431. params.endDate = this.chooseTime[1]
  432. }
  433. params.hospital = this.chooseHospital
  434. outsideHospitalAPI.ydRehabilitationFz(params).then(function(res){
  435. if(res.status == 200){
  436. vm.dialogTableData = res.detailModelList
  437. vm.dialogTotal = res.totalCount
  438. }
  439. })
  440. },
  441. closeDialog() {
  442. this.visible = false
  443. },
  444. dialogReset() {
  445. var params = {
  446. ...this.query
  447. }
  448. this.query = {
  449. name: '',
  450. mobile: '',
  451. sex: '',
  452. eventType: '',
  453. hospital: '',
  454. isRehabilitation:'',
  455. reservationType:'',
  456. doctorName:'',
  457. }
  458. if(this.prop=='planNum'){
  459. this.query.isRehabilitation = '1';
  460. }
  461. this.dialogSearchFn();
  462. },
  463. dialogExportFn() {
  464. var vm = this
  465. vm.dialogExportLoading = true
  466. if (this.title == '康复复诊记录明细') {
  467. var params ={
  468. page:this.dialogPage,
  469. pageSize:9999,
  470. ...this.query
  471. }
  472. if (this.yearType == '1') {
  473. params.startDate = this.chooseYear + '-01-01'
  474. params.endDate = this.chooseYear + '-12-31'
  475. } else if (this.yearType == '2'){
  476. params.startDate = this.chooseTime[0]
  477. params.endDate = this.chooseTime[1]
  478. }
  479. params.hospital = this.chooseHospital
  480. if (this.prop == 'vd1Num') {
  481. params.visitCount = 1
  482. }else if(this.prop == 'vd4Num'){
  483. params.visitCount = 4
  484. }else if(this.prop == 'vd2Num'){
  485. params.visitCount = 2
  486. }else if(this.prop == 'vd3Num'){
  487. params.visitCount = 3
  488. }
  489. var fileName = `康复复诊记录明细${new Date().getTime()}.xls`
  490. outsideHospitalAPI.exportYdRehabilitationFz(fileName, params).then(function() {
  491. vm.dialogExportLoading = false
  492. })
  493. } else {
  494. vm = this;
  495. var params ={
  496. page:this.dialogPage,
  497. pageSize:9999,
  498. ...this.query
  499. }
  500. if (this.yearType == '1') {
  501. params.startDate = this.chooseYear + '-01-01'
  502. params.endDate = this.chooseYear + '-12-31'
  503. } else if (this.yearType == '2'){
  504. params.startDate = this.chooseTime[0]
  505. params.endDate = this.chooseTime[1]
  506. }
  507. params.hospital = this.chooseHospital
  508. var fileName = `下转情况数据列表${new Date().getTime()}.xls`
  509. outsideHospitalAPI.exportYdTurnDownDataPage(fileName, params).then(function() {
  510. vm.dialogExportLoading = false
  511. })
  512. }
  513. },
  514. dialogSearchFn() {
  515. this.page = 1
  516. this.dialogSearch()
  517. },
  518. dialogSearch() {
  519. console.log(this,'this')
  520. if (this.title == '康复复诊记录明细') {
  521. this.ydRehabilitationFz()
  522. } else {
  523. this.ydTurnDownDataPage()
  524. }
  525. },
  526. renderHeader: function(h, item) {
  527. var label = item.column.label
  528. var column = item.column
  529. var tooltip = {
  530. 签约社区: '显示为该患者当前的签约社区医院名称',
  531. 社区医院: '显示为该患者当前的签约社区医院名称',
  532. 签约医院: '显示为该患者当前的签约社区医院名称',
  533. 签约医生: '显示为该患者当前的签约社区医生名称',
  534. 家庭医生: '显示为该患者当前的签约社区医生名称'
  535. }
  536. if (label == '签约社区' || label == '签约医生' || label == '签约医院' || label == '家庭医生' || label == '社区医院') {
  537. return [
  538. label,
  539. h(
  540. 'el-tooltip',
  541. {
  542. props: {
  543. content: (function() {
  544. return tooltip[label]
  545. })(),
  546. placement: 'top'
  547. }
  548. },
  549. [
  550. h('span', {
  551. class: {
  552. 'el-icon-question': true
  553. }
  554. })
  555. ]
  556. )
  557. ]
  558. } else {
  559. return [column.label]
  560. }
  561. },
  562. // 个人案
  563. seePatientDetail(row, prop) {
  564. if (prop == 'name') {
  565. if(this.title == '康复复诊记录明细'){
  566. EventBus.$emit('preview-person-info', { type: '5', code: row.patient||row.id,flag:'yd' })
  567. }else{
  568. EventBus.$emit('preview-person-info', { type: '4', code: row.patient||row.id,flag:'yd' })
  569. }
  570. }
  571. }
  572. },
  573. mounted() {
  574. this.init()
  575. }
  576. })