comprehensive-query.js 51 KB

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