|
|
@@ -0,0 +1,166 @@
|
|
|
+<template>
|
|
|
+ <el-select v-model="currentWard"
|
|
|
+ :clearable="wardsClearable"
|
|
|
+ style="width: 110px"
|
|
|
+ @change="fetchOverviews">
|
|
|
+ <el-option v-for="item in allWards"
|
|
|
+ :key="item.code"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.code"/>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ <el-input v-model="queryPatNo" clearable style="width: 90px" placeholder="住院号"
|
|
|
+ @keyup.enter="queryPatientInfoClick"></el-input>
|
|
|
+ <el-button icon="Search" type="primary" @click="queryPatientInfoClick">查询</el-button>
|
|
|
+ <el-checkbox v-model="inOutStatus" @change="selectCheckbox">是否出院</el-checkbox>
|
|
|
+ <br>
|
|
|
+ <el-table :data="cptOverviews"
|
|
|
+ height="750"
|
|
|
+ @row-click="handleClickOverview"
|
|
|
+ ref="elTableRef"
|
|
|
+ highlight-current-row
|
|
|
+ class="remove_hover"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
+ <el-table-column fixed v-if="props.selectFlag" type="selection" width="35"></el-table-column>
|
|
|
+ <el-table-column label="床" prop="bedNo" width="30"/>
|
|
|
+ <el-table-column label="姓名" width="70" prop="name">
|
|
|
+ <template #default="{row}">
|
|
|
+ <span>
|
|
|
+ {{ row.name }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="住院号" prop="inpatientNo" width="65"/>
|
|
|
+ <el-table-column label="次数" prop="admissTimes" width="65"/>
|
|
|
+ <el-table-column label="性别" prop="sex" width="65">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ cptSex(scope.row.sex) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup name='PatientBaseList'>
|
|
|
+import {computed, onMounted, ref} from "vue";
|
|
|
+import {allWardsVisible} from "@/utils/permission";
|
|
|
+import {cptSex} from "@/utils/computed";
|
|
|
+import {queryYz,getPatientBaseInfo,queryBabyPatientInfo} from "@/api/medical-advice/medical-advice-management";
|
|
|
+import {getAllWards} from "@/api/zhu-yuan-yi-sheng/resident-doctor";
|
|
|
+import {stringNotBlank} from "@/utils/blank-utils";
|
|
|
+import {ElMessage} from "element-plus";
|
|
|
+const selections = ref([])
|
|
|
+const queryPatNo = ref('')
|
|
|
+const wardsClearable = allWardsVisible()
|
|
|
+const allWards = ref([])
|
|
|
+const currentWard = ref()
|
|
|
+const overviews = ref([])
|
|
|
+const emit = defineEmits(['selectPatientInfo','allPatientList']);
|
|
|
+const props = defineProps({
|
|
|
+ yzType: {
|
|
|
+ type: String
|
|
|
+ },
|
|
|
+ selectFlag : {
|
|
|
+ type: Boolean
|
|
|
+ }
|
|
|
+})
|
|
|
+const fetchOverviews = () => {
|
|
|
+ // getOverView(currentWard.value).then((res) => {
|
|
|
+ // overviews.value = res
|
|
|
+ // })
|
|
|
+ queryPatientInfoClick()
|
|
|
+}
|
|
|
+//入院出院状态
|
|
|
+const inOutStatus = ref(false)
|
|
|
+const selectCheckbox = () => {
|
|
|
+ queryPatientInfoClick()
|
|
|
+}
|
|
|
+
|
|
|
+const queryPatientInfoClick=()=>{
|
|
|
+ overviews.value =[]
|
|
|
+ let inOutStatusFlag =inOutStatus.value ? "1" :"0"
|
|
|
+ if(inOutStatus.value && !stringNotBlank(queryPatNo.value)){
|
|
|
+ return ElMessage.error('住院号不能为空')
|
|
|
+ }
|
|
|
+
|
|
|
+ // 直接查询婴儿患者信息
|
|
|
+ queryBabyPatientInfo(queryPatNo.value,currentWard.value,inOutStatusFlag).then((res) => {
|
|
|
+ overviews.value = res
|
|
|
+ })
|
|
|
+}
|
|
|
+const cptOverviews = computed(() => {
|
|
|
+ if(props.selectFlag){
|
|
|
+ emit('allPatientList',{allPatientList:overviews.value,currentWard:currentWard.value})
|
|
|
+ }
|
|
|
+ return overviews.value
|
|
|
+})
|
|
|
+
|
|
|
+const elTableRef = ref(null)
|
|
|
+//行点击事件
|
|
|
+const handleClickOverview = (row) => {
|
|
|
+ let inOutStatusFlag =inOutStatus.value ? "1" :"0"
|
|
|
+ if(props.yzType=='cxyz'){
|
|
|
+ let queryData ={
|
|
|
+ patNo:row.inpatientNo,
|
|
|
+ times:row.admissTimes,
|
|
|
+ queryRange:'0',
|
|
|
+ inOutStatusFlag:inOutStatusFlag,
|
|
|
+ statusFlag:'3'
|
|
|
+ }
|
|
|
+
|
|
|
+ queryYz(queryData).then((res) => {
|
|
|
+ let val = {patientInfo:res.patientInfo,
|
|
|
+ yzDataList:res.yzDataList,
|
|
|
+ queryRange:queryData.queryRange,
|
|
|
+ statusFlag:queryData.statusFlag,
|
|
|
+ inOutStatusFlag:inOutStatusFlag,
|
|
|
+ }
|
|
|
+ emit('selectPatientInfo',val)
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ let inOutStatusFlag =inOutStatus.value ? "1" :"0"
|
|
|
+ let params = {inpatientNo:row.inpatientNo,
|
|
|
+ admissTimes:row.admissTimes,inOutStatusFlag:inOutStatusFlag}
|
|
|
+ getPatientBaseInfo(params).then((res) => {
|
|
|
+ let val = {
|
|
|
+ patientInfo:res,
|
|
|
+ inOutStatusFlag:inOutStatusFlag,
|
|
|
+ wardCode:currentWard.value
|
|
|
+ }
|
|
|
+ emit('selectPatientInfo',val)
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+const handleSelectionChange = (val) => {
|
|
|
+ if(props.selectFlag){
|
|
|
+ selections.value = val
|
|
|
+ emit('selectPatientInfo',val)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getAllWards().then((res) => {
|
|
|
+ if (res.length > 0) {
|
|
|
+ allWards.value = res
|
|
|
+ currentWard.value = res[0].code
|
|
|
+ // fetchOverviews()
|
|
|
+ queryPatientInfoClick()
|
|
|
+ }
|
|
|
+ })
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+
|
|
|
+.el_table__current {
|
|
|
+ background-color: #a7d3ff;
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|