<template>

  <div style="display: flex">



    <div style="flex: 2">
      <div style="alignment: center"><h1>就诊病历</h1></div>

        <div style="display: flex">
          <div style="width: 160px">
            <h3>姓名：张三</h3>
          </div>
          <div style="width: 160px">
            <h3>性别：男</h3>
          </div>
          <div style="width: 160px">
            <h3>年龄：24</h3>
          </div>
          <div style="width: 240px">
            <h3>主治医生：李华</h3>
          </div>
          <div style="width: 500px">
            <h3>就诊时间：2022-01-01</h3>
          </div>
        </div>
      <div style="alignment: left">
        <h2>病状描述</h2>
      </div>
      <div style="height: 100px">

      </div>

      <div style="alignment: left">
        <h2>诊断</h2>
      </div>
      <div style="height: 100px">

      </div>

      <div style="alignment: left">
        <h2>处方</h2>
      </div>
      <div>
        <el-table :data="prescription" style="width: 100%" >
          <el-table-column prop="drugName" label="药品名" />
          <el-table-column prop="size" label="规格" />
          <el-table-column prop="quantity" label="数量" />
          <el-table-column prop="useMethod" label="用法" />
          <el-table-column prop="consumption" label="用量" />




        </el-table>
      </div>
      <div style="height: 5px"></div>
      <div>
        <el-button style="alignment: right"
            size="mini"
            type="danger"
            @click="handleView()"
        >确定</el-button
        >
      </div>


    </div>




    <div style="width: 50px"></div>

  </div>

</template>

<script>
import DoctorAside from "@/components/DoctorAside";
import Header from "@/components/Header";
import request from "@/utils/request";

export default {
  name: "ViewMedicalRecord",
  components: {
    Header,
    DoctorAside
  },
  mounted() {
    //显示处方
    this.loadPrescription()
  },
  data(){
    return{
      prescription: [
        {
          drugName: '阿司匹林',
          size: '100mg * 30片',
          quantity: '×1',
          useMethod: '口服',
          consumption: '1片/次；每日一次'
        }
      ],
    }
  },
  methods: {
    handleView(){

    },
    loadPrescription(){
      // 将数据库数据呈现到前台
      request.get("",{

      }).then(res=>{
        console.log(res)
        this.prescription=res.data
      })
    },
  }
}
</script>

<style scoped>

</style>