basicInformationAnalysis.vue 52KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <div class="cell clearfix">
  8. <label class="title">
  9. <span class="name">日期查询</span> :
  10. </label>
  11. <div class="time">
  12. <ul class>
  13. <li
  14. :class="item.state == stateType ? 'active' : ''"
  15. @click="selectLapseTo(item.state)"
  16. v-for="item in month"
  17. :key="item.value"
  18. >{{ item.label }}</li>
  19. </ul>
  20. </div>
  21. </div>
  22. <div class="cell clearfix">
  23. <label class="title">
  24. <span class="name">查看范围</span> :
  25. </label>
  26. <div class="time">
  27. <ul class>
  28. <li
  29. :class="item.state == way ? 'active' : ''"
  30. @click="selectWay(item.state)"
  31. v-for="item in wayArr"
  32. :key="item.value"
  33. >{{ item.label }}</li>
  34. </ul>
  35. </div>
  36. </div>
  37. <div class="cell clearfix">
  38. <label class="title">
  39. <span class="name">日期查询</span> :
  40. </label>
  41. <el-date-picker
  42. v-model="listQuery.start_time"
  43. prefix-icon="el-icon-date"
  44. @change="changeTime"
  45. :editable="false"
  46. style="width: 196px;"
  47. type="date"
  48. placeholder="选择日期时间"
  49. align="right"
  50. format="yyyy-MM-dd"
  51. value-format="yyyy-MM-dd"
  52. :picker-options="pickerOptions"
  53. ></el-date-picker>
  54. <span class>-</span>
  55. <el-date-picker
  56. v-model="listQuery.end_time"
  57. prefix-icon="el-icon-date"
  58. @change="changeEndTime"
  59. :editable="false"
  60. style="width: 196px;"
  61. type="date"
  62. placeholder="选择日期时间"
  63. align="right"
  64. format="yyyy-MM-dd"
  65. value-format="yyyy-MM-dd"
  66. :picker-options="pickerOptions"
  67. ></el-date-picker>
  68. </div>
  69. <div class="cell clearfix">
  70. <label class="title"><span class="name">转归情况</span> : </label>
  71. <div class="time ">
  72. <ul class="">
  73. <li
  74. :class="item.lapseto == lapsetoType ? 'active' : ''"
  75. @click="selectLapseOne(item.lapseto)"
  76. v-for="item in lapsetoArr"
  77. :key="item.value"
  78. >
  79. {{ item.label }}
  80. </li>
  81. </ul>
  82. </div>
  83. </div>
  84. <div class="cell clearfix">
  85. <label class="title"><span class="name">病人来源</span> : </label>
  86. <div class="time ">
  87. <ul class="">
  88. <li
  89. :class="item.source == sourceType ? 'active' : ''"
  90. @click="selectSource(item.source)"
  91. v-for="item in sourceArr"
  92. :key="item.value"
  93. >
  94. {{ item.label }}
  95. </li>
  96. </ul>
  97. </div>
  98. </div>
  99. <div class="cell clearfix" v-show="treatShow">
  100. <label class="title">
  101. <span class="name">透析模式</span> :
  102. </label>
  103. <div class="time">
  104. <ul class>
  105. <li
  106. :class="item.state == stateMode ? 'active' : ''"
  107. @click="selectTreatMode(item.state)"
  108. v-for="item in treatmentMode"
  109. :key="item.mode_id"
  110. >{{ item.name }}</li>
  111. </ul>
  112. </div>
  113. </div>
  114. <div v-if="way == 0" class="cell clearfix" style="align-items:normal">
  115. <div style="float:left">
  116. <div class="infoBox" style="width:370px;">
  117. <div class="infoOne">
  118. <div class="titleBox">
  119. <span class="point"></span>
  120. <p class="infoTitle">透析总量({{total}}次)</p>
  121. </div>
  122. <div class="borderBox">
  123. <div v-for="(item,index) in modetype" :key="index">
  124. <span v-if="item.mode_id == 'HD'">
  125. <p>HD:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  126. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  127. </span>
  128. <span v-if="item.mode_id == 'HDF'">
  129. <p>HDF:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  130. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  131. </span>
  132. <span v-if="item.mode_id == 'HD+HP'">
  133. <p>HD+HP:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  134. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  135. </span>
  136. <span v-if="item.mode_id == 'HP'">
  137. <p>HP:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  138. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  139. </span>
  140. <span v-if="item.mode_id == 'HF'">
  141. <p>HF:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  142. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  143. </span>
  144. <span v-if="item.mode_id == 'SCUF'">
  145. <p>SCUF:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  146. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  147. </span>
  148. <span v-if="item.mode_id == 'IUF'">
  149. <p>IUF:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  150. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  151. </span>
  152. <span v-if="item.mode_id == 'HFHD'">
  153. <p>HFHD:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  154. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  155. </span>
  156. <span v-if="item.mode_id == 'HFHD+HP'">
  157. <p>HFHD+HP:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  158. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  159. </span>
  160. <span v-if="item.mode_id == 'PHF'">
  161. <p>PHF:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  162. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  163. </span>
  164. <span v-if="item.mode_id == 'HFR'">
  165. <p>HFR:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  166. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  167. </span>
  168. <span v-if="item.mode_id == 'HDF+HP'">
  169. <p>HDF+HP:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  170. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  171. </span>
  172. <span v-if="item.mode_id == 'HFHD+HP'">
  173. <p>HFHD+HP:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  174. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  175. </span>
  176. <span v-if="item.mode_id == '腹水回输'">
  177. <p>腹水回输:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  178. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  179. </span>
  180. <span v-if="item.mode_id == 'HD前置换'">
  181. <p>HD前置换:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  182. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  183. </span>
  184. <span v-if="item.mode_id == 'HD后置换'">
  185. <p>HD后置换:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  186. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  187. </span>
  188. <span v-if="item.mode_id == 'HDF前置换'">
  189. <p>HDF前置换:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  190. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  191. </span>
  192. <span v-if="item.mode_id == 'HDF后置换'">
  193. <p>HDF后置换:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  194. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  195. </span>
  196. <span v-if="item.mode_id == 'IUF+HD'">
  197. <p>IUF+HD:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
  198. <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
  199. </span>
  200. </div>
  201. </div>
  202. </div>
  203. <div class="infoOne">
  204. <div class="titleBox">
  205. <span class="point2"></span>
  206. <p class="infoTitle">传染病统计</p>
  207. </div>
  208. <div class="borderBox2">
  209. <div v-for="(item,i) in this.InfectiousList" :key="i">
  210. <span v-if="item.disease_id == 2">
  211. <p>乙肝:{{item.count}}人({{(item.count/InfectiousTotal*100).toFixed(1)}}%)</p>
  212. <el-progress :percentage="(item.count/InfectiousTotal*100).toFixed(1)"></el-progress>
  213. </span>
  214. <span v-if="item.disease_id == 3">
  215. <p>丙肝:{{item.count}}人({{(item.count/InfectiousTotal*100).toFixed(1)}}%)</p>
  216. <el-progress :percentage="(item.count/InfectiousTotal*100).toFixed(1)"></el-progress>
  217. </span>
  218. <span v-if="item.disease_id == 4">
  219. <p>艾滋病:{{item.count}}人({{(item.count/InfectiousTotal*100).toFixed(1)}}%)</p>
  220. <el-progress :percentage="(item.count/InfectiousTotal*100).toFixed(1)"></el-progress>
  221. </span>
  222. <span v-if="item.disease_id == 5">
  223. <p>肺结核:{{item.count}}人({{(item.count/InfectiousTotal*100).toFixed(1)}}%)</p>
  224. <el-progress :percentage="(item.count/InfectiousTotal*100).toFixed(1)"></el-progress>
  225. </span>
  226. <span v-if="item.disease_id == 6">
  227. <p>梅毒:{{item.count}}人({{(item.count/InfectiousTotal*100).toFixed(1)}}%)</p>
  228. <el-progress :percentage="(item.count/InfectiousTotal*100).toFixed(1)"></el-progress>
  229. </span>
  230. <span v-if="item.disease_id == 1">
  231. <p>其他:{{item.count}}人({{((item.count)/InfectiousTotal*100).toFixed(1)}}%)</p>
  232. <el-progress :percentage="((item.count)/InfectiousTotal*100).toFixed(1)"></el-progress>
  233. </span>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. <div style="float:left">
  240. <div class="infoBox">
  241. <div class="infoOne">
  242. <div class="titleBox">
  243. <span class="point1"></span>
  244. <p class="infoTitle">转归统计(总人数{{patientCount}}人)</p>
  245. </div>
  246. <div class="borderBox1">
  247. <span v-if="lapsetoType == 0 || lapsetoType == 1"><p>留治:{{rollOutTotal}}人({{(rollOutTotal/patientCount*100).toFixed(1)}}%)</p>
  248. <el-progress :percentage="(rollOutTotal/patientCount*100).toFixed(1)"></el-progress>
  249. </span>
  250. <span v-if="lapsetoType == 0 || lapsetoType == 2"><p>转出:{{outTotal}}人({{(outTotal/patientCount*100).toFixed(1)}}%)</p>
  251. <el-progress :percentage="(outTotal/patientCount*100).toFixed(1)"></el-progress>
  252. </span>
  253. </div>
  254. </div>
  255. <div class="infoOne">
  256. <div class="titleBox">
  257. <span class="point2"></span>
  258. <p class="infoTitle">男女比例</p>
  259. </div>
  260. <div class="borderBox2">
  261. <p>男:{{totalMan}}人({{(totalMan/totalGender*100).toFixed(1)}}%)</p>
  262. <el-progress :percentage="(totalMan/totalGender*100).toFixed(1)"></el-progress>
  263. <p>女:{{totalWoman}}人({{(totalWoman/totalGender*100).toFixed(1)}}%)</p>
  264. <el-progress :percentage="(totalWoman/totalGender*100).toFixed(1)"></el-progress>
  265. </div>
  266. </div>
  267. <div class="infoOne">
  268. <div class="titleBox">
  269. <span class="point"></span>
  270. <p class="infoTitle">年龄统计</p>
  271. </div>
  272. <div class="borderBox">
  273. <div v-for="(item,j) in ageCount" :key="j">
  274. <span v-if="item.age == 20">
  275. <p>年龄≤20:{{item.count}}人({{(item.count/ageTotal*100).toFixed(1)}}%)</p>
  276. <el-progress :percentage="(item.count/ageTotal*100).toFixed(1)"></el-progress>
  277. </span>
  278. <span v-if="item.age == 40">
  279. <p>20&lt;年龄≤40:{{item.count}}人({{(item.count/ageTotal*100).toFixed(1)}}%)</p>
  280. <el-progress :percentage="(item.count/ageTotal*100).toFixed(1)"></el-progress>
  281. </span>
  282. <span v-if="item.age == 60">
  283. <p>40&lt;年龄≤60:{{item.count}}人({{(item.count/ageTotal*100).toFixed(1)}}%)</p>
  284. <el-progress :percentage="(item.count/ageTotal*100).toFixed(1)"></el-progress>
  285. </span>
  286. <span v-if="item.age == 80">
  287. <p>60&lt;年龄≤80:{{item.count}}人({{(item.count/ageTotal*100).toFixed(1)}}%)</p>
  288. <el-progress :percentage="(item.count/ageTotal*100).toFixed(1)"></el-progress>
  289. </span>
  290. <span v-if="item.age ==150">
  291. <p>大于80:{{item.count}}人({{(item.count/ageTotal*100).toFixed(1)}}%)</p>
  292. <el-progress :percentage="(item.count/ageTotal*100).toFixed(1)"></el-progress>
  293. </span>
  294. </div>
  295. </div>
  296. </div>
  297. <div class="infoOne">
  298. <div class="titleBox">
  299. <span class="point1"></span>
  300. <p class="infoTitle">透龄统计</p>
  301. </div>
  302. <div class="borderBox1">
  303. <div v-for="(item,index) in dialysisAge" :key="index">
  304. <span v-if="item.age== 1">
  305. <p>透析龄≤12:{{item.count}}人({{(item.count/patientCount*100).toFixed(1)}}%)</p>
  306. <el-progress :percentage="(item.count/patientCount*100).toFixed(1)"></el-progress>
  307. </span>
  308. <span v-if="item.age == 2">
  309. <p>12&lt;透析龄≤36:{{item.count}}人({{(item.count/patientCount*100).toFixed(1)}}%)</p>
  310. <el-progress :percentage="(item.count/patientCount*100).toFixed(1)"></el-progress>
  311. </span>
  312. <span v-if="item.age == 3">
  313. <p>36≤透析龄≤60:{{item.count}}/人({{(item.count/patientCount*100).toFixed(1)}}%)</p>
  314. <el-progress :percentage="(item.count/patientCount*100).toFixed(1)"></el-progress>
  315. </span>
  316. <span v-if="item.age == 4">
  317. 透析龄 ≥60:{{item.count}}人({{((item.count)/patientCount*100).toFixed(1)}}%)
  318. <el-progress :percentage="((item.count)/patientCount*100).toFixed(1)"></el-progress>
  319. </span>
  320. </div>
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. </div>
  326. <div v-else>
  327. <div style="margin-bottom:20px;">
  328. <p style="font-size: 16px;font-weight: bold;color: #000;">透析总量</p>
  329. <line-chart :options="chart"></line-chart>
  330. </div>
  331. <div>
  332. <div class="cell clearfix" v-show="treatShow">
  333. <label class="title">
  334. <span class="name">转归状态</span> :
  335. </label>
  336. <div class="time">
  337. <ul class>
  338. <li
  339. :class="item.state == lapseMode ? 'active' : ''"
  340. @click="selectLapsetoMode(item.state)"
  341. v-for="item in lapsetoMode"
  342. :key="item.value"
  343. >{{ item.label }}</li>
  344. </ul>
  345. </div>
  346. </div>
  347. <p style="font-size: 16px;font-weight: bold;color: #000;">转归统计</p>
  348. <line-chart :options="bar"></line-chart>
  349. </div>
  350. </div>
  351. </div>
  352. </div>
  353. </template>
  354. <script>
  355. const moment = require('moment')
  356. import echarts from "echarts";
  357. import { GetOICData } from "@/api/qcd";
  358. import PieChart from "../qcd/components/BarChart";
  359. import { uParseTime } from "@/utils/tools";
  360. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  361. import LineChart from "../qcd/components/LineChart";
  362. import {getDialysisModeType,getTotalLapseCount,getTotalSexCount,getTotalInfectiousCount,getTotalAgeCount,getTotalDialysisCount,getTreatModeList,getCountModeId,getRolloutCount} from "@/api/common/common"
  363. export default {
  364. name: "dialysisTotal",
  365. components: {
  366. PieChart,
  367. BreadCrumb,
  368. LineChart
  369. },
  370. data() {
  371. return {
  372. pickerOptions: {
  373. disabledDate(time) {
  374. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
  375. return time.getTime() > Date.now() || time.getTime() < threeMonths;;
  376. }
  377. },
  378. crumbs: [
  379. { path: false, name: "质控管理" },
  380. { path: false, name: "基本信息统计" }
  381. ],
  382. listQuery: {
  383. start_time: "",
  384. end_time: "",
  385. page: 1,
  386. limit: 10
  387. },
  388. stateType: 0,
  389. month: [
  390. { value: 0, label: "本月", state: 0 },
  391. { value: 1, label: "近三月", state: 1 },
  392. { value: 2, label: "近半年", state: 2 },
  393. { value: 3, label: "近一年", state: 3 }
  394. // { value:4,label:"自定义",state:4}
  395. ],
  396. modetype:[],
  397. total:0,
  398. patientCount:0,
  399. rollOut:0,
  400. RetentionCount:0,
  401. totalMan:0,
  402. totalWoman:0,
  403. totalGender:0,
  404. InfectiousList:[],
  405. InfectiousTotal:0,
  406. ageCount:[],
  407. ageTotal:0,
  408. otherTotal:0,
  409. totalone:0,
  410. totaltwo:0,
  411. totalthree:0,
  412. rollOutTotal:0,
  413. outTotal:0,
  414. dialysisAge:[],
  415. start:0,
  416. end:0,
  417. lapsetoType: 0,
  418. lapsetoArr: [
  419. { value: 0, label: '全部', source: 0, lapseto: 0 },
  420. { value: 1, label: '转出', source: 0, lapseto: 2 },
  421. { value: 2, label: '留治', source: 0, lapseto: 1 },
  422. // { value: 3, label: '死亡', source:0, lapseto: 3 },
  423. ],
  424. sourceType: 0,
  425. sourceArr: [
  426. { value: 0, label: '全部', source: 0, lapseto: 0 },
  427. { value: 3, label: '门诊', source: 1, lapseto: 1 },
  428. { value: 4, label: '住院', source: 2, lapseto: 1 }
  429. ],
  430. way: 0,
  431. wayArr: [
  432. { value: 0, label: "统计图", state: 0 },
  433. { value: 1, label: "趋势图", state: 1 }
  434. ],
  435. modesData: {
  436. xAxis: [],
  437. series: []
  438. },
  439. modesDataTwo:{
  440. xAxis:[],
  441. series:[]
  442. },
  443. chart: {
  444. title: {
  445. text: "ECharts 入门示例"
  446. },
  447. tooltip: {},
  448. legend: {
  449. data: [],
  450. left: 0
  451. },
  452. xAxis: {
  453. data: []
  454. },
  455. yAxis: {
  456. axisLabel: {
  457. formatter: "{value} %"
  458. },
  459. show: false
  460. },
  461. series: [
  462. {
  463. name: "",
  464. type: "line",
  465. data: [],
  466. barWidth: 30,
  467. label: {
  468. normal: {
  469. show: true,
  470. position: "top",
  471. formatter: "{c}次"
  472. }
  473. },
  474. //配置样式
  475. itemStyle: {
  476. //通常情况下:
  477. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  478. normal: {
  479. color: function(params) {
  480. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  481. var colorList = [
  482. ["#A9E0F3", "#9FBDFC"],
  483. ["#FFD7C0", "#FF9994"]
  484. ];
  485. var index = params.dataIndex;
  486. if (params.dataIndex >= colorList.length) {
  487. index = params.dataIndex % colorList.length;
  488. }
  489. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  490. { offset: 0, color: colorList[index][0] },
  491. // { offset: 0.5, color: colorList[index][1] },
  492. { offset: 1, color: colorList[index][1] }
  493. ]);
  494. },
  495. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  496. },
  497. //鼠标悬停时:
  498. emphasis: {
  499. shadowBlur: 10,
  500. shadowOffsetX: 0,
  501. shadowColor: "rgba(0, 0, 0, 0.2)"
  502. }
  503. }
  504. }
  505. ],
  506. dataZoom: [
  507. {
  508. // Y轴固定,让内容滚动
  509. type: 'slider',
  510. show: false,
  511. xAxisIndex: [0],
  512. start: 1,
  513. end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
  514. zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
  515. },
  516. {
  517. type: 'inside',
  518. xAxisIndex: [0],
  519. start: 1,
  520. end: 20,
  521. zoomLock: true // 锁定区域禁止缩放
  522. }
  523. ],
  524. },
  525. bar: {
  526. title: {
  527. text: "ECharts 入门示例"
  528. },
  529. tooltip: {},
  530. legend: {
  531. data: [],
  532. left: 0
  533. },
  534. xAxis: {
  535. data: []
  536. },
  537. yAxis: {
  538. axisLabel: {
  539. formatter: "{value} %"
  540. },
  541. show: false
  542. },
  543. series: [
  544. {
  545. name: "",
  546. type: "line",
  547. data: [],
  548. barWidth: 30,
  549. label: {
  550. normal: {
  551. show: true,
  552. position: "top",
  553. formatter: "{c}次"
  554. }
  555. },
  556. //配置样式
  557. itemStyle: {
  558. //通常情况下:
  559. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  560. normal: {
  561. color: function(params) {
  562. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  563. var colorList = [
  564. ["#A9E0F3", "#9FBDFC"],
  565. ["#FFD7C0", "#FF9994"]
  566. ];
  567. var index = params.dataIndex;
  568. if (params.dataIndex >= colorList.length) {
  569. index = params.dataIndex % colorList.length;
  570. }
  571. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  572. { offset: 0, color: colorList[index][0] },
  573. // { offset: 0.5, color: colorList[index][1] },
  574. { offset: 1, color: colorList[index][1] }
  575. ]);
  576. },
  577. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  578. },
  579. //鼠标悬停时:
  580. emphasis: {
  581. shadowBlur: 10,
  582. shadowOffsetX: 0,
  583. shadowColor: "rgba(0, 0, 0, 0.2)"
  584. }
  585. }
  586. }
  587. ],
  588. dataZoom: [
  589. {
  590. // Y轴固定,让内容滚动
  591. type: 'slider',
  592. show: false,
  593. xAxisIndex: [0],
  594. start: 1,
  595. end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
  596. zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
  597. },
  598. {
  599. type: 'inside',
  600. xAxisIndex: [0],
  601. start: 1,
  602. end: 20,
  603. zoomLock: true // 锁定区域禁止缩放
  604. }
  605. ],
  606. },
  607. treatmentMode:[],
  608. stateMode:1,
  609. lapseMode:0,
  610. treatShow:false,
  611. mode_id:0,
  612. lapsetoMode:[
  613. { value: 0, label: "留治", state: 0 },
  614. { value: 1, label: "转出", state: 1}
  615. ],
  616. lapseid:0,
  617. startDate:"",
  618. endDate:"",
  619. };
  620. },
  621. methods: {
  622. getTimestamp(time) {
  623. // 把时间日期转成时间戳
  624. return new Date(time).getTime() / 1000;
  625. },
  626. changeTime(val) {
  627. this.stateType = 4
  628. var timeStar=Date.parse(val)/1000
  629. var timeEnd =Date.parse(this.listQuery.end_time)/1000
  630. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  631. if (time > 0) {
  632. this.$message.error("结束时间不能小于开始时间");
  633. this.start_time = "";
  634. } else {
  635. //统计透析总量
  636. this.getDialysisModeType(val,this.listQuery.end_time,this.lapsetoType,this.sourceType)
  637. //统计转归状态
  638. this.getTotalLapseCount(this.listQuery.start_time,this.listQuery.end_time,this.lapsetoType,this.sourceType)
  639. //统计男女比例
  640. this.getTotalSexCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  641. //统计传染病
  642. this.getTotalInfectiousCount(this.listQuery.start_time,this.listQuery.end_time,this.lapsetoType,this.sourceType)
  643. //统计年龄
  644. this.getTotalAgeCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  645. //统计透析年龄
  646. this.getTotalDialysisCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  647. this.start = timeStar
  648. this.end =timeEnd
  649. this.getCountModeId()
  650. this.getRolloutCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  651. }
  652. },
  653. changeEndTime(val) {
  654. this.stateType = 4
  655. var timeEnd=Date.parse(val)/1000
  656. var timeStar =Date.parse(this.listQuery.start_time)/1000
  657. var time =
  658. this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
  659. if (time < 0) {
  660. this.$message.error("结束时间不能小于开始时间");
  661. this.listQuery.end_time = "";
  662. } else {
  663. //统计透析总量
  664. this.getDialysisModeType(this.listQuery.start_time,val,this.lapsetoType,this.sourceType)
  665. //统计转归状态
  666. this.getTotalLapseCount(this.listQuery.start_time,this.listQuery.end_time,this.lapsetoType,this.sourceType)
  667. //统计男女比例
  668. this.getTotalSexCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  669. //统计传染病
  670. this.getTotalInfectiousCount(this.listQuery.start_time,this.listQuery.end_time,this.lapsetoType,this.sourceType)
  671. //统计年龄
  672. this.getTotalAgeCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  673. //统计透析年龄
  674. this.getTotalDialysisCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  675. this.start = timeStar
  676. this.end =timeEnd
  677. this.getCountModeId()
  678. this.getRolloutCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  679. }
  680. },
  681. selectLapseTo(state) {
  682. this.stateType = state;
  683. this.listQuery.state = state;
  684. //获取本月当前机构的透析模式
  685. const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
  686. const endDate = moment(new Date()).format('YYYY-MM-DD')
  687. var now = new Date()
  688. var nowMonth = now.getMonth(); //当前月
  689. var nowYear = now.getFullYear(); //当前年
  690. //本月的开始时间
  691. var monthStartDate = new Date(nowYear, nowMonth, 1);
  692. var timeStar=Date.parse(monthStartDate)/1000;//s
  693. // console.log("本月第一天",timeStar)
  694. //本月的结束时间
  695. var monthEndDate = new Date(nowYear, nowMonth+1, 0);
  696. var timeEnd=Date.parse(monthEndDate)/1000-1;//s
  697. // console.log("本月最后一天",timeEnd)
  698. //本月
  699. if(state == 0){
  700. //统计透析总量
  701. this.getDialysisModeType(startDate,endDate,this.lapsetoType,this.sourceType)
  702. //统计转归状态
  703. this.getTotalLapseCount(startDate,endDate,this.lapsetoType,this.sourceType)
  704. //统计男女比例
  705. this.getTotalSexCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  706. //统计传染病
  707. this.getTotalInfectiousCount(startDate,endDate,this.lapsetoType,this.sourceType)
  708. //统计年龄
  709. this.getTotalAgeCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  710. //统计透析年龄
  711. this.getTotalDialysisCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  712. this.start = timeStar
  713. this.end = timeEnd
  714. this.getCountModeId()
  715. this.getRolloutCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  716. }
  717. //近三月
  718. if(state == 1){
  719. this.listQuery.start_time = ""
  720. this.listQuery.end_time = ""
  721. const startDate = moment().subtract('month', 3).format('YYYY-MM-DD')
  722. var startunitx = Date.parse(startDate)/1000
  723. // console.log("开始时间搓",startunitx)
  724. const endDate = moment(new Date()).format('YYYY-MM-DD')
  725. // console.log("结束时间",endDate)
  726. var endunitx = Date.parse(endDate)/1000
  727. // console.log("日期时间搓",endunitx)
  728. //统计透析总量
  729. this.getDialysisModeType(startDate,endDate,this.lapsetoType,this.sourceType)
  730. //统计转归状态
  731. this.getTotalLapseCount(startDate,endDate,this.lapsetoType,this.sourceType)
  732. //统计男女比例
  733. this.getTotalSexCount(startunitx,endunitx,this.lapsetoType,this.sourceType)
  734. //统计传染病
  735. this.getTotalInfectiousCount(startDate,endDate,this.lapsetoType,this.sourceType)
  736. //统计年龄
  737. this.getTotalAgeCount(startunitx,endunitx,this.lapsetoType,this.sourceType)
  738. //统计透析年龄
  739. this.getTotalDialysisCount(startunitx,endunitx,this.lapsetoType,this.sourceType)
  740. this.start = startunitx
  741. this.end = endunitx
  742. this.getCountModeId()
  743. this.getRolloutCount(startunitx,endunitx,this.lapsetoType,this.sourceType)
  744. }
  745. //近半年
  746. if(state == 2){
  747. this.listQuery.start_time = ""
  748. this.listQuery.end_time = ""
  749. const startDate = moment().subtract('month', 6).format('YYYY-MM-DD')
  750. // console.log("6月前",startDate)
  751. var startunitx = Date.parse(startDate)/1000
  752. // console.log("开始时间搓",startunitx)
  753. const endDate = moment(new Date()).format('YYYY-MM-DD')
  754. // console.log("结束时间",endDate)
  755. var endunitx = Date.parse(endDate)/1000
  756. // console.log("日期时间搓",endunitx)
  757. //统计透析总量
  758. this.getDialysisModeType(startDate,endDate,this.lapsetoType,this.sourceType)
  759. //统计转归状态
  760. this.getTotalLapseCount(startDate,endDate,this.lapsetoType,this.sourceType)
  761. //统计男女比例
  762. this.getTotalSexCount(startunitx,endunitx,this.lapsetoType,this.sourceType)
  763. //统计传染病
  764. this.getTotalInfectiousCount(startDate,endDate,this.lapsetoType,this.sourceType)
  765. //统计年龄
  766. this.getTotalAgeCount(startunitx,endunitx,this.lapsetoType,this.sourceType)
  767. //统计透析年龄
  768. this.getTotalDialysisCount(startunitx,endunitx,this.lapsetoType,this.sourceType)
  769. this.start = startunitx
  770. this.end = endunitx
  771. this.getCountModeId()
  772. this.getRolloutCount(startunitx,endunitx,this.lapsetoType,this.sourceType)
  773. }
  774. //近一年
  775. if(state == 3){
  776. this.listQuery.start_time = ""
  777. this.listQuery.end_time = ""
  778. const startDate = moment().subtract('month', 12).format('YYYY-MM-DD')
  779. // console.log("6月前",startDate)
  780. var startunitx = Date.parse(startDate)/1000
  781. // console.log("开始时间搓",startunitx)
  782. const endDate = moment(new Date()).format('YYYY-MM-DD')
  783. // console.log("结束时间",endDate)
  784. var endunitx = Date.parse(endDate)/1000
  785. // console.log("日期时间搓",endunitx)
  786. //统计透析总量
  787. this.getDialysisModeType(startDate,endDate,this.lapsetoType,this.sourceType)
  788. //统计转归状态
  789. this.getTotalLapseCount(startDate,endDate,this.lapsetoType,this.sourceType)
  790. //统计男女比例
  791. this.getTotalSexCount(startunitx,endunitx,this.lapsetoType,this.sourceType)
  792. //统计传染病
  793. this.getTotalInfectiousCount(startDate,endDate,this.lapsetoType,this.sourceType)
  794. //统计年龄
  795. this.getTotalAgeCount(startunitx,endunitx,this.lapsetoType,this.sourceType)
  796. //统计透析年龄
  797. this.getTotalDialysisCount(startunitx,endunitx,this.lapsetoType,this.sourceType)
  798. this.start = startunitx
  799. this.end = endunitx
  800. this.getCountModeId()
  801. this.getRolloutCount(startunitx,endunitx,this.lapsetoType,this.sourceType)
  802. }
  803. },
  804. selectTreatMode(state){
  805. this.mode_id = state
  806. this.stateMode = state;
  807. this.getCountModeId()
  808. },
  809. selectLapsetoMode(state){
  810. this.lapseid = state
  811. this.lapseMode = state
  812. this.getRolloutCount(this.start,this.end)
  813. },
  814. getDialysisModeType(startDate,endDate,lapsetoType,sourceType){
  815. this.modesData.series = []
  816. this.modesData.xAxis = []
  817. getDialysisModeType(startDate,endDate,lapsetoType,sourceType).then(response=>{
  818. if(response.data.state == 1){
  819. var modetype = response.data.data.modetype
  820. console.log("modetype",modetype)
  821. this.modetype = modetype
  822. var total = response.data.data.total
  823. console.log("total",total)
  824. this.total = total.count
  825. // this.total = total
  826. // console.log("数据",this.modetype)
  827. var modedate = response.data.data.modetype
  828. for(let i=0;i<modedate.length;i++){
  829. if(modedate[i].mode_id == 1){
  830. modedate[i].mode_id = "HD"
  831. }
  832. if(modedate[i].mode_id == 2){
  833. modedate[i].mode_id = "HDF"
  834. }
  835. if(modedate[i].mode_id == 3){
  836. modedate[i].mode_id = "HD+HP"
  837. }
  838. if(modedate[i].mode_id == 4){
  839. modedate[i].mode_id = "HP"
  840. }
  841. if(modedate[i].mode_id == 5){
  842. modedate[i].mode_id = "HF"
  843. }
  844. if(modedate[i].mode_id == 6){
  845. modedate[i].mode_id = "SCUF"
  846. }
  847. if(modedate[i].mode_id == 7){
  848. modedate[i].mode_id = "IUF"
  849. }
  850. if(modedate[i].mode_id == 8){
  851. modedate[i].mode_id = "HFHD"
  852. }
  853. if(modedate[i].mode_id == 9){
  854. modedate[i].mode_id = "HFHD+HP"
  855. }
  856. if(modedate[i].mode_id == 10){
  857. modedate[i].mode_id = "PHF"
  858. }
  859. if(modedate[i].mode_id == 11){
  860. modedate[i].mode_id = "HFR"
  861. }
  862. if(modedate[i].mode_id == 12){
  863. modedate[i].mode_id = "HDF+HP"
  864. }
  865. if(modedate[i].mode_id == 13){
  866. modedate[i].mode_id = "CRRT"
  867. }
  868. if(modedate[i].mode_id == 14){
  869. modedate[i].mode_id = "腹水回输"
  870. }
  871. if(modedate[i].mode_id == 15){
  872. modedate[i].mode_id = "HD前置换"
  873. }
  874. if(modedate[i].mode_id == 16){
  875. modedate[i].mode_id = "HD后置换"
  876. }
  877. if(modedate[i].mode_id == 17){
  878. modedate[i].mode_id = "HDF前置换"
  879. }
  880. if(modedate[i].mode_id == 18){
  881. modedate[i].mode_id = "HDF后置换"
  882. }
  883. if(modedate[i].mode_id == 19){
  884. modedate[i].mode_id = "IUF+HD"
  885. }
  886. // this.modesData.xAxis.push(modedate[i].mode_id)
  887. // this.modesData.series.push(((modedate[i].count/total)*100).toFixed(1))
  888. }
  889. // this.chart.series[0].data = this.modesData.series
  890. // this.chart.xAxis.data = this.modesData.xAxis
  891. // this.getArrLength1(this.chart.xAxis.data)
  892. }
  893. })
  894. },
  895. //统计转归
  896. getTotalLapseCount(startDate,endDate,lapsetoType,sourceType ){
  897. this.modesDataTwo.series = []
  898. this.modesDataTwo.xAxis = []
  899. getTotalLapseCount(startDate,endDate,lapsetoType,sourceType).then(response=>{
  900. if(response.data.state == 1){
  901. var arr = [
  902. {name:"留治",count:0},
  903. {name:"转出",count:0}
  904. ]
  905. var patients = response.data.data.patients
  906. this.rollOutTotal = patients.length
  907. var patienttwo = response.data.data.patienttwo
  908. this.outTotal = patienttwo.length
  909. var count = response.data.data.count
  910. this.patientCount = count
  911. var rollout = response.data.data.rollout
  912. for(let i=0;i<arr.length;i++){
  913. arr[0].count = this.rollOutTotal
  914. arr[1].count = this.outTotal
  915. }
  916. }
  917. })
  918. },
  919. //统计男女比例
  920. getTotalSexCount(timeStar,timeEnd,lapsetoType,sourceType){
  921. getTotalSexCount(timeStar,timeEnd,lapsetoType,sourceType).then(response=>{
  922. if(response.data.state === 1){
  923. console.log("resp2222",response.data.data.totalWoman)
  924. var total = response.data.data.total
  925. this.totalGender = total
  926. var totalMan = response.data.data.totalSex
  927. this.totalMan = totalMan
  928. var totalWoman = response.data.data.totalWoman
  929. this.totalWoman = totalWoman
  930. }
  931. })
  932. },
  933. //统计传染病
  934. getTotalInfectiousCount(timeStar,timeEnd,lapsetoType,sourceType){
  935. getTotalInfectiousCount(timeStar,timeEnd,lapsetoType,sourceType).then(response=>{
  936. if(response.data.state === 1){
  937. this.InfectiousTotal = response.data.data.total
  938. var infectious = response.data.data.count
  939. var otherTotal = response.data.data.otherTotal
  940. this.otherTotal = otherTotal
  941. var arr = [
  942. {count:0,disease_id:2},
  943. {count:0,disease_id:3},
  944. {count:0,disease_id:4},
  945. {count:0,disease_id:5},
  946. {count:0,disease_id:6},
  947. ]
  948. if(infectious.length == 0){
  949. this.InfectiousList = arr
  950. return false
  951. }
  952. this.InfectiousList = infectious
  953. }
  954. })
  955. },
  956. getTotalAgeCount(timeStar,timeEnd,lapsetoType,sourceType){
  957. getTotalAgeCount(timeStar,timeEnd,lapsetoType,sourceType).then(response=>{
  958. if(response.data.state == 1){
  959. var ageCount = response.data.data.ageCount
  960. var arr = []
  961. arr = ageCount.sort(this.compare('age'))
  962. this.ageCount = arr
  963. this.ageTotal = response.data.data.total
  964. }
  965. })
  966. },
  967. compare:function (k) {
  968. return function (a, b) {
  969. var M = a[k];
  970. var N = b[k];
  971. return M - N; // 从低向高排
  972. // return N - M; // 从高向低排
  973. }
  974. },
  975. //统计透析年龄
  976. getTotalDialysisCount(timeStar,timeEnd,lapsetoType,sourceType){
  977. getTotalDialysisCount(timeStar,timeEnd,lapsetoType,sourceType).then(response=>{
  978. if(response.data.state == 1){
  979. var dataage = response.data.data.dataage
  980. this.dialysisAge = dataage
  981. }
  982. })
  983. },
  984. getTreatModeList(timeStar,timeEnd){
  985. const params = {
  986. start_time:timeStar,
  987. end_time:timeEnd
  988. }
  989. getTreatModeList(params).then(response=>{
  990. if(response.data.state == 1){
  991. var list = response.data.data.list
  992. this.mode_id = list[0].mode_id
  993. for(let i=0;i<list.length;i++){
  994. if(list[i].mode_id == 1){
  995. list[i].name = "HD"
  996. list[i].state = 1
  997. }
  998. if(list[i].mode_id == 2){
  999. list[i].name = "HDF"
  1000. list[i].state = 2
  1001. }
  1002. if(list[i].mode_id == 3){
  1003. list[i].name = "HD+HP"
  1004. list[i].state = 3
  1005. }
  1006. if(list[i].mode_id == 4){
  1007. list[i].name = "HP"
  1008. list[i].state = 4
  1009. }
  1010. if(list[i].mode_id == 5){
  1011. list[i].name = "HF"
  1012. list[i].state = 5
  1013. }
  1014. if(list[i].mode_id == 6){
  1015. list[i].name = "SCUF"
  1016. list[i].state = 6
  1017. }
  1018. if(list[i].mode_id == 7){
  1019. list[i].name = "IUF"
  1020. list[i].state = 7
  1021. }
  1022. if(list[i].mode_id == 8){
  1023. list[i].name="HFHD"
  1024. list[i].state = 8
  1025. }
  1026. if(list[i].mode_id == 9){
  1027. list[i].name ="HFHD+HP"
  1028. list[i].state = 9
  1029. }
  1030. if(list[i].mode_id == 10){
  1031. list[i].name = "PHF"
  1032. list[i].state = 10
  1033. }
  1034. if(list[i].mode_id == 11){
  1035. list[i].name = "HFR"
  1036. list[i].state = 11
  1037. }
  1038. if(list[i].mode_id == 12){
  1039. list[i].name = "HDF+HP"
  1040. list[i].state = 12
  1041. }
  1042. if(list[i].mode_id == 13){
  1043. list[i].name = "CRRT"
  1044. list[i].state = 13
  1045. }
  1046. if(list[i].mode_id == 14){
  1047. list[i].name = "腹水回输"
  1048. list[i].state = 14
  1049. }
  1050. if(list[i].mode_id == 15){
  1051. list[i].name = "HD前置换"
  1052. list[i].state = 15
  1053. }
  1054. if(list[i].mode_id == 16){
  1055. list[i].name = "HD后置换"
  1056. list[i].state = 16
  1057. }
  1058. if(list[i].mode_id == 17){
  1059. list[i].name = "HDF前置换"
  1060. list[i].state = 17
  1061. }
  1062. if(list[i].mode_id == 18){
  1063. list[i].name = "HDF后置换"
  1064. list[i].state = 18
  1065. }
  1066. if(list[i].mode_id == 19) {
  1067. list[i].name = "IUF+HD"
  1068. list[i].state = 19
  1069. }
  1070. }
  1071. this.treatmentMode = list
  1072. }
  1073. })
  1074. },
  1075. selectWay(index){
  1076. this.way = index
  1077. if(index == 0){
  1078. this.treatShow = false
  1079. }
  1080. if(index == 1){
  1081. this.treatShow = true
  1082. this.getCountModeId()
  1083. }
  1084. },
  1085. getArrLength(result){
  1086. if(result.length > 10){
  1087. var dataZoom_end = (10/result.length)*100;
  1088. this.bar.dataZoom[0].end = dataZoom_end
  1089. }else{
  1090. var dataZoom_end = 100;
  1091. this.bar.dataZoom[0].end = dataZoom_end
  1092. }
  1093. },
  1094. getArrLength1(result){
  1095. if(result.length > 10){
  1096. var dataZoom_end = (10/result.length)*100;
  1097. this.chart.dataZoom[0].end = dataZoom_end
  1098. }else{
  1099. var dataZoom_end = 100;
  1100. this.chart.dataZoom[0].end = dataZoom_end
  1101. }
  1102. },
  1103. getCountModeId(){
  1104. const params = {
  1105. start_time:this.start,
  1106. end_time:this.end,
  1107. mode_id:this.mode_id,
  1108. }
  1109. this.modesData.series = []
  1110. this.modesData.xAxis = []
  1111. getCountModeId(params).then(response=>{
  1112. if(response.data.state == 1){
  1113. var modeCount = response.data.data.modeCount
  1114. for(let i=0;i<modeCount.length;i++){
  1115. this.modesData.xAxis.push(moment(new Date(modeCount[i].dialysis_date*1000)).format('YYYY-MM-DD'))
  1116. this.modesData.series.push(modeCount[i].Count)
  1117. this.chart.series[0].data = this.modesData.series
  1118. this.chart.xAxis.data = this.modesData.xAxis
  1119. this.getArrLength1(this.chart.xAxis.data)
  1120. }
  1121. }
  1122. })
  1123. },
  1124. getRolloutCount(){
  1125. this.modesDataTwo.series = []
  1126. this.modesDataTwo.xAxis = []
  1127. const params = {
  1128. start_time:this.start,
  1129. end_time:this.end,
  1130. lapsetotype:this.lapsetoType,
  1131. sourcetype:this.sourceType,
  1132. }
  1133. getRolloutCount(params).then(response=>{
  1134. if(response.data.state == 1){
  1135. var rollout = response.data.data.rollout
  1136. var arr = []
  1137. var arrOne = []
  1138. for(let i=0;i<rollout.length;i++){
  1139. if(rollout[i].lapseto_type == 1){
  1140. arr.push(rollout[i])
  1141. }
  1142. if(rollout[i].lapseto_type == 2){
  1143. arrOne.push(rollout[i])
  1144. }
  1145. }
  1146. if(this.lapseid == 0){
  1147. this.modesDataTwo.xAxis = []
  1148. this.modesDataTwo.series = []
  1149. for(let i=0;i<arr.length;i++){
  1150. this.modesDataTwo.xAxis.push(moment(new Date(arr[i]. lapseto_time*1000)).format('YYYY-MM-DD'))
  1151. this.modesDataTwo.series.push(arr[i].Count)
  1152. }
  1153. this.bar.series[0].data = this.modesDataTwo.series
  1154. this.bar.xAxis.data = this.modesDataTwo.xAxis
  1155. this.getArrLength(this.bar.xAxis.data)
  1156. }
  1157. if(this.lapseid == 1){
  1158. this.modesDataTwo.xAxis = []
  1159. this.modesDataTwo.series = []
  1160. for(let i=0;i<arrOne.length;i++){
  1161. this.modesDataTwo.xAxis.push(moment(new Date(arrOne[i].lapseto_time*1000)).format('YYYY-MM-DD'))
  1162. this.modesDataTwo.series.push(arrOne[i].Count)
  1163. }
  1164. this.bar.series[0].data = this.modesDataTwo.series
  1165. this.bar.xAxis.data = this.modesDataTwo.xAxis
  1166. this.getArrLength(this.bar.xAxis.data)
  1167. }
  1168. }
  1169. })
  1170. },
  1171. selectSource(source) {
  1172. this.sourceType = source
  1173. this.getDialysisModeType(this.startDate,this.endDate,this.lapsetoType,this.sourceType)
  1174. this.getTotalLapseCount(this.startDate,this.endDate,this.lapsetoType,this.sourceType)
  1175. this.getTotalSexCount(this.startDate,this.endDate,this.lapsetoType,this.sourceType)
  1176. this.getTotalInfectiousCount(this.startDate,this.endDate,this.lapsetoType,this.sourceType)
  1177. this.getTotalAgeCount(this.startDate,this.endDate,this.lapsetoType,this.sourceType)
  1178. this.getTotalDialysisCount(this.startDate,this.endDate,this.lapsetoType,this.sourceType)
  1179. this.getRolloutCount(this.lapsetoType,this.sourceType)
  1180. },
  1181. selectLapseOne(lapseto) {
  1182. console.log("lapseto22222",lapseto)
  1183. this.lapsetoType = lapseto
  1184. this.getDialysisModeType(this.startDate,this.endDate,this.lapsetoType,this.sourceType)
  1185. this.getTotalLapseCount(this.startDate,this.endDate,this.lapsetoType,this.sourceType)
  1186. this.getTotalSexCount(this.startDate,this.endDate,this.lapsetoType,this.sourceType)
  1187. this.getTotalInfectiousCount(this.startDate,this.endDate,this.lapsetoType,this.sourceType)
  1188. this.getTotalAgeCount(this.startDate,this.endDate,this.lapsetoType,this.sourceType)
  1189. this.getTotalDialysisCount(this.startDate,this.endDate,this.lapsetoType,this.sourceType)
  1190. this.getRolloutCount(this.lapsetoType,this.sourceType)
  1191. },
  1192. },
  1193. created() {
  1194. //获取本月当前机构的透析模式
  1195. const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
  1196. const endDate = moment(new Date()).format('YYYY-MM-DD')
  1197. var now = new Date()
  1198. var nowMonth = now.getMonth(); //当前月
  1199. var nowYear = now.getFullYear(); //当前年
  1200. //本月的开始时间
  1201. var monthStartDate = new Date(nowYear, nowMonth, 1);
  1202. var timeStar=Date.parse(monthStartDate)/1000;//s
  1203. //本月的结束时间
  1204. var monthEndDate = new Date(nowYear, nowMonth+1, 0);
  1205. var timeEnd=Date.parse(monthEndDate)/1000-1;//s
  1206. this.startDate = startDate
  1207. this.endDate = endDate
  1208. //统计透析总量
  1209. this.getDialysisModeType(startDate,endDate,this.lapsetoType,this.sourceType)
  1210. //统计转归状态
  1211. this.getTotalLapseCount(startDate,endDate,this.lapsetoType,this.sourceType)
  1212. //统计男女比例
  1213. this.getTotalSexCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  1214. //统计传染病
  1215. this.getTotalInfectiousCount(startDate,endDate,this.lapsetoType,this.sourceType)
  1216. //统计年龄
  1217. this.getTotalAgeCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  1218. //统计透析年龄
  1219. this.getTotalDialysisCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  1220. //获取当前选中时间所有的透析模式
  1221. this.getTreatModeList(timeStar,timeEnd)
  1222. this.start = timeStar
  1223. this.end = timeEnd
  1224. this.getRolloutCount(timeStar,timeEnd,this.lapsetoType,this.sourceType)
  1225. },
  1226. };
  1227. </script>
  1228. <style rel="stylesheet/scss" lang="scss" scoped>
  1229. .infoBox {
  1230. display: flex;
  1231. flex-wrap: wrap;
  1232. .infoOne {
  1233. margin-right: 30px;
  1234. margin-top: 20px;
  1235. .titleBox {
  1236. display: flex;
  1237. align-items: center;
  1238. }
  1239. .point {
  1240. display: inline-block;
  1241. width: 7px;
  1242. height: 7px;
  1243. background: linear-gradient(
  1244. 90deg,
  1245. rgba(169, 224, 243, 1),
  1246. rgba(159, 189, 252, 1)
  1247. );
  1248. border-radius: 50%;
  1249. }
  1250. .point1 {
  1251. width: 7px;
  1252. height: 7px;
  1253. background: linear-gradient(
  1254. 90deg,
  1255. rgba(255, 215, 192, 1),
  1256. rgba(255, 153, 148, 1)
  1257. );
  1258. border-radius: 50%;
  1259. }
  1260. .point2 {
  1261. width: 7px;
  1262. height: 7px;
  1263. background: linear-gradient(
  1264. 90deg,
  1265. rgba(215, 195, 253, 1),
  1266. rgba(179, 168, 247, 1)
  1267. );
  1268. border-radius: 50%;
  1269. }
  1270. .infoTitle {
  1271. font-size: 16px;
  1272. font-weight: bold;
  1273. margin-left: 5px;
  1274. color: #000;
  1275. }
  1276. .borderBox {
  1277. width: 340px;
  1278. min-height: 140px;
  1279. background: rgba(255, 255, 255, 1);
  1280. border: 1px solid rgba(229, 229, 229, 1);
  1281. border-radius: 10px;
  1282. padding: 0 14px 20px;
  1283. margin-top: 10px;
  1284. p {
  1285. font-size: 14px;
  1286. color: #000;
  1287. margin: 10px 0 3px;
  1288. }
  1289. }
  1290. .borderBox1 {
  1291. width: 340px;
  1292. min-height: 140px;
  1293. background: rgba(255, 255, 255, 1);
  1294. border: 1px solid rgba(229, 229, 229, 1);
  1295. border-radius: 10px;
  1296. padding: 0 14px 20px;
  1297. margin-top: 10px;
  1298. p {
  1299. font-size: 14px;
  1300. color: #000;
  1301. margin: 10px 0 3px;
  1302. }
  1303. }
  1304. .borderBox2 {
  1305. width: 340px;
  1306. min-height: 140px;
  1307. background: rgba(255, 255, 255, 1);
  1308. border: 1px solid rgba(229, 229, 229, 1);
  1309. border-radius: 10px;
  1310. padding: 0 14px 20px;
  1311. margin-top: 10px;
  1312. p {
  1313. font-size: 14px;
  1314. color: #000;
  1315. margin: 10px 0 3px;
  1316. }
  1317. }
  1318. }
  1319. }
  1320. </style>
  1321. <style lang="scss">
  1322. .infoBox {
  1323. .infoOne {
  1324. .el-progress-bar__outer{
  1325. height:10px !important;
  1326. }
  1327. .borderBox {
  1328. .el-progress-bar__inner {
  1329. background: linear-gradient(
  1330. 90deg,
  1331. rgba(169, 224, 243, 1),
  1332. rgba(159, 189, 252, 1)
  1333. );
  1334. }
  1335. .el-progress-bar{
  1336. margin-right: -59px;
  1337. padding-right: 60px;
  1338. }
  1339. }
  1340. .borderBox1 {
  1341. .el-progress-bar__inner {
  1342. background: linear-gradient(
  1343. 90deg,
  1344. rgba(255, 215, 192, 1),
  1345. rgba(255, 153, 148, 1)
  1346. );
  1347. }
  1348. .el-progress-bar{
  1349. margin-right: -59px;
  1350. padding-right: 60px;
  1351. }
  1352. }
  1353. .borderBox2 {
  1354. .el-progress-bar__inner {
  1355. background: linear-gradient(
  1356. 90deg,
  1357. rgba(215, 195, 253, 1),
  1358. rgba(179, 168, 247, 1)
  1359. );
  1360. }
  1361. .el-progress-bar{
  1362. margin-right: -59px;
  1363. padding-right: 60px;
  1364. }
  1365. }
  1366. }
  1367. }
  1368. </style>