<template>
  <div class="pageContent">
    <el-table
      :data="tableData"
      :header-cell-style="{background:'#edf4fb'}"
      style="width: 100%">
      <el-table-column prop="adviceName" label="医嘱名称" min-width="120" show-overflow-tooltip/>
      <el-table-column prop="type" label="医嘱类型">
        <template slot-scope="scope">
          {{ scope.row.type | filterType }}
        </template>
      </el-table-column>
      <el-table-column prop="spec" label="规格" min-width="100" show-overflow-tooltip/>
      <el-table-column prop="dose" label="剂量" width="50"/>
      <el-table-column prop="unit" label="单位"/>
      <el-table-column prop="usage" label="用法"/>
      <el-table-column prop="frequency" label="频次"/>
      <el-table-column prop="indicate" label="指示"/>
      <el-table-column prop="days" label="天数" width="50"/>
      <el-table-column prop="highest" label="最高" width="50"/>
      <el-table-column prop="beginTime" label="开始时间" min-width="150"/>
      <el-table-column prop="beginDoctor" label="开处方医生" width="100"/>
    </el-table>
    <pagination
      class="card-page"
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.page"
      :limit.sync="queryParams.pageSize"
    />
  </div>
</template>

<script>
export default {
  name: "medRecord",
  data() {
    return {
      tableData: [
        {
          adviceName:'注射用羟喜树碱',
          type:1,
          spec:'8毫克/瓶',
          dose:'8',
          unit:'毫克',
          usage:'动脉注射',
          frequency:'量子',
          indicate:'托',
          days:20,
          highest:20,
          beginTime:'2022-07-12 12:00:24',
          beginDoctor:'刘献'
        },
        {
          adviceName:'门冬酰胺酶',
          type:1,
          spec:'1万一1.5万..',
          dose:'1个',
          unit:'毫升',
          usage:'肌注',
          frequency:'点',
          indicate:'',
          days:20,
          highest:20,
          beginTime:'2022-05-20 09:00:24',
          beginDoctor:'刘献'
        },
        {
          adviceName:'再生人干扰素a2b注...',
          type:1,
          spec:'100万IU:1... ',
          dose:'1个',
          unit:'毫升',
          usage:'皮注',
          frequency:'量子',
          indicate:'',
          days:'',
          highest:'',
          beginTime:'2022-02-20 09:00:24',
          beginDoctor:'刘献'
        }
      ],
      total:3,
      queryParams: {
        page: 1,
        pageSize: 20
      }
    }
  },
  filters: {
    filterType(flag) {
      let _flag;
      switch (flag) {
        case 1:
          _flag = '长期医嘱';
          break;
        case 2:
          _flag = '临时医嘱';
          break;
      }
      return _flag;
    },
  },
}
</script>

<style scoped lang="scss">
.pageContent {
  height: 100%;
  position: relative;
  padding-bottom: 70px;

  .card-page {
    position: absolute;
    bottom: 0;
    right: 0;
  }
}
</style>
