<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 v-if="isShow('透后体重')">
          <label for="thtz">透后体重 : </label>
          <span class="content" id="thtz">{{weight_after?weight_after:''}}</span>
          <span class="unit">{{weight_after?"kg":''}}</span>
        </li>
        <li v-if="isShow('收缩压')">
          <label for="ssy">收缩压 : </label>
          <span class="content" id="ssy">{{systolic_blood_pressure?systolic_blood_pressure:''}}</span>
          <span class="unit">{{systolic_blood_pressure?"mmHg":''}}</span>
        </li>
        <li v-if="isShow('实际超滤量')">
          <label for="sjcll">实际超滤量: </label>
          <span class="content" id="sjcll">{{actual_ultrafiltration?actual_ultrafiltration:''}}</span>
          <span class="unit">{{actual_ultrafiltration?"L":''}}</span>
        </li>
        <li v-if="isShow('透析器凝血')">
          <label for="nx">透析器凝血 : </label>
          <span class="content" id="nx">{{cruor}}</span>
        </li>
        <li v-if="isShow('内瘘')">
          <label for="nw">内瘘 : </label>
          <span id="nw" class="content">{{internal_fistula}}</span>
        </li>
        <li v-if="isShow('导管')">
          <label for="dg">导管 : </label>
          <span id="dg" class="content">{{catheter}}</span>
        </li>
        <li v-if="isShow('穿刺处血肿')">
          <label for="jccxz">穿刺处血肿 : </label>
          <span id="jccxz" class="content">{{puncture_point_haematoma_name}}</span>
        </li>
        <li v-if="patient_gose==3&&isShow('科室')">
          <label for="ks">科室 : </label>
          <span id="ks" class="content">{{inpatient_department}}</span>
        </li>
        <li v-if="isShow('体温')">
          <label for="tw">体温 : </label>
          <span class="content" id="tw">{{temperature?temperature:''}}</span>
          <span class="unit">{{temperature?"℃":''}}</span>
        </li>
        <li v-if="isShow('脉率')">
          <label for="ml">脉率 : </label>
          <span id="ml" class="content">{{pulse_frequency?pulse_frequency:''}}</span>
          <span class="unit">{{pulse_frequency?"次/分":''}}</span>
        </li>

        <li v-if="isShow('血管通路操作')">
          <label for="xgtlcz">血管通路操作: </label>
          <span id="xgtlcz" class="content">{{blood_access_opera}}</span>
        </li>

      </ul>

      <ul>
        <li v-if="isShow('体重减少')">
          <label for="tzjs">体重减少 : </label>
          <span class="content" id="tzjs">{{weight_loss?weight_loss:''}}</span>
          <span class="unit">{{weight_loss?"kg":''}}</span>
        </li>
        <li v-if="isShow('舒张压')">
          <label for="szy">舒张压 : </label>
          <span id="szy" class="content">{{diastolic_blood_pressure?diastolic_blood_pressure:''}}</span>
          <span class="unit">{{diastolic_blood_pressure?"mmHg":''}}</span>
        </li>
        <li v-if="isShow('实际置换量')">
          <label for="sjzhl">实际置换量 : </label>
          <span id="sjzhl" class="content">{{actual_displacement?actual_displacement:''}}</span>
          <span class="unit">{{actual_displacement?"ml":''}}</span>
        </li>
        <li v-if="isShow('透后症状')">
          <label for="thzz">透后症状 : </label>
          <span id="thzz" class="content">{{symptom_after_dialysis}}</span>
        </li>
        <li v-if="isShow('血管通路部位')">
          <label for="xgtl">血管通路部位 : </label>
          <span id="xgtl" class="content">{{blood_access_part}}</span>
        </li>
        <li v-if="isShow('并发症')">
          <label for="bfz">并发症: </label>
          <span id="bfz" class="content">{{complication}}</span>
        </li>
        <li v-if="isShow('压迫后内瘘震颤')">
          <label for="yph">压迫后内瘘震颤: </label>
          <span id="yph" class="content">{{internal_fistula_tremor_ac_name}}</span>
        </li>
        <li v-if="patient_gose==3&&isShow('交待病房护士/患者/陪人观察内容')">
          <label for="jdbf">交待病房护士/患者/陪人观察内容 : </label>
          <span class="content" id="jdbf">{{observation_content}}</span>
        </li>
        <li v-if="isShow('实际治疗时长')">
          <label for="sjzl">实际治疗时长 : </label>
          <span id="sjzl" class="content">{{actual_treatment_hour}}时{{actual_treatment_minute}}分</span>
        </li>
        <li v-if="isShow('透析中入量')">
          <label for="txzrl">透析中入量: </label>
          <span id="txzrl" class="content">{{dialysis_intakes_feed?dialysis_intakes_feed:''}}</span>
        </li>

        <li v-if="isShow('患者去向')">
          <label for="hzqx">患者去向: </label>
          <span id="hzqx" class="content">{{patient_gose_name}}</span>
        </li>
        <li v-if="patient_gose==3&&isShow('其他观察内容')">
          <label for="qtgcnr">其他观察内容 : </label>
          <span id="qtgcnr" class="content">{{observation_content_other}}</span>
        </li >
        <li  v-if="isShow('拔针后穿刺点渗血')">
          <label for="bzh">拔针后穿刺点渗血: </label>
          <span id="bzh" class="content">{{puncture_point_oozing_blood_name}}</span>
        </li>
      </ul>


      <ul >
        <li v-if="isShow('透析过程')">
          <label for="tw">透析过程 : </label>
          <span class="content" id="tw" v-if="this.record.dialysis_process == 1">完成</span>
          <span class="content" id="tw" v-if="this.record.dialysis_process == 2">提前{{in_advance_minute}}min</span>
        </li>
        <li v-if="this.record.dialysis_process == 2&&isShow('透析过程提前原因')">
          <label for="tw">透析过程提前原因 : </label>
          <span class="content" id="tw" >{{in_advance_reason}}</span>
        </li>



        <li v-if="isShow('内瘘管拔针后压迫止血时间')">
          <label for="ml">内瘘管拔针后压迫止血时间 : </label>
          <span id="ml" class="content" v-if="hemostasis_minute">{{hemostasis_minute}}min</span>
          <span id="ml" class="content" v-else>-min</span>
        </li>
        <li v-if="isShow('内瘘管拔针后压迫止血操作')">
          <label for="ml">内瘘管拔针后压迫止血操作 : </label>
          <span id="ml" class="content">{{getOpera(this.record.hemostasis_opera)}}</span>
        </li>
        <li v-if="isShow('血管震颤和血管杂音')">
          <label for="sjzl">血管震颤和血管杂音 : </label>
          <span id="sjzl" class="content">{{getTremorNoise(this.record.tremor_noise)}}</span>
        </li>
        <li v-if="isShow('失衡综合症')">
          <label for="txzrl">失衡综合症: </label>
          <span id="txzrl" class="content">{{getDisequilibriumSyndrome(this.record.disequilibrium_syndrome)}}</span>
        </li>
        <li v-if="this.record.disequilibrium_syndrome == 2&&isShow('失衡综合症症状')">
          <label for="txzrl">失衡综合症症状: </label>
          <span id="txzrl" class="content">{{this.record.disequilibrium_syndrome_option}}</span>
        </li>
        <li v-if="isShow('动脉管道')">
          <label for="xgtlcz">动脉管道: </label>
          <span id="xgtlcz" class="content">{{getArterialTubeName(this.record.arterial_tube)}}</span>
        </li>
        <li v-if="isShow('静脉管道')">
          <label for="bzh">静脉管道: </label>
          <span id="bzh" class="content">{{getIntravenousTubeName(this.record.intravenous_tube)}}</span>
        </li>
        <li v-if="isShow('透析器')">
          <label for="hzqx">透析器: </label>
          <span id="hzqx" class="content">{{getDialyzer(this.record.dialyzer)}}</span>
        </li>
      </ul>
    </div>
    <div class="note">备注 : <span>{{remark}}</span></div>
  </div>
