<template>
  <div class="container">
    <div class="bgimg"></div>
    <div class="content">
      <div class="title">方案列表</div>
      <!-- <div class="loginForm"> -->
        <!-- <div @click="showDetail(item.id)" v-for="(item,index) in list" style="height: 100%;border-bottom: 1px solid #ccc;padding-bottom:1rem;">
          <div class="rowfont">姓名：{{item.name}}</div>
          <div class="rowfont">ID：{{item.code}}</div>
          <div class="rowfont">年龄：{{item.age}}</div>
          <div class="rowfont">体重：{{item.bltz}}</div>
          <div class="rowfont">产品：{{item.ckmpro}}</div>
          <div class="rowfont">频次：{{item.ckmfreq}}</div>
          <div class="rowfont">剂量(IU)：{{item.ckzsjl}}</div>
          <div class="rowfont">方案医生：{{item.doctor_name}}</div>
          <div class="rowfont">方案时间：{{item.ctime}}</div>
        </div> -->
        <div class="patCaseForm baseInfo" v-if="list.length>0" style="padding-bottom:1rem;">
            <mt-cell :title="'姓名:'+list[0].name" :value="'ID:'+list[0].code"></mt-cell>
            <mt-cell :title="'年龄:'+list[0].age" :value="'性别:'+list[0].sex"></mt-cell>
          </div>
          <!-- 方案 -->
          <div class="patCaseForm baseInfo" v-for="(item,index) in list">
            <!-- <mt-cell :title="'姓名:'+item.name" :value="'ID:'+item.code"></mt-cell>
            <mt-cell :title="'年龄:'+item.age" :value="'性别:'+item.sex"></mt-cell> -->
            <mt-cell :title="'产品:'+item.ckmpro" :value="'剂量(IU):'+item.ckzsjl"></mt-cell>
            <mt-cell :title="'频次:'+item.ckmfreq" :value="'体重(KG):'+item.bltz"></mt-cell>
            <mt-cell :title="'方案医生:'+item.doctor_name"></mt-cell>
            <div style="font-size:1.2rem;text-align:left;padding-left:10px;">
              方案时间:{{item.ctime}}
              <mt-button type="primary" size="small" @click="showDetail(item.id)">详情</mt-button>
            </div>
          </div>
      <!-- </div> -->
      <div class="footer">
        <div class="jbbtn" @click="goPage(-1)">返回</div>
      </div>
    </div>
  </div>
</template>

<script>
  import {
    Field,
    Picker,
    Search,
    Button
  } from 'mint-ui'

  export default {
    name: 'Index',
    components: {
      Field,
      Picker,
      Search,
      Button
    },
    data() {
      return {
        form: {},
        list: []
      }
    },
    methods: {
      goPage(path) {
        if(path==-1){
          this.$router.go(-1)
        }else{
          this.$router.push(path)
        }
      },
      showDetail(id) {
        this.$router.push({
          'path': '/diagcalcshow',
          query: {
            id: id,
            role: 2,
            show: 1
          }
        })
      },
      getData() {
        let id = this.$route.query.id
        this.$api.getPatientCaseList().then(res => {
          if (!res.data.code) {
            this.list = res.data.data.list
          }
        })
      }
    },
    created() {
      this.getData()
    }
  }

</script>

<style scoped lang="scss">
  hr {
    margin: 1rem 0;
  }

  .bgimg {
    width: 100%;
    height: 10rem;
    top: -5vh;
    position: absolute;
    background-image: url("../assets/images/commonbg.png");
    background-size: 100% 100%;
    z-index: 2;
  }

  /deep/ .loginForm {
    width: 84%;
    margin: auto;
    margin-top: 2rem !important;
    background: #fff;
    padding: 1rem;
    padding-bottom: 2.2rem;
    border-radius: 5px;
    position: relative;

    .formTitle {
      height: 1rem;
      line-height: 1rem;
      text-align: left;
      color: #2882F4;
      padding-bottom: 0.5rem;
      border-bottom: 1px solid #2882F4;
      font-weight: bold;
    }
  }

  /deep/ .rowfont {
    font-size: 1.4rem;
    height: 100%!important;
  }

  .patCaseForm {
    width: 84%;
    margin: auto;
    margin-top: 1rem;
    background: #fff;
    padding: 1rem;
    border-radius: 5px;
    position: relative;
    padding-bottom:2rem;

    .mint-button--small {
      height: 1.6rem;
      position: absolute;
      left: 78%;
    }

    .mint-cell {
      min-height: 1.8rem;
    }

    /deep/ .mint-cell .mint-cell-title {
      width: 60%;
      text-align: left;
    }

    /deep/ .mint-cell .mint-cell-value {
      width: 45%;
      text-align: right;
    }

    /deep/ .mint-cell .mint-cell-wrapper {
      font-size: 1.1rem;
      background-image: none;
    }

    .footer {
      .jbbtn {
        margin-top: 1rem;
        height: 2rem;
        line-height: 2rem;
        font-size: 1.2rem;
        width: 40%;
      }
    }
  }

  /deep/ .mint-cell-value{
    color:#000;
  }
  /deep/ .mint-cell:last-child{
    background-image: none;
  }

</style>
