<template>
  <el-container>
    <el-header>
      住院号：
      <el-input style="width: 120px" v-model="patNo"/>
      <el-button @click="queryClick">查询</el-button>
    </el-header>

    <el-main>
      <xc-table :local-data="data" :height="20">
        <el-table-column label="住院号" prop="patNo" width="80"/>
        <el-table-column label="姓名" prop="name" width="60"/>
        <el-table-column label="床号" prop="bedNo" width="60"/>
        <el-table-column label="消息" prop="message"/>
      </xc-table>
    </el-main>

  </el-container>
</template>

<script setup name='CriticalValue'>
import {huanZheXinXi} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
import {getCriticalValuePatientList} from "@/api/zhu-yuan-yi-sheng/critical-value";
import XcTable from "@/components/xiao-chan/xc-table/XcTable.vue";

const patNo = ref('')
const data = ref([])

const queryClick = () => {
  if (!patNo.value) {
    patNo.value = ''
  }
  getCriticalValuePatientList(patNo.value).then((res) => {
    data.value = res
  })
}

watch(() => huanZheXinXi.value.inpatientNo, () => {
  patNo.value = huanZheXinXi.value.inpatientNo
  queryClick()
}, {immediate: true})


</script>

<style scoped lang="scss">

</style>
