comprehensive-query.js 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654
  1. Vue.use(Vuedals.default);
  2. new Vue({
  3. el: "#main",
  4. data: {
  5. height:"",
  6. isloading:false, //加载中
  7. start:"",
  8. end:"",
  9. tabledata:[], //表格数据
  10. levelList:[{level:"4",areaLevel:"2"},{level:"3",areaLevel:"3"},{level:"2",areaLevel:"4"}], //两种搜索,地区等级对比
  11. areaLevel:"", // 2、市,3、区,4、社区,5、团队
  12. initareaLevel:"",
  13. initlevel: '',
  14. initarea: '',
  15. level: '',
  16. area: '',
  17. areaTitle: '',
  18. index: '121',
  19. lowLevel: '',
  20. initlowLevel:"",
  21. years:[],
  22. chooseYear: '',
  23. userRole: '',
  24. treedata: [],
  25. tableHeader:[],
  26. defaultProps: {
  27. children: 'children',
  28. label: 'label'
  29. },
  30. pickerOptions:{
  31. disabledDate:function(time) {
  32. return time.getTime() > Date.now()
  33. },
  34. },
  35. radio:'1',
  36. timeLevel: 2,
  37. searchJson:{},
  38. currentPage:1,
  39. currentSize:10,
  40. datatotal:0,
  41. rangeList:[],
  42. rangeCode:"",
  43. areaList:[],
  44. areaCode:"",
  45. communityList:[{code:"",name:"全部"}],
  46. communityCode:"",
  47. teamList:[{code:"",name:"全部"}],
  48. teamCode:"",
  49. detailInquire: [{
  50. label: '明细查询',
  51. children: [
  52. {label: '咨询分析', id:'33'},
  53. {label: '签约分析', id:'34'},
  54. {label: '专病分析', id:'35'},
  55. {label: '生日祝福分析', id:'36'},
  56. {label: '上门服务分析', id:'37'},
  57. {label: '长处方分析', id:'38'},
  58. {label: '体征数据分析', id:'39'},
  59. {label: '上转预约明细', id:'40'},
  60. {label: '微信绑定明细', id:'41'},
  61. ]
  62. }],
  63. handleNodeShow:1,
  64. handleNodeId:0,
  65. radio1:'',
  66. radio2:'',
  67. radio3:'',
  68. radio4:'',
  69. radio5:'',
  70. radio6:'',
  71. radio7:'',
  72. radio8:'',
  73. radio9:'',
  74. cities:[{value:'高血压',num:'4'},
  75. {value:'糖尿病',num:'5'},
  76. {value:'65岁以上人群',num:'3'},
  77. {value:'0-6岁小孩',num:'7'},
  78. {value:'计划生育家庭',num:'9'},
  79. {value:'严重精神障碍',num:'10'},
  80. {value:'残疾人',num:'11'},
  81. {value:'普通人群',num:'1'},
  82. {value:'结核病',num:'12'},
  83. {value:'低保人群',num:'8'},
  84. {value:'孕产妇',num:'6'},
  85. ],
  86. checkedCities: [],
  87. specialCities:[],
  88. specialCheckedCities:[],
  89. serveCities:[{value:'残疾人',num:'1'},
  90. {value:'失能/半失能老人',num:'5'},
  91. {value:'80岁以上老人',num:'7'},
  92. {value:'肺结核患者',num:'2'},
  93. {value:'计生特殊家庭',num:'3'},
  94. {value:'重性精神病',num:'4'},
  95. {value:'其他',num:'6'},
  96. ],
  97. serveSpecialCities:[],
  98. options: [{
  99. value: '1',
  100. label: '是'
  101. }, {
  102. value: '0',
  103. label: '否'
  104. },],
  105. value: '',
  106. form:{
  107. endorseTheTicket:'',
  108. renew:'',
  109. backToSign:'',
  110. WeChat:'',
  111. },
  112. form2:{
  113. juniorCollege:'',
  114. family:'',
  115. resident:'',
  116. },
  117. form3:{
  118. family:'',
  119. resident:'',
  120. },
  121. form4:{
  122. family:'',
  123. resident:'',
  124. },
  125. form5:{
  126. family:'',
  127. resident:'',
  128. },
  129. handleData:[],
  130. diseaseData:[],
  131. serviceTypeData:[],
  132. analyseData:[], //分析数据
  133. searchJsonTime:undefined,
  134. loadingTwo:false,
  135. radio1Show:null,
  136. serverType:'',
  137. diseaseDataType:'',
  138. serviceTypeDataType:'',
  139. fullscreenLoading:false,
  140. derive:'',
  141. tabsList:[
  142. {id:'1',text:'综合查询',show:true},
  143. {id:'2',text:'明细查询',show:false},
  144. {id:'3',text:'汇总数据',show:false},
  145. ],
  146. tabsId:'1',
  147. facility:'', //体征数据分析 - 设备类型
  148. illness:'', //体征数据分析 - 疾病类型
  149. form6:{
  150. resident:'',
  151. doctor:'',
  152. },
  153. form7:{
  154. resident:'',
  155. doctorOne:'',
  156. hospital:'',
  157. doctorTwo:'',
  158. administrativeOffice:'',
  159. },
  160. getHealthData:[],
  161. form8:{
  162. renew:'',
  163. },
  164. reservationData:[],
  165. wexinBindingData:[],
  166. hospitalData:[],
  167. administrativeOffice:[],
  168. collect:[
  169. {
  170. id: "kfxzrs,kfxzrc,szrs,szrc",
  171. label: "专病汇总",
  172. code:'1',
  173. children:[
  174. {id: "kfxzrs",label:'康复下转人数',code:'1',},
  175. {id: "kfxzrc",label:'康复下转人次',code:'1',},
  176. {id: "szrs",label:'上转人数',code:'1',},
  177. {id: "szrc",label:'上转人数',code:'1',},
  178. ],
  179. },
  180. {
  181. id: "scsbs,scrc,yctzrc,gyrc",
  182. label: "体征数据汇总",
  183. code:'2',
  184. children:[
  185. {id: "scsbs",label:'上传设备数',code:'2'},
  186. {id: "scrc",label:'上传人次',code:'2'},
  187. {id: "yctzrc",label:'异常体征人次',code:'2'},
  188. {id: "gyrc",label:'干预人次',code:'2'},
  189. ],
  190. },
  191. {
  192. id: "fwgd",
  193. label: "上门服务汇总",
  194. code:'3',
  195. children:[
  196. {id: "fwgd",label:'服务工单',code:'3'}
  197. ],
  198. },
  199. ],
  200. specHosName:'',
  201. specHosList:[],
  202. collectCode:'',
  203. diseaseReport:[],
  204. diseaseColumn:[],
  205. diseaseHeader:[],
  206. facilitySign:'',
  207. getDeviceReport:[],
  208. getDeviceColumn:[],
  209. getDeviceHeader:[],
  210. getDoorReport:[],
  211. getDoorColumn:[],
  212. getDoorHeader:[],
  213. isCheck: false,
  214. },
  215. components: {
  216. vuedals: Vuedals.Component
  217. },
  218. watch: {
  219. rangeCode: function (val) {
  220. var vm=this
  221. if(vm.initlevel != 2){
  222. vm.communityCode=""
  223. }
  224. vm.teamCode=""
  225. vm.getTreeList()
  226. },
  227. areaCode:function(val){
  228. var vm=this
  229. vm.selChange(3)
  230. },
  231. communityCode:function(val){
  232. var vm=this
  233. vm.selChange(5)
  234. },
  235. },
  236. mounted: function () {
  237. var vm=this
  238. //初始化数据
  239. initData(vm);
  240. vm.getDiseaseTypeList()
  241. vm.height = document.body.offsetHeight - 85
  242. window.onresize = function () {
  243. vm.height = document.body.offsetHeight - 85
  244. }
  245. },
  246. methods: {
  247. reset:function() {
  248. if(this.tabsId == 1) {
  249. this.getTreeList()
  250. }else{
  251. this.collect = [
  252. {
  253. id: "kfxzrs,kfxzrc,szrs,szrc",
  254. label: "专病汇总",
  255. code:'1',
  256. children:[
  257. {id: "kfxzrs",label:'康复下转人数',code:'1'},
  258. {id: "kfxzrc",label:'康复下转人次',code:'1'},
  259. {id: "szrs",label:'下转人数',code:'1'},
  260. {id: "szrc",label:'下转人数',code:'1'},
  261. ],
  262. },
  263. {
  264. id: "scsbs,scrc,yctzrc,gyrc",
  265. label: "体征数据汇总",
  266. code:'2',
  267. children:[
  268. {id: "scsbs",label:'上传设备数',code:'2'},
  269. {id: "scrc",label:'上传人次',code:'2'},
  270. {id: "yctzrc",label:'异常体征人次',code:'2'},
  271. {id: "gyrc",label:'干预人次',code:'2'},
  272. ],
  273. },
  274. {
  275. id: "fwgd",
  276. label: "上门服务汇总",
  277. code:'3',
  278. children:[
  279. {id: "fwgd",label:'服务工单',code:'3'}
  280. ],
  281. },
  282. ]
  283. }
  284. },
  285. // 清除
  286. eliminateClick:function() {
  287. this.radio = '1'
  288. this.radio1 = ''
  289. this.radio2 = ''
  290. this.radio3 = ''
  291. this.radio4 = ''
  292. this.radio5 = ''
  293. this.radio6 = ''
  294. this.radio7 = ''
  295. this.radio8 = ''
  296. this.radio9 = ''
  297. this.form = {
  298. endorseTheTicket:'',
  299. renew:'',
  300. backToSign:'',
  301. WeChat:'',
  302. }
  303. this.form2 = {
  304. juniorCollege:'',
  305. family:'',
  306. resident:'',
  307. }
  308. this.form3 = {
  309. family:'',
  310. resident:'',
  311. }
  312. this.form4 = {
  313. family:'',
  314. resident:'',
  315. }
  316. this.form5 = {
  317. family:'',
  318. resident:'',
  319. }
  320. this.facility = '' //体征数据分析 - 设备类型
  321. this.illness = '' //体征数据分析 - 疾病类型
  322. this.form6 = {
  323. resident:'',
  324. doctor:'',
  325. }
  326. this.form7 = {
  327. resident:'',
  328. doctorOne:'',
  329. hospital:'',
  330. doctorTwo:'',
  331. administrativeOffice:'',
  332. }
  333. this.form8 = {
  334. renew : ''
  335. }
  336. this.facilitySign = ''
  337. initData(this)
  338. // initTime(this)
  339. // initScope(this)
  340. },
  341. tabsClick:function(item) {
  342. var vm = this
  343. vm.tabsId = item.id
  344. vm.tabsList.forEach(function(res){
  345. if(res.id == item.id) {
  346. res.show = true
  347. }else{
  348. res.show = false
  349. }
  350. })
  351. vm.eliminateClick()
  352. },
  353. // 获取汇总数据的专科医院
  354. specHosData:function() {
  355. var vm = this
  356. statisticAPI.getSpecialHospital().then(function(res){
  357. if(res.status == 200) {
  358. res.data.forEach(function(item){
  359. vm.specHosList.push(
  360. {code:item.code,name:item.name}
  361. )
  362. })
  363. }
  364. })
  365. },
  366. getDiseaseTypeList:function() {
  367. var vm = this
  368. statisticAPI.getDiseaseTypeList({}).then(function(res){
  369. if(res.status == 200) {
  370. vm.specialCities = res.list
  371. }
  372. })
  373. },
  374. // 签约人群
  375. handleCheckedCitiesChange:function(value) {
  376. var vm = this
  377. vm.handleData = value
  378. },
  379. // 下转病种
  380. diseaseChange:function(value) {
  381. var vm = this
  382. vm.diseaseData = value
  383. },
  384. // 服务类型
  385. serviceTypeChange:function(value) {
  386. var vm = this
  387. vm.serviceTypeData = value
  388. },
  389. // 综合析树形图
  390. treedataClick:function(name,data) {
  391. var vm = this
  392. vm.handleNodeShow = 1
  393. vm.handleNodeId = 0
  394. vm.currentPage = 1
  395. vm.radio = '1' //签约年度 --创建时间
  396. // initTime(vm)
  397. // initScope(vm)
  398. },
  399. // 汇总树形图
  400. collectClick:function(data,isCheck) {
  401. var vm = this
  402. vm.derive = data.label
  403. vm.handleNodeShow = 3
  404. vm.currentPage = 1
  405. vm.radio = '1' //签约年度 --创建时间
  406. vm.isCheck = isCheck
  407. },
  408. collCheck:function(data,name) {
  409. // console.log(arguments)
  410. var vm = this
  411. vm.diseaseReport = []
  412. vm.datatotal = 0
  413. vm.collect.forEach(function(item){
  414. item.children.forEach(function(o) {
  415. if(o.code != data.code) {
  416. vm.$refs.collectTree.setChecked(o, false, true)
  417. }
  418. })
  419. if(data.id == item.id) {
  420. vm.$refs.collectTree.setChecked(item, vm.isCheck, true)
  421. } else {
  422. item.children.forEach(function(o) {
  423. if(data.id == o.id) {
  424. vm.$refs.collectTree.setChecked(o, vm.isCheck, true)
  425. }
  426. })
  427. }
  428. })
  429. vm.handleNodeId = 'huizongshuju'
  430. vm.collectCode = data.code
  431. if(data.code == 1) {
  432. vm.rangeList=[{name:"按区",code:"town"},{name:"按社区",code:"hospital"},{name:"按团队",code:"team"},{name:"按专科医院",code:"specHos"}]
  433. vm.specHosData()
  434. }else{
  435. vm.rangeList=[{name:"按区",code:"town"},{name:"按社区",code:"hospital"},{name:"按团队",code:"team"}]
  436. }
  437. },
  438. // 点击明细查询树形图
  439. handleNodeClick:function(name,data) {
  440. var vm = this
  441. vm.handleNodeId = 0
  442. vm.derive = name.label
  443. if(data.id>=33) { //明细查询以下
  444. vm.handleNodeShow = 2 // 明细查询tabs为2
  445. vm.tableHeader = [] // 选择统计的数组
  446. vm.analyseData = [] // 明细查询数组
  447. }
  448. vm.handleNodeId = data.data.id //切换后的id
  449. vm.radio = '1' //签约年度 --创建时间
  450. vm.radio1 = '' //咨询分析咨询状态
  451. vm.radio2 = ''
  452. vm.radio3 = ''
  453. vm.radio4 = ''
  454. vm.radio5 = ''
  455. vm.radio6 = ''
  456. vm.radio7 = ''
  457. vm.radio8 = ''
  458. vm.checkedCities = [] //签约人群清空
  459. vm.specialCheckedCities = [] //下转病种清空
  460. vm.serveSpecialCities = [] //服务类型清空
  461. vm.diseaseReport = []
  462. vm.datatotal = 0
  463. vm.form = {
  464. endorseTheTicket:'',
  465. renew:'',
  466. backToSign:'',
  467. WeChat:'',
  468. }
  469. vm.form2 = {
  470. juniorCollege:'',
  471. family:'',
  472. resident:'',
  473. }
  474. vm.form3 = {
  475. family:'',
  476. resident:'',
  477. },
  478. vm.form4 = {
  479. family:'',
  480. resident:'',
  481. },
  482. vm.form5 = {
  483. family:'',
  484. resident:'',
  485. },
  486. initTime(vm) //时间初始化
  487. initScope(vm) //数据范围初始化
  488. vm.currentPage = 1
  489. vm.analysFunction(vm.handleNodeId) //明细查询列表查询
  490. },
  491. analysFunction:function(id) {
  492. var vm = this
  493. // idcard = idcard.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2") 身份证 医保卡 脱敏显示
  494. if(id == 33) {
  495. // 咨询分析
  496. vm.getConsultList()
  497. }else if(id == 34) {
  498. // 签约分析
  499. vm.getSignList()
  500. }else if(id == 35) {
  501. // 专病分析
  502. vm.getSickList()
  503. }else if(id == 36) {
  504. // 生日祝福分析
  505. vm.getBirthdayPatientList()
  506. }else if(id == 37) {
  507. // 上门服务分析
  508. vm.getDoorServiceList()
  509. }else if(id == 38) {
  510. // 长处方分析
  511. vm.getPrescriptionList()
  512. }else if(id == 39) {
  513. // 体征数据
  514. vm.physicalSignData()
  515. }else if(id == 40) {
  516. // 上转预约
  517. vm.upTransferAppointment()
  518. }else if(id == 41) {
  519. // 微信绑定
  520. vm.wechatBinding()
  521. }
  522. },
  523. // 下转预约获取医生,科室
  524. getReservationHosAndDept:function(data) {
  525. var vm = this
  526. statisticAPI.getReservationHosAndDept({
  527. hospital:data?data:'',
  528. type:data?'2':'',
  529. }).then(function(res){
  530. if(res.status == 200) {
  531. if(data) {
  532. vm.administrativeOffice = []
  533. res.data.forEach(function(item){
  534. vm.administrativeOffice.push({
  535. value: item.code,
  536. label: item.name
  537. })
  538. })
  539. }else{
  540. vm.hospitalData = []
  541. res.data.forEach(function(item){
  542. vm.hospitalData.push({
  543. value: item.code,
  544. label: item.name
  545. })
  546. })
  547. }
  548. }
  549. })
  550. },
  551. hospitalChange:function(data) {
  552. var vm = this
  553. vm.getReservationHosAndDept(data)
  554. },
  555. // 咨询分析
  556. getConsultList:function() {
  557. var vm = this
  558. vm.loadingTwo = true
  559. statisticAPI.getConsultList({
  560. year :vm.radio=='1'?vm.chooseYear:'', //签约年度
  561. startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
  562. endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
  563. status :vm.radio1, //咨询状态,1已回复,0未回复,2未及时回复
  564. team :vm.teamCode, //团队
  565. area :vm.areaCode, //地区
  566. hospital :vm.communityCode, //社区
  567. rang :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
  568. pageSize:vm.currentSize,
  569. page:vm.currentPage,
  570. }).then(function(res){
  571. // console.log(res,"咨询分析")
  572. if(res.status == 200) {
  573. vm.analyseData = res.data.list
  574. vm.datatotal = res.data.total
  575. vm.loadingTwo = false
  576. }
  577. if(res.status == -1) {
  578. vm.loadingTwo = false
  579. vm.$message.error(res.msg)
  580. }
  581. })
  582. },
  583. // 签约分析
  584. getSignList:function() {
  585. var vm = this
  586. vm.loadingTwo = true
  587. var handleDataList = []
  588. vm.serverType = ''
  589. vm.handleData.forEach(function(res){
  590. handleDataList.push(res.num)
  591. })
  592. vm.serverType = handleDataList.join(',')
  593. statisticAPI.getSignList({
  594. year :vm.radio=='1'?vm.chooseYear:'', //签约年度
  595. startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
  596. endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
  597. serverType:vm.serverType, //签约人群
  598. status :vm.radio2, //签约状态,1已签约,0待审核,2代缴费
  599. isUpdate:vm.form.endorseTheTicket, //是否改签 1是0否
  600. isAdd:vm.form.renew, //是否续签 1是0否
  601. isOut:vm.form.backToSign, //是否退签 1是0否
  602. isBindWX:vm.form.WeChat, //是否绑定微信 1是0否
  603. team :vm.teamCode, //团队
  604. area :vm.areaCode=='350200'?'':vm.areaCode, //地区
  605. hospital :vm.communityCode, //社区
  606. rang :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
  607. pageSize:vm.currentSize,
  608. page:vm.currentPage,
  609. }).then(function(res){
  610. // console.log(res,"签约分析")
  611. if(res.status == 200) {
  612. res.data.list.forEach(function(item){
  613. item.sscNum = item.sscNum.replace(/^(.{4})(?:\d+)(.{1})$/,"$1****$2")
  614. item.idcardNum = item.idcardNum.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2")
  615. })
  616. vm.analyseData = res.data.list
  617. vm.datatotal = res.data.total
  618. vm.loadingTwo = false
  619. }
  620. if(res.status == -1) {
  621. vm.loadingTwo = false
  622. vm.$message.error(res.msg)
  623. }
  624. })
  625. },
  626. // 专病分析
  627. getSickList:function() {
  628. var vm = this
  629. // vm.diseaseData
  630. vm.loadingTwo = true
  631. var handleDataList = []
  632. vm.diseaseDataType = ''
  633. vm.diseaseData.forEach(function(res){
  634. handleDataList.push(res.code)
  635. })
  636. vm.diseaseDataType = handleDataList.join(',')
  637. statisticAPI.getSickList({
  638. year :vm.radio=='1'?vm.chooseYear:'', //年度
  639. startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
  640. endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
  641. diseaseType:vm.diseaseDataType, //病种类型
  642. status :vm.radio3, //下转状态,1已接受,0未接受,2未管理
  643. doctorName:vm.form2.juniorCollege, //专科医生
  644. familyDoctorName:vm.form2.family, //家庭医生名字
  645. patientName:vm.form2.resident, // 居民姓名
  646. team :vm.teamCode, //团队
  647. area :vm.areaCode=='350200'?'':vm.areaCode, //地区
  648. hospital :vm.communityCode, //社区
  649. rang :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
  650. pageSize:vm.currentSize,
  651. page:vm.currentPage,
  652. }).then(function(res){
  653. // console.log(res,"专病分析")
  654. if(res.status == 200) {
  655. res.data.list.forEach(function(item){
  656. item.sscNum = item.sscNum.replace(/^(.{4})(?:\d+)(.{1})$/,"$1****$2")
  657. item.idcardNum = item.idcardNum.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2")
  658. })
  659. vm.analyseData = res.data.list
  660. vm.datatotal = res.data.total
  661. vm.loadingTwo = false
  662. }
  663. if(res.status == -1) {
  664. vm.loadingTwo = false
  665. vm.$message.error(res.msg)
  666. }
  667. })
  668. },
  669. // 生日祝福分析明细
  670. getBirthdayPatientList:function() {
  671. var vm = this
  672. vm.loadingTwo = true
  673. statisticAPI.getBirthdayPatientList({
  674. patientName:vm.form3.resident, // 居民姓名
  675. doctorName:vm.form3.family, //医生姓名
  676. signYear :vm.radio=='1'?vm.chooseYear:'', //签约年度
  677. startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
  678. endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
  679. status :vm.radio4, //状态(不传为全部,1、已发送,2、未发送)
  680. team :vm.teamCode, //团队
  681. area :vm.areaCode=='350200'?'':vm.areaCode, //地区
  682. hospital :vm.communityCode, //社区
  683. range :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
  684. pageSize:vm.currentSize,
  685. page:vm.currentPage,
  686. }).then(function(res){
  687. if(res.status == 200) {
  688. // console.log(res,"Sddddd")
  689. res.data.detailModelList.forEach(function(item){
  690. item.ssc = item.ssc.replace(/^(.{4})(?:\d+)(.{1})$/,"$1****$2")
  691. item.idcard = item.idcard.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2")
  692. })
  693. vm.analyseData = res.data.detailModelList
  694. vm.datatotal = res.data.total
  695. vm.loadingTwo = false
  696. }
  697. if(res.status == -1) {
  698. vm.loadingTwo = false
  699. vm.$message.error(res.msg)
  700. }
  701. })
  702. },
  703. // 长处方分析明细
  704. getPrescriptionList:function() {
  705. var vm = this
  706. vm.loadingTwo = true
  707. statisticAPI.getPrescriptionList({
  708. patientName:vm.form5.resident, // 居民姓名
  709. doctorName :vm.form5.family, //医生姓名
  710. signYear :vm.radio=='1'?vm.chooseYear:'', //签约年度
  711. startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
  712. endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
  713. status :vm.radio6, //续方状态 0待审核 20药师审核中 40待支付 100已完成 999其他
  714. diagnosis :vm.radio7, //续方疾病类型1高血压2糖尿病3其他
  715. dispensaryType :vm.radio8, // 取药方式1自取2快递3健管师配送
  716. team :vm.teamCode, //团队
  717. area :vm.areaCode=='350200'?'':vm.areaCode, //地区
  718. hospital :vm.communityCode, //社区
  719. range :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
  720. pageSize:vm.currentSize,
  721. page:vm.currentPage,
  722. }).then(function(res){
  723. if(res.status == 200) {
  724. res.data.detailModelList.forEach(function(item){
  725. // console.log(item.finish_time,"长处方分析")
  726. item.ssc = item.ssc.replace(/^(.{4})(?:\d+)(.{1})$/,"$1****$2")
  727. item.idcard = item.idcard.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2")
  728. })
  729. vm.analyseData = res.data.detailModelList
  730. vm.datatotal = res.data.total
  731. vm.loadingTwo = false
  732. }
  733. if(res.status == -1) {
  734. vm.loadingTwo = false
  735. vm.$message.error(res.msg)
  736. }
  737. })
  738. },
  739. // 上门服务分析明细
  740. getDoorServiceList:function() {
  741. var vm = this
  742. vm.loadingTwo = true
  743. var handleDataList = []
  744. vm.serviceTypeDataType = ''
  745. vm.serviceTypeData.forEach(function(res){
  746. handleDataList.push(res.num)
  747. })
  748. vm.serviceTypeDataType = handleDataList.join(',')
  749. statisticAPI.getDoorServiceList({
  750. patientName:vm.form4.resident, // 居民姓名
  751. doctorName :vm.form4.family, //医生姓名
  752. signYear :vm.radio=='1'?vm.chooseYear:'', //签约年度
  753. startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
  754. endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
  755. status :vm.radio5, //工单状态 -1已取消,1待派单、2待接单、3已接单、4待服务、5待评价
  756. type :vm.serviceTypeDataType, //服务类型 1残疾人,2肺结核患者,3计生特殊家庭,4重性精神病,5失能/半失能老人,6其他,7 80岁以上老人
  757. team :vm.teamCode, //团队
  758. area :vm.areaCode=='350200'?'':vm.areaCode, //地区
  759. hospital :vm.communityCode, //社区
  760. range :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
  761. pageSize:vm.currentSize,
  762. page:vm.currentPage,
  763. }).then(function(res){
  764. if(res.status == 200) {
  765. // console.log(res,"上门服务分析明细")
  766. res.data.detailModelList.forEach(function(item){
  767. item.ssc = item.ssc.replace(/^(.{4})(?:\d+)(.{1})$/,"$1****$2")
  768. item.idcard = item.idcard.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2")
  769. })
  770. vm.analyseData = res.data.detailModelList
  771. vm.datatotal = res.data.total
  772. vm.loadingTwo = false
  773. }
  774. if(res.status == -1) {
  775. vm.loadingTwo = false
  776. vm.$message.error(res.msg)
  777. }
  778. })
  779. },
  780. //体征数据分析传参
  781. getHealthParameter:function() {
  782. var vm = this
  783. return {
  784. signYear :vm.radio=='1'?vm.chooseYear:'', //签约年度
  785. team :vm.teamCode, //团队
  786. area :vm.areaCode=='350200'?'':vm.areaCode, //地区
  787. hospital :vm.communityCode, //社区
  788. range :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
  789. startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
  790. endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
  791. name:vm.form6.resident, // 居民姓名
  792. category :vm.facility, //设备类型
  793. doctorName:vm.form6.doctor, //医生姓名
  794. serverType:vm.illness, //签约疾病类型
  795. pageSize:vm.currentSize,
  796. page:vm.currentPage,
  797. }
  798. },
  799. //体征数据分析
  800. physicalSignData:function() {
  801. var vm = this
  802. vm.loadingTwo = true
  803. statisticAPI.getHealthList(vm.getHealthParameter()).then(function(res){
  804. if(res.status == 200) {
  805. // console.log(res,"体征数据")
  806. vm.getHealthData = res.data.detailModelList
  807. vm.datatotal = res.data.total
  808. vm.loadingTwo = false
  809. }
  810. if(res.status == -1) {
  811. vm.loadingTwo = false
  812. vm.$message.error(res.msg)
  813. }
  814. })
  815. },
  816. //上转预约传参
  817. reservationParameter:function() {
  818. var vm = this
  819. return {
  820. signYear :vm.radio=='1'?vm.chooseYear:'', //签约年度
  821. team :vm.teamCode, //团队
  822. area :vm.areaCode=='350200'?'':vm.areaCode, //地区
  823. hospital :vm.communityCode, //社区
  824. range :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
  825. startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
  826. endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
  827. name:vm.form7.resident, // 居民姓名
  828. doctorName:vm.form7.doctorOne, //签约医生姓名
  829. reservationHospital:vm.form7.hospital, //签约医院
  830. reservationDept:vm.form7.administrativeOffice, //预约科室
  831. reservationDoctorName:vm.form7.doctorTwo, //预约医生
  832. pageSize:vm.currentSize,
  833. page:vm.currentPage,
  834. }
  835. },
  836. // 上转预约
  837. upTransferAppointment:function() {
  838. var vm = this
  839. vm.loadingTwo = true
  840. statisticAPI.getDoctorReservationList(vm.reservationParameter()).then(function(res){
  841. if(res.status == 200) {
  842. // console.log(res,"上转预约")
  843. vm.reservationData = res.data.detailModelList
  844. vm.datatotal = res.data.total
  845. vm.loadingTwo = false
  846. vm.getReservationHosAndDept()
  847. }
  848. if(res.status == -1) {
  849. vm.loadingTwo = false
  850. vm.$message.error(res.msg)
  851. }
  852. })
  853. },
  854. //微信绑定传参
  855. wexinBindingParameter:function() {
  856. var vm = this
  857. return {
  858. signYear :vm.radio=='1'?vm.chooseYear:'', //签约年度
  859. team :vm.teamCode, //团队
  860. area :vm.areaCode=='350200'?'':vm.areaCode, //地区
  861. hospital :vm.communityCode, //社区
  862. range :vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
  863. startDate :vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
  864. endDate :vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
  865. binging:vm.form8.renew, //是否绑定微信
  866. pageSize:vm.currentSize,
  867. page:vm.currentPage,
  868. }
  869. },
  870. // 微信绑定
  871. wechatBinding:function() {
  872. var vm = this
  873. vm.loadingTwo = true
  874. statisticAPI.getWexinBindingList(vm.wexinBindingParameter()).then(function(res){
  875. if(res.status == 200) {
  876. // console.log(res,"微信绑定")
  877. res.data.detailModelList.forEach(function(res){
  878. res.sex = res.sex==1?'男':'女'
  879. res.apply_date = new Date(res.apply_date).format('yyyy-MM-dd HH:mm:ss')
  880. })
  881. vm.wexinBindingData = res.data.detailModelList
  882. vm.datatotal = res.data.total
  883. vm.loadingTwo = false
  884. }
  885. if(res.status == -1) {
  886. vm.loadingTwo = false
  887. vm.$message.error(res.msg)
  888. }
  889. })
  890. },
  891. //专病汇总传参
  892. getSpecialParameter:function() {
  893. var vm = this
  894. var parameter = {
  895. signYear:vm.radio=='1'?vm.chooseYear:'', //签约年度
  896. team:vm.teamCode, //团队
  897. area:vm.areaCode=='350200'?'':vm.areaCode, //地区
  898. hospital :vm.specHosName?vm.specHosName:vm.communityCode, //专病医院
  899. range:vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
  900. startDate:vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
  901. endDate:vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
  902. menu:vm.beforeReq().checked,
  903. // pageSize:vm.currentSize,
  904. // page:vm.currentPage,
  905. }
  906. return parameter
  907. },
  908. // 专病汇总
  909. getSpecialDiseaseReport:function() {
  910. var vm = this
  911. vm.loadingTwo = true
  912. statisticAPI.getSpecialDiseaseReport(vm.getSpecialParameter()).then(function(res){
  913. if(res.status == 200) {
  914. vm.loadingTwo = false
  915. vm.diseaseReport = res.data.list
  916. vm.diseaseColumn = res.data.column
  917. vm.diseaseHeader = res.data.header
  918. vm.datatotal = res.data.list.length
  919. }else{
  920. vm.loadingTwo = false
  921. vm.$message.error(res.msg)
  922. }
  923. })
  924. },
  925. //体征分析传参
  926. getDeviceParameter:function() {
  927. var vm = this
  928. var parameter = {
  929. signYear:vm.radio=='1'?vm.chooseYear:'', //签约年度
  930. team:vm.teamCode, //团队
  931. area:vm.areaCode=='350200'?'':vm.areaCode, //地区
  932. hospital :vm.communityCode, //医院
  933. range:vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
  934. startDate:vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
  935. endDate:vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
  936. category:vm.facilitySign,
  937. menu:vm.beforeReq().checked,
  938. // pageSize:vm.currentSize,
  939. // page:vm.currentPage,
  940. }
  941. return parameter
  942. },
  943. // 体征分析数据
  944. getDeviceHealthReport:function() {
  945. var vm = this
  946. vm.loadingTwo = true
  947. statisticAPI.getDeviceHealthReport(vm.getDeviceParameter()).then(function(res){
  948. if(res.status == 200) {
  949. vm.loadingTwo = false
  950. // console.log(res,"sss")
  951. vm.getDeviceReport = res.data.list
  952. vm.getDeviceColumn = res.data.column
  953. vm.getDeviceHeader = res.data.header
  954. vm.datatotal = res.data.list.length
  955. } else {
  956. vm.loadingTwo = false
  957. vm.$message.error(res.msg)
  958. }
  959. })
  960. },
  961. //上门汇总传参
  962. getDoorParameter:function() {
  963. var vm = this
  964. var parameter = {
  965. signYear:vm.radio=='1'?vm.chooseYear:'', //签约年度
  966. team:vm.teamCode, //团队
  967. area:vm.areaCode=='350200'?'':vm.areaCode, //地区
  968. hospital :vm.communityCode, //医院
  969. status:vm.radio9,
  970. range:vm.rangeCode, //数据范围(town区传值area,hospital医院传值hospital,team团队传值team)
  971. startDate:vm.radio=='2'?vm.searchJsonTime.start:'', //开始时间
  972. endDate:vm.radio=='2'?vm.searchJsonTime.end:'', //结束时间
  973. menu:vm.beforeReq().checked,
  974. // pageSize:vm.currentSize,
  975. // page:vm.currentPage,
  976. }
  977. return parameter
  978. },
  979. // 上门汇总
  980. getDoorServerOrderReport:function() {
  981. var vm = this
  982. vm.loadingTwo = true
  983. statisticAPI.getDoorServerOrderReport(vm.getDoorParameter()).then(function(res){
  984. if(res.status == 200) {
  985. vm.loadingTwo = false
  986. // console.log(res,"sss")
  987. vm.getDoorReport = res.data.list
  988. vm.getDoorColumn = res.data.column
  989. vm.getDoorHeader = res.data.header
  990. vm.datatotal = res.data.list.length
  991. }else{
  992. vm.loadingTwo = false
  993. vm.$message.error(res.msg)
  994. }
  995. })
  996. },
  997. getTreeList:function(){
  998. var vm=this
  999. statisticAPI.exportTreeList({rang:vm.rangeCode}).then(function(res){
  1000. if(res.status == 200){
  1001. // console.log(res,"Sddd")
  1002. vm.treedata = [],jindex=0
  1003. _.each(res.data,function(item,index){
  1004. vm.treedata.push({
  1005. id:"p_"+jindex,
  1006. label:index,
  1007. children:[]
  1008. })
  1009. _.each(item,function(citem,cindex){
  1010. vm.treedata[jindex].children.push({
  1011. id:cindex,
  1012. label:citem,
  1013. })
  1014. })
  1015. jindex++
  1016. })
  1017. }
  1018. })
  1019. },
  1020. beforeReq:function(flag){
  1021. var vm=this,startDate="",endDate="",checked=[]
  1022. if(vm.radio=="1"){
  1023. if(vm.chooseYear == 2022) {
  1024. startDate = '2022-07-01'
  1025. endDate = '2022-12-31'
  1026. }else if(vm.chooseYear > 2022) {
  1027. startDate = vm.chooseYear + '-01-01'
  1028. endDate = getEndDate(vm.chooseYear)
  1029. }else{
  1030. startDate = getStartDate(vm.chooseYear)
  1031. endDate = getEndDate(vm.chooseYear)
  1032. }
  1033. vm.timeLevel = 2
  1034. }else{
  1035. if(!vm.start&&!vm.end){
  1036. this.$message({
  1037. message: '请选择创建时间',
  1038. type: 'warning'
  1039. });
  1040. return false
  1041. }else{
  1042. if(vm.start>vm.end){
  1043. this.$message({
  1044. message: '开始时间应早于结束时间',
  1045. type: 'warning'
  1046. });
  1047. return false
  1048. }else{
  1049. startDate = vm.start
  1050. endDate = vm.end
  1051. vm.timeLevel = 1
  1052. }
  1053. }
  1054. }
  1055. if(vm.handleNodeId == 0 || vm.handleNodeId == 'huizongshuju') {
  1056. var checkTree
  1057. if(vm.tabsId == 1) {
  1058. checkTree = vm.$refs.tree.getCheckedNodes(true);
  1059. }else{
  1060. checkTree = vm.$refs.collectTree.getCheckedNodes(true);
  1061. }
  1062. if(checkTree.length){
  1063. if(!flag){
  1064. vm.tableHeader = []
  1065. }
  1066. _.each(checkTree,function(item,index){
  1067. if(!flag){
  1068. vm.tableHeader.push({prop:item.label,label:item.label})
  1069. }
  1070. checked.push(item.id)
  1071. })
  1072. }else{
  1073. this.$message({
  1074. message: '请选择搜索指标!',
  1075. type: 'warning'
  1076. });
  1077. return false
  1078. }
  1079. }else if(vm.handleNodeId == 2) {
  1080. this.$message({
  1081. message: '请选择明细查询!',
  1082. type: 'warning'
  1083. });
  1084. return false
  1085. }
  1086. return {start:startDate,end:endDate,checked:checked.join(",")}
  1087. },
  1088. // 查询
  1089. searchHandle:function(){
  1090. // console.log(this.beforeReq())
  1091. var vm = this
  1092. vm.searchJsonTime = vm.beforeReq()
  1093. vm.currentPage = 1
  1094. if(this.radio1 == 1) {this.radio1Show = true}else{this.radio1Show = false}
  1095. if(vm.handleNodeId == 0) {
  1096. if(vm.searchJsonTime){
  1097. vm.searchJson = {
  1098. startDate:vm.searchJsonTime.start,
  1099. endDate:vm.searchJsonTime.end,
  1100. quotaStr:vm.searchJsonTime.checked,
  1101. range:vm.rangeCode,
  1102. team:vm.teamCode,
  1103. hospital:vm.communityCode,
  1104. area:vm.areaCode=="350200"?"":vm.areaCode,
  1105. size:vm.currentSize,
  1106. page:vm.currentPage,
  1107. timeLevel: vm.timeLevel
  1108. }
  1109. vm.getStatisticDataList()
  1110. }
  1111. }else if(vm.handleNodeId == 33) {
  1112. // 咨询分析
  1113. vm.getConsultList()
  1114. }else if(vm.handleNodeId == 34) {
  1115. // 签约分析
  1116. vm.getSignList()
  1117. }else if(vm.handleNodeId == 35) {
  1118. // 专病分析
  1119. vm.getSickList()
  1120. }else if(vm.handleNodeId == 36) {
  1121. // 生日祝福分析
  1122. vm.getBirthdayPatientList()
  1123. }else if(vm.handleNodeId == 37) {
  1124. // 上门服务分析
  1125. vm.getDoorServiceList()
  1126. }else if(vm.handleNodeId == 38) {
  1127. // 长处方分析
  1128. vm.getPrescriptionList()
  1129. }else if(vm.handleNodeId == 39) {
  1130. // 体征数据
  1131. vm.physicalSignData()
  1132. }else if(vm.handleNodeId == 40) {
  1133. // 上转预约
  1134. vm.upTransferAppointment()
  1135. }else if(vm.handleNodeId == 41) {
  1136. // 微信绑定
  1137. vm.wechatBinding()
  1138. }else if(vm.collectCode == 1) {
  1139. // 专病汇总
  1140. vm.getSpecialDiseaseReport()
  1141. }else if(vm.collectCode == 2) {
  1142. // 体征数据汇总
  1143. vm.getDeviceHealthReport()
  1144. }else if(vm.collectCode == 3) {
  1145. // 上门服务汇总
  1146. vm.getDoorServerOrderReport()
  1147. }
  1148. },
  1149. getStatisticDataList:function(){
  1150. var vm = this
  1151. vm.isloading = true
  1152. var params=JSON.parse(JSON.stringify(vm.searchJson))
  1153. params.page = vm.currentPage
  1154. statisticAPI.getStatisticDataList(params).then(function(res){
  1155. if(res.status == 200) {
  1156. vm.tabledata = res.data.data
  1157. vm.datatotal = res.data.total
  1158. if(vm.tabledata.length){
  1159. vm.tableHeader=[]
  1160. _.each(vm.tabledata[0],function(item,index){
  1161. if(index!="town"&&index!="townName"&&index!="hospital"&&index!="hospitalName"&&index!="area"&&index!="areaName"&&index!="code"&&index!="name")
  1162. vm.tableHeader.push({prop:index,label:index})
  1163. })
  1164. }
  1165. } else {
  1166. vm.$message.error(res.msg)
  1167. }
  1168. vm.isloading = false
  1169. })
  1170. },
  1171. // 导出
  1172. exportHandle:function(){
  1173. // var uid = JSON.parse(window.localStorage.getItem('wlyyAgentForDoc')).uid
  1174. // var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
  1175. // saveAs(blob, "hello world.txt");
  1176. // return
  1177. var vm =this
  1178. var vm = this,searchJson=undefined
  1179. vm.fullscreenLoading = true
  1180. searchJson = vm.beforeReq('export')
  1181. var areaCode = vm.areaCode=="350200"?"":vm.areaCode
  1182. var chooseYear = vm.radio=='1'?vm.chooseYear:'' //年份
  1183. var startDate = vm.radio=='2'?vm.searchJsonTime.start:''
  1184. var endDate = vm.radio=='2'?vm.searchJsonTime.end:''
  1185. if(vm.handleNodeId == 0) {
  1186. if(searchJson){
  1187. statisticAPI.statisticsExportExport({
  1188. startDate: searchJson.start,
  1189. endDate: searchJson.end,
  1190. quotaStr: searchJson.checked,
  1191. range: vm.rangeCode,
  1192. area: areaCode,
  1193. hospital: vm.communityCode,
  1194. team: vm.teamCode,
  1195. timeLevel: vm.timeLevel,
  1196. }, "综合查询.xls").then(function(res){
  1197. vm.fullscreenLoading = false
  1198. // toastr.info("导出成功")
  1199. // var blob = new Blob(["Hello, world!"]);
  1200. // FileSaver.saveAs(blob, "hello world.txt");
  1201. // console.log(res)
  1202. // FileSaver()
  1203. })
  1204. .catch(function(err){
  1205. console.error(err)
  1206. })
  1207. // let str = httpRequest.server + 'statisticsExport/export?startDate='+searchJson.start+'&endDate='+searchJson.end+'&quotaStr='+searchJson.checked+'&range='+vm.rangeCode+'&area='+areaCode+'&hospital='+vm.communityCode+'&team='+vm.teamCode+'&timeLevel='+vm.timeLevel
  1208. // window.location.href = str
  1209. }
  1210. }else if(vm.handleNodeId == 33) {
  1211. // 咨询分析
  1212. if(vm.analyseData.length!=0) {
  1213. statisticAPI.statisticsExportExportConsultList({
  1214. year: chooseYear,
  1215. startDate: startDate,
  1216. endDate: endDate,
  1217. status: vm.radio1,
  1218. area: areaCode,
  1219. hospital: vm.communityCode,
  1220. rang:vm.rangeCode,
  1221. team: vm.teamCode,
  1222. },vm.derive+".xls").then(function(res){
  1223. vm.fullscreenLoading = false
  1224. // var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
  1225. // FileSaver.saveAs(blob, "hello world.txt");
  1226. // FileSaver()
  1227. })
  1228. .catch(function(err){
  1229. toastr.info(err)
  1230. vm.fullscreenLoading = false
  1231. console.error(err)
  1232. })
  1233. // var str = httpRequest.server + 'statisticsExport/exportConsultList?year='+chooseYear+'&startDate='+startDate+'&endDate='+endDate+
  1234. // '&status='+vm.radio1+'&area='+areaCode+'&hospital='+vm.communityCode+'&rang='+vm.rangeCode+'&team='+vm.teamCode
  1235. // window.location.href = str
  1236. }else{vm.fullscreenLoading = false}
  1237. }else if(vm.handleNodeId == 34) {
  1238. // 签约分析
  1239. if(vm.analyseData.length!=0) {
  1240. statisticAPI.statisticsExportExportSignList({
  1241. year: chooseYear,
  1242. startDate: startDate,
  1243. endDate: endDate,
  1244. serverType:vm.serverType,
  1245. status:vm.radio2,
  1246. isUpdate:vm.form.endorseTheTicket,
  1247. isAdd:vm.form.renew,
  1248. isOut:vm.form.backToSign,
  1249. isBindWX:vm.form.WeChat,
  1250. area: areaCode,
  1251. hospital: vm.communityCode,
  1252. rang:vm.rangeCode,
  1253. team: vm.teamCode,
  1254. },vm.derive+".xls").then(function(res){
  1255. vm.fullscreenLoading = false
  1256. })
  1257. .catch(function(err){
  1258. toastr.info(err)
  1259. vm.fullscreenLoading = false
  1260. console.error(err)
  1261. })
  1262. }else{vm.fullscreenLoading = false}
  1263. }else if(vm.handleNodeId == 35) {
  1264. // 专病分析
  1265. if(vm.analyseData.length!=0) {
  1266. statisticAPI.statisticsExportExportSickList({
  1267. year: chooseYear,
  1268. startDate: startDate,
  1269. endDate: endDate,
  1270. diseaseType:vm.diseaseDataType,
  1271. status:vm.radio3,
  1272. doctorName:vm.form2.juniorCollege,
  1273. familyDoctorName:vm.form2.family,
  1274. patientName:vm.form2.resident,
  1275. area: areaCode,
  1276. hospital: vm.communityCode,
  1277. rang:vm.rangeCode,
  1278. team: vm.teamCode,
  1279. },vm.derive+".xls").then(function(res){
  1280. vm.fullscreenLoading = false
  1281. })
  1282. .catch(function(err){
  1283. toastr.info(err)
  1284. vm.fullscreenLoading = false
  1285. console.error(err)
  1286. })
  1287. }else{vm.fullscreenLoading = false}
  1288. }else if(vm.handleNodeId == 36) {
  1289. // 生日祝福分析
  1290. if(vm.analyseData.length!=0) {
  1291. statisticAPI.statisticsExportGetBirthdayPatientListExport({
  1292. signYear: chooseYear,
  1293. startDate: startDate,
  1294. endDate: endDate,
  1295. patientName:vm.form3.resident,
  1296. doctorName:vm.form3.family,
  1297. status:vm.radio4,
  1298. area: areaCode,
  1299. hospital: vm.communityCode,
  1300. range:vm.rangeCode,
  1301. team: vm.teamCode,
  1302. pageSize:'50000',
  1303. page:vm.currentPage,
  1304. },vm.derive+".xls").then(function(res){
  1305. vm.fullscreenLoading = false
  1306. })
  1307. .catch(function(err){
  1308. toastr.info(err)
  1309. vm.fullscreenLoading = false
  1310. console.error(err)
  1311. })
  1312. }else{vm.fullscreenLoading = false}
  1313. }else if(vm.handleNodeId == 37) {
  1314. // 上门服务分析
  1315. if(vm.analyseData.length!=0) {
  1316. statisticAPI.statisticsExportExportDoorServiceList({
  1317. signYear: chooseYear,
  1318. startDate: startDate,
  1319. endDate: endDate,
  1320. patientName:vm.form4.resident,
  1321. doctorName:vm.form4.family,
  1322. status:vm.radio5,
  1323. type:vm.serviceTypeDataType,
  1324. area: areaCode,
  1325. hospital: vm.communityCode,
  1326. range:vm.rangeCode,
  1327. team: vm.teamCode,
  1328. pageSize:vm.currentSize,
  1329. page:vm.currentPage,
  1330. },vm.derive+".xls").then(function(res){
  1331. vm.fullscreenLoading = false
  1332. })
  1333. .catch(function(err){
  1334. toastr.info(err)
  1335. vm.fullscreenLoading = false
  1336. console.error(err)
  1337. })
  1338. }else{vm.fullscreenLoading = false}
  1339. }else if(vm.handleNodeId == 38) {
  1340. // 长处方分析
  1341. if(vm.analyseData.length!=0) {
  1342. statisticAPI.statisticsExportExportPrescriptionList({
  1343. signYear: chooseYear,
  1344. startDate: startDate,
  1345. endDate: endDate,
  1346. patientName:vm.form5.resident,
  1347. doctorName:vm.form5.family,
  1348. status:vm.radio6,
  1349. diagnosisName:vm.radio7,
  1350. dispensaryType:vm.radio8,
  1351. area: areaCode,
  1352. hospital: vm.communityCode,
  1353. range:vm.rangeCode,
  1354. team: vm.teamCode,
  1355. pageSize:vm.currentSize,
  1356. page:vm.currentPage,
  1357. },vm.derive+".xls").then(function(res){
  1358. vm.fullscreenLoading = false
  1359. })
  1360. .catch(function(err){
  1361. toastr.info(err)
  1362. vm.fullscreenLoading = false
  1363. console.error(err)
  1364. })
  1365. }else{vm.fullscreenLoading = false}
  1366. }else if(vm.handleNodeId == 39) {
  1367. // 体征数据
  1368. if(vm.getHealthData.length!=0) {
  1369. statisticAPI.exportHealthList(vm.getHealthParameter(),vm.derive+".xls").then(function(res){
  1370. vm.fullscreenLoading = false
  1371. })
  1372. .catch(function(err){
  1373. toastr.info(err)
  1374. vm.fullscreenLoading = false
  1375. console.error(err)
  1376. })
  1377. }else{vm.fullscreenLoading = false}
  1378. }else if(vm.handleNodeId == 40) {
  1379. // 上转预约
  1380. if(vm.reservationData.length!=0) {
  1381. statisticAPI.exportDoctorReservationList(vm.reservationParameter(),vm.derive+".xls").then(function(res){
  1382. vm.fullscreenLoading = false
  1383. })
  1384. .catch(function(err){
  1385. toastr.info(err)
  1386. vm.fullscreenLoading = false
  1387. console.error(err)
  1388. })
  1389. }else{vm.fullscreenLoading = false}
  1390. }else if(vm.handleNodeId == 41) {
  1391. // 微信绑定数据
  1392. if(vm.wexinBindingData.length!=0) {
  1393. statisticAPI.exportWexinBindingList(vm.wexinBindingParameter(),vm.derive+".xls").then(function(res){
  1394. vm.fullscreenLoading = false
  1395. })
  1396. .catch(function(err){
  1397. toastr.info(err)
  1398. vm.fullscreenLoading = false
  1399. console.error(err)
  1400. })
  1401. }else{vm.fullscreenLoading = false}
  1402. }else if(vm.collectCode == 1) {
  1403. // 专病汇总
  1404. if(vm.diseaseReport.length!=0) {
  1405. statisticAPI.exportSpecialDiseaseReport(vm.getSpecialParameter(),vm.derive+".xls").then(function(res){
  1406. vm.fullscreenLoading = false
  1407. })
  1408. .catch(function(err){
  1409. toastr.info(err)
  1410. vm.fullscreenLoading = false
  1411. console.error(err)
  1412. })
  1413. }else{vm.fullscreenLoading = false}
  1414. }else if(vm.collectCode == 2) {
  1415. // 体征分析
  1416. if(vm.getDeviceReport.length!=0) {
  1417. statisticAPI.exportDeviceHealthReport(vm.getDeviceParameter(),vm.derive+".xls").then(function(res){
  1418. vm.fullscreenLoading = false
  1419. })
  1420. .catch(function(err){
  1421. toastr.info(err)
  1422. vm.fullscreenLoading = false
  1423. console.error(err)
  1424. })
  1425. }else{vm.fullscreenLoading = false}
  1426. }else if(vm.collectCode == 3) {
  1427. // 上门汇总
  1428. if(vm.getDoorReport.length!=0) {
  1429. statisticAPI.exportDoorServerOrderReport(vm.getDoorParameter(),vm.derive+".xls").then(function(res){
  1430. vm.fullscreenLoading = false
  1431. })
  1432. .catch(function(err){
  1433. toastr.info(err)
  1434. vm.fullscreenLoading = false
  1435. console.error(err)
  1436. })
  1437. }else{vm.fullscreenLoading = false}
  1438. }
  1439. },
  1440. backClick:function(){
  1441. history.go(-1);
  1442. },
  1443. bindEvent:function(){
  1444. var vm=this
  1445. //监听后退按钮的操作
  1446. EventBus.$on("back-click", function (arg) {
  1447. EventBus.$emit('update-statistics-time', {}); //更新统计时间
  1448. vm.backClick()
  1449. });
  1450. //监听页面刷新
  1451. EventBus.$on("refresh-click", function (arg) {
  1452. EventBus.$emit('update-statistics-time', {}); //更新统计时间
  1453. initData(vm)
  1454. });
  1455. $("#main").removeClass("c-hide");
  1456. },
  1457. // 下一页 上一页
  1458. handleCurrentChange:function(val) {
  1459. var vm = this
  1460. vm.currentPage = val
  1461. if(vm.handleNodeId == 0) {
  1462. vm.getStatisticDataList()
  1463. }else if(vm.handleNodeId == 33) {
  1464. // 咨询分析
  1465. vm.getConsultList()
  1466. }else if(vm.handleNodeId == 34) {
  1467. // 签约分析
  1468. vm.getSignList()
  1469. }else if(vm.handleNodeId == 35) {
  1470. // 专病分析
  1471. vm.getSickList()
  1472. }else if(vm.handleNodeId == 36) {
  1473. // 生日祝福分析
  1474. vm.getBirthdayPatientList()
  1475. }else if(vm.handleNodeId == 37) {
  1476. // 上门服务分析
  1477. vm.getDoorServiceList()
  1478. }else if(vm.handleNodeId == 38) {
  1479. // 长处方分析
  1480. vm.getPrescriptionList()
  1481. }else if(vm.handleNodeId == 39) {
  1482. // 体征数据
  1483. vm.physicalSignData()
  1484. }else if(vm.handleNodeId == 40) {
  1485. // 上转预约
  1486. vm.upTransferAppointment()
  1487. }else if(vm.handleNodeId == 41) {
  1488. // 微信绑定
  1489. vm.wechatBinding()
  1490. }
  1491. },
  1492. //获取省市区 type:区3
  1493. getDistrict: function(type,code,name) {
  1494. var vm=this,list = [],param=""
  1495. if(type == 3){
  1496. list = [{code:code,name:name}]
  1497. param = "area"
  1498. }else if(type == 5){
  1499. list = [{code:"",name:"全部"}]
  1500. param = "community"
  1501. }
  1502. var params={
  1503. type:type,code:code
  1504. }
  1505. homeAPI.getDistrict(params).then(function(res) {
  1506. if(res.status == 200) {
  1507. vm[param+"List"]=list.concat(res.list)
  1508. vm[param+"Code"]=vm[param+"List"][0].code
  1509. } else {
  1510. vm.$message.error(res.msg)
  1511. }
  1512. })
  1513. },
  1514. selChange:function(type){
  1515. var vm=this,name=""
  1516. if(type == 3){
  1517. vm.initSelOption("community")
  1518. vm.initSelOption("team")
  1519. vm.getCommunityHospital()
  1520. }else if(type == 5){
  1521. vm.initSelOption("team")
  1522. vm.teamListByArea()
  1523. }
  1524. },
  1525. initSelOption:function(param){
  1526. var vm=this
  1527. vm[param+"List"]=[{code:"",name:"全部"}]
  1528. if(param == "team"){
  1529. vm[param+"List"]=[{id:"",name:"全部"}]
  1530. }
  1531. vm[param+"Code"]=vm[param+"List"][0].code||vm[param+"List"][0].id
  1532. },
  1533. getCommunityHospital:function() {
  1534. var vm=this,list = [{code:"",name:"全部"}],param="community"
  1535. homeAPI.getCommunityHospital({area:vm.areaCode=='350200'?"":vm.areaCode}).then(function(res) {
  1536. if(res.status == 200) {
  1537. vm[param+"List"]=list.concat(res.data)
  1538. vm[param+"Code"]=vm[param+"List"][0].code
  1539. } else {
  1540. vm.$message.error(res.msg)
  1541. }
  1542. })
  1543. },
  1544. teamListByArea:function() {
  1545. var vm=this,list = [{id:"",name:"全部"}],param="team"
  1546. homeAPI.teamListByArea({area:vm.areaCode=='350200'?"":vm.areaCode,hospital:vm.communityCode}).then(function(res) {
  1547. if(res.status == 200) {
  1548. vm[param+"List"]=list.concat(res.data)
  1549. vm[param+"Code"]=vm[param+"List"][0].id
  1550. } else {
  1551. vm.$message.error(res.msg)
  1552. }
  1553. })
  1554. }
  1555. },
  1556. })
  1557. // 初始化时间
  1558. function initTime(vm){
  1559. var now = new Date();
  1560. vm.end = now.format("yyyy-MM-dd")
  1561. var start = now.getTime() - 30*24*60*60*1000
  1562. vm.start = new Date(start).format("yyyy-MM-dd")
  1563. vm.nowyear = vm.chooseYear = now.getFullYear()
  1564. vm.nowmonth = now.getMonth()+1
  1565. vm.years = []
  1566. for(i=vm.nowyear; i>=2016; i--){
  1567. vm.years.push(i)
  1568. }
  1569. }
  1570. // 数据范围初始化
  1571. function initScope(vm) {
  1572. //获得缓存中缓存的角色权限
  1573. var userRole = window.sessionStorage.getItem("selectedRole");
  1574. if (!userRole) {
  1575. return false;
  1576. }
  1577. vm.userRole = JSON.parse(userRole);
  1578. //level:2、市,3、区,4、社区,5、团队
  1579. vm.initareaLevel = vm.areaLevel = vm.userRole.code == '350200' ? 2 : vm.userRole.code.length == 6 ? 3 : 4;
  1580. vm.initlevel = vm.level = vm.userRole.code == '350200' ? 4 : vm.userRole.code.length == 6 ? 3 : 2;
  1581. // vm.lowLevel = vm.initlowLevel = vm.userRole.code == '350200' ? 3 : vm.userRole.code.length == 6 ? 2 : 1;
  1582. vm.initarea =vm.area = vm.userRole.code;
  1583. vm.areaTitle = vm.userRole.name;
  1584. vm.rangeList=[{name:"按区",code:"town"},{name:"按社区",code:"hospital"},{name:"按团队",code:"team"}]
  1585. if(vm.initlevel == 4){ //市获取区
  1586. vm.getDistrict(3,vm.initarea,vm.areaTitle.substr(0,3))
  1587. vm.rangeCode = vm.rangeList[0].code
  1588. }else if(vm.initlevel == 3){ //区获取社区
  1589. vm.areaList = [{code:vm.initarea,name:vm.areaTitle}]
  1590. vm.areaCode = vm.initarea
  1591. vm.rangeCode = vm.rangeList[0].code
  1592. }else if(vm.initlevel == 2){ //社区获取团队
  1593. vm.communityList = [{code:vm.initarea,name:vm.areaTitle}]
  1594. vm.communityCode = vm.initarea
  1595. vm.rangeList.shift()
  1596. vm.rangeCode = vm.rangeList[0].code
  1597. }
  1598. vm.searchJson.range = vm.rangeCode
  1599. }
  1600. function initData(vm) {
  1601. initScope(vm)
  1602. //初始化时间
  1603. initTime(vm)
  1604. vm.tabledata = []
  1605. vm.bindEvent()
  1606. }