<template>
  <div class="">
    <div class="info ">
      <ul class="clearfix">
        <!-- <li v-for="(item,index) in info" :key="index" :value="item.value" >
                <label>{{item.label}}</label>
                <span>{{item.content}}</span>
            </li> -->
        <li>
          <label>姓名 : </label>
          <span>{{ patient.name }}</span>
        </li>
        <li>
          <label>性别 : </label>
          <span>{{ patient.gender == 1 ? "男" : "女" }}</span>
        </li>
        <li>
          <label>出生 : </label>
          <span>{{ patient.birthday }}</span>
        </li>
        <li>
          <label>透析号 : </label>
          <span>{{ patient.dialysis_no }}</span>
        </li>
        <li>
          <label>床位号 : </label>
          <span>{{ device_number.number }}</span>
        </li>
        <li>
          <label>来源 : </label>
          <span>{{ patient.source }}</span>
        </li>
        <li>
          <label>住院号 : </label>
          <span>{{ patient.admission_number }}</span>
        </li>
        <!-- <li>
                <label>透析时长 : </label>
                <span></span>
            </li> -->
      </ul>
    </div>
  </div>
</template>

<script>
import { parseTime } from "@/utils";

export default {
  name: "detailsInfo",
  data() {
    return {
      patient: {
        name: "",
        gender: 1,
        birthday: "",
        dialysis_no: "",
        device_number: "",
        source: "",
        admission_number: ""
      },
      device_number: {
        number: ""
      }
    };
  },
  methods: {
    setPatientInfo(patient, device_number_name) {
      if (patient == null) {
        this.patient.name = "";
        this.patient.gender = 1;
        this.patient.birthday = "";
        this.patient.dialysis_no = "";
        // this.patient.device_number = ""
        this.patient.source = "";
        this.patient.admission_number = "";
      } else {
        this.patient.name = patient.name;
        this.patient.gender = patient.gender;
        this.patient.birthday = parseTime(patient.birthday, "{y}/{m}/{d}");
        this.patient.dialysis_no = patient.dialysis_no;
        this.device_number.number = device_number_name;
        this.patient.source = patient.source == 1 ? "门诊" : "住院";
        this.patient.admission_number = patient.admission_number;
      }
    }
  }
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.info {
  background: $text-color;
  border-top: 1px $border-color solid;
  padding: 0.25rem 0.28rem;
  ul {
    li {
      float: left;
      width: 20%;
      // margin: 0 1rem 0 0;
      font-size: 0.28rem;
      height: 0.6rem;
      line-height: 0.6rem;
    }
  }
}
</style>
