<!-- 文书管理 -->
<template>
  <div class="patient-container">
    <patient-sidebar :id="patientID" defaultActive="6-1"></patient-sidebar>
    <div>
      <div class="patient-app-container advice-container app-container">
        <el-tabs v-model="activeName" >
          <el-tab-pane label="已生成" name="first">
            <div style="display: flex;">
              <div style="width: 30%;">
                <div>
                  <el-input
                    placeholder="请输入内容"
                    prefix-icon="el-icon-search"
                    v-model="input2" style="width: 200px;">
                  </el-input>
                  <!-- <el-button type="primary">查看图片</el-button> -->
                </div>
                <div>
                  <el-table
                    :data="tableData"
                    stripe
                    :header-cell-style="{
                       background:' #409eff',
                       color: 'white'
                    }"
                    border
                    style="width: 100%">
                    <el-table-column
                      prop="num"
                      label="序号"
                      width="60">
                    </el-table-column>
                    <el-table-column
                      prop="date"
                      label="日期"
                      width="120">
                    </el-table-column>
                    <el-table-column
                      prop="address"
                      label="知情同意书">
                    </el-table-column>
                  </el-table>
                </div>
              </div>
              <div style="width: 68%; margin-left: 10px;">
                <div style="height: 100vh; border: 1px solid gainsboro;">

                </div>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="模板" name="second">
            <div style="display: flex;">
              <div style="width: 30%;">
                <div>
                  <el-input
                    placeholder="请输入内容"
                    prefix-icon="el-icon-search"
                    v-model="input2" style="width: 200px;">
                  </el-input>
                  <!-- <el-button type="primary">新增</el-button> -->
                </div>
                <div>
                  <el-table
                    :data="templates"
                    style="width: 100%"
                    hegint="300"
                    border
                    :highlight-current-row="true"
                    :header-cell-style="{
                      color: '#409eff',
                    }"
                    @row-click="rowClick"
                  >
                    <el-table-column
                      prop="date"
                      label="知情同意书模板"
                      align="center"
                    >
                    </el-table-column>
                  </el-table>
                </div>
              </div>
              <div style="width: 67%; margin-left: 10px;">
                <div v-if="face_show">
                  <Falloutbedprint :patient_id ="this.patientID"></Falloutbedprint>
                </div>
                <div v-if="filter_show">
                  <!-- filter_show -->
                  <Filter_informed :patient_id ="this.patientID"></Filter_informed>
                </div>
                <div v-if="profunda_show">
                  <profunda_informed :patient_id ="this.patientID"></profunda_informed>
                </div>
                <div v-if="arteriovenous_show">
                  <arteriovenous_informed :patient_id ="this.patientID"></arteriovenous_informed>
                </div>
                <div v-if="Highrisk_show" >
                  <Highrisk_informed :patient_id ="this.patientID"></Highrisk_informed>
                </div>
                <div v-if="anticoagulation_show">
                  <anticoagulation_informed :patient_id ="this.patientID"></anticoagulation_informed>
                </div>
                <div v-if="critical_show">
                  <critical_informed :patient_id ="this.patientID"></critical_informed>
                </div>
                <div v-if="hemoperfusion_show">
                  <hemoperfusion_informed :patient_id ="this.patientID"></hemoperfusion_informed>
                </div>
                <div v-if="Bring_show">
                  <Bring_informed :patient_id ="this.patientID"></Bring_informed>
                </div>
                <div v-if="catheterization_show">
                  <catheterization_informed :patient_id ="this.patientID"></catheterization_informed>
                </div>
                <div v-if="dialyzer_show">
                  <dialyzer_informed :patient_id ="this.patientID"></dialyzer_informed>
                </div>
                <div v-if="therapy_show">
                  <therapy_informed :patient_id ="this.patientID"></therapy_informed>
                </div>
                
              </div>
            </div>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>

  </div>
</template>