</template>

<script>
  export default {
    name: "DialysisPrescription",
    data() {
      return {
        title: "透后评估 ",
        // note: "无明显异常",
        // doctor: "刘小军  医生",
        // info1: [
        //   { value: "1", label: "透后体重 : ", content: "55", unit: "kg" },
        //   { value: "2", label: "收缩压 : ", content: "174", unit: "mmHg" },
        //   { value: "3", label: "实际超滤量: ", content: "20", unit: "ml" },
        //   { value: "4", label: "疑血 : ", content: "无震颤", unit: "" },
        //   { value: "5", label: "", content: "", unit: "" }
        // ],
        // info2: [
        //   { value: "1", label: "体重减少 : ", content: "3", unit: "kg" },
        //   { value: "2", label: "舒张压 : ", content: "200", unit: "mmHg" },
        //   { value: "3", label: "实际置换量 : ", content: "20", unit: "ml" },
        //   { value: "3", label: "透后症状 : ", content: "无症状", unit: "" },
        //   { value: "4", label: "导管 : ", content: "导管堵塞", unit: "" }
        // ],
        // info3: [
        //   { value: "1", label: "体温 : ", content: "14", unit: "℃" },
        //   { value: "2", label: "心率 : ", content: "2", unit: "次/分" },
        //   { value: "3", label: "实际治疗时长 : ", content: "4时4分", unit: "" },
        //   { value: "4", label: "透析中入量: ", content: "一般", unit: "" },
        //   { value: "4", label: "并发症: ", content: "痔疮出血", unit: "" }
        // ]
      };
    },
    props: {
      record: {
        type: Object,
      }
    },
    computed: {
      weight_after: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.weight_after
      },
      systolic_blood_pressure: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.systolic_blood_pressure
      },
      actual_ultrafiltration: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.actual_ultrafiltration
      },
      cruor: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.cruor
      },
      internal_fistula: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.internal_fistula;
      },
      weight_loss: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.weight_loss
      },
      inpatient_department: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.inpatient_department
      },
      patient_gose: function () {
        if (this.record == null || this.record.id == "") {
          return 0
        }
        return this.record.patient_gose
      },
      diastolic_blood_pressure: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.diastolic_blood_pressure
      },
      actual_displacement: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.actual_displacement
      },
      symptom_after_dialysis: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.symptom_after_dialysis
      },
      blood_access_part: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        let vascular_access = this.$store.getters.vascular_access;
        let valen = vascular_access.length
        let name = '-';
        for (let index = 0; index < valen; index++) {
          if (vascular_access[index].id == this.record.blood_access_part_id) {
            name = vascular_access[index].name;
            break;
          }
        }
        return name
      },
      puncture_point_oozing_blood_name: function () {

        if (this.record == null || this.record.id == "") {
          return "-"
        }
        switch (this.record.puncture_point_oozing_blood) {
          case 1:
            return '有'
            break;
          case 2:
            return '无'
            break

          default:
            return '-'
            break;
        }
      },
      patient_gose_name: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        switch (this.record.patient_gose) {
          case 1:
            return '离院'
            break;
          case 2:
            return '留观'
            break
          case 3:
            return '住院'
            break

          default:
            return '-'
            break;
        }
      },
      blood_access_opera: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        let vascular_access = this.$store.getters.vascular_access_desc;
        let valen = vascular_access.length
        let name = '-';
        for (let index = 0; index < valen; index++) {
          if (vascular_access[index].id == this.record.blood_access_part_opera_id) {
            name = vascular_access[index].name;
            break;
          }
        }
        return name
      },
      catheter: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.catheter
      },
      puncture_point_haematoma_name: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        switch (this.record.puncture_point_haematoma) {
          case 1:
            return '有'
            break;
          case 2:
            return '无'
            break
          default:
            return '-'
            break;
        }
      },
      temperature: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.temperature
      },
      pulse_frequency: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.pulse_frequency
      },
      actual_treatment_hour: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.actual_treatment_hour
      },
      actual_treatment_minute: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.actual_treatment_minute
      },
      dialysis_intakes_feed: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.dialysis_intakes
      },
      observation_content_other: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.observation_content_other
      },
      observation_content: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.observation_content
      },
      complication: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        return this.record.complication
      },
      internal_fistula_tremor_ac_name: function () {
        if (this.record == null || this.record.id == "") {
          return "-"
        }
        switch (this.record.internal_fistula_tremor_ac) {
          case 1:
            return '存在'
            break;
          case 2:
            return '减弱'
            break;
          case 3:
            return '无';
            break
          default:
            return '-'
            break;
        }
      },

      remark: function () {
        if (this.record == null || this.record.id == "") {
          return ""
        }
        return this.record.remark
      },in_advance_minute:function () {
        if (this.record == null || this.record.id == "") {
          return ""
        }
        return this.record.in_advance_minute
      },in_advance_reason:function () {
        if (this.record == null || this.record.id == "") {
          return ""
        }
        return this.record.in_advance_reason + ","+this.record.in_advance_reason_other
      },hemostasis_minute:function () {
        if (this.record == null || this.record.id == "") {
          return ""
        }

        return this.record.hemostasis_minute
      },in_advance_reason_other:function () {
        if (this.record == null || this.record.id == "") {
          return ""
        }
        return this.record.in_advance_reason_other
      }
    },
    methods: {
      isShow(name){
        var filedList = this.$store.getters.user.fileds

        for (let i = 0; i < filedList.length; i++){
          if(filedList[i].module == 5 && filedList[i].filed_name_cn == name&&filedList[i].is_show == 1){
            return true
          }
        }
        return false
      },
      getOpera:function (id) {
        var hemostasis_opera = this.$store.getters.hemostasis_opera;
        var hemostasisOperaName = "";
        for (let i = 0; i < hemostasis_opera.length; i++){
          if(hemostasis_opera[i].id == id){
            hemostasisOperaName =    hemostasis_opera[i].name
          }
        }
        return hemostasisOperaName

      },getTremorNoise:function (id) {
        var tremor_noise = this.$store.getters.tremor_noise;
        var tremorNoiseName = "";
        for (let i = 0; i < tremor_noise.length; i++){
          if(tremor_noise[i].id == id){
            tremorNoiseName =    tremor_noise[i].name
          }
        }
        return tremorNoiseName
      },getDisequilibriumSyndrome:function (id) {
        var disequilibrium_syndrome = this.$store.getters.disequilibrium_syndrome;
        var disequilibriumSyndromeName = "";
        for (let i = 0; i < disequilibrium_syndrome.length; i++){
          if(disequilibrium_syndrome[i].id == id){
            disequilibriumSyndromeName =    disequilibrium_syndrome[i].name
          }
        }
        return disequilibriumSyndromeName

      },getDisequilibriumSyndromeOptionName:function (id) {
        var disequilibrium_syndrome_option = this.$store.getters.disequilibrium_syndrome_option;
        var disequilibriumSyndromeOptionName = "";
        for (let i = 0; i < disequilibrium_syndrome_option.length; i++) {
          if (disequilibrium_syndrome_option[i].id == id) {
            disequilibriumSyndromeOptionName = disequilibrium_syndrome_option[i].name
          }
        }
        return disequilibriumSyndromeOptionName
      },getArterialTubeName:function (id) {
        var arterial_tube = this.$store.getters.arterial_tube;
        var arterialTubeName = "";
        for (let i = 0; i < arterial_tube.length; i++) {
          if (arterial_tube[i].id == id) {
            arterialTubeName = arterial_tube[i].name
          }
        }
        return arterialTubeName

      },getIntravenousTubeName:function (id) {
        var intravenous_tube = this.$store.getters.intravenous_tube;
        var intravenousTubeName = "";
        for (let i = 0; i < intravenous_tube.length; i++) {
          if (intravenous_tube[i].id == id) {
            intravenousTubeName = intravenous_tube[i].name
          }
        }
        return intravenousTubeName

      },getDialyzer:function (id) {
        var dialyzer = this.$store.getters.dialyzer;
        var dialyzerName = "";
        for (let i = 0; i < dialyzer.length; i++) {
          if (dialyzer[i].id == id) {
            dialyzerName = dialyzer[i].name
          }
        }
        return dialyzerName
      }
      // setRecord(record) {
      //   if (record == null) {
      //     this.info1[0].content = ""
      //     this.info1[1].content = ""
      //     this.info1[2].content = ""
      //     this.info1[3].content = ""
      //     this.info1[4].content = ""

      //     this.info2[0].content = ""
      //     this.info2[1].content = ""
      //     this.info2[2].content = ""
      //     this.info2[3].content = ""
      //     this.info2[4].content = ""

      //     this.info3[0].content = ""
      //     this.info3[1].content = ""
      //     this.info3[2].content = ""
      //     this.info3[3].content = ""
      //     this.info3[4].content = ""

      //     this.note = ""

      //   } else {
      //     this.info1[0].content = record.weight_after
      //     this.info1[1].content = record.systolic_blood_pressure
      //     this.info1[2].content = record.actual_ultrafiltration
      //     this.info1[3].content = record.cruor
      //     // this.info1[4].content = record.systolic_blood_pressure

      //     this.info2[0].content = record.weight_loss
      //     this.info2[1].content = record.diastolic_blood_pressure
      //     this.info2[2].content = record.actual_displacement
      //     this.info2[3].content = record.symptom_after_dialysis
      //     this.info2[4].content = record.catheter

      //     this.info3[0].content = record.temperature
      //     this.info3[1].content = record.pulse_frequency
      //     this.info3[2].content = record.actual_treatment_hour
      //     this.info3[3].content = record.dialysis_intakes_feed
      //     this.info3[4].content = record.complication

      //     this.note = record.remark
      //   }
      // }
    }
  };
</script>

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



