<template>
    <div class="assessmentAfter">
        <div>
            <div class="warnTxt" v-if="showTxt != ''">
                {{ showTxt }}
            </div>
            <van-cell>
                <template #title>
                    <span style="color:#7b8c9c" v-if="prescription_prop!=null">目标超滤量:{{prescription_prop.target_ultrafiltration}}</span>
                    <span style="color:#7b8c9c"  v-if="$store.getters.user.template_info.template_id != 9 && $store.getters.user.template_info.template_id != 17 && $store.getters.user.template_info.template_id != 20 && $store.getters.user.template_info.template_id != 21 && $store.getters.user.template_info.template_id != 22  && $store.getters.user.template_info.template_id != 23 && $store.getters.user.template_info.template_id != 24 && $store.getters.user.template_info.template_id != 26 && $store.getters.user.template_info.template_id != 28 && $store.getters.user.template_info.template_id != 27 && $store.getters.user.template_info.template_id != 29 && $store.getters.user.template_info.template_id != 30 && $store.getters.user.template_info.template_id != 31 && $store.getters.user.template_info.template_id != 32 && $store.getters.user.template_info.template_id != 34 && $store.getters.user.template_info.template_id != 38 && $store.getters.user.template_info.template_id != 40 && $store.getters.user.template_info.template_id != 43 && $store.getters.user.template_info.org_id!=9555 && $store.getters.user.template_info.template_id != 60  && $store.getters.user.template_info.org_id!=10340 && $store.getters.user.template_info.org_id!=10387 && $store.getters.user.template_info.org_id!=10430 && $store.getters.user.template_info.org_id!=10441 && $store.getters.user.template_info.org_id!=10445 && $store.getters.user.template_info.org_id!=9829 && $store.getters.user.template_info.org_id!=10440 && $store.getters.user.template_info.org_id!=10469 && $store.getters.user.template_info.org_id!=10460 && $store.getters.user.template_info.org_id!=10723 && $store.getters.user.template_info.org_id!=10731  && $store.getters.user.template_info.org_id!=10727 && $store.getters.user.template_info.org_id!=10751&& $store.getters.user.template_info.org_id!=10752">L</span>
                    <span style="color:#7b8c9c"  v-if="$store.getters.user.template_info.template_id == 9 || $store.getters.user.template_info.template_id == 17 || $store.getters.user.template_info.template_id == 20 || $store.getters.user.template_info.template_id == 21 || $store.getters.user.template_info.template_id == 22 || $store.getters.user.template_info.template_id == 23 || $store.getters.user.template_info.template_id == 24 || $store.getters.user.template_info.template_id == 26 || $store.getters.user.template_info.template_id == 28 || $store.getters.user.template_info.template_id == 27 || $store.getters.user.template_info.template_id == 29 || $store.getters.user.template_info.template_id == 30 || $store.getters.user.template_info.template_id == 31 || $store.getters.user.template_info.template_id == 32 || $store.getters.user.template_info.template_id == 34 || $store.getters.user.template_info.template_id == 38 || $store.getters.user.template_info.template_id == 40 || $store.getters.user.template_info.template_id == 43 || $store.getters.user.template_info.org_id==9555 || $store.getters.user.template_info.template_id==60|| $store.getters.user.template_info.org_id==10340 || $store.getters.user.template_info.org_id==10387 || $store.getters.user.template_info.org_id==10430  || $store.getters.user.template_info.org_id==10441 || $store.getters.user.template_info.org_id==10445 || $store.getters.user.template_info.org_id==9829 ||  $store.getters.user.template_info.org_id==10440 ||  $store.getters.user.template_info.org_id==10469 ||  $store.getters.user.template_info.org_id==10460 ||  $store.getters.user.template_info.org_id==10723 ||  $store.getters.user.template_info.org_id==10731 ||  $store.getters.user.template_info.org_id==10727|| $store.getters.user.template_info.org_id==10751 || $store.getters.user.template_info.org_id==10752">ml</span>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <span style="color:#7b8c9c" v-if="prescription_prop!=null && ($store.getters.user.template_info.org_id == 9671 || $store.getters.user.template_info.org_id == 10469)">处方脱水量:{{prescription_prop.prescription_water}}ml</span>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <span style="color:#7b8c9c" v-if="predialysis!=null">透前体重:{{predialysis.weight_before}}kg</span>


                </template>
            </van-cell>
            <van-collapse v-model="activeNames" accordion @change='showSubMenu'>
              <van-field v-model="start_time_str" readonly @click="selectStartTimeAction" v-if="$store.getters.user.template_info.org_id == 10164 || $store.getters.user.template_info.org_id == 10599" label="透后时间"  input-align="right"/>
                <van-field v-model="timeValue" readonly @click="openPicker" @focus="inputFocus" v-if="isShow('实际治疗时长')" :required="isShow_title('实际治疗时长')" label="实际治疗时长" input-align="right"/>
                <van-field v-model="formValue.actual_ultrafiltration" @focus="inputFocus" v-if="isShow('实际超滤量')" :required="isShow_title('实际超滤量')" type="number" input-align="right">
                    <template #label>
                        <span v-if="(template_id == 6 && $store.getters.user.template_info.org_id !=10447 && $store.getters.user.template_info.org_id !=10471 && $store.getters.user.template_info.org_id !=10624) || template_id == 9 || template_id == 10 || template_id == 11 || template_id == 17 || template_id == 20 || template_id == 21 || template_id == 22 || template_id == 23 || template_id == 24 || template_id == 26 || template_id == 28 || template_id == 27 || template_id == 29 || template_id == 30 || template_id == 31 || template_id == 32 || template_id == 34 || template_id == 36 || template_id == 38 || template_id == 40 || template_id == 43 || template_id == 44 || template_id == 47 || template_id == 56 || template_id == 60 || $store.getters.user.template_info.org_id == 9555 || $store.getters.user.template_info.org_id == 10307 || $store.getters.user.template_info.org_id == 10340 || $store.getters.user.template_info.org_id == 10387 || $store.getters.user.template_info.org_id == 10430 || $store.getters.user.template_info.org_id == 10432 || $store.getters.user.template_info.org_id == 10441 || $store.getters.user.template_info.org_id == 10445 || $store.getters.user.template_info.org_id == 10495 || $store.getters.user.template_info.org_id == 10375  || $store.getters.user.template_info.org_id == 10551 || $store.getters.user.template_info.org_id == 10597 || $store.getters.user.template_info.org_id == 10599 || $store.getters.user.template_info.org_id == 10580 || $store.getters.user.template_info.org_id == 10629 || $store.getters.user.template_info.org_id == 10617 || $store.getters.user.template_info.org_id == 10677 || $store.getters.user.template_info.org_id == 10667 || $store.getters.user.template_info.org_id == 10480 || $store.getters.user.template_info.org_id == 10693 || $store.getters.user.template_info.org_id == 10702 || $store.getters.user.template_info.org_id == 10697 || $store.getters.user.template_info.org_id == 10635 ||  $store.getters.user.template_info.org_id == 10723 ||  $store.getters.user.template_info.org_id == 10721 ||  $store.getters.user.template_info.org_id == 10727 || $store.getters.user.template_info.org_id == 10742|| $store.getters.user.template_info.org_id == 10757">实际超滤量(ml)</span>
                        <span v-else>实际超滤量(L)</span>
                    </template>
                </van-field>
                <van-field v-model="formValue.weight_after" @focus="inputFocus" v-if="isShow('透后称重')" :required="isShow_title('透后称重')" label="透后称重(kg)" type="number" input-align="right"/>
                <van-field v-model="formValue.last_after_weight" @focus="inputFocus" v-if="isShow('上次透后体重')" :required="isShow_title('上次透后体重')" label="上次透后体重(kg)" type="number" input-align="right"/>
                <van-field v-model="formValue.additional_weight" @focus="inputFocus" v-if="isShow('衣物重')" :required="isShow_title('衣物重')" label="衣物重(kg)" type="number" input-align="right"/>
                <van-field v-model="formValue.weight_loss" @focus="inputFocus" v-if="isShow('体重减少')" :required="isShow_title('体重减少')" label="体重减少(kg)" type="number" input-align="right"/>
                <van-field v-model="formValue.after_weight" @focus="inputFocus" v-if="isShow('透后体重')" :required="isShow_title('透后体重')" label="透后体重(kg)" type="number" input-align="right" readonly/>
                <van-collapse-item v-if="isShow('穿刺处血肿')" title="穿刺处血肿" name="0">
                  <template slot="title">
                  <div><span v-if="isShow_title('穿刺处血肿')" class="warn_tip">*</span>穿刺处血肿</div>
                  </template>
                    <template #value>
                        <span v-if="formValue.puncture_point_haematoma == 0" class="text" style="width: 50px"></span>
                        <span v-if="formValue.puncture_point_haematoma == 1" class="text" style="width: 50px">有</span>
                        <span v-if="formValue.puncture_point_haematoma == 2" class="text" style="width: 50px">无</span>
                    </template>
                    <van-radio-group v-model="formValue.puncture_point_haematoma">
                        <van-radio name=" " key="-2">请选择</van-radio>
                        <van-radio :name="1">有</van-radio>
                        <van-radio :name="2">无</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-collapse-item v-if="isShow('并发症')" title="并发症" name="complication">
                  <template slot="title">
                  <div><span v-if="isShow_title('并发症')" class="warn_tip">*</span>并发症</div>
                  </template>
                    <template #value>
                        <div>{{formValue.complication}}</div>
                    </template>
                    <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
                </van-collapse-item>
                <van-field v-model="formValue.other_complication" @focus="inputFocus" v-if="isShow('并发症其他')" :required="isShow_title('并发症其他')" label="并发症其他" input-align="right"/>
                <van-collapse-item v-if="isShow('内瘘')" title="内瘘" name="internal_fistula">
                  <template slot="title">
                  <div><span v-if="isShow_title('内瘘')" class="warn_tip">*</span>内瘘</div>
                  </template>
                    <template #value>
                        <div>{{formValue.internal_fistula}}</div>
                    </template>
                    <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
                </van-collapse-item>
                <van-collapse-item v-if="isShow('导管')" title="导管" name="catheter">
                  <template slot="title">
                  <div><span v-if="isShow_title('导管')" class="warn_tip">*</span>导管</div>
                  </template>
                    <template #value>
                        <div>{{formValue.catheter}}</div>
                    </template>
                    <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
                </van-collapse-item>
                <van-collapse-item v-if="isShow('透析过程')" title="透析过程" name="dialysis_process">
                  <template slot="title">
                  <div><span v-if="isShow_title('透析过程')" class="warn_tip">*</span>透析过程</div>
                  </template>
                    <template #value>
                        <div>{{getDialysisProcess(formValue.dialysis_process)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.dialysis_process">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="1">完成</van-radio>
                        <van-radio :name="2">提前</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-field v-model="formValue.in_advance_minute" @focus="inputFocus" v-if="formValue.dialysis_process == 2 && isShow('透析过程提前时间')" :required="formValue.dialysis_process == 2 &&isShow_title('透析过程提前时间')" label="透析过程提前时间(min)" type="number" input-align="right"/>
                <van-collapse-item v-if="formValue.dialysis_process == 2 && isShow('透析过程提前原因')" title="透析过程提前原因" name="in_advance_reason">
                    <template slot="title">
                  <div><span v-if="formValue.dialysis_process == 2 &&isShow_title('透析过程提前原因')" class="warn_tip">*</span>透析过程提前原因</div>
                  </template>
                    <template #value>
                        <div>{{formValue.in_advance_reason}}</div>
                    </template>
                    <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
                </van-collapse-item>
                <van-field v-model="formValue.in_advance_reason_other" @focus="inputFocus" v-if="formValue.dialysis_process == 2 && isShow('透析过程提前其他原因')" :required="formValue.dialysis_process == 2&&isShow_title('透析过程提前其他原因')" label="透析过程提前其他原因" input-align="right"/>
                <van-field v-model="formValue.hemostasis_minute" @focus="inputFocus" v-if="isShow('内瘘管拔针后压迫止血时间')" :required="isShow_title('内瘘管拔针后压迫止血时间')" label="内瘘管拔针后压迫止血时间(min)" type="number" input-align="right"/>
                <van-collapse-item v-if="isShow('内瘘管拔针后压迫止血操作')" title="内瘘管拔针后压迫止血操作" name="hemostasis_opera">
                    <template slot="title">
                  <div><span v-if="isShow_title('内瘘管拔针后压迫止血操作')" class="warn_tip">*</span>内瘘管拔针后压迫止血操作</div>
                  </template>
                    <template #value>
                        <div>{{getOpera(formValue.hemostasis_opera)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.hemostasis_opera">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in this.$store.getters.hemostasis_opera' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-collapse-item v-if="isShow('动脉管道')" title="动脉管道" name="arterial_tube">
                  <template slot="title">
                  <div><span v-if="isShow_title('动脉管道')" class="warn_tip">*</span>动脉管道</div>
                  </template>
                    <template #value>
                        <div>{{getArterialTubeName(formValue.arterial_tube)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.arterial_tube">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in this.$store.getters.arterial_tube' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-collapse-item v-if="isShow('静脉管道')" title="静脉管道" name="intravenous_tube">
                  <template slot="title">
                  <div><span v-if="isShow_title('静脉管道')" class="warn_tip">*</span>静脉管道</div>
                  </template>
                    <template #value>
                        <div>{{getIntravenousTubeName(formValue.intravenous_tube)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.intravenous_tube">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in this.$store.getters.intravenous_tube' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-field v-model="body_weight_after" readonly v-if="this.$store.getters.user.template_info.template_id == 6 || this.$store.getters.user.template_info.template_id == 68" :required="isShow_title('透后净体重')" label="透后净体重(kg)" type="number" input-align="right"/>
                <van-collapse-item v-if="isShow('透析器凝血')" title="透析器凝血" name="cruor">
                  <template slot="title">
                  <div><span v-if="isShow_title('透析器凝血')" class="warn_tip">*</span>透析器凝血</div>
                  </template>
                    <template #value>
                        <div>{{formValue.cruor}}</div>
                    </template>
                    <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
                </van-collapse-item>

                <van-collapse-item v-if="isShow('拔针后穿刺点渗血')" title="拔针后穿刺点渗血" name="puncture_point_oozing_blood">
                    <template slot="title">
                  <div><span v-if="isShow_title('拔针后穿刺点渗血')" class="warn_tip">*</span>拔针后穿刺点渗血</div>
                  </template>
                    <template #value>
                        <span v-if="formValue.puncture_point_oozing_blood == 0"></span>
                        <span v-if="formValue.puncture_point_oozing_blood == 1">有</span>
                        <span v-if="formValue.puncture_point_oozing_blood == 2">无</span>
                    </template>
                    <van-radio-group v-model="formValue.puncture_point_oozing_blood">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="'1'">有</van-radio>
                        <van-radio :name="'2'">无</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-collapse-item v-if="isShow('患者去向')" title="患者去向" name="patient_gose">
                  <template slot="title">
                  <div><span v-if="isShow_title('患者去向')" class="warn_tip">*</span>患者去向</div>
                  </template>
                    <template #value>
                        <div>{{GetPatientGoes(formValue.patient_gose)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.patient_gose">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in this.$store.getters.patient_gose' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-collapse-item v-if="isShow('压迫后内瘘震颤')" title="压迫后内瘘震颤" name="internal_fistula_tremor_ac">
                    <template slot="title">
                  <div><span v-if="isShow_title('压迫后内瘘震颤')" class="warn_tip">*</span>压迫后内瘘震颤</div>
                  </template>
                    <template #value>
                        <div>{{GetIFTAValue(formValue.internal_fistula_tremor_ac)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.internal_fistula_tremor_ac">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in this.$store.getters.internal_fistula_tremor_ac' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-field v-model="formValue.inpatient_department" @focus="inputFocus" v-if="formValue.patient_gose==3&&isShow('科室')" :required="formValue.patient_gose==3&&isShow_title('科室')" label="科室" input-align="right"/>
                <van-collapse-item v-if="formValue.patient_gose==3&&isShow('交待病房护士/患者/陪人观察内容')" title="交待病房护士/患者/陪人观察内容" name="observation_content">
                    <template slot="title">
                  <div><span v-if="formValue.patient_gose==3&&isShow_title('交待病房护士/患者/陪人观察内容')" class="warn_tip">*</span>交待病房护士/患者/陪人观察内容</div>
                  </template>
                    <template #value>
                        <div>{{formValue.observation_content}}</div>
                    </template>
                    <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
                </van-collapse-item>
                <van-field v-model="formValue.observation_content_other" @focus="inputFocus" v-if="formValue.patient_gose==3&&isShow('其他观察内容')" :required="formValue.patient_gose==3&&isShow_title('其他观察内容')" label="其他观察内容" input-align="right"/>
                <van-field v-model="formValue.actual_displacement" @focus="inputFocus" :required="isShow_title('实际置换量')" v-if="isShow('实际置换量') && (prescription_prop.mode_id == 2 || prescription_prop.mode_id == 5 || prescription_prop.mode_id == 12 || prescription_prop.mode_id == 13 || prescription_prop.mode_id == 28 || prescription_prop.mode_id == 10 )" type="number" input-align="right">
                    <template #label>
                        <span v-if="template_id == 20 || template_id == 21">实际置换量(ml)</span>
                        <span v-else>实际置换量(L)</span>
                    </template>
                </van-field>
                <van-field v-model="formValue.temperature" @focus="inputFocus" v-if="isShow('体温')" :required="isShow_title('体温')" label="体温(℃)" type="number" input-align="right"/>
                <van-field v-model="formValue.systolic_blood_pressure" @focus="inputFocus" v-if="isShow('收缩压')" :required="isShow_title('收缩压')" label="收缩压(mmHg)" type="number" input-align="right"/>
                <van-field v-model="formValue.diastolic_blood_pressure" @focus="inputFocus" v-if="isShow('舒张压')" :required="isShow_title('舒张压')" label="舒张压(mmHg)" type="number" input-align="right"/>
                <van-field v-model="formValue.supine_systolic_blood_pressure" @focus="inputFocus" v-if="isShow('卧位收缩压')" :required="isShow_title('卧位收缩压')" label="卧位收缩压(mmHg)" type="number" input-align="right"/>
                <van-field v-model="formValue.supine_diastolic_blood_pressure" @focus="inputFocus" v-if="isShow('卧位舒张压')" :required="isShow_title('卧位舒张压')" label="卧位舒张压(mmHg)" type="number" input-align="right"/>
                <van-field v-model="formValue.setting_pressure" @focus="inputFocus" v-if="isShow('坐位收缩压')" :required="isShow_title('坐位收缩压')" label="坐位收缩压(mmHg)" type="number" input-align="right"/>
                <van-field v-model="formValue.diastolic_pressure" @focus="inputFocus" v-if="isShow('坐位舒张压')" :required="isShow_title('坐位舒张压')" label="坐位舒张压(mmHg)" type="number" input-align="right"/>
                <van-field v-model="formValue.breathing_rate" @focus="inputFocus" v-if="isShow('呼吸频率') && $store.getters.user.template_info.org_id != 10551" :required="isShow_title('呼吸频率')" label="呼吸频率(次/min)"  input-align="right"/>
                <van-field v-model="formValue.breathing_rate" @focus="inputFocus" v-if="isShow('呼吸频率') && $store.getters.user.template_info.org_id == 10551" :required="isShow_title('呼吸频率')" label="呼吸频率(次/min)" type="number"  input-align="right"/>
                <van-field v-model="formValue.pulse_frequency" @focus="inputFocus" v-if="isShow('脉搏')" :required="isShow_title('脉搏')" label="脉搏(次/分)" type="number" input-align="right"/>
                <van-collapse-item v-if="isShow('透后症状')" title="透后症状" name="symptom_after_dialysis">
                  <template slot="title">
                  <div><span v-if="isShow_title('透后症状')" class="warn_tip">*</span>透后症状</div>
                </template>
                    <template #value>
                        <div>{{formValue.symptom_after_dialysis}}</div>
                    </template>
                    <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
                </van-collapse-item>
                <van-field v-model="formValue.symptom_after_dialysis_remark" v-if="$store.getters.user.template_info.org_id == 10164 || $store.getters.user.template_info.org_id == 10599" @focus="inputFocus"  label="透后症状" />
                <van-field v-model="formValue.dialysis_intakes" @focus="inputFocus" v-if="isShow('透析中入量')" :required="isShow_title('透析中入量')" label="透析中入量"  input-align="right"/>
                <van-collapse-item v-if="isShow('透析中入量单位')" title="透析中入量单位" name="dialysis_intakes_unit">
                    <template slot="title">
                  <div><span v-if="isShow_title('透析中入量单位')" class="warn_tip">*</span>透析中入量单位</div>
                </template>
                    <template #value>
                        <div>{{getUnit(formValue.dialysis_intakes_unit)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.dialysis_intakes_unit">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in unit' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-field v-model="formValue.return_blood" @focus="inputFocus" v-if="isShow('回血')" :required="isShow_title('回血')" label="回血(ml)" type="number" input-align="right"/>
                <van-field v-model="formValue.rehydration_volume" @focus="inputFocus" v-if="isShow('补液量')" :required="isShow_title('补液量')" label="补液量(ml)" type="number" input-align="right"/>
                <van-field v-model="formValue.dialysis_during" @focus="inputFocus" v-if="isShow('透析中进食')" :required="isShow_title('透析中进食')" type="number" input-align="right">
                    <template #label>
                        <span v-if="template_id != 36 && template_id != 6">透析中进食(ml)</span>
                        <span v-else>透析中进食(kg)</span>
                    </template>
                </van-field>
                <van-field v-model="formValue.stroke_volume" @focus="inputFocus" v-if="isShow('出量')" :required="isShow_title('出量')" label="出量(ml)" type="number" input-align="right"/>
                <van-collapse-item v-if="isShow('血流量')" title="血流量" name="blood_flow">
                    <template slot="title">
                    <div><span v-if="isShow_title('血流量')" class="warn_tip">*</span>血流量</div>
                    </template>
                    <template #value>
                        <div>{{BloodFlowById(formValue.blood_flow)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.blood_flow">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in bloodFlowList' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-collapse-item v-if="isShow('封管液配置')" title="封管液配置" name="sealing_fluid_dispose">
                  <template slot="title">
                    <div><span v-if="isShow_title('封管液配置')" class="warn_tip">*</span>封管液配置</div>
                    </template>
                    <template #value>
                        <div>{{formValue.sealing_fluid_dispose}}</div>
                    </template>
                    <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
                </van-collapse-item>
                <van-field v-model="formValue.sealing_fluid_special" @focus="inputFocus" :required="sealing_fluid_dispose_name == '特殊' && isShow_title('封管液特殊')" v-if="sealing_fluid_dispose_name == '特殊' && isShow('封管液特殊')" label="封管液配置(特殊)" input-align="right"/>
                <van-collapse-item v-if="isShow('血管通路部位')" title="血管通路部位" name="blood_access_part_id">
                  <template slot="title">
                    <div><span v-if="isShow_title('血管通路部位')" class="warn_tip">*</span>血管通路部位</div>
                    </template>
                    <template #value>
                        <div>{{QueryPartById(formValue.blood_access_part_id)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.blood_access_part_id">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in this.$store.getters.vascular_access' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-collapse-item v-if="isShow('血管通路操作')" title="血管通路操作" name="blood_access_part_opera_id">
                    <template slot="title">
                    <div><span v-if="isShow_title('血管通路操作')" class="warn_tip">*</span>血管通路操作</div>
                    </template>
                    <template #value>
                        <div>{{QueryOperaById(formValue.blood_access_part_opera_id)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.blood_access_part_opera_id">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in this.$store.getters.vascular_access_desc' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-collapse-item v-if="isShow('内瘘震颤和血管杂音')" title="内瘘震颤和血管杂音" name="tremor_noise">
                    <template slot="title">
                    <div><span v-if="isShow_title('内瘘震颤和血管杂音')" class="warn_tip">*</span>内瘘震颤和血管杂音</div>
                    </template>
                    <template #value>
                        <div>{{getTremorNoise(formValue.tremor_noise)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.tremor_noise">
                        <van-radio name="-2" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in this.$store.getters.tremor_noise' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-collapse-item v-if="isShow('失衡综合症')" title="失衡综合症" name="disequilibrium_syndrome">
                    <template slot="title">
                    <div><span v-if="isShow_title('失衡综合症')" class="warn_tip">*</span>失衡综合症</div>
                    </template>
                    <template #value>
                        <div>{{getDisequilibriumSyndrome(formValue.disequilibrium_syndrome)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.disequilibrium_syndrome">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in this.$store.getters.disequilibrium_syndrome' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-collapse-item v-if="formValue.disequilibrium_syndrome == 2 && isShow('失衡综合症症状')" title="失衡综合症症状" name="disequilibrium_syndrome_option">
                    <template slot="title">
                    <div><span v-if="isShow_title('失衡综合症症状')" class="warn_tip">*</span>失衡综合症症状</div>
                    </template>
                    <template #value>
                        <div>{{formValue.disequilibrium_syndrome_option}}</div>
                    </template>
                    <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
                </van-collapse-item>
                <van-collapse-item v-if="isShow('透析期间进食')" title="透析期间进食" name="is_eat">
                    <template slot="title">
                    <div><span v-if="isShow_title('透析期间进食')" class="warn_tip">*</span>透析期间进食</div>
                    </template>
                    <template #value>
                        <span v-if="formValue.is_eat == 0" class="text" style="width: 50px"></span>
                        <span v-if="formValue.is_eat == 1" class="text" style="width: 50px">有</span>
                        <span v-if="formValue.is_eat == 2" class="text" style="width: 50px">无</span>
                    </template>
                    <van-radio-group v-model="formValue.is_eat">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="1">有</van-radio>
                        <van-radio :name="2">无</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-field v-model="formValue.cvc_a" @focus="inputFocus" v-if="isShow('中心静脉封管(肝素-A端)')" :required="isShow_title('中心静脉封管(肝素-A端)')" label="中心静脉封管(肝素-A端)(ml)" type="number" input-align="right"/>
                <van-field v-model="formValue.cvc_v" @focus="inputFocus" v-if="isShow('中心静脉封管(肝素-V端)')" :required="isShow_title('中心静脉封管(肝素-V端)')" label="中心静脉封管(肝素-V端)(ml)" type="number" input-align="right"/>
                <van-collapse-item v-if="isShow('管路')" title="管路" name="channel">
                    <template slot="title">
                    <div><span v-if="isShow_title('管路')" class="warn_tip">*</span>管路</div>
                    </template>
                    <template #value>
                        <div>{{getChannelName(formValue.channel)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.channel">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in this.$store.getters.channel' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-field v-model="formValue.dosage_of_anticoagulants" @focus="inputFocus" v-if="isShow('实际抗凝剂用量')" :required="isShow_title('实际抗凝剂用量')" label="实际抗凝剂用量" type="number" input-align="right"/>
                 <van-field v-model="formValue.urr" @focus="inputFocus" v-if="isShow('URR')" :required="isShow_title('URR')" label="URR"  input-align="right"/>
                  <van-collapse-item v-if="isShow('透析相关高血压')" title="透析相关高血压" name="hypertenison">
                    <template slot="title">
                    <div><span v-if="isShow_title('透析相关高血压')" class="warn_tip">*</span>透析相关高血压</div>
                    </template>
                    <template #value>
                        <span v-if="formValue.hypertenison == 0" class="text" style="width: 50px"></span>
                        <span v-if="formValue.hypertenison == 1" class="text" style="width: 50px">有</span>
                        <span v-if="formValue.hypertenison == 2" class="text" style="width: 50px">无</span>
                    </template>
                    <van-radio-group v-model="formValue.hypertenison">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="1">有</van-radio>
                        <van-radio :name="2">无</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-collapse-item v-if="isShow('透析相关低血压')" title="透析相关低血压" name="hypopiesia">
                  <template slot="title">
                    <div><span v-if="isShow_title('透析相关低血压')" class="warn_tip">*</span>透析相关低血压</div>
                    </template>
                    <template #value>
                        <span v-if="formValue.hypopiesia == 0" class="text" style="width: 50px"></span>
                        <span v-if="formValue.hypopiesia == 1" class="text" style="width: 50px">有</span>
                        <span v-if="formValue.hypopiesia == 2" class="text" style="width: 50px">无</span>
                    </template>
                    <van-radio-group v-model="formValue.hypopiesia">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="1">有</van-radio>
                        <van-radio :name="2">无</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <!-- <van-cell title='离科方式' v-if="isShow('离科方式')"> -->
                <van-collapse-item v-if="isShow('离科方式')" title="离科方式" name="leave_office_method">
                  <template slot="title">
                    <div><span v-if="isShow_title('离科方式')" class="warn_tip">*</span>离科方式</div>
                    </template>
                    <template #value>
                        <div>{{ GetWay(formValue.leave_office_method) }}</div>
                    </template>
                    <van-radio-group v-model="formValue.leave_office_method">
                        <van-radio name="-2" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in leaveOfficeList' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <!-- </van-cell> -->
                 <van-collapse-item v-if="isShow('转归')" title="转归" name="lapse">
                  <template slot="title">
                    <div><span v-if="isShow_title('转归')" class="warn_tip">*</span>转归</div>
                    </template>
                    <template #value>
                        <div>{{ GetLapse(formValue.lapse) }}</div>
                    </template>
                    <van-radio-group v-model="formValue.lapse">
                        <van-radio name="" key="-2">请选择</van-radio>
                        <van-radio :name="item.id" v-for='(item,index) in lapseList' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>
                <van-field v-model="formValue.ktv" rows="1" autosize label="KT/V" v-if="isShow('KT/V')" :required="isShow_title('KT/V')" type="textarea" input-align="right"/>
                <van-cell title='意识' v-if="isShow('意识')" :required="isShow_title('意识')">
                     <template #label>
                         <van-radio-group v-model="formValue.consciousness">
                            <van-radio name="-2" key="-2">请选择</van-radio>
                            <van-radio :name="item.id" v-for='(item,index) in consciousnessList' :key="index">{{ item.name }}</van-radio>
                         </van-radio-group>
                      </template>
                </van-cell>
               <van-cell title='跌倒风险' v-if="isShow('跌倒风险')" :required="isShow_title('跌倒风险')">
                     <template #label>
                         <van-radio-group v-model="formValue.fallrisk">
                            <van-radio name="-2" key="-2">请选择</van-radio>
                            <van-radio :name="item.id" v-for='(item,index) in fallriskList' :key="index">{{ item.name }}</van-radio>
                         </van-radio-group>
                      </template>
                </van-cell>
                <van-cell title='机器运行' v-if="isShow('机器运行')" :required="isShow_title('机器运行')">
                     <template #label>
                         <van-radio-group v-model="formValue.machine_run">
                            <van-radio name="-2" key="-2">请选择</van-radio>
                            <van-radio :name="item.name" v-for='(item,index) in machineList' :key="index">{{ item.name }}</van-radio>
                         </van-radio-group>
                      </template>
                </van-cell>
                 <van-field v-model="formValue.after_urea" @focus="inputFocus" v-if="isShow('透后尿素')" :required="isShow_title('透后尿素')" label="透后尿素(mmol/L)"  input-align="right"/>
                  <van-field v-model="formValue.accumulated_blood_volume" @focus="inputFocus" v-if="isShow('累计血容量')" :required="isShow_title('累计血容量')" label="透析血容量(L)"  input-align="right"/>
                  <van-field v-model="formValue.transfusion_volume" @focus="inputFocus" v-if="isShow('输液量')" :required="isShow_title('输液量')" label="输液量(ml)"  input-align="right"/>
                 <van-collapse-item v-if="isShow('管路凝血')" title="管路凝血" name="pip_coagulation">
                    <template slot="title">
                    <div><span v-if="isShow_title('管路凝血')" class="warn_tip">*</span>管路凝血</div>
                    </template>
                    <template #value>
                        <div>{{formValue.pip_coagulation}}</div>
                    </template>
                    <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
                 </van-collapse-item>
                <van-field v-model="formValue.displace_liqui_value" @focus="inputFocus" v-if="isShow('置换液总量') && (prescription_prop.mode_id == 2 || prescription_prop.mode_id == 5 || prescription_prop.mode_id == 12 || prescription_prop.mode_id == 13 || prescription_prop.mode_id == 28 || prescription_prop.mode_id == 10 )" :required="isShow_title('置换液总量')" label="置换液总量(L)" type="number" input-align="right"/>
                <van-field v-model="formValue.remark" rows="1" autosize label="备注" :required="isShow_title('备注')" type="textarea" input-align="right"/>

            </van-collapse>

        </div>
        <div class="preserveBox">
            <div @click="commitInfo" v-if="hasPermission && isCommit">保存</div>
            <div v-else class="disabled">保存</div>
        </div>
        <mt-datetime-picker
            class="datetimePicker"
            ref="picker"
            type="time"
            hourFormat="{value}小时"
            minuteFormat="{value}分钟"
            @confirm="handleTimeConfirm"
            v-model="time"
        ></mt-datetime-picker>


        <mt-datetime-picker
          class="datetimePicker"
          ref="start_time_picker"
          type="datetime"
          @confirm="didSelectStartTime"
          v-model="formValue.start_time"
        ></mt-datetime-picker>

       <van-popup
        v-model="infor_visibility"
        class="advicePopup"
        get-container="#today_panel"
      >
        <infor-sub-menu
        :visibility="infor_visibility"
        v-on:menu-cancle-three="menuCancleFour"
        v-on:menu-comfirm-three="menuComfirmFour"
        >
      </infor-sub-menu>


      </van-popup>
    </div>
</template>

<script>
import {commitAssessmentAfterDislysis,saveMobileInformation} from '@/api/dialysis'
import {Toast} from 'vant'
import {getDataConfig} from '@/utils/data'
import { Dialog } from "vant";

import request from '@/utils/request'
import checkBoxMenu from './components/checkBoxMenu'
import InforSubMenu from "../dialog/subMenu/InforSubMenu.vue"
import { parseTime } from "@/utils";
import { uParseTime } from '@/utils/tools'
const moment = require('moment');
export default {
  props: {
    record: {
      type: Object
    },
    last_record: {
      type: Object
    },
    patient_prop: {
      type: Object
    },
    predialysis: {
      type: Object
    },
    prescription_prop: {
      type: Object
    },
    last_monitor:{
      type:Object
    }
  },
  components: {
    checkBoxMenu,
    InforSubMenu
  },
  data () {
    return {
      showTxt: '',
      hasPermission: true,
      activeNames: '',
      checkBoxShow: false,
      timeValue: '',
      body_weight_after: '',
      formValue: {

        actual_ultrafiltration: '',
        weight_after: '',
        additional_weight: '',
        weight_loss: '',
        puncture_point_haematoma: '',
        complication: '',
        internal_fistula: '',
        catheter: '',
        dialysis_process: '',
        hemostasis_minute: '',
        hemostasis_opera: '',
        arterial_tube: '',
        intravenous_tube: '',
        cruor: '',
        puncture_point_oozing_blood: '',
        patient_gose: '',
        internal_fistula_tremor_ac: '',
        inpatient_department: '',
        observation_content: '',
        observation_content_other: '',
        actual_displacement: '',
        temperature: '',
        systolic_blood_pressure: '',
        diastolic_blood_pressure: '',
        supine_systolic_blood_pressure: '',
        supine_diastolic_blood_pressure: '',
        setting_pressure: '',
        diastolic_pressure: '',
        breathing_rate: '',
        pulse_frequency: '',
        symptom_after_dialysis: '',
        dialysis_intakes: '',
        dialysis_intakes_unit: 0,
        return_blood: '',
        rehydration_volume: '',
        dialysis_during: '',
        stroke_volume: '',
        blood_flow: '',
        sealing_fluid_dispose: '',
        sealing_fluid_special: '',
        blood_access_part_id: 0,
        blood_access_part_opera_id: 0,
        tremor_noise: '',
        disequilibrium_syndrome: '',
        disequilibrium_syndrome_option: '',
        is_eat: '',
         cvc_a: '',
        cvc_v: '',
        channel: '',
        dosage_of_anticoagulants: '',
        urr: '',
        hypertenison: '',
        hypopiesia: '',
        leave_office_method: '',
        lapse: '',
        ktv: '',
        consciousness: '',
        fallrisk: '',
        machine_run: '',
        after_urea: '',
        accumulated_blood_volume: '',
        pip_coagulation: '',//
        remark: '',
        actual_treatment_hour: '',
        actual_treatment_minute: '',
        in_advance_minute: '',
        in_advance_reason: '',
        in_advance_reason_other: '',
        dialyzer: '',
        other_complication: '',
        transfusion_volume:"",
        condenser:"",
        last_after_weight:"",
        displace_liqui_value:"",
        after_weight:"",
        start_time: moment().format('YYYY-MM-DD HH:mm:ss'),
        symptom_after_dialysis_remark:""
      },
      propForm: {
        title: '',
        list: [],
        optionList: [],
        isMultiple: 2,
        result: [], // 选中的值
        type: 1, // 用来区分不同子菜单，方便对返回值进行赋值
        selectId: 0,
        isHasOther: 1
      },
      unit: [{id: 1, name: 'g'}, {id: 2, name: 'ml'}, {id: 3, name: 'kg'},{id:4,name:"L"}],
      sealing_fluid_dispose_name: '',
      changeAssessmentAfter: 0,
      leaveOfficeList: [],
      consciousnessList: [],
      fallriskList: [],
      bloodFlowList: [],
      lapseList: [],
      machineList: [],
      isCommit: true,
      coagulationList: [],
      infor_visibility:false,
      start_time_str: "",
    
    }
  },
  computed: {
    newFormValue () {
      return JSON.parse(JSON.stringify(this.formValue))
    }
  },
  created () {
    console.log("中国",this.record)

    if(this.record.id == 0){
     this.start_time_str = ""
    }
    if(this.record.id>0){
      console.log("hahahhahwowoowowow")
      if (this.record.record_time == 0) {
        this.start_time_str = ""
      } else {
        this.start_time_str = this.getTimeOne(this.record.record_time)
        console.log("日期好女孩红红火火恍恍惚惚哈哈哈哈哈哈哈哈哈",this.start_time_str)
      }
    }

    this.getPermission()
    let initHour = ''
    let initMinute = ''
    let tempHour = ''
    let tempMinute = ''
    this.template_id = this.$store.getters.user.template_info.template_id
    this.leaveOfficeList = getDataConfig('hemodialysis', 'leave_office_method')
    this.consciousnessList = getDataConfig('hemodialysis', 'consciousness')
    console.log('意识', this.consciousnessList)
    this.fallriskList = getDataConfig('hemodialysis', 'fallrisk')
    this.bloodFlowList = getDataConfig('hemodialysis', 'blood_flow')
    this.lapseList = getDataConfig('hemodialysis', 'lapse')
    this.machineList = getDataConfig('hemodialysis', 'machine_run')
    this.coagulationList = getDataConfig('hemodialysis', 'pip_coagulation')
    if (this.record != null && this.record.id != '') {
      for (const key in this.formValue) {
        this.formValue[key] = this.record[key]
      }
    }

    if ((this.record.id == undefined || this.record.id == '') && this.predialysis.id != undefined) {
      this.$set(
        this.formValue,
        'additional_weight',
        this.predialysis['additional_weight'].toString()
      )
    }
   
    if (this.record != null && this.record.id != '') {
      this.formValue.actual_ultrafiltration = this.record.actual_ultrafiltration
      this.formValue.weight_loss = this.record.weight_loss
      //解决透后体重不上传的问题
      if(this.formValue.weight_after == 0){
         this.formValue.weight_after = this.record.weight_after
      }


    } else {
      
      if (this.last_record != null && this.last_record.id > 0) {
        for (var key in this.last_record) {
          if (key != 'actual_treatment_hour' && key != 'actual_treatment_minute' && key != 'weight_loss' && key != 'weight_after' && key != 'systolic_blood_pressure' && key != 'diastolic_blood_pressure' && key != 'pulse_frequency' && key != 'remark') {
            this.$set(this.formValue, key, this.last_record[key]
            )
          }
        }
      }
    }
    console.log('小时2332322323', this.formValue.actual_treatment_hour)
    if (typeof this.formValue.actual_treatment_hour === 'undefined') {
      tempHour = ''
      initHour = '00'
    } else {
      tempHour = this.formValue.actual_treatment_hour + '小时'
      console.log('23323232233', tempHour)
      if (parseInt(this.formValue.actual_treatment_hour) < 10) {
        initHour = '0' + this.formValue.actual_treatment_hour
      } else {
        initHour = this.formValue.actual_treatment_hour
      }
    }
    if (typeof this.formValue.actual_treatment_minute === 'undefined') {
      tempMinute = ''
      initMinute = '00'
    } else {
      tempMinute = this.formValue.actual_treatment_minute + '分钟'

      if (parseInt(this.formValue.actual_treatment_minute) < 10) {
        initMinute = '0' + this.formValue.actual_treatment_minute
      } else {
        initMinute = this.formValue.actual_treatment_minute
      }
    }

    this.time = initHour + ':' + initMinute
    this.timeValue = tempHour + tempMinute
    console.log('timeValue33232323232', this.timeValue)
    var date = this.$route.query && this.$route.query.date
    date *= 1000
    var newDate = new Date(date)

    var y = newDate.getFullYear()
    var m = newDate.getMonth() + 1
    var d = newDate.getDate()
    if (isNaN(y) || isNaN(m) || isNaN(d)) {
      newDate = new Date()
      y = newDate.getFullYear()
      m = newDate.getMonth() + 1
      d = newDate.getDate()
    }
    this.record_date =
            y + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d)

    this.puncture_point_oozing_blood_state = this.formValue.puncture_point_oozing_blood == 0
    this.puncture_point_haematoma_state = this.formValue.puncture_point_haematoma == 0
    this.eat_state = this.formValue.is_eat == 0

    if (this.formValue.weight_after == '') {
      this.formValue.weight_loss = ''
    } else {
      this.formValue.weight_loss = this.record.weight_loss
    }

    console.log('this.formValue.weight_loss', this.formValue.weight_loss)
    console.log('this.record.weight_loss', this.record.weight_loss)

    if (this.record != null && this.record != undefined) {
      this.formValue.actual_ultrafiltration = this.record.actual_ultrafiltration

      // if(this.$store.getters.user.template_info.org_id==10580){
      //   this.formValue.actual_ultrafiltration = this.record.weight_loss*1000
      // }
      if(this.$route.query.patient_id ==18695){
          this.formValue.actual_displacement = 0
      }
      if(this.$route.query.patient_id ==18695){
          this.formValue.actual_displacement = 0
      }

      //干体重默认透前评估里面的干体重
      if(this.$store.getters.user.template_info.org_id==10138 || this.$store.getters.user.template_info.org_id==10278 ||  this.$store.getters.user.template_info.org_id==0 || this.$store.getters.user.template_info.org_id==3877 || this.$store.getters.user.template_info.org_id==10551 || this.$store.getters.user.template_info.org_id==10558 || this.$store.getters.user.template_info.org_id==10515 || this.$store.getters.user.template_info.org_id==10597 || this.$store.getters.user.template_info.org_id==10599 || this.$store.getters.user.template_info.org_id==10598  || this.$store.getters.user.template_info.org_id==10510 || this.$store.getters.user.template_info.org_id==10629 || this.$store.getters.user.template_info.org_id==10702 || this.$store.getters.user.template_info.org_id==10721 || this.$store.getters.user.template_info.org_id==10726 || this.$store.getters.user.template_info.org_id==10727 || this.$store.getters.user.template_info.org_id==10723|| this.$store.getters.user.template_info.org_id==10599 || this.$store.getters.user.template_info.org_id==10597){
          this.formValue.additional_weight = this.predialysis.additional_weight
          this.formValue.patient_gose = "1"
      }
      if(this.$store.getters.user.template_info.org_id==10551){
         this.formValue.dialysis_intakes = 0
      }
      console.log("干体重",this.formValue.additional_weight)
    }

    if(this.record!=null && (this.record.id == "" || this.record.id == 0)){
      if(this.$store.getters.user.template_info.org_id==10597){
          this.formValue.cruor =""
      }
      if(this.$store.getters.user.template_info.org_id==9829){
        this.formValue.pulse_frequency= 80
      }
    }

    if(this.$store.getters.user.template_info.org_id==10679){
      if(this.formValue.weight_after == 0){
        this.formValue.weight_after =  this.predialysis.weight_before - this.prescription_prop.target_ultrafiltration
      }
      if(this.formValue.temperature == 0){
         this.formValue.temperature = 36.5
      }
      if(this.formValue.systolic_blood_pressure == 0){
         this.formValue.systolic_blood_pressure = this.last_monitor.systolic_blood_pressure
      }
      if(this.formValue.diastolic_blood_pressure == 0){
        this.formValue.diastolic_blood_pressure = this.last_monitor.diastolic_blood_pressure
      }
      if(this.formValue.pulse_frequency == 0){
         this.formValue.pulse_frequency = this.last_monitor.pulse_frequency
      }
      console.log("最后一次透析监测",this.last_monitor)

    }

    if(this.$store.getters.user.template_info.org_id==10721){
     
      if(this.formValue.temperature == 0){
         this.formValue.temperature = 36.5
      }
     
      if(this.formValue.pulse_frequency == 0){
         this.formValue.pulse_frequency = this.last_monitor.pulse_frequency
      }
      console.log("最后一次透析监测",this.last_monitor)

    }

    if(this.$store.getters.user.template_info.org_id ==10677){
      if(this.formValue.temperature == 0){
         this.formValue.temperature = 36.5
      }
      if(this.formValue.systolic_blood_pressure == 0){
         this.formValue.systolic_blood_pressure = this.last_monitor.systolic_blood_pressure
      }
      if(this.formValue.diastolic_blood_pressure == 0){
        this.formValue.diastolic_blood_pressure = this.last_monitor.diastolic_blood_pressure
      }
      if(this.formValue.pulse_frequency == 0){
         this.formValue.pulse_frequency = this.last_monitor.pulse_frequency
      }
    }

  },
  methods: {
    getTimeOne (time) {
      return uParseTime(time, '{y}-{m}-{d} {h}:{i}:{s}')
    },
    didSelectStartTime: function (time) {
      this.start_time_str =  parseTime(time, "{y}-{m}-{d} {h}:{i}") + ":00";
    },
    selectStartTimeAction() {
      this.$refs.start_time_picker.open();
    },
    inputFocus: function (event) {
      var input = event.target
      setTimeout(function () {
        input.scrollIntoView()
      }, 0)

      if (input.setSelectionRange) {
        setTimeout(function () {
          input.setSelectionRange(0, input.value.length)
        }, 0)
      } else if (input.createTextRange) {
        var rng = input.createTextRange()
        rng.move('character', input.value.length)
        rng.select()
      }
    },
    isShow_title (name) {
      var filedList = this.$store.getters.user.fileds
      for (let i = 0; i < filedList.length; i++) {
        if (filedList[i].module == 5 && filedList[i].filed_name_cn == name && filedList[i].is_show == 1&&
          filedList[i].is_write == 1) {
          return true
        }
      }
      return false
    },
    isShow (name) {
      var filedList = this.$store.getters.user.fileds
      for (let i = 0; i < filedList.length; i++) {
        if (filedList[i].module == 5 && filedList[i].filed_name_cn == name && filedList[i].is_show == 1) {
          return true
        }
      }
      return false
    },
    isShow2 (name) {
      var filedList = this.$store.getters.user.fileds
      for (let i = 0; i < filedList.length; i++) {
        if (filedList[i].module == 3 && filedList[i].filed_name_cn == name && filedList[i].is_show == 1) {
          return true
        }
      }
      return false
    },
    openPicker: function () {
      this.$refs.picker.open()
    },
    handleTimeConfirm: function (val) {
      val = val.replace('小时')
      val = val.replace('分钟')
      let timeArray = val.split(':')
      if (parseInt(timeArray[0].substring(0, 1)) == 0) {
        this.formValue.actual_treatment_hour = timeArray[0].charAt(
          timeArray[0].length - 1
        )
      } else {
        this.formValue.actual_treatment_hour = timeArray[0]
      }

      if (parseInt(timeArray[1].substring(0, 1)) == 0) {
        this.formValue.actual_treatment_minute = timeArray[1].charAt(
          timeArray[1].length - 1
        )
      } else {
        this.formValue.actual_treatment_minute = timeArray[1]
      }
      this.timeValue =
                this.formValue.actual_treatment_hour +
                '小时' +
                this.formValue.actual_treatment_minute +
                '分钟'
    },
    showSubMenu: function (val) {
      this.checkBoxShow = true
      switch (val) {
        case 'cruor':
          this.propForm.type = 1
          this.isShowDialog = false
          this.propForm.title = '凝血'
          this.propForm.isHasOther = 2
          this.visibility = true
          this.propForm.list = []
          this.propForm.list = getDataConfig('hemodialysis', 'cruor')
          this.propForm.optionList = []
          this.propForm.isMultiple = 2
          if (
            this.formValue.cruor != undefined ||
                    this.formValue.cruor != null
          ) {
            if (this.formValue.cruor.length > 0) {
              this.propForm.result = this.formValue.cruor.split(',')
            } else {
              this.propForm.result = []
            }
          } else {
            this.propForm.result = []
          }
          this.propForm.click_ref = 'cruor'
          break
        case 'symptom_after_dialysis':
          this.propForm.type = 2
          this.isShowDialog = false
          this.propForm.title = '透后症状'
          this.propForm.isHasOther = 2

          this.visibility = true
          this.propForm.list = []

          this.propForm.list = getDataConfig('hemodialysis', 'symptoms')
          this.propForm.optionList = []
          this.propForm.isMultiple = 2
          if (
            this.formValue.symptom_after_dialysis != undefined ||
                    this.formValue.symptom_after_dialysis != null
          ) {
            if (this.formValue.symptom_after_dialysis.length > 0) {
              this.propForm.result = this.formValue.symptom_after_dialysis.split(
                ','
              )
            } else {
              this.propForm.result = []
            }
          } else {
            this.propForm.result = []
          }
          this.propForm.click_ref = 'symptom_after_dialysis'
          break

        case 'catheter':
          this.propForm.type = 3
          this.isShowDialog = false
          this.propForm.title = '导管'
          this.visibility = true
          this.propForm.isHasOther = 2
          this.propForm.list = []

          this.propForm.list = getDataConfig('hemodialysis', 'catheter')
          this.propForm.optionList = []
          this.propForm.isMultiple = 2
          if (
            this.formValue.catheter != undefined ||
                    this.formValue.catheter != null
          ) {
            if (this.formValue.catheter.length > 0) {
              this.propForm.result = this.formValue.catheter.split(',')
            } else {
              this.propForm.result = []
            }
          } else {
            this.propForm.result = []
          }
          this.propForm.click_ref = 'catheter'
          break
        case 'complication':
          this.propForm.type = 4
          this.isShowDialog = false
          this.propForm.title = '并发症'
          this.propForm.isHasOther = 2

          this.visibility = true
          this.propForm.list = []

          this.propForm.list = getDataConfig('hemodialysis', 'complication')
          this.propForm.optionList = []
          this.propForm.isMultiple = 2
          // this.propForm.result = this.formValue.complication.split(",")
          if (
            this.formValue.complication != undefined ||
                    this.formValue.complication != null
          ) {
            if (this.formValue.complication.length > 0) {
              this.propForm.result = this.formValue.complication.split(',')
            } else {
              this.propForm.result = []
            }
          } else {
            this.propForm.result = []
          }
          this.propForm.click_ref = 'complication'
          break

        case 'blood_access_part':
          this.propForm.type = 5
          this.isShowDialog = false
          this.propForm.title = '血管通路部位'
          this.propForm.isHasOther = 2

          this.visibility = true
          this.propForm.list = []
          this.propForm.optionList = this.$store.getters.vascular_access
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.blood_access_part_id
          this.propForm.click_ref = 'blood_access_part'
          break

        case 'blood_access_opera':
          this.propForm.type = 6
          this.isShowDialog = false
          this.propForm.title = '血管通路操作'
          this.propForm.isHasOther = 2

          this.visibility = true
          this.propForm.list = []
          this.propForm.optionList = this.$store.getters.vascular_access_desc
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.blood_access_part_opera_id
          this.propForm.click_ref = 'blood_access_opera'
          break
        case 'internal_fistula':
          this.propForm.type = 7
          this.isShowDialog = false
          this.propForm.title = '内瘘'
          this.visibility = true
          this.propForm.list = []
          this.propForm.list = getDataConfig(
            'hemodialysis',
            'internal_fistula'
          )
          this.propForm.optionList = []
          this.propForm.isMultiple = 2
          this.propForm.isHasOther = 2

          if (
            this.formValue.internal_fistula != undefined ||
                    this.formValue.internal_fistula != null
          ) {
            if (this.formValue.internal_fistula.length > 0) {
              this.propForm.result = this.formValue.internal_fistula.split(',')
            } else {
              this.propForm.result = []
            }
          } else {
            this.propForm.result = []
          }
          this.propForm.click_ref = 'internal_fistula'
          break
        case 'internal_fistula_tremor_ac':
          this.propForm.type = 8
          this.isShowDialog = false
          this.propForm.title = '压迫后内瘘震颤'
          this.visibility = true
          this.propForm.list = []
          this.propForm.isHasOther = 2

          this.propForm.optionList = this.$store.getters.internal_fistula_tremor_ac
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.internal_fistula_tremor_ac
          this.propForm.click_ref = 'internal_fistula_tremor_ac'
          break
        case 'patient_gose':
          this.propForm.type = 9
          this.isShowDialog = false
          this.propForm.title = '患者去向'
          this.visibility = true
          this.propForm.list = []
          this.propForm.isHasOther = 2

          this.propForm.optionList = this.$store.getters.patient_gose
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.patient_gose
          this.propForm.click_ref = 'patient_gose'
          break

        case 'observation_content':
          this.propForm.type = 10
          this.isShowDialog = false
          this.propForm.title = '交待病房护士/患者/陪人观察内容'
          this.visibility = true
          this.propForm.isHasOther = 2
          this.propForm.list = []

          this.propForm.list = this.$store.getters.observation_content
          this.propForm.optionList = []
          this.propForm.isMultiple = 2
          if (
            this.formValue.observation_content != undefined ||
                    this.formValue.observation_content != null
          ) {
            if (this.formValue.observation_content.length > 0) {
              this.propForm.result = this.formValue.observation_content.split(
                ','
              )
            } else {
              this.propForm.result = []
            }
          } else {
            this.propForm.result = []
          }
          this.propForm.click_ref = 'observation_content'
          break

        case 'dialysis_process':
          this.propForm.type = 11
          this.isShowDialog = false
          this.propForm.title = '透析过程'
          this.visibility = true
          this.propForm.isHasOther = 2

          this.propForm.list = []
          this.propForm.optionList = this.$store.getters.dialysis_process
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.dialysis_process
          this.propForm.click_ref = 'dialysis_process'
          break

        case 'in_advance_reason':
          this.propForm.type = 12
          this.isShowDialog = false
          this.propForm.title = '透析过程提前原因'
          this.visibility = true
          this.propForm.isHasOther = 2
          this.propForm.list = []

          this.propForm.list = this.$store.getters.in_advance_reason
          this.propForm.optionList = []
          this.propForm.isMultiple = 2
          if (
            this.formValue.in_advance_reason != undefined ||
                    this.formValue.in_advance_reason != null
          ) {
            if (this.formValue.in_advance_reason.length > 0) {
              this.propForm.result = this.formValue.in_advance_reason.split(
                ','
              )
            } else {
              this.propForm.result = []
            }
          } else {
            this.propForm.result = []
          }
          this.propForm.click_ref = 'in_advance_reason'
          break

        case 'hemostasis_opera':
          this.propForm.type = 13
          this.isShowDialog = false
          this.propForm.title = '内瘘管拔针后压迫止血操作'
          this.visibility = true
          this.propForm.isHasOther = 2

          this.propForm.list = []
          this.propForm.optionList = this.$store.getters.hemostasis_opera
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.hemostasis_opera
          this.propForm.click_ref = 'hemostasis_opera'
          break
        case 'tremor_noise':
          this.propForm.type = 14
          this.isShowDialog = false
          this.propForm.title = '内瘘震颤和血管杂音'
          this.visibility = true
          this.propForm.isHasOther = 2

          this.propForm.list = []
          this.propForm.optionList = this.$store.getters.tremor_noise
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.tremor_noise
          this.propForm.click_ref = 'tremor_noise'
          break
        case 'disequilibrium_syndrome':
          this.propForm.type = 15
          this.isShowDialog = false
          this.propForm.title = '失衡综合症'
          this.visibility = true
          this.propForm.list = []
          this.propForm.isHasOther = 2

          this.propForm.optionList = this.$store.getters.disequilibrium_syndrome
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.disequilibrium_syndrome
          this.propForm.click_ref = 'disequilibrium_syndrome'
          break
        case 'disequilibrium_syndrome_option':
          this.propForm.type = 16
          this.isShowDialog = false
          this.propForm.title = '失衡综合症情况'
          this.visibility = true
          this.propForm.isHasOther = 2
          this.propForm.list = []

          this.propForm.list = this.$store.getters.disequilibrium_syndrome_option
          this.propForm.optionList = []
          this.propForm.isMultiple = 2
          if (
            this.formValue.disequilibrium_syndrome_option != undefined ||
                    this.formValue.disequilibrium_syndrome_option != null
          ) {
            if (this.formValue.disequilibrium_syndrome_option.length > 0) {
              this.propForm.result = this.formValue.disequilibrium_syndrome_option.split(
                ','
              )
            } else {
              this.propForm.result = []
            }
          } else {
            this.propForm.result = []
          }
          this.propForm.click_ref = 'disequilibrium_syndrome_option'
          break
        case 'arterial_tube':
          this.propForm.type = 17
          this.isShowDialog = false
          this.propForm.title = '动脉管道'
          this.propForm.isHasOther = 2
          this.propForm.list = []

          this.visibility = true
          this.propForm.list = []
          this.propForm.optionList = this.$store.getters.arterial_tube
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.arterial_tube
          this.propForm.click_ref = 'arterial_tube'
          break
        case 'intravenous_tube':
          this.propForm.type = 18
          this.isShowDialog = false
          this.propForm.title = '静脉管道'
          this.visibility = true
          this.propForm.list = []
          this.propForm.isHasOther = 2

          this.propForm.optionList = this.$store.getters.intravenous_tube
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.intravenous_tube
          this.propForm.click_ref = 'intravenous_tube'
          break
        case 'dialyzer':
          this.propForm.type = 19
          this.isShowDialog = false
          this.propForm.title = '透析器'
          this.visibility = true
          this.propForm.isHasOther = 2

          this.propForm.list = []
          this.propForm.optionList = this.$store.getters.dialyzer
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.dialyzer
          this.propForm.click_ref = 'dialyzer'
          break
        case 'puncture_point_oozing_blood':
          this.propForm.type = 20
          this.isShowDialog = false
          this.propForm.title = '拔针后穿刺点渗血'
          this.visibility = true
          this.propForm.isHasOther = 2

          this.propForm.list = []
          this.propForm.optionList = this.puncture_point_oozing_bloods
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.puncture_point_oozing_blood
          this.propForm.click_ref = 'puncture_point_oozing_blood'
          break
        case 'puncture_point_haematoma':
          this.propForm.type = 21
          this.isShowDialog = false
          this.propForm.title = '穿刺处血肿'
          this.visibility = true
          this.propForm.isHasOther = 2

          this.propForm.list = []
          this.propForm.optionList = this.puncture_point_haematomas
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.puncture_point_haematoma
          this.propForm.click_ref = 'puncture_point_haematoma'
          break
        case 'is_eat':
          this.propForm.type = 22
          this.isShowDialog = false
          this.propForm.title = '透析期间进食'
          this.visibility = true
          this.propForm.isHasOther = 2
          this.propForm.list = []
          this.propForm.optionList = this.eat
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.is_eat
          this.propForm.click_ref = 'is_eat'
          break
        case 'dialysis_intakes_unit':
          this.propForm.type = 23
          this.isShowDialog = false
          this.propForm.title = '透析中入量单位'
          this.visibility = true
          this.propForm.isHasOther = 2
          this.propForm.list = []
          this.propForm.optionList = this.unit
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.dialysis_intakes_unit
          this.propForm.click_ref = 'dialysis_intakes_unit'
          break
        case 'channel':
          this.propForm.type = 24
          this.isShowDialog = false
          this.propForm.title = '管路'
          this.visibility = true
          this.propForm.list = []
          this.propForm.isHasOther = 2
          this.propForm.optionList = this.$store.getters.channel
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.channel
          this.propForm.click_ref = 'channel'
          break
        case 'blood_flow':
          this.propForm.type = 25
          this.isShowDialog = false
          this.propForm.title = '血流量'
          this.propForm.isHasOther = 2

          this.visibility = true
          this.propForm.list = []
          this.propForm.optionList = getDataConfig('hemodialysis', 'blood_flow')
          this.propForm.isMultiple = 1
          this.propForm.selectId = this.formValue.blood_flow
          this.propForm.click_ref = 'blood_flow'
          break
        case 'sealing_fluid_dispose':
          this.propForm.type = 26
          this.isShowDialog = false
          this.propForm.title = '封管液配置'
          this.propForm.isHasOther = 2

          this.visibility = true
          this.propForm.list = []

          this.propForm.list = getDataConfig('hemodialysis', 'sealing_fluid_dispose')
          this.propForm.optionList = []
          this.propForm.isMultiple = 2
          if (
            this.formValue.sealing_fluid_dispose != undefined ||
                    this.formValue.sealing_fluid_dispose != null
          ) {
            if (this.formValue.sealing_fluid_dispose.length > 0) {
              this.propForm.result = this.formValue.sealing_fluid_dispose.split(',')
            } else {
              this.propForm.result = []
            }
          } else {
            this.propForm.result = []
          }
          this.propForm.click_ref = 'sealing_fluid_dispose'
          break
        case 'pip_coagulation':
          this.propForm.type = 27
          this.isShowDialog = false
          this.propForm.title = '管路凝血'
          this.propForm.isHasOther = 2

          this.visibility = true
          this.propForm.list = []

          this.propForm.list = getDataConfig('hemodialysis', 'pip_coagulation')
          this.propForm.optionList = []
          this.propForm.isMultiple = 2
          if (
            this.formValue.pip_coagulation != undefined ||
                    this.formValue.pip_coagulation != null
          ) {
            if (this.formValue.pip_coagulation.length > 0) {
              this.propForm.result = this.formValue.pip_coagulation.split(',')
            } else {
              this.propForm.result = []
            }
          } else {
            this.propForm.result = []
          }
          this.propForm.click_ref = 'pip_coagulation'
          break
      }
    },
    getString: function (val) {
      this.visibility = false
      this.isShowDialog = true
      this.$nextTick(() => {
        if (
          this.$refs[this.propForm.click_ref] != undefined &&
                    this.$refs[this.propForm.click_ref] != null
        ) {
          this.$refs[this.propForm.click_ref].scrollIntoView()
        }
      })
      switch (val.type) {
        case 1:
          this.formValue.cruor = val.result.join(',')
          break
        case 2:
          this.formValue.symptom_after_dialysis = val.result.join(',')
          break
        case 3:
          this.formValue.catheter = val.result.join(',')
          break
        case 4:
          this.formValue.complication = val.result.join(',')
          break
        case 5:
          this.formValue.blood_access_part_id = val.selectId
          break
        case 6:
          this.formValue.blood_access_part_opera_id = val.selectId
          break
        case 7:
          this.formValue.internal_fistula = val.result.join(',')
          break
        case 8:
          this.formValue.internal_fistula_tremor_ac = val.selectId
          break
        case 9:
          this.formValue.patient_gose = val.selectId
          break
        case 10:
          this.formValue.observation_content = val.result.join(',')
          break
        case 11:
          this.formValue.dialysis_process = val.selectId
          break
        case 12:
          this.formValue.in_advance_reason = val.result.join(',')
          break
        case 13:
          this.formValue.hemostasis_opera = val.selectId
          break
        case 14:
          this.formValue.tremor_noise = val.selectId
          break
        case 15:
          this.formValue.disequilibrium_syndrome = val.selectId
          break
        case 16:
          this.formValue.disequilibrium_syndrome_option = val.result.join(',')
          break
        case 17:
          this.formValue.arterial_tube = val.selectId
          break
        case 18:
          this.formValue.intravenous_tube = val.selectId
          break
        case 19:
          this.formValue.dialyzer = val.selectId

          break
        case 20:
          if (val.selectId == 1) {
            this.formValue.puncture_point_oozing_blood = val.selectId
            this.puncture_point_oozing_blood_state = true
          } else if (val.selectId == 2) {
            this.formValue.puncture_point_oozing_blood = val.selectId
            this.puncture_point_oozing_blood_state = false
          } else {
            this.formValue.puncture_point_oozing_blood = 0
          }

          break
        case 21:
          if (val.selectId == 1) {
            this.formValue.puncture_point_haematoma = val.selectId
            this.puncture_point_haematoma_state = true
          } else if (val.selectId == 2) {
            this.formValue.puncture_point_haematoma = val.selectId
            this.puncture_point_haematoma_state = false
          } else {
            this.formValue.puncture_point_haematoma = 0
          }
          break
        case 22:
          if (val.selectId == 1) {
            this.formValue.is_eat = val.selectId
            this.eat_state = true
          } else if (val.selectId == 2) {
            this.formValue.is_eat = val.selectId
            this.eat_state = false
          } else {
            this.formValue.is_eat = 0
          }
          break

        case 23:
          this.formValue.dialysis_intakes_unit = val.selectId
          break
        case 24:
          this.formValue.channel = val.selectId
          break
        case 25:
          this.formValue.blood_flow = val.selectId
          break
        case 26:
          this.formValue.sealing_fluid_dispose = val.result.join(',')
          break
        case 27:
          this.formValue.pip_coagulation = val.result.join(',')
          break
      }
    },
      getArrEqual(arr1, arr2) {
      let newArr = [];
      for (let i = 0; i < arr2.length; i++) {
        for (let j = 0; j < arr1.length; j++) {
          if (arr1[j].module == 5&&arr1[j].is_show == 1 &&arr1[j].filed_name === arr2[i][0]&&arr1[j].is_write == 1 ) {
              newArr.push(arr1[j]);
          }
        }
        // console.log(newArr,'newArr')
      }
       return newArr;
    },

    open_tips(info) {
      // console.log(info, "oo");
      for (let i = 0; i < info.length; i++) {
        if (info[i].is_write == 1) {
          // Dialog.alert({
          //   title: "必填提示",
          //   message: `${info[i].filed_name_cn}为必填字段，不能为空`,
          // }).then(() => {
          //   // on close
          // });
          Toast.fail(`${info[i].filed_name_cn}为必填字段，不能为空`)
        }
      }
    },
    isWrite(name) {
      var filedList = this.$store.getters.user.fileds;

      for (let i = 0; i < filedList.length; i++) {
        if (
          filedList[i].module == 5 &&
          filedList[i].filed_name_cn == name &&
          filedList[i].is_write == 1 &&
          filedList[i].is_show == 1
        ) {
          return true;
        }
      }

      return false;
    },
    commitInfo: function () {
      if(this.isWrite('实际治疗时长')&&
        this.formValue.actual_treatment_hour == ''&&
        this.formValue.actual_treatment_minute == '')
        {
          console.log('实际治疗时长',this.formValue.actual_treatment_hour);
        Toast.fail(`实际治疗时长为必填字段，不能为空`)
      } else if (this.isCommit == true) {

        let ParamsQuery = this.formValue
        ParamsQuery['patient'] = this.$route.query.patient_id
        ParamsQuery['record_date'] = this.record_date
        ParamsQuery['mode'] = '1'
        if (this.record.creater > 0) {
          ParamsQuery['mode'] = '2'
          if (this.$store.getters.user.admin.id != this.record.creater) {
            ParamsQuery['mode'] = '3'
          }
        }
        console.log('pramsquery', ParamsQuery)

        console.log("params----------",ParamsQuery)
        let newParams = ParamsQuery;
        // 必填弹窗开始
        console.log(newParams, "提交的参数");
        if(newParams.dialysis_process != 2){
            delete newParams.in_advance_minute
            delete newParams.in_advance_reason
            delete newParams.in_advance_reason_other
          }
          if(newParams.patient_gose != 3){
            delete newParams.inpatient_department
            delete newParams.observation_content_other
            delete newParams.observation_content
          }
          if(newParams.sealing_fluid_dispose != '特殊'){
            delete newParams.sealing_fluid_special
          }

          let result = [];
          let filedList = this.$store.getters.user.fileds;
          let new_arr = Object.entries(newParams);
          new_arr.forEach((el) => { //|| el[1] == "0"
            if (el[1] === "" || el[1] === 0  || el[1] == undefined) {
              // result.push(el);
              result.unshift(el)
            }
          });
          console.log(result, "提交的参数当中过滤出为空的");
          console.log(this.getArrEqual(filedList, result));
          let warnarr = [];
          warnarr = this.getArrEqual(filedList, result);
          console.log("warenarr23323232",warnarr)
          if (warnarr.length > 0) {
            this.open_tips(warnarr);
            // 必填弹窗结束
          }else{
            this.isCommit = false
            Toast.loading({ forbidClick: true, duration: 0 })

            if(ParamsQuery.weight_loss == "NaN"){
              ParamsQuery.weight_loss = 0
            }
            if(ParamsQuery.breathing_rate!=undefined){
              ParamsQuery.breathing_rate = ParamsQuery.breathing_rate.toString()
            }
            if(ParamsQuery.last_after_weight!=undefined){
              ParamsQuery.last_after_weight = ParamsQuery.last_after_weight.toString()
            }
            if(ParamsQuery.displace_liqui_value!=undefined){
              ParamsQuery.displace_liqui_value = ParamsQuery.displace_liqui_value.toString()
            }
             
            console.log("透前体重",this.predialysis)
            if(this.$store.getters.user.template_info.org_id == 10693){
              if(ParamsQuery.weight_after == 0){
                 if(this.predialysis!=null){
                  ParamsQuery.weight_after = this.predialysis.dry_weight
                 }
              }
            }
            if(this.formValue.start_time!=""){
              ParamsQuery.start_time = this.start_time_str
            }else{
              ParamsQuery.start_time = ""
            }
        
          
            console.log("param2332233232",ParamsQuery)
            commitAssessmentAfterDislysis(ParamsQuery).then(response => {
              console.log("hhhh2h2h2h",response.data.state)
            if (response.data.state == 0) {
              console.log("o2o3o32o2323oo32")
              Toast.fail(response.data.msg)
              this.isCommit = true
              if(response.data.code == 600000008){
                this.infor_visibility = true
              }
              return false
            } else {
              Toast.success('提交成功')
              this.$emit('did_update',response.data.data.assessmentAfterDislysis)
              for (const key in response.data.data.assessmentAfterDislysis) {
                this.record[key] = response.data.data.assessmentAfterDislysis[key]
              }
            }
            this.changeAssessmentAfter = 0
            this.isCommit = true
          }).catch(err => {
            this.changeAssessmentAfter = 0
            Toast.fail(err)
            this.isCommit = true
          })
        }

      }
    },
    getDialysisProcess: function (id) {
      var dialysis_process = this.$store.getters.dialysis_process
      var dialysisProcessName = ''
      for (let i = 0; i < dialysis_process.length; i++) {
        if (dialysis_process[i].id == id) {
          dialysisProcessName = dialysis_process[i].name
        }
      }
      return dialysisProcessName
    },
    getOpera: function (id) {
      var hemostasis_opera = this.$store.getters.hemostasis_opera
      var hemostasisOperaName = ''
      for (let i = 0; i < hemostasis_opera.length; i++) {
        if (hemostasis_opera[i].id == id) {
          hemostasisOperaName = hemostasis_opera[i].name
        }
      }
      return hemostasisOperaName
    },
    getArterialTubeName: function (id) {
      var arterial_tube = this.$store.getters.arterial_tube
      var arterialTubeName = ''
      for (let i = 0; i < arterial_tube.length; i++) {
        if (arterial_tube[i].id == id) {
          arterialTubeName = arterial_tube[i].name
        }
      }
      return arterialTubeName
    },
    getIntravenousTubeName: function (id) {
      var intravenous_tube = this.$store.getters.intravenous_tube
      var intravenousTubeName = ''
      for (let i = 0; i < intravenous_tube.length; i++) {
        if (intravenous_tube[i].id == id) {
          intravenousTubeName = intravenous_tube[i].name
        }
      }
      return intravenousTubeName
    },
    GetPatientGoes (id) {
      let name = ''
      let patient_gose = this.$store.getters.patient_gose
      let ifl = patient_gose.length
      for (let index = 0; index < ifl; index++) {
        if (patient_gose[index].id == id) {
          name = patient_gose[index].name
          break
        }
      }
      return name
    },
    GetIFTAValue (id) {
      let name = ''
      let internal_fistula_tremor_ac = this.$store.getters.internal_fistula_tremor_ac
      let ifl = internal_fistula_tremor_ac.length
      for (let index = 0; index < ifl; index++) {
        if (internal_fistula_tremor_ac[index].id == id) {
          name = internal_fistula_tremor_ac[index].name
          break
        }
      }
      return name
    },
    getUnit: function (val) {
      let name = ''
      for (let i = 0; i < this.unit.length; i++) {
        if (this.unit[i].id == val) {
          name = this.unit[i].name
        }
      }
      return name
    },
    QueryPartById: function (val) {
      let vascular_access_part_name = ''
      let vascular_access = this.$store.getters.vascular_access

      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
    },
    QueryOperaById: function (val) {
      let vascular_access_desc_name = ''
      var vascular_access_desc = this.$store.getters.vascular_access_desc

      for (let i = 0; i < vascular_access_desc.length; i++) {
        if (vascular_access_desc[i].id == val) {
          vascular_access_desc_name = vascular_access_desc[i].name
          break
        }
      }

      return vascular_access_desc_name
    },
    getTremorNoise: function (id) {
      var tremor_noise = this.$store.getters.tremor_noise
      var tremorNoiseName = ''
      for (let i = 0; i < tremor_noise.length; i++) {
        if (tremor_noise[i].id == id) {
          tremorNoiseName = tremor_noise[i].name
        }
      }
      return tremorNoiseName
    },
    getDisequilibriumSyndrome: function (id) {
      var disequilibrium_syndrome = this.$store.getters.disequilibrium_syndrome
      var disequilibriumSyndromeName = ''
      for (let i = 0; i < disequilibrium_syndrome.length; i++) {
        if (disequilibrium_syndrome[i].id == id) {
          disequilibriumSyndromeName = disequilibrium_syndrome[i].name
        }
      }
      return disequilibriumSyndromeName
    },
    getChannelName: function (id) {
      var channel = this.$store.getters.channel
      var channelName = ''
      for (let i = 0; i < channel.length; i++) {
        if (channel[i].id == id) {
          channelName = channel[i].name
        }
      }
      return channelName
    },
    GetWay (val) {
      let str = ''
      for (let i = 0; i < this.leaveOfficeList.length; i++) {
        if (this.leaveOfficeList[i].id == val) {
          str = this.leaveOfficeList[i].name
        }
      }
      return str
    },
    GetMachine (val) {
      let str = ''
      for (let i = 0; i < this.machineList.length; i++) {
        if (this.machineList[i].id == val) {
          str = this.machineList[i].name
        }
      }
      return str
    },
    GetLapse (val) {
      let str = ''
      for (let i = 0; i < this.lapseList.length; i++) {
        if (this.lapseList[i].id == val) {
          str = this.lapseList[i].name
        }
      }
      return str
    },
    BloodFlowById: function (val) {
      let blood_flow_name = ''
      let blood_flow_arr = getDataConfig('hemodialysis', 'blood_flow')

      for (let i = 0; i < blood_flow_arr.length; i++) {
        if (blood_flow_arr[i].id == val) {
          blood_flow_name = blood_flow_arr[i].name
        }
      }
      return blood_flow_name
    },
    getPermission () {
      request
        .get('/m/api/permission/get', {
          params: {
            create_url: '/m/api/dialysis/assessmentAfterDislysis?mode=1',
            modify_url: '/m/api/dialysis/assessmentAfterDislysis?mode=2',
            modify_other_url: '/m/api/dialysis/assessmentAfterDislysis?mode=3',
            module: 8
          }
        })
        .then(res => {
          console.log(res)
          console.log('透后', this.predialysis)
          if (res.data.state == 0) {
            this.hasPermission = false
          } else if (res.data.state == 1) {
            if (this.record.id != '' && this.record.creater != 0) {
              // 有数据
              if (this.record.creater == this.$store.getters.user.admin.id) {
                // 创建人是自己
                if (res.data.data.is_has_modify == false) {
                  this.hasPermission = false
                  this.showTxt = '你没有修改透后评估权限'
                }
              } else {
                // 创建人不是自己
                if (res.data.data.is_has_modify_other == false) {
                  this.hasPermission = false
                  this.showTxt = '你没有修改他人透后评估权限'
                }
              }
            } else if (this.record.id == '' || this.record.creater == 0) {
              if (res.data.data.is_has_create == false) {
                this.hasPermission = false
                this.showTxt = '你没有新增透后评估权限'
              }
            }
          }
        })
    },
    isObjectValueEqual (a, b) {
      // 取对象a和b的属性名
      var aProps = Object.getOwnPropertyNames(a)
      var bProps = Object.getOwnPropertyNames(b)
      // 判断属性名的length是否一致
      if (aProps.length != bProps.length) {
        return false
      }
      // 循环取出属性名，再判断属性值是否一致
      for (var i = 0; i < aProps.length; i++) {
        var propName = aProps[i]
        if (a[propName] != b[propName]) {
          return false
        }
      }
      return true
    },
   menuComfirmFour:function(start_time,remark){
       var params = {
         patient_id:this.$route.query.patient_id,
         record_date:this.$route.query.date,
         start_time:start_time,
         module:9,
         remark:remark,
       }

      saveMobileInformation(params).then(response=>{
        if(response.data.state == 1){
           this.infor_visibility = false
           Toast.success('申请成功')
        }
      })
    },
    menuCancleFour:function(){
     this.infor_visibility = false

    },
  },
  watch: {
    'formValue.sealing_fluid_dispose': function () {
      var sealing_fluid_dispose_name = ''
      var str = this.formValue.sealing_fluid_dispose
      var arr = str.split(',')
      for (let i = 0; i < arr.length; i++) {
        if (arr[i] == '特殊') {
          // eslint-disable-next-line camelcase
          sealing_fluid_dispose_name = '特殊'
        }
      }
      this.sealing_fluid_dispose_name = sealing_fluid_dispose_name
      return this.sealing_fluid_dispose_name
    },
    'formValue.weight_after': {
      handler (newWeight, oldWeight) {
        // eslint-disable-next-line no-unused-vars
        let weight = parseFloat(
          newWeight - this.formValue.additional_weight
        ).toFixed(1)
        if (weight > 0) {
          this.body_weight_after = weight
        } else {
          this.body_weight_after = ''
        }
        if (!this.isShow('衣物重')) {
          this.formValue.additional_weight = 0
        }
        if (!this.isShow2('衣物重')) {
          this.predialysis.additional_weight = 0
        }

        // this.formValue.weight_loss = (this.predialysis.weight_before - this.predialysis.additional_weight) - (this.formValue.weight_after - this.formValue.additional_weight)
        this.formValue.weight_loss = ((this.predialysis.weight_before - this.predialysis.additional_weight) - (this.formValue.weight_after - this.formValue.additional_weight)).toFixed(1)
        this.formValue.after_weight = (this.formValue.weight_after - this.formValue.additional_weight).toFixed(1)
        console.log('sssss', this.formValue.weight_loss)
        if (this.formValue.weight_loss < 0) {
          this.formValue.weight_loss = ''
        }
        if (this.formValue.weight_after == '') {
          this.formValue.weight_loss = ''
        }
      },
      deep: true,
      immediate: false
    },
    'formValue.after_weight':{
       handler(){
        this.formValue.after_weight = (this.formValue.weight_after - this.formValue.additional_weight).toFixed(1)
        console.log("hahahahh")
       }
    },
    'formValue.additional_weight': {
      handler (newWeight, oldWeight) {
        // eslint-disable-next-line no-unused-vars
        if (newWeight > 0) {
          let weight = parseFloat(
            this.formValue.weight_after - newWeight
          ).toFixed(1)
          if (weight > 0) {
            this.body_weight_after = weight
          } else {
            this.body_weight_after = ''
          }
        }

        if (!this.isShow('衣物重')) {
          this.formValue.additional_weight = 0
        }
        if (!this.isShow2('衣物重')) {
          this.predialysis.additional_weight = 0
        }

        this.formValue.weight_loss = ((this.predialysis.weight_before - this.predialysis.additional_weight) - (this.formValue.weight_after - this.formValue.additional_weight)).toFixed(1)
        if (this.formValue.weight_loss < 0) {
          this.formValue.weight_loss = ''
        }

        if (this.formValue.weight_after == '') {
          this.formValue.weight_loss = ''
        }
      },
      deep: true,
      immediate: true
    },
    newFormValue: {
      handler (newVal, oldVal) {
        if (!this.isObjectValueEqual(newVal, oldVal)) {
          this.changeAssessmentAfter++
        }
      },
      deep: true
    }
  }
}
</script>

<style lang="scss" scoped>
.assessmentAfter{
    display: flex;
    flex-direction: column;
    height: 100%;
    >:first-child{
        flex: 1;
        overflow-y: auto;
    }
}
.van-radio-group{
    display: flex;
    flex-wrap: wrap;
    .van-radio{
        width: 50%;
        margin-bottom: .625rem;
    }
}
.van-checkbox-group{
    display: flex;
    flex-wrap: wrap;
    .van-checkbox{
        width: 50%;
        margin-bottom: .625rem;
    }
}
.preserveBox{
    height: 3.125rem;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    align-items: center;
    font-size: 1rem;
    >:first-child{
        text-align: center;
        height: 2.5rem;
        width: 100%;
        line-height: 2.5rem;
        background: #409eff;
        color:#fff;
        border-radius: 4px;
    }
}
.warnTxt {
  font-size: 1rem;
  height: 1.875rem;
  line-height: 1.875rem;
  text-align: center;
  background: #faa331;
  color: #fff;
}
.disabled{
  background: #D8D8D8 !important;
}
.warn_tip{
  color: red;
}

</style>
<style lang="scss">
.assessmentAfter{
    .van-field__label{
        // width: 9.375rem;
        width: initial;
    }
    .datetimePicker{
        .picker-item{
            font-size: .875rem !important;
            height: 44px;
            line-height: 44px;

        }
        .mint-datetime-action{
            font-size: .9375rem !important;
        }

    }
}

</style>
