<template>
  <div class="assessmentBefore">
      <div>
          <div class="warnTxt" v-if="showTxt != ''">
              {{ showTxt }}
          </div>
          <van-collapse v-model="activeNames" accordion @change='showSubMenu'>
              <van-field v-model="formValue.last_after_weight" @focus="inputFocus"  :required="isShow_title('上次透后体重')" label="上次透后体重(kg)" type="number" v-if="$store.getters.user.template_info.org_id == 10702" :disabled="true" input-align="right"/>
              <van-field v-model="formValue.weight_before" @focus="inputFocus" v-if="isShow('透前称重')" :required="isShow_title('透前称重')" label="透前称重(kg)" type="number" input-align="right"/>
              <van-field v-model="formValue.weight_befor_remake" @focus="inputFocus" v-if="isShow('透前体重备注')" :required="isShow_title('透前体重备注')" label="透前体重备注"  input-align="right"/>
              <van-field v-model="formValue.dry_weight" @click="showDryWeight" readonly v-if="isShow('干体重')" :required="isShow_title('干体重')" label="干体重(kg)" type="number" input-align="right"/>
              <van-field v-model="formValue.height"   v-if="isShow('身高')" :required="isShow_title('身高')" label="身高(cm)" input-align="right"/>
              <van-field v-model="formValue.age"   v-if="isShow('年龄')" :required="isShow_title('年龄')" label="年龄(岁)"  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-collapse-item v-if="isShow('透析机型号')" title="透析机型号" name="1">
                  <template slot="title">
                      <div><span v-if="isShow_title('透析机型号')" class="warn_tip">*</span>透析机型号</div>
                  </template>
                  <template #value>
                      <div>{{DialysisModel(formValue.machine_type)}}</div>
                  </template>
                  <van-radio-group v-model="formValue.machine_type">
                      <van-radio name="" key="-2">请选择</van-radio>
                      <van-radio :name="item.name" v-for='(item,index) in machine_type_arr' :key="index">{{ item.name }}</van-radio>
                  </van-radio-group>
              </van-collapse-item>
              <van-field v-model="formValue.dialysis_count" @focus="inputFocus" v-if="isShow('透析频次')" :required="isShow_title('透析频次')" label="透析频次(次/周)"  input-align="right">
                <template #label>
                  <span v-if="$store.getters.user.template_info.org_id != 10243">透析频次(次/周)</span>
                  <span v-else>透析频次</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.breathing_rate" @focus="inputFocus" v-if="isShow('呼吸频率') && $store.getters.user.template_info.org_id != 10551" :required="isShow_title('呼吸频率')" label="呼吸频率(次/分)"  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="呼吸频率(次/分)"  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('透析前症状') && $store.getters.user.template_info.org_id==10551" title="透析前症状" name="symptom_before_dialysis">
                  <template slot="title">
                      <div><span v-if="isShow_title('透析前症状')" class="warn_tip">*</span>透析前症状</div>
                  </template>
                  <template #value>
                      <div>{{formValue.symptom_before_dialysis}}</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="2">
                <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 vascular_access_desc_arr' :key="index">{{ item.name }}</van-radio>
                  </van-radio-group>
              </van-collapse-item>
              <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>{{formValue.blood_access_part_id}}</div>
                  </template>
                  <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
              </van-collapse-item>

              <van-field v-model="formValue.venous_catheterization_part_other" @focus="inputFocus" v-if="isShow('血管通路其他部位')" :required="isShow_title('血管通路其他部位')" label="血管通路其他部位" input-align="right"/>

              <van-collapse-item v-if="isShow('体液过多症状')" title="体液过多症状" name="humor_excessive_symptom_info">
                  <template slot="title">
                      <div><span v-if="isShow_title('体液过多症状')" class="warn_tip">*</span>体液过多症状</div>
                  </template>
                  <template #value>
                      <div>{{formValue.humor_excessive_symptom}}</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="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-field v-model="formValue.internal_fistula_other" @focus="inputFocus" v-if="isShow('血管通路(内瘘)其他')" :required="isShow_title('血管通路(内瘘)其他')" label="血管通路(内瘘)其他" input-align="right"/>
              <van-collapse-item v-if="isShow('血管杂音')" title="血管杂音" name="6">
                <template slot="title">
                      <div><span v-if="isShow_title('血管杂音')" class="warn_tip">*</span>血管杂音</div>
                  </template>
                  <template #value>
                      <div>{{getBloodAccessNoise(formValue.blood_access_noise)}}</div>
                  </template>
                  <van-radio-group v-model="formValue.blood_access_noise">
                      <van-radio name="" key="-2">请选择</van-radio>
                      <van-radio :name="item.id" v-for='(item,index) in blood_access_noise_arr' :key="index">{{ item.name }}</van-radio>
                  </van-radio-group>
              </van-collapse-item>
              <van-collapse-item v-if="isShow('血管通路皮肤情况')" title="血管通路皮肤情况" name="internal_fistula_skin">
                  <template slot="title">
                      <div><span v-if="isShow_title('血管通路皮肤情况')" class="warn_tip">*</span>血管通路皮肤情况</div>
                  </template>
                  <template #value>
                      <div>{{formValue.internal_fistula_skin}}</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="8">
                  <template slot="title">
                      <div><span v-if="isShow_title('中心静脉置管')" class="warn_tip">*</span>中心静脉置管</div>
                  </template>
                  <template #value>
                      <div>{{getVenousCatheterization(formValue.venous_catheterization)}}</div>
                  </template>
                  <van-radio-group v-model="formValue.venous_catheterization">
                      <van-radio name="" key="-2">请选择</van-radio>
                      <van-radio :name="item.id" v-for='(item,index) in venous_catheterization_arr' :key="index">{{ item.name }}</van-radio>
                  </van-radio-group>
              </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-field v-model="formValue.ductus_arantii_other" v-if="isShow('导管其他')" :required="isShow_title('导管其他')" label="导管其他" input-align="right"/>
              <van-collapse-item v-if="isShow('导管打折')" title="导管打折" name="10">
                <template slot="title">
                      <div><span v-if="isShow_title('导管打折')" class="warn_tip">*</span>导管打折</div>
                  </template>
                  <template #value>
                      <div>{{GetCatheterBendById(formValue.catheter_bend)}}</div>
                  </template>
                  <van-radio-group v-model="formValue.catheter_bend">
                      <van-radio name="-2" key="-2">请选择</van-radio>
                      <!-- <van-radio :name="item.id" v-for='(item,index) in catheter_bend_arr' :key="index">{{ item.name }}</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="puncture_needle">
                  <template slot="title">
                      <div><span v-if="isShow_title('穿刺针')" class="warn_tip">*</span>穿刺针</div>
                  </template>
                  <template #value>
                      <div>{{formValue.puncture_needle}}</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_needle_direction">
                  <template slot="title">
                  <div><span v-if="isShow_title('穿刺方向')" class="warn_tip">*</span>穿刺方向</div>
                  </template>
                    <template #value>
                        <div>{{GetConsciousness(formValue.puncture_needle_direction)}}</div>
                    </template>
                    <van-radio-group v-model="formValue.puncture_needle_direction">
                        <van-radio :name="item.id" v-for='(item,index) in consciousness_arr' :key="index">{{ item.name }}</van-radio>
                    </van-radio-group>
                </van-collapse-item>

            
              <van-collapse-item v-if="isShow('针眼')" title="针眼" name="pinholing">
                <template slot="title">
                      <div><span v-if="isShow_title('针眼')" class="warn_tip">*</span>针眼</div>
                  </template>
                  <template #value>
                      <div>{{formValue.pinholing}}</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_way">
                  <template slot="title">
                      <div><span v-if="isShow_title('穿刺方式')" class="warn_tip">*</span>穿刺方式</div>
                  </template>
                  <template #value>
                      <div>{{formValue.puncture_way}}</div>
                  </template>
                  <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
              </van-collapse-item>
              <van-collapse-item v-if="isShow('穿刺点') && formValue.puncture_way!=undefined&&formValue.puncture_way.indexOf('绳梯')!==-1" title="穿刺点" name="point_puncture">
                    <template #value>
                        <div>{{formValue.point_puncture}}</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="14">
                <template slot="title">
                      <div><span v-if="isShow_title('出血')" class="warn_tip">*</span>出血</div>
                  </template>
                  <template #value>
                      <span v-if="formValue.is_hemorrhage == 0" class="text" style="width: 50px"></span>
                      <span v-if="formValue.is_hemorrhage == 1" class="text" style="width: 50px">有</span>
                      <span v-if="formValue.is_hemorrhage == 2" class="text" style="width: 50px">无</span>
                  </template>
                  <van-radio-group v-model="formValue.is_hemorrhage">
                      <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="formValue.is_hemorrhage == 1 && isShow('出血选项')" title="—— 出血选项" name="hemorrhage">
                  <template slot="title">
                      <div><span v-if="formValue.is_hemorrhage == 1 &&isShow_title('出血选项')" class="warn_tip">*</span>出血选项</div>
                  </template>
                  <template #value>
                      <div>{{formValue.hemorrhage}}</div>
                  </template>
                  <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
              </van-collapse-item>
              <van-field v-model="formValue.hemorrhage_other" @focus="inputFocus" v-if="formValue.is_hemorrhage == 1 && isShow('其他出血情况')" :required="formValue.is_hemorrhage == 1 &&isShow_title('其他出血情况')" label="—— 其他出血情况" input-align="right"/>
              <van-collapse-item v-if="isShow('血栓')" title="血栓" name="16">
                <template slot="title">
                      <div><span v-if="isShow_title('血栓')" class="warn_tip">*</span>血栓</div>
                  </template>
                  <template #value>
                      <span v-if="formValue.thromubus_type == 0" class="text" style="width: 50px"></span>
                      <span v-if="formValue.thromubus_type == 1" class="text" style="width: 50px">有</span>
                      <span v-if="formValue.thromubus_type == 2" class="text" style="width: 50px">无</span>
                  </template>
                  <van-radio-group v-model="formValue.thromubus_type">
                      <van-radio name="-2" 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.thrombus_av" @focus="inputFocus" v-if="thromubusShow" :required="isShow_title('导管AV端各约')" label="导管AV端各约(cm)" type="number" input-align="right"/>
              <van-field v-model="formValue.thromubus_a" @focus="inputFocus" v-if="thromubusShow" :required="isShow_title('导管A端约')" label="导管A端约(cm)" type="number" input-align="right"/>
              <van-field v-model="formValue.thromubus_v" @focus="inputFocus" v-if="thromubusShow" :required="isShow_title('导管V端约')" label="导管V端约(cm)" type="number" input-align="right"/>
              <van-collapse-item v-if="isShow('皮肤')" title="皮肤" name="skin">
                <template slot="title">
                      <div><span v-if="isShow_title('皮肤')" class="warn_tip">*</span>皮肤</div>
                  </template>
                  <template #value>
                      <div>{{formValue.skin}}</div>
                  </template>

                  <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
              </van-collapse-item>
              <van-field v-model="formValue.skin_other" @focus="inputFocus" v-if="isShow('其他皮肤情况')" :required="isShow_title('其他皮肤情况')" label="其他皮肤情况" input-align="right"/>
              <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-collapse-item v-if="isShow('透析前症状') && $store.getters.user.template_info.org_id!=10551" title="透析前症状" name="symptom_before_dialysis">
                  <template slot="title">
                      <div><span v-if="isShow_title('透析前症状')" class="warn_tip">*</span>透析前症状</div>
                  </template>
                  <template #value>
                      <div>{{formValue.symptom_before_dialysis}}</div>
                  </template>

                  <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
              </van-collapse-item>
              <van-field v-model="formValue.symptom_before_dialysis_other" @focus="inputFocus" v-if="isShow('透析前状态其他')" :required="isShow_title('透析前状态其他')" label="透析前状态其他" input-align="right"/>
              <van-collapse-item v-if="isShow('前次透析后症状')" title="前次透析后症状" name="last_post_dialysis">
                  <template slot="title">
                      <div><span v-if="isShow_title('前次透析后症状')" class="warn_tip">*</span>前次透析后症状</div>
                  </template>
                  <template #value>
                      <div>{{formValue.last_post_dialysis}}</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="21">
                <template slot="title">
                      <div><span v-if="isShow_title('急诊')" class="warn_tip">*</span>急诊</div>
                  </template>
                  <template #value>
                      <div>{{getEmergencyTreatment(formValue.emergency_treatment)}}</div>
                  </template>
                  <van-radio-group v-model="formValue.emergency_treatment">
                      <van-radio name="" key="-2">请选择</van-radio>
                      <van-radio :name="item.id" v-for='(item,index) in emergency_treatment_arr' :key="index">{{ item.name }}</van-radio>
                  </van-radio-group>
              </van-collapse-item>
              <van-field v-model="formValue.emergency_treatment_other" @focus="inputFocus" v-if="isShow('其他急诊情况')" :required="isShow_title('其他急诊情况')" label="其他急诊情况" input-align="right"/>
              <van-field v-model="body_weight_before" readonly v-if="this.$store.getters.user.template_info.template_id == 6 || this.$store.getters.user.template_info.template_id == 68" label="透前净体重(kg)" type="number" input-align="right"/>
              <van-collapse-item v-if="isShow('透析期间')" title="透析期间" name="dialysis_interphase">
                  <template slot="title">
                      <div><span v-if="isShow_title('透析期间')" class="warn_tip">*</span>透析期间</div>
                  </template>
                  <template #value>
                      <div>{{formValue.dialysis_interphase}}</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="ductus_arantii">
                  <template slot="title">
                      <div><span v-if="isShow_title('中心静脉导管')" class="warn_tip">*</span>中心静脉导管</div>
                  </template>
                  <template #value>
                      <div>{{formValue.ductus_arantii}}</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="24">
                <template slot="title">
                      <div><span v-if="isShow_title('感染')" class="warn_tip">*</span>感染</div>
                  </template>
                  <template #value>
                      <span v-if="formValue.is_infect == 0" class="text" style="width: 50px"></span>
                      <span v-if="formValue.is_infect == 1" class="text" style="width: 50px">无</span>
                      <span v-if="formValue.is_infect == 2" class="text" style="width: 50px">有</span>
                  </template>
                  <van-radio-group v-model="formValue.is_infect">
                      <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.infect_other" @focus="inputFocus" v-if="isShow('其他感染情况')" :required="isShow_title('其他感染情况')" label="其他感染情况" input-align="right"/>
              <van-field v-model="formValue.exposed" @focus="inputFocus" v-if="isShow('外露')" :required="isShow_title('外露')" label="外露(cm)" type="number" input-align="right"/>
              <van-collapse-item v-if="isShow('导管缝线')" title="导管缝线" name="catheter_suture">
                  <template slot="title">
                      <div><span v-if="isShow_title('导管缝线')" class="warn_tip">*</span>导管缝线</div>
                  </template>
                  <template #value>
                      <div>{{formValue.catheter_suture}}</div>
                  </template>
                  <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
              </van-collapse-item>
              <van-field v-model="formValue.catheter_suture_other" @focus="inputFocus" v-if="isShow('导管缝线(其他)')" :required="isShow_title('导管缝线(其他)')" label="导管缝线(其他)" input-align="right"/>
              <van-field v-model="formValue.urine_volume" @focus="inputFocus" v-if="isShow('尿量')" :required="isShow_title('尿量')" label="尿量(ml)" type="number" input-align="right"/>
              <van-collapse-item v-if="isShow('水肿')" title="水肿" name="edema">
                  <template slot="title">
                      <div><span v-if="isShow_title('水肿')" class="warn_tip">*</span>水肿</div>
                  </template>
                  <template #value>
                      <div>{{formValue.edema}}</div>
                  </template>
                  <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
              </van-collapse-item>
              <van-field v-model="formValue.special_treatment" @focus="inputFocus" v-if="isShow('特殊处理情况')" :required="isShow_title('特殊处理情况')" label="特殊处理情况" input-align="right"/>
              <van-collapse-item v-if="isShow('导管维护')" title="导管维护" name="catheter_maintenance">
                  <template slot="title">
                      <div><span v-if="isShow_title('导管维护')" class="warn_tip">*</span>导管维护</div>
                  </template>
                  <template #value>
                      <div>{{formValue.catheter_maintenance}}</div>
                  </template>
                  <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
              </van-collapse-item>
                <van-field v-model="formValue.dehydration" @focus="inputFocus" v-if="isShow('预增脱水量')" :required="isShow_title('预增脱水量')" label="预增脱水量(L)" type="number" input-align="right"/>
               <van-field v-model="formValue.pre_dialysis_drugs" @focus="inputFocus" v-if="isShow('透析前药物')" :required="isShow_title('透析前药物')" label="透析前药物"  input-align="right"/>
               <van-collapse-item v-if="isShow('围手术期')" title="围手术期" name="24">
                  <template slot="title">
                      <div><span v-if="isShow_title('围手术期')" class="warn_tip">*</span>围手术期</div>
                  </template>
                  <template #value>
                      <span v-if="formValue.period == 0" class="text" style="width: 50px"></span>
                      <span v-if="formValue.period == 1" class="text" style="width: 50px">无</span>
                      <span v-if="formValue.period == 2" class="text" style="width: 50px">有</span>
                  </template>
                  <van-radio-group v-model="formValue.period">
                      <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.estimated_food_intake" @focus="inputFocus" v-if="isShow('预计进食量')" :required="isShow_title('预计进食量')" label="预计进食量(g)"  input-align="right"/>
               <van-field v-model="formValue.blood_pressure_during_dialysis" @focus="inputFocus" v-if="isShow('透析期间血压')" :required="isShow_title('透析期间血压')" label="透析期间血压"  input-align="right"/>

              <van-collapse-item v-if="isShow('抽吸')" title="抽吸" name="suction">
                <template slot="title">
                      <div><span v-if="isShow_title('抽吸')" class="warn_tip">*</span>抽吸</div>
                  </template>
                  <template #value>
                      <div>{{formValue.suction}}</div>
                  </template>
                  <checkBoxMenu v-if='checkBoxShow' v-on:menu-comfirm="getString" :propsForm="propForm"></checkBoxMenu>
              </van-collapse-item>

              <van-field v-model="formValue.his_department" @focus="inputFocus" v-if="isShow('住院科室')" :required="isShow_title('住院科室')" label="住院科室"  input-align="right"/>
              <van-field v-model="formValue.his_bed" @focus="inputFocus" v-if="isShow('住院床位')" :required="isShow_title('住院床位')" label="住院床位"  input-align="right"/>
              <van-collapse-item v-if="isShow('导管评估项目')" title="导管评估项目" name="catheter_evaluation_program">
                    <template #value>
                        <div>{{formValue.catheter_evaluation_program}}</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="skin_site_catheterization">
                    <template #value>
                        <div>{{formValue.skin_site_catheterization}}</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="44">
                    <template #value>
                        <span v-if="formValue.whether_unobstructed == 0" class="text" style="width: 50px"></span>
                        <span v-if="formValue.whether_unobstructed == 1" class="text" style="width: 50px">是</span>
                        <span v-if="formValue.whether_unobstructed == 2" class="text" style="width: 50px">否</span>
                    </template>
                    <van-radio-group v-model="formValue.whether_unobstructed">
                        <van-radio name="-2" 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="45">
                    <template #value>
                        <span v-if="formValue.lien_necessary == 0" class="text" style="width: 50px"></span>
                        <span v-if="formValue.lien_necessary == 1" class="text" style="width: 50px">是</span>
                        <span v-if="formValue.lien_necessary == 2" class="text" style="width: 50px">否</span>
                    </template>
                    <van-radio-group v-model="formValue.lien_necessary">
                        <van-radio name="-2" 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-if="isShow('通路形成时间')"
                  v-model="nuclein_date_str"
                  readonly
                  @click="selectNucleinDateAction"
                  label="通路形成时间"
                  input-align="right"
                />

              <van-cell title='透前症状' v-if="isShow('透前症状')" @click="teachShow = true" is-link value="请选择"></van-cell>
              <van-popup v-model="teachShow" get-container="#app" class="listBoxPopup newListBoxPopupApp" style="z-index:5000">
                  <div class="listBox">
                      <div @click="toTeach('')">请选择</div>
                      <div v-for="(item,index) in teach" :key="index" @click="toTeach(item.id)">{{ item.text }}</div>
                  </div>
              </van-popup>
              <van-field class="bgField" v-if="isShow('透前症状')" v-model="formValue.befor_symptoms" rows="1" autosize type="textarea" placeholder="请输入"/>

              <van-field v-model="formValue.washing_time" @focus="inputFocus" v-if="isShow('冲洗时间')" label="q(h)"  input-align="right"/>
              <van-field v-model="formValue.warsh_count" @focus="inputFocus" v-if="isShow('冲洗量')" label="NS冲洗量(ml)"  input-align="right"/>
              <van-field v-model="formValue.remark" rows="1" autosize :required="isShow_title('备注')" label="备注"  type="textarea" input-align="right"/>
          </van-collapse>
          <van-popup v-model="dry_visibility" class="advicePopup" get-container="#today_panel">
              <dry-weight-menu
              ref="dry"
              v-on:menu-cancle-two="menuDryCancle"
              v-on:menu-comfirm-two="menuDryComfirm"
              :propsForm="propDryForm"
              :dry_weight_list="dry_weight_list"

              ></dry-weight-menu>
          </van-popup>
      </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="nuclein_date_picker"
          type="date"
          @confirm="didNucleinDateTime"
          v-model="nuclein_date"
         ></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 axios from 'axios'
