<template>
  <div class="container">
    <div class="bgimg"></div>
    <div class="content">
      <div class="title">病例管理</div>
      <div class="searchinput">
          <mt-field class="searchInput" placeholder="请输入患者姓名" v-model="queryForm.name">
              <mt-button type="primary" size="small" @click="getData()">搜索</mt-button>
          </mt-field>
      </div>
      <div class="patCaseForm baseInfo" v-for="(item,index) in caseList">
          <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.mpro" :value="'注射剂量:'+item.zsjl"></mt-cell>
          <mt-cell :title="'注射频次:'+item.zspc"></mt-cell>
          <div style="font-size:1rem;text-align:left;padding-left:10px;">
              方案时间:{{item.ctime}}
              <mt-button type="primary" size="small" @click="showDetail(item.id)">详情</mt-button>
          </div>
      </div>
      <!-- <div class="footer">
        <div class="jbbtn">确定</div>
        <div class="jbbtn" @click="goPage('/patinjectionlist')">查看注射记录</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 {
        searchName:"",
        form: {},
        queryForm:{},
        caseList:{}
      }
    },
    methods: {
      goPage(path) {
        this.$router.push(path)
      },
      showDetail(id){
        this.$router.push({"path":"diagcalcshow",query:{id:id}})
      },
      getData() {
        let id = this.$route.query.id
        this.$api.getPatientCaseList(this.queryForm).then(res => {
          if (!res.data.code) {
            this.caseList = res.data.data.list
          }
        })
      }
    },
    created() {
      this.getData()
    }
  }

</script>

<style scoped lang="scss">
  .searchinput{
    width: 80%;
    margin: auto;
    .mint-search{
      height: 100%;
      margin-top:1rem;
    }
  }
  .patCaseForm {
    width: 84%;
    margin: auto;
    margin-top: 1rem;
    background: #fff;
    padding: 1rem;
    border-radius: 5px;
    position: relative;
    .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;
    }
  }
  .container{
    height: 100%;
  }
  .footer {
    display: flex;
    .jbbtn{
      width: 42%;
    }
  }

</style>
