Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

patientComplianceDetails.vue 30KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-button type="primary" @click="$router.back(-1)">返回</el-button>
  6. </div>
  7. <div class="app-container">
  8. <div class="page_patientComplianceDetails">
  9. <div class="cell clearfix" style="margin:0">
  10. <el-form :inline="true" :model="listQuery">
  11. </el-form>
  12. </div>
  13. <el-container>
  14. <div style="width:160px">
  15. <el-form :inline="true" :model="listQuery">
  16. <el-form-item label>
  17. <el-autocomplete
  18. class="checkSearch"
  19. popper-class="my-autocomplete"
  20. v-model.trim="listQuery.search"
  21. :fetch-suggestions="querySearchAsync"
  22. :trigger-on-focus="false"
  23. placeholder="病人透析号/姓名"
  24. @select="handleSelect"
  25. >
  26. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  27. <template slot-scope="{ item }">
  28. <div class="name">{{ item.name }}</div>
  29. </template>
  30. </el-autocomplete>
  31. </el-form-item>
  32. </el-form>
  33. <div class="tableTitle">患者列表</div>
  34. <el-table ref="singleTable" :data="patientsData" border style="width: 100%;" height="500" highlight-current-row @current-change="handleChange" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
  35. <el-table-column prop="name" label="透析号" width="70">
  36. <template slot-scope="scope">
  37. {{scope.row.dialysis_no}}
  38. </template>
  39. </el-table-column>
  40. <el-table-column prop="date" label="姓名" width="90">
  41. <template slot-scope="scope">
  42. {{scope.row.name }}
  43. </template>
  44. </el-table-column>
  45. </el-table>
  46. </div>
  47. <div class="containerRight" style="flex:1;overflow: hidden">
  48. <div class="cell clearfix">
  49. <label class="title" style="text-align:left">
  50. <span class="name">统计方式</span> :
  51. </label>
  52. <div class="time">
  53. <ul class>
  54. <li
  55. :class="item.state == monthType ? 'active' : ''"
  56. @click="chooseMonth(item.state)"
  57. v-for="item in month"
  58. :key="item.value"
  59. >{{ item.label }}</li>
  60. </ul>
  61. </div>
  62. <label class="title">
  63. <span class="name">日期查询</span> :
  64. </label>
  65. <el-date-picker
  66. v-model="listQuery.start_time"
  67. prefix-icon="el-icon-date"
  68. @change="changeTime"
  69. :editable="false"
  70. type="date"
  71. style="max-width:160px"
  72. placeholder="选择日期时间"
  73. align="right"
  74. format="yyyy-MM-dd"
  75. value-format="yyyy-MM-dd"
  76. :picker-options="pickerOptions"
  77. ></el-date-picker>
  78. <span class>-</span>
  79. <el-date-picker
  80. v-model="listQuery.end_time"
  81. prefix-icon="el-icon-date"
  82. @change="changeEndTime"
  83. :editable="false"
  84. type="date"
  85. style="max-width:160px"
  86. placeholder="选择日期时间"
  87. align="right"
  88. format="yyyy-MM-dd"
  89. value-format="yyyy-MM-dd"
  90. :picker-options="pickerOptions"
  91. ></el-date-picker>
  92. </div>
  93. <div class="tableTitle">指标监控</div>
  94. <div style="width:100%;overflow-x:auto">
  95. <div class="qualityBox">
  96. <div
  97. class="qualityOne"
  98. v-for="(item,index) in normData"
  99. :key="index"
  100. :class="quality == index ? 'active' : ''"
  101. @click="clickQuality(index,item.inspection_minor)"
  102. >
  103. <p>{{ item.item_name }}</p>
  104. <span v-if="item.range_type == 1 && getvlist(item.inspection_minor)!=0"><span v-if="parseInt(item.min_range)<=getvlist(item.inspection_minor) && getvlist(item.inspection_minor)<=parseInt(item.large_range) "><i class="iconfont icon-gou gou"></i></span></span>
  105. <span v-if="item.range_type == 1 && getvlist(item.inspection_minor)!=0"><span v-if="parseInt(item.min_range)>getvlist(item.inspection_minor) || getvlist(item.inspection_minor)>parseInt(item.large_range)"><i class="iconfont icon-gantanhao gth"></i></span></span>
  106. <span v-if="item.range_type == 1 && getvlist(item.inspection_minor)==0"></span>
  107. <span v-if="item.range_type == 2 && getvlistwo(item.inspection_minor)!=''"><span v-if="getvlistwo(item.inspection_minor)==item.range_value"><i class="iconfont icon-gou gou"></i></span></span>
  108. <span v-if="item.range_type == 2 && getvlistwo(item.inspection_minor)!=''"><span v-if="getvlistwo(item.inspection_minor)!=item.range_value"><i class="iconfont icon-gantanhao gth"></i></span></span>
  109. <span v-if="item.range_type == 2 && getvlistwo(item.inspection_minor)==''"></span>
  110. </div>
  111. </div>
  112. </div>
  113. <div class="tableTitle">指标趋势
  114. <span style="font-weight:normal">&nbsp;&nbsp;(当前患者: {{patient_name}})</span>
  115. </div>
  116. <div class="cell clearfix">
  117. <p class="point"></p>
  118. <p class="pointTitle">{{itemName}}</p>
  119. </div>
  120. <div>
  121. <line-chart :options="chart" v-if="rangetype == 1"></line-chart>
  122. <line-chart1 :options="char2" v-if="rangetype == 2"></line-chart1>
  123. </div>
  124. </div>
  125. </el-container>
  126. </div>
  127. </div>
  128. </div>
  129. </template>
  130. <script>
  131. const moment = require('moment')
  132. import echarts from "echarts";
  133. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  134. import LineChart from "../qcd/components/LineChart";
  135. import LineChart1 from '../qcd/components/LineChart1'
  136. import { uParseTime } from "@/utils/tools";
  137. import { PostSearch} from '@/api/patient'
  138. import { getCurrentOrgPatients,GetQualityControl,getNormData,getPatientComplianceDetail,getIdSlist } from "@/api/common/common"
  139. export default {
  140. components: {
  141. LineChart,
  142. BreadCrumb,
  143. LineChart1
  144. },
  145. data() {
  146. return {
  147. patient_name:"",
  148. rangetype:1,
  149. itemName:"",
  150. isTrue:0,
  151. crumbs: [
  152. { path: false, name: "质控管理" },
  153. { path: false, name: "患者达标详情" }
  154. ],
  155. patientsData:[],
  156. normData:[],
  157. startime:0,
  158. endtime:0,
  159. listQuery: {
  160. start_time: "",
  161. end_time: "",
  162. page: 1,
  163. limit: 10
  164. },
  165. item_id:0,
  166. month: [
  167. { value: 0, label: "本月", state: 0 },
  168. { value: 1, label: "近三月", state: 1 },
  169. { value: 2, label: "近半年", state: 2 },
  170. { value: 3, label: "近一年", state: 3 }
  171. ],
  172. modesData: {
  173. xAxis: [],
  174. series: []
  175. },
  176. pickerOptions: {
  177. disabledDate(time) {
  178. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
  179. return time.getTime() > Date.now() || time.getTime() < threeMonths;;
  180. }
  181. },
  182. patientid:0,
  183. monthType: 0,
  184. arr: [],
  185. quality: 0,
  186. char2: {
  187. title: {
  188. text: 'ECharts 入门示例'
  189. },
  190. tooltip: {},
  191. legend: {
  192. data: ['次数'],
  193. left: 0
  194. },
  195. xAxis: {
  196. data: [],
  197. axisLine: {
  198. lineStyle: {
  199. color: '#FF0000',
  200. width: 8 //这里是为了突出显示加上的
  201. }
  202. },
  203. axisLabel: {
  204. interval: 0,
  205. formatter: function(value) {
  206. var ret = '' //拼接加\n返回的类目项
  207. var maxLength = 8 //每项显示文字个数
  208. var valLength = value.length //X轴类目项的文字个数
  209. var rowN = Math.ceil(valLength / maxLength) //类目项需要换行的行数
  210. if (rowN > 1) {
  211. //如果类目项的文字大于3,
  212. for (var i = 0; i < rowN; i++) {
  213. var temp = '' //每次截取的字符串
  214. var start = i * maxLength //开始截取的位置
  215. var end = start + maxLength //结束截取的位置
  216. //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
  217. temp = value.substring(start, end) + '\n'
  218. ret += temp //凭借最终的字符串
  219. }
  220. return ret
  221. } else {
  222. return value
  223. }
  224. }
  225. }
  226. },
  227. yAxis: {
  228. axisLabel: {
  229. formatter: '{value} %'
  230. },
  231. show: false,
  232. axisLine: {
  233. lineStyle: {
  234. color: '#00FF00',
  235. width: 8 //这里是为了突出显示加上的
  236. }
  237. }
  238. },
  239. series: [
  240. {
  241. name: '',
  242. type: 'line',
  243. data: [],
  244. symbol: 'circle',//折线点设置为实心点
  245. symbolSize: 15, //折线点的大小
  246. barWidth: 30,
  247. label: {
  248. normal: {
  249. show: true,
  250. position: "top",
  251. formatter: (params) => {
  252. let str = ''
  253. str = this.otherData[params.dataIndex]
  254. return str
  255. }
  256. }
  257. },
  258. //配置样式
  259. itemStyle: {
  260. //通常情况下:
  261. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  262. normal: {
  263. color: (params) => {
  264. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  265. var colorList = [
  266.                 ['#409EFF','#409EFF'],
  267.                 ['#f56c6c','#f56c6c']
  268.                 ];
  269.               if(params.seriesName == this.otherData[params.dataIndex]){
  270.                 var index = 0 
  271.                   }else {
  272.                   var index = 1
  273.                  }
  274.                    
  275.                     // var index = params.dataIndex;
  276.                     // if (params.dataIndex >= colorList.length) {
  277.                     //   index = params.dataIndex % colorList.length;
  278.                     // }
  279.                     return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  280.                       {offset: 0, color: colorList[index][0]},
  281.                       // { offset: 0.5, color: colorList[index][1] },
  282.                       {offset: 1, color: colorList[index][1]}
  283.                     ]);
  284. },
  285. lineStyle: {
  286. width:2,
  287. color: "#cccccc"//折线的颜色
  288. },
  289. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  290. },
  291. //鼠标悬停时:
  292. emphasis: {
  293. shadowBlur: 10,
  294. shadowOffsetX: 0,
  295. shadowColor: 'rgba(0, 0, 0, 0.2)'
  296. }
  297. }
  298. }
  299. ],
  300. dataZoom: [
  301. {
  302. //Y轴固定,让内容滚动
  303. type: "slider",
  304. show: false,
  305. xAxisIndex: [0],
  306. start: 1,
  307. end: 20, //设置X轴刻度之间的间隔(根据数据量来调整)
  308. zoomLock: true //锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
  309. },
  310. {
  311. type: "inside",
  312. xAxisIndex: [0],
  313. start: 1,
  314. end: 20,
  315. zoomLock: true //锁定区域禁止缩放
  316. }
  317. ],
  318. },
  319. chart: {
  320. title: {
  321. text: "ECharts 入门示例"
  322. },
  323. tooltip: {},
  324. // legend: {
  325. // data: ["次数"],
  326. // left: 0
  327. // },
  328. xAxis: {
  329. data: []
  330. },
  331. yAxis: {
  332. axisLabel: {
  333. formatter: "{value} %"
  334. },
  335. show: false
  336. },
  337. series: [
  338. {
  339. name: "次数",
  340. type: "line",
  341. data: [],
  342. barWidth: 30,
  343. label: {
  344. normal: {
  345. show: true,
  346. position: "top",
  347. formatter: "{c}"
  348. }
  349. },
  350. //配置样式
  351. itemStyle: {
  352. //通常情况下:
  353. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  354. normal: {
  355. color: function(params) {
  356. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  357. var colorList = [
  358. ["#A9E0F3", "#9FBDFC"],
  359. ["#A9E0F3", "#9FBDFC"],
  360. ["#A9E0F3", "#9FBDFC"],
  361. ["#FFD7C0", "#FF9994"],
  362. ["#FFD7C0", "#FF9994"],
  363. ["#FFD7C0", "#FF9994"],
  364. ["#D7C3FD", "#B3A8F7"],
  365. ["#D7C3FD", "#B3A8F7"],
  366. ["#D7C3FD", "#B3A8F7"]
  367. ];
  368. var index = params.dataIndex;
  369. if (params.dataIndex >= colorList.length) {
  370. index = params.dataIndex % colorList.length;
  371. }
  372. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  373. { offset: 0, color: colorList[index][0] },
  374. // { offset: 0.5, color: colorList[index][1] },
  375. { offset: 1, color: colorList[index][1] }
  376. ]);
  377. },
  378. lineStyle:{
  379. color:'#409eff' //改变折线颜色
  380. },
  381. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  382. },
  383. //鼠标悬停时:
  384. emphasis: {
  385. shadowBlur: 10,
  386. shadowOffsetX: 0,
  387. shadowColor: "rgba(0, 0, 0, 0.5)"
  388. }
  389. }
  390. }
  391. ],
  392. dataZoom: [
  393. {
  394. //Y轴固定,让内容滚动
  395. type: "slider",
  396. show: false,
  397. xAxisIndex: [0],
  398. start: 1,
  399. end: 20, //设置X轴刻度之间的间隔(根据数据量来调整)
  400. zoomLock: true //锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
  401. },
  402. {
  403. type: "inside",
  404. xAxisIndex: [0],
  405. start: 1,
  406. end: 20,
  407. zoomLock: true //锁定区域禁止缩放
  408. }
  409. ],
  410. },
  411. inspect_date:0,
  412. monthActive:0,
  413. otherData:[],
  414. vlist:[],
  415. ids:[],
  416. };
  417. },
  418. methods: {
  419. chooseMonth(month) {
  420. //一月
  421. if(month == 0){
  422. this.listQuery.start_time = ""
  423. this.listQuery.end_time =""
  424. this.monthActive = 0
  425. const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
  426. const endDate = moment(new Date()).format('YYYY-MM-DD')
  427. var now = new Date()
  428. var nowMonth = now.getMonth(); //当前月
  429. var nowYear = now.getFullYear(); //当前年
  430. //本月的开始时间
  431. var monthStartDate = new Date(nowYear, nowMonth, 1);
  432. this.startime=Date.parse(monthStartDate)/1000;//s
  433. //本月的结束时间
  434. var monthEndDate = moment().endOf('month').format('YYYY-MM-DD HH:mm:ss');
  435. this.endtime =Date.parse(monthEndDate)/1000-1;//s
  436. this.getlistDetail()
  437. this.getIdSlist()
  438. }
  439. //近三月
  440. if(month == 1){
  441. this.listQuery.start_time = ""
  442. this.listQuery.end_time =""
  443. this.monthActive = 1
  444. const startDate = moment().subtract('month', 3).format('YYYY-MM-DD')
  445. this.startime = Date.parse(startDate)/1000
  446. const endDate = moment(new Date()).format('YYYY-MM-DD')
  447. this.endtime = Date.parse(endDate)/1000
  448. this.getlistDetail()
  449. this.getIdSlist()
  450. }
  451. //近半年
  452. if(month == 2){
  453. this.listQuery.start_time = ""
  454. this.listQuery.end_time =""
  455. this.monthActive = 2
  456. const startDate = moment().subtract('month', 6).format('YYYY-MM-DD')
  457. this.startime = Date.parse(startDate)/1000
  458. const endDate = moment(new Date()).format('YYYY-MM-DD')
  459. this.endtime = Date.parse(endDate)/1000
  460. this.getlistDetail()
  461. this.getIdSlist()
  462. }
  463. //近一年
  464. if(month == 3){
  465. this.listQuery.start_time = ""
  466. this.listQuery.end_time =""
  467. this.monthActive = 3
  468. const startDate = moment().subtract('month', 12).format('YYYY-MM-DD')
  469. this.startime = Date.parse(startDate)/1000
  470. const endDate = moment(new Date()).format('YYYY-MM-DD')
  471. this.endtime = Date.parse(endDate)/1000
  472. this.getlistDetail()
  473. this.getIdSlist()
  474. }
  475. this.monthType = month;
  476. },
  477. clickQuality(index,itemid) {
  478. var itemName = ''
  479. for(let i=0;i<this.normData.length;i++){
  480. if(itemid == this.normData[i].inspection_minor){
  481. if(this.normData[i].range_type == 1){
  482. itemName = this.normData[i].item_name + "("+this.normData[i].min_range + "-"+this.normData[i].large_range+")"+this.normData[i].unit
  483. }
  484. if(this.normData[i].range_type == 2){
  485. itemName = this.normData[i].item_name
  486. }
  487. }
  488. }
  489. this.itemName = itemName
  490. this.quality = index;
  491. this.item_id = itemid
  492. this.getlistDetail()
  493. },
  494. handleSizeChange(limit) {
  495. //this.limit = limit;
  496. //this.getConfigurationList();
  497. },
  498. handleCurrentChange(page) {
  499. //this.page = page;
  500. //this.getConfigurationList();
  501. },
  502. getTime(time) {
  503. return uParseTime(time, "{y}-{m}-{d}");
  504. },
  505. onSearch(){
  506. },
  507. changeTime(val){
  508. var time = this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time);
  509. if (time > 0) {
  510. this.$message.error("结束时间不能小于开始时间");
  511. this.listQuery.start_time = "";
  512. } else {
  513. this.startime = Date.parse(val)/1000;//s
  514. this.getlistDetail()
  515. }
  516. },
  517. changeEndTime(val){
  518. var time =
  519. this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
  520. if (time < 0) {
  521. this.$message.error("结束时间不能小于开始时间");
  522. this.listQuery.end_time = "";
  523. } else {
  524. this.endtime = Date.parse(val)/1000;//s
  525. this.getlistDetail()
  526. }
  527. },
  528. getTimestamp(time) {
  529. // 把时间日期转成时间戳
  530. return new Date(time).getTime() / 1000;
  531. },
  532. handleChange(val){
  533. this.patientid = val.id
  534. this.patient_name = val.name
  535. this.getlistDetail()
  536. this.getIdSlist()
  537. },
  538. getCurrentOrgPatients(){
  539. getCurrentOrgPatients().then(response=>{
  540. if(response.data.state == 1){
  541. var patients = response.data.data.patients
  542. for(let i=0;i<patients.length;i++){
  543. if(this.patientid == patients[i].id){
  544. this.$refs.singleTable.setCurrentRow(patients[i])
  545. this.patient_name = patients[i].name
  546. }
  547. }
  548. this.patientsData = patients
  549. }
  550. })
  551. },
  552. getNormData(){
  553. getNormData().then(response=>{
  554. var normdata = response.data.data.normdata
  555. // console.log("normdata",normdata)
  556. for(let i=0;i<normdata.length;i++){
  557. this.item_id = normdata[0].inspection_minor
  558. this.itemName = normdata[0].item_name + "("+normdata[0].min_range + "-"+normdata[0].large_range +")"+normdata[0].unit
  559. this.ids.push(normdata[i].inspection_minor)
  560. }
  561. // console.log("ids",this.ids)
  562. this.normData = normdata
  563. this.getlist()
  564. this.getIdSlist()
  565. })
  566. },
  567. getlist(){
  568. this.modesData.series = []
  569. this.modesData.xAxis = []
  570. this.char2.xAxis.data = []
  571. this.char2.series[0].data = []
  572. const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
  573. const endDate = moment(new Date()).format('YYYY-MM-DD')
  574. var now = new Date()
  575. var nowMonth = now.getMonth(); //当前月
  576. var nowYear = now.getFullYear(); //当前年
  577. //本月的开始时间
  578. var monthStartDate = new Date(nowYear, nowMonth, 1);
  579. this.startime=Date.parse(monthStartDate)/1000;//s
  580. //本月的结束时间
  581. var monthEndDate = moment().endOf('month').format('YYYY-MM-DD HH:mm:ss');
  582. this.endtime =Date.parse(monthEndDate)/1000-1;//s
  583. const params = {
  584. patientid:this.patientid,
  585. startime:this.startime,
  586. endtime:this.endtime,
  587. itemid:this.item_id,
  588. inspectdate:this.inspect_date,
  589. }
  590. GetQualityControl(params).then(response=>{
  591. if(response.data.state == 1){
  592. var list = response.data.data.list
  593. // console.log("list是什么",list)
  594. for(let i=0;i<list.length;i++){
  595. if(parseInt(list[i].inspect_value)>= parseInt(list[i].range_min) && parseInt(list[i].inspect_value)<= parseInt(list[i].range_max)){
  596. this.isTrue = 1
  597. }
  598. if(parseInt(list[i].inspect_value)< parseInt(list[i].range_min) || parseInt(list[i].inspect_value) > parseInt(list[i].range_max)){
  599. this.isTrue =0
  600. }
  601. if(list[i].range_type == 1){
  602. this.rangetype = 1
  603. this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
  604. this.modesData.series.push(list[i].inspect_value)
  605. }
  606. if(list[i].range_type == 2){
  607. this.rangetype = 2
  608. this.otherData.push(list[i].inspect_value)
  609. this.char2.series[0].data.push("1")
  610. this.char2.xAxis.data.push(this.getTime(list[i].inspect_date))
  611. this.char2.series[0].name = list[i].range_value
  612. }
  613. }
  614. this.chart.series[0].data = this.modesData.series
  615. this.chart.xAxis.data = this.modesData.xAxis
  616. if(this.rangetype == 1){
  617. this.getArrLength(this.chart.xAxis.data,1)
  618. }else{
  619. this.getArrLength(this.char2.xAxis.data,2)
  620. }
  621. }
  622. })
  623. },
  624. getlistDetail(){
  625. this.modesData.series = []
  626. this.modesData.xAxis = []
  627. this.char2.xAxis.data = []
  628. this.char2.series[0].data = []
  629. const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
  630. const endDate = moment(new Date()).format('YYYY-MM-DD')
  631. if(this.monthActive == 0){
  632. var now = new Date()
  633. var nowMonth = now.getMonth(); //当前月
  634. var nowYear = now.getFullYear(); //当前年
  635. //本月的开始时间
  636. var monthStartDate = new Date(nowYear, nowMonth, 1);
  637. this.startime=Date.parse(monthStartDate)/1000;//s
  638. //本月的结束时间
  639. var monthEndDate = moment().endOf('month').format('YYYY-MM-DD HH:mm:ss');
  640. this.endtime =Date.parse(monthEndDate)/1000-1;//s
  641. }
  642. const params = {
  643. patientid:this.patientid,
  644. startime:this.startime,
  645. endtime:this.endtime,
  646. itemid:this.item_id,
  647. }
  648. // console.log("params",params)
  649. getPatientComplianceDetail(params).then(response=>{
  650. if(response.data.state == 1){
  651. var list = response.data.data.list
  652. for(let i=0;i<list.length;i++){
  653. if(parseInt(list[i].inspect_value)>= parseInt(list[i].range_min) && parseInt(list[i].inspect_value)<= parseInt(list[i].range_max)){
  654. this.isTrue = 1
  655. }
  656. if(parseInt(list[i].inspect_value)< parseInt(list[i].range_min) || parseInt(list[i].inspect_value) > parseInt(list[i].range_max)){
  657. this.isTrue =0
  658. }
  659. if(list[i].range_type == 1){
  660. this.rangetype = 1
  661. this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
  662. this.modesData.series.push(list[i].inspect_value)
  663. }
  664. if(list[i].range_type == 2){
  665. this.rangetype = 2
  666. this.otherData.push(list[i].inspect_value)
  667. this.char2.series[0].data.push("1")
  668. this.char2.xAxis.data.push(this.getTime(list[i].inspect_date))
  669. this.char2.series[0].name = list[i].range_value
  670. }
  671. }
  672. this.chart.series[0].data = this.modesData.series
  673. this.chart.xAxis.data = this.modesData.xAxis
  674. if(this.rangetype == 1){
  675. this.getArrLength(this.chart.xAxis.data,1)
  676. }else{
  677. this.getArrLength(this.char2.xAxis.data,2)
  678. }
  679. }
  680. })
  681. },
  682. querySearchAsync(keyword, cb) {
  683. let key = ''
  684. if (keyword != undefined) {
  685. key = keyword
  686. }
  687. let searchArray = []
  688. PostSearch(key).then(response => {
  689. if (response.data.state == 1) {
  690. searchArray = response.data.data.patient
  691. // console.log("searchArray",searchArray)
  692. cb(searchArray)
  693. } else {
  694. cb([])
  695. }
  696. })
  697. },
  698. handleSelect(val) {
  699. // console.log("val",val)
  700. this.listQuery.search = val.name
  701. this.patientid = val.id
  702. for(let i=0;i<this.patientsData.length;i++){
  703. if(val.id == this.patientsData[i].id){
  704. this.$refs.singleTable.setCurrentRow(this.patientsData[i])
  705. }
  706. }
  707. this.getlistDetail()
  708. },
  709. getArrLength(result,type){
  710. if(type == 1){
  711. if(result.length > 10){
  712. var dataZoom_end = (10/result.length)*100;
  713. this.chart.dataZoom[0].end = dataZoom_end
  714. }else{
  715. var dataZoom_end = 100;
  716. this.chart.dataZoom[0].end = dataZoom_end
  717. }
  718. }else{
  719. if(result.length > 10){
  720. var dataZoom_end = (10/result.length)*100;
  721. this.char2.dataZoom[0].end = dataZoom_end
  722. }else{
  723. var dataZoom_end = 100;
  724. this.char2.dataZoom[0].end = dataZoom_end
  725. }
  726. }
  727. },
  728. getIdSlist(){
  729. var ids = []
  730. ids = this.ids
  731. this.vlist = []
  732. getIdSlist({ids:ids},this.patientid).then(response=>{
  733. if(response.data.state == 1){
  734. const vlist = response.data.data.vlist
  735. // console.log("vlist",vlist)
  736. this.vlist = vlist
  737. }
  738. })
  739. },
  740. getvlist(id){
  741. var itemvalue = 0
  742. for(let i=0;i<this.vlist.length;i++){
  743. if(id == this.vlist[i].item_id){
  744. if(this.vlist[i].inspect_type == 1 &&this.vlist[i].inspect_value!=''){
  745. itemvalue = parseInt(this.vlist[i].inspect_value)
  746. }else{
  747. itemvalue = 0
  748. }
  749. }
  750. }
  751. return itemvalue
  752. },
  753. getvlistwo(id){
  754. var itemvalue = ''
  755. for(let i=0;i<this.vlist.length;i++){
  756. if(id == this.vlist[i].item_id){
  757. if(this.vlist[i].inspect_type ==2 && this.vlist[i].inspect_value!=''){
  758. itemvalue = this.vlist[i].inspect_value
  759. }else{
  760. itemvalue = ''
  761. }
  762. }
  763. }
  764. return itemvalue
  765. }
  766. },
  767. created(){
  768. this.patientid = this.$route.query.patientid
  769. this.inspect_date = this.$route.query.date
  770. //获取指标项
  771. this.getNormData()
  772. //获取该机构下的所有患者
  773. this.getCurrentOrgPatients()
  774. }
  775. };
  776. </script>
  777. <style lang="scss" scoped>
  778. .point {
  779. width: 13px;
  780. height: 13px;
  781. background: linear-gradient(
  782. 0deg,
  783. rgba(169, 224, 243, 1),
  784. rgba(159, 189, 252, 1)
  785. );
  786. border-radius: 7px;
  787. margin-right: 8px;
  788. }
  789. .pointTitle {
  790. font-size: 13px;
  791. }
  792. .containerRight {
  793. padding-left: 10px;
  794. }
  795. .tableTitle {
  796. font-size: 16px;
  797. color: #000;
  798. font-weight: bold;
  799. margin-bottom: 10px;
  800. margin-top: 8px;
  801. }
  802. .qualityBox {
  803. display: flex;
  804. flex-wrap: nowrap;
  805. min-width: 1800px;
  806. padding-bottom: 10px;
  807. .qualityOne {
  808. width: 4.5rem;
  809. height: 4.5rem;
  810. border-radius: 0.3125rem;
  811. border: 1px solid rgba(229, 229, 229, 1);
  812. display: flex;
  813. align-items: center;
  814. flex-direction: column;
  815. margin-right: 0.875rem;
  816. cursor: pointer;
  817. // justify-content: space-around;
  818. .gth {
  819. color: #ff974a;
  820. font-size: 1.25rem;
  821. }
  822. .gou {
  823. color: #5cd924;
  824. font-size: 1.25rem;
  825. }
  826. p {
  827. width: 100%;
  828. margin-top: 1.25rem;
  829. margin-bottom: 0.625rem;
  830. font-weight: bold;
  831. color: #666666;
  832. font-size: 0.875rem;
  833. text-align: center;
  834. white-space: nowrap;
  835. overflow: hidden;
  836. text-overflow: ellipsis;
  837. }
  838. }
  839. .active {
  840. background: #5b98ff;
  841. p {
  842. color: #fff;
  843. }
  844. .gth {
  845. color: #fff;
  846. font-size: 1.25rem;
  847. }
  848. .gou {
  849. color: #fff;
  850. font-size: 1.25rem;
  851. }
  852. }
  853. }
  854. </style>
  855. <style lang="scss">
  856. .page_patientComplianceDetails {
  857. .cell {
  858. text-align: center;
  859. }
  860. .el-form-item {
  861. margin-bottom: 0;
  862. }
  863. ::-webkit-scrollbar{
  864. height: 15px !important;
  865. }
  866. .el-form--inline .el-form-item{
  867. margin-right:0;
  868. }
  869. }
  870. </style>