<script>
import PatientSidebar from '../components/PatientSidebar'
import Falloutbedprint from './components/Falloutbedprint'
import Filter_informed from './components/Filter_informed'
import profunda_informed from './components/profunda_informed'
import arteriovenous_informed from './components/arteriovenous_informed'
import Highrisk_informed from './components/Highrisk_informed'
import anticoagulation_informed from './components/anticoagulation_informed'
import critical_informed from './components/critical_informed'
import hemoperfusion_informed from './components/hemoperfusion_informed'
import Bring_informed from './components/Bring_informed'//自带药物
import catheterization_informed from './components/catheterization_informed'//深静脉导管置入
import dialyzer_informed from './components/dialyzer_informed'//透析器（滤器）
import therapy_informed from './components/therapy_informed'//透析器(滤过)治疗
import { getPatientDetailInformedconsent,  } from '@/api/patient'
export default {
  
  components: {
    PatientSidebar,
    Falloutbedprint,
    Filter_informed,
    profunda_informed,
    arteriovenous_informed,
    Highrisk_informed,
    anticoagulation_informed,
    critical_informed,
    hemoperfusion_informed,
    Bring_informed,
    catheterization_informed,
    dialyzer_informed,
    therapy_informed
  },
  data() {
    return {
      // patient_id:0,
      activeName:'first',
      templates:[{date:'人脸识别知情同意书',value:1},{date:'血液透析(滤过、灌流)治疗知情同意书',value:2},{date:'深静脉透析导管拔管术知情同意书',value:3},{date:'动静脉内瘘穿刺知情同意书',value:4},
                {date:'高危出血患者血液净化抗凝方式选择知情同意书',value:5},{date:'抗凝溶栓治疗知情同意书',value:6},{date:'危重患者接受血液净化治疗知情同意书',value:7},
                {date:'血液灌流治疗知情同意书',value:8},{date:'自带药物代为注射告知知情同意书',value:9},{date:'深静脉透析导管置入术知情同意书',value:10},
                {date:'透析器（滤器）重复使用知情同意书',value:11},{date:'血液透析（滤过）治疗知情同意书',value:12}],

      face_show:true,
      filter_show:false,
      profunda_show:false,
      arteriovenous_show:false,
      Highrisk_show:false,
      anticoagulation_show:false,
      critical_show:false,
      hemoperfusion_show:false,
      Bring_show:false,
      catheterization_show:false,
      dialyzer_show:false,
      therapy_show:false,
      patientID:0,
      patient:{},
      tableData:[],
      input2:'',
    }

  },
  created() {
    const id = this.$route.params && this.$route.params.id
    this.patientID = parseInt(id)
    console.log("病人id",this.patientID)
    // this.queryParams.patient_id = this.patientID;
  },
  methods: {
    getlist(){
    
    getPatientDetailInformedconsent(this.patientID).then(response=>{
      if(response.data.state == 1){
        var patient =  response.data.data.patients
        console.log("patinet",patient)
        this.patient =patient
      }
    }) 
   },
    rowClick(row, column, event){
      // console.log('1111',row);
      // console.log('2222',column);
      // console.log('3333',event);
     
        if(row.value==1){
          this.face_show=true
          this.filter_show=false,
          this.profunda_show=false,
          this.arteriovenous_show=false,
          this.Highrisk_show=false,
          this.anticoagulation_show=false,
          this.critical_show=false,
          this.hemoperfusion_show=false,
          this.Bring_show=false,
          this.catheterization_show=false,
          this.dialyzer_show=false,
          this.therapy_show=false
        }
        if(row.value==2){
          this.filter_show=true
          this.face_show=false
          this.profunda_show=false,
          this.arteriovenous_show=false,
          this.Highrisk_show=false,
          this.anticoagulation_show=false,
          this.critical_show=false,
          this.hemoperfusion_show=false,
          this.Bring_show=false,
          this.catheterization_show=false,
          this.dialyzer_show=false,
          this.therapy_show=false
        }
        if(row.value==3){
          this.face_show=false
          this.filter_show=false,
          this.profunda_show=true,
          this.arteriovenous_show=false,
          this.Highrisk_show=false,
          this.anticoagulation_show=false,
          this.critical_show=false,
          this.hemoperfusion_show=false,
          this.Bring_show=false,
          this.catheterization_show=false,
          this.dialyzer_show=false,
          this.therapy_show=false
        }
        if(row.value==4){
          this.filter_show=false
          this.face_show=false
          this.profunda_show=false,
          this.arteriovenous_show=true,
          this.Highrisk_show=false,
          this.anticoagulation_show=false,
          this.critical_show=false,
          this.hemoperfusion_show=false,
          this.Bring_show=false,
          this.catheterization_show=false,
          this.dialyzer_show=false,
          this.therapy_show=false
        }
        if(row.value==5){
          this.face_show=false
          this.filter_show=false,
          this.profunda_show=false,
          this.arteriovenous_show=false,
          this.Highrisk_show=true,
          this.anticoagulation_show=false,
          this.critical_show=false,
          this.hemoperfusion_show=false,
          this.Bring_show=false,
          this.catheterization_show=false,
          this.dialyzer_show=false,
          this.therapy_show=false
        }
        if(row.value==6){
          this.filter_show=false
          this.face_show=false
          this.profunda_show=false,
          this.arteriovenous_show=false,
          this.Highrisk_show=false,
          this.anticoagulation_show=true,
          this.critical_show=false,
          this.hemoperfusion_show=false,
          this.Bring_show=false,
          this.catheterization_show=false,
          this.dialyzer_show=false,
          this.therapy_show=false
        }
        if(row.value==7){
          this.face_show=false
          this.filter_show=false,
          this.profunda_show=false,
          this.arteriovenous_show=false,
          this.Highrisk_show=false,
          this.anticoagulation_show=false,
          this.critical_show=true,
          this.hemoperfusion_show=false,
          this.Bring_show=false,
          this.catheterization_show=false,
          this.dialyzer_show=false,
          this.therapy_show=false
        }
        if(row.value==8){
          this.filter_show=false
          this.face_show=false
          this.profunda_show=false,
          this.arteriovenous_show=false,
          this.Highrisk_show=false,
          this.anticoagulation_show=false,
          this.critical_show=false,
          this.hemoperfusion_show=true,
          this.Bring_show=false,
          this.catheterization_show=false,
          this.dialyzer_show=false,
          this.therapy_show=false
        }
        if(row.value==9){
          this.face_show=false
          this.filter_show=false,
          this.profunda_show=false,
          this.arteriovenous_show=false,
          this.Highrisk_show=false,
          this.anticoagulation_show=false,
          this.critical_show=false,
          this.hemoperfusion_show=false,
          this.Bring_show=true,
          this.catheterization_show=false,
          this.dialyzer_show=false,
          this.therapy_show=false
        }
        if(row.value==10){
          this.filter_show=false
          this.face_show=false
          this.profunda_show=false,
          this.arteriovenous_show=false,
          this.Highrisk_show=false,
          this.anticoagulation_show=false,
          this.critical_show=false,
          this.hemoperfusion_show=false,
          this.Bring_show=false,
          this.catheterization_show=true,
          this.dialyzer_show=false,
          this.therapy_show=false
        }
        if(row.value==11){
          this.face_show=false
          this.filter_show=false,
          this.profunda_show=false,
          this.arteriovenous_show=false,
          this.Highrisk_show=false,
          this.anticoagulation_show=false,
          this.critical_show=false,
          this.hemoperfusion_show=false,
          this.Bring_show=false,
          this.catheterization_show=false,
          this.dialyzer_show=true,
          this.therapy_show=false
        }
        if(row.value==12){
          this.filter_show=false
          this.face_show=false
          this.profunda_show=false,
          this.arteriovenous_show=false,
          this.Highrisk_show=false,
          this.anticoagulation_show=false,
          this.critical_show=false,
          this.hemoperfusion_show=false,
          this.Bring_show=false,
          this.catheterization_show=false,
          this.dialyzer_show=false,
          this.therapy_show=true
        }
  
    },
  }
}
</script>
<style rel="stylesheet/css" lang="scss" scoped>
    .content_top{
      display: flex;
      justify-content: space-between;
     
    }
    .table{
        border: 1px solid #DCDFE6;
        border-collapse:collapse;
        border-spacing: 0;
        thead th{
            background: #0077ff9f;
            color: white;
            text-align: center;
            height: 40px;
        }
        tbody td{
           height: 40px;
           padding: 5px;
        }
        .start{
            text-align: center;
        }
        .bing{
            width: 150px;
            text-align: center;
        }
        .bg_color{
            background: rgb(243, 240, 240);
        }
        .jiange{
            margin-left: 20px;
            // color: black;
        }
        .xiaojige{
          margin-left: 10px;
        }
        .rightjiange{
          margin-right: 40px;
          font-size: 15px;
        }
        .ttbwzz-type-a {
          min-width: 80px;
          margin-right: 30px;
          padding: 5px 0px;
          font-size: 15px;
        }
        input{
            -webkit-appearance: checkbox;
        }
    }
    .shuoming p{
      margin-top: 5px;
      color: rgb(167, 165, 165);
    }
    .biaotou{
      font-size: 18px;
      margin-bottom: 10px;
      color: #0077ff9f;
      // background-color: '#409eff';
    }
    ::-webkit-scrollbar {
        width: 5px;
    }
    ::-webkit-scrollbar-track {
        /*background black*/
        border-radius: 5px;
        background-color: white;
    }
    .table2 tr td{
      width: 50%;
      height: 40px;
      padding: 5px;
    }

  </style>
  <style lang="scss">
  .status_change{

      .el-dialog__header{
          background-color:#eff2f5;
          .el-dialog__title,.el-dialog__headerbtn i{
          color: #666666;
          }
      }
  }
  .el-dialog {
      left: 50% !important;
      position: fixed !important;
      top: 40% !important;
      transform: translate(-50%, -50%) !important;
      margin-top: 0 !important;

  }
</style>
 