123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs="crumbs"></bread-crumb>
- </div>
- <div class="app-container">
- <div class="page_patientControlAnalysis">
- <div class="cell clearfix">
- <el-form :inline="true" :model="listQuery">
- <el-form-item label>
- <el-autocomplete
- class="checkSearch"
- popper-class="my-autocomplete"
- v-model.trim="listQuery.search"
- :fetch-suggestions="querySearchAsync"
- :trigger-on-focus="false"
- placeholder="病人透析号/姓名"
- @select="handleSelect"
- >
- <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="lapstor" placeholder="请选择" style="margin-right:20px;width:100px">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select> -->
- <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"
- style="width: 196px;"
- type="date"
- placeholder="选择日期时间"
- align="right"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- ></el-date-picker>
- <span class>-</span>
- <el-date-picker
- v-model="listQuery.end_time"
- prefix-icon="el-icon-date"
- @change="changeEndTime"
- :editable="false"
- style="width: 196px;"
- type="date"
- placeholder="选择日期时间"
- align="right"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- ></el-date-picker>
- </div>
- <div class="cell clearfix">
- <p class="chartTitle">统计图</p>
- </div>
- <div class="cell clearfix">
- <p class="point"></p>
- <p class="pointTitle">指标正常范围值</p>
- </div>
- <div v-loading="isLoading">
- <line-chart :options="chart"></line-chart>
- </div>
- <div class="cell clearfix">
- <p class="chartTitle">统计表</p>
- </div>
- <div>
- <el-button type="primary" size="small" style="margin-bottom: 10px;" @click="toExportList">导出</el-button>
- <el-table :data="tableData" v-loading="isLoadingTwo" border style="width: 100%"
- :row-style="{ color: '#303133' }"
- :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
- <el-table-column fixed prop="name" label="姓名" width="100"></el-table-column>
- <el-table-column label="透析号" width="80">
- <template slot-scope="scope">
- {{ scope.row.dialysis_no }}
- </template>
- </el-table-column>
- <el-table-column
- :label="modeItem.item_name"
- property="number"
- align="center"
- min-width="120"
- v-for="(modeItem, index) in normData"
- :key="index"
- >
- <template slot-scope="scope">
- <span
- v-if="scope.row.data[modeItem.item_name].range_type == 1 && scope.row.data[modeItem.item_name].inspect_value == ''">0</span>
- <span
- v-if="scope.row.data[modeItem.item_name].range_type == 1 && scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) < parseInt(scope.row.data[modeItem.item_name].range_min))">
- <span>{{ scope.row.data[modeItem.item_name].inspect_value }}</span><span
- style="color:#5B98FF;margin-left:5px;">↓</span>
- </span>
- <span
- v-if="scope.row.data[modeItem.item_name].range_type == 1 && scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) > parseInt(scope.row.data[modeItem.item_name].range_max))">
- <span>{{ scope.row.data[modeItem.item_name].inspect_value }}</span><span
- style="color:#F56C6C;margin-left:5px;">↑</span>
- </span>
- <span
- v-if="scope.row.data[modeItem.item_name].range_type == 1 && scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) >= parseInt(scope.row.data[modeItem.item_name].range_min))&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) <= parseInt(scope.row.data[modeItem.item_name].range_max)) ">{{ scope.row.data[modeItem.item_name].inspect_value }}</span>
- <span
- v-if="scope.row.data[modeItem.item_name].range_type == 2 && scope.row.data[modeItem.item_name].inspect_value !=''">
- <span
- v-if="scope.row.data[modeItem.item_name].range_value == scope.row.data[modeItem.item_name].inspect_value">
- <span
- style="color:#5B98FF;margin-left:5px;">{{ scope.row.data[modeItem.item_name].inspect_value }}</span>
- </span>
- <span
- v-if="scope.row.data[modeItem.item_name].range_value != scope.row.data[modeItem.item_name].inspect_value">
- <span
- style="color:#F56C6C;margin-left:5px;">{{ scope.row.data[modeItem.item_name].inspect_value }}</span>
- </span>
- </span>
- </template>
- </el-table-column>
- <el-table-column fixed="right" label="操作" width="100">
- <template slot-scope="scope">
- <el-button @click="handleClick(scope.row.patient_id,scope.row.inspect_date)" style="font-size:14px;"
- type="text" size="small">查看
- </el-button>
- </template>
- </el-table-column>
- </el-table>
-
- <el-pagination
- align="right"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="listQuery.page"
- :page-sizes="[10, 20, 50, 100,200,300,400,500,600]"
- :page-size="10"
- background
- style="margin-top:20px;"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- ></el-pagination>
- </div>
- </div>
- </div>
- </div>
- </template>
-
- <script>
- import { PostSearch } from '@/api/patient'
- import echarts from 'echarts'
- import BreadCrumb from '@/xt_pages/components/bread-crumb'
- import LineChart from '../qcd/components/LineChart'
- import {
- getCartogramlist,
- getCurrentOrgPatients,
- getNormData,
- getPatientContorlAnalysis,
- getPatientsControl
- } from '@/api/common/common'
-
- export default {
- components: {
- LineChart,
- BreadCrumb
- },
- data() {
- return {
- 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
-
- }
- },
- crumbs: [
- { path: false, name: '质控管理' },
- { path: false, name: '患者质控达标统计' }
- ],
- listQuery: {
- start_time: '',
- end_time: '',
- page: 1,
- limit: 10
- },
- isLoading: false,
- isLoadingTwo: false,
- // total:0,
- lapstor: 0,
- options: [
- {
- value: 0,
- label: '全部'
- },
- {
- value: 1,
- label: '留治'
- },
- {
- value: '2',
- label: '转出'
- }
- ],
- value: '',
- modesData: {
- xAxis: [],
- series: []
- },
- chart: {
- // 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.obj.length > 0) {
- let str = ''
- str = '(' + this.obj[params.dataIndex] + '人' + ',' + params.data + '%' + ')'
- 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)"
- // }
- }
- }
- ]
- },
- patientsArr: [],
- tableData: [],
- normData: [],
- paitents: [],
- tableName: [],
- total: 0,
- obj: [],
- ObjectData: {},
- tablePatients: [],
- tableSort: [],
- dataName: [
- { id: 0, name: '达标' },
- { id: 1, name: '未达标' }
- ],
- dataCount: [
- { id: 0, count: 0 },
- { id: 1, count: 0 }
- ],
- patient_id: 0
- }
- },
- methods: {
- handleStartTimeChange(){
- this.getlist()
- }, handleEndTimeChange(){
- this.getlist()
- },
- handleSizeChange(limit) {
- this.tableData = []
- this.listQuery.limit = limit
-
- this.getlist()
-
- },
- handleCurrentChange(page) {
- this.tableData = []
- this.listQuery.page = page
- this.getlist()
- },
- 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.getlist()
-
- }
-
- },
- 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.getlist()
-
- }
- },
- getTimestamp(time) {
- // 把时间日期转成时间戳
- return new Date(time).getTime() / 1000
- },
- handleClick(patientid, inspectdate) {
- console.log("patient_id",patientid)
- console.log("inspectdate",inspectdate)
- // var id = 0
- // var dialysis_no = 0
- // for(let i=0;i<this.tablePatients.length;i++){
- // if(name == this.tablePatients[i].name){
- // id = this.tablePatients[i].patient_id
- // dialysis_no = this.tablePatients[i].dialysis_no
- // }
- // }
- this.$router.push({ path: '/qcd/patientComplianceDetails?patientid=' + patientid + '&date=' + inspectdate })
- },
- getDialysisNo(name) {
- for (let i = 0; i < this.tablePatients.length; i++) {
- if (name == this.tablePatients[i].name) {
- return this.tablePatients[i].dialysis_no
- }
- }
- },
- getNormData() {
- getNormData().then(response => {
- if (response.data.state == 1) {
- var normdata = response.data.data.normdata
- console.log('normdata', normdata)
- this.normData = normdata
- var a = []
- for (let i = 0; i < normdata.length; i++) {
- a.push(normdata[i])
- }
- // console.log("a",a)
- this.newArr = a
- var arr = this.arrayToObj(a)
- this.ObjectData = arr
-
- }
- })
- },
- onSearch() {
- const params = {
- lapstor: this.lapstor,
- patientid: this.patient_id,
- startime: this.listQuery.start_time,
- endtime: this.listQuery.end_time
- }
- console.log("param",params)
- this.isLoadingTwo = true
- getPatientContorlAnalysis(params).then(response => {
- if (response.data.state == 1) {
- this.isLoadingTwo = false
-
- var control = response.data.data.patientcontorDetail
- console.log("control",control)
- let dataInfo = {}
- control.forEach((item, index) => {
- let { inspect_date } = item
- if (!dataInfo[inspect_date]) {
- dataInfo[inspect_date] = {
- inspect_date,
- name: item.name,
- child: [],
- patient_id: item.patient_id,
- range_type: item.range_type,
- dialysis_no: item.dialysis_no
- }
- }
- })
- let list = Object.values(dataInfo)
- // console.log("list",list)
- list.map(item => {
- for (let i = 0; i < control.length; i++) {
- if (item.inspect_date == control[i].inspect_date && item.patient_id == control[i].patient_id) {
- item.child.push(control[i])
- }
- }
- })
- var newarrtwo = []
- list.map(item => {
- item.child.map(it => {
- newarrtwo.push(it)
- })
- })
-
- // 配置的才显示
- var arrthree = []
- for (let i = 0; i < newarrtwo.length; i++) {
- for (let j = 0; j < this.normData.length; j++) {
- if (newarrtwo[i].item_id == this.normData[j].inspection_minor) {
- arrthree.push(newarrtwo[i])
- }
- }
- }
- // console.log("arrthree",arrthree)
- var arrfour = this.arrayDate(arrthree, newarrtwo)
- arrfour.map(item => {
- item.item_name = ''
- arrthree.push(item)
- })
-
- var dd = {}
- for (const index in arrthree) {
- if (!(arrthree[index].inspect_date in dd)) {
- dd[arrthree[index].inspect_date] = {}
- }
- if (!(arrthree[index].item_name in dd[arrthree[index].inspect_date]) && arrthree[index].item_name != 0) {
- dd[arrthree[index].inspect_date][arrthree[index].item_name] = arrthree[index]
- }
- }
- this.tableData = []
-
- for (const key in dd) {
- for (const mkey in this.ObjectData) {
- if (!(this.ObjectData[mkey].item_name in dd[key])) {
- dd[key][this.ObjectData[mkey].item_name] = {
- item_name: this.ObjectData[mkey].item_name,
- name: mkey,
- inspect_value: 0,
- range_type: this.ObjectData[mkey].range_type
- }
- }
- }
- this.tableData.push({ name: key, data: dd[key] })
- }
- let dataInfotwo = {}
- control.forEach((item, index) => {
- let { inspect_date } = item
- if (!dataInfotwo[inspect_date]) {
- dataInfotwo[inspect_date] = {
- inspect_date,
- name: item.name,
- dialysis_no: item.dialysis_no,
- patient_id:item.patient_id,
- inspect_date:item.inspect_date,
- }
- }
- })
- let listtwo = Object.values(dataInfotwo)
- // console.log("listtwo",listtwo)
- listtwo.map(item => {
- this.tableData.map(it => {
- if (item.inspect_date == parseInt(it.name)) {
- it.name = item.name
- it.dialysis_no = item.dialysis_no
- it.patient_id = item.patient_id
- it.inspect_date = item.inspect_date
- }
- })
- })
- // let projectArr = []
- // this.newArr.map(item => {
- // projectArr.push(item.item_name)
- // })
-
- // this.tableData.map(item => {
- // let newarr = Object.values(item.data)
- // newarr.sort((a, b) => {
- // return projectArr.indexOf(a.item_name) - projectArr.indexOf(b.item_name)
- // })
- // item.data = newarr
- // })
-
- // for (let i = 0; i < this.patientsArr.length; i++) {
- // for (let j = 0; j < this.tableData.length; j++) {
- // if (this.patientsArr[i].name == this.tableData[j].name) {
- // this.tableData[j].dialysis_no = this.patientsArr[i].dialysis_no
- // this.tableData[j].patient_id = this.patientsArr[i].id
- // }
- // }
- // }
-
- } else {
- this.isLoadingTwo = false
-
- }
- })
- },
- getlist() {
- this.isLoadingTwo = true
- getPatientsControl(this.lapstor, this.listQuery.start_time, this.listQuery.end_time, this.listQuery.page, this.listQuery.limit).then(response => {
- if (response.data.state == 1) {
- this.isLoadingTwo = false
- var patients = response.data.data.patients
-
- this.tablePatients = patients
-
- // let dataInfothree = {}
- // patients.forEach((item, index) => {
- // let { inspect_date } = item
- // if (!dataInfothree[inspect_date]) {
- // dataInfothree[inspect_date] = {
- // inspect_date,
- // name: item.name,
- // child: [],
- // patient_id: item.patient_id,
- // }
- // }
- // })
- // let patientlist = Object.values(dataInfothree)
- // console.log("patientlist",patientlist)
-
- var total = response.data.data.total
- this.total = total
- var control = response.data.data.control
-
- var infectiousControl = response.data.data.infectiousControl
-
- infectiousControl.map(item => {
- control.push(item)
- })
-
-
- // var newPatinteArr = []
- // patientlist.map(item=>{
- // for(let i=0;i<control.length;i++){
- // if(item.inspect_date == control[i].inspect_date && item.patient_id == control[i].patient_id){
- // item.child.push(control[i])
- // }
- // }
- // })
- // console.log("patientlist",patientlist)
-
- var newArr = []
- // 分页
- for (let i = 0; i < control.length; i++) {
- for (let j = 0; j < patients.length; j++) {
- if (control[i].patient_id == patients[j].patient_id) {
- newArr.push(control[i])
- }
- }
- }
- console.log(newArr)
-
- let dataInfo = {}
- newArr.forEach((item, index) => {
- let { patient_id } = item
- if (!dataInfo[patient_id]) {
- dataInfo[patient_id] = {
- name: item.name,
- child: [],
- patient_id: item.patient_id,
- range_type: item.range_type
- }
- }
- })
- let list = Object.values(dataInfo)
-
-
- list.map(item => {
- for (let i = 0; i < newArr.length; i++) {
- if (item.patient_id == newArr[i].patient_id) {
- item.child.push(newArr[i])
- }
- }
- })
-
-
-
- var newarrtwo = []
- list.map(item => {
- item.child.map(it => {
- newarrtwo.push(it)
- })
- })
-
- console.log("list")
- console.log(list)
- console.log(newarrtwo)
-
-
- // 配置的才显示
- var arrthree = []
- for (let i = 0; i < newarrtwo.length; i++) {
- for (let j = 0; j < this.normData.length; j++) {
- if (newarrtwo[i].item_id == this.normData[j].inspection_minor) {
- arrthree.push(newarrtwo[i])
- }
- }
- }
- console.log('arrthree', arrthree)
- var arrfour = this.arrayDate(arrthree, newarrtwo)
- arrfour.map(item => {
- item.item_name = ''
- arrthree.push(item)
- })
-
-
- console.log("arrthree",arrthree)
- var dd = {}
- for (const index in arrthree) {
- if (!(arrthree[index].patient_id in dd)) {
- dd[arrthree[index].patient_id] = {}
- }
- if (!(arrthree[index].item_name in dd[arrthree[index].patient_id]) && arrthree[index].item_name != 0) {
- dd[arrthree[index].patient_id][arrthree[index].item_name] = arrthree[index]
-
- }
- }
- console.log("dad00000000000000",dd)
-
- let dataInfotwo = {}
- newArr.forEach((item, index) => {
- let { patient_id } = item
- if (!dataInfotwo[patient_id]) {
- dataInfotwo[patient_id] = {
- patient_id,
- name: item.name,
- inspect_value: item.inspect_value,
- id: item.id,
- }
- }
- })
- let listtwo = Object.values(dataInfotwo)
-
- for (const key in dd) {
- for (const mkey in this.ObjectData) {
- if (!(this.ObjectData[mkey].item_name in dd[key])) {
- dd[key][this.ObjectData[mkey].item_name] = {
- item_name: this.ObjectData[mkey].item_name,
- name: mkey,
- inspect_value: 0,
- range_type: this.ObjectData[mkey].range_type
- }
- }
- }
- this.tableData.push({ name: key, data: dd[key] })
- }
-
- listtwo.map(item => {
- this.tableData.map(it => {
- if (item.patient_id == parseInt(it.name)) {
- it.name = item.name
- it.id = item.id
- it.inspect_date = item.inspect_date
- }
- })
- })
-
- for (let i = 0; i < this.patientsArr.length; i++) {
- for (let j = 0; j < this.tableData.length; j++) {
- if (this.patientsArr[i].name == this.tableData[j].name) {
- this.tableData[j].dialysis_no = this.patientsArr[i].dialysis_no
- this.tableData[j].patient_id = this.patientsArr[i].id
- }
- }
- }
- }else{
- this.isLoadingTwo = false
- }
- })
- },
- arrayToObj(arr) {
- return Object.assign({}, arr)
- },
-
- arrayDate(array1, array2) {
- var array1 = array1
- var array2 = array2
- var result = []
- for (var i = 0; i < array2.length; i++) {
- var obj = array2[i]
- var num = obj.item_id //staff_id 就是要对比的key
- var isExist = false
- for (var j = 0; j < array1.length; j++) {
- var aj = array1[j]
- var n = aj.item_id
- if (n == num) {
- isExist = true
- break
- }
- }
- if (!isExist) {
- result.push(obj)
- }
- }
- return result
- },
- //统计柱状图
- getCartogramlist() {
- this.isLoading = true
- getCartogramlist(this.lapstor, this.listQuery.start_time, this.listQuery.end_time, this.limit, this.page).then(response => {
- if (response.data.state == 1) {
- this.isLoading = false
-
- var total = response.data.data.total
-
- var standtotal = response.data.data.standtotal
-
- var standtotalone = response.data.data.standtotalOne
-
- for (let i = 0; i < this.dataCount.length; i++) {
- this.dataCount[0].count = standtotal + standtotalone
- this.dataCount[1].count = total - standtotal - standtotalone
- this.obj.push(this.dataCount[i].count)
- }
- // console.log("dataCount",this.dataCount)
- for (let i = 0; i < this.dataName.length; i++) {
- this.modesData.xAxis.push(this.dataName[i].name)
- }
- for (let i = 0; i < this.dataCount.length; i++) {
- this.modesData.series.push(((this.dataCount[i].count / total) * 100).toFixed(1))
- }
- this.chart.series[0].data = this.modesData.series
- this.chart.xAxis.data = this.modesData.xAxis
-
- } else {
- this.isLoading = false
- }
- })
- },
- getCurrentOrgPatients() {
- getCurrentOrgPatients().then(response => {
- if (response.data.state == 1) {
- this.patientsArr = response.data.data.patients
- // console.log("病人",this.patientsArr)
- //获取列表数据
- this.getlist()
- }
- })
- },
- 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([])
- }
- })
- },
- handleSelect(val) {
- this.listQuery.search = val.name
- this.patient_id = val.id
- this.onSearch()
- },
- toExportList(){
- import("@/vendor/Export2Excel").then((excel) => {
-
- var arr =["序号","姓名","透析号"]
- if(this.normData!=null && this.normData.length>0){
- for(let i=0;i<this.normData.length;i++){
- arr.push(this.normData[i].item_name)
- }
- }
-
- if(this.tableData!=null && this.normData!=null && this.tableData.length>0&&this.normData.length>0){
-
- var newArr =[]
-
- for(let i=0;i<this.tableData.length;i++){
- var obj = {index:0,name:"",patient_id:0,dialysis_no:"",item_name:""}
- for(let j=0;j<this.normData.length;j++){
- obj.index = i+1
- obj.patient_id = this.tableData[i].patient_id
- obj.name = this.tableData[i].name
- obj.dialysis_no = this.tableData[i].dialysis_no
- obj[this.normData[j].item_name] = this.tableData[i].data[this.normData[j].item_name].inspect_value
- }
- newArr.push(obj)
- }
- }
- console.log("患者质控达标统计",newArr)
- const tHeader = arr
- var newList = ["index","name","dialysis_no"]
- if(this.normData!=null && this.normData.length>0){
- for(let i=0;i<this.normData.length;i++){
- newList.push(this.normData[i].item_name)
- }
- }
- var filterVal = []
- filterVal = newList
-
- const data = this.formatJson(filterVal, newArr);
- excel.export_json_to_excel({
- header: tHeader,
- data,
- filename: "患者质控达标统计",
- });
- this.downloadLoading = false;
- });
- },
- formatJson(filterVal, jsonData) {
- return jsonData.map((v) => filterVal.map((j) => v[j]));
- },
- },
- created() {
- var nowDate = new Date()
- var nowYear = nowDate.getFullYear()
- var nowMonth = nowDate.getMonth() + 1
- var nowDay = nowDate.getDate()
- this.listQuery.end_time =
- nowYear +
- '-' +
- (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
- '-' +
- (nowDay < 10 ? '0' + nowDay : nowDay)
- nowDate.setMonth(nowDate.getMonth() - 3)
- nowYear = nowDate.getFullYear()
- nowMonth = nowDate.getMonth() + 1
- nowDay = nowDate.getDate()
- this.listQuery.start_time =
- nowYear +
- '-' +
- (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
- '-' +
- (nowDay < 10 ? '0' + nowDay : nowDay)
-
- this.getCurrentOrgPatients()
- //获取系统指标
- this.getNormData()
- //获取统计图数据
- this.getCartogramlist()
-
- }
- }
- </script>
-
- <style lang="scss" scoped>
- .page_patientControlAnalysis {
-
- .pointTitle {
- font-size: 13px;
- }
-
- .chartTitle {
- font-size: 16px;
- font-weight: bold;
- color: #000000;
- }
-
- .point {
- width: 13px;
- height: 13px;
- background: linear-gradient(
- 0deg,
- rgba(169, 224, 243, 1),
- rgba(159, 189, 252, 1)
- );
- border-radius: 7px;
- margin-right: 8px;
- }
-
- .pointTitle {
- font-size: 13px;
- }
-
- }
-
- </style>
-
- <style lang="scss">
- .page_patientControlAnalysis {
-
- .el-form-item {
- margin-bottom: 0;
- }
-
- .cell {
- text-align: center;
- }
-
- ::-webkit-scrollbar {
- height: 15px !important;
- }
-
- }
- </style>
|