comprehensive-query.js 57 KB

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