.<template>
  <div>
    <van-row class="top_row" style="display:none">
      <div class="newSearch1">
        <el-input
          prefix-icon="el-icon-search"
          v-model="search_input"
          ref="search_field"
          placeholder="透析号/姓名"
        ></el-input>
        <p class="searchBtn" @click="searchWithKeyword(1)">搜索</p>
      </div>
    </van-row>

    <div class="area">
      <DialysisAdviceTable v-show="index == 0"></DialysisAdviceTable>
      <NormalAdviceTable v-show="index == 1"></NormalAdviceTable>
    </div>
  </div>
</template>

<script>
import DialysisAdviceTable from "./DialysisAdviceTable";
import NormalAdviceTable from "./NormalAdviceTable";
export default {
  name: "RecordPage",
  data() {
    return {
      index: 0,
      search_input: "",
      search_keyword: ""
    };
  },
  components: {
    NormalAdviceTable,
    DialysisAdviceTable
  },
  methods: {
    ClickTab: function(tabIndex) {
      this.index = tabIndex;
    },
    searchWithKeyword: function() {
      this.$refs.search_field.blur();
      this.search_keyword = this.search_input;
    },
    clearKeyword: function() {
      this.search_input = "";
      this.search_keyword = "";
    }
  }
};
</script>

<style style="stylesheet/scss" lang="scss" scoped>
.top_row {
  font-size: 0.3rem;
  padding: 0.3rem 0.3rem;
  // border-bottom: 1px #e5e5e5 solid;
  display: flex;
  align-items: center;
  background: #258ffc;
}
.title {
  font-size: 0.34rem;
  font-weight: 600;
  color: $title-color;
}
.department {
  text-align: center;
  ul {
    li {
      float: left;
      font-size: 0.36rem;
      margin: 0 0.2rem;
      height: 0.64rem;
      line-height: 0.64rem;
      padding: 0 0.3rem;
      color: $title-color;

      &.active {
        background: $main-color;
        color: #fff;
        border-radius: 30px;
      }
    }
  }
}
.search {
  color: #a8b3ba;
  width: 4.2rem;
  float: right;

  .iconfont {
    color: #a8b3ba;
    font-size: 0.36rem;
  }
  .field {
    background-color: #ebf1f7;
    height: 0.6rem;
    line-height: 0.6rem;
    padding: 0 0 0 10px;
    border-radius: 30px;
  }
}
.add_schedule_btn {
  margin-left: 10px;
  float: right;
  background-color: #ff7978;
  border: none;
  @media only screen and (max-width: 812px) {
    min-width: 60px !important;
  }
}
</style>

<style lang="scss">
.newSearch1 {
  height: 1rem;
  width: 100%;
  background: #fff;
  border-radius: 30px;
  .searchBtn {
    width: 14%;
    float: right;
    height: 1rem;
    line-height: 1rem;
    text-align: center;
    font-size: 0.45rem;
    color: #258ffc;
    vertical-align: middle;
  }
  .el-input {
    height: 100%;
    width: 85% !important;
    float: left;
  }
  .el-input__inner {
    height: 100%;
    line-height: 1rem;
    width: 100%;
    border-radius: 30px;
    border: none;
    font-size: 0.45rem;
    vertical-align: middle;
    @media only screen and (min-width: 768px) {
      padding-left: 0.9rem;
    }
  }
  .el-input__icon {
    line-height: 1rem;
    font-size: 0.45rem;
    margin-top: 0.02rem;
    padding-left: 0.1rem;
  }
  .el-input__prefix {
    @media only screen and (min-width: 768px) {
      left: 10px;
    }
  }
}
</style>
