<template>
  <div class="plate-box">
    <h2 class="title">
      <span class="line"></span>
      <p>{{ title }}</p>
      <span class="line"></span>
    </h2>
    <div class="plate ">
      <ul>
        <li style="height: 0.6rem;">
          <label>透析物品核查 : </label>
          <span class="content">{{ dialysis_item_check }}</span>
        </li>
        <li style="height: 0.6rem;">
          <label>透析参数核查 : </label>
          <span class="content">{{ dialysis_parameter_check }}</span>
        </li>
        <li style="height: 0.6rem;">
          <label>血管通路核查 : </label>
          <span class="content">{{ vascular_access_verification }}</span>
        </li>
        <li style="height: 0.6rem;">
          <label>管道连接核查 : </label>
          <span class="content">{{ pipeline_connection_check }}</span>
        </li>
      </ul>
      <ul>
        <li style="height: 0.6rem;">
          <label>{{ dialysis_item_desc_title }}</label>
          <span class="content">{{ dialysis_item_desc }}</span>
        </li>
        <li style="height: 0.6rem;">
          <label>{{ dialysis_parameter_desc_title }}</label>
          <span class="content">{{ dialysis_parameter_desc }}</span>
        </li>
        <li style="height: 0.6rem;">
          <label>{{ vascular_access_desc_title }}</label>
          <span class="content">{{ vascular_access_desc }}</span>
        </li>
        <li style="height: 0.6rem;">
          <label>{{ pipeline_connection_desc_title }}</label>
          <span class="content">{{ pipeline_connection_desc }}</span>
        </li>
      </ul>
      <ul>
        <li style="height: 0.6rem;">
          <label></label>
          <span class="content"> </span>
        </li>
      </ul>
    </div>
    <!-- <div class="note">处方医生 : {{doctor}}</div> -->
  </div>
</template>

<script>
export default {
  name: "DoubleCheck",
  data() {
    return {
      title: "双人查对 ",
      note: "无明显异常",
      doctor: "刘小军  医生",
      info1: [
        { value: "1", label: "透析物品核查 : ", content: "", unit: "" },
        { value: "2", label: "透析参数核查 : ", content: "", unit: "" },
        { value: "3", label: "血管通路核查 : ", content: "", unit: "" },
        { value: "4", label: "管道连接核查 : ", content: "", unit: "" }
      ],
      info2: [
        { value: "1", label: "差错描述 : ", content: "", unit: "", hide: true },
        { value: "2", label: "差错描述 : ", content: "", unit: "", hide: true },
        { value: "3", label: "差错描述 : ", content: "", unit: "", hide: true },
        { value: "4", label: "差错描述 : ", content: "", unit: "", hide: true }
      ],
      info3: [{ value: "1", label: " ", content: "", unit: "" }]
    };
  },
  props: {
    record: {
      type: Object
    }
  },
  computed: {
    dialysis_item_check: function() {
      if (this.record == null || this.record.id == "") {
        return "";
      }
      return this.record.dialysis_item_check == 1 ? "正确" : "错误";
    },
    dialysis_parameter_check: function() {
      if (this.record == null || this.record.id == "") {
        return "";
      }
      return this.record.dialysis_parameter_check == 1 ? "正确" : "错误";
    },
    vascular_access_verification: function() {
      if (this.record == null || this.record.id == "") {
        return "";
      }
      return this.record.vascular_access_verification == 1 ? "正确" : "错误";
    },
    pipeline_connection_check: function() {
      if (this.record == null || this.record.id == "") {
        return "";
      }
      return this.record.pipeline_connection_check == 1 ? "正确" : "错误";
    },
    dialysis_item_desc_title: function() {
      if (this.record == null || this.record.id == "") {
        return "";
      }
      return this.record.dialysis_item_check == 1 ? "" : "错误描述 : ";
    },
    dialysis_parameter_desc_title: function() {
      if (this.record == null || this.record.id == "") {
        return "";
      }
      return this.record.dialysis_parameter_check == 1 ? "" : "错误描述 : ";
    },
    vascular_access_desc_title: function() {
      if (this.record == null || this.record.id == "") {
        return "";
      }
      return this.record.vascular_access_verification == 1 ? "" : "错误描述 : ";
    },
    pipeline_connection_desc_title: function() {
      if (this.record == null || this.record.id == "") {
        return "";
      }
      return this.record.pipeline_connection_check == 1 ? "" : "错误描述 : ";
    },

    dialysis_item_desc: function() {
      if (this.record == null || this.record.id == "") {
        return "";
      }
      return this.record.dialysis_item_check == 1
        ? ""
        : this.record.dialysis_item_desc;
    },
    dialysis_parameter_desc: function() {
      if (this.record == null || this.record.id == "") {
        return "";
      }
      return this.record.dialysis_parameter_check == 1
        ? ""
        : this.record.dialysis_parameter_desc;
    },
    vascular_access_desc: function() {
      if (this.record == null || this.record.id == "") {
        return "";
      }
      return this.record.vascular_access_verification == 1
        ? ""
        : this.record.vascular_access_desc;
    },
    pipeline_connection_desc: function() {
      if (this.record == null || this.record.id == "") {
        return "";
      }
      return this.record.pipeline_connection_check == 1
        ? ""
        : this.record.pipeline_connection_desc;
    }
  },
  methods: {
    setRecord(record) {
      if (record == null) {
        this.info1[0].content = "";
        this.info1[1].content = "";
        this.info1[2].content = "";
        this.info1[3].content = "";

        this.info2[0].hide = true;
        this.info2[1].hide = true;
        this.info2[2].hide = true;
        this.info2[3].hide = true;

        this.info2[0].content = "";
        this.info2[1].content = "";
        this.info2[2].content = "";
        this.info2[3].content = "";
      } else {
        this.info1[0].content =
          record.dialysis_item_check == 1 ? "正确" : "错误";
        this.info1[1].content =
          record.dialysis_parameter_check == 1 ? "正确" : "错误";
        this.info1[2].content =
          record.vascular_access_verification == 1 ? "正确" : "错误";
        this.info1[3].content =
          record.pipeline_connection_check == 1 ? "正确" : "错误";

        this.info2[0].hide = record.dialysis_item_check == 1;
        this.info2[1].hide = record.dialysis_parameter_check == 1;
        this.info2[2].hide = record.vascular_access_verification == 1;
        this.info2[3].hide = record.pipeline_connection_check == 1;

        this.info2[0].content = record.dialysis_item_desc;
        this.info2[1].content = record.dialysis_parameter_desc;
        this.info2[2].content = record.vascular_access_desc;
        this.info2[3].content = record.pipeline_connection_desc;
      }
    }
  }
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped></style>
