index.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  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: 'v1Num',
  71. width: '130'
  72. },
  73. {
  74. label: '已服务人次',
  75. prop: 'vd1Num',
  76. width: '130'
  77. }
  78. ]
  79. },
  80. {
  81. label: '复诊3',
  82. children: [
  83. {
  84. label: '应服务人次',
  85. prop: 'v1Num',
  86. width: '130'
  87. },
  88. {
  89. label: '已服务人次',
  90. prop: 'vd1Num',
  91. width: '130'
  92. }
  93. ]
  94. },
  95. {
  96. label: '复诊4',
  97. children: [
  98. {
  99. label: '应服务人次',
  100. prop: 'v1Num',
  101. width: '130'
  102. },
  103. {
  104. label: '已服务人次',
  105. prop: 'vd1Num',
  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. }
  172. },
  173. methods: {
  174. closeMessageDialog() {
  175. this.messageVisible = false
  176. },
  177. init() {
  178. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  179. if (selectedRole.code.indexOf('350200') > -1) {
  180. this.level = 1 // 市卫健委
  181. this.areaOptions = [
  182. { label: '思明区', value: '350203' },
  183. { label: '海沧区', value: '350205' },
  184. { label: '湖里区', value: '350206' },
  185. { label: '集美区', value: '350211' },
  186. { label: '同安区', value: '350212' },
  187. { label: '翔安区', value: '350213' }
  188. ]
  189. } else if (selectedRole.code.length == 6) {
  190. this.level = 2 // 区管理
  191. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  192. this.form = {
  193. range: 'town',
  194. area: selectedRole.code
  195. }
  196. this.getHospital(selectedRole.code)
  197. } else {
  198. this.level = 3 // 社区管理
  199. this.rangeOptions = [{ label: '医院', value: 'hospital' }, { label: '团队', value: 'team' }]
  200. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  201. this.hospital = [{ label: selectedRole.name, value: selectedRole.code }]
  202. this.form = {
  203. range: 'hospital',
  204. area: selectedRole.code.substring(0, 6),
  205. hospital: selectedRole.code
  206. }
  207. this.getTeam(selectedRole.code)
  208. }
  209. this.initTime()
  210. this.getList()
  211. this.initHospitalList();
  212. },
  213. initTime() {
  214. var vm = this
  215. var now = new Date()
  216. vm.nowyear = vm.chooseYear = now.getFullYear()
  217. vm.years = []
  218. for (i = vm.nowyear; i >= 2013; i--) {
  219. vm.years.push(i)
  220. }
  221. },
  222. initHospitalList() {
  223. var vm = this;
  224. vm.hospitalList=[{code:'',name:'全部'}];
  225. outsideHospitalAPI.ydManageHospitalList().then(function(res){
  226. if(res.status == 200){
  227. res.detailModelList.forEach(item => {
  228. vm.hospitalList.push(item)
  229. });
  230. }
  231. })
  232. },
  233. resetArea() {
  234. if (this.level == 1) {
  235. delete this.form.area
  236. delete this.form.hospital
  237. delete this.form.team
  238. } else if (this.level == 2) {
  239. delete this.form.hospital
  240. delete this.form.team
  241. } else {
  242. delete this.form.team
  243. }
  244. },
  245. getList() {
  246. var vm = this
  247. this.loading = true
  248. var params = {
  249. }
  250. if (this.yearType == '1') {
  251. params.startDate = this.chooseYear + '-01-01'
  252. params.endDate = this.chooseYear + '-12-31'
  253. } else if (this.yearType == '2'){
  254. params.hospital = this.chooseHospital
  255. }else if(this.yearType=='3'){
  256. params.startDate = this.chooseTime[0]
  257. params.endDate = this.chooseTime[1]
  258. }
  259. outsideHospitalAPI.ydRehabilitationInfo(params).then(function(res) {
  260. if (res.status == 200) {
  261. vm.tableData = res.detailModelList
  262. if (res.detailModelList.length == 0) {
  263. vm.$message.warning('暂无数据!')
  264. }
  265. vm.total = res.detailModelList.length
  266. }
  267. vm.loading = false
  268. })
  269. },
  270. queryDate() {
  271. this.page = 1
  272. this.getList()
  273. },
  274. exportTable() {
  275. var vm = this
  276. this.exportLoading = true
  277. var params = {
  278. }
  279. if (this.yearType == '1') {
  280. params.startDate = this.chooseYear + '-01-01'
  281. params.endDate = this.chooseYear + '-12-31'
  282. } else if (this.yearType == '2'){
  283. params.hospital = this.chooseHospital
  284. }else if(this.yearType=='3'){
  285. params.startDate = this.chooseTime[0]
  286. params.endDate = this.chooseTime[1]
  287. }
  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.resetArea()
  300. this.yearType = '1'
  301. this.paramsObj = {
  302. name: '',
  303. type: '',
  304. signDoctorName: '',
  305. hospitalName: ''
  306. }
  307. this.chooseYear = new Date().getFullYear()
  308. this.chooseTime = 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. this.DialogPage = val
  321. if( this.title = '康复复诊记录明细'){
  322. this.ydRehabilitationFz()
  323. }else{
  324. this.ydTurnDownDataPage()
  325. }
  326. },
  327. handleDialogSizeChange(val) {
  328. this.dialogSize = val
  329. if( this.title = '康复复诊记录明细'){
  330. this.ydRehabilitationFz()
  331. }else{
  332. this.ydTurnDownDataPage()
  333. }
  334. },
  335. //详情
  336. openDialog(row, prop) {
  337. this.query = {
  338. name: '',
  339. mobile: '',
  340. sex: '',
  341. eventType: '',
  342. hospital: '',
  343. isRehabilitation:'',
  344. reservationType:'',
  345. doctorName:'',
  346. }
  347. if (prop == 'total' || prop == 'planNum') {
  348. this.title = '下转情况数据列表'
  349. this.dialogHeader = [
  350. { label: '姓名', prop: 'name', width: '110' },
  351. { label: '性别', prop: 'sex', width: '110' },
  352. { label: '年龄', prop: 'age', width: '110' },
  353. { label: '手机号', prop: 'mobile', width: '110' },
  354. { label: '下转次数', prop: 'num', width: '110' },
  355. { label: '最近一次下转诊断', prop: 'diagnosisName', width: '110' },
  356. { label: '最近一次下转时间', prop: 'turnDownTime', width: '110' },
  357. { label: '最近一次下转类型', prop: 'eventType', width: '110' }
  358. ]
  359. this.ydTurnDownDataPage()
  360. this.visible = true
  361. } else if (prop == 'vd1Num' || prop == 'v4Num') {
  362. this.title = '康复复诊记录明细'
  363. this.dialogHeader = [
  364. { label: '姓名', prop: 'name' },
  365. { label: '性别', prop: 'sex' },
  366. { label: '年龄', prop: 'age' },
  367. { label: '手机号', prop: 'mobile' },
  368. { label: '管理医院', prop: 'hospitalName' },
  369. { label: '管理医生', prop: 'doctorName' },
  370. { label: '服务方式', prop: 'reservationType' },
  371. { label: '服务时间', prop: 'finishTime' }
  372. ]
  373. this.ydRehabilitationFz()
  374. this.visible = true
  375. }
  376. },
  377. ydTurnDownDataPage(){
  378. vm = this;
  379. vm.dialogTableData = [];
  380. vm.dialogTotal=0
  381. var params ={
  382. page:this.dialogPage,
  383. pageSize:this.dialogSize,
  384. ...this.query
  385. }
  386. if (this.yearType == '1') {
  387. params.startDate = this.chooseYear + '-01-01'
  388. params.endDate = this.chooseYear + '-12-31'
  389. } else if (this.yearType == '2'){
  390. params.hospital = this.chooseHospital
  391. }else if(this.yearType=='3'){
  392. params.startDate = this.chooseTime[0]
  393. params.endDate = this.chooseTime[1]
  394. }
  395. outsideHospitalAPI.ydTurnDownDataPage(params).then(function(res){
  396. if(res.status == 200){
  397. vm.dialogTableData = res.detailModelList
  398. vm.dialogTotal = res.totalCount
  399. }
  400. })
  401. },
  402. ydRehabilitationFz(){
  403. vm = this;
  404. vm.dialogTableData = [];
  405. vm.dialogTotal=0
  406. var params ={
  407. page:this.dialogPage,
  408. pageSize:this.dialogSize,
  409. ...this.query
  410. }
  411. if (this.yearType == '1') {
  412. params.startDate = this.chooseYear + '-01-01'
  413. params.endDate = this.chooseYear + '-12-31'
  414. } else if (this.yearType == '2'){
  415. params.hospital = this.chooseHospital
  416. }else if(this.yearType=='3'){
  417. params.startDate = this.chooseTime[0]
  418. params.endDate = this.chooseTime[1]
  419. }
  420. outsideHospitalAPI.ydRehabilitationFz(params).then(function(res){
  421. if(res.status == 200){
  422. vm.dialogTableData = res.detailModelList
  423. vm.dialogTotal = res.totalCount
  424. }
  425. })
  426. },
  427. closeDialog() {
  428. this.visible = false
  429. },
  430. dialogReset() {
  431. var params = {
  432. ...this.query
  433. }
  434. this.query = {
  435. visitCount: params.visitCount,
  436. range: typeof params.range == 'undefined' ? '' : params.range,
  437. area: typeof params.area == 'undefined' ? '' : params.area,
  438. hospital: typeof params.hospital == 'undefined' ? '' : params.hospital,
  439. team: typeof params.team == 'undefined' ? '' : params.team
  440. }
  441. },
  442. dialogExportFn() {
  443. var vm = this
  444. vm.dialogExportLoading = true
  445. if (this.title == '康复复诊记录明细') {
  446. var params ={
  447. page:this.dialogPage,
  448. pageSize:9999,
  449. ...this.query
  450. }
  451. if (this.yearType == '1') {
  452. params.startDate = this.chooseYear + '-01-01'
  453. params.endDate = this.chooseYear + '-12-31'
  454. } else if (this.yearType == '2'){
  455. params.hospital = this.chooseHospital
  456. }else if(this.yearType=='3'){
  457. params.startDate = this.chooseTime[0]
  458. params.endDate = this.chooseTime[1]
  459. }
  460. var fileName = `康复复诊记录明细${new Date().getTime()}.xls`
  461. outsideHospitalAPI.exportYdRehabilitationFz(fileName, params).then(function() {
  462. vm.dialogExportLoading = false
  463. })
  464. } else {
  465. vm = this;
  466. var params ={
  467. page:this.dialogPage,
  468. pageSize:9999,
  469. ...this.query
  470. }
  471. if (this.yearType == '1') {
  472. params.startDate = this.chooseYear + '-01-01'
  473. params.endDate = this.chooseYear + '-12-31'
  474. } else if (this.yearType == '2'){
  475. params.hospital = this.chooseHospital
  476. }else if(this.yearType=='3'){
  477. params.startDate = this.chooseTime[0]
  478. params.endDate = this.chooseTime[1]
  479. }
  480. var fileName = `下转情况数据列表${new Date().getTime()}.xls`
  481. outsideHospitalAPI.exportYdTurnDownDataPage(fileName, params).then(function() {
  482. vm.dialogExportLoading = false
  483. })
  484. }
  485. },
  486. dialogSearchFn() {
  487. this.page = 1
  488. this.dialogSearch()
  489. },
  490. dialogSearch() {
  491. console.log(this,'this')
  492. if (this.title == '康复复诊记录明细') {
  493. this.ydRehabilitationFz()
  494. } else {
  495. this.ydTurnDownDataPage()
  496. }
  497. },
  498. renderHeader: function(h, item) {
  499. var label = item.column.label
  500. var column = item.column
  501. var tooltip = {
  502. 签约社区: '显示为该患者当前的签约社区医院名称',
  503. 社区医院: '显示为该患者当前的签约社区医院名称',
  504. 签约医院: '显示为该患者当前的签约社区医院名称',
  505. 签约医生: '显示为该患者当前的签约社区医生名称',
  506. 家庭医生: '显示为该患者当前的签约社区医生名称'
  507. }
  508. if (label == '签约社区' || label == '签约医生' || label == '签约医院' || label == '家庭医生' || label == '社区医院') {
  509. return [
  510. label,
  511. h(
  512. 'el-tooltip',
  513. {
  514. props: {
  515. content: (function() {
  516. return tooltip[label]
  517. })(),
  518. placement: 'top'
  519. }
  520. },
  521. [
  522. h('span', {
  523. class: {
  524. 'el-icon-question': true
  525. }
  526. })
  527. ]
  528. )
  529. ]
  530. } else {
  531. return [column.label]
  532. }
  533. },
  534. // 个人案
  535. seePatientDetail(row, prop) {
  536. if (prop == 'name') {
  537. if(this.title == '康复复诊记录明细'){
  538. EventBus.$emit('preview-person-info', { type: '5', code: row.patient||row.id,flag:'yd' })
  539. }else{
  540. EventBus.$emit('preview-person-info', { type: '4', code: row.patient||row.id,flag:'yd' })
  541. }
  542. }
  543. }
  544. },
  545. mounted() {
  546. this.init()
  547. }
  548. })