<template>
  <div class="main-contain">
    <div class="position">
      <bread-crumb :crumbs="crumbs"></bread-crumb>
      <el-button
        :loading="loading"
        size="small"
        icon="el-icon-printer"
        @click="printThisPage"
        type="primary"
        >打印
      </el-button>
    </div>
    <div class="app-container">
      <div id="print_content">
        <div
          v-for="(record, index) in records"
          :key="record.id"
          class="print_page_main_content"
        >
          <div id="dialysis-print-box"  style="page-break-after:always">
              <div class="dialysis-print-order print-template-two print_page_main_content">
                <div style="display:inline-block;width:100%;text-align:center;">
                    <div
                    class="order-title"
                    style="letter-spacing: 0;font-weight:600;font-size:22px;display:inline-block;"
                    >
                    {{ orgname }} 血液净化治疗记录单
                    </div>
                </div>
                <div class="row">
                    <div class="inline_block">
                    姓名：
                    <div class="under_line" style="width: 50px;text-align: center;">
                        {{ record.patient.name }}
                    </div>
                    </div>
                    <div class="inline_block">
                    性别：
                    <div class="under_line" style="width: 30px;text-align: center;">
                        {{ record.patient.gender == 1 ? "男" : "女" }}
                    </div>
                    </div>
                    <div class="inline_block">
                    年龄：
                    <div class="under_line" style="width: 30px;text-align: center;">
                        {{ getNewAge(record.patient.id_card_no) }}
                    </div>
                    岁
                    </div>
                    <div class="inline_block">
                    透析号：
                    <div class="under_line" style="width: 70px;text-align: center;">
                        {{ record.patient.dialysis_no }}
                    </div>
                    </div>
                    <div class="inline_block">
                    <div class="under_line" style="width: 50px;text-align: center;">
                        <!-- <check-box :checked="receiverTreatmentAccess.condition == 2 ? true : false"></check-box> -->
                        <span v-if="record.receive_assessment.condition == 2">门诊</span>
                        <span v-if="record.receive_assessment.condition == 1">住院</span>
                    </div>
                    </div>
                    <div class="inline_block">
                    床号：
                    <div class="under_line" style="width: 90px;text-align: center;">
                        {{
                        record.dialysis_order &&
                        record.dialysis_order.device_number &&
                        record.dialysis_order.device_number.number.length >
                        0
                        ? record.dialysis_order.device_number.number
                        : record.device_number.number
                      }}
                    </div>
                    </div>
                    
                    <div class="inline_block">
                    透析次数：
                    <div class="under_line" style="width: 50px;text-align: left">
                        {{ record.patient.total_dialysis + record.patient.user_sys_before_count }} 次
                    </div>
                    </div>
                    <div class="inline_block">
                    日期：
                    <div class="under_line" style="width: 80px;text-align: left">
                        {{ getTime(record.schedule_date, "{y}-{m}-{d}") }}
                    </div>
                    </div>

                </div>
                <!-- <div class="row">
                    <div class="inline_block">
                    病区：
                    <div class="under_line" style="width: 120px;text-align: center;">
                        {{ patientInfo.DialysisSchedule.device_zone.name ? patientInfo.DialysisSchedule.device_zone.name : '' }}
                    </div>
                    </div>
                    
                </div> -->

                <div class="row">
                    <table class="proj_table">
                    <tbody>
                        <tr>
                        <td colspan="1" style="width:50%;padding:0px 0px 5px">
                            <div style="letter-spacing:5px;text-align:center;font-weight:520;font-size:16px;padding: 0px 8px;line-height: 30px;border-bottom:1px solid #000;">
                            透析前评估
                            </div>
                            <div class="row" style="padding:5px 8px;">
                            <div class="inline_block">
                                T
                                <div class="under_line" style="width: 40px;text-align: center">
                                {{ record.assessment_before_dislysis.temperature ? record.assessment_before_dislysis.temperature : "/" }}
                                </div>
                                °C
                            </div>
                            <div class="inline_block" style="margin-left:5px;">
                                P
                                <div class="under_line" style="width: 50px;text-align: center;">
                                {{ record.assessment_before_dislysis.pulse_frequency ? record.assessment_before_dislysis.pulse_frequency : "/" }}
                                </div>
                                次/分
                            </div>
                            <div class="inline_block" style="margin-left:5px;">
                                R
                                <div class="under_line" style="width: 50px;text-align: center;">
                                {{ record.assessment_before_dislysis.breathing_rate ? record.assessment_before_dislysis.breathing_rate : "/" }}
                                </div>
                                次/分
                            </div>
                            <div class="inline_block" style="margin-left:5px;">
                                BP
                                <div class="under_line" style="width: 70px;text-align: center;">
                                {{ record.assessment_before_dislysis.systolic_blood_pressure ? record.assessment_before_dislysis.systolic_blood_pressure : "" }}/
                                {{ record.assessment_before_dislysis.diastolic_blood_pressure ? record.assessment_before_dislysis.diastolic_blood_pressure : "" }}
                                </div>
                                mmHg
                            </div>
                            </div>
                            <div class="row" style="padding:5px 8px;">
                            <div class="inline_block">
                                透析间期：
                                <div class="under_line" style="width: 150px;text-align: center">
                                {{ record.assessment_before_dislysis.last_post_dialysis ? record.assessment_before_dislysis.last_post_dialysis : "" }}
                                </div>
                            </div>
                            <div class="inline_block" style="margin-left:10px;">
                                透前症状：
                                <div class="under_line" style="width: 130px;text-align: center">
                                {{ record.assessment_before_dislysis.symptom_before_dialysis ? record.assessment_before_dislysis.symptom_before_dialysis : "" }}
                                </div>
                            </div>
                            </div>
                            <div class="row" style="padding:5px 8px;">
                            <div class="inline_block">
                                内瘘：
                                <div class="under_line" style="width: 180px;text-align: center">
                                {{ record.assessment_before_dislysis.internal_fistula ? record.assessment_before_dislysis.internal_fistula : "/" }}
                                </div>
                            </div>
                            <div class="inline_block" style="margin-left:8px;">
                                导管：
                                <div class="under_line" style="width: 160px;text-align: center">
                                {{ record.assessment_before_dislysis.catheter ? record.assessment_before_dislysis.catheter : "/" }}
                                </div>
                            </div>
                            </div>
                            <div class="row" style="padding:5px 8px;">
                            <div class="inline_block">
                                合并症：
                                <div class="under_line" style="width: 160px;text-align: center">
                                {{ record.assessment_before_dislysis.complication ? record.assessment_before_dislysis.complication : "/" }}
                                </div>
                            </div>
                            <div class="inline_block" style="margin-left:12px;">
                                干体重：
                                <div class="under_line" style="width: 50px;text-align: center">
                                {{ record.assessment_before_dislysis.dry_weight ? record.assessment_before_dislysis.dry_weight : "/" }}
                                </div>
                                kg
                            </div>
                            </div>
                            <div class="row" style="padding:5px 8px;">
                            <div class="inline_block">
                                透前体重：
                                <div class="under_line" style="width: 50px;text-align: center">
                                {{ record.assessment_before_dislysis.weight_before ? record.assessment_before_dislysis.weight_before : "/" }}
                                </div>
                                kg
                            </div>
                            <div class="inline_block" style="margin-left:10px;">
                                衣物重：
                                <div class="under_line" style="width: 50px;text-align: center">
                                {{ record.assessment_before_dislysis.additional_weight ? record.assessment_before_dislysis.additional_weight: "/" }}
                                </div>
                                kg
                            </div>
                            <div class="inline_block" style="margin-left:10px;">
                                体重增加：
                                <div class="under_line" style="width: 50px;text-align: center">
                                {{ record.assessment_before_dislysis.weight_before > 0 && record.lastafterweight.weight_after > 0 ? parseFloat(record.assessment_before_dislysis.weight_before - record.lastafterweight.weight_after).toFixed(2): "/" }}
                                </div>
                                kg
                            </div>
                            </div>
                            <div class="row" style="padding:5px 8px;">
                            <div class="inline_block">
                                穿刺方式：
                                <div class="under_line" style="width: 150px;text-align: center">
                                {{ record.assessment_before_dislysis.puncture_way ? record.assessment_before_dislysis.puncture_way : "/" }}
                                </div>
                            </div>
                            <div class="inline_block" style="margin-left:10px;">
                                穿刺针：
                                <div class="under_line" style="width: 140px;text-align: center">
                                {{ record.assessment_before_dislysis.puncture_needle ? record.assessment_before_dislysis.puncture_needle : "/" }}
                                </div>
                            </div>
                            </div>
                        </td>
                        <td colspan="1" style="width:50%;padding:0px 0px 5px">
                            <div style="letter-spacing:5px;text-align:center;font-weight:520;font-size:16px;padding: 0px 8px;line-height: 30px;border-bottom:1px solid #000;">
                            透析后评估
                            </div>
                            <div class="row" style="padding:5px 8px;">
                            <div class="inline_block">
                                T
                                <div class="under_line" style="width: 40px;text-align: center">
                                {{ record.assessment_after_dislysis.temperature ? record.assessment_after_dislysis.temperature : "/" }}
                                </div>
                                °C
                            </div>
                            <div class="inline_block" style="margin-left:5px;">
                                P
                                <div class="under_line" style="width: 50px;text-align: center;">
                                {{ record.assessment_after_dislysis.pulse_frequency ? record.assessment_after_dislysis.pulse_frequency : "/" }}
                                </div>
                                次/分
                            </div>
                            <div class="inline_block" style="margin-left:5px;">
                                R
                                <div class="under_line" style="width: 50px;text-align: center;">
                                {{ record.assessment_after_dislysis.breathing_rate ? record.assessment_after_dislysis.breathing_rate : "/" }}
                                </div>
                                次/分
                            </div>
                            <div class="inline_block" style="margin-left:5px;">
                                BP
                                <div class="under_line" style="width: 70px;text-align: center;">
                                {{ record.assessment_after_dislysis.systolic_blood_pressure ? record.assessment_after_dislysis.systolic_blood_pressure : "" }}/
                                {{ record.assessment_after_dislysis.diastolic_blood_pressure ? record.assessment_after_dislysis.diastolic_blood_pressure : "" }}
                                </div>
                                mmHg
                            </div>
                            </div>
                            <div class="row" style="padding:5px 8px;">
                            <div class="inline_block">
                                凝血：
                                <div class="under_line" style="width: 160px;text-align: center">
                                {{ record.assessment_after_dislysis.cruor ? record.assessment_after_dislysis.cruor : "/" }}
                                </div>
                            </div>
                            <div class="inline_block" style="margin-left:10px;">
                                透后症状：
                                <div class="under_line" style="width: 140px;text-align: center">
                                {{ record.assessment_after_dislysis.symptom_after_dialysis ? record.assessment_after_dislysis.symptom_after_dialysis : "/" }}
                                </div>
                            </div>
                            </div>
                            <div class="row" style="padding:5px 8px;">
                            <div class="inline_block">
                                内瘘：
                                <div class="under_line" style="width: 160px;text-align: center">
                                {{ record.assessment_after_dislysis.internal_fistula ? record.assessment_after_dislysis.internal_fistula : "/" }}
                                </div>
                            </div>
                            <div class="inline_block" style="margin-left:10px;">
                                导管：
                                <div class="under_line" style="width: 140px;text-align: center">
                                {{ record.assessment_after_dislysis.catheter ? record.assessment_after_dislysis.catheter : "/" }}
                                </div>
                            </div>
                            </div>
                            <div class="row" style="padding:5px 8px;">
                            <div class="inline_block">
                                并发症：
                                <div class="under_line" style="width: 145px;text-align: center">
                                {{ record.assessment_after_dislysis.complication ? record.assessment_after_dislysis.complication : "/" }}
                                </div>
                            </div>
                            <div class="inline_block" style="margin-left:10px;">
                                机器运行：
                                <div class="under_line" style="width: 140px;text-align: center">
                                {{ record.assessment_after_dislysis.machine_run ? record.assessment_after_dislysis.machine_run : '/' }}
                                </div>
                            </div>
                            </div>
                            <div class="row" style="padding:5px 8px;">
                            <div class="inline_block">
                                实际超滤量：
                                <div class="under_line" style="width: 60px;text-align: center">
                                {{ record.assessment_after_dislysis.actual_ultrafiltration ? record.assessment_after_dislysis.actual_ultrafiltration : "/" }}
                                </div>
                                L
                            </div>
                            <div class="inline_block" style="margin-left:48px;">
                                透后体重：
                                <div class="under_line" style="width: 50px;text-align: center">
                                {{ record.assessment_after_dislysis.weight_after ? record.assessment_after_dislysis.weight_after : "/" }}
                                </div>
                                kg
                            </div>
                            </div>
                            <div class="row" style="padding:5px 8px;">
                            <div class="inline_block">
                                体重减少：
                                <div class="under_line" style="width: 60px;text-align: center">
                                {{ record.assessment_after_dislysis.weight_loss ? record.assessment_after_dislysis.weight_loss : "/" }}
                                </div>
                                kg
                            </div>
                            <div class="inline_block" style="margin-left:62px;">
                                实际置换量：
                                <div class="under_line" style="width: 50px;text-align: center">
                                {{ record.assessment_after_dislysis.actual_displacement ? record.assessment_after_dislysis.actual_displacement : "/" }}
                                </div>
                                L
                            </div>
                            </div>
                        </td>
                        </tr>
                        <tr>
                        <td colspan="7" style="letter-spacing:5px;text-align:center;font-weight:520;font-size:16px;padding: 0px 8px;line-height: 30px;">
                            透析处方
                        </td>
                        </tr>
                        <tr>
                        <td colspan="7">
                            <div class="row" style="padding: 2px 0;line-height:23px;display:flex;">
                            <div class="inline_block" style="flex:1;">
                                处方脱水量：
                                <div class="under_line" style="width: 50px;text-align: center">
                                {{ record.prescription.target_ultrafiltration ? record.prescription.target_ultrafiltration : "/" }}
                                </div>
                                L
                            </div>
                            <div class="inline_block">
                                透析时长：
                                <div class="under_line" style="width: 50px;text-align: center">
                                {{ record.prescription.dialysis_duration_hour ? record.prescription.dialysis_duration_hour : "0" }}
                                </div>
                                h
                                <div class="under_line" style="width: 50px;text-align: center">
                                {{ record.prescription.dialysis_duration_minute ? record.prescription.dialysis_duration_minute : "0" }}
                                </div>
                                min
                            </div>
                            <div class="inline_block" style="flex:1;margin-left:5px;">
                                透析方式：
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="!record.prescription.mode_id">
                                /
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 1">
                                HD
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 2">
                                HDF
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 3">
                                HD+HP
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 4">
                                HP
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 5">
                                HF
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 6">
                                SCUF
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 7">
                                IUF
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 8">
                                HFHD
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 9">
                                HFHD+HP
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 10">
                                PHF
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 11">
                                HFR
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 12">
                                HDF+HP
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 13">
                                CRRT
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 14">
                                腹水回输
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 15">
                                HD前置换
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 16">
                                HD后置换
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 17">
                                HDF前置换
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 18">
                                HDF后置换
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 19">
                                IUF+HD
                                </div>
                                <div class="under_line" style="width: 150px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 22">
                                血浆胆红素吸附+HDF
                                </div>
                                <div class="under_line" style="width: 150px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 23">
                                血浆胆红素吸附
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 24">
                                  I-HDF
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 25">
                                  HD高通
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 26">
                                  CVVH
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 27">
                                  CVVHD
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 28">
                                  CVVHDF
                                </div>
                                <div class="under_line" style="width: 70px;text-align: center;font-weight:600;" v-if="record.prescription.mode_id == 29">
                                  PE
                                </div>
                            </div>
                            <div class="inline_block" style="flex:1;">
                                置换方式：
                                <div class="under_line" style="width: 60px;text-align: center">
                                {{ getDisplaceLiquiPart(record.prescription.displace_liqui_part) }}
                                </div>
                            </div>
                            <div class="inline_block" style="flex:1;">
                                置换总量：
                                <div class="under_line" style="width: 50px;text-align: center">
                                {{ record.prescription.displace_liqui_value ? record.prescription.displace_liqui_value : "/" }}
                                </div>
                                L
                            </div>
                            </div>
                            <div class="row" style="padding: 2px 0;line-height:23px;display:flex;" v-if="org_id == 10233">
                              <div class="inline_block" style="flex:1">
                                血管通路：
                                <div class="under_line" style="width: 260px;text-align: center;">
                                  {{ QueryPartById(record.assessment_before_dislysis && record.assessment_before_dislysis.blood_access_part_opera_id ? record.assessment_before_dislysis.blood_access_part_opera_id : 0)}}
                                </div>
                              </div>
                              <div class="inline_block" style="flex:1">
                                血管通路部位：
                                <div class="under_line" style="width: 160px;text-align: center;">
                                  {{record.assessment_before_dislysis.blood_access_part_id}}
                                </div>
                              </div>
                            </div>
                            <div class="row" style="padding: 2px 0;line-height:23px;display:flex;">
                              <div class="inline_block" style="flex:1" v-if="org_id != 10233">
                                  血管通路：
                                  <div class="under_line" style="width: 260px;text-align: center;">
                                  <!-- {{record.prescription.blood_access_part_opera_name}} -->
                                  {{ QueryPartById(record.prescription && record.prescription.blood_access ? record.prescription.blood_access : 0) }}
                                  </div>
                              </div>
                              <div class="inline_block" style="flex:1">
                                  透析机型：
                                  <div class="under_line" style="width: 150px;text-align: center;">
                                  {{ record.assessment_before_dislysis.machine_type ? record.assessment_before_dislysis.machine_type : '' }}
                                  </div>
                              </div>
                              <div class="inline_block" style="flex:1">
                                  机号：
                                  <div class="under_line" style="width: 60px;text-align: center;">
                                  {{
                                      record.dialysis_order &&
                                      record.dialysis_order.device_number &&
                                      record.dialysis_order.device_number.number.length >
                                      0
                                      ? record.dialysis_order.device_number.number
                                      : record.device_number.number
                                  }}
                                  </div>
                              </div>
                              <div v-if="org_id == 10233" class="inline_block" style="flex:1;margin-left:10px;">
                                透析器/灌流器：
                                <div class="under_line" style="width: 120px;text-align: center;">
                                  {{ record.prescription.dialyzer_perfusion_apparatus ? record.prescription.dialyzer_perfusion_apparatus : "" }}
                                </div>
                              </div>
                            </div>
                            <div class="row" style="padding: 2px 0;line-height:23px;display:flex;">
                            <div class="inline_block" style="flex:1;">
                                血流量：
                                <div class="under_line" style="width: 50px;text-align: center">
                                {{ record.prescription.blood_flow_volume ? record.prescription.blood_flow_volume : "/" }}
                                </div>
                                ml/min
                            </div>
                            <div class="inline_block" style="flex:1;">
                                抗凝剂
                                <div class="under_line" style="width: 200px;text-align: center">
                                <span v-if="record.prescription.anticoagulant == 0"
                                    >&nbsp;/</span
                                >
                                <span v-if="record.prescription.anticoagulant == 1"
                                    >&nbsp;无肝素</span
                                >
                                <span v-if="record.prescription.anticoagulant == 2"
                                    >&nbsp;普通肝素</span
                                >
                                <span v-if="record.prescription.anticoagulant == 3"
                                    >&nbsp;低分子肝素</span
                                >
                                <span v-if="record.prescription.anticoagulant == 4"
                                    >&nbsp;阿加曲班</span
                                >
                                <span v-if="record.prescription.anticoagulant == 5"
                                    >&nbsp;枸橼酸钠</span
                                >
                                <span v-if="record.prescription.anticoagulant == 6"
                                    >&nbsp;低分子肝素钙</span
                                >
                                <span v-if="record.prescription.anticoagulant == 7"
                                    >&nbsp;低分子肝素钠</span
                                >
                                </div>
                            </div>
                            <div class="inline_block" style="margin-left:20px;" v-if="record.prescription.anticoagulant != 5">
                                首剂：
                                <div class="under_line" style="width: 50px;text-align: center;">
                                {{ record.prescription.anticoagulant_shouji ? record.prescription.anticoagulant_shouji : "/" }}
                                </div>
                                <span v-if="record.prescription.anticoagulant == 2">mg</span>
                                <span v-else>iu</span>
                            </div>
                            <div class="inline_block" style="margin-left:20px;">
                                维持：
                                <div class="under_line" style="width: 50px;text-align: center;">
                                {{ record.prescription.anticoagulant_weichi ? record.prescription.anticoagulant_weichi : "/" }}
                                </div>
                                <span v-if="record.prescription.anticoagulant == 2">mg</span>
                                <span v-else>iu</span>
                            </div>
                            <div class="inline_block" style="margin-left:20px;">
                                总量：
                                <div class="under_line" style="width: 50px;text-align: center;">
                                {{ record.prescription.anticoagulant_zongliang ? record.prescription.anticoagulant_zongliang : "/" }}
                                </div>
                                <span v-if="record.prescription.anticoagulant == 2">mg</span>
                                <span v-else>iu</span>
                            </div>
                            </div>
                            <div class="row" style="padding: 2px 0;line-height:23px;">
                            <div class="inline_block">
                                透析液配方：钾
                                <div class="under_line" style="width: 50px;text-align: center">
                                {{ record.prescription.kalium ? record.prescription.kalium : "/" }}
                                </div>
                                mmol/L
                            </div>
                            <div class="inline_block" style="margin-left:10px;">
                                钠
                                <div class="under_line" style="width: 50px;text-align: center;">
                                {{ record.prescription.sodium ? record.prescription.sodium : "/" }}
                                </div>
                                mmol/L
                            </div>
                            <div class="inline_block" style="margin-left:10px;">
                                钙
                                <div class="under_line" style="width: 50px;text-align: center;">
                                {{ record.prescription.calcium ? record.prescription.calcium : "/" }}
                                </div>
                                mmol/L
                            </div>
                            <div class="inline_block" style="margin-left:10px;">
                                碳酸氢根
                                <div class="under_line" style="width: 50px;text-align: center;">
                                {{ record.prescription.bicarbonate ? record.prescription.bicarbonate : "/" }}
                                </div>
                                mmol/L
                            </div>
                            <div class="inline_block" style="margin-left:10px;">
                                最大超滤率
                                <div class="under_line" style="width: 70px;text-align: center;">
                                {{ record.prescription.max_ultrafiltration_rate ? record.prescription.max_ultrafiltration_rate : "/" }}
                                </div>
                                ml/h
                            </div>
                            </div>
                        </td>
                        </tr>
                        <tr>
                        <td style="padding: 0; position: relative;" colspan="2">
                            <table class="inside_table">
                            <tbody>
                                <tr style="line-height:35px;padding:8px 5px;">
                                <td colspan="7" style="letter-spacing:5px;text-align:center;font-weight:520;font-size:16px;padding: 0px 8px;line-height: 30px;">
                                    医嘱内容
                                </td>
                                </tr>
                                <tr style="line-height:30px;padding:0 5px;">
                                <td style="font-size: 16px" width="10%">时间</td>
                                <td style="font-size: 16px" colspan="2" width="45%">医嘱内容</td>
                                <td style="font-size: 16px" width="10%">医生签名</td>
                                <td style="font-size: 16px" width="10%">执行时间</td>
                                <td style="font-size: 16px" width="10%">执行人员</td>
                                <td style="font-size: 16px" width="10%">核对人员</td>
                                </tr>

                                <tr v-for="(advice, advice_index) in record.advices" :key="advice_index">
                                <td height="30px" style="padding:4px 5px;">
                                    <span v-if="advice[0].start_time">
                                        {{ getTime(advice[0].start_time, "{h}:{i}") }}
                                    </span>
                                </td>
                                <td height="30px" colspan="2" class="advice-name" style="padding:4px 5px;">
                                    <span v-for="(item,index) in advice" :key="index">
                                      <!-- <span v-if="item.children.length > 0"> -->
                                          <span v-if="item.parent_id > 0">---></span>
                                          <span v-if="item.advice_name">&nbsp;&nbsp;&nbsp;&nbsp;{{ item.advice_name }}</span>
                                          <span v-if="item && item.advice_desc">({{ item.advice_desc }}{{ item.drug_spec_unit }})</span>
                                          <span v-if="item.prescribing_number">&nbsp;&nbsp; {{ item.prescribing_number }}{{ item.prescribing_number_unit }}</span>
                                          <span v-if="item.single_dose != 0">{{ item.single_dose }}{{ item.single_dose_unit }}</span>
                                          <span v-if="item.parent_id == 0">{{ item.delivery_way }}</span>
                                          <span v-if="item.parent_id == 0">{{ item.execution_frequency }}</span>
                                          <span v-if="item.parent_id == 0 && item.remark.length > 0">({{ item.remark }})</span>
                                          <span v-if="item.children && !Array.isArray(item)" style="display:block;border-top: 1px solid #000;" v-for="(child, childindex) in item.children" :key="childindex" class="advice-children">
                                              <span style="padding-left: 20px !important;">---></span>
                                              <span>
                                              <span>{{ child.advice_name }}</span>
                                              <span v-if="child.advice_desc">{{ child.advice_desc }}{{ child.drug_spec_unit }}</span>
                                              <span v-if="child.prescribing_number">* {{ child.prescribing_number }}{{ child.prescribing_number_unit }}</span>
                                              <span v-if="child.single_dose != 0">单次用量 {{ child.single_dose }}{{ child.single_dose_unit }}</span>
                                              </span>
                                          </span>
                                      <!-- </span> -->
                                  </span>
                                </td>
                                
                                <td height="30px" style="padding:4px 5px;">
                                    <span v-if="setAdminUserES(advice[0], 'advice_doctor') == ''">
                                        {{getAdminUser(advice[0], 'advice_doctor')}}
                                    </span>
                                    <span v-else style="display:flex;align-items:center;justify-content:space-around;height:36px;">
                                        <img style="height:30px;" :src="setAdminUserES(advice[0], 'advice_doctor')" alt srcset />
                                    </span>
                                </td>
                                
                                <td height="30px" style="padding:4px 5px;">
                                    <span v-if="advice[0].execution_time">{{ getTime(advice[0].execution_time, "{h}:{i}") }}</span>
                                </td>
                                <td height="30px" style="padding:4px 5px;">
                                    <span v-if="setAdminUserES(advice[0], 'execution_staff') == ''">
                                        {{getAdminUser(advice[0], 'execution_staff')}}
                                    </span>
                                    <span v-else>
                                        <img style="height:30px;" :src="setAdminUserES(advice[0], 'execution_staff')" alt srcset />
                                    </span>
                                </td>
                                <td height="30px" style="padding:4px 5px;">
                                    <span v-if="setAdminUserES(advice[0], 'checker') == ''">{{ getAdminUser(advice[0], "checker") }}</span>
                                    <span v-else>
                                      <img class="es-img" :src="setAdminUserES(advice[0], 'checker')" alt="" srcset="" style="height: 30px;" />
                                    </span>
                                </td>
                                </tr>
                            </tbody>
                            </table>
                        </td>
                        </tr>
                        
                        <tr>
                        <td style="padding: 0; position: relative;" colspan="2">
                            <table class="inside_table">
                            <tbody>
                                <tr>
                                <td colspan="11" style="letter-spacing:5px;text-align:center;font-weight:520;font-size:16px;padding: 0px 8px;line-height: 30px;">
                                    监测记录
                                </td>
                                </tr>
                                <tr>
                                <td width="60">时间</td>
                                <td width="40">体温<br />°C</td>
                                <td width="50">血流量<br />(ml/min)</td>
                                <td width="90">静脉压(mmHg)/<br />跨膜压(mmHg)</td>
                                <td width="80">超滤率(ml/h)/<br />超滤量(ml)</td>
                                <td width="80">钠浓度(ml/h)/<br />温度(°C)</td>
                                <td width="50">脉搏<br />(次/分)</td>
                                <td width="60">血压<br />(mmHg)</td>
                                <td width="50">血容量</td>
                                <td width="50">签名</td>
                                <td width="200">病情变化及处理</td>
                                </tr>

                                <tr v-for="(monitor, monindex) in record.monitor_records" :key="monindex">
                                <td style="padding:1px 5px;" height="30px">{{ getTime(monitor.operate_time, "{h}:{i}") }}</td>
                                <td style="padding:1px 5px;">{{ monitor.temperature ? monitor.temperature : '' }}</td>
                                <td style="padding:1px 5px;">{{ monitor.blood_flow_volume ? monitor.blood_flow_volume : "" }}
                                <td style="padding:1px 5px;"><span v-if="getTime(monitor.operate_time, '{h}:{i}')">{{ monitor.venous_pressure ? monitor.venous_pressure : "" }}/{{ monitor.transmembrane_pressure ? monitor.transmembrane_pressure : "" }}</span></td>
                                <td style="padding:1px 5px;"><span v-if="getTime(monitor.operate_time, '{h}:{i}')">{{ monitor.ultrafiltration_rate ? monitor.ultrafiltration_rate : "" }}/{{ monitor.ultrafiltration_volume ? monitor.ultrafiltration_volume : "" }}</span></td>
                                <td style="padding:1px 5px;"><span v-if="getTime(monitor.operate_time, '{h}:{i}')">{{ monitor.sodium_concentration ? monitor.sodium_concentration : "" }}/{{ monitor.dialysate_temperature ? monitor.dialysate_temperature : "" }}</span></td>
                                <td style="padding:1px 5px;">{{ monitor.pulse_frequency ? monitor.pulse_frequency : "" }}</td>
                                <td style="padding:1px 5px;">
                                    {{ monitor.systolic_blood_pressure ? monitor.systolic_blood_pressure + "/" : "" }}
                                    {{ monitor.diastolic_blood_pressure ? monitor.diastolic_blood_pressure : "" }}
                                </td>
                                <td style="padding:1px 5px;">{{ monitor.accumulated_blood_volume ? monitor.accumulated_blood_volume : '' }}</td>
                                <td style="padding:1px 5px;" height="30px">
                                    <span v-if="setAdminUserES(monitor, 'monitoring_nurse') == ''">
                                        {{ getAdminUser(monitor, 'monitoring_nurse') }}
                                    </span>
                                    <span v-else style="display:flex;align-items:center;justify-content:space-around;height:36px;">
                                        <img style="height:30px;" :src="setAdminUserES(monitor, 'monitoring_nurse')" alt srcset />
                                    </span>
                                </td>
                                <td style="line-height:16px;padding:0px;">
                                    <div style="min-height:20px;line-height:20px; overflow:hidden;">
                                    <span v-if="getTime(monitor.operate_time, '{h}:{i}')" style="word-break: break-all;margin:0;line-height:16px;-webkit-line-clamp:3;overflow:visible;display:inline-block;vertical-align:middle;height:auto;">
                                        <template v-if="(record.dialysis_order && monitor.operate_time == record.dialysis_order.start_time)">【开始透析】<span v-if="org_id != 10233"> 引血100ml/min</span></template>
                                        <span v-if="record.dialysis_order && monitor.operate_time == record.dialysis_order.end_time">【结束透析】<span v-if="org_id != 10233"> 回血100ml/min</span></span> 
                                        {{ monitor.symptom }} &nbsp;{{ monitor.dispose }} &nbsp;{{ monitor.result }}
                                    </span>
                                    </div>
                                </td>
                                </tr>
                                <tr>
                                <td colspan="11" style="line-height:25px;text-align:left;">
                                    医师记录：{{ record.summer ? record.summer.special_record : '' }}
                                </td>
                                </tr>
                            </tbody>
                            </table>
                        </td>
                        </tr>
                        <tr>
                        <td colspan="7" style="letter-spacing:5px;text-align:center;font-weight:520;font-size:16px;padding: 0px 8px;line-height: 30px;">
                            治疗小结
                        </td>
                        </tr>
                        <tr>
                        <td colspan="7">
                            <div class="row" style="padding: 2px 0;line-height:23px;display:flex;">
                            <div class="inline_block">
                                实际治疗时间：
                                <div class="under_line" style="width: 30px;text-align: center">
                                {{ record.assessment_after_dislysis.actual_treatment_hour ? record.assessment_after_dislysis.actual_treatment_hour : "/" }}
                                </div>
                                h
                                <div class="under_line" style="width: 30px;text-align: center">
                                {{ record.assessment_after_dislysis.actual_treatment_minute ? record.assessment_after_dislysis.actual_treatment_minute : 0 }}
                                </div>
                                min
                            </div>
                            </div>
                            <div class="row" style="padding: 2px 0;line-height:23px;display:flex;">
                            <div class="inline_block" style="flex:1">
                                <span>治疗小结：</span>
                                <div class="under_line" style="width: 90%;text-align: left;white-space: initial;">
                                {{  record.summer ? record.summer.dialysis_summary : "/" }}
                                </div>
                            </div>
                            </div>
                            <div class="row" style="padding: 2px 0;line-height:23px;display:flex;">
                            <div class="inline_block" style="flex:1;">
                                透后宣教：
                                <div class="under_line" style="width: 90%;text-align: left;white-space: initial;">
                                {{ record.summer ? record.summer.mission : '' }}
                                </div>
                            </div>
                            </div>
                        </td>
                        </tr>
                        <tr>
                        <td colspan="7">
                            <div class="row" style="padding: 2px 0;line-height:23px;display:flex;">
                            <div class="inline_block" style="flex:1;display: flex;align-items: center;">
                                上机护士：
                                <div class="under_line" style="width: 80px;text-align: center">
                                    <span style="display: inline-block;height: 36px;line-height: 36px;" v-if="setAdminUserES(record.dialysis_order, 'start_nurse') == ''">{{getAdminUser(record.dialysis_order, 'start_nurse')}}</span>
                                    <span v-else>
                                        <img class="es-img" style="height:30px;" :src="setAdminUserES(record.dialysis_order, 'start_nurse')" />
                                    </span>
                                </div>
                            </div>
                            <div class="inline_block" style="flex:1;display: flex;align-items: center;">
                                核对人员：
                                <div class="under_line" style="width: 80px;text-align: center">
                                    <span v-if="record.check != null ? record.dialysis_order.start_nurse != record.check.modifier : false">
                                        <span style="display: inline-block;height: 36px;line-height: 36px;" v-if="setAdminUserES(record.check, record.check == null ? 0 : 'modifier') == ''">
                                        {{ getAdminUser(record.check, record.check == null ? 0 : 'modifier') }}
                                        </span>
                                        <img style="height:30px;" :src="setAdminUserES(record.check, record.check == null ? 0 : 'modifier')" alt srcset v-else />
                                    </span>
                                    <span v-else>
                                        <span style="display: inline-block;height: 36px;line-height: 36px;" v-if="setAdminUserES(record.check, record.check == null ? 0 : 'creater') == ''">
                                        {{ getAdminUser(record.check, "creater") }}
                                        </span>
                                        <img style="height:30px;" :src="setAdminUserES(record.check, record.check == null ? 0 : 'creater')" alt srcset v-else />
                                    </span>
                                </div>
                            </div>
                            <div class="inline_block" style="flex:1;display: flex;align-items: center;">
                                下机护士：
                                <div class="under_line" style="width: 80px;text-align: center">
                                    <span style="display: inline-block;height: 36px;line-height: 36px;" v-if="setAdminUserES(record.dialysis_order, 'finish_nurse') == ''">{{getAdminUser(record.dialysis_order, 'finish_nurse')}}</span>
                                    <span v-else>
                                        <img class="es-img" style="height:30px;" :src="setAdminUserES(record.dialysis_order, 'finish_nurse')" />
                                    </span>
                                </div>
                            </div>
                            <div class="inline_block" style="flex:1;display: flex;align-items: center;">
                                治疗医生：
                                <div class="under_line" style="width: 80px;text-align: center">
                                    <span style="display: inline-block;height: 36px;line-height: 36px;" v-if="setAdminUserES(record.prescription, 'creater') == ''">{{getAdminUser(record.prescription, 'creater')}}</span>
                                    <img class="es-img" :src="setAdminUserES(record.prescription, 'creater')" alt="" srcset="" v-else style="height: 30px;">
                                </div>
                            </div>
                            </div>
                        </td>
                        </tr>
                    </tbody>
                    </table>
                </div>
                </div>
          </div>
          <!-- <div style="page-break-after:always"></div> -->
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import CheckBox from './option_check_box'
import LabelBox from '../printItem/LabelBox'
import {
  GetBatchPrintDialysisData,
  getLastAfterWeight
} from '@/api/print_data'
import { jsGetAge, uParseTime } from '@/utils/tools'
import { getDataConfig } from '@/utils/data'
import BreadCrumb from '@/xt_pages/components/bread-crumb'
import print from 'print-js'
export default {
  name: 'BatchPrintOrderSeven',
  components: {
    CheckBox,
    BreadCrumb,
    LabelBox
  },
  data() {
    return {
      crumbs: [
        { path: false, name: '透析管理' },
        { path: false, name: '批量打印' }
      ],
      records: [
        // 模拟有多条数据
        // {
        //     monitor_records: [ {},{},{},{},{},{},{},{},{},{},{}, ],
        //     advices: [ {},{},{},{},{},{},{}, ],
        // },
        // {
        //     monitor_records: [],
        //     advices: [],
        // },
      ],
      queryParams: {
        xtdate: '',
        xtno: ''
      },
      loading: false,
      orgname: '',
      bloodAccessParOpera: {},
      anticoagulantsConfit: {},
      dialysateFormulationOptions: {},
      operatorMaps: {},
      operators: [],
      adminUser: [],
      adminSign: [],
      doctor_advices: [],
      monitor_records: [],
      advice_groups: [],
      advice_groups_2: [],
      blood_access_part: [],
      posture_arr: [],
      complications: [
        '低血压',
        '高血压',
        '心律失常',
        '头晕',
        '头痛',
        '呕吐',
        '抽搐',
        '出血',
        '心衰',
        '腹痛'
      ],
      allName: [],
      NameStatus: 0,
      advices: [],
      docotorId: '',
      lastAfterWeight: '',
      appetite_arr: [],
      precaution_arr: [],
      showOne: false,
      showTwo: false,
      arr:[],
      arrtwo:[],
      bloodAccess: [],
      displaceLiquiPartOptions:[]
    }
  },
  created() {
    var xtuser = this.$store.getters.xt_user
    // console.log('xtuser', xtuser)
    this.orgname = xtuser.org.org_name
    this.org_id = this.$store.getters.xt_user.org.id
    //   this.orgname = "遂溪方济医院";
    this.modeOptions = this.$store.getters.treatment_mode
    //   this.replacementWays = this.$store.getters.replacement_ways;
    //   this.perfusionApparatus = this.$store.getters.perfusion_apparatus;
    this.anticoagulantsConfit = this.$store.getters.anticoagulants_confit
    this.displaceLiquiPartOptions = this.$store.getters.displace_liqui;
    this.posture_arr = getDataConfig('hemodialysis', 'posture')
    var bloodAccessParOpera = getDataConfig(
      'hemodialysis',
      'vascular_access_desc'
    )
    console.log("血管通路",bloodAccessParOpera)
    for (var key in bloodAccessParOpera) {
      this.bloodAccessParOpera[bloodAccessParOpera[key].id] =
        bloodAccessParOpera[key]
    }
    console.log(this.bloodAccessParOpera)

    
     var arr = [];
    var arrtwo = [];
    for (let i = 0; i < bloodAccessParOpera.length; i++) {
      // if (bloodAccessParOpera[i].name == "内瘘波动及震颤-存在") {
      //   bloodAccessParOpera[i].name = "存在";
      //   arr.push(bloodAccessParOpera[i]);
      // }
      // if (bloodAccessParOpera[i].name == "内瘘波动及震颤-减弱") {
      //   bloodAccessParOpera[i].name = "减弱";
      //   arr.push(bloodAccessParOpera[i]);
      // }
      // if (bloodAccessParOpera[i].name == "内瘘波动及震颤-消失") {
      //   bloodAccessParOpera[i].name = "消失";
      //   arr.push(bloodAccessParOpera[i]);
      // }
      if (bloodAccessParOpera[i].name == "直穿") {
        arrtwo.push(bloodAccessParOpera[i]);
      }
      if (bloodAccessParOpera[i].name == "人造血管") {
        arrtwo.push(bloodAccessParOpera[i]);
      }
      if (bloodAccessParOpera[i].name == "移植血管") {
        arrtwo.push(bloodAccessParOpera[i]);
      }
      this.arr = arr;
      this.arrtwo = arrtwo;

      
    this.blood_access_part = getDataConfig('hemodialysis', 'vascular_access')

    var dialysateFormulationOptions = getDataConfig(
      'hemodialysis',
      'dialysate_formulation'
    )
    for (var key in dialysateFormulationOptions) {
      this.dialysateFormulationOptions[dialysateFormulationOptions[key].id] =
        dialysateFormulationOptions[key]
    }
    this.appetite_arr = getDataConfig('hemodialysis', 'appetite')
    this.precaution_arr = getDataConfig('hemodialysis', 'precaution')
    var bloodAccess = getDataConfig("hemodialysis", "vascular_access");
    this.bloodAccess = bloodAccess;
   }
  },
  mounted() {
    this.loading = true
    var ids = this.$store.getters.temp_params.batch_print_dialysis_record_ids
    console.log("ids",ids)
    if (ids.length == 0) {
      this.$router.back(-1)
      return
    }
    GetBatchPrintDialysisData(ids.join(','))
      .then(rs => {
        var resp = rs.data
        if (resp.state == 1) {
          this.org_template_info = resp.data.templateInfo

          this.records = this.records.concat(resp.data.schedules)

          console.log('记录', this.records)

          for (const recordIndex in this.records) {
            var dlegh = 0
            if (
              this.records[recordIndex].monitor_records &&
              this.records[recordIndex].monitor_records.length < 5
            ) {
              dlegh = 5 - this.records[recordIndex].monitor_records.length
            } else {
              dlegh = 0
            }
            if (dlegh > 0) {
              if (
                typeof this.records[recordIndex].monitor_records ===
                  'undefined' ||
                this.records[recordIndex].monitor_records == null
              ) {
                this.records[recordIndex].monitor_records = []
              }
              for (let index = 0; index < dlegh; index++) {
                this.records[recordIndex].monitor_records.push([])
              }
            }

            this.records[recordIndex].isShowZero = false
            if (this.records[recordIndex].patient.user_org_id == 9535) {
              this.records[recordIndex].isShowZero = true
            }

            var delghTwo = 0
            if (this.records[recordIndex].advices && this.records[recordIndex].advices.length < 12) {
              delghTwo = 12 - this.records[recordIndex].advices.length
            } else {
              delghTwo = 0
            }

            if (delghTwo > 0) {
              if (typeof this.records[recordIndex].advices === 'undefined' || this.records[recordIndex].advices == null) {
                this.records[recordIndex].advices = []
              }
              for (let index = 0; index < delghTwo; index++) {
                this.records[recordIndex].advices.push([])
              }
            }

            var childMap = {}
            for (const index in this.records[recordIndex].advices) {
              if (this.records[recordIndex].advices[index].parent_id == 0) {
                continue
              }
              if (
                !(
                  this.records[recordIndex].advices[index].parent_id in childMap
                )
              ) {
                childMap[
                  this.records[recordIndex].advices[index].parent_id
                ] = []
              }
              childMap[this.records[recordIndex].advices[index].parent_id].push(
                this.records[recordIndex].advices[index]
              )
            }

            var advices = []
            for (const index in this.records[recordIndex].advices) {
              if (this.records[recordIndex].advices[index].parent_id > 0) {
                continue
              }
              var item = this.records[recordIndex].advices[index]
              if (item.id in childMap) {
                item.children = childMap[item.id]
              } else {
                item.children = []
              }
              advices.push(item)
            }

            var leftAdvice = []
            var rightAdvice = []
            var adlen = advices.length

            var halfLen = adlen % 2 == 0 ? adlen / 2 : (adlen + 1) / 2
            for (var i = 0; i < halfLen; i++) {
              leftAdvice.push(advices[i])
              var rightIndex = i + halfLen
              rightAdvice.push(
                rightIndex in advices ? advices[i + halfLen] : []
              )
            }
            if (halfLen < 5) {
              var nl = 5 - leftAdvice.length
              for (let index = 0; index < nl; index++) {
                leftAdvice.push([])
              }
              var nl = 5 - rightAdvice.length
              for (let index = 0; index < nl; index++) {
                rightAdvice.push([])
              }
            }

            this.records[recordIndex].advices = []
            for (var i = 0; i < halfLen; i++) {
              var item = []
              item.push(leftAdvice[i])
              item.push(rightAdvice[i])
              this.records[recordIndex].advices.push(item)
            }
          }

          console.log(' this.records[recordIndex].advices', this.records)
          this.operators = resp.data.medical_staffs
          if (this.operators.length > 0) {
            var operatorsLen = this.operators.length
            for (var index = 0; index < operatorsLen; index++) {
              this.$set(
                this.operatorMaps,
                this.operators[index].id,
                this.operators[index]
              )
            }
          }

          this.adminUser = resp.data.users
          console.log('adminUser', this.adminUser)
          var name = resp.data.name
          this.adminSign = name
          console.log('name是', name)
          this.loading = false
        } else {
          this.loading = false
          this.$message.error(resp.msg)
        }
      })
      .catch(err => {
        this.$message.error(err)
      })
  },
  methods: {
    getDisplaceLiquiPart: function(val) {
       // console.log(val)
        let displace_liqui_part_name = "/";
        const displace_liqui_part = this.displaceLiquiPartOptions;
       // console.log("置换方式",displace_liqui_part)
        for (let i = 0; i < displace_liqui_part.length; i++) {
           if (displace_liqui_part[i].id == val) {
           displace_liqui_part_name = displace_liqui_part[i].name;
        }
      }
      return displace_liqui_part_name;
    },
    getNewAge(UUserCard) {
      if (UUserCard != null && UUserCard != '') {
        // 获取年龄
        var myDate = new Date()
        var month = myDate.getMonth() + 1
        var day = myDate.getDate()
        var age = myDate.getFullYear() - UUserCard.substring(6, 10) - 1
        if (UUserCard.substring(10, 12) < month || UUserCard.substring(10, 12) == month && UUserCard.substring(12, 14) <= day) {
          age++
        }
        return age
      }
    },
    getUnit: function(val) {
      if (val.assessment_after_dislysis == null) {
        return ''
      } else if (val.assessment_after_dislysis != null) {
        switch (val.assessment_after_dislysis.dialysis_intakes_unit) {
          case 1:
            return 'g'
            break
          case 2:
            return 'ml'
            break
        }
      }
    },
    QueryPartById: function(val) {
      let vascular_access_part_name = '/'
      const vascular_access = getDataConfig('hemodialysis', 'vascular_access_desc')
      for (let i = 0; i < vascular_access.length; i++) {
        if (vascular_access[i].id == val) {
          vascular_access_part_name = vascular_access[i].name
        }
      }
      return vascular_access_part_name
    },
    printThisPage() {
      var ptime = Math.round(new Date().getTime() / 1000)
      this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')

      const style =
        '@media print {.dialysis-print-order{width:960px;margin:0 auto}.dialysis-print-order .order-yy-name{margin:auto;text-align:center;font-size:20px;letter-spacing:5px}.dialysis-print-order .order-title{margin:auto;font-weight:600;text-align:center;font-size:22px;padding:10px 20px 20px 20px}.dialysis-print-order .table-box{width:100%;line-height:23px;font-size:14px}.dialysis-print-order .print-table{width:100%;text-align:center;border-collapse:collapse;line-height:25px;font-size:14px}.dialysis-print-order .print-table-no{width:100%;text-align:center;border-collapse:collapse;font-size:14px}.dialysis-print-order .under-line{border-bottom:1px solid #999;width:95%;text-align:center;margin-left:2px}.dialysis-print-order .title-box{text-align:center;font-size:16px;border:1px solid #666}.dialysis-print-order .radio-lebel-box{font-weight:400;cursor:pointer}.dialysis-print-order .radio-no{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.dialysis-print-order .radio-inner{white-space:nowrap;cursor:pointer;outline:0;display:inline-block;line-height:1;position:relative;vertical-align:middle}.dialysis-print-order .radio-fang{display:inline-block;position:relative;border:1px solid #000;box-sizing:border-box;width:14px;height:14px;background-color:#fff;z-index:1;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.dialysis-print-order .is-checked-radio::after{content:"√";font-size:15px}}.dialysis-print-order .print-table-no tr td { padding: 8px 5px; line-height: 25px; }.es-img{height: 20px; }.advice-name{text-align: left;}.advice-children{display:flex;} .dialysis-print-order .print-table tr td{padding: 0px 0px;} .print-template-two tr {line-height: 30px;}   .title-box-pro{border: 0 #fff;line-height: 40px;height: 40px;text-align: left;padding-left: 10px !important;}  .text-align-left{text-align: left !important;padding-left:10px !important;font-size: 14px !important;line-height: 25px;}'
      const style2 =
        '@media print {.option_panel { margin: 0 5px 0 0; } .option_panel .check_box_panel { white-space: nowrap; outline: none; display: inline-block; line-height: 1; position: relative; vertical-align: middle; } .dialysis-print-order .order-title{margin:auto;font-weight:600;text-align:center;font-size:22px;padding:10px}.option_panel .check_box_panel .check_box { display: inline-block; position: relative; border: 1px solid #000; box-sizing: border-box; width: 14px; height: 12px; background-color: #fff; } .check_box_panel .did_checked::after { content: "√"; font-size: 15px; } .print_page_main_content {background-color: white;width: 960px;margin: 0 auto 50px;padding: 0 0 0 0; page-break-after: always;}.print_page_main_content .order-yy-name {margin: auto;text-align: center;font-size: 20px;letter-spacing: 5px;}.print_page_main_content .order_title {text-align: center;font-size: 23px; line-height: 50px;font-weight: 500;} .row {font-size: 14px;line-height: 20px;padding: 5px 0;}.inline_block { display: inline-block;}.under_line_two {display: inline-block;border-bottom: 1px solid #999;text-align: left;white-space: nowrap;width: 50%;}.under_line {display: inline-block;border-bottom: 1px solid #999;text-align: center;white-space: nowrap; width: 50%;}.flex {display: -webkit-box;display: -moz-box; display: -ms-flexbox; display: -webkit-flex;display: flex;align-items: center;-webkit-align-items: center;box-align: center;-moz-box-align: center;-webkit-box-align: center;text-align: center;-webkit-justify-content: space-between;justify-content: space-between;-moz-box-pack: space-between;-webkit--moz-box-pack: space-between;box-pack: space-between;}.print_page_main_content .proj_table {width: 100%;border: 1px solid;border-collapse: collapse;padding: 2px;}.print_page_main_content .proj_table tbody tr td {border: 1px solid;font-size: 16px;padding: 3px 8px;line-height: 30px;}.print_page_main_content .proj_table .inside_table {width: 100%;border: hidden; border-collapse: collapse;}.print_page_main_content .proj_table .inside_table tr td {border: 1px solid; text-align: center;font-size: 14px;padding: 6px 5px;line-height: 16px;}.print-table-no {width: 100%;text-align: center;border-collapse: collapse;font-size: 14px;}.es-img {height: 30px;}.advice-name {text-align: left !important;line-height: 16px !important;}.advice-children {display: flex;}}.margin-bottom-50{margin-bottom:50px;}.margin-bottom-300 {margin-bottom:450px;}.margin-bottom-600 {margin-bottom:600px;}.margin-bottom-900 {margin-bottom:900px;}.print-yema{ position: absolute;top: 920px;left: 50%;} .print-yema2{ position: absolute;top: 400px;left: 50%;}.print-yema3{position: absolute;top: 1230px;left: 50%;}.print-yema4{position: absolute;top: 1370px;left: 50%;}.check_box{width:15px !important;height:15px !important;}.did_checke::after {font-size: 8px;margin-left: 2px;margin-top: 12px !important;position: absolute;}'
      const style9 =
        '@media print {#dialysis-print-box-1{margin:0 auto;}.dialysis-print-order{width:920px;margin:0 10px;font-size:10px;}.option_panel { margin: 0 5px 0 0; } .option_panel .check_box_panel { white-space: nowrap; outline: none; display: inline-block; line-height: 1; position: relative; vertical-align: middle; } .dialysis-print-order .order-title{margin:auto;font-weight:600;text-align:center;font-size:22px;padding:10px}.option_panel .check_box_panel .check_box { display: inline-block; position: relative; border: 1px solid #000; box-sizing: border-box; width: 14px; height: 12px; background-color: #fff; } .check_box_panel .did_checked::after { content: "√"; font-size: 15px; } .print_page_main_content {background-color: white;width: 940px;margin: 0 auto 50px;padding: 0 0 0 0; page-break-after: always;}.print_page_main_content .order-yy-name {margin: auto;text-align: center;font-size: 20px;letter-spacing: 5px;}.print_page_main_content .order_title {text-align: center;font-size: 23px; line-height: 50px;font-weight: 500;} .row {font-size: 14px;line-height: 20px;padding: 5px 0;}.inline_block { display: inline-block;}.under_line_two {display: inline-block;border-bottom: 1px solid #999;text-align: left;white-space: nowrap;width: 50%;}.under_line {display: inline-block;border-bottom: 1px solid #999;text-align: center;white-space: nowrap; width: 50%;}.flex {display: -webkit-box;display: -moz-box; display: -ms-flexbox; display: -webkit-flex;display: flex;align-items: center;-webkit-align-items: center;box-align: center;-moz-box-align: center;-webkit-box-align: center;text-align: center;-webkit-justify-content: space-between;justify-content: space-between;-moz-box-pack: space-between;-webkit--moz-box-pack: space-between;box-pack: space-between;}.print_page_main_content .proj_table {width: 100%;border: 1px solid;border-collapse: collapse;padding: 2px;}.print_page_main_content .proj_table tbody tr td {border: 1px solid;font-size: 16px;padding: 3px 8px;line-height: 30px;}.print_page_main_content .proj_table .inside_table {width: 100%;border: hidden; border-collapse: collapse;}.print_page_main_content .proj_table .inside_table tr td {border: 1px solid; text-align: center;font-size: 14px;padding: 6px 5px;line-height: 16px;}.print-table-no {width: 100%;text-align: center;border-collapse: collapse;font-size: 14px;}.es-img {height: 30px;}.advice-name {text-align: left !important;line-height: 16px !important;}.advice-children {display: flex;}}.margin-bottom-50{margin-bottom:50px;}.margin-bottom-300 {margin-bottom:450px;}.margin-bottom-600 {margin-bottom:600px;}.margin-bottom-900 {margin-bottom:900px;}.print-yema{ position: absolute;top: 920px;left: 50%;} .print-yema2{ position: absolute;top: 400px;left: 50%;}.print-yema3{position: absolute;top: 1230px;left: 50%;}.print-yema4{position: absolute;top: 1050px;left: 50%;}.check_box{width:15px !important;height:15px !important;}.did_checke::after {font-size: 8px;margin-left: 2px;margin-top: 12px !important;position: absolute;}.table-box1 {border: 1px solid #000;width: 100%;line-height: 30px;font-size: 14px;border-collapse: collapse;} @page {margin-top:5px;}.table-box1 tr {border-bottom: 1px solid #000;}';
      printJS({
        printable: 'print_content',
        type: 'html',
        documentTitle: '  ',
        style: style9,
        scanStyles: false
      })
    },

    complicationsOther: function(record) {
      if (record == null || typeof record === 'undefined') {
        return ''
      }
      if (record.complication.length == 0) {
        return ''
      }
      var complications = record.complication.split(',')
      var complicationOthers = []
      for (const index in complications) {
        if (
          this.complications.indexOf(complications[index]) < 0 &&
          complicationOthers.indexOf(complications[index]) < 0
        ) {
          complicationOthers.push(complications[index])
        }
      }
      return complicationOthers.join(',')
    },
    modeName(mode_id) {
      if (mode_id in this.modeOptions) {
        return this.modeOptions[mode_id].name
      }
      return ''
    },
    anticoagulantName: function(key) {
      if (key == null || typeof key === 'undefined') {
        return ''
      }
      var id = key.anticoagulant
      if (id in this.anticoagulantsConfit) {
        return this.anticoagulantsConfit[id].name
      }
      return ''
    },
    bloodAccessParOperaName(id) {
      if (id in this.bloodAccessParOpera) {
        return this.bloodAccessParOpera[id].name
      }
      return ''
    },
    isBbloodAccessParOperaCheck(key, value) {
      if (key == null || typeof key === 'undefined') {
        return false
      }
      var id = key.blood_access_part_opera_id
      if (id in this.bloodAccessParOpera) {
        return this.bloodAccessParOpera[id].name.indexOf(value) > -1
      }
      return false
    },
    isdialysateFormulatioCheck(key, value) {
      if (key == null || typeof key === 'undefined') {
        return false
      }
      var id = key.dialysate_formulation
      if (id in this.dialysateFormulationOptions) {
        return this.dialysateFormulationOptions[id].name.indexOf(value) > -1
      }
      return false
    },
    isValueIndexOfCheck: function(record, key, value) {
      if (record == null || record == undefined) {
        return false
      } else {
        return record[key].indexOf(value) > -1
      }
    },
    setAdminUserES(key, id) {
      if (
        typeof key === 'undefined' ||
        key == null ||
        typeof key[id] === 'undefined'
      ) {
        return ''
      }
      if (key[id] == 0) {
        return ''
      }
      if (key[id] in this.operatorMaps) {
        return this.operatorMaps[key[id]].es_url
      } else {
        return ''
      }
    },
    getFloat: function(x) {
      if (x != '.') {
        var f = Math.round(x * 100) / 100
        var s = f.toString()
        var rs = s.indexOf('.')
        if (rs <= 0) {
          rs = s.length
          s += '.'
        }
        while (s.length <= rs + 1) {
          s += '0'
        }
        return s
      } else {
        return '0.0'
      }
    },
    getAdminUser(key, id) {
      if (
        typeof key === 'undefined' ||
        key == null ||
        typeof key[id] === 'undefined'
      ) {
        return ''
      }
      if (key[id] === 0) {
        return ''
      }
      if (key[id] === undefined) {
        return ''
      }
      for (let i = 0; i < this.adminUser.length; i++) {
        if (this.adminUser[i].id === key[id]) {
          return this.adminUser[i].name
        }
      }
    },

    getName(id) {
      for (let i = 0; i < this.adminSign.length; i++) {
        if (this.adminSign[i].id === id) {
          if (this.adminSign[i].url === '') {
            this.showOne = true
            this.showTwo = false
            return this.adminSign[i].name
          } else {
            this.showOne = false
            this.showTwo = true
            return this.adminSign[i].url
          }
        }
      }
    },
    jsGetAge: function(agetime) {
      if (agetime === 0) {
        return ''
      }
      return jsGetAge(uParseTime(agetime, '{y}-{m}-{d}'), '-')
    },
    getTime(value, temp) {
      if (value != undefined) {
        return uParseTime(value, temp)
      }
      return ''
    },
    // 函数说明：因为一次透析记录有些记录不一定是必须填的，比如 record.receive_assessment 可能为 null，所以要取 record.receive_assessment.way 前需要判断 record.receive_assessment 是否为 null，所以这个方法用来简化模板渲染的代码
    // 参数说明：比如判断 record.receive_assessment.way 是不是为1，参数为 (record.receive_assessment, way, 1)
    isCheckBoxChecked: function(record, key, target_value) {
      if (record == null || record == undefined) {
        return false
      } else {
        return record[key] == target_value
      }
    },
    getAge: function(val) {
      if (val.age == 0) {
        if (val.birthday == 0) {
          return ''
        }
        return jsGetAge(uParseTime(val.birthday, '{y}-{m}-{d}'), '-')
      } else {
        return val.age
      }
    },
    newAdviceGroupObject: function() {
      return Object.assign(
        {},
        {
          group_no: 0,
          advices: []
        }
      )
    },
    getNumber: function(record) {
      console.log(record)
    },
    getLastAfterWeight(id, assessmentDate) {
      getLastAfterWeight(id, assessmentDate).then(response => {
        if (response.data.state === 1) {
          var weight = response.data.data.weight

          this.lastAfterWeight = weight.weight_after.toFixed(1)
          console.log('weight', weight)
        }
      })
    },
    getPartName(id) {
      console.log("id",id)
      for (let i = 0; i < this.bloodAccess.length; i++) {
        if ((this.bloodAccess[i].id = id)) {
          return this.bloodAccess[i].name;
        }
      }
    }
  }
}
</script>

