<template>
  <div class="pageContent">
    <el-table
      :data="tableData"
      :header-cell-style="{background:'#edf4fb'}"
      style="width: 100%">
      <el-table-column prop="type" label="类型">
          <template slot-scope="scope">
            <div :class="scope.row.type===1?'textBlue':'textOrange'">
              {{ scope.row.type | filterType }}
            </div>
          </template>
      </el-table-column>
      <el-table-column prop="beginTime" label="开始时间" min-width="100"/>
      <el-table-column prop="status" label="执行状态" />
      <el-table-column prop="adviceType" label="医嘱类型"/>
      <el-table-column prop="adviceContent" label="医嘱内容" min-width="150" show-overflow-tooltip/>
      <el-table-column prop="spec" label="规格" min-width="100" show-overflow-tooltip/>
      <el-table-column prop="dose" label="剂量"/>
      <el-table-column prop="unit" label="单位"/>
      <el-table-column prop="usage" label="用法"/>
      <el-table-column prop="frequency" label="频次"/>
      <el-table-column prop="total" label="总量"/>
      <el-table-column prop="beginDoctor" label="开嘱医生"/>
      <el-table-column prop="endDoctor" label="停嘱医生"/>
      <el-table-column prop="deptName" label="执行科室"/>
    </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: "inpatientAdvice",
  data(){
    return{
      tableData:[
        {
          type:1,
          beginTime:'2022-07-12 12:00:24',
          status:'已执行',
          adviceType:'西药',
          adviceContent:'谷维素片',
          spec:'10mg*10mg',
          dose:10,
          unit:'mg',
          usage:'肌注',
          frequency:'Bid',
          total:'',
          beginDoctor:'刘献',
          endDoctor:'',
          deptName:''
        },
        {
          type:1,
          beginTime:'2022-06-12 12:00:24',
          status:'未执行',
          adviceType:'西药',
          adviceContent:'复合维生素B片',
          spec:'CO*100粒',
          dose:100,
          unit:'粒',
          usage:'口服',
          frequency:'Qd',
          total:'',
          beginDoctor:'刘献',
          endDoctor:'',
          deptName:''
        },
        {
          type:1,
          beginTime:'2022-05-12 12:00:24',
          status:'',
          adviceType:'西药',
          adviceContent:'维生素E软胶囊',
          spec:'100mg*3.0mg',
          dose:10,
          unit:'mg',
          usage:'口服',
          frequency:'Qd',
          total:'',
          beginDoctor:'刘献',
          endDoctor:'',
          deptName:''
        },
        {
          type:2,
          beginTime:'2022-04-20 09:00:24',
          status:'',
          adviceType:'医技',
          adviceContent:'隐血试验',
          spec:'',
          dose:1,
          unit:'项',
          usage:'',
          frequency:'',
          total:'1',
          beginDoctor:'刘献',
          endDoctor:'',
          deptName:'检验科'
        },
        {
          type:2,
          beginTime:'2022-04-20 10:00:24',
          status:'',
          adviceType:'医技',
          adviceContent:'尿常规',
          spec:'',
          dose:1,
          unit:'项',
          usage:'',
          frequency:'',
          total:'1',
          beginDoctor:'刘献',
          endDoctor:'',
          deptName:'检验科'
        },
        {
          type:1,
          beginTime:'2022-02-22 15:00:59',
          status:'',
          adviceType:'护理',
          adviceContent:'Ⅰ级护理',
          spec:'',
          dose:1,
          unit:'日',
          usage:'',
          frequency:'',
          total:'1',
          beginDoctor:'刘献',
          endDoctor:'',
          deptName:''
        },
        {
          type:1,
          beginTime:'2022-02-22 15:00:59',
          status:'',
          adviceType:'说明',
          adviceContent:'监测空腹及三餐后',
          spec:'',
          dose:1,
          unit:'次',
          usage:'',
          frequency:'Bid',
          total:'',
          beginDoctor:'刘献',
          endDoctor:'',
          deptName:''
        }
      ],
      total:20,
      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;
  }
}
.textBlue{
  color: #0A69F3;
}
.textOrange{
  color: orange;
}
</style>
