<template>
  <div>
    <div
      class="patient"
      :class="borderColor(patient)"
      v-for="(patient, index) in patients"
      :key="index"
      @click="detailAction(patient)"
    >
      <div style="overflow: hidden; width: 100%" class="online">
        <p
          style="
            float: right;
            height: 0.5rem;
            line-height: 0.5rem;
            margin-right: 0.28rem;
            margin-top: 0.2rem;
          "
          :class="stateColor(patient)"
        >
          {{ stateText(patient) }}
        </p>
      </div>
      <!-- <router-link :to="{path:'/details',  query: {patient_id: patient.patient_id, date: patient.schedule_date}}"> -->
      <div class="kehu">
        <div style="position: relative; flex: 2; margin-bottom: 8px" class="tx">
          <!-- <img
            :src="
              patient.patient.avatar.length > 0
                ? patient.patient.avatar
                : '../../assets/product/test.jpg'
            "
            alt
          /> -->
          <div style="display: flex; flex-direction: column">
            <img
              v-if="patient.patient.gender == 1"
              src="../../assets/images/man.png"
              alt=""
            />

            <img v-else src="../../assets/images/woman.png" alt="" />
            <span class="redpoint" v-if="getStatus(patient)">
              {{
                getUnReadNum(patient) > 99
                  ? getUnReadNum(patient) + "+"
                  : getUnReadNum(patient)
              }}
            </span>

            <div  v-if="patient.prescription != null && patient.prescription.water_machine=='是'" class="water"><span>水</span></div>
          </div>

          <div class="right">
            <h3 class="name">
              <span v-if="patient.patient.is_infectious==2" style="color:red">{{ patient.patient.name }}</span> 
              <span v-if="patient.patient.is_infectious!=2">{{ patient.patient.name }}</span> 
              <span class="num"
                >{{ genderText(patient) }} | {{ age(patient)>200 ? patient.patient.age : age(patient) }}岁</span
              >
            </h3>
            <div class="difficult" v-if="patient.patient.troble_shoot == 1">
              疑难内瘘
            </div>
            <!-- 性别、年龄 -->
            <div class="dislysisInfo" style="color: #1b2631">
              <p
                v-if="
                  $store.getters.user.template_info.org_id != 9671 &&
                  $store.getters.user.template_info.org_id != 9675 &&
                  $store.getters.user.template_info.org_id != 10340
                "
              >
                透析号:{{
                  patient.patient.dialysis_no ? patient.patient.dialysis_no : ""
                }}
              </p>
              <!-- <p
                v-if="
                  $store.getters.user.template_info.org_id == 9671 ||
                  $store.getters.user.template_info.org_id == 9675 ||
                  $store.getters.user.template_info.org_id == 10340
                "
              >
                核酸检测日期:
                <span v-if="patient.dialysis_order != null">{{
                  getTimeOne(patient.dialysis_order.nuclein_date)
                }}</span>
              </p> -->
              <p
                v-if="
                  $store.getters.user.template_info.org_id == 9671 ||
                  $store.getters.user.template_info.org_id == 9675 ||
                  $store.getters.user.template_info.org_id == 10340
                "
              >
                透析时长:
                <span
                  v-if="
                    patient.prescription != null &&
                    patient.prescription.dialysis_duration_hour > 0
                  "
                  >{{ patient.prescription.dialysis_duration_hour }}时</span
                >
                <span
                  v-if="
                    patient.prescription != null &&
                    patient.prescription.dialysis_duration_minute > 0
                  "
                  >{{ patient.prescription.dialysis_duration_minute }}分</span
                >

                <span
                  v-if="
                    patient.prescription == null &&
                    patient.dialysis_solution != null
                  "
                  >{{
                    patient.dialysis_solution.dialysis_duration_hour
                  }}时</span
                >
                <span
                  v-if="
                    patient.prescription == null &&
                    patient.dialysis_solution != null
                  "
                  >{{
                    patient.dialysis_solution.dialysis_duration_minute
                  }}分</span
                >
              </p>
              <p
                v-if="
                  $store.getters.user.template_info.org_id != 9671 &&
                  $store.getters.user.template_info.org_id != 9675 &&
                  $store.getters.user.template_info.org_id != 10340
                "
              >
                体重(前/后kg):{{
                  patient.assessment_before_dislysis
                    ? patient.assessment_before_dislysis.weight_before
                    : ""
                }}
                <span
                  v-if="
                    patient.assessment_after_dislysis &&
                    patient.assessment_after_dislysis.weight_after > 0
                  "
                  >/{{
                    patient.assessment_after_dislysis
                      ? patient.assessment_after_dislysis.weight_after
                      : ""
                  }}</span
                >
              </p>

              <p v-if="$store.getters.user.template_info.org_id == 10693">
                干体重(kg):
                {{patient.assessment_before_dislysis? patient.assessment_before_dislysis.dry_weight: ""}}
                
              </p>
              
              <p
                v-if="
                  $store.getters.user.template_info.org_id == 9671 ||
                  $store.getters.user.template_info.org_id == 9675 ||
                  $store.getters.user.template_info.org_id == 10340
                "
              >
                抗凝剂:
                <span v-if="patient.prescription != null">
                  <span v-if="patient.prescription.anticoagulant == 1"
                    >无肝素</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 2"
                    >普通肝素</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 3"
                    >低分子肝素</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 4"
                    >阿加曲班</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 5"
                    >枸橼酸钠</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 6"
                    >低分子肝素钙</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 7"
                    >低分子肝素钠</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 8"
                    >依诺肝素</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 9"
                    >达肝素</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 10"
                    >体外抗凝</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 11"
                    >那屈肝素</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 12"
                    >无抗凝剂</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 13"
                    >那屈肝素钙</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 14"
                    >肝素钙注射液</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 15"
                    >甲磺酸萘莫司他</span
                  >
                </span>

                <span
                  v-if="
                    patient.prescription == null &&
                    patient.dialysis_solution != null
                  "
                >
                  <span v-if="patient.dialysis_solution.anticoagulant == 1"
                    >无肝素</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 2"
                    >普通肝素</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 3"
                    >低分子肝素</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 4"
                    >阿加曲班</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 5"
                    >枸橼酸钠</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 6"
                    >低分子肝素钙</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 7"
                    >低分子肝素钠</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 8"
                    >依诺肝素</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 9"
                    >达肝素</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 10"
                    >体外抗凝</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 11"
                    >那屈肝素</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 12"
                    >无抗凝剂</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 13"
                    >那屈肝素钙</span
                  >
                </span>
              </p>

              <p
                v-if="
                  $store.getters.user.template_info.org_id == 9671 ||
                  $store.getters.user.template_info.org_id == 9675 ||
                  $store.getters.user.template_info.org_id == 10340
                "
              >
                总量:
                <span v-if="patient.prescription != null">
                  <span v-if="patient.prescription.anticoagulant == 1"
                    >{{ patient.prescription.anticoagulant_zongliang }}iu</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 2"
                    >{{ patient.prescription.anticoagulant_zongliang }}mg</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 3"
                    >{{ patient.prescription.anticoagulant_zongliang }}iu</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 4"
                    >{{ patient.prescription.anticoagulant_zongliang }}iu</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 5"
                    >{{ patient.prescription.anticoagulant_zongliang }}iu</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 6"
                    >{{ patient.prescription.anticoagulant_zongliang }}iu</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 7"
                    >{{ patient.prescription.anticoagulant_zongliang }}iu</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 8"
                    >{{ patient.prescription.anticoagulant_zongliang }}iu</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 9"
                    >{{ patient.prescription.anticoagulant_zongliang }}iu</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 10"
                    >{{ patient.prescription.anticoagulant_zongliang }}iu</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 11"
                    >{{ patient.prescription.anticoagulant_zongliang }}iu</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 12"
                    >{{ patient.prescription.anticoagulant_zongliang }}iu</span
                  >
                  <span v-if="patient.prescription.anticoagulant == 13"
                    >{{ patient.prescription.anticoagulant_zongliang }}iu</span
                  >
                </span>

                <span
                  v-if="
                    patient.prescription == null &&
                    patient.dialysis_solution != null
                  "
                >
                  <span v-if="patient.dialysis_solution.anticoagulant == 1"
                    >{{
                      patient.dialysis_solution.anticoagulant_zongliang
                    }}iu</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 2"
                    >{{
                      patient.dialysis_solution.anticoagulant_zongliang
                    }}mg</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 3"
                    >{{
                      patient.dialysis_solution.anticoagulant_zongliang
                    }}iu</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 4"
                    >{{
                      patient.dialysis_solution.anticoagulant_zongliang
                    }}iu</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 5"
                    >{{
                      patient.dialysis_solution.anticoagulant_zongliang
                    }}iu</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 6"
                    >{{
                      patient.dialysis_solution.anticoagulant_zongliang
                    }}iu</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 7"
                    >{{
                      patient.dialysis_solution.anticoagulant_zongliang
                    }}iu</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 8"
                    >{{
                      patient.dialysis_solution.anticoagulant_zongliang
                    }}iu</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 9"
                    >{{
                      patient.dialysis_solution.anticoagulant_zongliang
                    }}iu</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 10"
                    >{{
                      patient.dialysis_solution.anticoagulant_zongliang
                    }}iu</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 11"
                    >{{
                      patient.dialysis_solution.anticoagulant_zongliang
                    }}iu</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 12"
                    >{{
                      patient.dialysis_solution.anticoagulant_zongliang
                    }}iu</span
                  >
                  <span v-if="patient.dialysis_solution.anticoagulant == 13"
                    >{{
                      patient.dialysis_solution.anticoagulant_zongliang
                    }}iu</span
                  >
                </span>
              </p>

              <p>
                目标超滤量:
                <span
                  v-if="
                    patient.prescription &&
                    patient.prescription.target_ultrafiltration > 0
                  "
                >
                  <span v-if="$store.getters.user.template_info.org_id == 10340"
                    >{{
                      patient.prescription
                        ? patient.prescription.target_ultrafiltration
                        : ""
                    }}ml</span
                  >

                  <span v-if="$store.getters.user.template_info.org_id == 10751"
                    >{{
                      patient.prescription
                        ? patient.prescription.target_ultrafiltration
                        : ""
                    }}ml</span
                  >

                  <span v-if="$store.getters.user.template_info.org_id == 10597"
                    >{{
                      patient.prescription
                        ? patient.prescription.target_ultrafiltration
                        : ""
                    }}L</span
                  >

                  <span v-if="$store.getters.user.template_info.org_id == 10612"
                    >{{
                      patient.prescription
                        ? patient.prescription.target_ultrafiltration
                        : ""
                    }}L</span
                  >
                  <span
                    v-if="$store.getters.user.template_info.org_id != 10340 && $store.getters.user.template_info.org_id != 10597 && $store.getters.user.template_info.org_id != 10612 && $store.getters.user.template_info.org_id != 10751"
                    >{{
                      patient.prescription
                        ? patient.prescription.target_ultrafiltration
                        : ""
                    }}</span
                  >
                </span>

                <span
                  v-if="
                    patient.prescription == null &&
                    patient.dialysis_solution != null
                  "
                >
                  <span
                    v-if="$store.getters.user.template_info.org_id == 10340"
                  >
                    <span
                      >{{
                        patient.dialysis_solution
                          ? patient.dialysis_solution.target_ultrafiltration
                          : ""
                      }}ml</span
                    >
                  </span>
                  <span
                    v-if="$store.getters.user.template_info.org_id == 10751"
                  >
                    <span
                      >{{
                        patient.dialysis_solution
                          ? patient.dialysis_solution.target_ultrafiltration
                          : ""
                      }}ml</span
                    >
                  </span>
                  <span
                    v-if="$store.getters.user.template_info.org_id == 10597"
                  >
                    <span
                      >{{
                        patient.dialysis_solution
                          ? patient.dialysis_solution.target_ultrafiltration
                          : ""
                      }}L</span
                    >
                  </span>
                  <span
                    v-if="$store.getters.user.template_info.org_id != 10340 && $store.getters.user.template_info.org_id != 10597&& $store.getters.user.template_info.org_id != 10751"
                    >{{
                      patient.prescription
                        ? patient.prescription.target_ultrafiltration
                        : ""
                    }}</span
                  >
                </span>
              </p>

              <p v-if="$store.getters.user.template_info.org_id == 10597 || $store.getters.user.template_info.org_id == 10612 || $store.getters.user.template_info.org_id == 10598 || $store.getters.user.template_info.org_id == 10679 || $store.getters.user.template_info.org_id == 10677 || $store.getters.user.template_info.org_id == 10702|| $store.getters.user.template_info.org_id == 10745">
                处方脱水量:
                  <span>{{patient.prescription? patient.prescription.prescription_water: ""}}L</span>
              </p>

              <p v-if="$store.getters.user.template_info.org_id == 10751">
                处方脱水量:
                  <span>{{patient.prescription? patient.prescription.prescription_water: ""}}ml</span>
              </p>

              <p
                v-if="
                  $store.getters.user.template_info.org_id != 9675 &&
                  $store.getters.user.template_info.org_id != 10340
                
                "
              >
                透析器/灌流器:{{patient.prescription ? patient.prescription.dialyzer_perfusion_apparatus: ""}}
                <span
                  v-if="patient.prescription != null &&patient.prescription.dialysis_dialyszers != ''">
                  {{patient.prescription? patient.prescription.dialysis_dialyszers: ""}}
                </span>
                <span v-if="patient.prescription == null && patient.dialysis_solution!=null">
                  {{patient.dialysis_solution? patient.dialysis_solution.dialysis_dialyszers: ""}}
                </span>
                <span v-if="patient.prescription != null &&patient.prescription.dialysis_irrigation != ''">/</span>
                <span v-if="patient.prescription == null &&patient.dialysis_solution!=null">
                  {{patient.dialysis_solution? patient.dialysis_solution.dialysis_irrigation: ""}}
                </span>
                <span v-if="patient.prescription != null &&patient.prescription.dialysis_irrigation != ''">
                  {{patient.prescription? patient.prescription.dialysis_irrigation: ""}}
                </span>

                <span v-if="patient.prescription == null && patient.dialysis_solution!=null">
                  {{patient.dialysis_solution? patient.dialysis_solution.dialysis_irrigation: ""}}
                </span>
              </p>

              <p
                v-if="
                  $store.getters.user.template_info.org_id == 9675 ||
                  $store.getters.user.template_info.org_id == 10340
                "
              >
                透析器/灌流器:
                <span
                  v-if="
                    patient.dialysis_order != null &&
                    patient.dialysis_order.dialysis_dialyszers != ''
                  "
                >
                  {{
                    patient.prescription
                      ? patient.dialysis_order.dialysis_dialyszers
                      : ""
                  }}
                </span>

                <span
                  v-if="
                    patient.dialysis_order == null && patient.last_order != null
                  "
                >
                  {{
                    patient.last_order
                      ? patient.last_order.dialysis_dialyszers
                      : ""
                  }}
                </span>
                <span
                  v-if="
                    patient.dialysis_order != null &&
                    patient.dialysis_order.dialysis_irrigation != ''
                  "
                  >/{{
                    patient.dialysis_order
                      ? patient.dialysis_order.dialysis_irrigation
                      : ""
                  }}
                </span>

                <span
                  v-if="
                    patient.dialysis_order == null && patient.last_order != null
                  "
                >
                  <span v-if="patient.last_order.dialysis_irrigation != ''"
                    >/{{
                      patient.last_order
                        ? patient.last_order.dialysis_irrigation
                        : ""
                    }}</span
                  >
                </span>
              </p>

              <p
                v-if="
                  $store.getters.user.template_info.org_id == 9671 ||
                  $store.getters.user.template_info.org_id == 10445 ||
                  $store.getters.user.template_info.org_id ==10597 ||
                  $store.getters.user.template_info.org_id ==10599 ||
                  $store.getters.user.template_info.org_id ==10702 || 
                  $store.getters.user.template_info.org_id ==10742 || 
                  $store.getters.user.template_info.org_id ==10751
                "
              >
                滤过器:
                <span v-if="patient.prescription!=null && patient.prescription.dialysis_strainer!=''">{{patient.prescription? patient.prescription.dialysis_strainer: ""}}</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null">{{patient.dialysis_solution? patient.dialysis_solution.dialysis_strainer: ""}}</span>
              </p>
              <p
                v-if="
                  $store.getters.user.template_info.org_id == 9675 ||
                  $store.getters.user.template_info.org_id == 10340
                "
              >
                排班备注:
                <span>{{patient.dialysis_order &&patient.dialysis_order.schedule_remark? patient.dialysis_order.schedule_remark:patient.patient.schedule_remark }}</span>
              </p>
              <p>抗凝剂:
                <span v-if="patient.prescription!=null&& patient.prescription&&patient.prescription.anticoagulant ==1" style="color: red;">无肝素</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==1" style="color: red;">无肝素</span>

                <span v-if="patient.prescription==null && patient.prescription&&patient.prescription.anticoagulant ==2">普通肝素</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==2">普通肝素</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==3">低分子肝素</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==3">低分子肝素</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==4">阿加曲班</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==4">阿加曲班</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==5">枸橼酸钠</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==5">枸橼酸钠</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==6">低分子肝素钙</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==6">低分子肝素钙</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==7">低分子肝素钠</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==7">低分子肝素钙</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==8">依诺肝素</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==8">依诺肝素</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==9">达肝素</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==9">达肝素</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==10">体外抗凝</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==10">体外抗凝</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==11">那屈肝素</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==11">那屈肝素</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==12">无抗凝剂</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==12">无抗凝剂</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==13">那曲肝素钙</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==13">那曲肝素钙</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==14">肝素钙注射液</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==14">肝素钙注射液</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==15">甲磺酸萘莫司他</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==15">甲磺酸萘莫司他</span>

                <span v-if=" patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==16">低分子量肝素钙</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==16">低分子肝素钙</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant ==17">肝素钠</span>
                <span v-if="patient.prescription==null && patient.dialysis_solution!=null &&  patient.dialysis_solution.anticoagulant==17">肝素钠</span>

              </p>
              <p>
                首剂:  
                <span v-if="patient.prescription!=null&& patient.prescription.anticoagulant!=1">
                  {{patient.prescription!=null&& patient.prescription&&patient.prescription.anticoagulant_shouji?patient.prescription&&patient.prescription.anticoagulant_shouji:"" }}
                 
                </span> 
                <span v-if="patient.prescription==null&& patient.dialysis_solution.anticoagulant!=1">
                  {{patient.prescription==null&& patient.dialysis_solution&&patient.dialysis_solution.anticoagulant_shouji?patient.dialysis_solution&&patient.dialysis_solution.anticoagulant_shouji:"" }}
                </span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 4">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 4">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 3">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 3">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 2">mg</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 2">mg</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 5">ml</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 5">ml</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 6">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 6">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 7">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 7">iu</span>
                
                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 8">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 8">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 9">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 9">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 10">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 10">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 11">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 11">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 13">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 13">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 16">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 16">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 17">
                 <span v-if="$store.getters.user.template_info.org_id !=10644"> mg</span>
                 <span v-if="$store.getters.user.template_info.org_id ==10644"> U</span>
                </span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 17">
                  <span v-if="$store.getters.user.template_info.org_id !=10644"> mg</span>
                  <span v-if="$store.getters.user.template_info.org_id ==10644"> U</span>
                </span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 14">
                 <span v-if="$store.getters.user.template_info.org_id !=10644"> mg</span>
                 <span v-if="$store.getters.user.template_info.org_id ==10644"> iu</span>
                </span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 14">
                  mg
                </span>


                维持: 
                <span v-if="patient.prescription!=null&& patient.prescription.anticoagulant!=1">
                  {{patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant_weichi?patient.prescription&&patient.prescription.anticoagulant_weichi:"" }}
                </span> 
                <span v-if="patient.prescription==null&& patient.dialysis_solution.anticoagulant!=1">
                  {{patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant_weichi?patient.dialysis_solution&&patient.dialysis_solution.anticoagulant_weichi:"" }}
                </span> 
              

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 4">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 4">iu</span>
                
                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 3">iu</span>
                <span v-if="patient.dialysis_solution==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 3">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 2">mg</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 2">mg</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 5">ml</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 5">ml</span>


                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 6">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 6">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 7">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 7">iu</span>
                
                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 8">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 8">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 9">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 9">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 10">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 10">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 11">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 11">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 13">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 13">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 16">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 16">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 17">
                  <span v-if="$store.getters.user.template_info.org_id !=10644"> mg/h</span>
                  <span v-if="$store.getters.user.template_info.org_id ==10644"> U/h</span>
                </span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 17">
                  <span v-if="$store.getters.user.template_info.org_id !=10644"> mg/h</span>
                  <span v-if="$store.getters.user.template_info.org_id ==10644"> U/h</span>
                </span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 14">
                  <span v-if="$store.getters.user.template_info.org_id !=10644"> mg/h</span>
                  <span v-if="$store.getters.user.template_info.org_id ==10644"> iu/h</span>
                </span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 14">
                  <span v-if="$store.getters.user.template_info.org_id !=10644"> mg/h</span>
                  <span v-if="$store.getters.user.template_info.org_id ==10644"> iu/h</span>
                </span>

                总量: 
                <span v-if="patient.prescription!=null&& patient.prescription.anticoagulant!=1">
                  {{  patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant_zongliang?patient.prescription&&patient.prescription.anticoagulant_zongliang:"" }}
                </span> 
               <span v-if="patient.prescription==null&& patient.dialysis_solution.anticoagulant!=1">
                 {{  patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant_zongliang?patient.dialysis_solution&&patient.dialysis_solution.anticoagulant_zongliang:"" }}
               </span>
                

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 4">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 4">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 3">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 3">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 2">mg</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 2">mg</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 5">ml</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 5">ml</span>
 

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 6">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 6">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 7">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 7">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 8">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 8">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 9">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 9">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 10">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 10">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 11">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 11">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 13">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 13">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 16">iu</span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 16">iu</span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 17">
                  <span v-if="$store.getters.user.template_info.org_id !=10644"> mg</span>
                  <span v-if="$store.getters.user.template_info.org_id ==10644">U</span>
                </span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 17">
                  <span v-if="$store.getters.user.template_info.org_id !=10644"> mg</span>
                  <span v-if="$store.getters.user.template_info.org_id ==10644">U</span>
                </span>

                <span v-if="patient.prescription!=null&&patient.prescription&&patient.prescription.anticoagulant == 14">
                  <span v-if="$store.getters.user.template_info.org_id !=10644"> mg</span>
                  <span v-if="$store.getters.user.template_info.org_id ==10644"> iu</span>
                </span>
                <span v-if="patient.prescription==null&&patient.dialysis_solution&&patient.dialysis_solution.anticoagulant == 14">
                  <span v-if="$store.getters.user.template_info.org_id !=10644"> mg</span>
                  <span v-if="$store.getters.user.template_info.org_id ==10644"> iu</span>
                </span>


              </p>
              <p>
                钙：<span v-if="patient.prescription!=null&&patient.prescription">{{patient.prescription.calcium }} (mmol/L)</span> 
                   <span v-if="patient.prescription==null&&patient.dialysis_solution!=null">{{patient.dialysis_solution.calcium }}(mmol/L)</span>
              </p>

              <p v-if="$store.getters.user.template_info.org_id==10644">
                备注：<span style="color:red" v-if="patient.prescription!=null&&patient.prescription">{{patient.prescription.remark }} </span> 
              </p>
            </div>
          </div>
        </div>
        <!-- <div class="online" style="flex:0.5;" v-show="computeState(patient) != 4">
          <p :class="stateColor(patient)">{{ stateText(patient) }}</p>
        </div> -->
        <div v-if="newIndex == 1" style="display: flex; flex-direction: column">
          <div
            v-if="
              (patient.prescription == null ||
                patient.prescription.creater == 0) &&
              newIndex == 1
            "
            class="prescription"
            @click.stop="open2(patient)"
          >
            开处方
          </div>
          <div
            v-if="
              patient.dialywater_machineis_order == null  &&
              newIndex == 1
            "
            class="prescription"
            @click.stop="open10(patient,index)"
          >
            透析上机
          </div>
          <div
            v-if="((patient.dobule_check&&patient.dobule_check.creater == 0 || patient.dobule_check&&patient.dobule_check.modifier == 0)  && newIndex == 1) "
            class="summary"
            @click.stop="open11(patient)"
          >
            双人核对
          </div>
        </div>

        <div v-if="newIndex == 2" style="display: flex; flex-direction: column">
          <div
            v-if="patient.treatment_summary == null && newIndex == 2"
            class="summary"
            @click.stop="open1(patient)"
          >
            开小结
          </div>
          <div
             v-if="patient.dobule_check==null &&  newIndex ==2"
            class="summary"
            @click.stop="open11(patient)"
          >
            双人核对
          </div>
          <div
            v-if="patient.dialysis_order != null && patient.dialysis_order.stage ==1  && newIndex == 2"
            class="summary"
            @click.stop="open12(patient)"
          >
            透析下机
          </div>
        </div>

        <div v-if="information.length == 0">
          <div
            class="disinfect"
            v-if="
              patient.dialysis_order != null &&
              patient.dialysis_order.stage == 2 &&
              is_run == 1
            "
            @click.stop="toDisInfect(patient)"
          >
            消毒
          </div>
        </div>
        <div v-if="information.length > 0">
          <div
            class="disinfect"
            v-if="
              patient.dialysis_order != null &&
              patient.dialysis_order.stage == 2 &&
              is_run == 1 &&
              getInformation(
                patient.bed_id,
                patient.schedule_date,
                patient.schedule_type,
                patient.patient_id
              ) == 0
            "
            @click.stop="toDisInfect(patient)"
          >
            消毒
          </div>

          <div
            class="disinfectOne"
            v-if="
              patient.dialysis_order != null &&
              patient.dialysis_order.stage == 2 &&
              is_run == 1 &&
              getInformation(
                patient.bed_id,
                patient.schedule_date,
                patient.schedule_type,
                patient.patient_id
              ) == 1
            "
            @click.stop="toDisInfect(patient)"
          >
            消毒
          </div>
        </div>
      </div>
      <!-- </router-link> -->
      <div
        class="function"
        :class="functionColor(patient)"
        :id="modeColor(patient.mode_id)"
      >
        <ul>
          <li>
            <span class="iconfont">&#xe6f7;</span>
            班次 : {{ timeTypeText(patient) }}
          </li>
          <li>
            <span class="iconfont">&#xe6de;</span>
            床位号 :
            <span v-if="$store.getters.user.template_info.org_id ==10340">
              <span style="color:blue" v-if="patient.dialysis_order && patient.dialysis_order.device_number!=undefined && (patient.dialysis_order.device_number.id == 4414 || patient.dialysis_order && patient.dialysis_order.device_number.id == 4449 || patient.dialysis_order && patient.dialysis_order.device_number.id == 4456 || patient.dialysis_order && patient.dialysis_order.device_number.id == 4416 || patient.dialysis_order && patient.dialysis_order.device_number.id == 4448 || patient.dialysis_order && patient.dialysis_order.device_number.id == 4468 || patient.dialysis_order && patient.dialysis_order.device_number.id == 4451 || patient.dialysis_order && patient.dialysis_order.device_number.id == 4457 || patient.dialysis_order && patient.dialysis_order.device_number.id == 4495)">

                {{
                patient.dialysis_order &&
                patient.dialysis_order.device_number &&
                patient.dialysis_order.device_number.number.length > 0
                  ? patient.dialysis_order.device_number.number
                  : patient.device_number.number
               }}
              </span> 
              <span v-else>
                {{
                  patient.dialysis_order &&
                  patient.dialysis_order.device_number &&
                  patient.dialysis_order.device_number.number.length > 0
                    ? patient.dialysis_order.device_number.number
                    : patient.device_number.number
               }}
              </span>
            </span>
            <span v-if="$store.getters.user.template_info.org_id!=10340">
              {{
              patient.dialysis_order &&
              patient.dialysis_order.device_number &&
              patient.dialysis_order.device_number.number.length > 0
                ? patient.dialysis_order.device_number.number
                : patient.device_number.number
            }}
            </span>
          </li>
          <li>
            <span class="iconfont">&#xe6f6;</span>
            透析模式 :
            <span v-if="patient.mode_id">{{
              $store.getters.treatment_mode[patient.mode_id].name
            }}</span>
          </li>
        </ul>
      </div>
    </div>

    <van-popup
      title="透析处方"
      v-model="showPopup2"
      class="appPopup"
      get-container="#app"
      :overlay="true"
      :close-on-click-overlay="false"
    >
      <prescription-dialog
        v-if="prescription_dialog_reset == true"
        :patient_prop="patient"
        :solution_prop="solution"
        :machines_prop="devices"
        :config="config"
        :prescription_prop="prescription"
        @finish="closePrescriptionDialog"
        :operators="operators"
        :types="goodTypes"
        :info="goodInfos"
        :status="status"
        :targetAdvices="longAdvices"
        :waitUploadAdvices="waitUploadAdvices"
        :is_open="is_open"
        @close="closePrescriptionDialog"
        @prescription="prescriptionFunc"
        :admin_users_prop="admin_users"
        :predialysis="predialysis_evaluation"
        :last_predialysis="last_predialysis_evaluation"
        :record="assessment_after_dislysis"
        :last_record="last_assessment_after_dislysis"
        :last_prescription="last_prescription"
        :dry_weight="dryWeight"
        :system_prescription="system_prescription"
        :schedual="schedual"
        :his_is_open="his_is_open"
        :prescription_open="prescription_open"
        :stockType="stockType"
        @longSolution="longSolutionFunc"
        :admin_map="admin_user_map"
        :admin_staff="admin_staff_map"
        :lastDialysisPrescription="lastDialysisPrescription"
        ref="prescription_dialog"
      ></prescription-dialog>
    </van-popup>

    <van-popup
      title="治疗小结"
      v-model="showPopup1"
      class="appPopup"
      get-container="#app"
      :overlay="true"
      :close-on-click-overlay="false"
    >
      <treatment-dialog
        :patient_prop="patient"
        :record="treatment_summary"
        @did_update="updateTreatmentOf"
        @close="closeTreatmentOf"
        ref="treatment_dialog"
      ></treatment-dialog>
    </van-popup>

    <van-popup
      title="透析上机"
      v-model="showPopup10"
      class="appPopup"
      get-container="#app"
      :overlay="true"
      :close-on-click-overlay="false"
    >
      <computer-dialog
        v-if="computer_dialog_reset == true"
        :schedule="schedual"
        :patient_prop="patient"
        :record="dialysis_order"
        :admins="admin_users"
        :device_numbers="device_numbers"
        :admin_map="admin_user_map"
        :admin_staff="admin_staff_map"
        :device_number_map="device_number_map"
        @did_add_monitor="didAddMonitor"
        @close="closeComputerOf"
        @open="closeOpen"
        :stockType="stockType"
        :last_order="lastOrder"
        :patient_index="patient_index"
        ref="computer_dialog"
      ></computer-dialog>
    </van-popup>

    <van-popup
      title="双人核对"
      v-model="showPopup11"
      class="appPopup"
      get-container="#app"
      :overlay="true"
      :close-on-click-overlay="false"
    >
      <dobule-dialog
       v-if="dobule_dialog_reset == true"
        :patient_prop="patient"
        :record="double_check"
        :admin_users_prop="admin_users"
        :admin_map="admin_user_map"
        @did_update="closeDoubleCheck"
        @close="closeDoubleCheck"
        :admins="admin_users"
        :predialysis="predialysis_evaluation"
        :prescription_prop="prescription"
        :dialysis_order="dialysis_order"
      ></dobule-dialog>
    </van-popup>

    <van-popup
      title="透析下机"
      v-model="showPopup12"
      :overlay="true"
      :close-on-click-overlay="false"
      v-if="dialysis_order_set == true"
    >
      <plane-dialog
        :patient_prop="patient"
        :record="dialysis_order"
        :monitor_records="monitor_records"
        :last_monitor_record="last_monitor_record"
        :admins="admin_users"
        :admin_map="admin_user_map"
        :prescription_prop="prescription"
        @did_off="closeDialysisOffclose"
        @close="closeDialysisOffclose"
        :last_order="lastOrder"
      >
      </plane-dialog>
    </van-popup>

    <!-- 消毒弹窗 -->
    <van-popup
      v-if="$store.getters.user.template_info.org_id==9671"
      title="消毒时间"
      v-model="showPlan"
      class="appPopup"
      get-container="#app"
      :overlay="true"
      :close-on-click-overlay="false"
    >
      <div class="Dialog">
        <div class="DialogTit">
          <span @click="close()" class="iconfont">&#xe6e9;</span>
          <h1 class="name">消毒时间</h1>
          <span class="success" @click="commitInfo" v-show="showOne">保存</span>
          <span class="success" @click="updateInfo" v-show="showTwo">修改</span>
        </div>
        <div class="DialogContent">
          <div class="item">
            <h2 class="name">{{ bed_name }}</h2>
            <div class="content">
              <span class="text" style="width: 100px"></span>
            </div>
          </div>

          <div class="item">
            <h2 class="name">开始消毒时间</h2>
            <div class="content">
              <span
                class="text"
                style="width: 100px"
                @click="selectStartTimeAction"
                >{{ start_time_str }}</span
              >
              <span class="iconfont">&#xe6f9;</span>
            </div>
          </div>


          <div class="item">
            <label class="name" for="dtl">消毒时长</label>
            <div class="content">
              <input
                type="number"
                @click="newClick($event)"
                @focus="inputFocus"
                id="dtl"
                v-model="disinfec_time"
                @change="inputBlur"
              />
            </div>
          </div>


          <div class="item">
            <h2 class="name">结束消毒时间</h2>
            <div class="content">
              <span
                class="text"
                style="width: 100px"
                @click="selectEndTimeAction"
                >{{ select_time_str }}</span
              >
              <span class="iconfont">&#xe6f9;</span>
            </div>
          </div>
        </div>

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

       <mt-datetime-picker
       class="double_check_dialog"
          ref="select_time_picker"
          type="datetime"
          @confirm="didSelectEndTime"
          v-model="select_time"
        ></mt-datetime-picker>

      </div>
    </van-popup>



    <van-popup
      v-if="$store.getters.user.template_info.org_id!=9671"
      title="消毒时间"
      v-model="showPlan"
      class="appPopup"
      get-container="#app"
      :overlay="true"
      :close-on-click-overlay="false"
    >
      <div class="Dialog">
        <div class="DialogTit">
          <span @click="close()" class="iconfont">&#xe6e9;</span>
          <h1 class="name">消毒时间</h1>
          <span class="success" @click="commitInfoOne" v-show="showOne">保存</span>
          <span class="success" @click="updateInfoOne" v-show="showTwo">修改</span>
        </div>
        <div class="DialogContent">
          <div class="item">
            <h2 class="name">{{ bed_name }}</h2>
            <div class="content">
              <span class="text" style="width: 100px"></span>
            </div>
          </div>

          <div class="item">
            <h2 class="name">开始消毒时间</h2>
            <div class="content">
              <span
                class="text"
                style="width: 100px"
                @click="selectStartTimeAction"
                >{{ start_time_str }}</span
              >
              <span class="iconfont">&#xe6f9;</span>
            </div>
          </div>


          <div class="item">
            <label class="name" for="dtl">消毒时长</label>
            <div class="content">
              <input
                type="number"
                @click="newClick($event)"
                @focus="inputFocus"
                id="dtl"
                v-model="disinfec_time"
                @change="inputBlur"
              />
            </div>
          </div>


          <div class="item">
            <h2 class="name">结束消毒时间</h2>
            <div class="content">
              <span
                class="text"
                style="width: 100px"
                @click="selectEndTimeAction"
                >{{ select_time_str }}</span
              >
              <span class="iconfont">&#xe6f9;</span>
            </div>
          </div>
          <div class="item">
            <h2 class="name">机表(床单元、床旁桌)消毒方式:</h2>
            <div class="content" @click="showPicker = true">
              <span
                class="text"
                style="width: 100px"
                >{{ kuangvalue }}</span
              >
              <span class="iconfont">&#xe6f9;</span>
            </div>
          </div>

          <div class="item">
            <h2 class="name">机表(床单元、床旁桌)消毒液:</h2>
            <div class="content" @click="showPicker2 = true">
              <span
                class="text"
                style="width: 100px"
                >{{ kuangvalue2 }}</span
              >
              <span class="iconfont">&#xe6f9;</span>
            </div>
          </div>

          <div class="item">
            <h2 class="name">液路消毒方式:</h2>
            <div class="content" @click="showPicker3 = true">
              <span
                class="text"
                style="width: 100px"
                >{{ kuangvalue3 }}</span
              >
              <span class="iconfont">&#xe6f9;</span>
            </div>
          </div>

          <div class="item">
            <h2 class="name">液路消毒液:</h2>
            <div class="content" @click="showPicker4 = true">
              <span
                class="text"
                style="width: 100px"
                >{{ kuangvalue4 }}</span
              >
              <span class="iconfont">&#xe6f9;</span>
            </div>
          </div>

          <div class="item">
            <h2 class="name">床单位更换:</h2>
            <div class="content" @click="showPicker5 = true">
              <span
                class="text"
                style="width: 100px"
                >{{ kuangvalue5 }}</span
              >
              <span class="iconfont">&#xe6f9;</span>
            </div>
          </div>

          <div class="item">
            <h2 class="name">透析机消毒液(更换):</h2>
            <div class="content" @click="showPicker6 = true">
              <span
                class="text"
                style="width: 100px"
                >{{ kuangvalue6 }}</span
              >
              <span class="iconfont">&#xe6f9;</span>
            </div>
          </div>


          <div class="item">
            <h2 class="name">空气滤网清洁:</h2>
            <div class="content" @click="showPicker7 = true">
              <span
                class="text"
                style="width: 100px"
                >{{ kuangvalue7 }}</span
              >
              <span class="iconfont">&#xe6f9;</span>
            </div>
          </div>

          <div class="item">
            <h2 class="name">细菌过滤器(更换):</h2>
            <div class="content" @click="showPicker8 = true">
              <span
                class="text"
                style="width: 100px"
                >{{ kuangvalue8 }}</span
              >
              <span class="iconfont">&#xe6f9;</span>
            </div>
          </div>


        </div>

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

       <mt-datetime-picker
       class="double_check_dialog"
          ref="select_time_picker"
          type="datetime"
          @confirm="didSelectEndTime"
          v-model="select_time"
        ></mt-datetime-picker>

        <!-- 选择框 -->
        <van-popup v-model:show="showPicker" round position="bottom">
          <van-picker
            show-toolbar
            :columns="disinfectType"
            placeholder="请选择"
            @cancel="showPicker=false"
            @confirm="onConfirm"
          />
        </van-popup>
        <van-popup v-model:show="showPicker2" round position="bottom">
          <van-picker
            show-toolbar
            :columns="disinfectantType"
            @cancel="showPicker2=false"
            @confirm="onConfirmOne"
          />
        </van-popup>

        <van-popup v-model:show="showPicker3" round position="bottom">
          <van-picker
            show-toolbar
            :columns="sterilizeType"
            @cancel="showPicker3=false"
            @confirm="onConfirmTwo"
          />
        </van-popup>


        <van-popup v-model:show="showPicker4" round position="bottom">
          <van-picker
            show-toolbar
            :columns="fluidPathType"
            @cancel="showPicker4=false"
            @confirm="onConfirmThree"
          />
        </van-popup>

        <van-popup v-model:show="showPicker5" round position="bottom">
          <van-picker
            show-toolbar
            :columns="bedType"
            @cancel="showPicker5=false"
            @confirm="onConfirmFour"
          />
        </van-popup>

        <van-popup v-model:show="showPicker6" round position="bottom">
          <van-picker
            show-toolbar
            :columns="listOne"
            @cancel="showPicker6=false"
            @confirm="onConfirmFive"
          />
        </van-popup>

        <van-popup v-model:show="showPicker7" round position="bottom">
          <van-picker
            show-toolbar
            :columns="listTwo"
            @cancel="showPicker7=false"
            @confirm="onConfirmSix"
          />
        </van-popup>

        <van-popup v-model:show="showPicker8" round position="bottom">
          <van-picker
            show-toolbar
            :columns="listThree"
            @cancel="showPicker8=false"
            @confirm="onConfirmSeven"
          />
        </van-popup>
      </div>
    </van-popup>
  </div>