<style scoped>
.print_page_main_content {
  background-color: white;
  width: 960px;
  margin: 0 auto 50px;
  padding: 0 0 0 0;
  page-break-after: always;
}

.print_page_main_content .order-yy-name {
  margin: auto;
  text-align: center;
  font-size: 20px;
  letter-spacing: 5px;
}

.print_page_main_content .order_title {
  text-align: center;
  font-size: 23px;
  line-height: 40px;
  font-weight: 500;
}

.row {
  font-size: 14px;
  line-height: 20px;
  padding: 5px 0;
}

.inline_block {
  display: inline-block;
}

.under_line {
  display: inline-block;
  border-bottom: 1px solid #999;
  text-align: center;
  white-space: nowrap;
  width: 50%;
}

.under_line::before {
  content: "\00A0";
}

.under_line::after {
  content: "\00A0";
}

.under_line_two {
  display: inline-block;
  border-bottom: 1px solid #999;
  text-align: left;
  white-space: nowrap;
  width: 50%;
}

.under_line_two::before {
  content: "\00A0";
}

.under_line_two::after {
  content: "\00A0";
}

.flex {
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  align-items: center;
  -webkit-align-items: center;
  box-align: center;
  -moz-box-align: center;
  -webkit-box-align: center;
  text-align: center;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  -moz-box-pack: space-between;
  -webkit--moz-box-pack: space-between;
  box-pack: space-between;
}

