<template>
    <div class="app-container ">
        <div class="order-print-btn" 
            v-loading="loading" 
            element-loading-text="加载中"
            element-loading-spinner="el-icon-loading"
            element-loading-background="rgba(0, 0, 0, 0.8)"
            style="width: 100%;">
            <el-button type="primary" icon="el-icon-printer" @click="printThisPage">打印</el-button>
        </div>
        <div  id="dialysis-print-box">
            <div class="dialysis-print-order" >
                <div class="order-yy-name">{{orgname}}</div>
                <div class="order-title">血液净化治疗记录单</div>
                <table class="table-box" style="margin-top: 10px;">
                    <tbody>
                        <tr>
                            <td width="50">姓 名: </td>
                            <td width="90">
                                <div class="under-line">&nbsp;{{patientInfo.name}}</div>
                            </td>
                            <td width="50">性 别: </td>
                            <td width="120">
                                <div>
                                    <label for="gender_1" class="radio-lebel-box">
                                        <span class="radio-inner">
                                            <span class="radio-fang " :class="{'is-checked-radio':patientInfo_gender_1}"></span>
                                            <input v-model="patientInfo.gender" id="gender_1" name="gender" type="radio" class="radio-no" value="1">
                                        </span>
                                        <span> 男</span>
                                    </label>
                                    &nbsp;
                                    <label for="gender_2" class="radio-lebel-box"> 
                                        <span class="radio-inner">
                                            <span class="radio-fang" :class="{'is-checked-radio':patientInfo_gender_2}"></span>
                                            <input v-model="patientInfo.gender" id="gender_2" :checked="patientInfo.gender==2?true:false" name="gender" type="radio" class="radio-no" value="2">
                                        </span>
                                        <span> 女</span>
                                    </label>
                                </div>
                            </td>
                            <td width="50">年 龄: </td>
                            <td width="40">
                                <div class="under-line">&nbsp;{{patientInfo.age}}</div>
                            </td>
                            <td>岁</td>
                            <td width="10">&nbsp;</td>
                            
                            <td width="50">科 室: </td>
                            <td width="150">
                                <div>
                                    <label for="source_1" class="radio-lebel-box">
                                        <span class="radio-inner">
                                            <span class="radio-fang " :class="{'is-checked-radio':patientInfo_source_1}"></span>
                                            <input v-model="patientInfo.source" id="source_1" name="source" type="radio" class="radio-no" value="1">
                                        </span>
                                        <span> 门 诊 透 析</span>
                                    </label>
                                    &nbsp;
                                    <label for="source_2" class="radio-lebel-box"> 
                                        <span class="radio-inner">
                                            <span class="radio-fang" :class="{'is-checked-radio':patientInfo_source_2}"></span>
                                            <input v-model="patientInfo.source" id="source_2" :checked="patientInfo.source==2?true:false" name="source" type="radio" class="radio-no" value="2">
                                        </span>
                                        <span> 住 院</span>
                                    </label>
                                </div>
                            </td>
                            <td  width="100">
                               <div class="under-line">{{patientInfo.DialysisSchedule.DeviceZone.name}}&nbsp;</div>
                            </td>
                            <td>科</td>
                            <td  width="100">
                               <div class="under-line">&nbsp;{{patientInfo.DialysisSchedule.DeviceNumber.number}}</div>
                            </td>
                            <td>床</td>
                            
                        </tr>
                    </tbody>
                </table>
                <table class="table-box" style="margin-top: 10px;">
                    <tbody>
                        <tr>
                            <td width="130">住院号/透析卡号: </td>
                            <td width="90">
                                <div class="under-line">&nbsp;{{patientInfo.admission_number?patientInfo.admission_number:'无'}} /{{patientInfo.dialysis_no}}</div>
                            </td>

                             <td width="40">诊 断: </td>
                            <td width="">
                                <div class="under-line">&nbsp;</div>
                            </td>

                            <td width="80">治 疗 日 期: </td>
                            <td width="120">
                                <div class="under-line">&nbsp;<span>{{queryParams.xtdate}}</span></div>
                            </td>
                           
                        </tr>
                    </tbody>
                </table>
                <table class="print-table" border="1">
                    <tbody>
                        <tr>
                            <td width="30px" class="title-box">透前评估</td>
                            <td >
                                <table class="table-box">
                                    <tbody>
                                        <tr>
                                            <td width="70">入院方式: </td>
                                            <td width="230">
                                                <div>
                                                    <label for="receiverTreatmentAccess_way_1" class="radio-lebel-box">
                                                        <span class="radio-inner">
                                                            <span class="radio-fang " :class="{'is-checked-radio':receiverTreatmentAccess.way==1?true:false}"></span>
                                                            <input v-model="receiverTreatmentAccess.way" id="receiverTreatmentAccess_way_1" name="receiverTreatmentAccess_way" type="radio" class="radio-no" value="1">
                                                        </span>
                                                        <span> 步行</span>
                                                    </label>
                                                    &nbsp;
                                                    <label for="receiverTreatmentAccess_way_2" class="radio-lebel-box"> 
                                                        <span class="radio-inner">
                                                            <span class="radio-fang" :class="{'is-checked-radio':receiverTreatmentAccess.way==2?true:false}"></span>
                                                            <input v-model="receiverTreatmentAccess.way" id="receiverTreatmentAccess_way_2" name="receiverTreatmentAccess_way" type="radio" class="radio-no" value="2">
                                                        </span>
                                                        <span> 扶行</span>
                                                    </label>
                                                    &nbsp;
                                                    <label for="receiverTreatmentAccess_way_3" class="radio-lebel-box"> 
                                                        <span class="radio-inner">
                                                            <span class="radio-fang" :class="{'is-checked-radio':receiverTreatmentAccess.way==3?true:false}"></span>
                                                            <input v-model="receiverTreatmentAccess.way" id="receiverTreatmentAccess_way_3" name="receiverTreatmentAccess_way" type="radio" class="radio-no" value="3">
                                                        </span>
                                                        <span> 轮椅</span>
                                                    </label>
                                                    &nbsp;
                                                    <label for="receiverTreatmentAccess_way_4" class="radio-lebel-box"> 
                                                        <span class="radio-inner">
                                                            <span class="radio-fang" :class="{'is-checked-radio':receiverTreatmentAccess.way==4?true:false}"></span>
                                                            <input v-model="receiverTreatmentAccess.way" id="receiverTreatmentAccess_way_4" name="receiverTreatmentAccess_way" type="radio" class="radio-no" value="4">
                                                        </span>
                                                        <span> 平车</span>
                                                    </label>
                                                </div>
                                            </td>
                                            
                                            <td ></td>
                                            <td width="50">意识: </td>
                                            <td width="180">
                                                <div>
                                                    <label for="receiverTreatmentAccess_consciousness_1" class="radio-lebel-box">
                                                        <span class="radio-inner">
                                                            <span class="radio-fang " :class="{'is-checked-radio':receiverTreatmentAccess.consciousness==1?true:false}"></span>
                                                            <input v-model="receiverTreatmentAccess.consciousness" id="receiverTreatmentAccess_consciousness_1" name="receiverTreatmentAccess_consciousness" type="radio" class="radio-no" value="1">
                                                        </span>
                                                        <span> 清醒</span>
                                                    </label>
                                                    &nbsp;
                                                    <label for="receiverTreatmentAccess_consciousness_2" class="radio-lebel-box"> 
                                                        <span class="radio-inner">
                                                            <span class="radio-fang" :class="{'is-checked-radio':receiverTreatmentAccess.consciousness==2?true:false}"></span>
                                                            <input v-model="receiverTreatmentAccess.consciousness" id="receiverTreatmentAccess_consciousness_2" name="receiverTreatmentAccess_consciousness" type="radio" class="radio-no" value="2">
                                                        </span>
                                                        <span> 嗜睡</span>
                                                    </label>
                                                    &nbsp;
                                                    <label for="receiverTreatmentAccess_consciousness_3" class="radio-lebel-box"> 
                                                        <span class="radio-inner">
                                                            <span class="radio-fang" :class="{'is-checked-radio':receiverTreatmentAccess.consciousness==3?true:false}"></span>
                                                            <input v-model="receiverTreatmentAccess.consciousness" id="receiverTreatmentAccess_consciousness_3" name="receiverTreatmentAccess_consciousness" type="radio" class="radio-no" value="3">
                                                        </span>
                                                        <span> 昏迷</span>
                                                    </label>
                                                </div>
                                            </td>
                                            <td ></td>
                                            <td width="50">体温: </td>
                                            <td width="100">
                                                <div class="under-line">&nbsp;{{predialysis.temperature}}</div>
                                            </td>
                                            <td width="30">℃</td>
                                        </tr>
                                    </tbody>
                                </table>
                                
                                <table class="table-box">
                                    <tbody>
                                        <tr>
                                            <td width="40">体位: </td>
                                            <td width="400">
                                                <div>
                                                    <label for="" class="radio-lebel-box">
                                                        <span class="radio-inner">
                                                            <span class="radio-fang " ></span>
                                                            <input  type="radio" class="radio-no" value="1">
                                                        </span>
                                                        <span> 自动体位</span>
                                                    </label>
                                                    &nbsp;
                                                    <label for="" class="radio-lebel-box">
                                                        <span class="radio-inner">
                                                            <span class="radio-fang " ></span>
                                                            <input  type="radio" class="radio-no" value="1">
                                                        </span>
                                                        <span> 平卧位</span>
                                                    </label>
                                                    &nbsp;
                                                    <label for="" class="radio-lebel-box">
                                                        <span class="radio-inner">
                                                            <span class="radio-fang " ></span>
                                                            <input  type="radio" class="radio-no" value="1">
                                                        </span>
                                                        <span> 半卧位</span>
                                                    </label>
                                                    &nbsp;
                                                    <label for="" class="radio-lebel-box">
                                                        <span class="radio-inner">
                                                            <span class="radio-fang " ></span>
                                                            <input  type="radio" class="radio-no" value="1">
                                                        </span>
                                                        <span> 端坐位</span>
                                                    </label>
                                                    &nbsp;
                                                    <label for="" class="radio-lebel-box">
                                                        <span class="radio-inner">
                                                            <span class="radio-fang " ></span>
                                                            <input  type="radio" class="radio-no" value="1">
                                                        </span>
                                                        <span> 躁动不安</span>
                                                    </label>
                                                    &nbsp;
                                                    
                                                </div>
                                            </td>
                                            
                                            <td ></td>
                                        </tr>
                                    </tbody>
                                </table>
                                <table class="print-table">
                                    <tbody>
                                        <tr>
                                            <td width="55%">
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="90">透析间期：</td>
                                                            <td>
                                                                <div class="under-line">&nbsp;{{predialysis.dialysis_interphase}}</div>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                            <td>
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="90">透前症状：</td>
                                                            <td>
                                                                <div class="under-line">&nbsp;{{predialysis.symptom_before_dialysis}}</div>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="60">内瘘：</td>
                                                            <td>
                                                                <div class="under-line">&nbsp;{{predialysis.internal_fistula}}</div>
                                                            </td>

                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                            <td>
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="60">导管：</td>
                                                            <td>
                                                                <div class="under-line">&nbsp;{{predialysis.catheter}}</div>
                                                            </td>

                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="75">合并症：</td>
                                                            <td>
                                                                <div class="under-line">&nbsp;{{predialysis.complication}}</div>
                                                            </td>

                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                            <td>
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="110">前次透析后：</td>
                                                            <td width="">
                                                                <div class="under-line">&nbsp;{{predialysis.last_post_dialysis}}</div>
                                                            </td>
                                                            <td width="20"></td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="90">透前体重：</td>
                                                            <td width="">
                                                                <div class="under-line">&nbsp;{{predialysis.weight_before}}</div>
                                                            </td>
                                                            <td width="20">kg</td>
                                                            <td width="30"></td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                            <td>
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="90">附加物重：</td>
                                                            <td width="">
                                                                <div class="under-line">&nbsp;{{predialysis.additional_weight}}</div>
                                                            </td>
                                                            <td width="20">kg</td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table class="print-table" border="1">
                    <tbody>
                        <tr>
                            <td class="title-box">透析后评估</td>
                        </tr>
                        <tr>
                            <td style="padding-bottom:15px;">
                                <table class="table-box">
                                    <tbody>
                                        <tr>
                                            <td width="20">BP</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{afterdialysis.systolic_blood_pressure}}/{{afterdialysis.diastolic_blood_pressure}}</div>
                                            </td>
                                            <td width="20">mmHg</td>
                                            <td width="30"></td>

                                            <td width="13">T</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{afterdialysis.temperature}}</div>
                                            </td>
                                            <td width="30">℃</td>
                                            <td width="30"></td>
                                            <td width="13">R</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{afterdialysis.breathing_rate}}</div>
                                            </td>
                                            <td width="60">次/分</td>
                                        </tr>
                                    </tbody>
                                </table>
                                <table class="print-table">
                                    <tbody>
                                        <tr>
                                            <td width="50%">
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="100">实际超滤量：</td>
                                                            <td width="">
                                                                <div class="under-line">&nbsp;{{afterdialysis.actual_ultrafiltration}}</div>
                                                            </td>
                                                            <td width="20">ml</td>
                                                            <td width="30"></td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                            <td>
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="100">实际置换量：</td>
                                                            <td width="">
                                                                <div class="under-line">&nbsp;{{afterdialysis.actual_displacement}}</div>
                                                            </td>
                                                            <td width="20">L</td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="50%">
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="60">凝血：</td>
                                                            <td>
                                                                <div class="under-line">&nbsp;{{afterdialysis.cruor}}</div>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                            <td>
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="90">透后症状：</td>
                                                            <td>
                                                                <div class="under-line">&nbsp;{{afterdialysis.symptom_after_dialysis}}</div>
                                                            </td>

                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            
                                            <td>
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="60">内瘘：</td>
                                                            <td>
                                                                <div class="under-line">&nbsp;{{afterdialysis.internal_fistula}}</div>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                            <td>
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="60">导管：</td>
                                                            <td>
                                                                <div class="under-line">&nbsp;{{afterdialysis.catheter}}</div>
                                                            </td>

                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="75">并发症：</td>
                                                            <td>
                                                                <div class="under-line">&nbsp;{{afterdialysis.complication}}</div>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                            <td>
                                                <table class="table-box">
                                                    <tbody>
                                                        <tr>
                                                            <td width="150">实际治疗时间：</td>
                                                            <td>
                                                                <div class="under-line">&nbsp;{{afterdialysis.actual_treatment_hour}} h {{afterdialysis.actual_treatment_minute}} min </div>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>

                <table class="print-table" border="1">
                    <tbody>
                        <tr>
                            <td width="50%" class="title-box">透析处方</td>
                        </tr>
                        <tr>
                            <td style="padding-bottom:15px;">
                                <table class="table-box">
                                    <tbody>
                                        <tr>
                                            <td width="90">透析方式：</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.mode}}</div>
                                            </td>
                                            <td width="100">处方脱水量：</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.dewater_amount}}</div>
                                            </td>
                                            <td width="20">L</td>
                                            <td width="90">透析时长：</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.dialysis_duration}}</div>
                                            </td>
                                            <td width="20">h</td>
                                            <td width="">&nbsp;</td>
                                            <td width="90">置换方式：</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.replacement}}</div>
                                            </td>
                                            <td width="">&nbsp;</td>
                                            <td width="100">置换总量：</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.replacement_total}}</div>
                                            </td>
                                            <td width="30">L</td>
                                        </tr>
                                    </tbody>
                                </table>
                                <table class="table-box">
                                    <tbody>
                                        <tr>
                                            <td width="75">透析器：</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.perfusion_apparatus_name}}</div>
                                            </td>
                                            <td width="20"></td>
                                            <td width="60">机号：</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.device.name}}</div>
                                            </td>
                                            <td width=""></td>
                                        </tr>
                                    </tbody>
                                </table>
                                <table class="table-box">
                                    <tbody>
                                        <tr>
                                            <td width="75">血流量：</td>
                                            <td width="60">
                                                <div class="under-line">&nbsp;{{prescription.blood_flow_volume}}</div>
                                            </td>
                                            <td width="90">ml/min</td>
                                            <td width=""></td>

                                            <td width="60">抗凝剂</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.anticoagulant}}</div>
                                            </td>
                                            <td width="">&nbsp;</td>

                                            <template v-if="AlPanel.shouji != -1">
                                            <td width="40">首剂</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.anticoagulant_shouji}}</div>
                                            </td>
                                            <td width="">{{AlPanel.shouji_unit}}</td>
                                            </template>

                                            <template v-if="AlPanel.weichi != -1">
                                            <td width="40">维持</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.anticoagulant_weichi}}</div>
                                            </td>
                                            <td width="">{{AlPanel.weichi_unit}}</td>
                                            </template>

                                            <template v-if="AlPanel.zongliang != -1">
                                            <td width="40">总量</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.anticoagulant_zongliang}}</div>
                                            </td>
                                            <td width="">{{AlPanel.zongliang_unit}}</td>
                                            </template>

                                            <template v-if="AlPanel.gaimingcheng != -1">
                                            <td width="60">钙名称</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.anticoagulant_gaimingcheng}}</div>
                                            </td>
                                            <td width=""></td>
                                            </template>

                                            <template v-if="AlPanel.gaijiliang != -1">
                                            <td width="40">剂量</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.anticoagulant_gaijiliang}}</div>
                                            </td>
                                            <td>{{AlPanel.gaijiliang_unit}}</td>
                                            </template>
                                        </tr>
                                    </tbody>
                                </table>
                                <table class="table-box">
                                    <tbody>
                                        <tr>
                                            <td width="100">透析液配方：</td>
                                            <td width="18">钾</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.kalium}}</div>
                                            </td>
                                            <td width="75">mmol/L</td>
                                            <td width="18">钠</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.sodium}}</div>
                                            </td>
                                            <td width="75">mmol/L</td>
                                            <td width="18">钙</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.calcium}}</div>
                                            </td>
                                            <td width="75">mmol/L</td>
                                            <td width="75">碳酸氢根</td>
                                            <td width="">
                                                <div class="under-line">&nbsp;{{prescription.bicarbonate}}</div>
                                            </td>
                                            <td width="75">mmol/L</td>
                                            
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>

                <table class="print-table" border="1">
                    <tbody>
                        <tr>
                            <td  class="title-box">临时医嘱</td>
                        </tr>
                    </tbody>
                </table>
                <table class="print-table-no" border="1" count="0">
                    <tbody>
                        <tr>
                            <td width="100">时间</td>
                            <td>医嘱内容</td>
                            <td width="75">医生签名</td>
                            <td width="75">执行时间</td>
                            <td width="75">执行人员</td>
                            <td width="75">核对人员</td>
                        </tr>
                        <tr v-for="advice in advices" :key="advice.id">
                            <td> {{advice.start_time | parseTime('{y}-{m}-{d} {h}:{i}')}}</td>
                            <td> 
                                <span v-if="advice.parent_id>0">└</span>
                                <span >{{advice.advice_name }}</span>
                                <span >{{advice.advice_desc}}</span>
                                <span v-if="advice.single_dose">{{advice.single_dose}}{{advice.single_dose_unit}}</span>
                                <span v-if="advice.prescribing_number">{{advice.prescribing_number}}{{advice.prescribing_number_unit}}</span>
                                <span >{{advice.delivery_way}}</span>
                                <span >{{advice.execution_frequency}}</span>
                            </td>
                            <td>{{getXuserName(advice.advice_doctor)}}</td>
                            <td><span v-if="advice.execution_time!=0" >{{advice.execution_time| parseTime('{y}-{m}-{d} {h}:{i}:{s}')}}</span></td>
                            <td><span v-if="advice.parent_id==0" >{{getXuserName(advice.execution_staff)}}</span></td>
                            <td><span v-if="advice.parent_id==0" >{{getXuserName(advice.checker)}}</span>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table class="print-table" border="1">
                    <tbody>
                        <tr>
                            <td  class="title-box">监测记录</td>
                        </tr>
                    </tbody>
                </table>
                <table class="print-table-no" border="1" count="0">
                    <tbody>
                        <tr>
                            <td >时间</td>
                            <td >血压<font size="2">（mmHg）</font></td>
                            <td >脉率<font size="2">（次/分）</font></td>
                            <td >呼吸<font size="2">（次/分）</font></td>
                            <td >血流量<font size="2">（ml/min）</font></td>
                            <td >静脉压<font size="2">（mmHg）</font></td>
                            <td >跨膜压<font size="2">（mmHg）</font></td>
                            <td >超滤量<font size="2"> (ml/h)</font></td>
                            <td >钠浓度<font size="2"> (mmol/L)</font></td>
                            <td >透析液温度<font size="2"> (℃)</font></td>
                            <td >置换率<font size="2"> (ml/min)</font></td>
                            <td >置换量<font size="2"> (L)</font></td>
                            
                            <td width="" style="min-width:45px;">病情变化</td>
                            <td width="" style="min-width:120px;">处理</td>
                            <td width="" style="min-width:45px;">结果</td>
                        </tr>
                        <tr v-for="monitor in monitors" :key="monitor.id">
                            <td>&nbsp;{{monitor.monitoring_date | parseTime('{y}-{m}-{d}')}} {{monitor.monitoring_time}}</td>
                            <td>&nbsp;{{monitor.systolic_blood_pressure}} / {{monitor.diastolic_blood_pressure}}</td>
                            <td>&nbsp;{{monitor.pulse_frequency}}</td>
                            <td>&nbsp;{{monitor.breathing_rate}}</td>
                            <td>&nbsp;{{monitor.blood_flow_volume}}</td>
                            <td>&nbsp;{{monitor.venous_pressure}}</td>
                            <td>&nbsp;{{monitor.transmembrane_pressure}}</td>
                            <td>&nbsp;{{monitor.ultrafiltration_volume}}</td>
                            <td>&nbsp;{{monitor.sodium_concentration}}</td>
                            <td>&nbsp;{{monitor.dialysate_temperature}}</td>
                            <td>&nbsp;{{monitor.replacement_rate}}</td>
                            <td>&nbsp;{{monitor.displacement_quantity}}</td>
                            <td>&nbsp;{{monitor.symptom}}</td>
                            <td>&nbsp;{{monitor.dispose}}</td>
                            <td>&nbsp;{{monitor.result}}</td>
                        </tr>
                    </tbody>
                </table>
                
                <table class="print-table" border="1">
                    <tbody>
                        <tr>
                            <td class="title-box">治疗小结</td>
                        </tr>
                        <tr>
                            <td style="padding-bottom:15px;">
                                <table class="table-box">
                                    <tbody>
                                        <tr>
                                            <td width="75">透后宣教:</td>
                                            <td width="">
                                                <div class="under-line" style="text-align:left;">&nbsp;{{summary.mission}}</div>
                                            </td>
                                            <td width=""></td>
                                        </tr>
                                    </tbody>
                                </table>
                                <table class="table-box">
                                    <tbody>
                                        <tr>
                                            <td width="75">治疗小结</td>
                                            <td width="">
                                                <div class="under-line" style="text-align:left;">&nbsp;{{summary.dialysis_summary}}</div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <!-- <table class="table-box">
                                    <tbody>
                                        <tr>
                                            <td width="75">
                                                换药护士
                                            </td>
                                            <td width="90">
                                                <div class="under-line">&nbsp; </div>
                                            </td>
                                            <td width=""></td>
                                            <td width="75">治疗护士</td>
                                            <td width="90">
                                                <div class="under-line">&nbsp;</div>
                                            </td>
                                            <td width=""></td>
                                            <td width="75">核对人员</td>
                                            <td width="90">
                                                <div class="under-line">&nbsp;</div>
                                            </td>
                                            <td width=""></td>
                                            <td width="75">下机护士</td>
                                            <td width="90">
                                                <div class="under-line">&nbsp;</div>
                                            </td>
                                            <td width=""></td>
                                            <td width="75">治疗医生</td>
                                            <td width="90">
                                                <div class="under-line">&nbsp;</div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table> -->
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</template>

