<template>
  <div class="newCase">
    <van-tabs v-model="index">
      <van-tab title="基本信息">
        <records-tab></records-tab>
      </van-tab>
      <van-tab title="医嘱">
        <advice-table></advice-table>
      </van-tab>
      <van-tab title="干体重">
      <dry-weight></dry-weight>
      </van-tab>
      <van-tab title="血管通路">
       <pass-assessment></pass-assessment>
      </van-tab>
      <van-tab title="病程记录">
        <course-management></course-management>
      </van-tab>
      <van-tab title="抢救记录">
        <rescue-record></rescue-record>
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
import { GetInspection } from '@/api/check'
import RecordsTab from './RecordsTab'
import AdviceTable from '../dialysis/AdviceTable'
import CheckTab from '../dialysis/CheckTab'
import DryWeight from '../dialysis/DryWeight'
import CourseManagement from '../dialysis/CourseManagement'
import RescueRecord from '../dialysis/RescueRecord'
import PassAssessment from "../dialysis/PassAssesment"
export default {
  name: 'CaseHistory',
  created () {
    this.patient = this.$route.query.patient_id
    // this.GetList()
  },
  data () {
    return {
      index: 0,
      inspectionDate: [],
      patient: 0
    }
  },
  mounted () {
    if (this.$route.query.active2) {
      this.index = parseInt(this.$route.query.active2)
    }
  },

  components: {
    CheckTab,
    AdviceTable,
    RecordsTab,
    DryWeight,
    CourseManagement,
    RescueRecord,
    PassAssessment
  },
  methods: {
    ClickTab: function (tabIndex, row) {
      this.index = tabIndex
      if (this.index == 1) {
        this.$refs.item.GetList(row.project_id, row)
      }
    },
    GetList: function () {
      let params = {
        patient: this.patient
      }
      GetInspection(params).then(response => {
        this.inspectionDate = []
        if (response.data.state == 1) {
          this.inspectionDate = response.data.data.reference
          this.$refs.item.GetList(1, this.inspectionDate[0])
        }
      })
    }
  }
}
</script>

<style style="stylesheet/scss" lang="scss" scoped>
.fixedBox {
  padding-top: 38px;
  // background: #fff;
  min-height: calc(100vh - 64px);
  @media only screen and (min-width: 415px) and (max-width: 767px) {
    padding-top: 58px;
  }
  @media only screen and (min-width: 768px) {
    padding-top: 82px;
  }
}
.nav {
  border-bottom: 1px #e5e5e5 solid;
  position: fixed;
  top: 63px;
  right: 0;
  z-index: 66;
  left: 0;
  background: #fff;
  background: #fff;
  @media only screen and (max-width: 767px) {
    top: 38px !important;
  }
  // @media only screen and (min-width: 376px) and (max-width: 668px) {
  //   top: 50px !important;
  // }
  @media only screen and (min-width: 415px) and (max-width: 767px) {
    top: 52px !important;
  }
  @media only screen and (min-width: 813px) and (max-width: 1024px) {
    top: 67px;
  }
  // @media only screen and (min-width: 737px) and (max-width: 768px) {
  //   padding-top: 20px;
  // }
  ul {
    width: 90%;
    margin: 0 auto;
    @include box-sizing;
    @include display-flex;
    @include align-items-center;
    @include text-align;
    @include justify-content-between;
    li {
      font-size: 0.45rem;
      // float: left;
      color: $pgh-color;
      padding: 0.3rem 0;
      cursor: pointer;
    }
    .active {
      position: relative;
      &::before {
        width: 100%;
        height: 2px;
        color: $main-color;
        position: absolute;
        bottom: 0;
        left: 0;
        content: "";
        background: $main-color;
      }
    }
  }
}
</style>
<style lang="scss">
.newCase{
  height: 100%;
  overflow-y: auto;
  .van-tabs{
    display: flex;
    height: 100%;
  }
  .van-tabs__content{
    overflow-y: auto;
    flex: 1;
  }
  .van-tabs--line .van-tabs__wrap{
    height: 1.46rem;
    position: fixed;
    top: 1.3rem;
    right: 0;
    left: 0;
    z-index: 99;
  }
  .van-tabs__nav--line{
    padding-bottom: 0.5rem;
  }
  .van-tab{
    line-height: 1.46rem;
    font-size: 0.46rem;
    padding: 0 0.13rem;
  }
  .van-tabs__line{
    bottom: 0.5rem;
    height: 0.1rem;
  }
  .van-tabs__line{
    width: 47px;
    transform: translateX(47px) translateX(-50%);
    transition-duration: 0.3s;
  }
}
</style>