.print_page_main_content .proj_table {
  width: 100%;
  border: 1px solid;
  border-collapse: collapse;
  padding: 2px;
}

.print_page_main_content .proj_table tbody tr td {
  border: 1px solid;
  /* text-align: center; */
  font-size: 16px;
  padding: 6px 8px;
  line-height: 30px;
}

.print_page_main_content .proj_table .inside_table {
  width: 100%;
  border: hidden; /* 解决边框冲突 */
  border-collapse: collapse;
}

.print_page_main_content .proj_table .inside_table tr td {
  border: 1px solid;
  text-align: center;
  font-size: 14px;
  padding: 8px 5px;
  line-height: 16px;
}

.print-table-no {
  width: 100%;
  text-align: center;
  border-collapse: collapse;
  font-size: 14px;
}

.es-img {
  height: 30px;
}

.advice-name {
  text-align: left !important;
  line-height: 16px !important;
}

.advice-children {
  display: flex;
}

.margin-bottom-300 {
  margin-bottom: 450px;
}

.margin-bottom-600 {
  margin-bottom: 600px;
}

.margin-bottom-900 {
  margin-bottom: 900px;
}

.print-yema {
  position: absolute;
  left: 50%;
}

.print-yema2 {
  position: absolute;
  left: 50%;
}

