comprehensive-query.js 57 KB

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