<script>
import {getDialysisRecord} from '@/api/dialysis';
import {
  jsGetAge,
  uParseTime
} from "@/utils/tools";
  import print from "print-js";

export default {
    name:'dialysisPrintOrder',
    data(){
        return {
            loading:false,
            orgname:'',
            patientInfo_gender_1:false,
            patientInfo_gender_2:false,
            patientInfo_source_2:false,
            patientInfo_source_1:false,
            modeOptions:{},
            replacementWays: [],
            perfusionApparatus: [],
            anticoagulantsConfit: {},

            queryParams:{
                xtdate:'',
                xtno:'',
            },
            patientInfo:{
                birth:'',
                age:'',
                DialysisSchedule:{
                    DeviceNumber:{},
                    DeviceZone:{},
                },
                gender:0
            },
            predialysis:{},
            afterdialysis:{},
            prescription:{
                device:{},
            },
            advices:[],
            users:[],
            monitors:[],
            summary:{},
            receiverTreatmentAccess:{},

            
            AlPanel:{id:0, name:"", type:1, shouji:2, weichi:2, zongliang:2, gaimingcheng:-1, gaijiliang:-1, shouji_unit:"mg", weichi_unit:"mg/h", zongliang_unit:"mg", gaimingcheng_unit:"", gaijiliang_unit:""},

        }
    },
    methods:{
        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{margin-top:10px;width:100%;line-height:20px;font-size:14px}.dialysis-print-order .print-table{width:100%;text-align:center;border-collapse:collapse;line-height:35px;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:20px;border:1px solid #666;letter-spacing:10px}.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}}';

          printJS({
            printable: "dialysis-print-box",
            type: "html",
            style: style,
            scanStyles: false
          });
        },
        
    getXuserName(id){
        if (id<=0) {
            return "";
        }
        var name = "";
        if (this.users==null || typeof(this.users.length) == "undefined") {
            return name;
        }
        var leng = this.users.length;
        if (leng==0) {
            return name;
        }
        for (let index = 0; index < leng; index++) {
            if (this.users[index].id == id) {
                name = this.users[index].name;
                break;
            }
        }
        return name;
    },
      modeName(mode_id) {
        return typeof(this.modeOptions[mode_id]) != 'undefined' && typeof(this.modeOptions[mode_id].name) != 'undefined'?this.modeOptions[mode_id].name:'';
      },
        getDialysisRecord(){
            getDialysisRecord(this.queryParams).then(response=>{
                if(response.data.state==1) {
                    this.users = response.data.data.users;
                    this.patientInfo = response.data.data.patientInfo;
                    this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}');
                    this.patientInfo.age = jsGetAge(this.patientInfo.birth, '-');
                    if (response.data.data.patientInfo.first_dialysis_date !=0) {
                        this.patientInfo.first_dialysis_date = uParseTime(response.data.data.patientInfo.first_dialysis_date, '{y}-{m}-{d}');
                    }else {
                        this.patientInfo.first_dialysis_date = '';
                    }

                    this.predialysis = response.data.data.PredialysisEvaluation;
                    this.afterdialysis = response.data.data.AssessmentAfterDislysis;
                    this.prescription = response.data.data.dialysisPrescription;
                    this.receiverTreatmentAccess = response.data.data.receiverTreatmentAccess;

                    this.prescription.mode = this.modeName(this.prescription.mode_id);
                    var rwLen = this.replacementWays.length;
                    this.prescription.replacement = "";
                    for (let index = 0; index < rwLen; index++) {
                        if(this.replacementWays[index].id == this.prescription.replacement_way) {
                            this.prescription.replacement = this.replacementWays[index].name;
                            break;
                        }
                    }

                    
                    var paLen = this.perfusionApparatus.length;
                    this.prescription.perfusion_apparatus_name = "";
                    for (let index = 0; index < paLen; index++) {
                        if(this.perfusionApparatus[index].id == this.prescription.perfusion_apparatus) {
                            this.prescription.perfusion_apparatus_name = this.perfusionApparatus[index].name;
                            break;
                        }
                    }

                    var acLen = this.anticoagulantsConfit.length;
                    var thisALID = this.prescription.anticoagulant;
                    this.prescription.anticoagulant = "";

                    if (typeof(this.anticoagulantsConfit[thisALID]) != 'undefined' && this.anticoagulantsConfit[thisALID] != null) {
                        this.prescription.anticoagulant = this.anticoagulantsConfit[thisALID].name;
                        this.AlPanel = this.anticoagulantsConfit[thisALID];
                    }

                    this.advices = response.data.data.advices;
                    this.monitors = response.data.data.monitors;
                    this.summary = response.data.data.summary;
                    

                }else {
                    this.$message.error("请求数据失败");
                    return false;
                }

            });
        }
    },
    watch:{
        "patientInfo.gender":function () {
            
            if (this.patientInfo.gender == 1) {
                    this.patientInfo_gender_1 = true;
                    this.patientInfo_gender_2 = false;
            } else if (this.patientInfo.gender == 2) {
                    this.patientInfo_gender_2 = true;
                    this.patientInfo_gender_1 = false;
            }else {
                    this.patientInfo_gender_2 = false;
                    this.patientInfo_gender_1 = false;
            }
        },
        "patientInfo.source":function () {
            
            if (this.patientInfo.source == 1) {
                    this.patientInfo_source_1 = true;
                    this.patientInfo_source_2 = false;
            } else if (this.patientInfo.source == 2) {
                    this.patientInfo_source_2 = true;
                    this.patientInfo_source_1 = false;
            }else {
                
                    this.patientInfo_source_2 = false;
                    this.patientInfo_source_1 = false;
            }
        }

        
    },
    created(){
        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;
        
        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;
        }
    }

}
</script>

<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: 20px;
    font-size: 14px;
}
.dialysis-print-order .print-table {
    width: 100%;
    text-align: center;
    border-collapse: collapse;
    line-height: 35px;
    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: 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 .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;
}
</style>