.print-yema3 {
  position: absolute;
  left: 50%;
}

.print-yema4 {
  position: absolute;
  left: 50%;
}

.print-yema5 {
  position: absolute;
  left: 50%;
}

.did_checke::after {
  content: "\221A";
  font-size: 8px;
  margin-left: 2px;
  margin-top: 2px;
  position: absolute;
}

.dialysis-print-order {
  width: 960px;
  margin: 0 auto;
}

.dialysis-print-order .order-yy-name {
  margin: auto;
  text-align: center;
  font-size: 20px;
  letter-spacing: 5px;
}

.dialysis-print-order .order-title {
  margin: auto;
  font-weight: 600;
  text-align: center;
  font-size: 22px;
  padding: 10px 20px 20px 20px;
}

.dialysis-print-order .table-box {
  width: 100%;
  line-height: 23px;
  font-size: 14px;
}

.dialysis-print-order .print-table {
  width: 100%;
  text-align: center;
  border-collapse: collapse;
  line-height: 40px;
  font-size: 14px;
}

.dialysis-print-order .print-table-no {
  width: 100%;
  text-align: center;
  border-collapse: collapse;
  font-size: 14px;
}

.dialysis-print-order .under-line {
  border-bottom: 1px solid #999;
  width: 95%;
  text-align: center;
  margin-left: 2px;
}

