<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="index"
          class="print_page_main_content"
        >
            <div id="dialysis-print-box">
                <div class="dialysis-print-order">
                    <div class="order-yy-name">{{ orgname }}</div>
                    <div class="order-title" style="border-bottom:1px solid #000;">血液净化治疗记录单</div>
                    <div class="lineHeight">身份识别</div>
                    <div class="lineHeight" style="display:flex;justify-content: space-between;">
                    <div style="width:18%">床号：{{ record.device_zone.name && record.device_number.number ? getNewNumber(record.device_zone.name,record.device_number.number) : '' }}</div>
                    <div style="width:16%">姓名：{{ record.patient.name ? record.patient.name : "/" }}</div>
                    <div style="width:16%">性别：{{ record.patient.gender == 1 ? '男' : record.patient.gender == 2 ? '女' : "/" }}</div>
                    <div class='widthLength25'>透析号：{{ record.patient.dialysis_no }}</div>
                    <div class='widthLength25'>日期：{{ getTime(record.schedule_date, "{y}-{m}-{d}") ? getTime(record.schedule_date, "{y}-{m}-{d}") : "/" }}</div>
                    </div>
                    <div class="lineHeight">基本信息</div>
                    <div class="lineHeight">
                        <div class="widthLength25">年龄：{{ getNewAge(record.patient.id_card_no) }}</div>
                        <div class="widthLength25">透析年龄：{{ record.patient.first_dialysis_date ? getMonths(record.patient.first_dialysis_date * 1000) : '/' }}月</div>
                        <div class="widthLength25">入院方式：<span v-for="(item, index) in way_arr" v-if="record.receive_assessment.way == item.id">{{ item.name }}</span></div>
                        <div class="widthLength25">累计：{{ record.patient.total_dialysis + record.patient.user_sys_before_count }} 次</div>
                    </div>
                    <div class="lineHeight">
                        <div class="widthLength25">首次透析时间：{{ record.patient.first_treatment_date ? getTime(record.patient.first_treatment_date ? record.patient.first_treatment_date : 0, "{y}-{m}-{d}") : '/' }}</div>
                        <div class="widthLength25">首入本院透析：{{ record.patient.hospital_first_dialysis_date ? getTime(record.patient.hospital_first_dialysis_date ? record.patient.hospital_first_dialysis_date : 0, "{y}-{m}-{d}") : '/' }}</div>
                        <div class="widthLength25"></div>
                        <div class="widthLength25"></div>
                    </div>
                    <div class="lineHeight">
                        诊断：{{ record.patient.diagnose }}
                    </div>
                    <div class="lineHeight">透析前评估：</div>
                    <div class="lineHeight">主诉：{{ record.patient.patient_complains ? record.patient.patient_complains : '无' }}</div>
                    <div class="lineHeight">透析前药物：{{ record.assessment_before_dislysis.pre_dialysis_drugs ? record.assessment_before_dislysis.pre_dialysis_drugs : '' }}</div>
                    <div class="lineHeight">
                    <span v-if="record.assessment_before_dislysis.is_hemorrhage == 1">出血部位：{{ record.assessment_before_dislysis.hemorrhage ? record.assessment_before_dislysis.hemorrhage : '无' }}</span>
                    <span v-else>出血部位：无</span>
                    </div>
                    <div class="lineHeight">
                        <div class="widthLength25">是否跌倒：{{ record.receive_assessment.tumble == 1 ? '是' : '否' }}</div>
                        <div class="widthLength25">跌倒预防措施：<span v-for="item in precaution_arr" v-if="record.receive_assessment.precaution == item.id">{{ item.name }}</span></div>
                        <div class="widthLength25">跌倒风险：
                            <span v-if="record.receive_assessment.danger_level == 1">无</span>
                            <span v-if="record.receive_assessment.danger_level == 2">低风险</span>
                            <span v-if="record.receive_assessment.danger_level == 3">中度风险</span>
                            <span v-if="record.receive_assessment.danger_level == 4">高风险</span>
                        </div>
                        <div class="widthLength25">是否通路感染：
                            <span v-if="record.assessment_before_dislysis.is_infect == 1">无</span>
                            <span v-if="record.assessment_before_dislysis.is_infect == 2">有</span>
                        </div>
                    </div>
                    <div class="lineHeight">
                        <div class="widthLength25">围手术期：{{ record.assessment_before_dislysis.period == 1 ? '有' : "无" }}</div>
                        <div class="widthLength25">尿量：{{ record.assessment_before_dislysis.urine_volume ? record.assessment_before_dislysis.urine_volume : 0 }}ml</div>
                        <div class="widthLength25">就诊方式：
                            <span v-if="record.receive_assessment.condition == 1">住院</span>
                            <span v-if="record.receive_assessment.condition == 2">门诊</span>
                            <span v-if="record.receive_assessment.condition == 3">手术期</span>
                            <span v-if="record.receive_assessment.condition == 4">急诊</span>
                        </div>
                        <div class="widthLength25">透析期间BP：未测</div>
                    </div>
                    <div class="lineHeight">
                        <div class="widthLength25">内瘘功能：{{ record.assessment_before_dislysis.internal_fistula ? record.assessment_before_dislysis.internal_fistula : '' }}</div>
                        <div class="widthLength25">穿刺方法：{{ record.assessment_before_dislysis.puncture_way ? record.assessment_before_dislysis.puncture_way : '' }}</div>
                        <div class="widthLength25">通路皮肤：{{ record.assessment_before_dislysis.internal_fistula_skin ? record.assessment_before_dislysis.internal_fistula_skin : '' }}</div>
                        <div class="widthLength25">BP：{{ 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 : "" }} mmHg
                        </div>
                    </div>
                    <div class="lineHeight">
                        <div class="widthLength25">T：{{ record.assessment_before_dislysis.temperature ? record.assessment_before_dislysis.temperature : '' }} ℃</div>
                        <div class="widthLength25">P：{{ record.assessment_before_dislysis.pulse_frequency ? record.assessment_before_dislysis.pulse_frequency : '' }} 次/分</div>
                        <div class="widthLength25">意识：
                        <span v-for="(item, index) in consciousness_arr" :key="index">
                            <span v-if="record.receive_assessment.consciousness == item.id">{{ item.name }}</span>
                        </span>
                        </div>
                        <div class="widthLength25">食欲：
                        <span v-for="(item, index) in appetite_arr" :key="index">
                            <span v-if="record.receive_assessment.appetite == item.id">{{ item.name }}</span>
                        </span>
                        </div>
                    </div>
                    <div class="lineHeight">
                        <div class="widthLength25">附加重物量：{{ record.assessment_before_dislysis.additional_weight ? record.assessment_before_dislysis.additional_weight : 0 }} Kg</div>
                        <div class="widthLength25">透前体重：{{ record.assessment_before_dislysis.weight_before ? record.assessment_before_dislysis.weight_before : "" }} Kg</div>
                        <div class="widthLength25">干体重：{{ record.assessment_before_dislysis.dry_weight ? record.assessment_before_dislysis.dry_weight : "" }} Kg</div>
                        <div class="widthLength25">预计进食量：{{ record.assessment_before_dislysis.estimated_food_intake ? record.assessment_before_dislysis.estimated_food_intake + ' g' : '无' }}</div>
                    </div>
                    <div class="lineHeight">
                        其他：{{ record.assessment_before_dislysis.remark ? record.assessment_before_dislysis.remark : '' }}
                    </div>
                    <div class="lineHeight">透后评估：</div>
                    <div class="lineHeight">
                        <div class="widthLength25">BP：{{ 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 : "" }} mmHg
                        </div>
                        <div class="widthLength25">T：{{ record.assessment_after_dislysis.temperature ? record.assessment_after_dislysis.temperature : '' }}℃</div>
                        <div class="widthLength25">意识：
                        <span v-for="(item, index) in consciousness_arr" :key="index">
                            <span v-if="record.assessment_after_dislysis.consciousness == item.id">{{ item.name }}</span>
                        </span>
                        </div>
                        <div class="widthLength25">跌倒风险：
                        <span v-if="record.assessment_after_dislysis.fallrisk == 1">无</span>
                        <span v-if="record.assessment_after_dislysis.fallrisk == 2">低风险</span>
                        <span v-if="record.assessment_after_dislysis.fallrisk == 3">中度风险</span>
                        <span v-if="record.assessment_after_dislysis.fallrisk == 4">高风险</span>
                        </div>
                    </div>
                    <div class="lineHeight">
                        <div class="widthLength25">实际进食量：{{ record.assessment_after_dislysis.dialysis_during ? record.assessment_after_dislysis.dialysis_during : '' }} g</div>
                        <div class="widthLength25">透后体重：{{ record.assessment_after_dislysis.weight_after ? record.assessment_after_dislysis.weight_after : "" }} Kg</div>
                        <div class="widthLength25">脉搏：{{ record.assessment_after_dislysis.pulse_frequency ? record.assessment_after_dislysis.pulse_frequency : "" }} 次/分</div>
                        <div class="widthLength25"></div>
                    </div>
                    <div class="lineHeight">治疗方案：</div>
                    <div class="lineHeight">
                        <div class="widthLength25">病情：<span v-for="item in illnessList" v-if="record.prescription.illness == item.id">{{ item.name }}</span></div>
                        <div class="widthLength25">治疗模式：
                        <span v-if="record.prescription.mode_id == 1">HD</span>
                        <span v-if="record.prescription.mode_id == 2">HDF</span>
                        <span v-if="record.prescription.mode_id == 3">HD+HP</span>
                        <span v-if="record.prescription.mode_id == 4">HP</span>
                        <span v-if="record.prescription.mode_id == 5">HP</span>
                        <span v-if="record.prescription.mode_id == 6">HF</span>
                        <span v-if="record.prescription.mode_id == 7">IUF</span>
                        <span v-if="record.prescription.mode_id == 8">HFHD</span>
                        <span v-if="record.prescription.mode_id == 9">HFHD+HP</span>
                        <span v-if="record.prescription.mode_id == 10">PHF</span>
                        <span v-if="record.prescription.mode_id == 11">HFR</span>
                        <span v-if="record.prescription.mode_id == 12">HDF+HP</span>
                        <span v-if="record.prescription.mode_id == 13">CRRT</span>
                        <span v-if="record.prescription.mode_id == 14">腹水回输</span>
                        <span v-if="record.prescription.mode_id == 15">HD前置换</span>
                        <span v-if="record.prescription.mode_id == 16">HD后置换</span>
                        <span v-if="record.prescription.mode_id == 17">HDF前置换</span>
                        <span v-if="record.prescription.mode_id == 18">HDF后置换</span>
                        <span v-if="record.prescription.mode_id == 19">IUF+HD</span>
                        </div>
                        <div class="widthLength25">治疗总时长：{{ record.prescription.dialysis_duration_hour ? record.prescription.dialysis_duration_hour : 0 }}小时
                        {{ record.prescription.dialysis_duration_minute ? record.prescription.dialysis_duration_minute : 0 }}分钟
                        </div>
                        <div class="widthLength25">透析器：{{ record.prescription.dialysis_dialyszers ? record.prescription.dialysis_dialyszers : '' }}
                        <span v-if="record.prescription.dialysis_irrigation!=''">/{{record.prescription.dialysis_irrigation}}</span>
                        </div>
                    </div>
                    <div class="lineHeight">
                        <div class="widthLength25">血流量：{{ record.prescription.blood_flow_volume ? record.prescription.blood_flow_volume : "" }} ml/min</div>
                        <div class="widthLength25">设定UF量：{{ record.prescription.target_ultrafiltration ? record.prescription.target_ultrafiltration : "" }} ml</div>
                        <div class="widthLength25">实际UF量：{{ record.assessment_after_dislysis.actual_ultrafiltration ? record.assessment_after_dislysis.actual_ultrafiltration : "" }} ml</div>
                        <div class="widthLength25">分区：{{ record.device_zone.name ? record.device_zone.name : '' }}</div>
                    </div>
                    <div class="lineHeight">
                        <div class="widthLength25">透析液温度：{{ record.prescription.dialysate_temperature ? record.prescription.dialysate_temperature : "" }} ℃</div>
                        <div class="widthLength25">透析液流量：{{ record.prescription.dialysate_flow ? record.prescription.dialysate_flow : "" }} ml/min</div>
                        <div class="widthLength25">碳酸氢根：{{ record.prescription.bicarbonate ? record.prescription.bicarbonate : "" }} mmol/L</div>
                        <div class="widthLength25">血管通路：{{ QueryPartById(record.prescription && record.prescription.blood_access ? record.prescription.blood_access : 0) }}</div>
                    </div>
                    <div class="lineHeight">
                        透析液浓度(mmol/L)：Ca： {{ record.prescription.calcium ? record.prescription.calcium : "" }}  &nbsp; Na： {{ record.prescription.sodium ? record.prescription.sodium : "" }} &nbsp;  K： {{ record.prescription.kalium ? record.prescription.kalium : "" }} &nbsp; 葡萄糖：{{ record.prescription.amylaceum ? record.prescription.amylaceum : "" }}
                    </div>
                    <table class="print-table" border="1">
                    <tbody>
                        <tr>
                        <td style="width:90px;height:40px">日期</td>
                        <td style="width:60px;height:40px">时间</td>
                        <td colspan="5" style="width:560px;height:40px">医嘱内容</td>
                        <td colspan="2" style="width:110px;height:40px">开立医生</td>
                        <td colspan="3" style="width:130px;height:40px">执行时间</td>
                        <td colspan="2" style="width:130px;height:40px">核对护士</td>
                        <td colspan="2" style="width:108px;height:40px">执行护士</td>
                        </tr>

                        <tr v-for="(advice, advice_index) in record.his_advices" style="height:30px">
                        <td>{{ getTime(advice.start_time, "{y}-{m}-{d}") }}</td>
                        <td>{{ getTime(advice.start_time, "{h}:{i}") }}</td>
                        <td colspan="5" style="height:30px;line-height:20px;">
                            <span v-if="advice.parent_id > 0">---></span>
                            <span>{{ advice.advice_name }}</span>
                            <span v-if="advice && advice.advice_desc">({{ advice.advice_desc }}{{ advice.drug_spec_unit }})</span>
                            <span v-if="advice.prescribing_number">
                            &nbsp;&nbsp; {{ advice.prescribing_number }}{{ advice.prescribing_number_unit }}
                            </span>
                            <span v-if="advice.single_dose != 0">{{ advice.single_dose }}{{ advice.single_dose_unit }}</span>
                            <span v-if="advice.parent_id == 0">
                            {{ advice.delivery_way }}
                            </span>
                            <span v-if="advice.parent_id == 0">
                            {{ advice.execution_frequency }}
                            </span>
                        </td>
                        <td colspan="2">
                            <span v-if="setAdminUserES(advice, 'advice_doctor') == ''">
                                {{getAdminUser(advice, '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, 'advice_doctor')" alt srcset />
                            </span>
                        </td>
                        <td colspan="3" style="width:130px;">
                            {{ getTime(advice.execution_time, "{h}:{i}") }}
                        </td>
                        <td colspan="2">
                             <span v-if="setAdminUserES(advice, 'checker') == ''">
                                {{getAdminUser(advice, 'checker')}}
                            </span>
                            <span v-else>
                                <img style="height:30px;" :src="setAdminUserES(advice, 'checker')" alt srcset />
                            </span>
                        </td>
                        <td colspan="2" style="height:30px">
                            <span v-if="setAdminUserES(advice, 'execution_staff') == ''">
                                {{getAdminUser(advice, 'execution_staff')}}
                            </span>
                            <span v-else>
                                <img style="height:30px;" :src="setAdminUserES(advice, 'execution_staff')" alt srcset />
                            </span>
                        </td>
                        </tr>
                    </tbody>
                    </table>
                    <div class="lineHeight">
                        <div style="width:16%;">医生：
                        <span style="display: inline-block;text-align: left;">
                            &nbsp;
                            <span v-if="setAdminUserES(record.prescription, 'prescription_doctor') == ''">{{getAdminUser(record.prescription, 'prescription_doctor')}}</span>
                            <img class="es-img" :src="setAdminUserES(record.prescription, 'prescription_doctor')" alt="" srcset="" v-else style="height: 20px;">
                        </span>
                        </div>
                        <div style="width:16%;">透前评估护士：
                        <span style="display: inline-block;text-align: left;">
                            &nbsp;
                            <span v-if="setAdminUserES(record.assessment_before_dislysis, 'creater') == ''">{{getAdminUser(record.assessment_before_dislysis, 'creater')}}</span>
                            <img class="es-img" :src="setAdminUserES(record.assessment_before_dislysis, 'creater')" alt="" srcset="" v-else style="height: 20px;">
                        </span>
                        </div>
                        <div style="width:16%;">核对护士：
                            <span style="display: inline-block;text-align: left;" v-if="record.check != null ? (record.dialysis_order==null?0:record.dialysis_order.start_nurse) != record.check.modifier : false">
                                <span 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 style="display: inline-block;text-align: left;" v-else>
                                <span v-if="setAdminUserES(record.check, record.check == null ? 0 : 'creater') == ''">
                                {{ getAdminUser(record.check, record.check == null ? 0 : 'creater') }}
                                </span>
                                <img style="height:30px;" :src="setAdminUserES(record.check, record.check == null ? 0 : 'creater')" alt srcset v-else />
                            </span>
                        </div>
                        <div style="width:16%;">责任护士：
                        <span style="display: inline-block;text-align: left;">
                            &nbsp;
                            <span v-if="setAdminUserES(record.dialysis_order, 'start_nurse') == ''">{{getAdminUser(record.dialysis_order, 'start_nurse')}}</span>
                            <img class="es-img" :src="setAdminUserES(record.dialysis_order, 'start_nurse')" alt="" srcset="" v-else style="height: 20px;">
                        </span>
                        </div>
                        <div style="width:16%;">责任组长：
                        <span style="display: inline-block;text-align: left;">
                            &nbsp;
                            <span v-if="setAdminUserES(record.dialysis_order, 'start_nurse') == ''">{{getAdminUser(record.dialysis_order, 'start_nurse')}}</span>
                            <img class="es-img" :src="setAdminUserES(record.dialysis_order, 'start_nurse')" alt="" srcset="" v-else style="height: 20px;">
                        </span>
                        </div>
                    </div>
                    <div class="lineHeight">治疗过程中检测记录：血压检测部位：{{ record.monitor_records && record.monitor_records[0] ? getBloodPressureMmonitoringSite(record.monitor_records[0].blood_pressure_monitoring_site) : '' }}</div>
                    <table class="print-table" border="1">
                    <tbody>
                        <tr>
                        <td width="50">时间</td>
                        <td width="70" style="height:20px;line-height:20px">BPmmHg</td>
                        <td width="40" style="height:20px;line-height:20px">P/HR<br />次/分</td>
                        <!-- <td width="50" style="height:20px;line-height:20px">管路<br />密闭性</td> -->
                        <td width="60" style="height:20px;line-height:20px">透析液<br />温度℃</td>
                        <td width="60" style="height:20px;line-height:20px">Qb<br />ml/min</td>
                        <td width="60" style="height:20px;line-height:20px">VP<br />mmHg</td>
                        <td width="60" style="height:20px;line-height:20px">AP<br />mmHg</td>
                        <td width="60" style="height:20px;line-height:20px">TMP<br />mmHg</td>
                        <td width="60" style="height:20px;line-height:20px">UFV<br />ml</td>
                        <td width="60" style="height:20px;line-height:20px">UFR<br />ml/h</td>
                        <td width="60" style="height:20px;line-height:20px">并发症</td>
                        <td width="60" style="height:20px;line-height:20px">护理措施</td>
                        <!-- <td width="60" style="height:20px;line-height:20px">UF医嘱</td> -->
                        <td width="60" style="height:20px;line-height:20px">执行人</td>
                        </tr>

                        <tr v-for="monitor in record.monitor_records" :key="monitor.id">
                        <td style="height:40px;line-height:40px;">&nbsp;{{ getTime(monitor.operate_time, "{h}:{i}") }}</td>
                        <td>
                            <span v-if="monitor.systolic_blood_pressure || monitor.diastolic_blood_pressure">
                            &nbsp;{{ monitor.systolic_blood_pressure ? monitor.systolic_blood_pressure : "" }}/
                            {{ monitor.diastolic_blood_pressure ? monitor.diastolic_blood_pressure : "" }}
                            </span>
                        </td>
                        <td>&nbsp;{{ monitor.pulse_frequency ? monitor.pulse_frequency : '' }}</td>
                        <!-- <td>&nbsp;</td> -->
                        <td>&nbsp;{{ monitor.dialysate_temperature ? monitor.dialysate_temperature : '' }}</td>
                        <td>&nbsp;{{ monitor.blood_flow_volume ? monitor.blood_flow_volume : '' }}</td>
                        <td>&nbsp;{{ monitor.venous_pressure ? monitor.venous_pressure : "" }}</td>
                        <td>&nbsp;{{ monitor.arterial_pressure ? monitor.arterial_pressure : "" }}</td>
                        <td>&nbsp;{{ monitor.transmembrane_pressure ? monitor.transmembrane_pressure : "" }}</td>
                        <td>&nbsp;{{ monitor.ultrafiltration_rate ? monitor.ultrafiltration_rate : "" }}</td>
                        <td>&nbsp;{{ monitor.ultrafiltration_volume ? monitor.ultrafiltration_volume : "" }}</td>
                        <td>&nbsp;{{ monitor.complication ? getComplication(monitor.complication) : "" }}</td>
                        <td style="text-align:left;padding-left:10px;">
                            <div v-if="monitor.operate_time" style="line-height:20px;text-align: left;display: inline-block;">
                            {{ monitor.dispose ? monitor.dispose : '无' }}
                            </div>
                        </td>
                        <!-- <td>&nbsp;</td> -->
                        <td>
                            <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>
                        </tr>
                    </tbody>
                    </table>
                    <div class="lineHeight">
                        护理记录：{{ record.summer&&record.summer.nursing_record ? record.summer.nursing_record : '' }}
                    </div>
                    <div class="lineHeight">
                        护理小结：{{ record.summer&&record.summer.special_record ? record.summer.special_record : '' }}
                    </div>
                    <!-- <div class="lineHeight">
                        治疗过程：
                    </div> -->
                    <div class="lineHeight">
                        <div class="widthLength25">实际治疗时长：{{ record.assessment_after_dislysis.actual_treatment_hour ? record.assessment_after_dislysis.actual_treatment_hour : 0 }}小时
                        {{ record.assessment_after_dislysis.actual_treatment_minute ? record.assessment_after_dislysis.actual_treatment_minute : 0 }}分钟
                        </div>
                        <!-- <div class="widthLength25">静脉管道：
                        <span v-if="afterdialysis.intravenous_tube == 1">0级</span>
                        <span v-if="afterdialysis.intravenous_tube == 2">I级</span>
                        <span v-if="afterdialysis.intravenous_tube == 3">Ⅱ级</span>
                        <span v-if="afterdialysis.intravenous_tube == 4">Ⅲ级</span>
                        </div>
                        <div class="widthLength25">动脉管道：
                        <span v-if="afterdialysis.arterial_tube == 1">0级</span>
                        <span v-if="afterdialysis.arterial_tube == 2">I级</span>
                        <span v-if="afterdialysis.arterial_tube == 3">Ⅱ级</span>
                        <span v-if="afterdialysis.arterial_tube == 4">Ⅲ级</span>
                        </div> -->
                        <div class="widthLength25">透析器凝血：{{ record.assessment_after_dislysis.cruor ? record.assessment_after_dislysis.cruor : "" }}</div>
                        <div class="widthLength25"></div>
                        <div class="widthLength25"></div>

                    </div>
                    <div class="lineHeight">
                    <div class="widthLength25">血管通路功能：
                        {{ record.assessment_after_dislysis.internal_fistula ? record.assessment_after_dislysis.internal_fistula : "" }}
                    </div>
                        <div class="widthLength25">出血：
                        <span v-if="record.assessment_after_dislysis.puncture_point_oozing_blood == 1">有</span>
                        <span v-else>无</span>
                        </div>
                        <div class="widthLength25">穿刺口：
                        <span v-if="record.assessment_after_dislysis.hemostasis_opera == 1">需要护士</span>
                        <span v-if="record.assessment_after_dislysis.hemostasis_opera == 2">他人协助</span>
                        <span v-if="record.assessment_after_dislysis.hemostasis_opera == 3">自己压迫</span>
                        <span v-if="record.assessment_after_dislysis.hemostasis_opera == 4">内瘘止血带</span>
                        </div>
                        <div class="widthLength25">透析状态：在透</div>

                    </div>
                    <div class="lineHeight">
                        <div class="widthLength25">URR：{{ record.assessment_after_dislysis.urr ? record.assessment_after_dislysis.urr : '未测' }}</div>
                        <div class="widthLength25">kt/V：{{ record.assessment_after_dislysis.ktv ? record.assessment_after_dislysis.ktv : '未测' }}</div>
                        <div class="widthLength25">透析相关高血压：{{ record.assessment_after_dislysis.hypertenison == 1 ? '有' : '无' }}</div>
                        <div class="widthLength25">透析相关低血压：{{ record.assessment_after_dislysis.hypopiesia == 1 ? '有' : '无' }}</div>

                    </div>
                    <div class="lineHeight">
                        <div class="widthLength25">转归：
                        <span v-if="record.assessment_after_dislysis.lapse == item.id" v-for="(item,index) in lapse_arr" :key="index">{{ item.name }}</span>
                        </div>
                        <div class="widthLength25">患者去向：
                        <span v-if="record.assessment_after_dislysis.patient_gose == 1">离院</span>
                        <span v-if="record.assessment_after_dislysis.patient_gose == 2">留观</span>
                        <span v-if="record.assessment_after_dislysis.patient_gose == 3">住院</span>
                        <span v-if="record.assessment_after_dislysis.patient_gose == 4">门诊</span>
                        </div>
                        <div class="widthLength25">离科方式：
                        <span v-if="record.assessment_after_dislysis.leave_office_method == 1">步行</span>
                        <span v-if="record.assessment_after_dislysis.leave_office_method == 2">扶行</span>
                        <span v-if="record.assessment_after_dislysis.leave_office_method == 3">轮椅</span>
                        <span v-if="record.assessment_after_dislysis.leave_office_method == 4">平车</span>
                        </div>
                        <div class="widthLength25">设备运行：正常</div>
                    </div>
                    <div class="lineHeight">
                        健康宣教：{{ record.summer&&record.summer&&record.summer.mission ? record.summer.mission : '' }}
                    </div>
                    <div class="lineHeight">
                        <div style="width:16%;">值班医生：
                        <span style="display: inline-block;text-align: left;">
                            &nbsp;
                            <span v-if="setAdminUserES(record.prescription, 'prescription_doctor') == ''">{{getAdminUser(record.prescription, 'prescription_doctor')}}</span>
                            <img class="es-img" :src="setAdminUserES(record.prescription, 'prescription_doctor')" alt="" srcset="" v-else style="height: 20px;">
                        </span>
                        </div>
                        <div style="width:16%;">责任护士：
                        <span style="display: inline-block;text-align: left;">
                            &nbsp;
                            <span v-if="setAdminUserES(record.dialysis_order, 'start_nurse') == ''">{{getAdminUser(record.dialysis_order, 'start_nurse')}}</span>
                            <img class="es-img" :src="setAdminUserES(record.dialysis_order, 'start_nurse')" alt="" srcset="" v-else style="height: 20px;">
                        </span>
                        </div>
                        <div style="width:16%;">下机护士：
                        <span style="display: inline-block;text-align: left;">
                            &nbsp;
                            <span v-if="setAdminUserES(record.dialysis_order, 'finish_nurse') == ''">{{getAdminUser(record.dialysis_order, 'finish_nurse')}}</span>
                            <img class="es-img" :src="setAdminUserES(record.dialysis_order, 'finish_nurse')" alt="" srcset="" v-else style="height: 20px;">
                        </span>
                        </div>
                    </div>
                    <div class="lineHeight">
                        病程记录：
                    </div>
                    <div class="lineHeight">{{ record.summer&&record.summer.dialysis_summary ? record.summer.dialysis_summary : '' }}{{ record.summer&&record.summer.created_time ? getTime(record.summer.created_time, "{y}-{m}-{d} {h}:{i}") : '' }}</div>
                    <div style="text-align:right;line-height:30px;">签名医生：
                    <span style="display: inline-block;text-align: left;">
                        &nbsp;
                        <span v-if="setAdminUserES(record.prescription, 'prescription_doctor') == ''">{{getAdminUser(record.prescription, 'prescription_doctor')}}</span>
                        <img class="es-img" :src="setAdminUserES(record.prescription, 'prescription_doctor')" alt="" srcset="" v-else style="height: 20px;">
                    </span>
                    </div>
                </div>
            </div>
            <div style="page-break-after: always;"></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import CheckBox from "./option_check_box";
import { GetBatchPrintDialysisData } 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";
import LabelBox from '../printItem/LabelBox'
export default {
  name: "BatchPrintOrder",
  components: {
    CheckBox,
    BreadCrumb,
    LabelBox

  },
  data() {
    return {
      crumbs: [
        { path: false, name: "透析管理" },
        { path: false, name: "批量打印" }
      ],
      records: [
        // 模拟有多条数据
        // {
        //     monitor_records: [ {},{},{},{},{},{},{},{},{},{},{}, ],
        //     advices: [ {},{},{},{},{},{},{}, ],
        // },
        // {
        //     monitor_records: [],
        //     advices: [],
        // },
      ],
      way_arr: [],
      consciousness_arr: [],
      appetite_arr: [],
      posture_arr: [],
      sick_condition_arr: [],
      precaution_arr: [],
      intake_arr: [],
      nutrition_arr: [],

      loading: false,
      orgname: "",
      bloodAccessParOpera: {},
      anticoagulantsConfit: {},
      dialysateFormulationOptions: {},
      operatorMaps: {},
      operators: [],
      adminUser: [],
      doctor_advices: [],
      advice_groups: [],
      advice_groups_2: [],
      complications: [
        "低血压",
        "高血压",
        "心律失常",
        "头晕",
        "头痛",
        "呕吐",
        "抽搐",
        "出血",
        "心衰",
        "腹痛"
      ]
    };
  },
  created() {
    this.way_arr = getDataConfig("hemodialysis", "way");
    this.consciousness_arr = getDataConfig("hemodialysis", "consciousness");
    this.appetite_arr = getDataConfig("hemodialysis", "appetite");
    this.posture_arr = getDataConfig("hemodialysis", "posture");
    this.sick_condition_arr = getDataConfig("hemodialysis", "sick_condition");
    this.precaution_arr = getDataConfig("hemodialysis", "precaution");
    this.intake_arr = getDataConfig("hemodialysis", "intake");
    this.nutrition_arr = getDataConfig("hemodialysis", "nutrition");
    this.bloodPressureMmonitoringSite = getDataConfig('hemodialysis','blood_pressure_monitoring_site');
    this.illnessList = getDataConfig('hemodialysis', 'illness')
    this.lapse_arr = getDataConfig("hemodialysis", "lapse");

    var xtuser = this.$store.getters.xt_user;
    this.orgname = xtuser.org.org_name;
    //   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;

    var bloodAccessParOpera = getDataConfig(
      "hemodialysis",
      "vascular_access_desc"
    );
    for (var key in bloodAccessParOpera) {
      this.bloodAccessParOpera[bloodAccessParOpera[key].id] =
        bloodAccessParOpera[key];
    }

    var dialysateFormulationOptions = getDataConfig(
      "hemodialysis",
      "dialysate_formulation"
    );
    for (var key in dialysateFormulationOptions) {
      this.dialysateFormulationOptions[dialysateFormulationOptions[key].id] =
        dialysateFormulationOptions[key];
    }

    //   const xtdate = this.$route.query && this.$route.query.xtdate;
    //   const xtno = this.$route.query && this.$route.query.xtno;
    //   if (typeof (xtdate) == "string" && xtdate.length > 0 && typeof (xtno) == "string" && xtno.length > 0) {
    //     this.queryParams.xtdate = xtdate;
    //     this.queryParams.xtno = xtno;
    //     this.getDialysisRecord();
    //   } else {
    //     this.$message.error("参数不齐");
    //     return false;
    //   }
  },
  mounted() {
    this.loading = true;
    var ids = this.$store.getters.temp_params.batch_print_dialysis_record_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 < 10
            // ) {
            //   dlegh = 10 - 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].his_advices &&
              this.records[recordIndex].his_advices.length < 6
            ) {
              delghTwo = 6 - this.records[recordIndex].his_advices.length
            } else {
              delghTwo = 0
            }

            if (delghTwo > 0) {
              if (
                typeof this.records[recordIndex].his_advices === 'undefined' ||
                this.records[recordIndex].his_advices == null
              ) {
                this.records[recordIndex].his_advices = []
              }
              for (let index = 0; index < delghTwo; index++) {
                this.records[recordIndex].his_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: {
    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
    },
    getBloodPressureMmonitoringSite(id){
      var name = "";
      for(let i=0;i<this.bloodPressureMmonitoringSite.length;i++){
         if(id == this.bloodPressureMmonitoringSite[i].id){
            name = this.bloodPressureMmonitoringSite[i].name
         }
      }
      return name
    },
    getMonths(t){
      var ot=new Date(t); //转为时间对象（js的时间戳是毫秒数）
      var oy=ot.getFullYear(); //年
      var om=ot.getMonth()+1; //月
      var tt=new Date(); //今天
      var ty=tt.getFullYear(); //今天年
      var tm=tt.getMonth()+1; //今天月
      var gm=(ty-oy)*12+(tm-om); //距今月数
      return gm
    },
    getNewNumber(name, number) {
      if (name.indexOf('区') > -1) {
        return (
          name + number
        )
      } else {
        return (
          name + '区' + number

        )
      }
    },
    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
      }
    },
    getPartName(id) {
      var vascularAccess = getDataConfig('hemodialysis', 'vascular_access')
      this.vascularAccess = vascularAccess
      for (let i = 0; i < this.vascularAccess.length; i++) {
        if (this.vascularAccess[i].id == id) {
          return this.vascularAccess[i].name
        }
      }
    },
    getIsCheckDataConfig(pName, cName, targetName) {
      var arr = getDataConfig(pName, cName);
      for (let i = 0; i < arr.length; i++) {
        if (arr[i].name == targetName) {
          return arr[i].id;
        }
      }
    },
    printAction: function() {
      const style =
        '@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: 16px;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: 5px 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: 16px;padding: 5px 5px;line-height: 18px;}.print-table-no {width: 100%;text-align: center;border-collapse: collapse;font-size: 14px;}.es-img {height: 20px;}.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:950px;}.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%;}.print-yema5{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;}';

      printJS({
        printable: "print_content",
        type: "html",
        documentTitle: "  ",
        style: style,
        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 "";
    },
    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;
        }
      }
    },
    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;font-size:10px;}.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;}.widthLength25{width: 25%;}.lineHeight{line-height: 20px;display: flex;justify-content: space-between;}'
      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;}'
      printJS({
        printable: 'print_content',
        type: 'html',
        documentTitle: '  ',
        style: style,
        scanStyles: false
      })
    },
    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.birthday == 0) {
        return "";
      }
      return jsGetAge(uParseTime(val.birthday, "{y}-{m}-{d}"), "-");
    },
    newAdviceGroupObject: function() {
      return Object.assign(
        {},
        {
          group_no: 0,
          advices: []
        }
      );
    },
    getNumber() {
      if (this.dialysisOrder != null) {
        return (
          this.patientInfo.DialysisSchedule.device_zone.name +
          this.dialysisOrder.DeviceNumber.number
        )
      } else {
        return (
          this.patientInfo.DialysisSchedule.device_zone.name +
          this.patientInfo.DialysisSchedule.device_number.number
        )
      }
    },
  }
};
</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;
}
.widthLength25{
    width: 25%;
}
.lineHeight{
    line-height: 30px;
    display: flex;
    justify-content: space-between;
}
</style>
