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

patientComplianceDetails.vue 28KB

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