</template>

<script>
import { uParseTime, jsGetAge } from '@/utils/tools'
import { parseTime } from '@/utils'
import { showToast } from 'vant';
import { setDialysisOrWaitSelectedConfig } from '@/utils/data_config'
import TreatmentDialog from './dialog/TreatmentDialog'
import PrescriptionDialog from './dialog/PrescriptionDialog'
import ComputerDialog from './dialog/ComputerDialog.vue'
import DobuleDialog from './dialog/DoubleDialog.vue'
import PlaneDialog from './dialog/PlaneDialog.vue'

import {
  CreateGroupAdvice,
  dialysisGlobalConfig,
  getDialysisRecord,
  getPatientId,
  getDialysisRecordOrde
} from '@/api/dialysis'
const moment = require('moment')
import { getDisInfectionTime, SaveDisinfetionInfo,SaveDisinfetionInfoOne } from '@/api/manage'
import { GetRemindLongAdviceOne } from '@/api/advice'
import { Console, info } from 'console'
export default {
  name: 'PatientBox',
  components: {
    TreatmentDialog,
    PrescriptionDialog,
    ComputerDialog,
    DobuleDialog,
    PlaneDialog
  },
  props: {
    patients: Array,
    newIndex: Number,
    is_run: Number,
    information: Array
  },
  data () {
    return {
      date: '',
      parent_id: '',
      showPopup1: false,
      showPopup2: false,
      showPopup3: false,
      showPopup10: false,
      showPopup11: false,
      showPopup12: false,
      config: {}, // 库存自动扣减
      operators: [], // 操作人
      patient: {}, // 患者信息
      schedual: {}, // 患者排班信息
      prescription: {}, // 透析处方
      solution: {}, // 透析方案
      last_prescription: {},
      system_prescription: {}, // 系统透析模版
      thoroug_dialog_reset: true,
      prescription_dialog_reset: true,
      computer_dialog_reset: true,
      dobule_dialog_reset: true,
      monit_dialog_reset: true,
      dialysis_order_set:true,
      showPicker:false,
      showPicker2:false,
      showPicker3:false,
      showPicker4:false,
      showPicker5:false,
      showPicker6:false,
      showPicker7:false,
      showPicker8:false,
      receiver_treatment_access: {}, // 接诊评估
      predialysis_evaluation: {}, // 透前评估
      last_predialysis_evaluation: {}, // 上次透前评估
      doctor_advices: [], // 临时医嘱
      advice_groups: [], // 对 doctor_advices 进行分组后的组列表，元素为 { group_no, start_time, advices:[advice object] }
      double_check: {}, // 双人核对
      assessment_after_dislysis: {}, // 透后评估
      last_assessment_after_dislysis: {}, // 上次透后评估
      lastDialysisPrescription:{},//上次透析处方，不按透析模式
      treatment_summary: {}, // 治疗小结
      monitor_records: [], // 透析监测
      special_premission: [],
      last_monitor_record: {
        id: 0,
        operate_time: new Date().getTime(),
        sodium_concentration: '',
        dialysate_temperature: ''
      }, // 上一次透析的监测记录
      dialysis_order: {}, // 透析记录
      admin_users: [], // 系统用户列表
      devices: [], // 设备
      device_numbers: [], // 床位号
      admin_user_map: {}, // {user_id: admin_user object}
      device_map: {}, // {device_id: device}
      device_number_map: {}, // {device_number_id: device_number}
      scrollTop: '',
      goTopShow: false,
      goodTypes: [],
      goodInfos: [],
      dryWeight: {},

      longAdvices: [],
      waitUploadAdvices: [],
      is_open: 0,
      prescription_open: 0,
      targetAdvices: [],
      status: '',
      patientid: 0,
      dialyzerPerfusionApparatus: [],
      // is_run: 0,
      showPlan: false,
      start_time_str: '',
      start_time: new Date(),
      select_time: new Date(),
      select_time_str: '',
      bed_name: '',
      bed_id: '',
      schedule_type: '',
      schedule_date: '',
      schedule_week: '',
      disinfec_time: '',
      end_time: '',
      zone_id: '',
      patient_id: '',
      mode_id: '',
      planStatus: 0,
      showOne: true,
      showTwo: false,
      end_time_one: '',
      his_is_open: 0,
      stockType: [],
      admin_staff_map: {},
      puncture_point_haematomas: [
        { id: 1, name: '有' },
        { id: 2, name: '无' }
      ],
      lastOrder: {},
      patient_index: 0,
      columns : [
      { text: '杭州', value: 'Hangzhou' },
      { text: '宁波', value: 'Ningbo' },
      { text: '温州', value: 'Wenzhou' },
      { text: '绍兴', value: 'Shaoxing' },
      { text: '湖州', value: 'Huzhou' },
    ],
    kuangvalue:'',
    kuangvalue2:'',
    kuangvalue3:"",
    kuangvalue4:"",
    kuangvalue5:"",
    kuangvalue6:"",
    kuangvalue7:"",
    kuangvalue8:"",
    // 机表消毒方式
    disinfectType: [
      { value: 0, text: "/" },
      { value: 1, text: "擦拭" },
      { value: 2, text: "化学消毒" }
    ],
    // 基表消毒液
    disinfectantType: [
      { value: 0, text: "/" },
      { value: 1, text: "0.22%季铵盐" },
      { value: 2, text: "500mg/l含氯消毒剂" },
      { value: 3, text: "1000mg/l含氯消毒剂" },
      { value: 4, text: "1500mg/l含氯消毒剂" },
      { value: 5,  text:"消毒湿巾"},
      { value: 6,  text:"1.85g/L季铵盐"},
      { value:7,   text:"2000mg/l含氯消毒剂"}
    ],
    // 夜路消毒方式
    sterilizeType: [
        { value: 0, text: "/" },
        { value: 1, text: "热化学消毒" },
        { value: 2, text: "化学消毒 + 除钙" },
        { value: 3, text: "热化学消毒 + 除钙" },
        { value: 4, text: "热消毒" },
        { value: 5, text: "化学消毒" },
        { value: 6, text: "除钙" },
        { value: 7, text: "清洗" }
      ],
      // 夜路消毒液
      fluidPathType: [
        { value: 0, text: "/" },
        { value: 1, text: "20%柠檬酸" },
        { value: 2, text: "25%柠檬酸" },
        { value: 3, text: "50%柠檬酸" },
        { value: 4, text: "50%柠檬酸 + 5%次氯酸钠" },
        { value: 5, text: "20%柠檬酸 + 10%冰醋酸" },
        { value: 6, text: "0.2%过氧化乙酸" },
        { value: 7, text: "10%冰醋酸" },
        { value: 8, text: "50%冰醋酸" },
        { value: 9, text: "5%次氯酸钠" },
        { value: 10,text:"25%的柠檬酸+5%次氯酸钠"},
        { value: 11,text:"20%柠檬酸+5%次氯酸钠"}
      ],
       // 床单位更换
       bedType: [
        { value: 0, text: "/" },
        { value: 1, text: "床单" },
        { value: 2, text: "被套" },
        { value: 3, text: "枕套" },

      ],

       // 床单位更换
       listOne: [
        { value: 1, text: "更换" },
        { value:2,text:"未更换"},
      ],
      listTwo: [
        { value: 1, text: "清洁" },
        { value: 2,  text:"未清洁"},
      ],
      listThree: [
        { value: 1, text: "更换" },
        { value: 2,  text:"未更换"},
      ],
      timenow:0,
      last_befor:{},
      dryWeightList:[],
      first_monitor:{},
      last_monitor:{},
     
    }
  },
  methods: {
    getTimeOne (time) {
      return uParseTime(time, '{y}-{m}-{d}')
    },
    getTimeTwo (time) {
      return uParseTime(time, '{y}-{m}-{d} {h}:{i}')
    },
    open1 (patient) {
      let date = patient.schedule_date
      let patient_id = patient.patient_id
      this.date = date
      this.patient_id = patient_id
      this.requestDialysisRecord(date, patient_id, 1)
    },
    open2 (patient) {
      let date = patient.schedule_date
      let patient_id = patient.patient_id
      this.date = date
      this.patient_id = patient_id
      this.requestDialysisRecord(date, patient_id, 2)
      this.requestLongAdvice()
    },
    open10 (patient, index) {
      console.log('patinet23323223', index)
      let date = patient.schedule_date
      let patient_id = patient.patient_id
      this.date = date
      this.patient_id = patient_id
      this.patient_index = index
      this.requestDialysisRecord(date, patient_id, 10)
    },
    open11 (patient) {
      let date = patient.schedule_date
      let patient_id = patient.patient_id
      this.date = date
      this.patient_id = patient_id
      this.requestDialysisRecord(date, patient_id, 11)
    },
    open12 (patient) {
      let date = patient.schedule_date
      let patient_id = patient.patient_id
      this.date = date
      this.patient_id = patient_id
      this.requestDialysisRecord(date, patient_id, 12)
    },
    requestDialysisRecord (date, patient_id, newType) {
      var dateStr = parseTime(date, '{y}-{m}-{d}')
      var params = {
        patient_id: patient_id,
        date: dateStr
      }
      this.advice_groups = []
      this.doctor_advices = []

      getDialysisRecord(params).then((rs) => {
        var resp = rs.data

        if (resp.state == 1) {
          var waitstoredata = this.$store.getters.waitscheduals
          this.stockType = resp.data.stockType
          var lastOrder = resp.data.lastOrder
          this.lastOrder = lastOrder
          var waitscheduals = waitstoredata.waitscheduals

          var storedata = this.$store.getters.scheduals
          var scheduals = storedata.scheduals
          var patient = resp.data.patient // 患者信息

          var schedual = resp.data.schedual // 患者排班信息
          var prescription = resp.data.prescription // 透析处方

          var solution = resp.data.solution // 透析方案
          var receiver_treatment_access = resp.data.receiver_treatment_access // 接诊评估
          var predialysis_evaluation = resp.data.predialysis_evaluation // 透前评估
        
          var doctor_advices = resp.data.doctor_advices // 临时医嘱
          // console.log('临时医嘱33233333333333333333333', doctor_advices)
          var his_advices = resp.data.his_advices

          // console.log('his_doctor_advice32232332h2332232332323', his_advices)
          var last_prescription = resp.data.last_prescription

          var system_prescription = resp.data.system_prescription

          this.dryWeight = resp.data.dry_weight

          this.last_befor = resp.data.lastAssesmentBeforDialysis 

          this.first_monitor = resp.data.firstMonitor

          this.last_monitor = resp.data.lastMonitor

          if (prescription == null || prescription.creater == 0) {
            this.isPullData = 1
          } else {
            this.isPullData = 2
          }

          this.goodInfos = resp.data.goodInfos

          if (doctor_advices != null) {
            for (let i = 0; i < doctor_advices.length; i++) {
              doctor_advices[i].origin = 1
              doctor_advices[i]['is_selected'] = 0
            }
          }

          var double_check = resp.data.double_check // 双人核对
          var assessment_after_dislysis = resp.data.assessment_after_dislysis // 透后评估
          var treatment_summary = resp.data.treatment_summary // 治疗小结
          var monitor_records = resp.data.monitor_records // 透析监测
          var dialysis_order = resp.data.dialysis_order // 透析记录
          var operators = resp.data.operators // 操作人

          var config = resp.data.config // 库存自动扣减配置
          var types = resp.data.types // 所有系统库存商品类型
          var last_predialysis_evaluation = resp.data.last_predialysis_evaluation // 上一次透前评估

          var last_assessment_after_dislysis =
            resp.data.last_assessment_after_dislysis // 上一次透前评估
          var last_monitor_record = resp.data.last_monitor_record
          //上一次透析处方，不按透析模式
          var lastDialysisPrescription =  resp.data.lastDialysisPrescription
          this.lastDialysisPrescription = lastDialysisPrescription
          if (Object.keys(waitstoredata).length > 0) {
            for (let index = 0; index < waitscheduals.length; index++) {
              if (waitscheduals[index].patient_id == patient.id) {
                waitscheduals[index].patient = patient
                waitscheduals[index].assessment_before_dislysis =
                  predialysis_evaluation
                waitscheduals[index].prescription = prescription
                waitscheduals[index].doctor_advice = doctor_advices
                waitscheduals[index].dialysis_order = dialysis_order
              }
            }
            this.$store.dispatch('SetWaitScheduals', {
              waitscheduals: waitscheduals
            })
          }

          if (Object.keys(storedata).length > 0) {
            for (let index = 0; index < scheduals.length; index++) {
              if (scheduals[index].patient_id == patient.id) {
                scheduals[index].patient = patient
                scheduals[index].assessment_before_dislysis =
                  predialysis_evaluation
                scheduals[index].prescription = prescription
                scheduals[index].doctor_advice = doctor_advices
                scheduals[index].dialysis_order = dialysis_order
              }
            }
            this.$store.dispatch('SetScheduals', { scheduals: scheduals })
          }
          this.system_prescription =
            system_prescription == null ? { id: '' } : system_prescription

          this.patient = patient
          this.schedual = schedual == null ? {} : schedual
          this.prescription = prescription == null ? { id: '' } : prescription
          this.solution = solution == null ? { id: '' } : solution
          this.last_prescription = last_prescription == null ? { id: '' } : last_prescription
          this.receiver_treatment_access =
            receiver_treatment_access == null
              ? { id: '' }
              : receiver_treatment_access
          this.predialysis_evaluation =
            predialysis_evaluation == null ? {} : predialysis_evaluation
          this.last_predialysis_evaluation =
            last_predialysis_evaluation == null
              ? {}
              : last_predialysis_evaluation
          this.doctor_advices = doctor_advices == null ? [] : doctor_advices

          this.config = config
          this.goodTypes = types

          if (this.doctor_advices.length > 0) {
            var group = this.newAdviceGroupObject()
            var initGroupBlock = function (group, advice) {
              group.group_no = advice.groupno
            }
            for (let index = 0; index < this.doctor_advices.length; index++) {
              const advice = this.doctor_advices[index]
              if (advice.groupno == 0) {
                // 老版本的医嘱没有分组的概念，所以这一个 if 是解决这个问题的，将每个无分组的医嘱各自归为一组
                if (advice.parent_id > 0) {
                  if (this.advice_groups.length > 0) {
                    var parent_group =
                      this.advice_groups[this.advice_groups.length - 1]
                    if (parent_group.advices.length > 0) {
                      if (parent_group.advices[0].id == advice.parent_id) {
                        parent_group.advices.push(advice)
                      }
                    }
                  }
                  continue
                } else {
                  if (group.group_no > 0) {
                    this.advice_groups.push(group)
                    group = this.newAdviceGroupObject()
                  }

                  initGroupBlock(group, advice)
                  group.advices.push(advice)
                  this.advice_groups.push(group)
                  group = this.newAdviceGroupObject()
                  continue
                }
              }

              if (group.group_no > 0 && group.group_no != advice.groupno) {
                this.advice_groups.push(group)
                group = this.newAdviceGroupObject()
              }
              if (group.group_no == 0) {
                initGroupBlock(group, advice)
              }
              if (group.group_no == advice.groupno) {
                group.advices.push(advice)
              }
            }
            if (group.group_no > 0) {
              // 上述的算法会导致最后一组没有加到advice_groups，这里要手动加上
              this.advice_groups.push(group)
            }
          }

          this.double_check = double_check == null ? { id: '' } : double_check
          this.assessment_after_dislysis =
            assessment_after_dislysis == null
              ? { id: '' }
              : assessment_after_dislysis
          this.last_assessment_after_dislysis =
            last_assessment_after_dislysis == null
              ? { id: '' }
              : last_assessment_after_dislysis
          this.treatment_summary =
            treatment_summary == null ? { id: '' } : treatment_summary
          this.monitor_records = monitor_records == null ? [] : monitor_records
          this.last_monitor_record =
            last_monitor_record == null
              ? this.last_monitor_record
              : last_monitor_record
          this.dialysis_order =
            dialysis_order == null ? { id: '' } : dialysis_order
          this.operators = operators

          // 强制刷新子组件
          this.thoroug_dialog_reset = false
          this.$nextTick(() => {
            this.thoroug_dialog_reset = true
          })
          this.prescription_dialog_reset = false
          this.$nextTick(() => {
            this.prescription_dialog_reset = true
          })
          this.monit_dialog_reset = false
          this.$nextTick(() => {
            this.monit_dialog_reset = true
          })
          this.computer_dialog_reset = false
          this.$nextTick(() => {
            this.computer_dialog_reset = true
          })
          this.dobule_dialog_reset = false
          this.$nextTick(() => {
            this.dobule_dialog_reset = true
          })
          this.dialysis_order_set = false
          this.$nextTick(() => {
            this.dialysis_order_set = true
          })

          this.title = patient.name

          dialysisGlobalConfig().then((rs) => {
            var res = rs.data
            if (res.state == 1) {
              this.admin_users = []
              this.admin_users = res.data.admin_users

              this.devices = res.data.devices
              this.device_numbers = res.data.device_numbers

              var device_map = {}
              for (let index = 0; index < this.devices.length; index++) {
                const device = this.devices[index]
                device_map[device.id] = device
              }
              this.device_map = device_map

              var admin_map = {}
              for (let index = 0; index < this.admin_users.length; index++) {
                const admin = this.admin_users[index]
                admin_map[admin.id] = admin
              }
              this.admin_user_map = admin_map

              var device_number_map = {}
              for (let index = 0; index < this.device_numbers.length; index++) {
                const device_number = this.device_numbers[index]
                device_number_map[device_number.id] = device_number
              }
              this.device_number_map = device_number_map
            }

            this.loading = false
            console.log('o2oo33o3o2o32', newType)
            if (newType == 1) {
              this.showPopup1 = true
            } else if (newType == 2) {
              this.showPopup2 = true
            } else if (newType == 10) {
              this.showPopup10 = true
            } else if (newType == 11) {
              this.showPopup11 = true
            } else if (newType == 12) {
              this.showPopup12 = true
            }
          })
        } else {
          this.$toast({
            message: resp.msg
          })
          this.loading = false
        }
      })
    },
    requestLongAdvice () {
      var dateStr = parseTime(this.date, '{y}-{m}-{d}')
      console.log('dateStr2323223322323', dateStr)
      var params = {
        id: this.patient_id,
        schedule_date: dateStr
      }
      GetRemindLongAdviceOne(params).then((rs) => {
        var resp = rs.data
        if (resp.state == 1) {
          var status = parseInt(resp.data.status)
          this.status = status

          switch (status) {
            case 2:
              var totalAdvice = resp.data.advices


              console.log("日期++++++++++++++",moment().weekday())
              console.log("totalADVICE---------------",totalAdvice)

              var total_day = ""
              if(moment().weekday() == 1){
                 total_day = "周一"
              }
              if(moment().weekday() == 2){
                total_day = "周二"
              }
              if(moment().weekday() == 3){
                total_day = "周三"
              }
              if(moment().weekday() == 4){
                total_day = "周四"
              }
              if(moment().weekday() == 5){
                total_day = "周五"
              }
              if(moment().weekday() == 6){
                total_day = "周六"
              }
              if(moment().weekday() == 7){
                total_day = "周日"
              }
              var longAdvicesTwo = resp.data.advices_two

              // console.log("longAdvicesTwo--------------------------",longAdvicesTwo)

              var waitUploadAdvices = []
              if (totalAdvice.length != 0) {
                for (let i = 0; i < totalAdvice.length; i++) {
                  totalAdvice[i]['isCheck'] = 1
                }

                for (let i = 0; i < totalAdvice.length; i++) {
                  for (let a = 0; a < longAdvicesTwo.length; a++) {
                    if (totalAdvice[i].template_id ==longAdvicesTwo[a].template_id) {
                      totalAdvice[i]['isCheck'] = 0
                    }

                  }
                }


                for (let i = 0; i < totalAdvice.length; i++) {
                  if (totalAdvice[i].isCheck == 1) {
                    waitUploadAdvices.push(totalAdvice[i])
                  }

                }

               
                if(this.$store.getters.user.template_info.org_id == 10449 || this.$store.getters.user.template_info.org_id ==10013){
                  for(let i = 0; i < totalAdvice.length; i++){
                    if(totalAdvice[i].week_day.indexOf(total_day)!=-1){
                      totalAdvice[i].isCheck = 1
                    }
                  }
                }

              }
            
              //医嘱提醒
              this.is_open = resp.data.is_open_remind
              // eslint-disable-next-line camelcase
              var his_is_open = resp.data.his_config_open
             
              // eslint-disable-next-line camelcase
              if (his_is_open === 1) {
                this.is_open = 0
              }
              // eslint-disable-next-line camelcase
              var is_advice_open = resp.data.is_advice_open
              // eslint-disable-next-line camelcase
              if (is_advice_open === 1) {
                this.is_open = 1
              }

              this.longAdvices = totalAdvice
              this.waitUploadAdvices = waitUploadAdvices

              // eslint-disable-next-line camelcase
              var prescription_open = resp.data.prescription_open
              // eslint-disable-next-line camelcase
              this.prescription_open = prescription_open

              break
          }
        } else {
        }
      })
    },

    updateTreatmentOf: function (val) {
      this.showPopup1 = false
      this.treatment_summary = val
    },

    closeTreatmentOf: function () {
      this.showPopup1 = false
    },
    closeComputerOf: function () {
      this.showPopup10 = false
    },
    newAdviceGroupObject: function () {
      return Object.assign(
        {},
        {
          group_no: 0,
          // advice_doctor: 0,
          // start_time: 0,
          advices: []
          // exec_staff: 0,
          // exec_time: 0,
          // checker: 0,
        }
      )
    },
    closePrescriptionDialog: function () {
      this.showPopup2 = false
    },
    prescriptionFunc: function (val, advices) {
      this.prescription = val
      this.newRequestDialysisRecord()
    },
    newRequestDialysisRecord () {
      console.log('处罚法2333232')
      var dateStr = parseTime(this.date, '{y}-{m}-{d}')
      var params = {
        patient_id: this.patient_id,
        date: dateStr
      }
      this.advice_groups = []
      this.doctor_advices = []

      getDialysisRecord(params).then((rs) => {
        var resp = rs.data

        if (resp.state == 1) {
          var waitstoredata = this.$store.getters.waitscheduals

          var waitscheduals = waitstoredata.waitscheduals
          var storedata = this.$store.getters.scheduals
          var scheduals = storedata.scheduals

          var patient = resp.data.patient // 患者信息

          var schedual = resp.data.schedual // 患者排班信息
          var lastOrder = resp.data.lastOrder
          // console.log('lastOrder2333232332wo', lastOrder)
          this.lastOrder = lastOrder
          var prescription = resp.data.prescription // 透析处方

          var solution = resp.data.solution // 透析方案
          var receiver_treatment_access = resp.data.receiver_treatment_access // 接诊评估
          var predialysis_evaluation = resp.data.predialysis_evaluation // 透前评估
          console.log('我的中国', resp.data.predialysis_evaluation)
          var doctor_advices = resp.data.doctor_advices // 临时医嘱
          var last_prescription = resp.data.last_prescription

          var system_prescription = resp.data.system_prescription

          this.dryWeight = resp.data.dry_weight

          if (prescription == null || prescription.creater == 0) {
            this.isPullData = 1
          } else {
            this.isPullData = 2
          }

          this.goodInfos = resp.data.goodInfos

          if (doctor_advices != null) {
            for (let i = 0; i < doctor_advices.length; i++) {
              doctor_advices[i]['is_selected'] = 0
            }
          }

          var double_check = resp.data.double_check // 双人核对
          var assessment_after_dislysis = resp.data.assessment_after_dislysis // 透后评估
          var treatment_summary = resp.data.treatment_summary // 治疗小结
          var monitor_records = resp.data.monitor_records // 透析监测
          var dialysis_order = resp.data.dialysis_order // 透析记录
          var operators = resp.data.operators // 操作人

          var special_premission = resp.data.special_premission // 特殊权限

          var config = resp.data.config // 库存自动扣减配置

          var types = resp.data.types // 所有系统库存商品类型

          var last_predialysis_evaluation =
              resp.data.last_predialysis_evaluation // 上一次透前评估
          var last_assessment_after_dislysis =
              resp.data.last_assessment_after_dislysis // 上一次透前评估
          var last_monitor_record = resp.data.last_monitor_record

          if (Object.keys(waitstoredata).length > 0) {
            for (let index = 0; index < waitscheduals.length; index++) {
              if (waitscheduals[index].patient_id == patient.id) {
                waitscheduals[index].patient = patient
                waitscheduals[index].assessment_before_dislysis =
                    predialysis_evaluation
                waitscheduals[index].prescription = prescription
                waitscheduals[index].doctor_advice = doctor_advices
                waitscheduals[index].dialysis_order = dialysis_order
              }
            }
            this.$store.dispatch('SetWaitScheduals', {
              waitscheduals: waitscheduals
            })
          }

          if (Object.keys(storedata).length > 0) {
            for (let index = 0; index < scheduals.length; index++) {
              if (scheduals[index].patient_id == patient.id) {
                scheduals[index].patient = patient
                scheduals[index].assessment_before_dislysis =
                    predialysis_evaluation
                scheduals[index].prescription = prescription
                scheduals[index].doctor_advice = doctor_advices
                scheduals[index].dialysis_order = dialysis_order
              }
            }
            this.$store.dispatch('SetScheduals', { scheduals: scheduals })
          }

          this.patient = patient
          this.schedual = schedual == null ? {} : schedual
          this.prescription =
              prescription == null ? { id: '' } : prescription

          this.solution = solution == null ? { id: '' } : solution
          this.last_prescription =
              last_prescription == null ? { id: '' } : last_prescription

          this.system_prescription =
              system_prescription == null ? { id: '' } : system_prescription

          this.receiver_treatment_access =
              receiver_treatment_access == null
                ? { id: '' }
                : receiver_treatment_access
          this.predialysis_evaluation =
              predialysis_evaluation == null ? {} : predialysis_evaluation
          this.last_predialysis_evaluation =
              last_predialysis_evaluation == null
                ? {}
                : last_predialysis_evaluation

          this.doctor_advices = doctor_advices == null ? [] : doctor_advices
          this.special_premission = special_premission
          this.config = config
          this.goodTypes = types

          if (this.doctor_advices.length > 0) {
            var group = this.newAdviceGroupObject()
            var initGroupBlock = function (group, advice) {
              group.group_no = advice.groupno
            }
            for (let index = 0; index < this.doctor_advices.length; index++) {
              const advice = this.doctor_advices[index]
              if (advice.groupno == 0) {
                // 老版本的医嘱没有分组的概念，所以这一个 if 是解决这个问题的，将每个无分组的医嘱各自归为一组
                if (advice.parent_id > 0) {
                  if (this.advice_groups.length > 0) {
                    var parent_group =
                        this.advice_groups[this.advice_groups.length - 1]
                    if (parent_group.advices.length > 0) {
                      if (parent_group.advices[0].id == advice.parent_id) {
                        parent_group.advices.push(advice)
                      }
                    }
                  }
                  continue
                } else {
                  if (group.group_no > 0) {
                    this.advice_groups.push(group)
                    group = this.newAdviceGroupObject()
                  }

                  initGroupBlock(group, advice)
                  group.advices.push(advice)
                  this.advice_groups.push(group)
                  group = this.newAdviceGroupObject()
                  continue
                }
              }

              if (group.group_no > 0 && group.group_no != advice.groupno) {
                this.advice_groups.push(group)
                group = this.newAdviceGroupObject()
              }
              if (group.group_no == 0) {
                initGroupBlock(group, advice)
              }
              if (group.group_no == advice.groupno) {
                group.advices.push(advice)
              }
            }
            if (group.group_no > 0) {
              // 上述的算法会导致最后一组没有加到advice_groups，这里要手动加上
              this.advice_groups.push(group)
            }

            // console.log(this.advice_groups)
          }

          this.double_check =
              double_check == null ? { id: '' } : double_check
          this.assessment_after_dislysis =
              assessment_after_dislysis == null
                ? { id: '' }
                : assessment_after_dislysis
          this.last_assessment_after_dislysis =
              last_assessment_after_dislysis == null
                ? { id: '' }
                : last_assessment_after_dislysis
          this.treatment_summary =
              treatment_summary == null ? { id: '' } : treatment_summary
          this.monitor_records =
              monitor_records == null ? [] : monitor_records
          this.last_monitor_record =
              last_monitor_record == null
                ? this.last_monitor_record
                : last_monitor_record
          this.dialysis_order =
              dialysis_order == null ? { id: '' } : dialysis_order
          this.operators = operators
        
          this.dryWeightList = resp.data.dryWeightList
          this.title = patient.name
          // 强制刷新子组件

          this.thoroug_dialog_reset = false
          this.$nextTick(() => {
            this.thoroug_dialog_reset = true
          })
          this.prescription_dialog_reset = false
          this.$nextTick(() => {
            this.prescription_dialog_reset = true
          })
          this.monit_dialog_reset = false
          this.$nextTick(() => {
            this.monit_dialog_reset = true
          })
        } else {
          this.$toast({
            message: resp.msg
          })
          this.loading = false
        }
      })
        .catch((error) => {
          this.loading = false
          console.log('error', error)
          this.$toast({
            message: '请求超时'
          })
        })
    },
    longSolutionFunc: function (val) {
      this.solution = val
    },
    //
    getUnReadNum: function (schedual) {
      // console.log('schedual23233232', schedual)
      if (schedual.doctor_advice != null) {
        // his
        if (schedual.doctor_advice.length == 0) {
          let doctorAdvice = []
          if (schedual.his_doctor_advice != null) {
            for (let i = 0; i < schedual.his_doctor_advice.length; i++) {
              if (schedual.his_doctor_advice[i].execution_state == 2) {
                doctorAdvice.push(schedual.his_doctor_advice[i])
              }
            }
          }

          let project = []
          if (schedual.project && schedual.project.length > 0) {
            if (schedual.project != null) {
              for (let i = 0; i < schedual.project.length; i++) {
                if (schedual.project[i].execution_state == 2) {
                  project.push(schedual.project[i])
                }
              }
            }
          }

          return doctorAdvice.length + project.length
        } else {
          // 血透
          if (schedual.doctor_advice != null) {
            if (
              schedual.doctor_advice[0] &&
              schedual.doctor_advice[0].origin &&
              schedual.doctor_advice[0].origin == 2
            ) {
              console.log('锦鲤2333233333')
              let doctorAdvice = []
              let adviceList = []
              if (
                schedual.his_doctor_advice &&
                schedual.his_doctor_advice != null
              ) {
                for (let i = 0; i < schedual.his_doctor_advice.length; i++) {
                  if (
                    schedual.his_doctor_advice[i].execution_state == 2 &&
                    schedual.his_doctor_advice[i] &&
                    schedual.his_doctor_advice[i].parent_id == 0
                  ) {
                    adviceList.push(schedual.his_doctor_advice[i])
                  }
                }
              }

              let project = []
              if (schedual.project && schedual.project.length > 0) {
                if (schedual.project != null) {
                  for (let i = 0; i < schedual.project.length; i++) {
                    if (schedual.project[i].execution_state == 2) {
                      project.push(schedual.project[i])
                    }
                  }
                }
              }
              for (let i = 0; i < schedual.doctor_advice.length; i++) {
                if (
                  schedual.doctor_advice[i].execution_state == 2 &&
                  schedual.doctor_advice[i] &&
                  schedual.doctor_advice[i].parent_id == 0
                ) {
                  doctorAdvice.push(schedual.doctor_advice[i])
                }
              }

              return doctorAdvice.length + adviceList.length + project.length
            } else {
              let doctorAdvice = []
              let adviceList = []
              let project = []
              if (schedual.project && schedual.project.length > 0) {
                if (schedual.project != null) {
                  for (let i = 0; i < schedual.project.length; i++) {
                    if (schedual.project[i].execution_state == 2) {
                      project.push(schedual.project[i])
                    }
                  }
                }
              }

              if (schedual && schedual.his_doctor_advice != null) {
                for (let i = 0; i < schedual.his_doctor_advice.length; i++) {
                  if (
                    schedual.his_doctor_advice[i].execution_state == 2 &&
                    schedual.his_doctor_advice[i]
                  ) {
                    adviceList.push(schedual.his_doctor_advice[i])
                  }
                }
              }

              for (let i = 0; i < schedual.doctor_advice.length; i++) {
                if (
                  schedual.doctor_advice[i].execution_state == 2 &&
                  schedual.doctor_advice[i] &&
                  schedual.doctor_advice[i].parent_id == 0
                ) {
                  doctorAdvice.push(schedual.doctor_advice[i])
                }
              }
              // console.log('不锦鲤', doctorAdvice.length, '血透', adviceList.length)
              return doctorAdvice.length + adviceList.length + project.length
            }
          }
        }
      }
    },
    getStatus: function (schedual) {
      var isShowDot = false

      if(this.$store.getters.user.template_info.org_id!=10697){
          if (
          schedual.his_doctor_advice &&
          schedual.his_doctor_advice.length != 0
        ) {
          for (let i = 0; i < schedual.his_doctor_advice.length; i++) {
            if (schedual.his_doctor_advice[i].execution_state == 2) {
              isShowDot = true
            }
          }
          return isShowDot
        }
      }
     
      if (schedual.doctor_advice && schedual.doctor_advice.length != 0) {
        if (schedual.doctor_advice && schedual.doctor_advice.length > 0) {
          if (schedual.doctor_advice != null) {
            for (let i = 0; i < schedual.doctor_advice.length; i++) {
              if (schedual.doctor_advice[i].execution_state == 2) {
                isShowDot = true
              }
            }
            return isShowDot
          }
        } else if (
          schedual.doctor_advice.length == 0 &&
          schedual.his_doctor_advice &&
          schedual.his_doctor_advice.length != 0
        ) {
          if (schedual.his_doctor_advice != null) {
            for (let i = 0; i < schedual.his_doctor_advice.length; i++) {
              if (schedual.his_doctor_advice[i].execution_state == 2) {
                isShowDot = true
              }
            }
            return isShowDot
          }
        } else {
          return false
        }
      }
    },
    stateColor: function (schedual) {
      var state = this.computeState(schedual)
      if (state == 1) {
        return 'blue'
      } else if (state == 2) {
        return 'gray'
      } else if (state == 3) {
        return 'red'
      } else if (state == 5) {
        return 'green1'
      } else if (state == 6) {
        return 'green2'
      } else {
        return 'blue'
      }
    },
    functionColor: function (schedual) {
      var state = this.computeState(schedual)
      if (state == 1 || state == 3) {
        return 'blue'
      } else if (state == 2) {
        return 'gray'
      } else {
        return 'blue'
      }
    },
    borderColor: function (schedual) {
      var yc = this.isAbnormal(schedual)
      if (yc == true) {
        return 'red'
      } else {
        return 'gray'
      }
    },
    stateText: function (schedual) {
      var state = this.computeState(schedual)
      if (state == 1) {
        return '已上机'
      } else if (state == 2) {
        return '已下机'
      } else if (state == 3) {
        return '监测中'
      } else if (state == 5) {
        return '待称重'
      } else if (state == 4) {
        // return schedual.patient.gender == 1 ? "男" : "女"
        return '未上机'
      }
      // else if (state == 6) {
      //   return '待开处方'
      // }
    },
    computeState: function (schedual) {
      if (
        schedual.assessment_before_dislysis == null ||
        schedual.assessment_before_dislysis.weight_before == 0
      ) {
        // 未签到称重
        return 5
      }
      // if (schedual.prescription == null || schedual.prescription.creater == 0) {
      //   // 未确认处方
      //   return 6
      // }

      if (schedual.dialysis_order == null) {
        // 未上机
        return 4
      } else if (schedual.dialysis_order.stage == 2) {
        // 已下机
        return 2
      } else if (
        schedual.dialysis_order.stage == 1 &&
        schedual.monitoring_records != null &&
        schedual.monitoring_records.length > 1
      ) {
        // 监测中
        return 3
      } else {
        return 1
      }
    },

    orderState: function (schedual) {
      if (schedual.dialysis_order == null) {
        // 未上机
        return 4
      } else if (schedual.dialysis_order.stage == 2) {
        // 已下机
        return 2
      } else if (
        schedual.dialysis_order.stage == 1 &&
        schedual.monitoring_records != null &&
        schedual.monitoring_records.length > 1
      ) {
        // 监测中
        return 3
      } else {
        return 1
      }
    },
    isAbnormal: function (schedual) {
      return false // schedual.yc;
    },
    timeTypeText: function (schedual) {
      if (schedual.schedule_type == 1) {
        return '上午'
      } else if (schedual.schedule_type == 2) {
        return '下午'
      } else {
        return '晚上'
      }
    },
    genderText: function (schedual) {
      if (schedual.patient.gender == 0) {
        return '未知'
      } else if (schedual.patient.gender == 1) {
        return '男'
      } else {
        return '女'
      }
    },

    age (schedual) {
      var thisLen = schedual.patient.id_card_no.length
      var birth = ''
      if (thisLen == 15) {
        birth = '19' + schedual.patient.id_card_no.substr(6, 6)
      } else {
        birth = schedual.patient.id_card_no.substr(6, 8)
      }
      birth =
        birth.substr(0, 4) +
        '-' +
        birth.substr(4, 2) +
        '-' +
        birth.substr(6, 2)
      return jsGetAge(birth, '-')
    },
    groupBy (array, f) {
      const groups = {}
      array.forEach(function (o) {
        const group = JSON.stringify(f(o))
        groups[group] = groups[group] || []
        groups[group].push(o)
      })
      return Object.keys(groups).map(function (group) {
        return groups[group]
      })
    },
    detailAction: function (schedual) {
      if (schedual.dialysis_order != null) {
        setDialysisOrWaitSelectedConfig(1)
      } else {
        setDialysisOrWaitSelectedConfig(0)
      }
      var patient_id = schedual.patient_id
      var date = schedual.schedule_date
      this.$router.push({
        path: '/details',
        query: {
          patient_id: patient_id,
          date: date,
          patient_name: schedual.patient.name
        }
      })
    },
    toDisInfect (schedual) {
      this.bed_name =
        schedual.device_number.zone.name +
        '-' +
        schedual.device_number.number +
        '号机'
      this.bed_id = schedual.bed_id
      this.schedule_date = schedual.schedule_date
      this.schedule_type = schedual.schedule_type
      this.schedule_week = schedual.schedule_week
      this.zone_id = schedual.device_number.zone.id
      this.patient_id = schedual.patient_id
      this.mode_id = schedual.mode_id
      if (this.$store.getters.user.template_info.org_id == 9671 || this.$store.getters.user.template_info.org_id == 9675 || this.$store.getters.user.template_info.org_id == 10340 || this.$store.getters.user.template_info.org_id == 9829  || this.$store.getters.user.template_info.org_id == 10490 || this.$store.getters.user.template_info.org_id == 10318 || this.$store.getters.user.template_info.org_id == 10721) {
        console.log('下机时间', schedual.dialysis_order.end_time)
        if (schedual && schedual.dialysis_order != null) {
          this.start_time_str = this.getTimeTwo(schedual.dialysis_order.end_time)
          console.log('start_time_str', this.start_time_str)
        }
      }

      var params = {
        patient_id: schedual.patient_id,
        schedule_date: schedual.schedule_date
      }
      console.log('params23232323', params)
      if (this.$store.getters.user.template_info.org_id == 9671 || this.$store.getters.user.template_info.org_id == 9675 || this.$store.getters.user.template_info.org_id == 10340 || this.$store.getters.user.template_info.org_id == 9829 || this.$store.getters.user.template_info.org_id == 10490 || this.$store.getters.user.template_info.org_id == 10101 || this.$store.getters.user.template_info.org_id == 10318  || this.$store.getters.user.template_info.org_id == 10721) {
        getDialysisRecordOrde(params).then((response) => {
          if (response.data.state == 1) {
            var order = response.data.data.order
            console.log('order', order)
            if(this.$store.getters.user.template_info.org_id == 10101){
              var end_order_time = 0
              if(order.end_time >0){

                 end_order_time = parseInt(order.end_time) + 300
              }
              console.log(order.end_time)
              console.log("end_order_time",end_order_time)
              this.start_time_str = this.getTimeTwo(end_order_time)
              console.log("开始时间",this.start_time_str)
            }else{
              this.start_time_str = this.getTimeTwo(order.end_time)
            }

            this.getDisInfectionTime()
            this.showPlan = true
          }
        })
      } else {
        this.getDisInfectionTime()
        this.showPlan = true
      }
    },
    close () {
      this.showPlan = false
    },
    commitInfo () {


      const params = {
        bed_id: this.bed_id,
        start_time: this.start_time_str,
        disinfec_time: this.disinfec_time,
        end_time: this.select_time_str,
        schedule_date: this.schedule_date,
        zone_id: this.zone_id,
        patient_id: this.patient_id,
        mode_id: this.mode_id,
        schedule_type: this.schedule_type,

      }
      console.log("newoowowo",params)

      if (this.disinfec_time == '') {
        this.$toast('消毒时长不能为空!')
        return false
      }
      if (this.planStatus == 1) {
        this.$toast('该设备无消毒计划,保存失败!')
        return false
      }
      console.log('params', params)

      SaveDisinfetionInfo(params).then((response) => {
        if (response.data.state == 1) {
          var information = response.data.data.information

          this.$toast('保存成功')
          this.showPlan = false
          var msstatus = response.data.data.msstatus
          // console.log('inforstate', msstatus)
          this.$parent.getDeviceInformation()
          if (msstatus == 2) {
            this.showPlan = false
            this.$toast('保存失败,该设备无消毒计划')
          }
        } else {
          this.showPlan = false
          this.$toast('保存失败')
        }
      })
    },
    commitInfoOne () {

      var way = 0
      for(let i=0;i<this.disinfectType.length;i++){
        if(this.kuangvalue == this.disinfectType[i].text){
           way = this.disinfectType[i].value
        }
      }
     
      var machine_disinfectant =0
      for(let i=0;i<this.disinfectantType.length;i++){
          if(this.kuangvalue2 == this.disinfectantType[i].text){
            machine_disinfectant = this.disinfectantType[i].value
          }
      }

      var disinfectant_way = 0
      for(let i=0;i<this.sterilizeType.length;i++){
        if(this.kuangvalue3 == this.sterilizeType[i].text){
           disinfectant_way = this.sterilizeType[i].value
        }
      }

      var disinfectant=0
      for(let i=0;i<this.fluidPathType.length;i++){
         if(this.kuangvalue4 == this.fluidPathType[i].text){
            disinfectant = this.fluidPathType[i].value
         }
      }

      console.log("bedType",this.bedType)
      var bed_way =0
      for(let i=0;i<this.bedType.length;i++){
        if(this.kuangvalue5 == this.bedType[i].text){
            bed_way = this.bedType[i].value
        }
      }

      var dialysis_checked  =0 

      if(this.kuangvalue6 == "更换"){
        dialysis_checked = 1
      }
      if(this.kuangvalue6 == "未更换"){
        dialysis_checked = 0
      }

      var clean  =0 

      if(this.kuangvalue7 == "清洁"){
        clean = 1
      }
      if(this.kuangvalue7 == "未清洁"){
        clean = 0
      }

      var germ_checked =0
      if(this.kuangvalue8 == "更换"){
          germ_checked =1
      }
      if(this.kuangvalue8 == "未更换"){
          germ_checked =0
      }
      console.log("kuangvalue",this.kuangvalue5)

      const params = {
        bed_id: this.bed_id,
        start_time: this.start_time_str,
        disinfec_time: this.disinfec_time,
        end_time: this.select_time_str,
        schedule_date: this.schedule_date,
        zone_id: this.zone_id,
        patient_id: this.patient_id,
        mode_id: this.mode_id,
        schedule_type: this.schedule_type,
        way:way,
        machine_disinfectant:machine_disinfectant,
        disinfectant_way:disinfectant_way,
        disinfectant:disinfectant,
        bed_way:bed_way,
        dialysis_checked:dialysis_checked,
        clean:clean,
        germ_checked:germ_checked,
      }
     
      if (this.disinfec_time == '') {
        this.$toast('消毒时长不能为空!')
        return false
      }
      if (this.planStatus == 1) {
        this.$toast('该设备无消毒计划,保存失败!')
        return false
      }
      console.log('params', params)
    
      SaveDisinfetionInfoOne(params).then((response) => {
        if (response.data.state == 1) {
          var information = response.data.data.information

          this.$toast('保存成功')
          this.showPlan = false
          var msstatus = response.data.data.msstatus
          // console.log('inforstate', msstatus)
          this.$parent.getDeviceInformation()
          if (msstatus == 2) {
            this.showPlan = false
            this.$toast('保存失败,该设备无消毒计划')
          }
        } else {
          this.showPlan = false
          this.$toast('保存失败')
        }
      })
    },
    updateInfo () {
      var u = navigator.userAgent
      var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1 // android终端
      var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) // ios终端
      const params = {
        bed_id: this.bed_id,
        start_time: this.start_time_str,
        disinfec_time: this.disinfec_time,
        end_time: this.select_time_str,
        schedule_date: this.schedule_date,
        zone_id: this.zone_id,
        patient_id: this.patient_id,
        mode_id: this.mode_id,
        schedule_type: this.schedule_type
      }
      if (this.disinfec_time == '') {
        this.$toast('消毒时长不能为空!')
        return false
      }
      // console.log("params",params)
      SaveDisinfetionInfo(params).then((response) => {
        if (response.data.state == 1) {
          var information = response.data.data.information

          this.$toast('修改成功')
          this.showPlan = false
        } else {
          this.showPlan = false
          this.$toast('修改失败')
        }
      })
    },
    updateInfoOne () {
      var u = navigator.userAgent
      var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1 // android终端
      var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) // ios终端

      var way = 0
      for(let i=0;i<this.disinfectType.length;i++){
        if(this.kuangvalue == this.disinfectType[i].text){
           way = this.disinfectType[i].value
        }
      }
     
      var machine_disinfectant =0
      for(let i=0;i<this.disinfectantType.length;i++){
          if(this.kuangvalue2 == this.disinfectantType[i].text){
            machine_disinfectant = this.disinfectantType[i].value
          }
      }

      var disinfectant_way = 0
      for(let i=0;i<this.sterilizeType.length;i++){
        if(this.kuangvalue3 == this.sterilizeType[i].text){
           disinfectant_way = this.sterilizeType[i].value
        }
      }

      var disinfectant=0
      for(let i=0;i<this.fluidPathType.length;i++){
         if(this.kuangvalue4 == this.fluidPathType[i].text){
            disinfectant = this.fluidPathType[i].value
         }
      }

      console.log("bedType",this.bedType)
      var bed_way =0
      for(let i=0;i<this.bedType.length;i++){
        if(this.kuangvalue5 == this.bedType[i].text){
            bed_way = this.bedType[i].value
        }
      }

      var dialysis_checked  =0 

      if(this.kuangvalue6 == "更换"){
        dialysis_checked = 1
      }
      if(this.kuangvalue6 == "未更换"){
        dialysis_checked = 0
      }

      var clean  =0 

      if(this.kuangvalue7 == "清洁"){
        clean = 1
      }
      if(this.kuangvalue7 == "未清洁"){
        clean = 0
      }

      var germ_checked =0
      if(this.kuangvalue8 == "更换"){
          germ_checked =1
      }
      if(this.kuangvalue8 == "未更换"){
          germ_checked =0
      }
      console.log("kuangvalue",this.kuangvalue5)
      const params = {
        bed_id: this.bed_id,
        start_time: this.start_time_str,
        disinfec_time: this.disinfec_time,
        end_time: this.select_time_str,
        schedule_date: this.schedule_date,
        zone_id: this.zone_id,
        patient_id: this.patient_id,
        mode_id: this.mode_id,
        schedule_type: this.schedule_type,
        way:way,
        machine_disinfectant:machine_disinfectant,
        disinfectant_way:disinfectant_way,
        disinfectant:disinfectant,
        bed_way:bed_way,
        dialysis_checked:dialysis_checked,
        clean:clean,
        germ_checked:germ_checked,
      }
      if (this.disinfec_time == '') {
        this.$toast('消毒时长不能为空!')
        return false
      }
      // console.log("params",params)
      SaveDisinfetionInfoOne(params).then((response) => {
        if (response.data.state == 1) {
          var information = response.data.data.information

          this.$toast('修改成功')
          this.showPlan = false
        } else {
          this.showPlan = false
          this.$toast('修改失败')
        }
      })
    },
    selectStartTimeAction: function () {
      this.$refs.start_time_picker.open()
    },
    selectEndTimeAction () {
      this.$refs.select_time_picker.open()
    },
    didSelectStartTime: function (time) {
      var u = navigator.userAgent
      var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1 // android终端
      var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) // ios终端

      if (isAndroid == true) {
        this.start_time_str = parseTime(time, '{y}-{m}-{d} {h}:{i}')
        let oldTime = this.start_time_str
        var time = new Date(oldTime.replace('-', '/'))

        var b = parseInt(this.disinfec_time) // 分钟数
        time.setMinutes(time.getMinutes() + b)
        this.end_time = ''

        this.end_time = parseTime(time, '{y}-{m}-{d} {h}:{i}')
        this.end_time_one = parseTime(time, '{y}-{m}-{d} {h}:{i}')
        this.select_time = parseTime(time, '{y}-{m}-{d} {h}:{i}')
        this.select_time_str = parseTime(time, '{y}-{m}-{d} {h}:{i}')
      }
      if (isiOS == true) {
        this.start_time_str = parseTime(time, '{y}-{m}-{d} {h}:{i}')

        let oldTime = this.start_time_str
        var time = new Date(oldTime.replace('-', '-'))

        var b = parseInt(this.disinfec_time) // 分钟数
        time.setMinutes(time.getMinutes() + b)
        this.end_time = ''
        this.end_time = parseTime(time, '{y}-{m}-{d} {h}:{i}')
        this.end_time_one = parseTime(time, '{y}-{m}-{d} {h}:{i}')
        this.select_time = parseTime(time, '{y}-{m}-{d} {h}:{i}')
        this.select_time_str = parseTime(time, '{y}-{m}-{d} {h}:{i}')
      }
    },

    didSelectEndTime (time) {
      this.select_time = parseTime(time, '{y}-{m}-{d} {h}:{i}')
      this.select_time_str = parseTime(time, '{y}-{m}-{d} {h}:{i}')
    },

    getDisInfectionTime () {
      const params = {
        bed_id: this.bed_id,
        schedule_type: this.schedule_type,
        schedule_week: this.schedule_week,
        schedule_date: this.schedule_date
      }
      getDisInfectionTime(params).then((response) => {
        if (response.data.state == 1) {
          var plan = response.data.data.plan

          this.disinfec_time = plan

          var planObj = response.data.data.planObj
          
          console.log("plaobj",planObj)
          // 机表(床单元、床旁桌)消毒方式
          if(planObj!="" && planObj!=undefined){
            var way = ""
            for(let i=0;i<this.disinfectType.length;i++){
              if(planObj.way == this.disinfectType[i].value){
                 way = this.disinfectType[i].text
              }
            }
            this.kuangvalue =way


            //机表(床单元、床旁桌)消毒液
            var machine_disinfectant = ""
            for(let i=0;i<this.disinfectantType.length;i++){
                if(planObj.machine_disinfectant == this.disinfectantType[i].value){
                  machine_disinfectant = this.disinfectantType[i].text
                }
            }
            console.log("machine_disinfectant",machine_disinfectant)
            this.kuangvalue2 = machine_disinfectant


            // 夜路消毒方式
            var disinfectant_way = ""
            for(let i=0;i<this.sterilizeType.length;i++){
              if(planObj.disinfectan_way == this.sterilizeType[i].value){
                disinfectant_way = this.sterilizeType[i].text
              }
            }
            console.log("machine_disinfectant",disinfectant_way)
            this.kuangvalue3 = disinfectant_way

            //液路消毒液
            var disinfectant=""
            for(let i=0;i<this.fluidPathType.length;i++){
              if(planObj.disinfectant == this.fluidPathType[i].value){
                 disinfectant = this.fluidPathType[i].text
              }
            }
            console.log("machine_disinfectant",disinfectant)
            this.kuangvalue4 = disinfectant

           // 床单位更换
            var bed_type = ""
            for(let i=0;i<this.bedType.length;i++){
              if(planObj.bed_way == this.bedType[i].value){
                 bed_type = this.bedType[i].text
              }
            }
            console.log("machine_disinfectant",bed_type)
            this.kuangvalue5 =bed_type
 
          }
          var total = 60 * parseInt(this.disinfec_time) + new Date(this.start_time_str).valueOf() / 1000
          console.log('total', total)
          this.select_time_str = this.getTimeTwo(total)
          this.select_time = this.getTimeTwo(total)

          if (plan == '') {
            this.end_time = ''
            this.select_time = ''
            this.select_time_str = ''
          }

          var infomation = response.data.data.infomation

          if (infomation != undefined) {
            this.showOne = false
            this.showTwo = true
            if (
              infomation.disinfec_startime == 0 ||
              infomation.disinfec_startime == ''
            ) {
              infomation.disinfec_startime = ''
            }
            if (
              infomation.disinfec_endtime == 0 ||
              infomation.disinfec_endtime == ''
            ) {
              infomation.disinfec_endtime = ''
            }
            this.start_time_str = parseTime(
              infomation.disinfec_startime,
              '{y}-{m}-{d} {h}:{i}'
            )
            this.end_time = parseTime(
              infomation.disinfec_endtime,
              '{y}-{m}-{d} {h}:{i}'
            )
            this.select_time = parseTime(
              infomation.disinfec_endtime,
              '{y}-{m}-{d} {h}:{i}'
            )
            this.select_time_str = parseTime(
              infomation.disinfec_endtime,
              '{y}-{m}-{d} {h}:{i}'
            )
            this.disinfec_time = infomation.long_time


            if(infomation!="" && infomation!=undefined){
              var way = ""
              for(let i=0;i<this.disinfectType.length;i++){
                if(infomation.disinfect_type == this.disinfectType[i].value){
                  way = this.disinfectType[i].text
                }
              }
              this.kuangvalue =way


            //机表(床单元、床旁桌)消毒液
            var machine_disinfectant = ""
            for(let i=0;i<this.disinfectantType.length;i++){
                if(infomation.disinfectant_type == this.disinfectantType[i].value){
                  machine_disinfectant = this.disinfectantType[i].text
                }
            }
           
            this.kuangvalue2 = machine_disinfectant


            // 夜路消毒方式
            var disinfectant_way = ""
            for(let i=0;i<this.sterilizeType.length;i++){
              if(infomation.fluid_path == this.sterilizeType[i].value){
                disinfectant_way = this.sterilizeType[i].text
              }
            }
            console.log("machine_disinfectant",disinfectant_way)
            this.kuangvalue3 = disinfectant_way

            //液路消毒液
            var disinfectant=""
            for(let i=0;i<this.fluidPathType.length;i++){
              if(infomation.disinfectant == this.fluidPathType[i].value){
                 disinfectant = this.fluidPathType[i].text
              }
            }
            console.log("machine_disinfectant",disinfectant)
            this.kuangvalue4 = disinfectant

           // 床单位更换
            var bed_type = ""
            for(let i=0;i<this.bedType.length;i++){
              if(infomation.bed_way == this.bedType[i].value){
                 bed_type = this.bedType[i].text
              }
            }
            console.log("machine_disinfectant",bed_type)
            this.kuangvalue5 =bed_type


            if(infomation.dialysis_checked == 1){
               this.kuangvalue6 = "更换"
            }

            if(infomation.dialysis_checked == 2){
               this.kuangvalue6 = "未更换"
            }

            if(infomation.germ_checked == 1){
               this.kuangvalue8 = "更换"
            }

            if(infomation.germ_checked == 2){
               this.kuangvalue8 = "未更换"
            }

            if(infomation.clean == 1){
               this.kuangvalue7 = "清洁"
            }

            if(infomation.clean == 2){
               this.kuangvalue7 = "未清洁"
            }
 
           }
          }
        } else {
          this.planStatus = 1
          this.$toast('该设备没有消毒计划')
        }
      })
    },

    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) {
      event.currentTarget.select()
    },
    inputBlur () {
      var total = 60 * parseInt(this.disinfec_time) + new Date(this.start_time_str).valueOf() / 1000
      console.log('total', total)
      this.select_time_str = this.getTimeTwo(total)
      this.select_time = this.getTimeTwo(total)

      // let oldTime = this.start_time_str
      // var time = new Date(oldTime.replace('-', '/'))
      // var b = parseInt(this.disinfec_time) // 分钟数
      // time.setMinutes(time.getMinutes() + b)

      // this.end_time = ''
      // this.end_time = parseTime(time, '{y}-{m}-{d} {h}:{i}')
      // this.end_time_one = ''
      // this.end_time_one = parseTime(time, '{y}-{m}-{d} {h}:{i}')

      // this.select_time = parseTime(time, '{y}-{m}-{d} {h}:{i}')
      // console.log('select_time23323233223', this.select_time)
      // this.select_time_str = parseTime(time, '{y}-{m}-{d} {h}:{i}')
      // console.log('select_time_str', this.select_time_str)
    },
    modeColor (id) {
      if (id == 1) {
      } else if (id == 2) {
        return 'modeRed'
      } else if (id == 3) {
        return 'modePurple'
      }
    },

    getInformation (bedId, date, classId, patientid) {
      var name = 0
      for (let i = 0; i < this.information.length; i++) {
        if (
          this.information[i].bed_number == bedId &&
          this.information[i].date == date &&
          this.information[i].class == classId
        ) {
          name = 1
        }
      }
      return name
    },
    didAddMonitor (monitor) {
      this.monitor_records.push(monitor)
      this.monitor_records.sort((a, b) => b.operate_time - a.operate_time)
      this.monitor_records.reverse()

      this.last_monitor_record = monitor
    },
    closeDoubleCheck: function (val) {
      this.showPopup11 = false
    },
    closeDialysisOffclose: function (val) {
      this.showPopup12 = false
    },
    closeOpen (index) {
      this.patients.splice(index, 1)
    },
    onConfirm(val){
      console.log("val2o2o2o2o",val)
      for(let i=0;i<this.disinfectType.length;i++){
        if(val.id==this.disinfectType[i].id){
          this.kuangvalue=val.text
        }
      }
      this.showPicker=false
    },
    onConfirmOne(val){
      for(let i=0;i<this.disinfectantType.length;i++){
        if(val.id==this.disinfectantType[i].id){
          this.kuangvalue2=val.text
        }
      }
      this.showPicker2=false
    },
    onConfirmTwo(val){
      for(let i=0;i<this.sterilizeType.length;i++){
        if(val.id==this.sterilizeType[i].id){
          this.kuangvalue3=val.text
        }
      }
      this.showPicker3=false
    },
    onConfirmThree(val){
      for(let i=0;i<this.fluidPathType.length;i++){
        if(val.id==this.fluidPathType[i].id){
          this.kuangvalue4=val.text
        }
      }
      this.showPicker4=false
    },
    onConfirmFour(val){
      for(let i=0;i<this.bedType.length;i++){
        if(val.id==this.bedType[i].id){
          this.kuangvalue5=val.text
        }
      }
      this.showPicker5=false
    },
    onConfirmFive(val){
      for(let i=0;i<this.listOne.length;i++){
        if(val.id==this.listOne[i].id){
          this.kuangvalue6=val.text
        }
      }
      this.showPicker6=false
    },
    onConfirmSix(val){
      for(let i=0;i<this.listTwo.length;i++){
        if(val.id==this.listTwo[i].id){
          this.kuangvalue7=val.text
        }
      }
      this.showPicker7=false
    },
    onConfirmSeven(val){
      for(let i=0;i<this.listThree.length;i++){
        if(val.id==this.listThree[i].id){
          this.kuangvalue8=val.text
        }
      }
      this.showPicker8=false
    }




  },
  created () {
    
    if (this.$store.getters.user.template_info.org_id != 10340 && this.$store.getters.user.template_info.org_id != 9829 &&  this.$store.getters.user.template_info.org_id != 10490) {
      this.start_time_str = parseTime(this.start_time, '{y}-{m}-{d} {h}:{i}')
      this.select_time_str = parseTime(this.select_time, '{y}-{m}-{d} {h}:{i}')
      console.log('this.select_time_str3232323', this.select_time_str)

    }

    let dateone =  moment().format('YYYY-MM-DD')//获取标准时间 //Tue Aug 16 2022 15:06:24 GMT+0800 (中国标准时间)
        //方式一
    let timeStampOne = Date.parse(dateone)
    
    var arrDateTwo = (timeStampOne/1000)-28800

    // console.log("时间搓2222",arrDateTwo)

    this.timenow = arrDateTwo
  },
  watch: {
    is_run: function () {
      console.log('is_run99999239292323', this.is_run)
    }
  }
}
</script>

