123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs="crumbs"></bread-crumb>
- </div>
- <div class="app-container">
- <div class="page_patientComplianceDetails">
- <div class="cell clearfix" style="margin:0">
- <el-form :inline="true" :model="listQuery">
- </el-form>
- </div>
- <el-container>
- <div style="width:150px">
- <div class="tableTitle">患者列表</div>
- <el-table :data="patientsData" border style="width: 100%;" height="500" highlight-current-row @current-change="handleChange">
- <el-table-column prop="name" label="透析号" width="80">
- <template slot-scope="scope">
- {{scope.row.dialysis_no}}
- </template>
- </el-table-column>
- <el-table-column prop="date" label="透析号" width="70">
- <template slot-scope="scope">
- {{scope.row.name }}
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="containerRight" style="flex:1;overflow: hidden">
- <div class="cell clearfix">
- <label class="title" style="text-align:left">
- <span class="name">统计方式</span> :
- </label>
- <div class="time">
- <ul class>
- <li
- :class="item.state == monthType ? 'active' : ''"
- @click="chooseMonth(item.state)"
- v-for="item in month"
- :key="item.value"
- >{{ item.label }}</li>
- </ul>
- </div>
- <label class="title">
- <span class="name">日期查询</span> :
- </label>
- <el-date-picker
- v-model="listQuery.start_time"
- prefix-icon="el-icon-date"
- @change="changeTime"
- :editable="false"
- type="date"
- style="max-width:160px"
- placeholder="选择日期时间"
- align="right"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- :picker-options="pickerOptions"
- ></el-date-picker>
- <span class>-</span>
- <el-date-picker
- v-model="listQuery.end_time"
- prefix-icon="el-icon-date"
- @change="changeEndTime"
- :editable="false"
- type="date"
- style="max-width:160px"
- placeholder="选择日期时间"
- align="right"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- :picker-options="pickerOptions"
- ></el-date-picker>
- </div>
- <div class="tableTitle">指标监控</div>
- <div style="width:100%;overflow-x:auto">
- <div class="qualityBox">
- <div
- class="qualityOne"
- v-for="(item,index) in normData"
- :key="index"
- :class="quality == index ? 'active' : ''"
- @click="clickQuality(index,item.inspection_minor)"
- >
- <p>{{ item.item_name }}</p>
- <span v-if="isTrue == 1"><i class="iconfont icon-gou gou"></i></span>
- <span v-if="isTrue == 0"><i class="iconfont icon-gantanhao gth"></i></span>
- </div>
- </div>
- </div>
- <div class="tableTitle">指标趋势</div>
- <div>
- <line-chart :options="chart"></line-chart>
- </div>
- </div>
- </el-container>
- </div>
- </div>
- </div>
- </template>
-
- <script>
- const moment = require('moment')
- import echarts from "echarts";
- import BreadCrumb from "@/xt_pages/components/bread-crumb";
- import LineChart from "../qcd/components/LineChart";
- import { uParseTime } from "@/utils/tools";
- import { getCurrentOrgPatients,GetQualityControl,getNormData,getPatientComplianceDetail } from "@/api/common/common"
- export default {
- components: {
- LineChart,
- BreadCrumb
- },
- data() {
- return {
- isTrue:0,
- crumbs: [
- { path: false, name: "质控管理" },
- { path: false, name: "患者达标详情" }
- ],
- patientsData:[],
- normData:[],
- startime:0,
- endtime:0,
- listQuery: {
- start_time: "",
- end_time: "",
- page: 1,
- limit: 10
- },
- item_id:0,
- month: [
- { value: 0, label: "本月", state: 0 },
- { value: 1, label: "近三个月", state: 1 },
- { value: 2, label: "近半年", state: 2 },
- { value: 3, label: "近一年", state: 3 }
- ],
- modesData: {
- xAxis: [],
- series: []
- },
- pickerOptions: {
- disabledDate(time) {
- let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
- return time.getTime() > Date.now() || time.getTime() < threeMonths;;
- }
- },
- patientid:0,
- monthType: 0,
- arr: ["钙", "磷", "钙萨达撒所多", "磷", "钙", "磷", "钙", "磷"],
- quality: 0,
- chart: {
- title: {
- text: "ECharts 入门示例"
- },
- tooltip: {},
- legend: {
- data: ["次数"],
- left: 0
- },
- xAxis: {
- data: []
- },
- yAxis: {
- axisLabel: {
- formatter: "{value} %"
- },
- show: false
- },
- series: [
- {
- name: "次数",
- type: "line",
- data: [],
- barWidth: 30,
- label: {
- normal: {
- show: true,
- position: "top",
- formatter: "{c}g/L"
- }
- },
- //配置样式
- itemStyle: {
- //通常情况下:
-
- //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
- normal: {
- color: function(params) {
- //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
- var colorList = [
- ["#A9E0F3", "#9FBDFC"],
- ["#A9E0F3", "#9FBDFC"],
- ["#A9E0F3", "#9FBDFC"],
-
- ["#FFD7C0", "#FF9994"],
- ["#FFD7C0", "#FF9994"],
- ["#FFD7C0", "#FF9994"],
- ["#D7C3FD", "#B3A8F7"],
- ["#D7C3FD", "#B3A8F7"],
- ["#D7C3FD", "#B3A8F7"]
- ];
-
- var index = params.dataIndex;
- if (params.dataIndex >= colorList.length) {
- index = params.dataIndex % colorList.length;
- }
-
- return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- { offset: 0, color: colorList[index][0] },
- // { offset: 0.5, color: colorList[index][1] },
- { offset: 1, color: colorList[index][1] }
- ]);
- },
- barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
- },
-
- //鼠标悬停时:
- emphasis: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: "rgba(0, 0, 0, 0.5)"
- }
- }
- }
- ]
- },
- inspect_date:0,
- monthActive:0,
- };
- },
- methods: {
- chooseMonth(month) {
- //一月
- if(month == 0){
- this.monthActive = 0
- const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
- const endDate = moment(new Date()).format('YYYY-MM-DD')
- var now = new Date()
- var nowMonth = now.getMonth(); //当前月
- var nowYear = now.getFullYear(); //当前年
- //本月的开始时间
- var monthStartDate = new Date(nowYear, nowMonth, 1);
- this.startime=Date.parse(monthStartDate)/1000;//s
-
- //本月的结束时间
- var monthEndDate = moment().endOf('month').format('YYYY-MM-DD HH:mm:ss');
- this.endtime =Date.parse(monthEndDate)/1000-1;//s
- this.getlistDetail()
- }
-
- //近三月
- if(month == 1){
- this.monthActive = 1
- const startDate = moment().subtract('month', 3).format('YYYY-MM-DD')
-
- this.startime = Date.parse(startDate)/1000
-
- const endDate = moment(new Date()).format('YYYY-MM-DD')
-
- this.endtime = Date.parse(endDate)/1000
-
- this.getlistDetail()
- }
-
-
- //近半年
- if(month == 2){
- this.monthActive = 2
- const startDate = moment().subtract('month', 6).format('YYYY-MM-DD')
-
- this.startime = Date.parse(startDate)/1000
- const endDate = moment(new Date()).format('YYYY-MM-DD')
- this.endtime = Date.parse(endDate)/1000
- this.getlistDetail()
- }
-
- //近一年
- if(month == 3){
- this.monthActive = 3
- const startDate = moment().subtract('month', 12).format('YYYY-MM-DD')
- this.startime = Date.parse(startDate)/1000
- const endDate = moment(new Date()).format('YYYY-MM-DD')
- this.endtime = Date.parse(endDate)/1000
- this.getlistDetail()
- }
-
-
- this.monthType = month;
- },
- clickQuality(index,itemid) {
- this.quality = index;
- this.item_id = itemid
- this.getlistDetail()
- },
- handleSizeChange(limit) {
- //this.limit = limit;
- //this.getConfigurationList();
- },
- handleCurrentChange(page) {
- //this.page = page;
- //this.getConfigurationList();
- },
- getTime(time) {
- return uParseTime(time, "{y}-{m}-{d}");
- },
- onSearch(){
- },
- changeTime(val){
- var time = this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time);
- if (time > 0) {
- this.$message.error("结束时间不能小于开始时间");
- this.listQuery.start_time = "";
- } else {
- this.startime = Date.parse(val)/1000;//s
- this.getlistDetail()
- }
-
- },
- changeEndTime(val){
- var time =
- this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
- if (time < 0) {
- this.$message.error("结束时间不能小于开始时间");
- this.listQuery.end_time = "";
- } else {
- this.endtime = Date.parse(val)/1000;//s
- this.getlistDetail()
- }
-
- },
- getTimestamp(time) {
- // 把时间日期转成时间戳
- return new Date(time).getTime() / 1000;
- },
- handleChange(val){
- this.patientid = val.id
- this.getlistDetail()
- },
- getCurrentOrgPatients(){
- getCurrentOrgPatients().then(response=>{
- if(response.data.state == 1){
- var patients = response.data.data.patients
- this.patientsData = patients
- }
- })
- },
- getNormData(){
- getNormData().then(response=>{
- var normdata = response.data.data.normdata
- for(let i=0;i<normdata.length;i++){
- this.item_id = normdata[0].inspection_minor
- }
- this.normData = normdata
- this.getlist()
- })
- },
- getlist(){
- this.modesData.series = []
- this.modesData.xAxis = []
- const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
- const endDate = moment(new Date()).format('YYYY-MM-DD')
- var now = new Date()
- var nowMonth = now.getMonth(); //当前月
- var nowYear = now.getFullYear(); //当前年
- //本月的开始时间
- var monthStartDate = new Date(nowYear, nowMonth, 1);
- this.startime=Date.parse(monthStartDate)/1000;//s
- //本月的结束时间
- var monthEndDate = moment().endOf('month').format('YYYY-MM-DD HH:mm:ss');
- this.endtime =Date.parse(monthEndDate)/1000-1;//s
-
- const params = {
- patientid:this.patientid,
- startime:this.startime,
- endtime:this.endtime,
- itemid:this.item_id,
- inspectdate:this.inspect_date,
- }
- GetQualityControl(params).then(response=>{
- if(response.data.state == 1){
- var list = response.data.data.list
- for(let i=0;i<list.length;i++){
- if(parseInt(list[i].inspect_value)>= parseInt(list[i].range_min) && parseInt(list[i].inspect_value)<= parseInt(list[i].range_max)){
- this.isTrue = 1
- }
- if(parseInt(list[i].inspect_value)< parseInt(list[i].range_min) || parseInt(list[i].inspect_value) > parseInt(list[i].range_max)){
- this.isTrue =0
- }
- this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
- this.modesData.series.push(list[i].inspect_value)
-
- }
- this.chart.series[0].data = this.modesData.series
- this.chart.xAxis.data = this.modesData.xAxis
-
- }
-
- })
- },
-
- getlistDetail(){
- this.modesData.series = []
- this.modesData.xAxis = []
- const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
- const endDate = moment(new Date()).format('YYYY-MM-DD')
-
- if(this.monthActive == 0){
- var now = new Date()
- var nowMonth = now.getMonth(); //当前月
- var nowYear = now.getFullYear(); //当前年
- //本月的开始时间
- var monthStartDate = new Date(nowYear, nowMonth, 1);
- this.startime=Date.parse(monthStartDate)/1000;//s
- //本月的结束时间
- var monthEndDate = moment().endOf('month').format('YYYY-MM-DD HH:mm:ss');
- this.endtime =Date.parse(monthEndDate)/1000-1;//s
- }
-
- const params = {
- patientid:this.patientid,
- startime:this.startime,
- endtime:this.endtime,
- itemid:this.item_id,
- }
- console.log("params",params)
- getPatientComplianceDetail(params).then(response=>{
- if(response.data.state == 1){
- var list = response.data.data.list
- for(let i=0;i<list.length;i++){
- if(parseInt(list[i].inspect_value)>= parseInt(list[i].range_min) && parseInt(list[i].inspect_value)<= parseInt(list[i].range_max)){
- this.isTrue = 1
- }
- if(parseInt(list[i].inspect_value)< parseInt(list[i].range_min) || parseInt(list[i].inspect_value) > parseInt(list[i].range_max)){
- this.isTrue =0
- }
- this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
- this.modesData.series.push(list[i].inspect_value)
-
- }
- this.chart.series[0].data = this.modesData.series
- this.chart.xAxis.data = this.modesData.xAxis
- }
- })
- }
- },
-
- created(){
- this.patientid = this.$route.query.patientid
- this.inspect_date = this.$route.query.date
- //获取指标项
- this.getNormData()
- //获取该机构下的所有患者
- this.getCurrentOrgPatients()
-
-
- }
- };
- </script>
-
- <style lang="scss" scoped>
- .containerRight {
- padding-left: 10px;
- }
- .tableTitle {
- font-size: 16px;
- color: #000;
- font-weight: bold;
- margin-bottom: 10px;
- margin-top: 8px;
- }
- .qualityBox {
- display: flex;
- flex-wrap: nowrap;
- min-width: 1800px;
- .qualityOne {
- width: 4.5rem;
- height: 4.5rem;
- border-radius: 0.3125rem;
- border: 1px solid rgba(229, 229, 229, 1);
- display: flex;
- align-items: center;
- flex-direction: column;
- margin-right: 0.875rem;
- cursor: pointer;
- // justify-content: space-around;
- .gth {
- color: #ff974a;
- font-size: 1.25rem;
- }
- .gou {
- color: #5cd924;
- font-size: 1.25rem;
- }
- p {
- width: 100%;
- margin-top: 1.25rem;
- margin-bottom: 0.625rem;
- font-weight: bold;
- color: #666666;
- font-size: 0.875rem;
- text-align: center;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- .active {
- background: #5b98ff;
- p {
- color: #fff;
- }
- .gth {
- color: #fff;
- font-size: 1.25rem;
- }
- .gou {
- color: #fff;
- font-size: 1.25rem;
- }
- }
- }
- </style>
-
-
- <style lang="scss">
- .page_patientComplianceDetails {
- .cell {
- text-align: center;
- }
- .el-form-item {
- margin-bottom: 0;
- }
- }
- </style>
|