project.vue 55KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585
  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. <el-tabs v-model="activeName" @tab-click="handleClick">
  8. <el-tab-pane label="按时间分组" name="first"></el-tab-pane>
  9. <el-tab-pane label="按项目分组" name="second"></el-tab-pane>
  10. </el-tabs>
  11. <div class="cell clearfix">
  12. <!-- <el-select v-model="lapseto" placeholder="请选择" style="width:120px;margin-right:10px" @change="changeOptions">
  13. <el-option
  14. v-for="item in options"
  15. :key="item.value"
  16. :label="item.label"
  17. :value="item.value"
  18. ></el-option>
  19. </el-select> -->
  20. <el-select v-model="type" placeholder="请选择" @change="chooseType" style="margin-right:10px">
  21. <el-option
  22. v-for="item in options1"
  23. :key="item.value"
  24. :label="item.label"
  25. :value="item.value"
  26. ></el-option>
  27. </el-select>
  28. <el-select v-model="mode_type" placeholder="请选择" style="width:120px;margin-right:0px" @change="handleModeType">
  29. <el-option
  30. v-for="item in normdata"
  31. :key="item.inspection_minor"
  32. :label="item.item_name"
  33. :value="item.inspection_minor"
  34. ></el-option>
  35. </el-select>
  36. </div>
  37. <div class="cell clearfix">
  38. <p class="chartTitle">统计图</p>
  39. </div>
  40. <div class="cell clearfix">
  41. <p class="point"></p>
  42. <p class="pointTitle">达标率</p>
  43. </div>
  44. <div v-loading="isLoading">
  45. <line-chart :options="chart"></line-chart>
  46. </div>
  47. <div class="cell clearfix">
  48. <p class="point"></p>
  49. <p class="pointTitle">指标正常范围值</p>
  50. </div>
  51. <div class="cell clearfix newDisplay">
  52. <span v-for="(item,index) in normdata" :key="index" class="index">
  53. <span v-if="item.is_status == 1">{{ item.item_name }}</span>
  54. <span v-if="item.is_status == 0 && item.inspection_major == 0 && item.inspection_minor == -1">收缩压</span>
  55. <span v-if="item.is_status == 0 && item.inspection_major == 0 && item.inspection_minor == -2">舒张压</span>
  56. <span v-if="item.range_type == 1 && item.is_status == 1">({{ item.min_range }}-{{ item.large_range }})</span>
  57. <span v-if="item.range_type == 2 && item.is_status == 1">({{ item.range_value }})</span>
  58. <span v-if="item.range_type == 0 && item.is_status == 0">({{ item.min_range }}-{{ item.large_range }})</span>
  59. </span>
  60. </div>
  61. </div>
  62. </div>
  63. </template>
  64. <script>
  65. const moment = require('moment')
  66. import echarts from 'echarts'
  67. import LineChart from '../../qcd/components/LineChart'
  68. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  69. import {
  70. getBloodPressureList,
  71. getMonthBloodList,
  72. getMonthProjectList,
  73. getNormData,
  74. getProjectList
  75. } from '@/api/common/common'
  76. export default {
  77. components: {
  78. LineChart,
  79. BreadCrumb
  80. },
  81. data() {
  82. return {
  83. isMode: 0,
  84. activeName: 'second',
  85. normdata: [],
  86. modesData: {
  87. xAxis: [],
  88. series: []
  89. },
  90. crumbs: [
  91. { path: false, name: '科室质控' },
  92. { path: false, name: '科室质控达标统计' },
  93. { path: false, name: '按项目分组' }
  94. ],
  95. options: [
  96. {
  97. value: 0,
  98. label: '全部'
  99. },
  100. {
  101. value: 1,
  102. label: '留治'
  103. },
  104. {
  105. value: 2,
  106. label: '转归'
  107. }
  108. ],
  109. options1: [
  110. {
  111. value: 1,
  112. label: '按季度统计对比'
  113. },
  114. {
  115. value: 2,
  116. label: '按月份统计对比'
  117. }
  118. ],
  119. value: '请选项',
  120. lapseto: 0,
  121. type: 1,
  122. isLoading: false,
  123. mode_type: '',
  124. range_type: '',
  125. bloodType: -1,
  126. chart: {
  127. // title: {
  128. // text: "ECharts 入门示例"
  129. // },
  130. tooltip: {},
  131. // legend: {
  132. // data: ["次数"],
  133. // left: 0
  134. // },
  135. xAxis: {
  136. data: []
  137. },
  138. yAxis: {
  139. axisLabel: {
  140. formatter: '{value} %'
  141. },
  142. show: false
  143. },
  144. series: [
  145. {
  146. name: '达标率',
  147. type: 'bar',
  148. data: [],
  149. barWidth: 30,
  150. label: {
  151. normal: {
  152. show: true,
  153. position: 'top',
  154. formatter: '{c}%'
  155. }
  156. },
  157. //配置样式
  158. itemStyle: {
  159. //通常情况下:
  160. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  161. normal: {
  162. color: function(params) {
  163. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  164. var colorList = [
  165. ['#A9E0F3', '#9FBDFC'],
  166. ['#A9E0F3', '#9FBDFC'],
  167. ['#A9E0F3', '#9FBDFC'],
  168. ['#FFD7C0', '#FF9994'],
  169. ['#FFD7C0', '#FF9994'],
  170. ['#FFD7C0', '#FF9994'],
  171. ['#D7C3FD', '#B3A8F7'],
  172. ['#D7C3FD', '#B3A8F7'],
  173. ['#D7C3FD', '#B3A8F7']
  174. ]
  175. var index = params.dataIndex
  176. if (params.dataIndex >= colorList.length) {
  177. index = params.dataIndex % colorList.length
  178. }
  179. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  180. { offset: 0, color: colorList[index][0] },
  181. // { offset: 0.5, color: colorList[index][1] },
  182. { offset: 1, color: colorList[index][1] }
  183. ])
  184. },
  185. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  186. },
  187. //鼠标悬停时:
  188. emphasis: {
  189. shadowBlur: 10,
  190. shadowOffsetX: 0,
  191. shadowColor: 'rgba(0, 0, 0, 0.2)'
  192. }
  193. }
  194. }
  195. ]
  196. },
  197. syslarge: 0,
  198. sysmin: 0,
  199. dialarge: 0,
  200. diamin: 0
  201. }
  202. },
  203. methods: {
  204. handleClick() {
  205. if (this.activeName == 'first') {
  206. this.$router.push({ path: '/qcd/officesControlAnalysis/time' })
  207. }
  208. },
  209. chooseType(val) {
  210. this.type = val
  211. //按季度
  212. if (val == 1) {
  213. if (this.mode_type == -1 || this.mode_type == -2) {
  214. this.getBloodList()
  215. return false
  216. } else {
  217. this.getlist()
  218. }
  219. }
  220. //按月份
  221. if (val == 2) {
  222. if (this.mode_type == -1 || this.mode_type == -2) {
  223. this.getMonthBloodList()
  224. return false
  225. } else {
  226. this.getMonthList()
  227. }
  228. }
  229. },
  230. changeOptions(val) {
  231. if (this.type == 1) {
  232. this.lapseto = val
  233. this.getlist()
  234. return false
  235. }
  236. if (this.type == 2) {
  237. this.lapseto = val
  238. this.getMonthList()
  239. return false
  240. }
  241. },
  242. getNormData() {
  243. this.isLoading = true
  244. getNormData().then(response => {
  245. this.isLoading = false
  246. var newArr = []
  247. var normdata = response.data.data.normdata
  248. newArr = normdata
  249. var bloodpressure = response.data.data.bloodPressure
  250. for (let i = 0; i < bloodpressure.length; i++) {
  251. if (bloodpressure[i].inspection_major == 0 && bloodpressure[i].inspection_minor == -1 && bloodpressure[i].is_status == 0) {
  252. bloodpressure[i].item_name = '收缩压'
  253. this.syslarge = parseInt(bloodpressure[i].large_range)
  254. this.sysmin = parseInt(bloodpressure[i].min_range)
  255. }
  256. if (bloodpressure[i].inspection_major == 0 && bloodpressure[i].inspection_minor == -2 && bloodpressure[i].is_status == 0) {
  257. bloodpressure[i].item_name = '舒张压'
  258. this.dialarge = parseInt(bloodpressure[i].large_range)
  259. this.diamin = parseInt(bloodpressure[i].min_range)
  260. }
  261. }
  262. bloodpressure.map(item => {
  263. newArr.push(item)
  264. })
  265. var newarr = newArr.sort((a, b) => {
  266. return a.sort - b.sort
  267. })
  268. for (let i = 0; i < newarr.length; i++) {
  269. this.mode_type = normdata[0].inspection_minor
  270. }
  271. this.normdata = newarr
  272. this.getBloodList()
  273. })
  274. },
  275. handleModeType(val) {
  276. console.log('modetype', this.type, this.mode_type)
  277. if (this.type == 2) {
  278. this.bloodType = val
  279. if (this.mode_type == -1 || this.mode_type == -2) {
  280. this.getMonthBloodList()
  281. return false
  282. } else {
  283. // console.log("chuff")
  284. this.getMonthList()
  285. return false
  286. }
  287. }
  288. if (val == -1) {
  289. // 统计收缩压
  290. this.bloodType = val
  291. this.getBloodList()
  292. return false
  293. }
  294. if (val == -2) {
  295. this.bloodType = val
  296. //统计舒张压
  297. this.getBloodList()
  298. return false
  299. }
  300. if (val != -1 || val != -2) {
  301. this.isMode = 2
  302. this.mode_type = val
  303. this.getlist()
  304. }
  305. },
  306. //季度
  307. getlist() {
  308. this.isLoading = true
  309. this.modesData.series = []
  310. this.modesData.xAxis = []
  311. const firstQuarterStart = moment().startOf('year').format('YYYY-MM-DD')
  312. const firstQuarterEnd = moment().month(11).endOf('month').format('YYYY-MM-DD')
  313. //第一季度
  314. const first_quarter_start = moment().startOf('year').format('YYYY-MM-DD')
  315. const first_qurter_end = moment().month(2).endOf('month').format('YYYY-MM-DD')
  316. //第二季度
  317. const second_qurter_start = moment().month(3).startOf('month').format('YYYY-MM-DD')
  318. const second_qurter_end = moment().month(5).endOf('month').format('YYYY-MM-DD')
  319. //第三季度
  320. const three_qurter_start = moment().month(6).startOf('month').format('YYYY-MM-DD')
  321. const three_qurter_end = moment().month(8).endOf('month').format('YYYY-MM-DD')
  322. //第四季度
  323. const four_qurter_start = moment().month(9).startOf('month').format('YYYY-MM-DD')
  324. const four_qurter_end = moment().month(11).endOf('month').format('YYYY-MM-DD')
  325. // console.log("this.modetype",this.mode_type)
  326. for (let i = 0; i < this.normdata.length; i++) {
  327. if (this.normdata[i].inspection_minor == this.mode_type) {
  328. this.range_type = this.normdata[i].range_type
  329. }
  330. }
  331. const params = {
  332. lapseto: this.lapseto,
  333. itemtype: this.type,
  334. modetype: this.mode_type,
  335. startime: firstQuarterStart,
  336. endtime: firstQuarterEnd,
  337. first_quarter_start: first_quarter_start,
  338. first_qurter_end: first_qurter_end,
  339. second_qurter_start: second_qurter_start,
  340. second_qurter_end: second_qurter_end,
  341. three_qurter_start: three_qurter_start,
  342. three_qurter_end: three_qurter_end,
  343. four_qurter_start: four_qurter_start,
  344. four_qurter_end: four_qurter_end,
  345. range_type: this.range_type
  346. }
  347. getProjectList(params).then(response => {
  348. if (response.data.state === 1) {
  349. this.isLoading = false
  350. var list = response.data.data.list
  351. var standList = response.data.data.standList
  352. var newArr = [
  353. { Total: '第一季度', Count: 1, NoCount: 0 },
  354. { Total: '第二季度', Count: 1, NoCount: 0 },
  355. { Total: '第三季度', Count: 1, NoCount: 0 },
  356. { Total: '第四季度', Count: 1, NoCount: 0 }
  357. ]
  358. //获取2个数组不同的部分
  359. var arrTwo = this.arrayDate(list, newArr)
  360. arrTwo.map(item => {
  361. list.push(item)
  362. })
  363. for (let i = 0; i < list.length; i++) {
  364. if (list[i].Total == '第一季度') {
  365. list[i].Total = 1
  366. }
  367. if (list[i].Total == '第二季度') {
  368. list[i].Total = 2
  369. }
  370. if (list[i].Total == '第三季度') {
  371. list[i].Total = 3
  372. }
  373. if (list[i].Total == '第四季度') {
  374. list[i].Total = 4
  375. }
  376. }
  377. //排序
  378. list.sort(this.compare('Total'))
  379. for (let i = 0; i < list.length; i++) {
  380. if (list[i].Total == 1) {
  381. list[i].Total = '第一季度'
  382. }
  383. if (list[i].Total == 2) {
  384. list[i].Total = '第二季度'
  385. }
  386. if (list[i].Total == 3) {
  387. list[i].Total = '第三季度'
  388. }
  389. if (list[i].Total == 4) {
  390. list[i].Total = '第四季度'
  391. }
  392. }
  393. var newArrThree = [
  394. { Total: '第一季度', Count: 0 },
  395. { Total: '第二季度', Count: 0 },
  396. { Total: '第三季度', Count: 0 },
  397. { Total: '第四季度', Count: 0 }
  398. ]
  399. //获取2个数组不同的部分
  400. var standArr = this.arrayDateTwo(standList, newArrThree)
  401. standArr.map(item => {
  402. standList.push(item)
  403. })
  404. var arrFive = []
  405. for (let i = 0; i < list.length; i++) {
  406. for (let j = 0; j < standList.length; j++) {
  407. if (list[i].Total == standList[j].Total) {
  408. list[i].NoCount = standList[j].Count
  409. arrFive.push(list[i])
  410. }
  411. }
  412. }
  413. for (const key in arrFive) {
  414. this.modesData.xAxis.push(arrFive[key].Total)
  415. this.modesData.series.push(((arrFive[key].NoCount / arrFive[key].Count) * 100).toFixed(1))
  416. }
  417. this.chart.series[0].data = this.modesData.series
  418. this.chart.xAxis.data = this.modesData.xAxis
  419. }else{
  420. this.isLoading = false
  421. }
  422. })
  423. },
  424. arrayDate(array1, array2) {
  425. var array1 = array1
  426. var array2 = array2
  427. var result = []
  428. for (var i = 0; i < array2.length; i++) {
  429. var obj = array2[i]
  430. var num = obj.Total //staff_id 就是要对比的key
  431. var isExist = false
  432. for (var j = 0; j < array1.length; j++) {
  433. var aj = array1[j]
  434. var n = aj.Total
  435. if (n == num) {
  436. isExist = true
  437. break
  438. }
  439. }
  440. if (!isExist) {
  441. result.push(obj)
  442. }
  443. }
  444. return result
  445. },
  446. arrayDateTwo(array1, array2) {
  447. var array1 = array1
  448. var array2 = array2
  449. var result = []
  450. for (var i = 0; i < array2.length; i++) {
  451. var obj = array2[i]
  452. var num = obj.Total //staff_id 就是要对比的key
  453. var isExist = false
  454. for (var j = 0; j < array1.length; j++) {
  455. var aj = array1[j]
  456. var n = aj.Total
  457. if (n == num) {
  458. isExist = true
  459. break
  460. }
  461. }
  462. if (!isExist) {
  463. result.push(obj)
  464. }
  465. }
  466. return result
  467. },
  468. arrayDateThree(array1, array2) {
  469. var array1 = array1
  470. var array2 = array2
  471. var result = []
  472. for (var i = 0; i < array2.length; i++) {
  473. var obj = array2[i]
  474. var num = obj.Total //staff_id 就是要对比的key
  475. var isExist = false
  476. for (var j = 0; j < array1.length; j++) {
  477. var aj = array1[j]
  478. var n = aj.Total
  479. if (n == num) {
  480. isExist = true
  481. break
  482. }
  483. }
  484. if (!isExist) {
  485. result.push(obj)
  486. }
  487. }
  488. return result
  489. },
  490. arrayDateFour(array1, array2) {
  491. var array1 = array1
  492. var array2 = array2
  493. var result = []
  494. for (var i = 0; i < array2.length; i++) {
  495. var obj = array2[i]
  496. var num = obj.Total //staff_id 就是要对比的key
  497. var isExist = false
  498. for (var j = 0; j < array1.length; j++) {
  499. var aj = array1[j]
  500. var n = aj.Total
  501. if (n == num) {
  502. isExist = true
  503. break
  504. }
  505. }
  506. if (!isExist) {
  507. result.push(obj)
  508. }
  509. }
  510. return result
  511. },
  512. compare(property) {
  513. return function(a, b) {
  514. var value1 = a[property]
  515. var value2 = b[property]
  516. return value1 - value2
  517. }
  518. },
  519. //按月份统计
  520. getMonthList() {
  521. this.modesData.series = []
  522. this.modesData.xAxis = []
  523. const januaryStart = moment().month(0).startOf('month').format('YYYY-MM-DD')
  524. const januaryEnd = moment().month(0).endOf('month').format('YYYY-MM-DD')
  525. const febStart = moment().month(1).startOf('month').format('YYYY-MM-DD')
  526. const febEnd = moment().month(1).endOf('month').format('YYYY-MM-DD')
  527. const marchStart = moment().month(2).startOf('month').format('YYYY-MM-DD')
  528. const marchEnd = moment().month(2).endOf('month').format('YYYY-MM-DD')
  529. const aprStart = moment().month(3).startOf('month').format('YYYY-MM-DD')
  530. const aprEnd = moment().month(3).endOf('month').format('YYYY-MM-DD')
  531. const mayStart = moment().month(4).startOf('month').format('YYYY-MM-DD')
  532. const mayEnd = moment().month(4).endOf('month').format('YYYY-MM-DD')
  533. const junStart = moment().month(5).startOf('month').format('YYYY-MM-DD')
  534. const junEnd = moment().month(5).endOf('month').format('YYYY-MM-DD')
  535. const julStart = moment().month(6).startOf('month').format('YYYY-MM-DD')
  536. const julEnd = moment().month(6).endOf('month').format('YYYY-MM-DD')
  537. const augStart = moment().month(7).startOf('month').format('YYYY-MM-DD')
  538. const augEnd = moment().month(7).endOf('month').format('YYYY-MM-DD')
  539. const sepStart = moment().month(8).startOf('month').format('YYYY-MM-DD')
  540. const sepEnd = moment().month(8).endOf('month').format('YYYY-MM-DD')
  541. const octStart = moment().month(9).startOf('month').format('YYYY-MM-DD')
  542. const octEnd = moment().month(9).endOf('month').format('YYYY-MM-DD')
  543. const novStart = moment().month(10).startOf('month').format('YYYY-MM-DD')
  544. const novEnd = moment().month(10).endOf('month').format('YYYY-MM-DD')
  545. const decStart = moment().month(11).startOf('month').format('YYYY-MM-DD')
  546. const decEnd = moment().month(11).endOf('month').format('YYYY-MM-DD')
  547. for (let i = 0; i < this.normdata.length; i++) {
  548. if (this.normdata[i].inspection_minor == this.mode_type) {
  549. this.range_type = this.normdata[i].range_type
  550. }
  551. }
  552. for (let i = 0; i < this.normdata.length; i++) {
  553. if (this.normdata[i].inspection_minor == this.mode_type) {
  554. this.range_type = this.normdata[i].range_type
  555. }
  556. }
  557. const params = {
  558. lapseto: this.lapseto,
  559. itemtype: this.type,
  560. modetype: this.mode_type,
  561. januaryStart: januaryStart,
  562. januaryEnd: januaryEnd,
  563. febStart: febStart,
  564. febEnd: febEnd,
  565. marchStart: marchStart,
  566. marchEnd: marchEnd,
  567. aprStart: aprStart,
  568. aprEnd: aprEnd,
  569. mayStart: mayStart,
  570. mayEnd: mayEnd,
  571. junStart: junStart,
  572. junEnd: junEnd,
  573. julStart: julStart,
  574. julEnd: julEnd,
  575. augStart: augStart,
  576. augEnd: augEnd,
  577. sepStart: sepStart,
  578. sepEnd: sepEnd,
  579. octStart: octStart,
  580. octEnd: octEnd,
  581. novStart: novStart,
  582. novEnd: novEnd,
  583. decStart: decStart,
  584. decEnd: decEnd,
  585. range_type: this.range_type
  586. }
  587. console.log('222222', params)
  588. this.isLoading = true
  589. getMonthProjectList(params).then(response => {
  590. if (response.data.state === 1) {
  591. this.isLoading = false
  592. var monthlist = response.data.data.monthlist
  593. var newArr = [
  594. { Total: '一月', Count: 1, NoCount: 0 },
  595. { Total: '二月', Count: 1, NoCount: 0 },
  596. { Total: '三月', Count: 1, NoCount: 0 },
  597. { Total: '四月', Count: 1, NoCount: 0 },
  598. { Total: '五月', Count: 1, NoCount: 0 },
  599. { Total: '六月', Count: 1, NoCount: 0 },
  600. { Total: '七月', Count: 1, NoCount: 0 },
  601. { Total: '八月', Count: 1, NoCount: 0 },
  602. { Total: '九月', Count: 1, NoCount: 0 },
  603. { Total: '十月', Count: 1, NoCount: 0 },
  604. { Total: '十一月', Count: 1, NoCount: 0 },
  605. { Total: '十二月', Count: 1, NoCount: 0 }
  606. ]
  607. var newArrTwo = [
  608. { Total: '一月', Count: 0 },
  609. { Total: '二月', Count: 0 },
  610. { Total: '三月', Count: 0 },
  611. { Total: '四月', Count: 0 },
  612. { Total: '五月', Count: 0 },
  613. { Total: '六月', Count: 0 },
  614. { Total: '七月', Count: 0 },
  615. { Total: '八月', Count: 0 },
  616. { Total: '九月', Count: 0 },
  617. { Total: '十月', Count: 0 },
  618. { Total: '十一月', Count: 0 },
  619. { Total: '十二月', Count: 0 }
  620. ]
  621. //获取2个数组不同的部分
  622. var standArr = this.arrayDateThree(monthlist, newArr)
  623. standArr.map(item => {
  624. monthlist.push(item)
  625. })
  626. //排序
  627. for (let i = 0; i < monthlist.length; i++) {
  628. if (monthlist[i].Total == '一月') {
  629. monthlist[i].Total = 1
  630. }
  631. if (monthlist[i].Total == '二月') {
  632. monthlist[i].Total = 2
  633. }
  634. if (monthlist[i].Total == '三月') {
  635. monthlist[i].Total = 3
  636. }
  637. if (monthlist[i].Total == '四月') {
  638. monthlist[i].Total = 4
  639. }
  640. if (monthlist[i].Total == '五月') {
  641. monthlist[i].Total = 5
  642. }
  643. if (monthlist[i].Total == '六月') {
  644. monthlist[i].Total = 6
  645. }
  646. if (monthlist[i].Total == '七月') {
  647. monthlist[i].Total = 7
  648. }
  649. if (monthlist[i].Total == '八月') {
  650. monthlist[i].Total = 8
  651. }
  652. if (monthlist[i].Total == '九月') {
  653. monthlist[i].Total = 9
  654. }
  655. if (monthlist[i].Total == '十月') {
  656. monthlist[i].Total = 10
  657. }
  658. if (monthlist[i].Total == '十一月') {
  659. monthlist[i].Total = 11
  660. }
  661. if (monthlist[i].Total == '十二月') {
  662. monthlist[i].Total = 12
  663. }
  664. }
  665. //排序
  666. monthlist.sort(this.compare('Total'))
  667. for (let i = 0; i < monthlist.length; i++) {
  668. if (monthlist[i].Total == 1) {
  669. monthlist[i].Total = '一月'
  670. }
  671. if (monthlist[i].Total == 2) {
  672. monthlist[i].Total = '二月'
  673. }
  674. if (monthlist[i].Total == 3) {
  675. monthlist[i].Total = '三月'
  676. }
  677. if (monthlist[i].Total == 4) {
  678. monthlist[i].Total = '四月'
  679. }
  680. if (monthlist[i].Total == 5) {
  681. monthlist[i].Total = '五月'
  682. }
  683. if (monthlist[i].Total == 6) {
  684. monthlist[i].Total = '六月'
  685. }
  686. if (monthlist[i].Total == 7) {
  687. monthlist[i].Total = '七月'
  688. }
  689. if (monthlist[i].Total == 8) {
  690. monthlist[i].Total = '八月'
  691. }
  692. if (monthlist[i].Total == 9) {
  693. monthlist[i].Total = '九月'
  694. }
  695. if (monthlist[i].Total == 10) {
  696. monthlist[i].Total = '十月'
  697. }
  698. if (monthlist[i].Total == 11) {
  699. monthlist[i].Total = '十一月'
  700. }
  701. if (monthlist[i].Total == 12) {
  702. monthlist[i].Total = '十二月'
  703. }
  704. }
  705. var monthNolist = response.data.data.monthNolist
  706. var standArrTwo = this.arrayDateThree(monthNolist, newArrTwo)
  707. standArrTwo.map(item => {
  708. monthNolist.push(item)
  709. })
  710. var arrOne = []
  711. for (let i = 0; i < monthlist.length; i++) {
  712. for (let j = 0; j < monthNolist.length; j++) {
  713. if (monthlist[i].Total == monthNolist[j].Total) {
  714. monthlist[i].NoCount = monthNolist[j].Count
  715. arrOne.push(monthlist[i])
  716. }
  717. }
  718. }
  719. for (const key in arrOne) {
  720. this.modesData.xAxis.push(arrOne[key].Total)
  721. this.modesData.series.push(((arrOne[key].NoCount / arrOne[key].Count) * 100).toFixed(1))
  722. }
  723. this.chart.series[0].data = this.modesData.series
  724. this.chart.xAxis.data = this.modesData.xAxis
  725. }else{
  726. this.isLoading = false
  727. }
  728. })
  729. },
  730. getBloodList() {
  731. this.modesData.series = []
  732. this.modesData.xAxis = []
  733. const firstQuarterStart = moment().startOf('year').format('YYYY-MM-DD')
  734. const firstQuarterEnd = moment().month(11).endOf('month').format('YYYY-MM-DD')
  735. //第一季度
  736. const first_quarter_start = moment().startOf('year').format('YYYY-MM-DD')
  737. const first_qurter_end = moment().month(2).endOf('month').format('YYYY-MM-DD')
  738. //第二季度
  739. const second_qurter_start = moment().month(3).startOf('month').format('YYYY-MM-DD')
  740. const second_qurter_end = moment().month(5).endOf('month').format('YYYY-MM-DD')
  741. //第三季度
  742. const three_qurter_start = moment().month(6).startOf('month').format('YYYY-MM-DD')
  743. const three_qurter_end = moment().month(8).endOf('month').format('YYYY-MM-DD')
  744. //第四季度
  745. const four_qurter_start = moment().month(9).startOf('month').format('YYYY-MM-DD')
  746. const four_qurter_end = moment().month(11).endOf('month').format('YYYY-MM-DD')
  747. const params = {
  748. first_quarter_start: first_quarter_start,
  749. first_qurter_end: first_qurter_end,
  750. second_qurter_start: second_qurter_start,
  751. second_qurter_end: second_qurter_end,
  752. three_qurter_start: three_qurter_start,
  753. three_qurter_end: three_qurter_end,
  754. four_qurter_start: four_qurter_start,
  755. four_qurter_end: four_qurter_end,
  756. bloodType: this.bloodType
  757. }
  758. this.isLoading = true
  759. console.log("params",params)
  760. getBloodPressureList(params).then(response => {
  761. if (response.data.state == 1) {
  762. this.isLoading = false
  763. if (this.bloodType == -1) {
  764. var firstTotal = response.data.data.firstTotal
  765. if (firstTotal == 0) {
  766. firstTotal = 1
  767. }
  768. var firstStandTotal = 0
  769. var firstlist = response.data.data.firstList
  770. var fistArr = []
  771. for (let i = 0; i < firstlist.length; i++) {
  772. if (firstlist[i].systolic_blood_pressure >= this.sysmin && firstlist[i].systolic_blood_pressure <= this.syslarge) {
  773. fistArr.push(firstlist[i])
  774. }
  775. }
  776. firstStandTotal = fistArr.length
  777. var secondetotal = response.data.data.secondeTotal
  778. if (secondetotal == 0) {
  779. secondetotal = 1
  780. }
  781. var secondeStandTotal = 0
  782. var secondelist = response.data.data.secondelist
  783. var secondeArr = []
  784. for (let i = 0; i < secondelist.length; i++) {
  785. if (secondelist[i].systolic_blood_pressure >= this.sysmin && secondelist[i].systolic_blood_pressure <= this.syslarge) {
  786. secondeArr.push(secondelist[i])
  787. }
  788. }
  789. secondeStandTotal = secondeArr.length
  790. var threetotal = response.data.data.threeTotal
  791. if (threetotal == 0) {
  792. threetotal = 1
  793. }
  794. var threeStandtotal = 0
  795. var threelist = response.data.data.threelist
  796. var threeArr = []
  797. for (let i = 0; i < threelist.length; i++) {
  798. if (threelist[i].systolic_blood_pressure >= this.sysmin && threelist[i].systolic_blood_pressure <= this.syslarge) {
  799. threeArr.push(threelist[i])
  800. }
  801. }
  802. threeStandtotal = threeArr.length
  803. var fourtotal = response.data.data.fourTotal
  804. if (fourtotal == 0) {
  805. fourtotal = 1
  806. }
  807. var fourStandTotal = 0
  808. var fourlist = response.data.data.fourlist
  809. var fourArr = []
  810. for (let i = 0; i < fourlist.length; i++) {
  811. if (fourlist[i].systolic_blood_pressure >= this.sysmin && fourlist[i].systolic_blood_pressure <= this.syslarge) {
  812. fourArr.push(fourlist[i])
  813. }
  814. }
  815. fourStandTotal = fourArr.length
  816. var newArr = [
  817. { name: '第一季度', Total: 0, StandCount: 0 },
  818. { name: '第二季度', Total: 0, StandCount: 0 },
  819. { name: '第三季度', Total: 0, StandCount: 0 },
  820. { name: '第四季度', Total: 0, StandCount: 0 }
  821. ]
  822. for (let i = 0; i < newArr.length; i++) {
  823. newArr[0].Total = firstTotal
  824. newArr[0].StandCount = firstStandTotal
  825. newArr[1].Total = secondetotal
  826. newArr[1].StandCount = secondeStandTotal
  827. newArr[2].Total = threetotal
  828. newArr[2].StandCount = threeStandtotal
  829. newArr[3].Total = fourtotal
  830. newArr[3].StandCount = fourStandTotal
  831. }
  832. // console.log("newArr",newArr)
  833. for (let j = 0; j < newArr.length; j++) {
  834. this.modesData.xAxis.push(newArr[j].name)
  835. this.modesData.series.push(((newArr[j].StandCount / newArr[j].Total) * 100).toFixed(1))
  836. }
  837. this.chart.series[0].data = this.modesData.series
  838. this.chart.xAxis.data = this.modesData.xAxis
  839. }
  840. if (this.bloodType == -2) {
  841. var firstTotal = response.data.data.firstTotal
  842. if (firstTotal == 0) {
  843. firstTotal = 1
  844. }
  845. var firstStandTotal = 0
  846. var firstlist = response.data.data.firstList
  847. var fistArr = []
  848. for (let i = 0; i < firstlist.length; i++) {
  849. if (firstlist[i].diastolic_blood_pressure >= this.diamin && firstlist[i].diastolic_blood_pressure <= this.dialarge) {
  850. fistArr.push(firstlist[i])
  851. }
  852. }
  853. firstStandTotal = fistArr.length
  854. var secondetotal = response.data.data.secondeTotal
  855. if (secondetotal == 0) {
  856. secondetotal = 1
  857. }
  858. var secondeStandTotal = 0
  859. var secondelist = response.data.data.secondelist
  860. var secondeArr = []
  861. for (let i = 0; i < secondelist.length; i++) {
  862. if (secondelist[i].diastolic_blood_pressure >= this.diamin && secondelist[i].diastolic_blood_pressure <= this.dialarge) {
  863. secondeArr.push(secondelist[i])
  864. }
  865. }
  866. secondeStandTotal = secondeArr.length
  867. var threetotal = response.data.data.threeTotal
  868. if (threetotal == 0) {
  869. threetotal = 1
  870. }
  871. var threeStandtotal = 0
  872. var threelist = response.data.data.threelist
  873. var threeArr = []
  874. for (let i = 0; i < threelist.length; i++) {
  875. if (threelist[i].diastolic_blood_pressure >= this.diamin && threelist[i].diastolic_blood_pressure <= this.dialarge) {
  876. threeArr.push(threelist[i])
  877. }
  878. }
  879. // console.log("threeArr",threeArr)
  880. threeStandtotal = threeArr.length
  881. var fourtotal = response.data.data.fourTotal
  882. if (fourtotal == 0) {
  883. fourtotal = 1
  884. }
  885. var fourStandTotal = 0
  886. var fourlist = response.data.data.fourlist
  887. var fourArr = []
  888. for (let i = 0; i < fourlist.length; i++) {
  889. if (fourlist[i].diastolic_blood_pressure >= this.diamin && fourlist[i].diastolic_blood_pressure <= this.dialarge) {
  890. fourArr.push(fourlist[i])
  891. }
  892. }
  893. fourStandTotal = fourArr.length
  894. var newArr = [
  895. { name: '第一季度', Total: 0, StandCount: 0 },
  896. { name: '第二季度', Total: 0, StandCount: 0 },
  897. { name: '第三季度', Total: 0, StandCount: 0 },
  898. { name: '第四季度', Total: 0, StandCount: 0 }
  899. ]
  900. for (let i = 0; i < newArr.length; i++) {
  901. newArr[0].Total = firstTotal
  902. newArr[0].StandCount = firstStandTotal
  903. newArr[1].Total = secondetotal
  904. newArr[1].StandCount = secondeStandTotal
  905. newArr[2].Total = threetotal
  906. newArr[2].StandCount = threeStandtotal
  907. newArr[3].Total = fourtotal
  908. newArr[3].StandCount = fourStandTotal
  909. }
  910. // console.log("newArr",newArr)
  911. for (let j = 0; j < newArr.length; j++) {
  912. this.modesData.xAxis.push(newArr[j].name)
  913. this.modesData.series.push(((newArr[j].StandCount / newArr[j].Total) * 100).toFixed(1))
  914. }
  915. this.chart.series[0].data = this.modesData.series
  916. this.chart.xAxis.data = this.modesData.xAxis
  917. }
  918. }else{
  919. this.isLoading = false
  920. }
  921. })
  922. },
  923. getMonthBloodList() {
  924. this.modesData.series = []
  925. this.modesData.xAxis = []
  926. const januaryStart = moment().month(0).startOf('month').format('YYYY-MM-DD')
  927. const januaryEnd = moment().month(0).endOf('month').format('YYYY-MM-DD')
  928. const febStart = moment().month(1).startOf('month').format('YYYY-MM-DD')
  929. const febEnd = moment().month(1).endOf('month').format('YYYY-MM-DD')
  930. const marchStart = moment().month(2).startOf('month').format('YYYY-MM-DD')
  931. const marchEnd = moment().month(2).endOf('month').format('YYYY-MM-DD')
  932. const aprStart = moment().month(3).startOf('month').format('YYYY-MM-DD')
  933. const aprEnd = moment().month(3).endOf('month').format('YYYY-MM-DD')
  934. const mayStart = moment().month(4).startOf('month').format('YYYY-MM-DD')
  935. const mayEnd = moment().month(4).endOf('month').format('YYYY-MM-DD')
  936. const junStart = moment().month(5).startOf('month').format('YYYY-MM-DD')
  937. const junEnd = moment().month(5).endOf('month').format('YYYY-MM-DD')
  938. const julStart = moment().month(6).startOf('month').format('YYYY-MM-DD')
  939. const julEnd = moment().month(6).endOf('month').format('YYYY-MM-DD')
  940. const augStart = moment().month(7).startOf('month').format('YYYY-MM-DD')
  941. const augEnd = moment().month(7).endOf('month').format('YYYY-MM-DD')
  942. const sepStart = moment().month(8).startOf('month').format('YYYY-MM-DD')
  943. const sepEnd = moment().month(8).endOf('month').format('YYYY-MM-DD')
  944. const octStart = moment().month(9).startOf('month').format('YYYY-MM-DD')
  945. const octEnd = moment().month(9).endOf('month').format('YYYY-MM-DD')
  946. const novStart = moment().month(10).startOf('month').format('YYYY-MM-DD')
  947. const novEnd = moment().month(10).endOf('month').format('YYYY-MM-DD')
  948. const decStart = moment().month(11).startOf('month').format('YYYY-MM-DD')
  949. const decEnd = moment().month(11).endOf('month').format('YYYY-MM-DD')
  950. const params = {
  951. januaryStart: januaryStart,
  952. januaryEnd: januaryEnd,
  953. febStart: febStart,
  954. febEnd: febEnd,
  955. marchStart: marchStart,
  956. marchEnd: marchEnd,
  957. aprStart: aprStart,
  958. aprEnd: aprEnd,
  959. mayStart: mayStart,
  960. mayEnd: mayEnd,
  961. junStart: junStart,
  962. junEnd: junEnd,
  963. julStart: julStart,
  964. julEnd: julEnd,
  965. augStart: augStart,
  966. augEnd: augEnd,
  967. sepStart: sepStart,
  968. sepEnd: sepEnd,
  969. octStart: octStart,
  970. octEnd: octEnd,
  971. novStart: novStart,
  972. novEnd: novEnd,
  973. decStart: decStart,
  974. decEnd: decEnd,
  975. bloodType: this.bloodType
  976. }
  977. console.log('params', params)
  978. this.isLoading = true
  979. getMonthBloodList(params).then(response => {
  980. if (response.data.state == 1) {
  981. this.isLoading = false
  982. if (this.bloodType == -1) {
  983. var januarytotal = response.data.data.januaryTotal
  984. if (januarytotal == 0) {
  985. januarytotal = 1
  986. }
  987. var januarystandtotal = 0
  988. var januarylist = response.data.data.januarylist
  989. var januaryArr = []
  990. for (let i = 0; i < januarylist.length; i++) {
  991. if (januarylist[i].systolic_blood_pressure >= this.sysmin && januarylist[i].systolic_blood_pressure <= this.syslarge) {
  992. januaryArr.push(januarylist[i])
  993. }
  994. }
  995. console.log('一月', januarylist)
  996. console.log('一月', januaryArr)
  997. januarystandtotal = januaryArr.length
  998. var febtotal = response.data.data.febTotal
  999. if (febtotal == 0) {
  1000. febtotal = 1
  1001. }
  1002. var febstandtotal = 0
  1003. var feblist = response.data.data.feblist
  1004. var febArr = []
  1005. for (let i = 0; i < feblist.length; i++) {
  1006. if (feblist[i].systolic_blood_pressure >= this.sysmin && feblist[i].systolic_blood_pressure <= this.syslarge) {
  1007. febArr.push(feblist[i])
  1008. }
  1009. }
  1010. console.log('二月', feblist)
  1011. console.log('二月', febArr)
  1012. febstandtotal = febArr.length
  1013. var marchtotal = response.data.data.marchTotal
  1014. if (marchtotal == 0) {
  1015. marchtotal = 1
  1016. }
  1017. var marchstandtotal = 0
  1018. var marchlist = response.data.data.marchlist
  1019. var marArr = []
  1020. for (let i = 0; i < marchlist.length; i++) {
  1021. if (marchlist[i].systolic_blood_pressure >= this.sysmin && marchlist[i].systolic_blood_pressure <= this.syslarge) {
  1022. marArr.push(marchlist[i])
  1023. }
  1024. }
  1025. console.log('三月', marchlist)
  1026. console.log('三月', marArr)
  1027. marchstandtotal = marArr.length
  1028. var aprtotal = response.data.data.aprTotal
  1029. if (aprtotal == 0) {
  1030. aprtotal = 1
  1031. }
  1032. var aprstandtotal = 0
  1033. var aprlist = response.data.data.aprlist
  1034. var aprArr = []
  1035. for (let i = 0; i < aprlist.length; i++) {
  1036. if (aprlist[i].systolic_blood_pressure >= this.sysmin && aprlist[i].systolic_blood_pressure <= this.syslarge) {
  1037. aprArr.push(aprlist[i])
  1038. }
  1039. }
  1040. console.log('四月', aprlist)
  1041. console.log('四月', aprArr)
  1042. var maytotal = response.data.data.mayTotal
  1043. if (maytotal == 0) {
  1044. maytotal = 1
  1045. }
  1046. var maystandtotal = 0
  1047. var maylist = response.data.data.maylist
  1048. var mayArr = []
  1049. for (let i = 0; i < maylist.length; i++) {
  1050. if (maylist[i].systolic_blood_pressure >= this.sysmin && maylist[i].systolic_blood_pressure <= this.syslarge) {
  1051. mayArr.push(maylist[i])
  1052. }
  1053. }
  1054. console.log('五月', maylist)
  1055. console.log('五月', mayArr)
  1056. maystandtotal = mayArr.length
  1057. var juntotal = response.data.data.junTotal
  1058. if (juntotal == 0) {
  1059. juntotal = 1
  1060. }
  1061. var junstandtotal = 0
  1062. var junlist = response.data.data.junlist
  1063. var junArr = []
  1064. for (let i = 0; i < junlist.length; i++) {
  1065. if (junlist[i].systolic_blood_pressure >= this.sysmin && junlist[i].systolic_blood_pressure <= this.syslarge) {
  1066. junArr.push(junlist[i])
  1067. }
  1068. }
  1069. console.log('六月', junlist)
  1070. console.log('六月', junArr)
  1071. junstandtotal = junArr.length
  1072. var jultotal = response.data.data.julTotal
  1073. if (jultotal == 0) {
  1074. jultotal = 1
  1075. }
  1076. var julstandtotal = 0
  1077. var jullist = response.data.data.jullist
  1078. var julArr = []
  1079. for (let i = 0; i < jullist.length; i++) {
  1080. if (jullist[i].systolic_blood_pressure >= this.sysmin && jullist[i].systolic_blood_pressure <= this.syslarge) {
  1081. julArr.push(jullist[i])
  1082. }
  1083. }
  1084. julstandtotal = julArr.length
  1085. var augtotal = response.data.data.augTotal
  1086. if (augtotal == 0) {
  1087. augtotal = 1
  1088. }
  1089. var augstandtotal = 0
  1090. var auglist = response.data.data.auglist
  1091. var augArr = []
  1092. for (let i = 0; i < auglist.length; i++) {
  1093. if (auglist[i].systolic_blood_pressure >= this.sysmin && auglist[i].systolic_blood_pressure <= this.syslarge) {
  1094. augArr.push(auglist[i])
  1095. }
  1096. }
  1097. augstandtotal = augArr.length
  1098. var septotal = response.data.data.sepTotal
  1099. if (septotal == 0) {
  1100. septotal = 1
  1101. }
  1102. var sepstandtotal = 0
  1103. var seplist = response.data.data.seplist
  1104. var sepArr = []
  1105. for (let i = 0; i < seplist.length; i++) {
  1106. if (seplist[i].systolic_blood_pressure >= this.sysmin && seplist[i].systolic_blood_pressure <= this.syslarge) {
  1107. sepArr.push(seplist[i])
  1108. }
  1109. }
  1110. sepstandtotal = sepArr.length
  1111. var octtotal = response.data.data.octTotal
  1112. if (octtotal == 0) {
  1113. octtotal = 1
  1114. }
  1115. var octstandtotal = 0
  1116. var octlist = response.data.data.octlist
  1117. var octArr = []
  1118. for (let i = 0; i < octlist.length; i++) {
  1119. if (octlist[i].systolic_blood_pressure >= this.sysmin && octlist[i].systolic_blood_pressure <= this.syslarge) {
  1120. octArr.push(octlist[i])
  1121. }
  1122. }
  1123. octstandtotal = octArr.length
  1124. var novtotal = response.data.data.novTotal
  1125. if (novtotal == 0) {
  1126. novtotal = 1
  1127. }
  1128. var novstandtotal = 0
  1129. var novlist = response.data.data.novlist
  1130. var novArr = []
  1131. for (let i = 0; i < novlist.length; i++) {
  1132. if (novlist[i].systolic_blood_pressure >= this.sysmin && novlist[i].systolic_blood_pressure <= this.syslarge) {
  1133. novArr.push(novlist[i])
  1134. }
  1135. }
  1136. var dectotal = response.data.data.decTotal
  1137. if (dectotal == 0) {
  1138. dectotal = 1
  1139. }
  1140. var decstandtotal = 0
  1141. var declist = response.data.data.declist
  1142. var decArr = []
  1143. for (let i = 0; i < declist.length; i++) {
  1144. if (declist[i].systolic_blood_pressure >= this.sysmin && declist[i].systolic_blood_pressure <= this.syslarge) {
  1145. decArr.push(declist[i])
  1146. }
  1147. }
  1148. decstandtotal = decArr.length
  1149. var newArr = [
  1150. { name: '一月', Total: 0, Count: 0 },
  1151. { name: '二月', Total: 0, Count: 0 },
  1152. { name: '三月', Total: 0, Count: 0 },
  1153. { name: '四月', Total: 0, Count: 0 },
  1154. { name: '五月', Total: 0, Count: 0 },
  1155. { name: '六月', Total: 0, Count: 0 },
  1156. { name: '七月', Total: 0, Count: 0 },
  1157. { name: '八月', Total: 0, Count: 0 },
  1158. { name: '九月', Total: 0, Count: 0 },
  1159. { name: '十月', Total: 0, Count: 0 },
  1160. { name: '十一月', Total: 0, Count: 0 },
  1161. { name: '十二月', Total: 0, Count: 0 }
  1162. ]
  1163. for (let i = 0; i < newArr.length; i++) {
  1164. newArr[0].Total = januarytotal
  1165. newArr[0].Count = januarystandtotal
  1166. newArr[1].Total = febtotal
  1167. newArr[1].Count = febstandtotal
  1168. newArr[2].Total = marchtotal
  1169. newArr[2].Count = marchstandtotal
  1170. newArr[3].Total = aprtotal
  1171. newArr[3].Count = aprstandtotal
  1172. newArr[4].Total = maytotal
  1173. newArr[4].Count = maystandtotal
  1174. newArr[5].Total = juntotal
  1175. newArr[5].Count = junstandtotal
  1176. newArr[6].Total = jultotal
  1177. newArr[6].Count = julstandtotal
  1178. newArr[7].Total = augtotal
  1179. newArr[7].Count = augstandtotal
  1180. newArr[8].Total = septotal
  1181. newArr[8].Count = sepstandtotal
  1182. newArr[9].Total = octtotal
  1183. newArr[9].Count = octstandtotal
  1184. newArr[10].Total = novtotal
  1185. newArr[10].Count = novstandtotal
  1186. newArr[11].Total = dectotal
  1187. newArr[11].Count = decstandtotal
  1188. }
  1189. // console.log("newarr",newArr)
  1190. for (let j = 0; j < newArr.length; j++) {
  1191. this.modesData.xAxis.push(newArr[j].name)
  1192. this.modesData.series.push(((newArr[j].Count / newArr[j].Total) * 100).toFixed(1))
  1193. }
  1194. this.chart.series[0].data = this.modesData.series
  1195. this.chart.xAxis.data = this.modesData.xAxis
  1196. }
  1197. if (this.bloodType == -2) {
  1198. var januarytotal = response.data.data.januaryTotal
  1199. if (januarytotal == 0) {
  1200. januarytotal = 1
  1201. }
  1202. var januarystandtotal = 0
  1203. var januarylist = response.data.data.januarylist
  1204. var januaryArr = []
  1205. for (let i = 0; i < januarylist.length; i++) {
  1206. if (januarylist[i].diastolic_blood_pressure >= this.diamin && januarylist[i].diastolic_blood_pressure <= this.dialarge) {
  1207. januaryArr.push(januarylist[i])
  1208. }
  1209. }
  1210. console.log('一月==', januarylist)
  1211. console.log('一月==', januaryArr)
  1212. januarystandtotal = januaryArr.length
  1213. var febtotal = response.data.data.febTotal
  1214. if (febtotal == 0) {
  1215. febtotal = 1
  1216. }
  1217. var febstandtotal = 0
  1218. var feblist = response.data.data.feblist
  1219. var febArr = []
  1220. for (let i = 0; i < feblist.length; i++) {
  1221. if (feblist[i].diastolic_blood_pressure >= this.diamin && feblist[i].diastolic_blood_pressure <= this.dialarge) {
  1222. febArr.push(feblist[i])
  1223. }
  1224. }
  1225. console.log('二月', feblist)
  1226. console.log('二月', febArr)
  1227. febstandtotal = febArr.length
  1228. var marchtotal = response.data.data.marchTotal
  1229. if (marchtotal == 0) {
  1230. marchtotal = 1
  1231. }
  1232. var marchstandtotal = 0
  1233. var marchlist = response.data.data.marchlist
  1234. var marArr = []
  1235. for (let i = 0; i < marchlist.length; i++) {
  1236. if (marchlist[i].diastolic_blood_pressure >= this.diamin && marchlist[i].diastolic_blood_pressure <= this.dialarge) {
  1237. marArr.push(marchlist[i])
  1238. }
  1239. }
  1240. console.log('三月', marchlist)
  1241. console.log('三月', marArr)
  1242. marchstandtotal = marArr.length
  1243. var aprtotal = response.data.data.aprTotal
  1244. if (aprtotal == 0) {
  1245. aprtotal = 1
  1246. }
  1247. var aprstandtotal = 0
  1248. var aprlist = response.data.data.aprlist
  1249. var aprArr = []
  1250. for (let i = 0; i < aprlist.length; i++) {
  1251. if (aprlist[i].diastolic_blood_pressure >= this.diamin && aprlist[i].diastolic_blood_pressure <= this.dialarge) {
  1252. aprArr.push(aprlist[i])
  1253. }
  1254. }
  1255. console.log('四月', aprlist)
  1256. console.log('四月', aprArr)
  1257. var maytotal = response.data.data.mayTotal
  1258. if (maytotal == 0) {
  1259. maytotal = 1
  1260. }
  1261. var maystandtotal = 0
  1262. var maylist = response.data.data.maylist
  1263. var mayArr = []
  1264. for (let i = 0; i < maylist.length; i++) {
  1265. if (maylist[i].diastolic_blood_pressure >= this.diamin && maylist[i].diastolic_blood_pressure <= this.dialarge) {
  1266. mayArr.push(maylist[i])
  1267. }
  1268. }
  1269. console.log('五月', maylist)
  1270. console.log('五月', mayArr)
  1271. maystandtotal = mayArr.length
  1272. var juntotal = response.data.data.junTotal
  1273. if (juntotal == 0) {
  1274. juntotal = 1
  1275. }
  1276. var junstandtotal = 0
  1277. var junlist = response.data.data.junlist
  1278. var junArr = []
  1279. for (let i = 0; i < junlist.length; i++) {
  1280. if (junlist[i].diastolic_blood_pressure >= this.diamin && junlist[i].diastolic_blood_pressure <= this.dialarge) {
  1281. junArr.push(junlist[i])
  1282. }
  1283. }
  1284. console.log('六月', junlist)
  1285. console.log('六月', junArr)
  1286. junstandtotal = junArr.length
  1287. var jultotal = response.data.data.julTotal
  1288. if (jultotal == 0) {
  1289. jultotal = 1
  1290. }
  1291. var julstandtotal = 0
  1292. var jullist = response.data.data.jullist
  1293. var julArr = []
  1294. for (let i = 0; i < jullist.length; i++) {
  1295. if (jullist[i].diastolic_blood_pressure >= this.diamin && jullist[i].diastolic_blood_pressure <= this.dialarge) {
  1296. julArr.push(jullist[i])
  1297. }
  1298. }
  1299. console.log('七月', jullist)
  1300. console.log('七月', julArr)
  1301. julstandtotal = julArr.length
  1302. var augtotal = response.data.data.augTotal
  1303. if (augtotal == 0) {
  1304. augtotal = 1
  1305. }
  1306. var augstandtotal = 0
  1307. var auglist = response.data.data.auglist
  1308. var augArr = []
  1309. for (let i = 0; i < auglist.length; i++) {
  1310. if (auglist[i].diastolic_blood_pressure >= this.diamin && auglist[i].diastolic_blood_pressure <= this.dialarge) {
  1311. augArr.push(auglist[i])
  1312. }
  1313. }
  1314. augstandtotal = augArr.length
  1315. var septotal = response.data.data.sepTotal
  1316. if (septotal == 0) {
  1317. septotal = 1
  1318. }
  1319. var sepstandtotal = 0
  1320. var seplist = response.data.data.seplist
  1321. var sepArr = []
  1322. for (let i = 0; i < seplist.length; i++) {
  1323. if (seplist[i].diastolic_blood_pressure >= this.diamin && seplist[i].diastolic_blood_pressure <= this.dialarge) {
  1324. sepArr.push(seplist[i])
  1325. }
  1326. }
  1327. sepstandtotal = sepArr.length
  1328. var octtotal = response.data.data.octTotal
  1329. if (octtotal == 0) {
  1330. octtotal = 1
  1331. }
  1332. var octstandtotal = 0
  1333. var octlist = response.data.data.octlist
  1334. var octArr = []
  1335. for (let i = 0; i < octlist.length; i++) {
  1336. if (octlist[i].diastolic_blood_pressure >= this.sysmin && octlist[i].diastolic_blood_pressure <= this.syslarge) {
  1337. octArr.push(octlist[i])
  1338. }
  1339. }
  1340. octstandtotal = octArr.length
  1341. var novtotal = response.data.data.novTotal
  1342. if (novtotal == 0) {
  1343. novtotal = 1
  1344. }
  1345. var novstandtotal = 0
  1346. var novlist = response.data.data.novlist
  1347. var novArr = []
  1348. for (let i = 0; i < novlist.length; i++) {
  1349. if (novlist[i].diastolic_blood_pressure >= this.diamin && novlist[i].diastolic_blood_pressure <= this.dialarge) {
  1350. novArr.push(novlist[i])
  1351. }
  1352. }
  1353. var dectotal = response.data.data.decTotal
  1354. if (dectotal == 0) {
  1355. dectotal = 1
  1356. }
  1357. var decstandtotal = 0
  1358. var declist = response.data.data.declist
  1359. var decArr = []
  1360. for (let i = 0; i < declist.length; i++) {
  1361. if (declist[i].diastolic_blood_pressure >= this.diamin && declist[i].diastolic_blood_pressure <= this.dialarge) {
  1362. decArr.push(declist[i])
  1363. }
  1364. }
  1365. decstandtotal = decArr.length
  1366. var newArr = [
  1367. { name: '一月', Total: 0, Count: 0 },
  1368. { name: '二月', Total: 0, Count: 0 },
  1369. { name: '三月', Total: 0, Count: 0 },
  1370. { name: '四月', Total: 0, Count: 0 },
  1371. { name: '五月', Total: 0, Count: 0 },
  1372. { name: '六月', Total: 0, Count: 0 },
  1373. { name: '七月', Total: 0, Count: 0 },
  1374. { name: '八月', Total: 0, Count: 0 },
  1375. { name: '九月', Total: 0, Count: 0 },
  1376. { name: '十月', Total: 0, Count: 0 },
  1377. { name: '十一月', Total: 0, Count: 0 },
  1378. { name: '十二月', Total: 0, Count: 0 }
  1379. ]
  1380. for (let i = 0; i < newArr.length; i++) {
  1381. newArr[0].Total = januarytotal
  1382. newArr[0].Count = januarystandtotal
  1383. newArr[1].Total = febtotal
  1384. newArr[1].Count = febstandtotal
  1385. newArr[2].Total = marchtotal
  1386. newArr[2].Count = marchstandtotal
  1387. newArr[3].Total = aprtotal
  1388. newArr[3].Count = aprstandtotal
  1389. newArr[4].Total = maytotal
  1390. newArr[4].Count = maystandtotal
  1391. newArr[5].Total = juntotal
  1392. newArr[5].Count = junstandtotal
  1393. newArr[6].Total = jultotal
  1394. newArr[6].Count = julstandtotal
  1395. newArr[7].Total = augtotal
  1396. newArr[7].Count = augstandtotal
  1397. newArr[8].Total = septotal
  1398. newArr[8].Count = sepstandtotal
  1399. newArr[9].Total = octtotal
  1400. newArr[9].Count = octstandtotal
  1401. newArr[10].Total = novtotal
  1402. newArr[10].Count = novstandtotal
  1403. newArr[11].Total = dectotal
  1404. newArr[11].Count = decstandtotal
  1405. }
  1406. // console.log("newarr",newArr)
  1407. for (let j = 0; j < newArr.length; j++) {
  1408. this.modesData.xAxis.push(newArr[j].name)
  1409. this.modesData.series.push(((newArr[j].Count / newArr[j].Total) * 100).toFixed(1))
  1410. }
  1411. this.chart.series[0].data = this.modesData.series
  1412. this.chart.xAxis.data = this.modesData.xAxis
  1413. }
  1414. }else{
  1415. this.isLoading = false
  1416. }
  1417. })
  1418. }
  1419. },
  1420. created() {
  1421. //获取指标正常范围值
  1422. this.getNormData()
  1423. }
  1424. }
  1425. </script>
  1426. <style lang="scss" scoped>
  1427. .newLi {
  1428. li {
  1429. background: #f5f5f6;
  1430. }
  1431. }
  1432. .chartTitle {
  1433. font-size: 16px;
  1434. font-weight: bold;
  1435. color: #000000;
  1436. }
  1437. .point {
  1438. width: 13px;
  1439. height: 13px;
  1440. background: linear-gradient(
  1441. 0deg,
  1442. rgba(169, 224, 243, 1),
  1443. rgba(159, 189, 252, 1)
  1444. );
  1445. border-radius: 7px;
  1446. margin-right: 8px;
  1447. }
  1448. .pointTitle {
  1449. font-size: 13px;
  1450. }
  1451. .index {
  1452. color: #a09ba3;
  1453. font-size: 13px;
  1454. margin-right: 36px;
  1455. margin-bottom: 20px;
  1456. }
  1457. .newDisplay {
  1458. flex-wrap: wrap;
  1459. padding-left: 20px;
  1460. }
  1461. </style>