|
@@ -1,10 +1,17 @@
|
|
|
<template>
|
|
|
<el-container>
|
|
|
<el-aside style="width: 190px;">
|
|
|
- <el-checkbox style="margin-left: 10px" v-model="woDeBingRen">我的病人</el-checkbox>
|
|
|
+ <el-select v-model="currentWard" @change="huoQuHuanZheLieBiaoClick" style="width: 120px" filterable>
|
|
|
+ <el-option v-for="item in userWards" :key="item.code" :value="item.code" :label="item.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select v-model="inpatientNo" style="width: 120px;" filterable :filter-method="filterMethod" clearable>
|
|
|
+ <el-option v-for="item in cptHuanZheLieBiaoData" :key="item.inpatientNo" :value="item.inpatientNo"
|
|
|
+ :label="item.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-checkbox style="margin-left: 10px" v-model="woDeBingRen" @change="woDeBingRenClick">我的病人</el-checkbox>
|
|
|
<el-table
|
|
|
:data="cptHuanZheLieBiaoData.slice((huanZheLieBiaoCurrentPage - 1) * 20,huanZheLieBiaoCurrentPage * 20 )"
|
|
|
- :height="tableHeight / 1.15" stripe highlight-current-row @row-click="huanZheXinXi">
|
|
|
+ :height="tableHeight / 1.15" @row-click="huanZheXinXi" :row-style="tableBackColor">
|
|
|
<el-table-column label="床位" prop="bedNo" width="40"></el-table-column>
|
|
|
<el-table-column label="姓名" prop="name">
|
|
|
<template #default="scope">
|
|
@@ -19,7 +26,6 @@
|
|
|
<el-table-column label="小科室" prop="zkWardName"></el-table-column>
|
|
|
</el-table>
|
|
|
<el-pagination
|
|
|
- :page-sizes="[10, 20, 30, 40]"
|
|
|
:page-size="20"
|
|
|
small
|
|
|
layout="prev,pager,next,total"
|
|
@@ -33,29 +39,46 @@
|
|
|
|
|
|
<script>
|
|
|
|
|
|
-import {computed, ref} from "vue";
|
|
|
+import {computed, onMounted, ref, watch} from "vue";
|
|
|
import store from "../../store";
|
|
|
-import {huoQuHuanZheLieBiao, huoQuHuanZheXinXi} from "../../api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
|
|
|
+import {
|
|
|
+ gongYongHuanZheXinXi,
|
|
|
+ huanZhePinLvData,
|
|
|
+ huoQuHuanZheLieBiao,
|
|
|
+ huoQuHuanZheXinXi, huoQuGeRenPinLv, xuanZheHuanZhe
|
|
|
+} from "../../api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
|
|
|
import maleIcon from '../../assets/male-icon.png'
|
|
|
import femaleIcon from '../../assets/female-icon.png'
|
|
|
+import {getUserWards} from "../../api/case-front-sheet";
|
|
|
+import {listNotBlank, stringIsBlank} from "../../utils/blank-utils";
|
|
|
+import {clone} from "../../utils/clone";
|
|
|
|
|
|
export default {
|
|
|
name: "HuanZheLieBiao",
|
|
|
+ props: ['inpatientNo'],
|
|
|
setup(props, cxt) {
|
|
|
const tableHeight = computed(() => {
|
|
|
return store.state.app.windowSize.h
|
|
|
})
|
|
|
+ // 选择的病房
|
|
|
+ const currentWard = ref('')
|
|
|
+ // 用户可以选择的 病房信息
|
|
|
+ const userWards = ref([])
|
|
|
+ // 住院号
|
|
|
+ const inpatientNo = ref('')
|
|
|
+
|
|
|
+ const cptHuanZheLieBiaoData = ref([])
|
|
|
const huanZheLieBiaoData = ref([])
|
|
|
const huanZheLieBiaoCurrentPage = ref(1)
|
|
|
const woDeBingRen = ref(false)
|
|
|
|
|
|
- const userCode = store.state.user.info.code
|
|
|
-
|
|
|
- const huoQuHuanZheLieBiaoClick = (val) => {
|
|
|
- huoQuHuanZheLieBiao(val).then((res) => {
|
|
|
+ const huoQuHuanZheLieBiaoClick = () => {
|
|
|
+ huoQuHuanZheLieBiao(currentWard.value).then((res) => {
|
|
|
huanZheLieBiaoData.value = res
|
|
|
+ cptHuanZheLieBiaoData.value = clone(res)
|
|
|
}).catch((e) => {
|
|
|
huanZheLieBiaoData.value = []
|
|
|
+ cptHuanZheLieBiaoData.value = []
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -64,21 +87,61 @@ export default {
|
|
|
}
|
|
|
|
|
|
const huanZheXinXi = (val) => {
|
|
|
- huoQuHuanZheXinXi(val.inpatientNo).then((res) => {
|
|
|
- cxt.emit('clickHuanZheXinXi', {res})
|
|
|
+ inpatientNo.value = val.inpatientNo
|
|
|
+ }
|
|
|
+
|
|
|
+ watch(() => inpatientNo.value, () => {
|
|
|
+ woDeBingRen.value = false
|
|
|
+ if (stringIsBlank(inpatientNo.value)) {
|
|
|
+ cptHuanZheLieBiaoData.value = huanZheLieBiaoData.value
|
|
|
+ } else {
|
|
|
+ huoQuHuanZheXinXi(inpatientNo.value).then((res) => {
|
|
|
+ gongYongHuanZheXinXi.value = res
|
|
|
+ cxt.emit('clickHuanZheXinXi', {res})
|
|
|
+ xuanZheHuanZhe.value = true
|
|
|
+ // 加载患者的频率
|
|
|
+ huoQuGeRenPinLv(res.inpatientNo, res.admissTimes).then((res) => {
|
|
|
+ huanZhePinLvData.value = res
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ const woDeBingRenClick = () => {
|
|
|
+ woDeBingRen.value ? filterMethod(store.state.user.info.code) : cptHuanZheLieBiaoData.value = huanZheLieBiaoData.value
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ const filterMethod = (val) => {
|
|
|
+ cptHuanZheLieBiaoData.value = huanZheLieBiaoData.value.filter(item => {
|
|
|
+ return item.inpatientNo.indexOf(val) > -1 || item.name.indexOf(val) > -1
|
|
|
+ || item.consultPhysician.indexOf(val) > -1 || item.referPhysician.indexOf(val) > -1
|
|
|
})
|
|
|
+ }
|
|
|
|
|
|
+ const tableBackColor = ({row, column, rowIndex, columnIndex}) => {
|
|
|
+ if (row.inpatientNo === inpatientNo.value) {
|
|
|
+ return {
|
|
|
+ backgroundColor: '#a7d3ff!important'
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- const cptHuanZheLieBiaoData = computed(() => {
|
|
|
- return huanZheLieBiaoData.value.filter(item => {
|
|
|
- return item.consultPhysician.indexOf(woDeBingRen.value ? userCode : '') > -1 || item.referPhysician.indexOf(woDeBingRen.value ? userCode : '') > -1
|
|
|
+ onMounted(() => {
|
|
|
+ getUserWards().then((res) => {
|
|
|
+ userWards.value = res
|
|
|
+ if (listNotBlank(userWards.value)) {
|
|
|
+ currentWard.value = userWards.value[0].code
|
|
|
+ huoQuHuanZheLieBiaoClick()
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
|
|
|
|
|
|
return {
|
|
|
tableHeight,
|
|
|
+ currentWard,
|
|
|
+ userWards,
|
|
|
huanZheLieBiaoData,
|
|
|
huoQuHuanZheLieBiaoClick,
|
|
|
huanZheLieBiaoCurrentPage,
|
|
@@ -87,7 +150,11 @@ export default {
|
|
|
femaleIcon,
|
|
|
woDeBingRen,
|
|
|
cptHuanZheLieBiaoData,
|
|
|
- huanZheXinXi
|
|
|
+ huanZheXinXi,
|
|
|
+ inpatientNo,
|
|
|
+ filterMethod,
|
|
|
+ tableBackColor,
|
|
|
+ woDeBingRenClick
|
|
|
}
|
|
|
}
|
|
|
}
|