comprehensive-query.js 82 KB

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