123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs="crumbs"></bread-crumb>
- </div>
- <div class="app-container">
- <div class="page_process">
- <new-nav activeName="weight"></new-nav>
- <div class="cell clearfix">
- <el-form :inline="true">
- <el-form-item label>
- <el-autocomplete
- class="checkSearch"
- popper-class="my-autocomplete"
- v-model="search_value"
- :fetch-suggestions="querySearchAsync"
- :trigger-on-focus="false"
- placeholder="请输入病人名字"
- @select="handleSelect"
- style="width:160px;"
- >
- <i class="el-icon-search el-input__icon" slot="suffix"></i>
- <template slot-scope="{ item }">
- <div class="name">{{ item.name }}</div>
- </template>
- </el-autocomplete>
-
- </el-form-item>
- </el-form>
- <el-select v-model="query.statistics_type" placeholder="请选择" style="width:110px;margin-right:10px" @change="changeProject">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.name"
- :value="item.value"
-
- ></el-option>
- </el-select>
- <label class="title">
- <span class="name">日期查询</span> :
- </label>
- <el-date-picker
- v-model="query.start_time"
- prefix-icon="el-icon-date"
- @change="changeTime"
- :editable="false"
- style="width: 150px;"
- type="date"
- :picker-options="pickerOptions"
- placeholder="选择日期时间"
- align="right"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- ></el-date-picker>
- <span class>-</span>
- <el-date-picker
- v-model="query.end_time"
- prefix-icon="el-icon-date"
- @change="changeEndTime"
- :editable="false"
- :picker-options="pickerOptions"
- style="width: 150px;"
- type="date"
- placeholder="选择日期时间"
- align="right"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- ></el-date-picker>
- </div>
- <el-container>
- <div style="width:160px">
-
- <div class="tableTitle">患者列表</div>
-
-
- <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
- :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
- highlight-current-row
- @current-change="handleChange">
- <el-table-column prop="dialysis_no" label="透析号" width="70">
- <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
- </el-table-column>
- <el-table-column prop="name" label="姓名" width="90">
- <template slot-scope="scope">{{ scope.row.name }}</template>
- </el-table-column>
- </el-table>
- </div>
- <div style="padding-left:10px;flex:1">
- <div class="tableTitle">指标趋势<span style="font-weight:normal"> (当前患者: {{patient_name}})</span></div>
- <div>
- <line-chart :options="bar"></line-chart>
-
- </div>
- <div class="tableTitle">统计表</div>
- <div>
-
- <el-table :data="tableData" style="width: 100%" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
- <el-table-column fixed label="日期" align="center">
- <template slot-scope="scope">
- {{scope.row.assessment_date | parseTime("{y}-{m}-{d}") }}
- </template>
- </el-table-column>
-
- <el-table-column label="姓名" align="center">
- <template slot-scope="scope">
- {{scope.row.patient.name}}
- </template>
- </el-table-column>
-
- <el-table-column label="干体重" align="center">
- <template slot-scope="scope">
- {{scope.row.dry_weight?scope.row.dry_weight:''}}
-
- <!--{{// scope.row.patient.lapseto == 1 ? '留治':'转出'}}-->
- </template>
- </el-table-column>
-
- <el-table-column label="前次透后体重" align="center">
- <template slot-scope="scope">
- {{scope.row.last_after_weight?scope.row.last_after_weight:''}}
-
- <!--<div v-if="scope.row.before.systolic_blood_pressure">{{scope.row.before.systolic_blood_pressure}} / {{scope.row.before.diastolic_blood_pressure}}</div>-->
- </template>
- </el-table-column>
-
- <el-table-column label="透前体重" align="center">
- <template slot-scope="scope">
- {{scope.row.weight_before?scope.row.weight_before:''}}
-
- <!--<div v-if="scope.row.min_monitor.systolic_blood_pressure">{{ scope.row.min_monitor.systolic_blood_pressure}} /{{ scope.row.min_monitor.diastolic_blood_pressure}}</div>-->
- </template>
- </el-table-column>
-
- <el-table-column label="透后体重" align="center">
- <template slot-scope="scope">
- <!--<div v-if="scope.row.max_monitor.systolic_blood_pressure">{{ scope.row.max_monitor.systolic_blood_pressure}} /{{ scope.row.max_monitor.diastolic_blood_pressure}}</div>-->
- {{scope.row.after.weight_after?scope.row.after.weight_after:''}}
-
-
- </template>
- </el-table-column>
-
- <el-table-column label="体重增加" align="center">
- <template slot-scope="scope">
- <div v-if="scope.row.weight_before && scope.row.last_after_weight">{{(scope.row.weight_before - scope.row.last_after_weight).toFixed(1)}}</div>
-
- <!--{{scope.row.weight_before - scope.row.last_after_weight}}-->
- <!--<div v-if="scope.row.after.systolic_blood_pressure"> {{ scope.row.after.systolic_blood_pressure}} /{{scope.row.after.diastolic_blood_pressure}}</div>-->
- </template>
- </el-table-column>
-
- <el-table-column fixed="right" label="趋势" align="center">
- <template slot-scope="scope">
- <el-button
- @click.native.prevent="jumpDetail(scope.row.patient_id)"
- type="text"
- size="small"
- style="font-size:14px;"
- >详情</el-button>
- </template>
- </el-table-column>
-
- </el-table>
-
- <el-pagination
- align="right"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="query.page"
- :page-sizes="[10, 20, 50, 100]"
- :page-size="10"
- background
- style="margin-top:20px;"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- ></el-pagination>
- </div>
- </div>
- </el-container>
- </div>
- </div>
- </div>
- </template>
-
-
- <script>
- import echarts from 'echarts'
- import NewNav from '../indicatorControlAnalysis/components/NewNav'
- import BreadCrumb from '@/xt_pages/components/bread-crumb'
- import LineChart from '../../qcd/components/LineChart'
- import { getCurrentOrgPatients } from "@/api/common/common";
- import {GetDialysisWeightChartData,GetDialysisWeightTableData,GetDefalutPatient} from "@/api/common/statistics"
-
- import {
- PostSearch
- } from '@/api/patient'
-
- import { uParseTime } from "@/utils/tools";
- import { getDataConfig } from "@/utils/data";
-
- export default {
- components: {
- LineChart,
- BreadCrumb,
- NewNav
- },
- data() {
- return {
- percent:[],
- 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;;
- }
- },
- patientsData:[],
- tableData: [
- ],
- loading: false,
- search_value: '',
- total: 0,
- patient_name:'',
- query: {
-
- patient_id: '',
- statistics_type: 1,
- start_time: '',
- end_time: '',
- limit: 10,
- page: 1
- },
- options: [
- { value: 1, name: '干体重' },
- { value: 2, name: '透前体重' },
- { value: 3, name: '体重增加' },
- { value: 4, name: '透后体重' },
- ],
- crumbs: [
- { path: false, name: '质控管理' },
- { path: false, name: '指标评估统计' },
- { path: false, name: '透析过程指标统计' }
- ],
- tableData1: [],
- 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: (params) => {
- if(this.percent.length > 0){
- let str = ''
- str = params.data + '('+ this.percent[params.dataIndex] +'%)'
- return str
- }else{
- let str = ''
- str = params.data
- return str
- }
- }
- }
- },
- //配置样式
- itemStyle: {
- //通常情况下:
-
- //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
- normal: {
- color: function(params) {
- //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
- var colorList = [
- ['#A9E0F3', '#9FBDFC'],
-
- ['#FFD7C0', '#FF9994']
- ]
-
- 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.2)'
- }
- }
- }
- ]
- },
- bar: {
- title: {
- text: 'ECharts 入门示例'
- },
- tooltip: {},
- legend: {
- data: [],
- left: 0
- },
- xAxis: {
- data: []
- },
- yAxis: {
- axisLabel: {
- formatter: '{value} %'
- },
- show: false
- },
- series: [
- {
- name: '',
- type: 'bar',
- data: [],
- barWidth: 30,
- label: {
- normal: {
- show: true,
- position: 'top',
- formatter: (params) => {
- if(this.percent.length > 0){
- let str = ''
- str = params.data + '('+ this.percent[params.dataIndex] +'%)'
- return str
- }else{
- let str = ''
- str = params.data
- return str
- }
- }
- }
- },
- //配置样式
- itemStyle: {
- //通常情况下:
-
- //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
- normal: {
- color: function(params) {
- //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
- var colorList = [
- ['#A9E0F3', '#9FBDFC'],
- ['#FFD7C0', '#FF9994']
- ]
-
- 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.2)'
- }
- }
- }
- ]
- }
-
- }
- },
- methods: {
- jumpDetail(patient_id){
- this.$router.push("/qcd/indicatorControlAnalysis/weightDetails?id="+patient_id)
-
- },
- changeProject(val){
- this.query.statistics_type = val
- this.query.page = 1
- this.GetDialysisWeightChartData(this.query)
-
- },
- handleChange(val){
- this.query.patient_id = val.id
- this.query.page = 1
- this.patient_name = val.name
- this.GetDialysisWeightTableData(this.query)
- // this.GetDialysisWeightChartData(this.query)
- },
- handleSizeChange(limit) {
- this.query.limit = limit;
- this.GetDialysisWeightTableData(this.query)
-
- },
- handleCurrentChange(page) {
- this.query.page = page;
- this.GetDialysisWeightTableData(this.query)
-
- },
- changeTime(val) {
- var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
- if (time > 0) {
- this.$message.error("结束时间不能小于开始时间");
- this.query.start_time = "";
- } else {
- // this.getDialysisList()
- this.query.page = 1;
- this.GetDialysisWeightChartData(this.query)
- this.GetDialysisWeightTableData(this.query)
-
- }
-
- },
- changeEndTime(val) {
- var time =
- this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
- if (time < 0) {
- this.$message.error("结束时间不能小于开始时间");
- this.query.end_time = "";
- } else {
- this.query.page = 1;
- this.GetDialysisWeightChartData(this.query)
- this.GetDialysisWeightTableData(this.query)
-
- }
- },
- getTimestamp(time) {
- // 把时间日期转成时间戳
- return new Date(time).getTime() / 1000;
- },
- QueryOperaById: function(val) {
- let vascular_access_desc_name = "";
- let vascular_access_desc = getDataConfig(
- "hemodialysis",
- "vascular_access_desc"
- );
- for (let i = 0; i < vascular_access_desc.length; i++) {
- if (vascular_access_desc[i].id == val) {
- vascular_access_desc_name = vascular_access_desc[i].name;
- }
- }
-
- return vascular_access_desc_name;
- },
- GetAnticoagulantById: function (val) {
- let anticoagulan_name = ''
- var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
- let anticoagulant = anticoagulantsConfitTwo
- for (let keys in anticoagulant) {
- if (anticoagulant[keys].id == val) {
- anticoagulan_name = anticoagulant[keys].name
- }
- }
- return anticoagulan_name
- },
- getModeName(mode_id){
- return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name: ""
- }, GetDialysisWeightTableData(params) {
- this.loading = true
- this.tableData = []
- GetDialysisWeightTableData(params)
- .then(rs => {
- var resp = rs.data
- if (resp.state == 1) {
- this.loading = false
-
- for (let i = 0; i < resp.data.data.length; i++) {
- this.tableData.push(resp.data.data[i])
- }
- this.total = resp.data.total
-
- } else {
- this.loading = false
- }
- })
- .catch(error => {
-
- })
- },
- GetDialysisWeightChartData(params) {
-
- // this.bar.xAxis.data = []
- // this.bar.series[0].data = []
- // this.percent = []
- GetDialysisWeightChartData(params)
- .then(rs => {
- var resp = rs.data
- if (resp.state == 1) {
- this.bar.xAxis.data = []
- this.bar.series[0].data = []
- this.percent = []
- for (let i = 0; i < resp.data.data.length; i++) {
- this.bar.xAxis.data.push(resp.data.data[i].name)
- this.bar.series[0].data.push(resp.data.data[i].total)
- this.percent.push(resp.data.data[i].ratio)
-
-
- }
- } else {
- }
- })
- .catch(error => {
- })
- },
- handleSelect(val) {
- this.query.patient_id = val.id
- this.query.page = 1
- // this.GetDialysisWeightChartData(this.query)
- // this.GetDialysisWeightTableData(this.query)
- for (let i = 0;i < this.patientsData.length; i++){
- if (this.patientsData[i].id == val.id){
- this.patient_name = this.patientsData[i].name
- this.$refs.table.setCurrentRow(this.patientsData[i])
- }
- }
-
- },
- querySearchAsync(keyword, cb) {
- let key = ''
- if (keyword != undefined) {
- key = keyword
- }
- let searchArray = []
- PostSearch(key).then(response => {
- if (response.data.state == 1) {
- searchArray = response.data.data.patient
- cb(searchArray)
- } else {
- cb([])
- }
- })
- },
- chooseWay(way) {
- this.wayType = way
- }, getCurrentOrgPatients(){
- getCurrentOrgPatients().then(response=>{
- if(response.data.state == 1){
- var patients = response.data.data.patients
- this.patientsData = patients
- // this.GetDefaultPatient()
- }
- })
- },GetDefaultPatient() {
- GetDefalutPatient().then(response => {
- if (response.data.state == 1) {
- var patient = response.data.data.patient
- this.patient_name = this.patientsData[i].name
-
- }
- })
- }
- }, created() {
- var date = new Date()
- var year = date.getFullYear() //获取完整的年份(4位)
- var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
- var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
- var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
- this.query.patient_id = 0
- this.query.end_time = year + '-' + month + '-' + day
- this.query.start_time = year + '-' + last_month + '-' + day
- this.query.statistics_type = 1
- this.GetDialysisWeightChartData(this.query)
- this.GetDialysisWeightTableData(this.query)
- this.getCurrentOrgPatients()
-
-
- }
- }
- </script>
-
- <style lang="scss" scoped>
- .tableTitle {
- font-size: 16px;
- color: #000;
- font-weight: bold;
- margin-bottom: 10px;
- }
- </style>
- <style lang="scss">
- .page_process {
-
- .el-button--medium {
- padding: 10px 8px;
- }
-
- .el-form-item {
- margin-bottom: 0;
- }
- ::-webkit-scrollbar{
- height: 15px !important;
- }
-
- }
- </style>
|