.dialysis-print-order .title-box {
  text-align: center;
  font-size: 16px;
}

.dialysis-print-order .radio-lebel-box {
  font-weight: 400;
  cursor: pointer;
}

.dialysis-print-order .radio-no {
  opacity: 0;
  outline: none;
  position: absolute;
  margin: 0;
  width: 0;
  height: 0;
  z-index: -1;
}

.dialysis-print-order .radio-inner {
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  display: inline-block;
  line-height: 1;
  position: relative;
  vertical-align: middle;
}

.dialysis-print-order .radio-fang {
  display: inline-block;
  position: relative;
  border: 1px solid #000;
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  background-color: #fff;
  z-index: 1;
  transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
    background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
}

.dialysis-print-order .is-checked-radio::after {
  content: "√";
  font-size: 15px;
}

.dialysis-print-order .print-table-no tr td {
  padding: 8px 5px;
  line-height: 25px;
}

.dialysis-print-order .print-table tr td {
  padding: 1px 1px;
  /*line-height: 25px;*/
}

.es-img {
  height: 25px;
}

.advice-name {
  text-align: left;
}

.advice-children {
  display: flex;
}

.title-box-pro {
  border: 0 #fff;
  line-height: 25px;
  height: 25px;
  text-align: left;
  padding-left: 10px !important;
}