import { EditAssessmentBeforeDislysis } from '@/api/patient'
import {saveMobileInformation} from '@/api/dialysis'
import InforSubMenu from "../dialog/subMenu/InforSubMenu.vue"
import {parseTime} from '@/utils'
import { Toast } from 'vant'
import { Dialog } from "vant";
import { uParseTime } from "@/utils/tools";
import { getDataConfig } from '@/utils/data'
import checkBoxMenu from './components/checkBoxMenu'
import DryWeightMenu from '../dialog/subMenu/dryWeightMenu'
import request from '@/utils/request'
const moment = require('moment')
export default {
props: {
  dry_weight: {
    type: Object
  },
  patient_prop: {
    type: Object
  },
  predialysis: {
    type: Object
  },
  last_predialysis: {
    type: Object
  },
  admin_users_prop: {
    type: Array
  },
  lastAssessment: {
    type: Object
  },
  last_befor:{
    type:Object
  },
  dry_weight_list:{
    type:Array
  },
  predialysis_evaluation_obj:{
    type:Object
  },
  first_monitor:{
    type:Object,
  },
  last_record: {
      type: Object,
  },

},
components: {
  checkBoxMenu,
  DryWeightMenu,
  InforSubMenu
},
data () {
  return {
    showTxt: '',
    hasPermission: true,
    activeNames: '',
    formValue: {
      weight_before: '',
      weight_befor_remake: '',
      dry_weight: '',//
      height: '',
      age: '',
      additional_weight: '',
      machine_type: 0,
      dialysis_count: '',
      temperature: '',
      systolic_blood_pressure: '',
      diastolic_blood_pressure: '',
      breathing_rate: '',
      pulse_frequency: '',
      blood_access_part_opera_id: '',
      blood_access_part_id: '',
      venous_catheterization_part_other: '',
      humor_excessive_symptom: '',
      internal_fistula: '',
      internal_fistula_other: '',
      blood_access_noise: '',
      internal_fistula_skin: '',
      venous_catheterization: '',
      catheter: '',
      catheter_bend: 2,
      puncture_needle: '',
      pinholing: '',
      puncture_way: '',
      is_hemorrhage: 0,
      hemorrhage:'',
      hemorrhage_other: '',
      thromubus_type: 0,
      thrombus_av: '',
      thromubus_a: '',
      thromubus_v: '',
      skin: '',
      skin_other: '',
      complication: '',
      symptom_before_dialysis: '',

      last_post_dialysis: '',
      emergency_treatment_other: '',
      emergency_treatment: '',
      dialysis_interphase: '',
      ductus_arantii: '',
      ductus_arantii_other: '',
      is_infect: 0,
      infect_other: '',
      exposed: '',
      catheter_suture: '',
      catheter_suture_other: '',
      urine_volume: '',
      edema: '',
      special_treatment: '',
      catheter_maintenance: '',
      dehydration: '',
      pre_dialysis_drugs: '',
      period: '',
      estimated_food_intake: '',
      blood_pressure_during_dialysis: '',
      suction: '',
      his_department: '',
      his_bed: '',
      remark: '',
      venous_catheterization_part: '',
      blood_access_internal_fistula: '',
      urea_befor: '',
      catheter_evaluation_program:'',
      skin_site_catheterization:"",
      whether_unobstructed:"",
      lien_necessary:"",
      pathway_formation_time:"",
      befor_symptoms:"",
      washing_time:"",
      warsh_count:"",
      puncture_needle_direction:"",
      symptom_before_dialysis_other:"",
      last_after_weight:""
    },
    machine_type_arr: [],

    record_date: '',

    checkBoxShow: false,
    propForm: {
      title: '',
      list: [],
      optionList: [],
      isMultiple: 2,
      result: [], // 选中的值
      type: 1, // 用来区分不同子菜单，方便对返回值进行赋值
      selectId: 0,
      isHasOther: 1 // 是否有其他选项  1是 2否
    },
    thromubusShow: false,
    propDryForm: {
      weight: 0,
      doctor: [],
      remark:""
    },
    dry_visibility: false,

    changeAssessmentBefore: 0,
    isCommit: true,
    suctionList: [],
    point_puncture_arr:[],
    catheter_evaluation_program_list:[],
    skin_site_catheterization_list:[],
    nuclein_date_str: moment(new Date()).format('YYYY-MM-DD'),
    nuclein_date:"",
    teachShow: false,
    teach:[],
    vascular_access_desc_arr:[],
    emergency_treatment_arr:[],
    venous_catheterization_arr:[],
    infor_visibility:false,
    consciousness_arr: [],

  }
},
created () {
  this.getPermission()

  console.log("数据我哦我",this.predialysis_evaluation_obj)
  console.log("上次透前评估",this.last_predialysis)
  
  if (this.predialysis != null) {
    if (this.predialysis.thromubus_type == 1) {
      this.thromubusShow = true
    }
    this.nuclein_date_str = this.getTimeOne(this.predialysis.pathway_formation_time)
    
    if(this.predialysis!=null){
      var puncture_needle_direction_one = this.PuncTureNeedleName(this.predialysis.puncture_needle_direction)
   
      if(puncture_needle_direction_one >0){
        this.predialysis.puncture_needle_direction = puncture_needle_direction_one.toString()
      } 
    }
   
    
  }
  if (this.last_predialysis != null) {
    if (this.last_predialysis.thromubus_type == 1) {
      this.thromubusShow = true
    }
  }
  this.machine_type_arr = getDataConfig('hemodialysis', 'machine_type')
  this.vascular_access_desc_arr = getDataConfig('hemodialysis', 'vascular_access_desc')
  this.vascular_access_arr = getDataConfig('hemodialysis', 'vascular_access')
  this.humor_excessive_symptom_arr = getDataConfig('hemodialysis', 'humor_excessive_symptom')
  this.internal_fistula_arr = getDataConfig('hemodialysis', 'internal_fistula')
  this.blood_access_noise_arr = this.$store.getters.blood_access_noise
  this.venous_catheterization_arr = this.$store.getters.venous_catheterization
  this.catheter_bend_arr = this.$store.getters.catheter_bend
  this.emergency_treatment_arr = this.$store.getters.emergency_treatment
  this.ductus_arantii_arr = this.$store.getters.ductus_arantii
  this.internal_fistula_skin_arr = getDataConfig('hemodialysis', 'internal_fistula_skin')
  this.catheter_arr = getDataConfig('hemodialysis', 'catheter')
  this.puncture_needle_arr = getDataConfig('hemodialysis', 'puncture_needle')
  this.pinholing_arr = getDataConfig('hemodialysis', 'pinholing')
  this.puncture_method_arr = getDataConfig('hemodialysis', 'puncture_method')
  this.hemorrhage_arr = getDataConfig('hemodialysis', 'hemorrhage')
  this.skin_arr = getDataConfig('hemodialysis', 'skin')
  this.complication_arr = getDataConfig('hemodialysis', 'complication')
  this.symptom_before_dialysis_arr = getDataConfig('hemodialysis', 'dialysis_before')
  this.last_dialysis_after_arr = getDataConfig('hemodialysis', 'last_dialysis_after')
  this.dialysis_duration_arr = getDataConfig('hemodialysis', 'dialysis_duration')
  this.catheter_suture_arr = getDataConfig('hemodialysis', 'catheter_suture')
  this.edema_arr = getDataConfig('hemodialysis', 'edema')
  this.catheter_maintenance_arr = getDataConfig('hemodialysis', 'catheter_maintenance')
  this.suctionList = getDataConfig('hemodialysis', 'suction')
  console.log('戈纳提中', this.dry_weight)
  this.catheter_evaluation_program_list = getDataConfig('hemodialysis','catheter_evaluation_program')
  this.skin_site_catheterization_list = getDataConfig('hemodialysis','skin_site_catheterization')
  this.teach = getDataConfig('befor_symptoms', 'befor_symptoms')
  this.consciousness_arr = getDataConfig('hemodialysis', 'puncture_needle_direction')
  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)

  var obj = this.predialysis

  this.formValue = obj
  if (this.predialysis.id == undefined && this.last_predialysis.id != undefined) {
    for (var key in this.last_predialysis) {
      if(this.org_id!=10644){
        if (key != 'systolic_blood_pressure' && key != 'diastolic_blood_pressure' && key != 'pulse_frequency' && key != 'weight_before') {
        this.$set(
          this.formValue,
          key,
          this.last_predialysis[key].toString()
        )
       }
      }

      if(this.org_id==10644){
        if (key != 'systolic_blood_pressure' && key != 'diastolic_blood_pressure' && key != 'pulse_frequency' && key != 'weight_before' && key!="puncture_needle") {
        this.$set(
          this.formValue,
          key,
          this.last_predialysis[key].toString()
        )
       }
      }
     
    }
    console.log("dryWeight",this.dry_weight)
    if (this.dry_weight != undefined) {
      this.formValue.dry_weight = this.dry_weight.dry_weight
      this.propDryForm.weight = this.dry_weight.dry_weight.toString()
      this.propDryForm.remark = this.dry_weight.remakes
    }
  }

  if (this.dry_weight != null && this.dry_weight.id != undefined) {

    if(this.$store.getters.user.template_info.org_id==10447 || this.$store.getters.user.template_info.org_id==9675 || this.$store.getters.user.template_info.org_id==10340){
       this.formValue.breathing_rate = 20
      //  if( this.formValue.symptom_before_dialysis == ""){
      //   this.formValue.symptom_before_dialysis = "无症状"
      //  }
    
        if(this.formValue.symptom_before_dialysis == ""){
          this.formValue.symptom_before_dialysis = this.last_befor.symptom_before_dialysis
        }

      }
    if(this.$store.getters.user.template_info.org_id==9829){
       this.formValue.pulse_frequency= 80
    }

    if(this.$store.getters.user.template_info.org_id==10445){
       if(this.formValue.temperature == '' || this.formValue.temperature ==0){
          this.formValue.temperature= 36.5
       }
      
    }

    if(this.$store.getters.user.template_info.org_id== 10721){
       if(this.formValue.temperature == '' || this.formValue.temperature ==0){
          this.formValue.temperature= 36.5
       }
    }
    if (this.predialysis.id == undefined && this.predialysis.id == undefined) {
      this.formValue.dry_weight = this.dry_weight.dry_weight

    }
    if (this.predialysis.id == undefined && this.last_predialysis.id != undefined) {
      this.formValue.dry_weight = this.dry_weight.dry_weight


      this.$set(this.formValue, 'dry_weight', this.dry_weight.dry_weight.toString())
    }
    this.propDryForm.weight = this.dry_weight.dry_weight.toString()
    this.propDryForm.remark = this.dry_weight.remakes

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

    if(this.$store.getters.user.template_info.org_id==10702){
     
      this.formValue.last_after_weight = (this.last_record.weight_after - this.last_record.additional_weight).toFixed(1)
    }



    if(this.$store.getters.user.template_info.org_id == 10721){
      
       if(this.formValue.temperature == '' || this.formValue.temperature ==0){
          this.formValue.temperature= 36.5
       }
    }

    if(this.$store.getters.user.template_info.org_id == 10721){
     
       if(this.formValue.temperature == '' || this.formValue.temperature ==0 || this.formValue.temperature == "undefined"){
          this.formValue.temperature = 36.5
       }
    }

    if(this.$store.getters.user.template_info.org_id == 10597){
      if(this.predialysis.id == undefined || this.predialysis.id == 0){
        this.formValue.additional_weight = this.last_record.additional_weight
      }
     
    }
   
  } else {
    if (this.predialysis.id == undefined && this.last_predialysis.id != undefined) {
      console.log('几拿了23232332')
      this.$set(
        this.formValue,
        'dry_weight',
        this.last_predialysis['dry_weight'].toString()
      )
      this.propDryForm.weight = this.formValue.dry_weight
     
    }
  }
  this.hemorrhage_state = this.formValue.is_hemorrhage == 0
  this.periods_state = this.formValue.period == 0
  this.suction_state = this.formValue.suction == 0
  this.data = getDataConfig('hemodialysis', 'vascular_access_desc')

  if (this.predialysis.id == 0 && this.lastAssessment.id != 0) {
    let vascular_access_desc = getDataConfig(
      'hemodialysis',
      'vascular_access_desc'
    )
    var vascular_access_desc_name = ''
    for (let i = 0; i < vascular_access_desc.length; i++) {
      if (vascular_access_desc[i].name == this.lastAssessment.blood_access_part_opera_id) {
        vascular_access_desc_name = vascular_access_desc[i].id
      }
    }
    this.formValue.blood_access_part_opera_id = vascular_access_desc_name
    this.formValue.blood_access_part_id = this.lastAssessment.blood_access_part_id

  }
  console.log('998823323232323232', this.predialysis.id)
 
  if(this.predialysis!=null && this.predialysis.id ==undefined && this.last_predialysis.id > 0){
    console.log("上次我哦我我", this.last_predialysis.venous_catheterization)
    this.formValue.venous_catheterization = this.last_predialysis.venous_catheterization
    // if(this.$store.getters.user.template_info.org_id==10610){
    //   this.formValue.venous_catheterization = this.last_predialysis.venous_catheterization
    // } 
    
  }
  console.log('last_predialysis2332323232', this.last_predialysis)
  console.log("中国",this.predialysis)
  if (this.predialysis.id == 0 && this.last_predialysis.id != 0) {
    let vascular_access_desc = getDataConfig(
      'hemodialysis',
      'vascular_access_desc'
    )
    var vascular_access_desc_name = ''
    for (let i = 0; i < vascular_access_desc.length; i++) {
      if (vascular_access_desc[i].name == this.last_predialysis.blood_access_part_opera_id) {
        vascular_access_desc_name = vascular_access_desc[i].id
      }
    }
    this.formValue.blood_access_part_opera_id = vascular_access_desc_name
    this.formValue.blood_access_part_id = this.last_predialysis.blood_access_part_id
   

  }

  if(this.predialysis_evaluation_obj == null){
     if(this.$store.getters.user.template_info.org_id==10597){
         this.formValue.symptom_before_dialysis = ""
     }
     if(this.$store.getters.user.template_info.org_id==10644){
        this.formValue.puncture_needle = ""
    }
   }
  
   if(this.$store.getters.user.template_info.org_id == 10721){
       console.log("提问呢------------------------",this.formValue.temperature)
       if(this.formValue.temperature == '' || this.formValue.temperature ==0 || this.formValue.temperature == "undefined"){
          this.formValue.temperature = 36.5
       }
    }

},
computed: {
  newFormValue () {
    return JSON.parse(JSON.stringify(this.formValue))
  }
},
methods: {
  getTimeOne (time) {
    if(time > 0){
      return uParseTime(time, '{y}-{m}-{d}')
    }else{
      return ""
    }

  },
  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()
    }
  },
  newClick (event) {
    console.log(event)
    // event.currentTarget.select()
  },
  isShow (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
  },
  isShow_title (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&&
              filedList[i].is_write == 1
      ) {
        return true
      }
    }
    return false
  },
  
  commitInfo: function () {
  if(this.isWrite('透前称重') ==true   && (this.formValue.weight_before =='' || this.formValue.weight_before ==undefined ||  this.formValue.weight_before == '0')){
     
      Toast.fail(`透前称重为必填字段，不能为空`)
    }else if (this.isCommit == true) {
     // this.isCommit = false
     let mode = 1

     if (this.formValue.dry_weight == undefined) {
       this.formValue.dry_weight = '0'
     } else {
       this.formValue.dry_weight = this.formValue.dry_weight.toString()
     }

     if (this.predialysis.id > 0) {
       mode = 1
       if (this.predialysis.creater == 0) {
         mode = 1
       } else {
         mode = 2
         if (this.predialysis.creater != this.$store.getters.user.admin.id) {
           mode = 3
         }
       }
     }
     this.machineType = getDataConfig('hemodialysis', 'machine_type')
     var arr = this.formValue
     for (let i = 0; i < this.machineType.length; i++) {
       if (arr.machine_type == this.machineType[i].id) {
         arr.machine_type = this.machineType[i].name
       }
     }

     if (arr.is_hemorrhage != undefined) {
       arr.is_hemorrhage = arr.is_hemorrhage.toString()
     }
     if (arr.catheter_bend != undefined) {
       arr.catheter_bend = parseInt(arr.catheter_bend)
     }
     if(this.formValue.blood_access_part_opera_id!=undefined || this.formValue.blood_access_part_opera_id!="NaN"){
       this.formValue.blood_access_part_opera_id = parseInt(this.formValue.blood_access_part_opera_id)?parseInt(this.formValue.blood_access_part_opera_id):0
     }

     this.formValue.thromubus_type = parseInt(this.formValue.thromubus_type)
     if(this.formValue.venous_catheterization!=undefined || this.formValue.venous_catheterization!="NaN"){
      this.formValue.venous_catheterization = parseInt(this.formValue.venous_catheterization)?parseInt(this.formValue.venous_catheterization):0
     }

     if(this.formValue.is_infect!=undefined){
        this.formValue.is_infect = this.formValue.is_infect.toString()
     }

     if(this.formValue.breathing_rate!=undefined){
        this.formValue.breathing_rate = this.formValue.breathing_rate.toString()
     }
     
      var puncture_needle_direction_name = this.GetConsciousness(this.formValue.puncture_needle_direction)
      this.formValue.puncture_needle_direction = puncture_needle_direction_name
      console.log('hhhahhah', this.formValue)
     if (this.formValue.thromubus_type === 2) {
       this.formValue.thromubus_a = ''
       this.formValue.thromubus_v = ''
       this.formValue.thrombus_av = ''
     }
     if(this.formValue.blood_access_noise == ""){
       this.formValue.blood_access_noise = 0
     }
     this.formValue = arr
     // 必填弹窗开始
       let ParamsQuery = this.formValue;

       console.log(ParamsQuery, "提交的参数");

       if(ParamsQuery.is_hemorrhage!=1){
         delete ParamsQuery.hemorrhage
       }

       let result = [];
       let filedList = this.$store.getters.user.fileds;
       let new_arr = Object.entries(ParamsQuery);
       new_arr.forEach((el) => {
         if (el[1] === "" || el[1] === 0 ) {
           // result.push(el);
           result.unshift(el)
         }else if(el[1] == '0' && el[1].length <=0){
            result.unshift(el)
          }
          else if(el[0] == 'emergency_treatment' && el[1]=='0'){
            result.unshift(el)
          }
          else if(el[0] == 'is_infect' && el[1]=='0'){
            result.unshift(el)
          }
          else if(el[0] == 'blood_access_noise' && el[1]=='0'){
            result.unshift(el)
          }
       });
       console.log(result, "提交的参数当中过滤出为空的");
       console.log(this.getArrEqual(filedList, result));
       let warnarr = [];
       warnarr = this.getArrEqual(filedList, result);

       if (warnarr.length > 0) {
         return this.open_tips(warnarr);
         // 必填弹窗结束

       } else{
         Toast.loading({ forbidClick: true, duration: 0 })
          EditAssessmentBeforeDislysis(
            this.$route.query.patient_id,
            this.record_date,
            this.formValue,
            mode
          ).then(response => {
            if (response.data.state == 0) {
              Toast(response.data.msg)
              this.isCommit = true
              if(response.data.code == 600000008){
                this.infor_visibility = true
              }
              return false
            } else {
              this.$emit('evaluation', response.data.data.evaluation)
              var obj = this.predialysis
              var arr = getDataConfig('hemodialysis', 'machine_type')
              for (let i = 0; i < arr.length; i++) {
                if (obj.machine_type == arr[i].name) {
                  obj.machine_type = arr[i].id
                }
              }
              this.formValue = response.data.data.evaluation
              if (this.formValue.dry_weight == undefined) {
                this.formValue.dry_weight = '0'
              } else {
                this.formValue.dry_weight = response.data.data.evaluation.dry_weight.toString()
              }
              var puncture_needle_direction_one = this.PuncTureNeedleName(response.data.data.evaluation.puncture_needle_direction)
   
              if(puncture_needle_direction_one >0){
                this.formValue.puncture_needle_direction = puncture_needle_direction_one.toString()
              } 
              Toast('提交完成')
              this.isCommit = true
            }
            this.changeAssessmentBefore = 0
          }).catch(error => {
            this.isCommit = true
            Toast.fail('请求失败')
            this.changeAssessmentBefore = 0
          })
       }
    }
  },

  getArrEqual(arr1, arr2) {
    // console.log(arr1, arr2, "arr1, arr2");
    let newArr = [];
    for (let i = 0; i < arr2.length; i++) {
      for (let j = 0; j < arr1.length; j++) {
        if (arr1[j].module == 3 && arr1[j].is_show == 1 &&arr1[j].filed_name == arr2[i][0]&&arr1[j].is_write == 1) {
          // console.log(arr1[j],'数据字段')
          // console.log(arr2[i][0], "这是啥呀");
          newArr.push(arr1[j]);
        }
        if(arr1[j].module == 3 &&
          arr1[j].is_show == 1 &&
          arr1[j].is_write == 1 &&
          arr1[j].filed_name == arr2[i][0] &&
          arr1[j].filed_name == 'hemorrhage_other' && this.formValue.is_hemorrhage == 1)
          {
            console.log('1234567889999',this.formValue.hemorrhage_other);
            newArr.push(arr1[j]);
        }
        if(arr1[j].module == 3 &&
          arr1[j].is_show == 1 &&
          arr1[j].is_write == 1 &&
          arr1[j].filed_name == arr2[i][0] &&
          arr1[j].filed_name == 'hemorrhage' && this.formValue.is_hemorrhage == 1)
          {
            console.log('qwertyuiop',this.formValue.hemorrhage_other);
            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) {
        Toast.fail(`${info[i].filed_name_cn}为必填字段，不能为空`)
      }
      if(info[i].filed_name == 'emergency_treatment_other'&& this.formValue.emergency_treatment != '0'){
        Toast.fail(`${info[i].filed_name_cn}为必填字段，不能为空`);
      }
      if(info[i].filed_name == 'hemorrhage_other'){
        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 == 3 &&
        filedList[i].filed_name_cn == name &&
        filedList[i].is_write == 1 &&
        filedList[i].is_show == 1
      ) {
        return true;
      }
    }
    return false;
  },
  getString (val) {
    switch (val.type) {
      case 1:
        this.formValue.last_post_dialysis = val.result.join(',')
        break
      case 2:
        this.formValue.dialysis_interphase = val.result.join(',')
        break

      case 3:
        this.formValue.symptom_before_dialysis = val.result.join(',')
        break
      case 4:
        this.formValue.catheter = val.result.join(',')
        break
      case 5:
        this.formValue.complication = val.result.join(',')
        break
      case 6:
        this.formValue.blood_access_part_id = val.result.join(',')
        break
      case 7:
        this.formValue.blood_access_part_opera_id = val.selectId
        break
      case 8:
        this.formValue.internal_fistula = val.result.join(',')
        break
      case 9:
        this.formValue.hemorrhage = val.result.join(',')
        break
      case 10:
        this.formValue.internal_fistula_skin = val.result.join(',')
        break
      case 11:
        this.formValue.catheter_bend = val.selectId
        break
      case 12:
        this.formValue.blood_access_internal_fistula = val.result.join(',')
        break
      case 13:
        this.formValue.blood_access_noise = val.selectId
        break
      case 14:
        this.formValue.venous_catheterization = val.selectId
        break
      case 15:
        this.formValue.venous_catheterization_part = val.selectId
        break
      case 16:
        this.formValue.ductus_arantii = val.result.join(',')
        break
      case 17:
        this.formValue.emergency_treatment = val.selectId
        break
      case 18:
        this.formValue.puncture_way = val.selectId
        break
      case 19:
        if (val.selectId == 1) {
          this.hemorrhage_state = true
          this.formValue.is_hemorrhage = parseInt(val.selectId)
        } else if (val.selectId == 2) {
          this.hemorrhage_state = false
          this.formValue.is_hemorrhage = parseInt(val.selectId)
        } else if (this.formValue.is_hemorrhage == -2) {
        }
        break
      case 20:
        if (val.selectId == 1) {
          this.infect_state = true
          this.formValue.is_infect = val.selectId.toString()
        } else if (val.selectId == 2) {
          this.infect_state = false
          this.formValue.is_infect = val.selectId.toString()
        } else if (this.formValue.is_infect == -2) {
        }
        break
      case 21:
        this.formValue.skin = val.selectId.toString()
        break
      case 22:
        this.formValue.puncture_needle = val.result.join(',')
        break
      case 23:
        this.formValue.machine_type = val.selectId
        break
      case 24:
        this.formValue.humor_excessive_symptom = val.selectId
        break
      case 25:
        this.formValue.skin = val.result.join(',')
        break
      case 26:
        this.formValue.puncture_way = val.result.join(',')
        break
      case 27:
        this.formValue.catheter_suture = val.result.join(',')
        break
      case 28:
        this.formValue.edema = val.result.join(',')
        break
      case 30:
        this.formValue.pinholing = val.result.join(',')
        break
      case 31:
        this.formValue.catheter_maintenance = val.result.join(',')
      case 32:
        if (val.selectId == 1) {
          this.thromubusShow = true
          this.thromubus_type = true
          this.formValue.thromubus_type = parseInt(val.selectId)
        } else if (val.selectId == 2) {
          this.thromubusShow = false
          this.thromubus_type = false
          this.formValue.thromubus_type = parseInt(val.selectId)
        } else if (this.formValue.thromubus_type == -2) {
        }
        break
      case 33:
        this.formValue.humor_excessive_symptom = val.result.join(',')
        break
      case 34:
        if (val.selectId == 1) {
          this.formValue.period = val.selectId
          this.periods_state = true
        } else if (val.selectId == 2) {
          this.formValue.period = val.selectId
          this.periods_state = false
        } else {
          this.formValue.period = 0
        }

        break
      case 35:
        this.formValue.suction = val.result.join(',')
        break
      case 36:
        this.formValue.point_puncture = val.result.join(',')
        break
      case 37:
        this.formValue.catheter_evaluation_program = val.result.join(',')
        break
        case 38:
        this.formValue.skin_site_catheterization = val.result.join(',')
        break
      

    }
  },
  showSubMenu (val) {
    this.checkBoxShow = true
    switch (val) {
      case 'last_post_dialysis':
        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.type = 1
        this.isShowDialog = false
        this.propForm.isShowOther = 2

        this.propForm.title = '前次透析后'
        this.visibility = true
        this.propForm.list = getDataConfig(
          'hemodialysis',
          'last_dialysis_after'
        )
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        if (
          this.formValue.last_post_dialysis != undefined ||
                  this.formValue.last_post_dialysis != null
        ) {
          if (this.formValue.last_post_dialysis.length > 0) {
            this.propForm.result = this.formValue.last_post_dialysis.split(
              ','
            )
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }

        this.propForm.click_ref = 'last_post_dialysis'

        break
      case 'dialysis_interphase':
        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.isShowOther = 2

        this.propForm.type = 2
        this.isShowDialog = false
        this.propForm.title = '透析期间'
        this.visibility = true
        this.propForm.list = getDataConfig(
          'hemodialysis',
          'dialysis_duration'
        )
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        if (
          this.formValue.dialysis_interphase != undefined ||
                  this.formValue.dialysis_interphase != null
        ) {
          if (this.formValue.dialysis_interphase.length > 0) {
            this.propForm.result = this.formValue.dialysis_interphase.split(
              ','
            )
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }
        this.propForm.click_ref = 'dialysis_interphase'
        break

      case 'symptom_before_dialysis':
        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.isShowOther = 2

        this.propForm.type = 3
        this.isShowDialog = false
        this.propForm.title = '透析前症状'
        this.visibility = true
        this.propForm.list = getDataConfig('hemodialysis', 'dialysis_before')
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        if (
          this.formValue.symptom_before_dialysis != undefined ||
                  this.formValue.symptom_before_dialysis != null
        ) {
          if (this.formValue.symptom_before_dialysis.length > 0) {
            this.propForm.result = this.formValue.symptom_before_dialysis.split(
              ','
            )
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }
        this.propForm.click_ref = 'symptom_before_dialysis'
        break

      case 'catheter':
        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.isShowOther = 1

        this.propForm.type = 4
        this.isShowDialog = false
        this.propForm.title = '导管'
        this.visibility = true
        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.result = []
        this.isHasOther = 1
        this.propForm.isShowOther = 2

        this.propForm.type = 5
        this.isShowDialog = false
        this.propForm.title = '并发症'
        this.visibility = true
        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_id':

        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.isShowOther = 1

        this.propForm.type = 6
        this.isShowDialog = false
        this.propForm.title = '血管通路部位'
        this.visibility = true
        this.propForm.list = []
        this.propForm.list = getDataConfig(
          'hemodialysis',
          'vascular_access'
        )
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        if (
          this.formValue.blood_access_part_id != undefined ||
                  this.formValue.blood_access_part_id != null
        ) {
          if (this.formValue.blood_access_part_id.length > 0) {
            this.propForm.result = this.formValue.blood_access_part_id.split(',')
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }
        this.propForm.click_ref = 'blood_access_part_id'
        break

      case 'vascular_access_desc':
        this.isHasOther = 2
        this.propForm.isShowOther = 1

        this.propForm.type = 7
        this.isShowDialog = false
        this.propForm.title = '血管通路'
        this.visibility = true
        this.propForm.list = []
        this.propForm.optionList = getDataConfig(
          'hemodialysis',
          'vascular_access_desc'
        )
        this.propForm.isMultiple = 1
        this.propForm.selectId = this.formValue.blood_access_part_opera_id
        this.propForm.click_ref = 'vascular_access_desc'
        break

      case 'internal_fistula':
        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.isShowOther = 1

        this.propForm.type = 8
        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.result = this.formValue.internal_fistula.split(",")
        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 'hemorrhage':
        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.isShowOther = 1

        this.propForm.type = 9
        this.isShowDialog = false
        this.propForm.title = '出血'
        this.visibility = true
        this.propForm.list = []
        this.propForm.list = getDataConfig('hemodialysis', 'hemorrhage')
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        // this.propForm.result = typeof(this.formValue.hemorrhage) == "string"? this.formValue.hemorrhage.split(","):[]
        if (
          this.formValue.hemorrhage != undefined ||
                  this.formValue.hemorrhage != null
        ) {
          if (this.formValue.hemorrhage.length > 0) {
            this.propForm.result = this.formValue.hemorrhage.split(',')
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }
        this.propForm.click_ref = 'hemorrhage'
        break
      case 'internal_fistula_skin':
        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.isShowOther = 1

        this.propForm.type = 10
        this.isShowDialog = false
        this.propForm.title = '血管通路皮肤情况'
        this.visibility = true
        this.propForm.list = getDataConfig('hemodialysis', 'internal_fistula_skin')
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        // this.propForm.result = this.formValue.hemorrhage.split(",")
        if (
          this.formValue.internal_fistula_skin != undefined ||
                  this.formValue.internal_fistula_skin != null
        ) {
          if (this.formValue.internal_fistula_skin.length > 0) {
            this.propForm.result = this.formValue.internal_fistula_skin.split(
              ','
            )
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }
        this.propForm.click_ref = 'internal_fistula_skin'
        break

      case 'catheter_bend':
        this.isHasOther = 2
        this.propForm.isShowOther = 1

        this.propForm.type = 11
        this.isShowDialog = false
        this.propForm.title = '导管打折'
        this.visibility = true
        this.propForm.list = []
        this.propForm.optionList = this.$store.getters.catheter_bend
        this.propForm.isMultiple = 1
        this.propForm.selectId = this.formValue.catheter_bend
        this.propForm.click_ref = 'catheter_bend'
        break

      case 'blood_access_internal_fistula':
        this.propForm.result = []
        this.propForm.isHasOther = 2
        this.propForm.type = 12
        this.propForm.isShowOther = 1

        this.isShowDialog = false
        this.propForm.title = '血管通路(内瘘)'
        this.visibility = true
        this.propForm.list = this.$store.getters.blood_access_internal_fistula
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        // this.propForm.result = this.formValue.hemorrhage.split(",")
        if (
          this.formValue.blood_access_internal_fistula != undefined ||
                  this.formValue.blood_access_internal_fistula != null
        ) {
          if (this.formValue.blood_access_internal_fistula.length > 0) {
            this.propForm.result = this.formValue.blood_access_internal_fistula.split(
              ','
            )
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }
        this.propForm.click_ref = 'blood_access_internal_fistula'
        break

      case 'blood_access_noise':
        this.propForm.isHasOther = 2
        this.propForm.isShowOther = 1

        this.propForm.type = 13
        this.isShowDialog = false
        this.propForm.title = '血管杂音'
        this.visibility = true
        this.propForm.list = []
        this.propForm.optionList = this.$store.getters.blood_access_noise
        this.propForm.isMultiple = 1
        this.propForm.selectId = this.formValue.blood_access_noise
        this.propForm.click_ref = 'blood_access_noise'
        break

      case 'venous_catheterization':
        this.propForm.isHasOther = 2
        this.propForm.isShowOther = 1

        this.propForm.type = 14
        this.isShowDialog = false
        this.propForm.title = '中心静脉置管'
        this.visibility = true
        this.propForm.list = []
        this.propForm.optionList = this.$store.getters.venous_catheterization
        this.propForm.isMultiple = 1
        this.propForm.selectId = this.formValue.venous_catheterization
        this.propForm.click_ref = 'venous_catheterization'
        break
      case 'venous_catheterization_part':
        this.propForm.isHasOther = 1

        this.propForm.type = 15
        this.isShowDialog = false
        this.propForm.title = '位置'
        this.propForm.isShowOther = 1

        this.visibility = true
        this.propForm.list = []
        this.propForm.optionList = this.$store.getters.venous_catheterization_part
        this.propForm.isMultiple = 1
        this.propForm.selectId = this.formValue.venous_catheterization_part
        this.propForm.click_ref = 'venous_catheterization_part'
        break
      case 'ductus_arantii':
        this.propForm.result = []
        this.propForm.isHasOther = 2
        this.propForm.type = 16
        this.isShowDialog = false
        this.propForm.title = '中心静脉导管'
        this.propForm.isShowOther = 1

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

        break

      case 'emergency_treatment':
        this.propForm.isHasOther = 1

        this.propForm.type = 17
        this.isShowDialog = false
        this.propForm.title = '急诊'
        this.visibility = true
        this.propForm.isShowOther = 1

        this.propForm.list = []
        this.propForm.optionList = this.$store.getters.emergency_treatment
        this.propForm.isMultiple = 1
        this.propForm.selectId = this.formValue.emergency_treatment
        this.propForm.click_ref = 'emergency_treatment'
        break
      case 'hemorrhage_state':
        this.propForm.type = 19
        this.isShowDialog = false
        this.propForm.title = '出血'
        this.visibility = true
        this.propForm.isShowOther = 1

        this.propForm.list = []
        this.propForm.optionList = this.hemorrhages
        this.propForm.isMultiple = 1
        this.propForm.selectId = this.formValue.is_hemorrhage
        this.propForm.click_ref = 'hemorrhage_state'
        break

      case 'infect_state':
        this.propForm.type = 20
        this.isShowDialog = false
        this.propForm.title = '感染'
        this.visibility = true
        this.propForm.isShowOther = 1

        this.propForm.list = []
        this.propForm.optionList = this.infects
        this.propForm.isMultiple = 1
        this.propForm.selectId = this.formValue.is_infect
        this.propForm.click_ref = 'infect_state'
        break

        // case 'skin':
        //   this.propForm.type = 21
        //   this.isShowDialog = false
        //   this.propForm.title = '皮肤'
        //   this.visibility = true
        //   this.propForm.isShowOther = 1

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

      case 'puncture_needle':
        this.propForm.result = []
        this.propForm.isHasOther = 2
        this.propForm.type = 22
        this.isShowDialog = false
        this.propForm.isShowOther = 1

        this.propForm.title = '穿刺针'
        this.visibility = true
        this.propForm.list = getDataConfig(
          'hemodialysis',
          'puncture_needle'
        )
        console.log("除非=-----------------",this.propForm.list)
        console.log("this.formValue.puncture_needle.split(',')",this.formValue.puncture_needle.split(','))
         
       var puncture_needle_str =  this.formValue.puncture_needle.split(',')
        var newArr = [];
        for (let i = 0; i < this.propForm.list.length; i++) {
            for (let j = 0; j < puncture_needle_str.length; j++) {
              var name = this.propForm.list[i].name.toUpperCase();
              var app = puncture_needle_str[j].toUpperCase();
              if (name == app) {
                newArr.push(this.propForm.list[i].name);
              }
            }
          }

        console.log("newArr--------",newArr)

        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        if (this.formValue.puncture_needle != undefined ||this.formValue.puncture_needle != null) {
          if (this.formValue.puncture_needle.length > 0) {

            this.propForm.result = newArr

          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }
        this.propForm.click_ref = 'puncture_needle'
        break

      case 'machine_type':
        this.isHasOther = 2
        this.propForm.isShowOther = 1
        this.propForm.type = 23
        this.isShowDialog = false
        this.propForm.title = '透析机型号'
        this.visibility = true
        this.propForm.list = []
        this.propForm.optionList = getDataConfig(
          'hemodialysis',
          'machine_type'
        )
        this.propForm.isMultiple = 1
        this.propForm.selectId = this.formValue.machine_type
        this.propForm.click_ref = 'machine_type'
        break
        // eslint-disable-next-line no-duplicate-case
      case 'skin':
        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.isShowOther = 1

        this.propForm.type = 25
        this.isShowDialog = false
        this.propForm.title = '皮肤'
        this.visibility = true
        this.propForm.list = getDataConfig('hemodialysis', 'skin')
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        // this.propForm.result = this.formValue.hemorrhage.split(",")
        if (
          this.formValue.skin != undefined ||
                  this.formValue.skin != null
        ) {
          if (this.formValue.skin.length > 0) {
            this.propForm.result = this.formValue.skin.split(
              ','
            )
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }
        this.propForm.click_ref = 'skin'
        break
      case 'puncture_way':
        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.isShowOther = 1

        this.propForm.type = 26
        this.isShowDialog = false
        this.propForm.title = '穿刺方式'
        this.visibility = true
        this.propForm.list = getDataConfig('hemodialysis', 'puncture_method')
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        // this.propForm.result = this.formValue.hemorrhage.split(",")
        if (
          this.formValue.puncture_way != undefined ||
                  this.formValue.puncture_way != null
        ) {
          if (this.formValue.puncture_way.length > 0) {
            this.propForm.result = this.formValue.puncture_way.split(
              ','
            )
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }
        this.propForm.click_ref = 'puncture_way'
        break

      case 'pinholing':
        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.isShowOther = 1

        this.propForm.type = 30
        this.isShowDialog = false
        this.propForm.title = '针眼'
        this.visibility = true
        this.propForm.list = getDataConfig('hemodialysis', 'pinholing')
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        // this.propForm.result = this.formValue.hemorrhage.split(",")
        if (
          this.formValue.pinholing != undefined ||
                  this.formValue.pinholing != null
        ) {
          if (this.formValue.pinholing.length > 0) {
            this.propForm.result = this.formValue.pinholing.split(',')
            // console.log("箴言------",this.propForm.result)
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }
        this.propForm.click_ref = 'puncture_way'
        break

      case 'edema':
        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.type = 28
        this.isShowDialog = false
        this.propForm.isShowOther = 2
        this.propForm.title = '水肿'
        this.visibility = true
        this.propForm.list = getDataConfig(
          'hemodialysis',
          'edema'
        )
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        if (
          this.formValue.edema != undefined ||
                  this.formValue.edema != null
        ) {
          if (this.formValue.edema.length > 0) {
            this.propForm.result = this.formValue.edema.split(
              ','
            )
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }

        this.propForm.click_ref = 'edema'

        break
      case 'catheter_suture':
        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.type = 27
        this.isShowDialog = false
        this.propForm.isShowOther = 2

        this.propForm.title = '导管缝线'
        this.visibility = true
        this.propForm.list = getDataConfig(
          'hemodialysis',
          'catheter_suture'
        )
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        if (
          this.formValue.catheter_suture != undefined ||
                  this.formValue.catheter_suture != null
        ) {
          if (this.formValue.catheter_suture.length > 0) {
            this.propForm.result = this.formValue.catheter_suture.split(
              ','
            )
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }

        this.propForm.click_ref = 'catheter_suture'

        break

      case 'catheter_maintenance':
        this.propForm.result = []
        this.isHasOther = 1
        this.propForm.isShowOther = 2

        this.propForm.type = 31
        this.isShowDialog = false
        this.propForm.title = '导管维护'
        this.visibility = true
        this.propForm.list = getDataConfig('hemodialysis', 'catheter_maintenance')
        this.propForm.optionList = []
        this.propForm.isMultiple = 2

        if (
          this.formValue.catheter_maintenance != undefined ||
                  this.formValue.catheter_maintenance != null
        ) {
          if (this.formValue.catheter_maintenance.length > 0) {
            this.propForm.result = this.formValue.catheter_maintenance.split(',')
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }

        this.propForm.click_ref = 'catheter_maintenance'
        break

      case 'thromubus_type':
        this.propForm.type = 32
        this.isShowDialog = false
        this.propForm.title = '出血'
        this.visibility = true
        this.propForm.isShowOther = 1

        this.propForm.list = []
        this.propForm.optionList = this.thromubustype
        this.propForm.isMultiple = 1
        this.propForm.selectId = this.formValue.thromubus_type
        this.propForm.click_ref = 'thromubus_type'
        break

      case 'humor_excessive_symptom_info':

        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.isShowOther = 1

        this.propForm.type = 33
        this.isShowDialog = false
        this.propForm.title = '体液过多症状'
        this.visibility = true
        this.propForm.list = []
        this.propForm.list = getDataConfig(
          'hemodialysis',
          'humor_excessive_symptom'
        )
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        if (
          this.formValue.humor_excessive_symptom_array != undefined ||
                  this.formValue.humor_excessive_symptom != null
        ) {
          if (this.formValue.humor_excessive_symptom_array.length > 0) {
            this.propForm.result = this.formValue.humor_excessive_symptom_array.split(',')
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }
        this.propForm.click_ref = 'humor_excessive_symptom'
        break
      case 'periods_state':
        this.propForm.type = 34
        this.isShowDialog = false
        this.propForm.title = '围手术期'
        this.visibility = true
        this.propForm.isShowOther = 1

        this.propForm.list = []
        this.propForm.optionList = this.periods
        this.propForm.isMultiple = 1
        this.propForm.selectId = this.formValue.period
        this.propForm.click_ref = 'periods_state'
        break
      case 'suction':
        this.propForm.result = []
        this.isHasOther = 2
        this.propForm.type = 35
        this.isShowDialog = false
        this.propForm.isShowOther = 2
        this.propForm.title = '抽吸'
        this.visibility = true
        this.propForm.list = getDataConfig(
          'hemodialysis',
          'suction'
        )
        this.propForm.optionList = []
        this.propForm.isMultiple = 2
        if (
          this.formValue.suction != undefined ||
                  this.formValue.suction != null
        ) {
          if (this.formValue.suction.length > 0) {
            this.propForm.result = this.formValue.suction.split(
              ','
            )
          } else {
            this.propForm.result = []
          }
        } else {
          this.propForm.result = []
        }

        this.propForm.click_ref = 'suction'

        break

        case 'point_puncture':
          this.propForm.result = []
          this.propForm.isHasOther = 2
          this.propForm.type = 36
          this.isShowDialog = false
          this.propForm.isShowOther = 1

          this.propForm.title = '穿刺针'
          this.visibility = true
          this.propForm.list = getDataConfig(
            'hemodialysis',
            'point_puncture'
          )
          this.propForm.optionList = []
          this.propForm.isMultiple = 2
          if (
            this.formValue.point_puncture != undefined ||
                    this.formValue.point_puncture != null
          ) {
            if (this.formValue.point_puncture.length > 0) {
              this.propForm.result = this.formValue.point_puncture.split(',')
            } else {
              this.propForm.result = []
            }
          } else {
            this.propForm.result = []
          }
          this.propForm.click_ref = 'point_puncture'
          break


          case 'catheter_evaluation_program':
          this.propForm.result = []
          this.isHasOther = 2
          this.propForm.isShowOther = 1

          this.propForm.type = 37
          this.isShowDialog = false
          this.propForm.title = '导管评估项目'
          this.visibility = true
          this.propForm.list = []
          this.propForm.list = getDataConfig(
            'hemodialysis',
            'catheter_evaluation_program'
          )

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

          case 'skin_site_catheterization':
          this.propForm.result = []
          this.isHasOther = 2
          this.propForm.isShowOther = 1

          this.propForm.type = 38
          this.isShowDialog = false
          this.propForm.title = '置管部位皮肤'
          this.visibility = true
          this.propForm.list = []
          this.propForm.list = getDataConfig(
            'hemodialysis',
            'skin_site_catheterization'
          )

          this.propForm.optionList = []
          this.propForm.isMultiple = 2
          if (
            this.formValue.skin_site_catheterization != undefined ||
                    this.formValue.skin_site_catheterization != null
          ) {
            if (this.formValue.skin_site_catheterization.length > 0) {
              this.propForm.result = this.formValue.skin_site_catheterization.split(',')
            } else {
              this.propForm.result = []
            }
          } else {
            this.propForm.result = []
          }
          this.propForm.click_ref = 'skin_site_catheterization'
          break
    }
  },
  showDryWeight: function () {
    this.isShowDialog = false
    this.dry_visibility = true
    this.$nextTick(() => {
      this.$refs.dry.open()
      this.propDryForm.doctor = []
      for (let i = 0; i < this.admin_users_prop.length; i++) {
        if (
          this.admin_users_prop[i].user_type == 2 ||
                  this.admin_users_prop[i].user_type == 1
        ) {
          this.propDryForm.doctor.push(this.admin_users_prop[i])
        }
      }
    })
  },
  menuDryCancle () {
    this.isShowDialog = true
    this.dry_visibility = false
    this.$refs.dry.close()
    // this.is_show_dry_weight = false
  },
  menuDryComfirm (val) {
    this.isShowDialog = true
    this.dry_visibility = false
    this.$refs.dry.close()
    this.formValue.dry_weight = val.dry_weight
    this.propDryForm.weight = val.dry_weight
    this.dry_weight = val
    this.$emit('weight_update', this.dry_weight)
  },
  DialysisModel: function (val) {
    let name = ''
    let options = getDataConfig('hemodialysis', 'machine_type')
    for (let index = 0; index < options.length; index++) {
      const option = options[index]
      if (option.name == val) {
        name = option.name
        break
      }
    }
    return name
  },
  QueryOperaById: function (val) {
    let vascular_access_desc_name = ''
    let vascular_access_desc = getDataConfig('hemodialysis', '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
      }
    }

    return vascular_access_desc_name
  },
  QueryHumorById: function (val) {
    let humor_excessive_symptom_name = ''
    let humor_excessive_symptom_array = getDataConfig('hemodialysis', 'humor_excessive_symptom')
    for (let i = 0; i < humor_excessive_symptom_array.length; i++) {
      if (humor_excessive_symptom_array[i].id == val) {
        humor_excessive_symptom_name = humor_excessive_symptom_array[i].name
      }
    }
    return humor_excessive_symptom_name
  },
  getBloodAccessNoise: function (id) {
    var BloodAccessNoiseOptions = this.$store.getters.blood_access_noise
    var BloodAccessNoiseName = ''
    for (let i = 0; i < BloodAccessNoiseOptions.length; i++) {
      if (BloodAccessNoiseOptions[i].id == id) {
        BloodAccessNoiseName = BloodAccessNoiseOptions[i].name
      }
    }
    return BloodAccessNoiseName
  },
  getVenousCatheterization: function (id) {
    var VenousCatheterizationOptions = this.$store.getters.venous_catheterization
    var VenousCatheterizationName = ''
    for (let i = 0; i < VenousCatheterizationOptions.length; i++) {
      if (VenousCatheterizationOptions[i].id == id) {
        VenousCatheterizationName = VenousCatheterizationOptions[i].name
      }
    }
    return VenousCatheterizationName
  },
  GetCatheterBendById: function (val) {
    let name = ''
    let options = this.$store.getters.catheter_bend
    for (let index = 0; index < options.length; index++) {
      const option = options[index]
      if (option.id == val) {
        name = option.name
        break
      }
    }
    return name
  },
  getEmergencyTreatment: function (id) {
    if (id == -1) {
      return '其他'
    }
    var emergencyTreatmentOptions = this.$store.getters.emergency_treatment
    var emergencyTreatmentName = ''
    for (let i = 0; i < emergencyTreatmentOptions.length; i++) {
      if (emergencyTreatmentOptions[i].id == id) {
        emergencyTreatmentName = emergencyTreatmentOptions[i].name
      }
    }
    return emergencyTreatmentName
  },
  getPermission () {
    request
      .get('/m/api/permission/get', {
        params: {
          create_url: '/m/api/assessmentbefore/commit?mode=1',
          modify_url: '/m/api/assessmentbefore/commit?mode=2',
          modify_other_url: '/m/api/assessmentbefore/commit?mode=3',
          module: 3
        }
      })
      .then(res => {
        if (res.data.state == 0) {
          this.hasPermission = false
        } else if (res.data.state == 1) {
          if (this.predialysis.id != '' && this.predialysis.creater != 0) {
            // 有数据
            if (
              this.predialysis.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.predialysis.id == '' ||
                  this.predialysis.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
  },
  selectNucleinDateAction () {
      this.$refs.nuclein_date_picker.open()
    },
  didNucleinDateTime: function (time) {
    this.nuclein_date_str = parseTime(time, '{y}-{m}-{d}')
  },
  toTeach (val) {
      if (val >= 0) {
        this.teach.map(item => {
          if (item.id == val) {
            var theValue = item.value
            this.dialysisAfterTeachSelectChange(theValue)
          }
        })
      }
      this.teachShow = false
    },
  dialysisAfterTeachSelectChange: function (values) {
    if (this.formValue.befor_symptoms == null) {
      this.formValue.befor_symptoms == ''
    }
    if (this.formValue.befor_symptoms == '') {
      this.formValue.befor_symptoms = values
    } else {
      if (this.formValue.befor_symptoms.indexOf(values) == -1) {
        if (this.formValue.befor_symptoms.charAt(this.formValue.befor_symptoms.length - 1).indexOf('。') == -1) {
          this.formValue.befor_symptoms =
          this.formValue.befor_symptoms + ',' + values
        } else {
          this.formValue.befor_symptoms = this.formValue.befor_symptoms + values
        }
      }
    }
  },

  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
  },
  GetConsciousness (val) {
      let str = ''
      if(this.consciousness_arr!=null){
        for (let i = 0; i < this.consciousness_arr.length; i++) {
        if (this.consciousness_arr[i].id == val) {
          str = this.consciousness_arr[i].name
        }
      }
      return str
      }
     
    },
   PuncTureNeedleName(name){
   
     var newArr =  getDataConfig('hemodialysis', 'puncture_needle_direction')
      var id =0
      if(newArr!=null){
        for(let i=0;i<newArr.length;i++){
         if(name ==newArr[i].name){
            id = newArr[i].id
         }
      }
       return id 
      }
    
    }
},
watch: {
  'formValue.weight_before': {

    handler (newWeight, oldWeight) {
      let weight = parseFloat(
        newWeight - this.formValue.additional_weight
      ).toFixed(1)
      if (weight > 0) {
        this.body_weight_before = weight
      } else {
        this.body_weight_before = ''
      }
    },
    deep: true,
    immediate: true
  },
  'formValue.additional_weight': {
    handler (newWeight, oldWeight) {
      if (newWeight > 0) {
        let weight = parseFloat(
          this.formValue.weight_before - newWeight
        ).toFixed(1)
        if (weight > 0) {
          this.body_weight_before = weight
        } else {
          this.body_weight_before = ''
        }
      }
    },
    deep: true,
    immediate: true,
    data: []
  },
  newFormValue: {
    handler (newVal, oldVal) {
      if (!this.isObjectValueEqual(newVal, oldVal)) {
        this.changeAssessmentBefore++
      }
    },
    deep: true
  }
}
}
</script>

<style lang="scss" scoped>
.assessmentBefore{
  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">
.assessmentBefore{
  .van-field__label{
      width: 8.75rem;
  }
  .advicePopup{
      width: 90%;
      .Dialog{
          width: 100%;
      }
      .DialogTit{
          padding: .625rem;
      }
      .CheckBox{
          max-height: 28.8rem !important;
          min-height: 10rem !important;
      }
      .DialogContent .item{
          padding: 0 .625rem;
          font-size: 1rem;
      }
      .DialogContent .item .name{
          height: 2.625rem;
          line-height: 2.625rem;
          font-size: .875rem;
      }
      .DialogContent .item .content .text{
          font-size: .875rem;
      }
      .optionsBox{
          min-height: 22rem !important;
      }
      .optionsBox ul li{
          height: 2.25rem;
          line-height: 2.25rem;
          font-size: .875rem;
          padding: 0 .75rem;
      }
      .optionsBox ul .tick::before{
          top: .75rem;
          right: .875rem;
          width: .5625rem;
          height: .3125rem;
      }
  }
}
#today_panel{
  .advicePopup{
      width: 90% !important;
      font-size: .875rem !important;
      z-index: 6000 !important;
      top: 10% !important;
      .Dialog{
          width: 100% !important;
      }
      .DialogTit{
          padding: .625rem !important;
      }
      .Dialog .DialogContent .item{
          padding: 0 .625rem;
      }
      .Dialog .DialogTit .iconfont{
          font-size: .875rem !important;
      }
      .newBack{
          font-size: .875rem !important;
      }
      .Dialog .DialogTit .success{
          font-size: .875rem !important;
      }
      .Dialog .DialogTit .name{
          font-size: .875rem !important;
      }
      .Dialog .DialogContent .item .name{
          height: 2.625rem !important;
          line-height: 2.625rem !important;
          font-size: .875rem !important;
      }
      .Dialog .DialogContent .item .content{
          font-size: .875rem !important;
      }
      .optionsBox ul li{
          height: 2.25rem !important;
          line-height: 2.25rem !important;
          font-size: .875rem !important;
      }
      .optionsBox{
          min-height: 15rem !important;
      }
      .optionsBox ul .tick::before{
          width: .625rem;
          height: .3125rem;
          top: .75rem;
          right: .875rem
      }
      .Dialog .DialogContent .item .content input{
          font-size: .875rem !important;
      }
      .Dialog .DialogContent .item .content .text{
          font-size: .875rem !important;
      }
  }
}

.bgField{
        .van-field__control{
            border:1px solid #ccc;
            background: #f6f6f6;
            border-radius: 4px;
            min-height: 6.25rem !important;
        }
        ::placeholder{  //通过这个设置
            color: #999 !important;
        }
    }

</style>
