comprehensive-query.js 63 KB

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