.title-box-pro-tr {
  border: 0 #fff;
}

.text-align-left {
  text-align: left !important;
  padding-left: 10px !important;
  font-size: 14px !important;
  line-height: 25px;
}

.print-table-tr-new td {
  line-height: 20px !important;
}

.border-top-solid {
  border: solid 1px #000;
}

.print-template-two tr {
  line-height: 30px;
}
</style>
<style>
.dialysis-print-order {
  width: 960px;
  margin: 0 auto;
}

.dialysis-print-order .order-yy-name {
  margin: auto;
  text-align: center;
  font-size: 20px;
  letter-spacing: 5px;
}

.dialysis-print-order .order-title {
  margin: auto;
  font-weight: 600;
  text-align: center;
  font-size: 22px;
  padding: 10px 20px 20px 20px;
}

.dialysis-print-order .table-box {
  width: 100%;
  line-height: 23px;
  font-size: 14px;
}

.dialysis-print-order .print-table {
  width: 100%;
  text-align: center;
  border-collapse: collapse;
  line-height: 40px;
  font-size: 14px;
}

.dialysis-print-order .print-table-no {
  width: 100%;
  text-align: center;
  border-collapse: collapse;
  font-size: 14px;
}

.dialysis-print-order .under-line {
  border-bottom: 1px solid #999;
  width: 95%;
  text-align: center;
  margin-left: 2px;
}