<style lang="scss" scoped>
.difficult {
    width: 60px;
    height: 25px;
    border-radius: 30px;
    background: #78d660;
    text-align: center;
    line-height: 25px;
    position: relative;
    bottom: 25px;
    left: 135px;
    color: #fff;
}

.water {
  width: 30px;
  height: 30px;
  line-height: 30px;
  background: #4fc7cb;
  color: white;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  margin-top: 10px;
}
::v-deep .appPopup {
  .Dialog {
    .van-collapse {
      .van-collapse-item {
        .van-cell {
          padding: 0.25rem 0.5rem !important;
          font-size: 0.5rem !important;
          .van-cell__right-icon {
            font-size: 0.5rem;
          }
        }
        .van-collapse-item__wrapper {
          .van-collapse-item__content {
            padding: 0.25rem 0.5rem;
            font-size: 0.5rem;
          }
        }
      }
    }
  }
}

.patient {
  border: 1px #e5e5ee solid;
  // padding: 0.33rem 0;
  padding: 0 0 0.33rem 0;
  width: 47%;
  margin: 0 3% 0.5rem 0;
  float: left;
  border-radius: 5px;
  @media only screen and (max-width: 415px) {
    width: 96% !important;
  }
  @media only screen and (min-width: 415px) and (max-width: 767px) {
    width: 48%;
    margin: 0 1% 0.5rem 0;
  }
  .function {
    padding: 0.3rem 0.32rem 0 0.32rem;
    color: #7b8a97;
    @media only screen and (min-width: 415px) and (max-width: 767px) {
      margin: 0;
      padding: 0.3rem 0.1rem 0 0.1rem;
    }
    ul {
      @include display-flex;
      @include align-items-center;
      @include text-align;
      @include justify-content-between;
      li {
        font-size: 0.3rem;
        @include display-flex;
        @include align-items-center;
        @media only screen and (max-width: 415px) {
          font-size: 0.36rem;
        }
        .iconfont {
          margin: 0 0.1rem 0 0;
          font-size: 0.4rem;
          display: none;
        }
      }
    }
  }
  .blue {
    color: $main-color;
    .iconfont {
      color: $main-color;
    }
  }
  .kehu {
    @include display-flex;
    // @include align-items-center;
    @include text-align;
    @include justify-content-between;
    border-bottom: 1px #e5e5e5 solid;
    // padding: 0 0 0.3rem 0.32rem;
    padding: 0 0 0 0.32rem;
    @media only screen and (min-width: 415px) and (max-width: 767px) {
      padding: 0 0 0.3rem 0.1rem;
    }
    .tx {
      @include display-flex;
      // @include align-items-center;
      margin-top: -0.3rem;
      img {
        width: 1rem;
        height: 1rem;
        border-radius: 50%;
        float: left;
        margin: 0 0.2rem 0 0;
      }
      .right {
        float: left;
        text-align: left;
        .name {
          font-size: 0.34rem;
          color: $title-color;
          font-weight: 600;
          margin-bottom: 0.1rem;
          @media only screen and (max-width: 415px) {
            font-size: 0.45rem;
          }
          @media only screen and (min-width: 416px) and (max-width: 767px) {
            font-size: 0.4rem;
          }
          .yc {
            background: #ff7979;
            color: #fff;
            height: 0.38rem;
            line-height: 0.38rem;
            font-size: 0.24rem;
            width: 0.74rem;
            border-radius: 4px;
            display: inline-block;
            text-align: center;
            margin-left: 0.13rem;
          }
        }
        .num {
          font-size: 0.3rem;
          @media only screen and (max-width: 415px) {
            font-size: 0.36rem;
          }
        }
      }
    }
    .disinfect {
      background: #258ffc;
      color: #fff;
      width: 1.45rem;
      height: 0.8rem;
      line-height: 0.8rem;
      border-radius: 4px;
      margin: 0 auto;
      font-size: 0.32rem;
      margin-right: 0.28rem;
      margin-top: 0.3rem;
      @media only screen and (max-width: 767px) {
        font-size: 0.36rem;
        width: 1.7rem;
      }

      @media only screen and (min-width: 415px) and (max-width: 767px) {
        width: 1.3rem;
        font-size: 0.36rem;
      }
    }

    .disinfectOne {
      background: #a8b3ba;
      color: #fff;
      width: 1.45rem;
      height: 0.8rem;
      line-height: 0.8rem;
      border-radius: 4px;
      margin: 0 auto;
      font-size: 0.32rem;
      margin-right: 0.28rem;
      margin-top: 0.3rem;
      @media only screen and (max-width: 767px) {
        font-size: 0.36rem;
        width: 1.7rem;
      }

      @media only screen and (min-width: 415px) and (max-width: 767px) {
        width: 1.3rem;
        font-size: 0.36rem;
      }
    }
    .summary {
      background: #7bce91;
      color: #fff;
      width: 1.45rem;
      height: 0.8rem;
      line-height: 0.8rem;
      border-radius: 4px;
      margin: 0 auto;
      font-size: 0.32rem;
      margin: 0 0.28rem;
      margin-top: 0.3rem;
      @media only screen and (max-width: 767px) {
        font-size: 0.36rem;
        width: 1.7rem;
      }
      @media only screen and (min-width: 415px) and (max-width: 767px) {
        width: 1.3rem;
        font-size: 0.36rem;
      }
    }
    .prescription {
      background: #4fc7cb;
      color: #fff;
      width: 1.45rem;
      height: 0.8rem;
      line-height: 0.8rem;
      border-radius: 4px;
      margin: 0 auto;
      font-size: 0.32rem;
      margin: 0 0.28rem;
      margin-top: 0.3rem;
      @media only screen and (max-width: 767px) {
        font-size: 0.36rem;
        width: 1.7rem;
      }
      @media only screen and (min-width: 415px) and (max-width: 767px) {
        width: 1.3rem;
        font-size: 0.36rem;
      }
    }
  }
  .online {
    text-align: center;
    width: 50%;
    // border-left: 1px #e5e5e5 solid;
    p {
      background: #c6cdd2;
      color: #fff;
      width: 1.45rem;
      height: 0.8rem;
      line-height: 0.8rem;
      border-radius: 4px;
      margin: 0 auto;
      font-size: 0.32rem;
      @media only screen and (max-width: 767px) {
        font-size: 0.36rem;
        width: 1.7rem;
      }
      @media only screen and (min-width: 415px) and (max-width: 767px) {
        width: 1.3rem;
        font-size: 0.36rem;
      }
    }
    .blue {
      background: $main-color;
    }
    .red {
      background: #f18f68;
    }
    .green {
      background: #5bd18b;
    }
    .green1 {
      background: #258ffc;
    }
    .green2 {
      background: #e6a23c;
    }
    .gray {
      background: #a8b3ba;
    }
    .lightGray {
      background: #c6cdd2;
    }
    .time {
      font-size: 0.26rem;
      color: #34495e;
    }
  }
}
.red {
  border: 1px #ff7979 solid;
}
.redpoint {
  display: inline-block;
  height: 26px;
  width: 26px;
  line-height: 23px;
  text-align: center;
  font-size: 0.45rem;
  border-radius: 20px;
  color: #fff;
  background: #f56c6c;
  position: absolute;
  top: -6px;
  left: 0.6rem;
  border: 1px solid #fff;
  @media only screen and (max-width: 415px) {
    height: 16px;
    width: 16px;
    line-height: 15px;
    top: -6px;
    left: 0.6rem;
  }
  @media only screen and (min-width: 415px) and (max-width: 767px) {
    height: 20px;
    width: 20px;
    line-height: 19px;
    top: -6px;
    left: 0.6rem;
    font-size: 0.36rem;
  }
}
.redPoint1 {
  display: inline-block;
  height: 26px;
  width: 26px;
  line-height: 23px;
  text-align: center;
  font-size: 0.45rem;
  border-radius: 20px;
  color: #fff;
  background: #f56c6c;
  position: absolute;
  top: 20px;
  left: 0.6rem;
  border: 1px solid #fff;
  @media only screen and (max-width: 415px) {
    height: 16px;
    width: 16px;
    line-height: 15px;
    top: 20px;
    left: 0.6rem;
  }
  @media only screen and (min-width: 415px) and (max-width: 767px) {
    height: 20px;
    width: 20px;
    line-height: 19px;
    top: 20px;
    left: 0.6rem;
    font-size: 0.36rem;
  }
}
.yztx {
  margin: 0 5px;
  padding: 3px 10px;
  background-color: #f56c6c;
  color: #fff;
  border-radius: 3px;
  font-size: 0.32rem;
  @media only screen and (max-width: 415px) {
    font-size: 0.34rem !important;
  }
  @media only screen and (min-width: 415px) and (max-width: 767px) {
    margin: 0;
    padding: 3px 3px;
  }
}
#modeRed {
  color: #ed5555;
}
#modePurple {
  color: #53b86e;
}
</style>

<style  scoped>
.double_check_dialog >>> .picker-item{font-size: .475rem ; }
</style>