.dialysis-print-order .title-box {
  text-align: center;
  font-size: 16px;
}

.dialysis-print-order .radio-lebel-box {
  font-weight: 400;
  cursor: pointer;
}

.dialysis-print-order .radio-no {
  opacity: 0;
  outline: none;
  position: absolute;
  margin: 0;
  width: 0;
  height: 0;
  z-index: -1;
}

.dialysis-print-order .radio-inner {
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  display: inline-block;
  line-height: 1;
  position: relative;
  vertical-align: middle;
}

.dialysis-print-order .radio-fang {
  display: inline-block;
  position: relative;
  border: 1px solid #000;
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  background-color: #fff;
  z-index: 1;
  transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
    background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
}

.dialysis-print-order .is-checked-radio::after {
  content: "√";
  font-size: 15px;
}

.dialysis-print-order .print-table-no tr td {
  padding: 8px 5px;
  line-height: 25px;
}

.dialysis-print-order .print-table tr td {
  padding: 1px 1px;
  /*line-height: 25px;*/
}

.es-img {
  height: 25px;
}

.advice-name {
  text-align: left;
}

.advice-children {
  display: flex;
}

.title-box-pro {
  border: 0 #fff;
  line-height: 25px;
  height: 25px;
  text-align: left;
  padding-left: 10px !important;
}

.title-box-pro-tr {
  border: 0 #fff;
}

.text-align-left {
  text-align: left !important;
  padding-left: 10px !important;
  font-size: 14px !important;
  line-height: 25px;
}

.print-table-tr-new td {
  line-height: 20px !important;
}

.border-top-solid {
  border: solid 1px #000;
}

.print-template-two tr {
  line-height: 30px;
}
</style>
