<template>
    <div class="main-contain">
        <div class="position">
            <bread-crumb :crumbs='crumbs'></bread-crumb>
        </div>
        <div class="app-container">
         <el-container>
               <div style="width:22%">
                 <el-row>
                   <el-col :span="24">
                     <span class="zone">分&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;区:</span>
                      <el-select v-model="forms.zone_id" placeholder="请选择" class="a" @change="changeBedNumber" style="width:70%" :disabled="zoneDisabled">
                        <el-option
                         v-for="item in bedZone"
                         :key="item.id"
                         :label="item.name"
                         :value="item.id"
                         >
                        </el-option>
                      </el-select>
                     </el-col>
                  </el-row>
<!--                  <el-row>-->
<!--                   <el-col>-->
<!--                    <span class="zone">班&nbsp;&nbsp;&nbsp;&nbsp;次:</span>-->
<!--                      <el-select v-model="forms.class_id" placeholder="请选择" class="a" @change="changeClassId" style="width:125px">-->
<!--                        <el-option-->
<!--                         v-for="item in Classes"-->
<!--                         :key="item.id"-->
<!--                         :label="item.name"-->
<!--                         :value="item.id">-->
<!--                        </el-option>-->
<!--                      </el-select>-->
<!--                     </el-col>-->
<!--                  </el-row>-->
                  <el-row>
                     <el-col>
                     <span class="zone">设备类型:</span>
                      <el-select v-model="forms.device_type" placeholder="请选择" class="a" @change="changeDeviceId" style="width:70%">
                        <el-option
                         v-for="item in DeviceTypeType"
                         :key="item.id"
                         :label="item.name"
                         :value="item.id">
                        </el-option>
                      </el-select>
                     </el-col>
                  </el-row>
                  <el-row>
                      <el-table
                          ref="singleTable"
                          :data="tableDatatwo"
                          highlight-current-row
                           border
                          @current-change="handleCurrentChange"
                           height="440"
                           :row-style="{ color: '#303133' }"
                          :header-cell-style="{
                            backgroundColor: 'rgb(245, 247, 250)',
                            color: '#606266'
                          }"
                        >
                     <el-table-column
                       prop="date"
                       label="设备名称"
                      width="90"
                      align="center"
                      >
                      <template slot-scope="scope">
                         <div @click="handleIndex(scope.$index)">{{scope.row.device_name}}</div>
                      </template>
                    </el-table-column>
                     <el-table-column
                       prop="name"
                      label="设备型号"
                      width="90"
                      align="center">
                      <template slot-scope="scope">
                        <div @click="handleIndex(scope.$index)">{{scope.row.device_mode}}</div>
                      </template>
                     </el-table-column>
                      <el-table-column
                       prop="address"
                       label="机位号"
                       align="center"
                       widwid="60">
                       <template slot-scope="scope">
                          <div @click="handleIndex(scope.$index)">{{scope.row.bed_number}}</div>
                       </template>
                     </el-table-column>
                     </el-table>
                  </el-row>
               </div>

                 <el-main>
                     <div class="main newMain">
                        <div class="newButtonOne">
                            <el-button
                             type="success"
                             @click="clickQuery()"
                            >
                            综合查询
                           </el-button>
                          </div>
                   <el-tabs v-model="activeName" @tab-click="handleClick">

                  <!-- 透析机基本信息 -->
                   <el-tab-pane label="基本信息" name="first" >
                     <!-- 透析机基本信息 -->
                      <div class="disinfectOne newDisinfectOne" v-show="tShow">

                        <el-row>
                          <div class="b">
                            <el-button @click="UpdateMachine()">修改</el-button>
                          </div>
                        </el-row>
                        <el-row>
                           <el-form :model="form" ref="form" :rules="rules">
                             <el-row>
                               <el-col :span="8">
                                 <el-form-item label="序列号:" required prop="serial_number">
                                   <el-input style="width:150px" v-model="form.serial_number" :disabled="disableThree"></el-input>
                                 </el-form-item>
                               </el-col>
                              <el-col :span="8">
                                 <el-form-item label="设备类型:" required prop="devicetype">
                                   <el-select style="width:150px" v-model="form.devicetype" :disabled="true">
                                       <el-option v-for="item in this.DeviceTypes" :key="item.id" :label="item.name" :value="item.id" ></el-option>
                                  </el-select>
                                 </el-form-item>
                              </el-col>
                              <el-col :span="8">
                                  <el-form-item label="机位号:">
                                       <el-select style="width:150px" v-model="form.bed_number" :disabled="disableThree">
                                          <el-option v-for="item in this.Number" :key="item.bed_id" :label="item.bed_number" :value="item.bed_id"></el-option>
                                       </el-select>
                                  </el-form-item>
                              </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="8">
                                 <el-form-item label="设备名称:" required prop="device_name">
                                     <el-input style="width:150px" v-model="form.device_name" :disabled="disableThree"></el-input>
                                </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                  <el-form-item label="生产厂家:">
                                      <el-input style="width:150px" v-model="form.manufacture_factory" :disabled="disableThree"></el-input>
                                  </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                 <el-form-item label="维修厂家:">
                                   <el-input style="width:150px" v-model="form.service_manufacturer" :disabled="disableThree"></el-input>
                                 </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="8">
                                   <el-form-item label="设备型号:" required prop="unit_type">
                                        <el-select style="width:150px" v-model="form.unit_type" :disabled="disableThree">
                                           <el-option
                                             v-for="item in this.deviceMode"
                                             :key="item.id"
                                             :label="item.device_mode"
                                             :value="item.id"
                                           ></el-option>
                                          </el-select>
                                   </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                  <el-form-item label="使用科室:">
                                       <el-input style="width:150px" v-model="form.use_section" :disabled="disableThree"></el-input>
                                  </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                  <el-form-item label="科室编号:">
                                     <el-input style="width:150px" v-model="form.section_number" :disabled="disableThree"></el-input>
                                  </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="8">
                                 <el-form-item label="购买日期:">
                                      <el-date-picker
                                       v-model="form.buy_date"
                                       prefix-icon="none"
                                       type="date"
                                       placeholder="请选择"
                                       format="yyyy-MM-dd"
                                       value-format="yyyy-MM-dd"
                                       style="width:150px"
                                       :disabled="disableThree">
                                      </el-date-picker>
                                </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                 <el-form-item label="安装日期:">
                                     <el-date-picker
                                       v-model="form.install_date"
                                       prefix-icon="none"
                                       type="date"
                                       placeholder="请选择"
                                       format="yyyy-MM-dd"
                                        value-format="yyyy-MM-dd"
                                       style="width:150px"
                                       :disabled="disableThree">
                                    </el-date-picker>
                                 </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                  <el-form-item label="启用日期:">
                                     <el-date-picker
                                       v-model="form.start_date"
                                       prefix-icon="none"
                                       type="date"
                                       placeholder="请选择"
                                       format="yyyy-MM-dd"
                                       value-format="yyyy-MM-dd"
                                       style="width:150px"
                                       :disabled="disableThree">
                                         </el-date-picker>
                                  </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                   <el-form-item label="维修工程师:">
                                    <el-input style="width:150px" v-model="form.maintenance_engineer" :disabled="disableThree"></el-input>
                                   </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                   <el-form-item label="联系电话:">
                                      <el-input style="width:150px" v-model="form.telephone" :disabled="disableThree"></el-input>
                                   </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                  <el-form-item label="保修期限:">
                                      <el-input style="width:150px" v-model="form.guarantee_date" :disabled="disableThree"></el-input>
                                  </el-form-item>
                                </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="8">
                                  <el-form-item label="机器状态:">
                                    <el-select style="width:150px"  v-model="form.machine_status" @change="changeMachineStatus">
                                      <el-option v-for="item in machineStatus" :key="item.id" :label="item.name" :value="item.id" :disabled="disableThree"></el-option>
                                    </el-select>
                                  </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                 <el-form-item label="初次使用次数:">
                                    <el-input v-model="form.user_total" style="width:150px" :disabled="disableThree"></el-input>
                                 </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                  <el-form-item label="备注:">
                                      <el-input style="width:150px" v-model="form.remarks" :disabled="disableThree"></el-input>
                                  </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                                <el-col :span="8">
                                  <el-form-item label="报废日期:">
                                    <el-date-picker
                                    v-model="form.rubbish_date"
                                   prefix-icon="none"
                                    type="date"
                                    placeholder="请选择"
                                    format="yyyy-MM-dd"
                                     value-format="yyyy-MM-dd"
                                     style="width:150px"
                                     :disabled="disableThree">
                                   </el-date-picker>
                                 </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                   <el-form-item label="报废原因:">
                                     <el-select style="width:150px" v-model="form.rubbish_reason" :disabled="readisable">
                                       <el-option v-for="item in this.DisCardResion" :key="item.id" :label="item.name" :value="item.id" :disabled="disableThree"></el-option>
                                     </el-select>
                                   </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                 <el-form-item label="使用年限(年):">
                                      <el-input style="width:150px" v-model="form.user_year" :disabled="disableThree"></el-input>
                                 </el-form-item>
                                </el-col>
                             </el-row>
                             <el-row>
                                <el-col :span="8">
                                   <el-form-item label="工作时长(时):">
                                       <el-input style="width:150px" v-model="form.work_time" :disabled="disableThree"></el-input>
                                   </el-form-item>
                                </el-col>
                             </el-row>
                             <el-row>
                                 <el-form-item label="治疗模式:">
                                   <el-checkbox-group v-model="form.treat_mode" @change="handleCheckedCitiesChange">
                                        <el-checkbox v-for="city in cities" :label="city" :key="city">{{city}}</el-checkbox>
                                    </el-checkbox-group>
                                  </el-form-item>
                             </el-row>
                             <el-row>
                               <el-col>
                                  <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
                               </el-col>
                             </el-row>
                             <el-row>
                               <div class="but">
                                 <el-col :span="12">
                                   <el-button size="medium" v-show="cancelShow" @click="cleanMainchine">取消</el-button>
                                 </el-col>
                                 <el-col :span="8">
                                  <el-button type="primary" size="medium" v-show="confirmShow" @click="UpdateMachineInfo('form')">保存</el-button>
                                  </el-col>
                               </div>
                             </el-row>
                           </el-form>
                        </el-row>
                      </div>

                       <!-- 水处理机基本信息 -->
                      <div v-show="sShow">
                         <el-row>
                          <div class="b">
                            <el-button size="small" @click="UpdateMachine()">修改</el-button>
                          </div>
                        </el-row>
                        <el-row>
                          <el-form :model="form" ref="form" :rules="rules">
                             <el-row>
                               <el-col :span="7">
                                 <el-form-item label="序列号:" required prop="serial_number">
                                   <el-input style="width:150px" v-model="form.serial_number" :disabled="disableFour"></el-input>
                                 </el-form-item>
                               </el-col>
                              <el-col :span="7">
                                 <el-form-item label="设备类型:" required prop="devicetype">
                                   <el-select style="width:150px" v-model="form.devicetype" :disabled="true">
                                       <el-option v-for="item in this.DeviceTypes" :key="item.id" :label="item.name" :value="item.id" :disabled="disableFour" ></el-option>
                                  </el-select>
                                 </el-form-item>
                              </el-col>
                               <el-col :span="7">
                                   <el-form-item label="机位号">
                                       <el-input style="width:150px" v-model="form.beds" :disabled="disableFour"></el-input>
                                   </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="7">
                                 <el-form-item label="设备名称:" required prop="device_name">
                                     <el-input style="width:150px" v-model="form.device_name" :disabled="disableFour"></el-input>
                                </el-form-item>
                               </el-col>
                               <el-col :span="7">
                                  <el-form-item label="生产厂家:">
                                      <el-input style="width:150px" v-model="form.manufacture_factory" :disabled="disableFour"></el-input>
                                  </el-form-item>
                               </el-col>
                               <el-col :span="7">
                                 <el-form-item label="维修厂家:">
                                   <el-input style="width:150px" v-model="form.service_manufacturer" :disabled="disableFour"></el-input>
                                 </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="7">
                                   <el-form-item label="设备型号:" required prop="unit_type">
                                       <el-select style="width:135px" v-model="form.unit_type" :disabled="disableFour">
                                        <el-option
                                            v-for="item in this.deviceMode"
                                            :key="item.id"
                                            :label="item.device_mode"
                                            :value="item.id"
                                             ></el-option>
                                           </el-select>
                                   </el-form-item>
                               </el-col>
                               <el-col :span="7">
                                  <el-form-item label="使用科室:">
                                       <el-input style="width:150px" v-model="form.use_section" :disabled="disableFour"></el-input>
                                  </el-form-item>
                               </el-col>
                               <el-col :span="7">
                                  <el-form-item label="科室编号:">
                                     <el-input style="width:150px" v-model="form.section_number" :disabled="disableFour"></el-input>
                                  </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="7">
                                 <el-form-item label="购买日期:">
                                      <el-date-picker
                                       v-model="form.buy_date"
                                       prefix-icon="none"
                                       type="date"
                                       placeholder="请选择"
                                       format="yyyy-MM-dd"
                                       value-format="yyyy-MM-dd"
                                       style="width:150px"
                                       :disabled="disableFour">
                                      </el-date-picker>
                                </el-form-item>
                               </el-col>
                               <el-col :span="7">
                                 <el-form-item label="安装日期:">
                                     <el-date-picker
                                       v-model="form.install_date"
                                       prefix-icon="none"
                                       type="date"
                                       placeholder="请选择"
                                       format="yyyy-MM-dd"
                                        value-format="yyyy-MM-dd"
                                       style="width:150px"
                                       :disabled="disableFour">
                                    </el-date-picker>
                                 </el-form-item>
                               </el-col>
                               <el-col :span="7">
                                  <el-form-item label="启用日期:">
                                     <el-date-picker
                                       v-model="form.start_date"
                                       prefix-icon="none"
                                       type="date"
                                       placeholder="请选择"
                                       format="yyyy-MM-dd"
                                       value-format="yyyy-MM-dd"
                                       style="width:150px"
                                       :disabled="disableFour">
                                         </el-date-picker>
                                  </el-form-item>
                                </el-col>
                                <el-col :span="7">
                                   <el-form-item label="维修工程师:">
                                    <el-input style="width:150px" v-model="form.maintenance_engineer" :disabled="disableFour"></el-input>
                                   </el-form-item>
                                </el-col>
                                <el-col :span="7">
                                   <el-form-item label="联系电话:">
                                      <el-input style="width:150px" v-model="form.telephone" :disabled="disableFour"></el-input>
                                   </el-form-item>
                                </el-col>
                                <el-col :span="7">
                                  <el-form-item label="保修期限:">
                                      <el-input style="width:150px" v-model="form.guarantee_date" :disabled="disableFour"></el-input>
                                  </el-form-item>
                                </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="7">
                                  <el-form-item label="机器状态:">
                                    <el-select style="width:150px"  v-model="form.machine_status" :disabled="disableFour">
                                      <el-option v-for="item in machineStatus" :key="item.id" :label="item.name" :value="item.id" ></el-option>
                                    </el-select>
                                  </el-form-item>
                               </el-col>
                               <el-col :span="7">
                                   <el-form-item label="消毒方式:">
                                        <el-select style="width:135px" v-model="form.Disinfection_mode" :disabled="disableFour">
                                          <el-option
                                           v-for="item in this.DisinfectionMode"
                                           :key="item.id"
                                           :label="item.name"
                                           :value="item.id"
                                           ></el-option>
                                         </el-select>
                                     </el-form-item>
                               </el-col>
                               <el-col :span="7">
                                    <el-form-item label="备注:">
                                      <el-input style="width:150px" v-model="form.remarks" :disabled="disableFour"></el-input>
                                    </el-form-item>
                                </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="7">
                                   <el-form-item label="报废日期:">
                                     <el-date-picker
                                       v-model="form.rubbish_date"
                                       prefix-icon="none"
                                       type="date"
                                       placeholder="请选择"
                                       format="yyyy-MM-dd"
                                       value-format="yyyy-MM-dd"
                                       style="width:135px"
                                       :disabled="disableFour">
                                    </el-date-picker>
                                   </el-form-item>
                                </el-col>
                                <el-col :span="7">
                                    <el-form-item label="报废原因:">
                                       <el-select style="width:150px" v-model="form.rubbish_reason" :disabled="disableFour">
                                         <el-option v-for="item in this.DisCardResion" :key="item.id" :label="item.name" :value="item.id" ></el-option>
                                        </el-select>
                                     </el-form-item>
                                </el-col>
                                 <el-col :span="7">
                                    <el-form-item label="使用年限(年):">
                                      <el-input style="width:150px" v-model="form.user_year" :disabled="disableFour"></el-input>
                                    </el-form-item>
                                </el-col>
                             </el-row>
                             <el-row>
                                 <el-col :span="8">
                                      <el-form-item label="工作时长(h):">
                                         <el-input style="width:150px" v-model="form.work_time" :disabled="disableFour"></el-input>
                                     </el-form-item>
                                  </el-col>
                                 <el-col :span="8">
                                  <el-form-item label="反渗模式:">
                                      <el-select style="width:135px" v-model="form.revers_mode" :disabled="disableFour">
                                        <el-option
                                            v-for="item in this.reverseMode"
                                            :key="item.id"
                                            :label="item.name"
                                             :value="item.id"
                                       ></el-option>
                                       </el-select>
                                   </el-form-item>
                                  </el-col>
                             </el-row>
                              <el-row>
                               <div class="but">
                                 <el-col :span="12">
                                   <el-button size="medium" v-show="cancelShow" @click="cleanMainchine">取消</el-button>
                                 </el-col>
                                 <el-col :span="8">
                                  <el-button type="primary" size="medium" v-show="confirmShow" @click="UpdateMachineInfoTwo('form')">保存</el-button>
                                  </el-col>
                               </div>
                             </el-row>
                          </el-form>
                        </el-row>
                      </div>

                      <!-- 其他信息 -->
                      <div v-show="qShow" class="disinfectOne">
                          <el-row>
                          <div class="b">
                            <el-button size="small" @click="UpdateMachine()">修改</el-button>
                          </div>
                        </el-row>
                        <el-form :model="form" ref="form" :rules="rules">
                          <el-row>
                               <el-col :span="8">
                                 <el-form-item label="序列号:" required prop="serial_number">
                                   <el-input style="width:150px" v-model="form.serial_number" :disabled="disableFive"></el-input>
                                 </el-form-item>
                               </el-col>
                              <el-col :span="8">
                                 <el-form-item label="设备类型:" required prop="devicetype">
                                   <el-select style="width:150px" v-model="form.devicetype" :disabled="true">
                                       <el-option v-for="item in this.DeviceTypes" :key="item.id" :label="item.name" :value="item.id" ></el-option>
                                  </el-select>
                                 </el-form-item>
                              </el-col>
                                <el-col :span="8">
                                  <el-form-item label="机位号:">
                                       <!-- <el-select style="width:150px" v-model="form.bed_number" :disabled="true">
                                          <el-option v-for="item in this.Number" :key="item.id" :label="item.number" :value="item.id"></el-option>
                                       </el-select> -->
                                       <el-input v-model="form.bed_numbers" style="width:150px" :disabled="disableFive"></el-input>
                                  </el-form-item>
                              </el-col>
                             </el-row>
                              <el-row>
                               <el-col :span="8">
                                 <el-form-item label="设备名称:" required prop="device_name">
                                     <el-input style="width:150px" v-model="form.device_name" :disabled="disableFive"></el-input>
                                </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                  <el-form-item label="生产厂家:">
                                      <el-input style="width:150px" v-model="form.manufacture_factory" :disabled="disableFive"></el-input>
                                  </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                 <el-form-item label="维修厂家:">
                                   <el-input style="width:150px" v-model="form.service_manufacturer" :disabled="disableFive"></el-input>
                                 </el-form-item>
                               </el-col>
                             </el-row>
                              <el-row>
                               <el-col :span="8">
                                   <el-form-item label="设备型号:" required prop="unit_type">
                                       <el-select style="width:135px" v-model="form.unit_type" :disabled="disableFive">
                                        <el-option
                                            v-for="item in this.deviceMode"
                                            :key="item.id"
                                            :label="item.device_mode"
                                            :value="item.id"
                                             ></el-option>
                                           </el-select>
                                       </el-form-item>
                                    </el-col>
                               <el-col :span="8">
                                  <el-form-item label="使用科室:">
                                       <el-input style="width:150px" v-model="form.use_section" :disabled="disableFive"></el-input>
                                  </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                  <el-form-item label="科室编号:">
                                     <el-input style="width:150px" v-model="form.section_number" :disabled="disableFive"></el-input>
                                  </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="8">
                                 <el-form-item label="购买日期:">
                                      <el-date-picker
                                       v-model="form.buy_date"
                                       prefix-icon="none"
                                       type="date"
                                       placeholder="请选择"
                                       format="yyyy-MM-dd"
                                       value-format="yyyy-MM-dd"
                                       style="width:150px"
                                       :disabled="disableFive">
                                      </el-date-picker>
                                </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                 <el-form-item label="安装日期:">
                                     <el-date-picker
                                       v-model="form.install_date"
                                       prefix-icon="none"
                                       type="date"
                                       placeholder="请选择"
                                       format="yyyy-MM-dd"
                                        value-format="yyyy-MM-dd"
                                       style="width:150px"
                                       :disabled="disableFive">
                                    </el-date-picker>
                                 </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                  <el-form-item label="启用日期:">
                                     <el-date-picker
                                       v-model="form.start_date"
                                       prefix-icon="none"
                                       type="date"
                                       placeholder="请选择"
                                       format="yyyy-MM-dd"
                                       value-format="yyyy-MM-dd"
                                       style="width:150px"
                                       :disabled="disableFive">
                                         </el-date-picker>
                                  </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                   <el-form-item label="维修工程师:">
                                    <el-input style="width:150px" v-model="form.maintenance_engineer" :disabled="disableFive"></el-input>
                                   </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                   <el-form-item label="联系电话:">
                                      <el-input style="width:150px" v-model="form.telephone" :disabled="disableFive"></el-input>
                                   </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                  <el-form-item label="保修期限:">
                                      <el-input style="width:150px" v-model="form.guarantee_date" :disabled="disableFive"></el-input>
                                  </el-form-item>
                                </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="8">
                                  <el-form-item label="机器状态:">
                                    <el-select style="width:150px"  v-model="form.machine_status" @change="changeMachineStatus">
                                      <el-option v-for="item in machineStatus" :key="item.id" :label="item.name" :value="item.id" :disabled="disableFive"></el-option>
                                    </el-select>
                                  </el-form-item>
                               </el-col>
                                 <el-col :span="8">
                                   <el-form-item label="消毒方式:">
                                       <el-select style="width:135px" v-model="form.Disinfection_mode" :disabled="disableFive">
                                         <el-option
                                          v-for="item in this.DisinfectionMode"
                                         :key="item.id"
                                         :label="item.name"
                                          :value="item.id"
                                           ></el-option>
                                      </el-select>
                                 </el-form-item>
                                </el-col>
                                 <el-col :span="8">
                                  <el-form-item label="备注:">
                                      <el-input style="width:150px" v-model="form.remarks" :disabled="disableFive"></el-input>
                                  </el-form-item>
                               </el-col>

                             </el-row>
                             <el-row>
                                 <el-col :span="8">
                                  <el-form-item label="报废日期:">
                                    <el-date-picker
                                    v-model="form.rubbish_date"
                                   prefix-icon="none"
                                    type="date"
                                    placeholder="请选择"
                                    format="yyyy-MM-dd"
                                     value-format="yyyy-MM-dd"
                                     style="width:135px"
                                     :disabled="disableFive">
                                   </el-date-picker>
                                 </el-form-item>
                                </el-col>
                                 <el-col :span="8">
                                   <el-form-item label="报废原因:">
                                     <el-select style="width:150px" v-model="form.rubbish_reason" :disabled="readisable">
                                       <el-option v-for="item in this.DisCardResion" :key="item.id" :label="item.name" :value="item.id" :disabled="disableFive"></el-option>
                                     </el-select>
                                   </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                 <el-form-item label="使用年限(年):">
                                      <el-input style="width:150px" v-model="form.user_year" :disabled="disableFive"></el-input>
                                 </el-form-item>
                                </el-col>
                             </el-row>
                             <el-row>
                                <el-col :span="8">
                                   <el-form-item label="工作时长:">
                                       <el-input style="width:150px" v-model="form.work_time" :disabled="disableFive"></el-input>
                                   </el-form-item>
                                </el-col>
                             </el-row>
                              <el-row>
                               <div class="but">
                                 <el-col :span="12">
                                   <el-button size="medium" v-show="cancelShow" @click="cleanMainchine">取消</el-button>
                                 </el-col>
                                 <el-col :span="8">
                                  <el-button type="primary" size="medium" v-show="confirmShow" @click="UpdateMacheineTwo('form')">保存</el-button>
                                  </el-col>
                               </div>
                             </el-row>
                        </el-form>
                      </div>
                   </el-tab-pane>

                   <el-tab-pane label="消毒计划" name="second">
                       <div class="disinfect" v-show="DisShow">
                          <div class="newButton">
                            <el-button
                            type="primary"
                             size="small"
                             @click="addPlan"
                            >
                            新增计划
                           </el-button>
                          </div>
                          <el-tabs type="border-card" v-model="activeNameTwo" @tab-click="handleClick" >
                           <el-tab-pane label="当前设备计划列表" name="first">
                               <el-row style="display: flex;align-items: center;">
                                 <el-col :span="2">
                                    <el-checkbox style="width: 30px" @change="changeCheckOne" v-model="checkAllStatus">全选</el-checkbox>
                                 </el-col>
                                 <el-col :span="2">
                                   <el-button size="small" @click="openDeleteMahcine">批量删除</el-button>
                                 </el-col>
                               </el-row>
                               <el-row>
                                      <el-table
                                       ref="multipleTable"
                                        @selection-change="handleSelectionChangeOne"
                                         :data="planData"
                                         border
                                         fit
                                         highlight-current-row
                                         style="width: 100%;margin-top: 10px;"
                                         :row-style="{ color: '#303133' }"
                                        :header-cell-style="{
                                          backgroundColor: 'rgb(245, 247, 250)',
                                          color: '#606266'
                                        }"
                                        >
                                        <el-table-column align="center" type="selection" width="55"></el-table-column>
                                        <el-table-column label="时间" align="center" min-width="50px">
                                                <template slot-scope="scope">
                                                    {{scope.row.time}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="班次" align="center" min-width="50px">
                                                <template slot-scope="scope">
                                                    {{scope.row.classtime}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="机表消毒方式" align="center" min-width="110px" >
                                                <template slot-scope="scope">
                                                    {{scope.row.way}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="机表消毒液" align="center" min-width="100px"  >
                                                <template slot-scope="scope">
                                                     {{scope.row.machine_disinfectant}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="液路消毒方式" align="center" min-width="110px"  >
                                                <template slot-scope="scope">
                                                   {{scope.row.disinfectan_way}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="液路消毒液" align="center" min-width="100px" >
                                                <template slot-scope="scope">
                                                    {{scope.row.disinfectant}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="消毒时长/min" align="center" min-width="60px" >
                                                <template slot-scope="scope">
                                                    {{scope.row.disinfec_time}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="操作" align="center" min-width="130px">
                                             <template slot-scope="scope">
                                                 <el-tooltip class="item" effect="dark" content="编辑" placement="top">
                                                  <el-button
                                                   size="mini"
                                                   type="primary"
                                                   icon="el-icon-edit-outline"
                                                    @click="EditMachine(scope.row.id, scope.$index)"
                                                    ></el-button>
                                                </el-tooltip>

                                                 <el-tooltip class="item" effect="dark" content="删除" placement="top">
                                                  <el-button
                                                   size="mini"
                                                   type="danger"
                                                   icon="el-icon-delete"
                                                    @click="openDelete(scope.row.id, scope.$index)"
                                                    ></el-button>
                                                </el-tooltip>
                                             </template>

                                        </el-table-column>
                                     </el-table>
                               </el-row>
                           </el-tab-pane>
                           <el-tab-pane label="按机型列表" name="second">
                              <el-row style="display: flex;align-items: center;">
                                 <el-col :span="2">
                                    <el-checkbox style="width: 30px" @change="changeCheck" v-model="checkAllStatusOne">全选</el-checkbox>
                                 </el-col>
                                 <el-col :span="2">
                                   <el-button size="small" @click="openDeleteMahcineOne">批量删除</el-button>
                                 </el-col>
                               </el-row>
                               <el-row>
                                      <el-table
                                       ref="multipleTableOne"
                                        @selection-change="handleSelectionChange"
                                        :row-style="{ color: '#303133' }"
                                        :header-cell-style="{
                                          backgroundColor: 'rgb(245, 247, 250)',
                                          color: '#606266'
                                        }"
                                         :data="tableData"
                                         border
                                         fit
                                         highlight-current-row
                                         style="width: 100%;margin-top: 10px;"
                                        >
                                        <el-table-column align="center" type="selection" width="55"></el-table-column>
                                        <el-table-column label="型号" align="center" min-width="60px">
                                                <template slot-scope="scope">
                                                    {{scope.row.device_mode}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="时间" align="center" min-width="60px" >
                                                <template slot-scope="scope">
                                                      {{scope.row.time}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="班次" align="center" min-width="60px" >
                                                <template slot-scope="scope">
                                                    {{scope.row.classtime}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="基表消毒方式" align="center" min-width="110px"  >
                                                <template slot-scope="scope">
                                                    {{scope.row.way}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="基表消毒液" align="center" min-width="100px"  >
                                                <template slot-scope="scope">
                                                   {{scope.row.machine_disinfectant}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="液路消毒方式" align="center" min-width="110px" >
                                                <template slot-scope="scope">
                                                   {{scope.row.disinfectant}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="液路消毒液" align="center" min-width="100px" >
                                                <template slot-scope="scope">
                                                   {{scope.row.disinfectan_way}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="消毒时长/min" align="center" min-width="60px" >
                                                <template slot-scope="scope">
                                                    {{scope.row.disinfec_time}}
                                                 </template>
                                        </el-table-column>
                                         <el-table-column label="操作" align="center" width="130px">
                                             <template slot-scope="scope">
                                                 <el-tooltip class="item" effect="dark" content="编辑" placement="top">
                                                  <el-button
                                                   size="mini"
                                                   type="primary"
                                                   icon="el-icon-edit-outline"
                                                    @click="EditMachine(scope.row.id, scope.$index)"
                                                    ></el-button>
                                                </el-tooltip>

                                                 <el-tooltip class="item" effect="dark" content="删除" placement="top">
                                                  <el-button
                                                   size="mini"
                                                   type="danger"
                                                   icon="el-icon-delete"
                                                    @click="openDelete(scope.row.id, scope.$index)"
                                                    ></el-button>
                                                </el-tooltip>
                                             </template>

                                        </el-table-column>
                                     </el-table>
                               </el-row>
                          </el-tab-pane>
                          </el-tabs>
                       </div>
                       <div class="zClass" v-show="DioShow">
                             暂无数据
                       </div>
                   </el-tab-pane>



                   <el-tab-pane label="使用登记" name="third">
                       <div class="userbutton">
                          <el-button type="primary" @click="ToReminders">自动生成使用登记</el-button>
                       </div>
                     <div v-show="UserShow">
                        <el-tabs type="border-card" v-model="activeNameThree" @tab-click="handleClick">
                          <el-tab-pane label="新增使用登记" name="first">

                             <el-form :model="userform" ref="userform" :rules="userRules">
                                <el-row>
                                  <el-col :span="8">
                                     <el-form-item label="日期:" required prop="date" class="st">
                                         <el-date-picker
                                           v-model="userform.date"
                                           prefix-icon="none"
                                           type="date"
                                           placeholder="请选择"
                                           format="yyyy-MM-dd"
                                           value-format="yyyy-MM-dd"
                                           style="width:150px">
                                          </el-date-picker>
                                     </el-form-item>
                                  </el-col>
                                  <el-col :span="8">
                                     <el-form-item label="班次:" required prop="classtype" class="st">
                                       <el-select v-model="userform.classtype" placeholder="请选择" style="width:150px">
                                           <el-option
                                            v-for="item in classType"
                                           :key="item.id"
                                           :label="item.name"
                                           :value="item.id"
                                           style="width:90px">
                                       </el-option>
                                        </el-select>
                                     </el-form-item>
                                  </el-col>
                                  <el-col :span="8">
                                     <el-form-item label="分区:" required prop="zone" >
                                         <el-select v-model="userform.zone" placeholder="请选择" style="width:150px" :disabled="true">
                                           <el-option
                                            v-for="item in bedZoneThree"
                                           :key="item.id"
                                           :label="item.name"
                                           :value="item.id"
                                           >
                                          </el-option>
                                        </el-select>
                                     </el-form-item>
                                  </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="8">
                                        <el-form-item label="机位号:" required prop="bed_number">
                                        <el-select style="width:150px" v-model="userform.bed_number" :disabled="true">
                                          <el-option v-for="item in this.bedNumberTwo" :key="item.id" :label="item.number" :value="item.id"></el-option>
                                        </el-select>
                                     </el-form-item>
                                    </el-col>
                                    <el-col :span="8">
                                       <el-form-item label="患者:" required prop ="patient_name">
                                           <el-autocomplete
                                               style="width:150px"
                                               popper-class="my-autocomplete"
                                               v-model="userform.patient_name"
                                               :fetch-suggestions="querySearchAsync"
                                               placeholder="请输入内容"
                                               @select="handleSelect">
                                           <i
                                              class="el-icon-search el-input__icon"
                                              slot="suffix"
                                             >
                                           </i>
                                            <template slot-scope="{ item }">
                                             <span class="addr">{{ item.name }}</span>
                                           </template>
                                            </el-autocomplete>
                                       </el-form-item>
                                    </el-col>
                                    <el-col :span="8">
                                       <el-form-item label="传染病:">
                                         <el-input style="width:150px" v-model="userform.contagion" :disabled="true"></el-input>
                                       </el-form-item>
                                    </el-col>
                                </el-row>
                                <el-row>
                                  <el-col :span="8">
                                    <el-form-item label="透析方式:">
                                       <el-select v-model="userform.dialysis_mode" placeholder="请选择" style="width:150px">
                                           <el-option
                                            v-for="item in treatmode"
                                           :key="item.id"
                                           :label="item.name"
                                           :value="item.id">
                                          </el-option>
                                     </el-select>
                                    </el-form-item>
                                  </el-col>
                                  <el-col :span="8">
                                      <el-form-item label="上机时间:">
                                          <el-date-picker
                                              type="datetime"
                                              format="yyyy-MM-dd HH:mm"
                                              value-format="yyyy-MM-dd HH:mm"
                                               placeholder="选择时间"
                                               v-model="userform.start_time"
                                               style="width:185px"
                                          ></el-date-picker>
                                      </el-form-item>
                                  </el-col>
                                   <el-col :span="8">
                                      <el-form-item label="下机时间:">
                                         <el-date-picker
                                              type="datetime"
                                              format="yyyy-MM-dd HH:mm"
                                              value-format="yyyy-MM-dd HH:mm"
                                               placeholder="选择时间"
                                               v-model="userform.end_time"
                                               style="width:185px"
                                          ></el-date-picker>
                                      </el-form-item>
                                  </el-col>
                                </el-row>
                                <el-row>
                                  <el-col :span="8">
                                      <el-form-item label="透析时长:">
                                          <el-input style="width:150px" v-model="userform.dialysis_time"></el-input>
                                      </el-form-item>
                                  </el-col>
                                  <el-col :span="8">
                                      <el-form-item label="实际超滤量(L)">
                                            <el-input style="width:150px" v-model="userform.hyperfiltratio"></el-input>
                                      </el-form-item>
                                  </el-col>
                                  <el-col :span="8">
                                     <el-form-item label="体重减少(kg):">
                                          <el-input style="width:150px" v-model="userform.weight_loss"></el-input>
                                     </el-form-item>
                                  </el-col>
                                </el-row>
                                <el-row>
                                  <el-col :span="8">
                                     <el-form-item label="预警值:">
                                        <el-input style="width:150px" v-model="userform.warning_value"></el-input>
                                     </el-form-item>
                                  </el-col>
                                  <el-col :span="8">
                                      <el-form-item label="使用次数:">
                                         <el-input style="width:150px" v-model="userform.user_total" :disabled="true"></el-input>
                                      </el-form-item>
                                  </el-col>
                                  <el-col :span="8">
                                        <el-form-item label="运行:">
                                           <el-radio-group v-model="userform.run" @change="changeRun">
                                                <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in runOption" :key="gender.id">{{gender.name}}</el-radio>
                                            </el-radio-group>
                                        </el-form-item>
                                  </el-col>
                                </el-row>
                                <el-row>
                                  <el-col>
                                      <el-form-item class="stoppage" label="故障发生阶段:">
                                        <el-radio-group v-model="userform.failure_stage" :disabled ="runDisable">
                                             <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in faultPhase" :key="index">{{gender.name}}</el-radio>
                                        </el-radio-group>
                                     </el-form-item>
                                  </el-col>
                                </el-row>
                                <el-row>
                                  <el-col :span="24">
                                      <el-form-item class="stoppage" label="故障描述:">
                                      <el-input style="width:78%" v-model="userform.fault_description"></el-input>
                                     </el-form-item>
                                  </el-col>
                                </el-row>
                                <el-row>
                                  <el-col :span="24">
                                   <el-form-item class="stoppage" label="故障提示信息及代码:">
                                      <el-input style="width:78%" v-model="userform.code_information"></el-input>
                                   </el-form-item>
                                  </el-col>
                                </el-row>
                                <el-row>
                                  <el-form-item label="机器消毒:"></el-form-item>
                                </el-row>
                                <el-row>
                                  <el-col :span="3">
                                      <el-form-item label="①机表"></el-form-item>
                                  </el-col>
                                  <el-col :span="10">
                                     <el-form-item label="消毒方式:" required prop="disinfect_type">
                                         <el-select v-model="userform.disinfect_type" placeholder="请选择" >
                                           <el-option
                                            v-for="item in disinfectType"
                                           :key="item.id"
                                           :label="item.name"
                                           :value="item.id"
                                           style="width:150px">
                                           </el-option>
                                        </el-select>
                                     </el-form-item>
                                  </el-col>
                                  <el-col :span="10">
                                     <el-form-item label="消毒液:" required prop="disinfectant_type">
                                        <el-select v-model="userform.disinfectant_type" placeholder="请选择" >
                                           <el-option
                                            v-for="item in disinfectantType"
                                           :key="item.id"
                                           :label="item.name"
                                           :value="item.id"
                                            style="width:200px">
                                           </el-option>
                                        </el-select>
                                     </el-form-item>
                                  </el-col>
                                </el-row>
                                <el-row>
                                  <el-col :span="3">
                                    <el-form-item style="visibility: hidden;" label="①机表"></el-form-item>
                                  </el-col>
                                  <el-col :span="10">
                                     <el-form-item label="消毒状态:" required prop="disinfection">
                                        <el-select v-model="userform.disinfection" placeholder="请选择" >
                                           <el-option
                                            v-for="item in disinfection"
                                           :key="item.id"
                                           :label="item.name"
                                           :value="item.id"
                                            style="width:200px">
                                           </el-option>
                                        </el-select>
                                     </el-form-item>
                                  </el-col>
                                  <el-col :span="10">
                                      <el-form-item label="运行:">
                                           <el-radio-group v-model="userform.machine_run">
                                                <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in runOptions" :key="index">{{gender.name}}</el-radio>
                                            </el-radio-group>
                                      </el-form-item>
                                  </el-col>
                                </el-row>
                                <el-row>
                                   <el-col :span="3">
                                       <el-form-item label="②液路"></el-form-item>
                                   </el-col>
                                   <el-col :span="10">
                                       <el-form-item label="消毒方式:" required prop="fluid_path">
                                         <el-select v-model="userform.fluid_path" placeholder="请选择" >
                                           <el-option
                                            v-for="item in sterilizeType"
                                           :key="item.id"
                                           :label="item.name"
                                           :value="item.id"
                                           style="width:200px">
                                           </el-option>
                                        </el-select>
                                       </el-form-item>
                                   </el-col>
                                   <el-col :span="10">
                                       <el-form-item label="消毒液:" required prop="disinfectant">
                                        <el-select v-model="userform.disinfectant" placeholder="请选择" >
                                           <el-option
                                            v-for="item in fluidPathType"
                                           :key="item.id"
                                           :label="item.name"
                                           :value="item.id"
                                            style="width:260px">
                                           </el-option>
                                        </el-select>
                                     </el-form-item>
                                   </el-col>
                                </el-row>
                                <el-row>
                                  <el-col :span="3">
                                    <el-form-item style="visibility: hidden;" label="①机表"></el-form-item>
                                  </el-col>
                                   <el-col :span="10">
                                     <el-form-item label="消毒状态:" required prop="disinfection_status">
                                        <el-select v-model="userform.disinfection_status" placeholder="请选择" >
                                           <el-option
                                            v-for="item in disinfection"
                                           :key="item.id"
                                           :label="item.name"
                                           :value="item.id"
                                            style="width:200px">
                                           </el-option>
                                        </el-select>
                                     </el-form-item>
                                  </el-col>
                                  <el-col :span="10">
                                      <el-form-item label="消毒液残留:">
                                        <el-radio-group v-model="userform.disinfection_residue">
                                                <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in Disinfectant" :key="index">{{gender.name}}</el-radio>
                                         </el-radio-group>
                                      </el-form-item>
                                  </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="8">
                                        <el-form-item label="消毒时长:">
                                            <el-input style="width:135px" v-model="userform.longtime"></el-input><span style="color:#606266;">分钟</span>
                                        </el-form-item>
                                    </el-col>
                                    <el-col :span="8">
                                       <el-form-item label="开始消毒时间:">
                                          <el-date-picker
                                              type="datetime"
                                              format="yyyy-MM-dd HH:mm"
                                              value-format="yyyy-MM-dd HH:mm"
                                               placeholder="选择时间"
                                               v-model="userform.starttime"
                                               style="width:185px;"
                                          ></el-date-picker>
                                       </el-form-item>
                                    </el-col>
                                    <el-col :span="8">
                                       <el-form-item label="结束消毒时间:">
                                            <el-date-picker
                                              type="datetime"
                                              format="yyyy-MM-dd HH:mm"
                                              value-format="yyyy-MM-dd HH:mm"
                                               placeholder="选择时间"
                                               v-model="userform.endtime"
                                               style="width:185px;"
                                          ></el-date-picker>
                                       </el-form-item>
                                    </el-col>
                                </el-row>
                                <el-row>
                                   <el-col :span="3" style="height: 36px;line-height: 36px;">
                                     <el-form-item label="透析机消毒液:"></el-form-item>
                                   </el-col>
                                   <el-col :span="5" style="display:flex;align-items: center">
                                     <el-form-item>
                                       <el-checkbox v-model="userform.dialysis_checked">更换</el-checkbox>
                                      </el-form-item>
                                   </el-col>
                                   <el-col :span="8">
                                     <el-form-item label="名称:">
                                       <el-select v-model="userform.dialysis_name" placeholder="请选择" style="width:150px">
                                           <el-option
                                            v-for="item in names"
                                           :key="item.id"
                                           :label="item.name"
                                           :value="item.id"
                                            >
                                           </el-option>
                                        </el-select>
                                     </el-form-item>
                                   </el-col>
                                   <el-col :span="8">
                                      <el-form-item label="规格:">
                                          <el-input style="width:100px" v-model="userform.norms"></el-input><span style="color:#606266;">桶</span>
                                      </el-form-item>
                                       <span class="warn" v-show="warnShow">您已一个月未更换,请注意检测</span>
                                   </el-col>
                                </el-row>
                                <el-row>
                                   <el-col>
                                      <el-form-item label="浓度:">
                                         <el-radio-group v-model="userform.dialysis_concentration">
                                                <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in potency" :key="index">{{gender.name}}</el-radio>
                                         </el-radio-group>

                                      </el-form-item>
                                   </el-col>
                                </el-row>
                                <el-row>
                                   <el-col :span="8">
                                     <el-form-item label="细菌过滤器:">
                                       <el-checkbox v-model="userform.germ_checked">更换</el-checkbox>
                                       <span class="warn" v-show="warnShowTwo">您已一个月未更换,请注意检测</span>
                                     </el-form-item>

                                     </el-col>
                                   <el-col :span="8">
                                     <el-form-item class="newname" label="名称:">
                                       <el-select v-model="userform.germ_name" placeholder="请选择" style="width:150px">
                                           <el-option
                                            v-for="item in germs"
                                           :key="item.id"
                                           :label="item.name"
                                           :value="item.id"
                                            >
                                           </el-option>
                                        </el-select>
                                     </el-form-item>
                                   </el-col>
                                   <el-col :span="8">
                                       <el-form-item class="newname" label="数量:">
                                           <el-input style="width:100px" v-model="userform.germ_number"></el-input><span style="color:#606266;">支</span>
                                       </el-form-item>
                                   </el-col>
                                </el-row>
                                <el-row>
                                   <el-col :span="8">
                                      <el-form-item label="空气滤网清洁:">
                                        <el-checkbox v-model="userform.clean">清洁</el-checkbox>
                                      <span class="warn" v-show="warnShowThree">您已一个月未清洁,请检查</span>
                                      </el-form-item>
                                     </el-col>
                                   <el-col :span="8">
                                       <el-form-item class="newname" label="签名:" required prop="sign_name">
                                          <el-select v-model="userform.sign_name" placeholder="请选择" >
                                           <el-option
                                            v-for="item in autograph"
                                           :key="item.admin_user_id"
                                           :label="item.user_name"
                                           :value="item.admin_user_id"
                                            style="width:185px">
                                           </el-option>
                                         </el-select>
                                       </el-form-item>
                                   </el-col>
                                </el-row>
                                <el-row>
                                  <div class="elbutton">
                                    <el-col :span="6">
                                     <el-button>取消</el-button>
                                    </el-col>
                                    <el-col :span="2">
                                     <el-button type="primary" @click="SaveInformation('userform')">保存</el-button>
                                    </el-col>
                                  </div>
                                </el-row>
                             </el-form>

                          </el-tab-pane>
                           <el-tab-pane label="使用登记列表" name="second">
                             <user-form ref="userForm" :userdata="userdata"></user-form>
                           </el-tab-pane>
                       </el-tabs>
                     </div>
                     <div v-show="Ushow" class="zClass">
                       暂无数据
                     </div>
                   </el-tab-pane>
                   <el-tab-pane label="质量控制" name="fourth">
                      <div v-show="zhiShow">
                       <el-tabs type="border-card" v-model="activeNameSix" @tab-click="handleClick">
                         <el-tab-pane label="新增质量控制" name="first">
                           <span style="margin-bottom: 20px;display: block;">细菌培养</span>
                           <el-form :model="qualityForm" ref="qualityForm" :rules="qualitRules">
                             <el-row>
                               <el-col :span="8">
                                  <el-form-item label="取样日期:">
                                    <el-date-picker
                                      v-model="qualityForm.date"
                                       prefix-icon="none"
                                       type="date"
                                       placeholder="请选择"
                                       format="yyyy-MM-dd"
                                      value-format="yyyy-MM-dd"
                                      style="width:150px">
                                   </el-date-picker>
                                  </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                  <el-form-item label="取样标本:">
                                     <el-select style="width:150px"  v-model="qualityForm.specimen" @change="changeSpecimen">
                                      <el-option v-for="item in samplingSpecimen" :key="item.id" :label="item.name" :value="item.id"></el-option>
                                    </el-select>
                                  </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                  <el-form-item label="A浓缩液批号:">
                                     <el-input style="width:150px" v-model="qualityForm.concentrate_noa" :disabled="disable"></el-input>
                                  </el-form-item>
                               </el-col>

                             </el-row>
                             <el-row>
                                 <el-col :span="8">
                                  <el-form-item label="B浓缩液批号">
                                     <el-input style="width:150px" v-model="qualityForm.concentrate_nob" :disabled="diableTwo"></el-input>
                                  </el-form-item>
                               </el-col>
                                <el-col :span="8">
                                   <el-form-item label="采样部位:">
                                     <el-select style="width:150px"  v-model="qualityForm.sampling_locationa">
                                       <el-option v-for="item in samplingLocation" :key="item.id" :label="item.name" :value="item.id"></el-option>
                                      </el-select>
                                   </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                   <el-form-item label="检测单位:" required prop="detection_unit">
                                     <el-input style="width:150px" v-model="qualityForm.detection_unit"></el-input>
                                  </el-form-item>
                                </el-col>
                             </el-row>
                             <el-row>
                                <el-col :span="8">
                                  <el-form-item label="取样者:" required prop="sampler">
                                     <el-select style="width:150px"  v-model="qualityForm.sampler">
                                       <el-option v-for="item in sampling" :key="item.addmin_user_id" :label="item.user_name" :value="item.admin_user_id"></el-option>
                                      </el-select>
                                  </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="出报告日期:">
                                        <el-date-picker
                                          v-model="qualityForm.reporting_date"
                                          prefix-icon="none"
                                          type="date"
                                          placeholder="请选择"
                                          format="yyyy-MM-dd"
                                          value-format="yyyy-MM-dd"
                                          style="width:150px">
                                        </el-date-picker>
                                    </el-form-item>
                                </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="24">
                                  <el-form-item label="检测结果:(cfu/ml)">
                                     <el-input
                                        type="textarea"
                                        :rows="2"
                                         placeholder="请输入内容"
                                         style="width:84%"
                                         v-model="qualityForm.detection_result"
                                         >
                                      </el-input>
                                  </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="24">
                                 <span style="color:#FF9900">注:细菌检测应每个月一次，要求细菌数<100cfu/ml</span>
                               </el-col>
                             </el-row>
                             <el-row>
                                <div class="clearn">
                                  <el-col :span="4">
                                    <el-button @click="cleanSaveBacteria">取消</el-button>
                                  </el-col>
                                   <el-col :span="4">
                                    <el-button type="primary" @click="SaveBacteria('qualityForm')">保存</el-button>
                                  </el-col>
                                </div>
                              </el-row>
                            </el-form>
                              <el-divider></el-divider>


                              <span style="margin-bottom: 20px;display: block;">内毒素检测</span>
                            <el-form ref="qualityFormTwo" :model="qualityFormTwo" :rules="diaRules">
                              <el-row>
                                  <el-col :span="8">
                                     <el-form-item label="取样日期:">
                                        <el-date-picker
                                          v-model="qualityFormTwo.sampling_date"
                                          prefix-icon="none"
                                          type="date"
                                          placeholder="请选择"
                                          format="yyyy-MM-dd"
                                          value-format="yyyy-MM-dd"
                                          style="width:150px">
                                        </el-date-picker>
                                     </el-form-item>
                                  </el-col>
                                  <el-col :span="8">
                                       <el-form-item label="取样标本:">
                                          <el-select style="width:150px"  v-model="qualityFormTwo.specimenb" @change="changeSpecimen">
                                             <el-option v-for="item in samplingSpecimen" :key="item.id" :label="item.name" :value="item.id"></el-option>
                                          </el-select>
                                       </el-form-item>
                                  </el-col>
                                  <el-col :span="8">
                                     <el-form-item label="A浓缩液批号:">
                                       <el-input style="width:150px" v-model="qualityFormTwo.concentrate_noc" :disabled="disable"></el-input>
                                     </el-form-item>
                                  </el-col>

                              </el-row>
                              <el-row>
                                 <el-col :span="8">
                                      <el-form-item label="B浓缩液批号:">
                                          <el-input style="width:150px" v-model ="qualityFormTwo.concentrateb_nod" :disabled="diableTwo"></el-input>
                                      </el-form-item>
                                  </el-col>
                                   <el-col :span="8">
                                  <el-form-item label="采样部位:">
                                    <el-select style="width:150px"  v-model="qualityFormTwo.sampling_locationb">
                                       <el-option v-for="item in samplingLocation" :key="item.id" :label="item.name" :value="item.id"></el-option>
                                    </el-select>
                                   </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                   <el-form-item label="检测单位:" required prop="detection_unit">
                                      <el-input style="width:150px" v-model ="qualityFormTwo.detection_unit"></el-input>
                                   </el-form-item>
                                </el-col>
                              </el-row>
                              <el-row>
                                <el-col :span="8">
                                   <el-form-item label="取样者:" required prop="samplerb">
                                      <el-select style="width:150px"  v-model="qualityFormTwo.samplerb">
                                        <el-option v-for="item in sampling" :key="item.addmin_user_id" :label="item.user_name" :value="item.admin_user_id"></el-option>
                                      </el-select>
                                   </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                  <el-form-item label="出报告日期:">
                                     <el-date-picker
                                       v-model="qualityFormTwo.reporting_dateb"
                                       prefix-icon="none"
                                       type="date"
                                       placeholder="请选择"
                                       format="yyyy-MM-dd"
                                       value-format="yyyy-MM-dd"
                                       style="width:150px">
                                    </el-date-picker>
                                  </el-form-item>
                                </el-col>
                              </el-row>
                              <el-row>
                                <el-col :span="24">
                                 <el-form-item label="检测结果:(EU/ml)">
                                     <el-input
                                        type="textarea"
                                        :rows="2"
                                         placeholder="请输入内容"
                                         style="width:800px"
                                         v-model="qualityFormTwo.detection_resultb"
                                         >
                                      </el-input>
                                  </el-form-item>
                                </el-col>
                              </el-row>
                              <el-row>
                                  <el-col :span="24">
                                    <span style="color:#FF9900">注:内毒素检测应至少每3个月1次，要求内毒素<0.25EU/ml，每台透析机每年至少检测一次</span>
                                   </el-col>
                              </el-row>
                              <el-row>
                                <div class="clearn">
                                  <el-col :span="4">
                                    <el-button @click="cleanLincomycin">取消</el-button>
                                  </el-col>
                                   <el-col :span="4">
                                    <el-button type="primary" @click="SaveLincomycin('qualityFormTwo')">保存</el-button>
                                  </el-col>
                                </div>
                              </el-row>
                            </el-form>
                               <el-divider></el-divider>


                              <span style="margin-bottom: 20px;display: block;">透析液离子浓度检测</span>

                            <el-form ref="qualityFormThree" :model="qualityFormThree" :rules="ruleThree">
                              <el-row>
                                <el-col :span="8">
                                    <el-form-item label="取样日期:">
                                        <el-date-picker
                                          v-model="qualityFormThree.dateb"
                                          prefix-icon="none"
                                          type="date"
                                          placeholder="请选择"
                                          format="yyyy-MM-dd"
                                          value-format="yyyy-MM-dd"
                                          style="width:150px">
                                        </el-date-picker>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="取样者:" required prop="samplerc">
                                      <el-select style="width:150px"  v-model="qualityFormThree.samplerc">
                                        <el-option v-for="item in sampling" :key="item.addmin_user_id" :label="item.user_name" :value="item.admin_user_id"></el-option>
                                      </el-select>
                                   </el-form-item>
                                </el-col>
                                  <el-col :span="8">
                                   <el-form-item label="检测单位:" required prop="detection_unit">
                                      <el-input style="width:150px" v-model ="qualityFormThree.detection_unit"></el-input>
                                   </el-form-item>
                                </el-col>
                              </el-row>
                              <el-row>
                                 <el-col :span="8">
                                     <el-form-item label="A浓缩液批号:">
                                       <el-input style="width:150px" v-model="qualityFormThree.concentrate_nof"></el-input>
                                     </el-form-item>
                                  </el-col>
                                   <el-col :span="8">
                                     <el-form-item label="B浓缩液批号:">
                                       <el-input style="width:150px" v-model="qualityFormThree.concentrate_nog"></el-input>
                                     </el-form-item>
                                  </el-col>
                                   <el-col :span="8">
                                    <el-form-item label="出报告日期:">
                                        <el-date-picker
                                          v-model="qualityFormThree.date_reportc"
                                          prefix-icon="none"
                                          type="date"
                                          placeholder="请选择"
                                          format="yyyy-MM-dd"
                                          value-format="yyyy-MM-dd"
                                          style="width:150px">
                                        </el-date-picker>
                                    </el-form-item>
                                </el-col>
                              </el-row>
                              <el-row>
                                <el-col :span="8">
                                  <!-- <span>Na<sup>+</sup></span> -->
                                   <el-form-item class="newItem" label="实际Na⁺(mmol/L):">
                                        <el-input style="width:123px" v-model="qualityFormThree.actual_na"></el-input>
                                    </el-form-item>
                                </el-col>
                                 <el-col :span="8">
                                    <el-form-item class="newItem" label="配方Na⁺(mmol/L):">
                                        <el-input style="width:123px" v-model="qualityFormThree.actual_pna"></el-input>
                                    </el-form-item>
                                </el-col>
                                 <el-col :span="8">
                                    <el-form-item label="K⁺(mmol/L):">
                                        <el-input style="width:150px" v-model="qualityFormThree.actual_k"></el-input>
                                    </el-form-item>
                                </el-col>

                              </el-row>
                               <el-row>
                                <el-col :span="8">
                                    <el-form-item label="Ca2⁺(mmol/L):">
                                        <el-input style="width:150px" v-model="qualityFormThree.actual_ca"></el-input>
                                    </el-form-item>
                                </el-col>
                                 <el-col :span="8">
                                    <el-form-item label="CI¯(mmol/L):">
                                        <el-input style="width:150px" v-model="qualityFormThree.actual_ci"></el-input>
                                    </el-form-item>
                                </el-col>
                                 <el-col :span="8">
                                    <el-form-item label="HCO3¯(mmol/L):">
                                        <el-input style="width:150px" v-model="qualityFormThree.actual_hco"></el-input>
                                    </el-form-item>
                                </el-col>
                              </el-row>
                              <el-row>
                                 <el-col :span="8">
                                    <el-form-item label="Mg2⁺(mmol/L):">
                                        <el-input style="width:150px" v-model="qualityFormThree.actual_mg"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                  <el-form-item label="PH:">
                                     <el-input style="width:150px" v-model="qualityFormThree.actual_ph"></el-input>
                                  </el-form-item>
                                </el-col>
                              </el-row>
                              <el-row>
                                <div></div>
                              </el-row>
                              <el-row>
                                <el-col :span="24">
                                  <el-form-item label="备注:">
                                     <el-input
                                        type="textarea"
                                        :rows="2"
                                         placeholder="请输入内容"
                                         style="width:500px"
                                         v-model="qualityFormThree.remakes"
                                         >
                                      </el-input>
                                  </el-form-item>
                                </el-col>
                              </el-row>
                              <el-row>
                                <div class="clearn">
                                  <el-col :span="4">
                                    <el-button @click="cleanQuality">取消</el-button>
                                  </el-col>
                                   <el-col :span="4">
                                    <el-button type="primary" @click="SaveQualityControl('qualityFormThree')">保存</el-button>
                                  </el-col>
                                </div>
                              </el-row>
                               </el-form>

                         </el-tab-pane>


                         <el-tab-pane label="质量控制列表" name="second">
                           <quality-form ref="child"></quality-form>
                         </el-tab-pane>
                       </el-tabs>
                       </div>
                        <div v-show="zhShow" class="zClass">
                          暂无数据
                        </div>
                   </el-tab-pane>
                    <el-tab-pane label="维修维护" name="five">
                       <el-tabs type="border-card" v-model="activeNameFive" @tab-click="handleClick">
                         <el-tab-pane label="新增维修维护" name="first">
                           <el-form :model="guaForm" ref="guaForm" :rules="repirRules">
                             <el-row>
                               <el-col :span="8">
                                  <el-form-item label="保修日期:" required prop="guarantee_date">
                                     <el-date-picker
                                          v-model="guaForm.guarantee_date"
                                          prefix-icon="none"
                                          type="date"
                                          placeholder="请选择"
                                          format="yyyy-MM-dd"
                                          value-format="yyyy-MM-dd"
                                          style="width:150px">
                                        </el-date-picker>
                                  </el-form-item>
                               </el-col>
                                <el-col :span="8">
                                  <el-form-item label="出发时间:">
                                      <el-date-picker
                                          type="datetime"
                                          format="yyyy-MM-dd HH:mm"
                                          value-format="yyyy-MM-dd HH:mm"
                                          placeholder="选择时间"
                                          v-model="guaForm.start_time"
                                          style="width:185px;">
                                       </el-date-picker>
                                  </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                                 <el-col :span="8">
                                  <el-form-item label="到达时间:">
                                     <!-- <el-date-picker
                                          v-model="guaForm.arrive_time"
                                          prefix-icon="none"
                                          type="date"
                                          placeholder="请选择"
                                          format="yyyy-MM-dd"
                                          value-format="yyyy-MM-dd"
                                          style="width:185px">
                                        </el-date-picker> -->
                                         <el-date-picker
                                          type="datetime"
                                          format="yyyy-MM-dd HH:mm"
                                          value-format="yyyy-MM-dd HH:mm"
                                          placeholder="选择时间"
                                          v-model="guaForm.arrive_time"
                                          style="width:185px;">
                                       </el-date-picker>
                                  </el-form-item>
                               </el-col>
                                <el-col :span="8">
                                  <el-form-item label="完成时间:">
                                         <el-date-picker
                                          type="datetime"
                                          format="yyyy-MM-dd HH:mm"
                                          value-format="yyyy-MM-dd HH:mm"
                                          placeholder="选择时间"
                                          v-model="guaForm.finish_time"
                                          style="width:185px;">
                                       </el-date-picker>
                                  </el-form-item>
                               </el-col>
                               <el-col :span="8">
                                  <el-form-item label="总路程:(公里)">
                                     <el-input style="width:150px" v-model = "guaForm.total_distance"></el-input>
                                  </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="24">
                                  <el-form-item label="故障发生阶段">
                                      <el-radio-group v-model="guaForm.failure_stage">
                                             <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in faultPhase" :key="index">{{gender.name}}</el-radio>
                                        </el-radio-group>
                                  </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                                <el-col :span="24">
                                  <el-form-item class="formItem" label="故障提示信息及代码">
                                     <el-input
                                        type="textarea"
                                        :rows="2"
                                         placeholder="请输入内容"
                                         v-model="guaForm.code_information"
                                        style="width:85%">
                                     </el-input>
                                  </el-form-item>
                                </el-col>
                             </el-row>
                             <el-row>
                                <el-col :span="8">
                                    <el-form-item label="故障描述:" required prop="fault_description">
                                        <el-input
                                           type="textarea"
                                           :rows="2"
                                            placeholder="请输入内容"
                                            v-model="guaForm.fault_description"
                                            style="width:86%;margin-left: 10%;">
                                         </el-input>
                                    </el-form-item>
                                </el-col>
                                 <el-col :span="8">
                                    <el-form-item label="原因分析:">
                                        <el-input
                                           type="textarea"
                                           :rows="2"
                                            placeholder="请输入内容"
                                            v-model="guaForm.cause_analysis"
                                            style="width:86%;margin-left: 10%;">
                                         </el-input>
                                    </el-form-item>
                                </el-col>
                                 <el-col :span="8">
                                    <el-form-item label="处理过程:">
                                        <el-input
                                           type="textarea"
                                           :rows="2"
                                            placeholder="请输入内容"
                                            v-model="guaForm.treatment_process"
                                            style="width:86%;margin-left: 10%;">
                                         </el-input>
                                    </el-form-item>
                                </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="24">
                                  <el-form-item label="上传图片:">
                                    <el-upload
                                      :data="uploadFileData"
                                      action="https://upload.qiniup.com"
                                      :on-success="handleSuccess"
                                      :before-upload="beforeUploadFile"
                                      :limit="1"
                                      ref='upload'
                                      accept=".jpg,.png,.gif"
                                      >
                                        <el-button size="small" type="primary">上传图片</el-button>
                                      </el-upload>
                                     <a class="el-upload-list__item-name" v-show="classShow">
                                        <i style="color:#0000EE"><a :href="guaForm.images" target="_blank">{{filename}}</a><span @click="hiddenShow"><li class="el-icon-circle-close"></li></span></i>
                                     </a>
                                  </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="20">
                                  <el-form-item label="故障是否排除:">
                                       <el-radio-group v-model="guaForm.exclude">
                                             <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in breakDown" :key="index">{{gender.name}}</el-radio>
                                        </el-radio-group>
                                  </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                               <el-col :span="20">
                                 <el-form-item label="原因:">
                                      <el-input
                                          type="textarea"
                                          :rows="2"
                                           placeholder="请输入内容"
                                           v-model="guaForm.reason"
                                          style="width:300px">
                                      </el-input>
                                 </el-form-item>
                               </el-col>
                             </el-row>
                             <el-row>
                                <div class="clearn">
                                  <el-col :span="4">
                                    <el-button>取消</el-button>
                                  </el-col>
                                   <el-col :span="4">
                                    <el-button type="primary" @click="SaveRepair('guaForm')">保存</el-button>
                                  </el-col>
                                </div>
                             </el-row>
                           </el-form>
                         </el-tab-pane>
                         <el-tab-pane label="维修维护列表" name="second">
                              <repair-form ref="child"></repair-form>
                         </el-tab-pane>
                      </el-tabs>
                   </el-tab-pane>
                   </el-tabs>
                </div>

                <!-- <el-autocomplete
                  popper-class="my-autocomplete"
                  v-model="state"
                 :fetch-suggestions="querySearch"
                  placeholder="请输入内容"
                  @select="handleSelect"
                  >
                  <i
                   class="el-icon-edit el-input__icon"
                   slot="suffix"
                  @click="handleIconClick">
                  </i>
                 <template slot-scope="{ item }">
                 <div class="name">{{ item.value }}</div>
                  <span class="addr">{{ item.address }}</span>
                  </template>
                 </el-autocomplete> -->

             </el-main>
          </el-container>
        </el-container>
      </el-container>

         <!-- 新增计划 -->
        <plan-form ref="planForm" :equimentid="equimentid" v-on:getAllPlan="getAllPlan" v-on:getAllPlanDetail="getAllPlanDetail" @func="getPlanData"></plan-form>
        <!-- <edit-machine-form ref="editmachineform"  :planid="planid" ></edit-machine-form> -->
        <!-- 综合查询 -->
        <multiple-form ref="multipleform" :equimentid="equimentid"></multiple-form>
         <!-- 使用登记提醒配置 -->
         <remander-form ref="remanderform"> </remander-form>
    <!-- 编辑消毒计划 -->
     <el-dialog title="编辑消毒计划" :visible.sync="dialogVisible" width="50%" center>
       <el-form :model="machineform" ref="machineform" :rules="planRules">
        <el-row>
          <el-col :span="10">
            <el-form-item label="设备型号:" required prop = "device_type">
              <el-select style="width:135px" v-model="machineform.device_type">
                <el-option
                  v-for="item in this.DeviceType"
                  :key="item.id"
                  :label="item.device_mode"
                  :value="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="消毒时长:" required prop="disinfec_time">
              <el-input style="width:135px" v-model="machineform.disinfec_time"></el-input>
              <span>分钟</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="10">
            <el-form-item label="时间:" required prop="time">
              <el-select
                v-model="machineform.time"
                placeholder="请选择时间"
                 style="width: 140px;"
              >
                <el-option
                  v-for="item in this.timeType"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="班次:" required prop="class_time">
              <el-select
                v-model="machineform.class_time"
                placeholder="请选择时间"
                 style="width: 140px;"
              >
                <el-option
                  v-for="item in this.classType"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="10">
            <el-form-item label="机表消毒方式:">
              <el-select style="width:135px" v-model="machineform.way">
                <el-option
                  v-for="item in this.disinfectType"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="机表消毒液:">
              <el-select
                style="width:135px"
                v-model="machineform.machine_disinfectant"
              >
                <el-option
                  v-for="item in this.disinfectantType"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="10">
            <el-form-item label="液路消毒方式:">
              <el-select style="width:135px" v-model="machineform.disinfectant_way">
                <el-option
                  v-for="item in this.sterilizeType"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="液路消毒液:">
              <el-select style="width:135px" v-model="machineform.disinfectant">
                <el-option
                  v-for="item in this.fluidPathType"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="UpdatePlanInfo('machineform')">保存</el-button>
      </span>
    </el-dialog>

        </div>
    </div>

</template>

<script>
  import BreadCrumb from '../components/bread-crumb'
  import { getAllSubregion, getAllMachine, getMachineDetailById,
    UpdateMachineInfo, getAllPlan, getAllPlanDetail, DeletePlans,
    getAllEquimentName, EditPlanDetail, UpdatePlanInfo, SaveInformation, getPatientInfo,
    ChangeClass, getAllOrganization, getUserRegister, SaveQualityControl, getOrgName, SaveRepair, SaveBacteria, SaveLincomycin, getAutoData, getAllEquitType, UpdateMacheineTwo, getTotalNumber, getTimeWarning, getTimeBeteen, getAllpatient, UpdateMachineInfoTwo, getPatientDetail, openDelete, getAllMode, selectChange, selectBed } from '@/api/manage'
  import { uParseTime } from '@/utils/tools'
  import { getToken } from '@/api/qiniu'
  import PlanForm from './components/PlanForm'
  import EditMachineForm from './components/EditMachineForm'
  import MultipleForm from './components/MultipleForm'
  import UserForm from './components/UserForm'
  import QualityForm from './components/QualityForm'
  import RepairForm from './components/RepairForm'
  import RemanderForm from './components/RemanderForm'
  import { parseTime } from '@/utils'
  import { getFileExtension } from '@/utils/tools'
  import { PostSearch } from '@/api/patient'
const cityOptions = ['HD', 'HDF', 'HD+HP', 'HP', 'HF', 'SCUF', 'IUF', 'HFHD', 'HFHD+HP', 'PHF', 'HFR', 'HDF+HP', 'CRRT', '腹水回输']
const moment = require('moment')
export default {
    name: 'home',
    components: {
      BreadCrumb,
      PlanForm,
      EditMachineForm,
      MultipleForm,
      UserForm,
      QualityForm,
      RepairForm,
      RemanderForm
    },
    data() {
      return {
        crumbs: [
          { path: false, name: '设备管理详情页' }
        ],
        tableData: [],
        tableDatatwo: [],
        planData: [],
        DeviceTypeType: [
          { id: 0, name: '全部' },
          { id: 1, name: '透析机' },
          { id: 2, name: '水处理机' },
          { id: 3, name: '其他' }
        ],
        bedNumber: [],
        zoneNumber: [],
        Number: [],
        form: {
          id: '',
          serial_number: '',
          devicetype: '',
          bed_number: '',
          device_name: '',
          manufacture_factory: '',
          service_manufacturer: '',
          unit_type: '',
          use_section: '',
          section_number: '',
          buy_date: '',
          install_date: '',
          start_date: '',
          maintenance_engineer: '',
          telephone: '',
          guarantee_date: '',
          machine_status: '',
          user_total: '',
          remarks: '',
          rubbish_date: '',
          rubbish_reason: '',
          user_year: '',
          work_time: '',
          treat_mode: [],
          treat_type: [],
          bed: '', // 治疗模式
          Disinfection_mode: '',
          revers_mode: '',
          beds: '',
          bed_numbers: ''
        },
        activeName: 'first',
        activeNameTwo: 'first',
        activeNameThree: 'first',
        activeNameSix: 'first',
        activeNameFive: 'first',
        machineStatus: [
          { id: 1, name: '使用机' },
          { id: 2, name: '备用机' },
          { id: 3, name: '急诊机' },
          { id: 4, name: '报废机' }
        ],
        DisCardResion: [
          { id: 0, name: '请选择' },
          { id: 1, name: '超期限报废' },
          { id: 2, name: '故障报废' },
          { id: 3, name: '核定报废' }
        ],
        DeviceTypes: [
          { id: 1, name: '透析机' },
          { id: 2, name: '水处理机' },
          { id: 3, name: '其他' }
        ],
        Classes: [
          { id: 0, name: '全部' },
          { id: 1, name: '上午' },
          { id: 2, name: '下午' },
          { id: 3, name: '晚上' }
        ],
        names: [
          { id: 0, name: '请选择' },
          { id: 1, name: '20%柠檬酸' },
          { id: 2, name: '50%柠檬酸' },
          { id: 3, name: '次氯酸钠' }
        ],
        germs: [
          { id: 0, name: '请选择' },
          { id: 1, name: '费森细菌过滤器' },
          { id: 2, name: '日机装细菌过滤器' },
          { id: 3, name: '贝朗机细菌过滤器' },
          { id: 4, name: '东丽机细菌过滤器' }
        ],
        DisinfectionMode: [
          { id: 0, name: '请选择' },
          { id: 1, name: '化学消毒' },
          { id: 2, name: '热消毒' },
          { id: 3, name: '化学消毒+热消毒' }
        ],
        autograph: [],
        bedZone: [],
        bedZoneTwo: [],
        forms: {
          zone_id: 0, // 分区号
          class_id: '', // 班次
          device_type: 0, // 设备类型
          date: ''
        },
        currentRow: null,
        cancelShow: false,
        confirmShow: false,
        isIndeterminate: true,
        checkAll: false,
        cities: cityOptions,
        rules: {
          serial_number: [{ required: true, message: '请填写序列号' }],
          device_name: [{ required: true, message: '请填写序列号' }],
          devicetype: [{ required: true, message: '请填写设备类型' }],
          unit_type: [{ required: true, message: '请填写设备型号' }]

        },
        qualitRules: {
          detection_unit: [{ required: true, message: '请填写检测单位' }],
          sampler: [{ required: true, message: '请填写取样者' }]

        },
        diaRules: {
          detection_unit: [{ required: true, message: '请填写检测单位' }],
          samplerb: [{ required: true, message: '请填写取样者' }]
        },
        repirRules: {
          guarantee_date: [{ required: true, message: '请填写保修日期' }],
          fault_description: [{ required: true, message: '请填写故障描述' }]
        },
        ruleThree: {
          detection_unit: [{ required: true, message: '请填写检测单位' }],
          samplerc: [{ required: true, message: '请填写取样者' }]
        },
        userRules: {
          date: [{ required: true, message: '请填写日期' }],
          zone: [{ required: true, message: '请填写分区' }],
          bed_number: [{ required: true, message: '请填写机位号' }],
          patient_name: [{ required: true, message: '请填写患者', trigger: ['blur', 'change'] }],
          disinfect_type: [{ required: true, message: '请填写消毒方式' }],
          disinfectant_type: [{ required: true, message: '请填写消毒液' }],
          disinfection: [{ required: true, message: '请填写消毒状态' }],
          fluid_path: [{ required: true, message: '请填写消毒方式' }],
          disinfectant: [{ required: true, message: '请填写消毒液' }],
          disinfection_status: [{ required: true, message: '消毒状态' }],
          sign_name: [{ required: true, message: '请填写签名', trigger: ['change'] }],
          classtype: [{ required: true, message: '请填写班次' }]
        },
        planRules: {
          device_type: [{ required: true, message: '请输入设备型号' }],
          disinfec_time: [{ required: true, message: '请输入消毒时长' }],
          time: [{ required: true, message: '请输入时间' }],
          class_time: [{ required: true, message: '请输入班次' }]
        },
        runOption: [
          { id: 1, name: '正常' },
          { id: 2, name: '故障' }
        ],
        runOptions: [
          { id: 1, name: '达标' },
          { id: 2, name: '未达标' }
        ],
        faultPhase: [
          { id: 1, name: '开机启动' },
          { id: 2, name: '自检' },
          { id: 3, name: '准备' },
          { id: 4, name: '治疗' },
          { id: 5, name: '消毒' }
        ],
        Disinfectant: [
          { id: 1, name: '有' },
          { id: 2, name: '无' }
        ],
        potency: [
          { id: 1, name: '达标' },
          { id: 2, name: '未达标' }
        ],
        sampling: [],
        DeviceType: [],
        equimentid: 0,
        checkAllStatus: false,
        checkAllStatusOne: false,
        selectMachines: [],
        selectMachinesOne: [],
        machineIndex: -1,
        planid: 0,
        machineform: {
          id: '',
          device_type: '',
          disinfec_time: '',
          time: '',
          class_time: '',
          way: '',
          machine_disinfectant: '',
          disinfectant_way: '',
          disinfectant: ''
        },
        dialogVisible: false,
        timeType: [
          { id: 1, name: '周一' },
          { id: 2, name: '周二' },
          { id: 3, name: '周三' },
          { id: 4, name: '周四' },
          { id: 5, name: '周五' },
          { id: 6, name: '周六' },
          { id: 7, name: '周日' }
        ],
        classType: [
          { id: 0, name: '请选择' },
          { id: 1, name: '上午' },
          { id: 2, name: '下午' },
          { id: 3, name: '晚上' }
        ],
        // 基表消毒方式
        disinfectType:
        [
          { id: 0, name: '/' },
          { id: 1, name: '擦拭' },
          { id: 2, name: '化学消毒' }
        ],
        // 基表消毒液
        disinfectantType: [
          { id: 0, name: '/' },
          { id: 1, name: '0.22%季铵盐' },
          { id: 2, name: '500mg/l含氯消毒剂' },
          { id: 3, name: '1000mg/l含氯消毒剂' },
          { id: 4, name: '1500mg/l含氯消毒剂' }
        ],
        // 夜路消毒方式
        sterilizeType: [
          { id: 0, name: '/' },
          { id: 1, name: '热化学消毒' },
          { id: 2, name: '化学消毒 + 除钙' },
          { id: 3, name: '热化学消毒 + 除钙' },
          { id: 4, name: '热消毒' },
          { id: 5, name: '化学消毒' },
          { id: 6, name: '除钙' },
          { id: 7, name: '清洗' }
        ],
        // 夜路消毒液
        fluidPathType: [
          { id: 0, name: '/' },
          { id: 1, name: '20%柠檬酸' },
          { id: 2, name: '25%柠檬酸' },
          { id: 3, name: '50%柠檬酸' },
          { id: 4, name: '50%柠檬酸 + 5%次氯酸钠' },
          { id: 5, name: '20%柠檬酸 + 10%冰醋酸' },
          { id: 6, name: '0.2%过氧化乙酸' },
          { id: 7, name: '10%冰醋酸' },
          { id: 8, name: '50%冰醋酸' },
          { id: 9, name: '5%次氯酸钠' }
        ],

        userform: {
          id: 0,
          date: moment(new Date()).format('YYYY-MM-DD'), // 日期
          classtype: '', // 班次
          zone: '', // 分区
          bed_number: '', // 床位号
          patient_name: '', // 患者
          contagion: '', // 传染病
          dialysis_mode: '', // 透析方式
          start_time: '', // 上机时间
          end_time: '', // 下机时间
          dialysis_time: '', // 透析时长
          hyperfiltratio: '', // 实际超滤量
          weight_loss: '', // 体重减少
          warning_value: '', // 预警值
          user_total: '', // 使用次数
          run: 1, // 运行
          failure_stage: '', // 故事发生阶段
          fault_description: '', // 故障描述
          code_information: '', // 故障提示及代码

          // 机器消毒
          disinfect_type: 1, // 消毒方式
          disinfectant_type: 2, // 消毒液
          disinfection: 1, // 消毒状态
          machine_run: 1, // 运行

          // 液路
          fluid_path: 3, // 消毒方式
          disinfectant: 3, // 消毒液
          disinfection_status: 1, // 消毒状态
          disinfection_residue: 1, // 消毒液残留
          longtime: '', // 消毒时长
          starttime: '', // 开始消毒时间
          endtime: '', // 结束消毒时间
          dialysis_checked: '', // 更换
          dialysis_name: '', // 名称
          norms: '', // 规格
          dialysis_concentration: 1, // 浓度
          germ_checked: '', // 更换
          germ_name: '', // 名称
          germ_number: '', // 数量
          clean: '', // 清洁
          sign_name: '', // 签名
          patient_id: ''
        },
        treatmentmodes: [
          { id: 1, name: 'HD' },
          { id: 2, name: 'HDF' },
          { id: 3, name: 'HD+HP' },
          { id: 4, name: 'HP' },
          { id: 5, name: 'HF' },
          { id: 6, name: 'SCUF' },
          { id: 7, name: 'IUF' },
          { id: 8, name: 'HFHD+HP' },
          { id: 9, name: 'HFR' },
          { id: 10, name: 'HDF+HP' },
          { id: 11, name: 'GRRT' },
          { id: 12, name: '腹水回输' }
        ],
        treatmode: [
          { id: 0, name: '请选择' },
          { id: 1, name: 'HD' },
          { id: 2, name: 'HDF' },
          { id: 3, name: 'HD + HP' },
          { id: 4, name: 'HP' },
          { id: 5, name: 'HF' },
          { id: 6, name: 'SCUF' },
          { id: 7, name: 'IUF' },
          { id: 8, name: 'HFHD' },
          { id: 9, name: 'HFHD+HP' },
          { id: 10, name: 'PHF' },
          { id: 11, name: 'HFR' },
          { id: 12, name: 'HDF+HP' },
          { id: 13, name: 'CRRT' },
          { id: 14, name: '腹水回输' },
          { id: 15, name: 'HD前置换' },
          { id: 16, name: 'HD后置换' },
          { id: 17, name: 'HDF前置换' },
          { id: 18, name: 'HDF后置换' }
        ],
        disinfection: [
          { id: 0, name: '请选择' },
          { id: 1, name: '已消毒' },
          { id: 2, name: '未消毒' },
          { id: 3, name: '消毒未完成' }
        ],
        patientName: [],
        start: '',
        end: '',
        // 细菌培养
        qualityForm: {
          date: moment(new Date()).format('YYYY-MM-DD'), // 取样日期
          specimen: '', // 取样标本
          concentrate_noa: '', // 浓A
          concentrate_nob: '', // 浓B,
          sampling_locationa: '', // 采样部位
          detection_unit: '', // 检测单位
          sampler: '', // 取样者
          reporting_date: '', // 报告日期
          detection_result: '' // 检测结果
        },
        qualityFormTwo: {
          // 内毒素检测
          detection_unit: '', // 检测单位
          sampling_date: moment(new Date()).format('YYYY-MM-DD'), // 取样日期
          specimenb: '', // 取样标本
          concentrate_noc: '', // A浓缩液批号
          concentrateb_nod: '', // B浓
          sampling_locationb: '', // 采样部位
          samplerb: '', // 取样者
          reporting_dateb: '', // 出报告日期
          detection_resultb: '' // 检测结果
        },
        qualityFormThree: {
          detection_unit: '', // 检测单位
          // 透析液离子浓度检测
          dateb: moment(new Date()).format('YYYY-MM-DD'), // 取样日期
          samplerc: '', // 取样者
          concentrate_nof: '', // A浓
          concentrate_nog: '', // B浓
          date_reportc: '', // 出报告日期
          actual_na: '',
          actual_pna: '',
          actual_k: '',
          actual_ca: '',
          actual_ci: '',
          actual_hco: '',
          actual_mg: '',
          actual_ph: '',
          remakes: ''
        },
        disable: false,
        diableTwo: false,
        samplingSpecimen: [
          { id: 0, name: '请选择' },
          { id: 1, name: '透析液' },
          { id: 2, name: 'A浓缩液' },
          { id: 3, name: 'B浓缩液' },
          { id: 4, name: '置换液' },
          { id: 5, name: '透析用水' }
        ],
        samplingLocation: [
          { id: 0, name: '请选择' },
          { id: 1, name: '透析液入口' },
          { id: 2, name: '透析液取样口' },
          { id: 3, name: '置换液出口' },
          { id: 4, name: '透析机反渗水入口' }
        ],
        breakDown: [
          { id: 1, name: '是' },
          { id: 2, name: '待观察' },
          { id: 3, name: '未解决' }
        ],
        guaForm: {
          guarantee_date: moment(new Date()).format('YYYY-MM-DD'),
          start_time: '',
          arrive_time: '',
          finish_time: '',
          total_distance: '',
          failure_stage: '',
          fault_description: '',
          cause_analysis: '',
          treatment_process: '',
          images: '',
          exclude: '',
          reason: '',
          code_information: '',
          imageName: ''
        },

        filename: '',
        qiniuDomain: 'https://images.shengws.com/',
        uploadFileData: { token: '', key: '' },
        tShow: false,
        sShow: false,
        qShow: false,
        readisable: true,
        fileList: [],
        DisShow: true,
        DioShow: false,
        zhiShow: true,
        zhShow: false,
        UserShow: true,
        Ushow: false,
        restaurants: [],
        state: '',
        userdata: 0,
        disableThree: true,
        disableFour: true,
        disableFive: true,
        runDisable: true,
        warnShow: false,
        warnShowTwo: false,
        warnShowThree: false,
        bedZoneThree: [],
        bedNumberTwo: [],
        reverseMode: [
          { id: 0, name: '请选择' },
          { id: 1, name: '单级反渗' },
          { id: 2, name: '双级反渗' }
        ],
        tabIndex: '',
        deviceMode: [],
        zoneDisabled: false,
        bedid: '',
        unitType: '',
        classShow: false
      }
    },
    methods: {
      changeRun(val) {
        if (val === 1) {
          this.runDisable = true
          this.userform.failure_stage = ''
        }
        if (val === 2) {
          this.runDisable = false
        }
      },

      handleClick(tab, event) {
        // console.log(tab, event)
      },
      handleExceed(file) {
      //  console.log(file)
      },
      handleRemove(file, fileList) {

      },
      beforeRemove(file, fileList) {
      //  console.log(file, fileList)
      },
      handlePreview(file) {
        // console.log(file)
      },
      changetreatmentmode(val) {
        const checkedCount = val.length
        this.checkAll = checkedCount === this.treatmentmode.length
        this.isIndeterminate = checkedCount > 0 && checkedCount < this.treatmentmode.length
      },
      handleCheckAllChange(val) {
        this.form.treat_mode = val ? cityOptions : []
        this.isIndeterminate = false
      },
      handleCheckedCitiesChange(value) {
        const checkedCount = value.length
        this.checkAll = checkedCount === this.cities.length
        this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length
      },

      // 获取所有分区
      getAllSubregion() {
        getAllSubregion().then(response => {
          var zones = response.data.data.zones
          this.deviceType = zones
          var numbers = response.data.data.numbers

          var zone = [{ id: 0, name: '全部' }]
          for (let i = 0; i < zones.length; i++) {
            const item = zones[i]
            zone.push({ id: item.id, name: item.name })
          }
          var devicenumber = response.data.data.devicenumber
          // console.log('devicenumber', devicenumber)
          this.bedZone = zone

          var zoness = [{ id: 0, name: '请选择' }]
          for (let i = 0; i < zones.length; i++) {
            const item = zones[i]
            zoness.push({ id: item.id, name: item.name })
          }

          var bed = [{ id: 0, number: '请选择' }]
          for (let i = 0; i < numbers.length; i++) {
            const item = numbers[i]
            // console.log(item)
            bed.push({ id: item.id, number: item.number })
          }
          this.bedNumberTwo = bed
          this.bedZoneTwo = zones
          this.bedZoneThree = zoness
          this.bedNumber = numbers

          // this.Number = devicenumber
        })
      },

      changeBedNumber(val) {
        this.forms.zone_id = val
        this.getAllMachine()
      },
      changeClassId(val) {
        this.forms.class_id = val
        this.getAllMachine()
      },
      changeDeviceId(val) {
        if (val === 1) {
          this.zoneDisabled = false
        } else {
          this.zoneDisabled = true
        }
        this.forms.device_type = val
        this.getAllMachine()
      },
      getAllMachine() {
        getAllMachine(this.forms.zone_id, this.forms.device_type).then(response => {
          if (response.data.state === 1) {
            var addmahcer = response.data.data.addmahcer
            console.log('查找的数据', addmahcer)
            for(let j=0;j<addmahcer.length;j++){
              if(addmahcer[j].device_type == 1){
                 addmahcer[j].bed_number = addmahcer[j].number
              }
              if(addmahcer[j].device_type == 2){
                 addmahcer[j].bed_number = addmahcer[j].bed_number
              }
               if(addmahcer[j].device_type == 3){
                 addmahcer[j].bed_number = addmahcer[j].bed_number
              }
            }
            this.tableDatatwo = addmahcer
            this.tabIndex = this.$route.query.index
            var id = this.$route.query.id
            for (let i = 0; i < this.tableDatatwo.length; i++) {
              if (this.tableDatatwo[i].id == id) {
                this.$refs.singleTable.setCurrentRow(this.tableDatatwo[i])
                break
              }

            }
            // this.$refs.singleTable.setCurrentRow(this.tableDatatwo[this.tabIndex])
          }
        })
      },
      handleIndex(index) {
        this.tabIndex = index
      },
      handleCurrentChange(val) {
        this.unitType = val.unit_type
        // console.log('val是什么', val)
        this.currentRow = val
        this.$forceUpdate()
        this.getMachineDetailById(val.id)
        this.equimentid = val.id
        this.userdata = val.id
        this.getAllPlanDetail(val.unit_type)
        this.getPatientInfo(val.id)
        // 获取基本信息
        this.getUserRegister(val.id)
        // 病人下机后插入数据
        this.getAutoData(val.id)
        this.getTotalNumber(val.id)
        // this.getTimeWarning(val.id)
        this.getTimeBeteen(val.id)
        this.getData(val.bed_id)
      },
      getAutoData(id) {
        getAutoData(id).then(response => {
          if (response.data.state === 1) {
            var dialysis = response.data.data.dialysis
          }
        })
      },
      getMachineDetailById(id) {
        getMachineDetailById(id).then(response => {
          if (response.data.state === 1) {
            var addmacher = response.data.data.addmacher
            console.log('设备详情', addmacher)
            var warning = response.data.data.warning
            // console.log('warning', warning)
            var time = this.getTimestamp(this.userform.date) - warning.stime
            // console.log('时间', time)
            // if (time < 2678400 && warning.dialysis_checked === 1) {
            //   this.warnShow = false
            // } else {
            //   this.warnShow = true
            // }
            var germ = response.data.data.germ
            // console.log('germ', germ)
            var timetwo = this.getTimestamp(this.userform.date) - germ.stime
            // console.log('时间', timetwo)
            // if (timetwo < 2678400 && germ.germ_checked === 1) {
            //   this.warnShowTwo = false
            // } else {
            //   this.warnShowTwo = true
            // }
            var clean = response.data.data.clean
            var timethree = this.getTimestamp(this.userform.date) - clean.stime
            // console.log('时间', timethree)
            // if (timethree < 2678400 && clean.clean === 1) {
            //   this.warnShowThree = false
            // } else {
            //   this.warnShowThree = true
            // }
            var number = response.data.data.number
            // console.log('number', number)
            this.Number = number
            if (addmacher.device_type === 1) {
              this.sShow = false
              this.qShow = false
              this.tShow = true
              this.DisShow = true
              this.DioShow = false
              this.zhiShow = true
              this.zhShow = false
              this.UserShow = true
              this.Ushow = false
            }
            if (addmacher.device_type === 2) {
              this.tShow = false
              this.qShow = false
              this.sShow = true
              this.DisShow = false
              this.DioShow = true
              this.zhiShow = true
              this.zhShow = false
              this.UserShow = true
              this.Ushow = false
            }

            if (addmacher.device_type === 3) {
              this.tShow = false
              this.sShow = false
              this.qShow = true
              this.DisShow = false
              this.DioShow = true
              this.zhiShow = false
              this.zhShow = true
              this.UserShow = false
              this.Ushow = true
            }
            var mode = response.data.data.mode

            var zone = response.data.data.zone

            const arr1 = []
            //  const cityOptions = ['HD', 'HDF', 'HD+HP', 'HP', 'HF', 'SCUF', 'IUF', 'HFHD+HP', 'HFR', 'HDF+HP', 'GRRT', '腹水回收']
            for (let index = 0; index < mode.length; index++) {
              if (mode[index].treate_mode === 1) {
                mode[index] = 'HD'
              }

              if (mode[index].treate_mode === 2) {
                mode[index] = 'HDF'
              }

              if (mode[index].treate_mode === 3) {
                mode[index] = 'HD+HP'
              }

              if (mode[index].treate_mode === 4) {
                mode[index] = 'HP'
              }

              if (mode[index].treate_mode === 5) {
                mode[index] = 'HF'
              }

              if (mode[index].treate_mode === 6) {
                mode[index] = 'SCUF'
              }

              if (mode[index].treate_mode === 7) {
                mode[index] = 'IUF'
              }

              if (mode[index].treate_mode === 8) {
                mode[index] = 'HFHD'
              }

              if (mode[index].treate_mode === 9) {
                mode[index] = 'HFHD+HP'
              }
              if (mode[index].treate_mode === 10) {
                mode[index] = 'PHF'
              }

              if (mode[index].treate_mode === 11) {
                mode[index] = 'HFR'
              }
              if (mode[index].treate_mode === 12) {
                mode[index] = 'HDF+HP'
              }

              if (mode[index].treate_mode === 13) {
                mode[index] = 'CRRT'
              }

              if (mode[index].treate_mode === 14) {
                mode[index] = '腹水回输'
              }
              arr1.push(mode[index])
            }
            this.form.treat_mode = arr1
            this.form.id = addmacher.id
            this.form.serial_number = addmacher.serial_number
            this.form.devicetype = addmacher.device_type
            this.form.bed_number = addmacher.bed_id
            this.form.bed_numbers = addmacher.bed_number
            this.form.beds = addmacher.bed_number
            this.form.device_name = addmacher.device_name
            this.form.manufacture_factory = addmacher.manufacture_factory
            this.form.service_manufacturer = addmacher.service_manufacturer

            // this.form.unit_type = addmacher.unit_type

            this.form.unit_type = parseInt(addmacher.device_mode)
            this.form.use_section = addmacher.use_section
            this.form.section_number = addmacher.section_number
            if (addmacher.buy_date !== 0) {
              this.form.buy_date = uParseTime(addmacher.buy_date, '{y}-{m}-{d}')
            }
            if (addmacher.install_date !== 0) {
              this.form.install_date = uParseTime(addmacher.install_date, '{y}-{m}-{d}')
            }

            if (addmacher.start_date !== 0) {
              this.form.start_date = uParseTime(addmacher.start_date, '{y}-{m}-{d}')
            }
            this.form.maintenance_engineer = addmacher.maintenace_engineer
            this.form.telephone = addmacher.telephone
            this.form.guarantee_date = addmacher.guarantee_date
            this.form.machine_status = addmacher.machine_status
            this.form.user_total = addmacher.user_total
            this.form.remarks = addmacher.remarks
            // this.form.device_mode = addmacher.device_mode
            if (addmacher.rubbish_date !== 0) {
              this.form.rubbish_date = uParseTime(addmacher.rubbish_date, '{y}-{m}-{d}')
            }

            this.form.rubbish_reason = addmacher.rubbish_reason
            this.form.user_year = addmacher.user_year
            this.form.work_time = addmacher.work_time

            // eslint-disable-next-line eqeqeq
            if (addmacher.disinfection_mode == 0) {
              this.form.Disinfection_mode = 0
            } else {
              this.form.Disinfection_mode = addmacher.disinfection_mode
            }

            // eslint-disable-next-line eqeqeq
            if (addmacher.revers_mode == 0) {
              this.form.revers_mode = 0
            } else {
              this.form.revers_mode = addmacher.revers_mode
            }
            this.getAllSubregion()
          }
        })
      },
      UpdateMachine() {
        this.cancelShow = true
        this.confirmShow = true
        this.disableThree = false
        this.disableFour = false
        this.disableFive = false
      },
      UpdateMachineInfo(formName) {
        const arr2 = []
        this.form.treat_mode.map((item, index) => {
          const obj = {}
          if (item === 'HD') {
            obj.id = 1
          }
          if (item === 'HDF') {
            obj.id = 2
          }
          if (item === 'HD+HP') {
            obj.id = 3
          }
          if (item === 'HP') {
            obj.id = 4
          }
          if (item === 'HF') {
            obj.id = 5
          }
          if (item === 'SCUF') {
            obj.id = 6
          }
          if (item === 'IUF') {
            obj.id = 7
          }
          if (item === 'HFHD') {
            obj.id = 8
          }
          if (item === 'HFHD+HP') {
            obj.id = 9
          }
          if (item === 'PHF') {
            obj.id = 10
          }
          if (item === 'HFR') {
            obj.id = 11
          }
          if (item === 'HDF+HP') {
            obj.id = 12
          }
          if (item === 'CRRT') {
            obj.id = 13
          }
          if (item === '腹水回输') {
            obj.id = 14
          }
          arr2.push(obj.id)
        })

        this.form.treat_type = arr2

        var device_type = this.form.devicetype
        var device_types = parseInt(device_type)
        this.form.devicetype = device_types

        if (this.form.rubbish_reason === '') {
          this.form.rubbish_reason = 0
        }
        var rubbish_reason = this.form.rubbish_reason
        var rubbish_reasons = parseInt(rubbish_reason)
        this.form.rubbish_reason = rubbish_reasons

        var machine_status = this.form.machine_status
        var machine_statuss = parseInt(machine_status)
        this.form.machine_status = machine_statuss

        // if (this.form.bed_number === '') {
        //   this.form.bed_number = 0
        // }

        var bed_numbers = this.form.bed_number
        var bed_numberss = parseInt(bed_numbers)
        this.form.bed_number = bed_numberss
        this.$refs[formName].validate(valid => {
          UpdateMachineInfo(this.form).then(response => {
            // console.log('form', this.form)
            if (response.data.state === 1) {
              var addmacher = response.data.data.addmacher
              // console.log('addmacher----', addmacher)
              this.$message.success('修改成功')
              // this.$router.push({ path: '/device/home?index=' + this.tabIndex })
              for (let i = 0; i < this.tableDatatwo.length; i++) {
                if (this.tableDatatwo[i].id == addmacher.id) {
                  for (let j = 0; j < this.deviceMode.length; j++) {
                    if (this.deviceMode[j].id === parseInt(addmacher.unit_type)) {
                      addmacher.device_mode = this.deviceMode[j].device_mode
                      //   this.$forceUpdate()
                    }
                  }

                  this.tableDatatwo[i] = addmacher
                  // this.$refs.singleTable.setCurrentRow(this.tableDatatwo[i])
                }
              }
              // this.getAllMachine()
              // this.getAllSubregion()
              this.$refs.singleTable.setCurrentRow(addmacher)
              this.$forceUpdate()
            }else{
             this.$message.error("修改失败");
            }
          })
        })
      },

      // eslint-disable-next-line no-irregular-whitespace
      // 更新水处理机
      UpdateMachineInfoTwo(formName) {
        var device_type = this.form.devicetype
        var device_types = parseInt(device_type)
        this.form.devicetype = device_types

        if (this.form.rubbish_reason === '') {
          this.form.rubbish_reason = 0
        }
        var rubbish_reason = this.form.rubbish_reason
        var rubbish_reasons = parseInt(rubbish_reason)
        this.form.rubbish_reason = rubbish_reasons

        var machine_status = this.form.machine_status
        var machine_statuss = parseInt(machine_status)
        this.form.machine_status = machine_statuss

        var revers_mode = this.form.revers_mode
        var revers_modes = parseInt(revers_mode)
        this.form.revers_mode = revers_modes

        var disinfecction_modes = this.form.Disinfection_mode
        var disinfecction_modess = parseInt(disinfecction_modes)
        this.form.Disinfection_mode = disinfecction_modess

        this.$refs[formName].validate(valid => {
          if (valid) {
            UpdateMachineInfoTwo(this.form).then(response => {
              if (response.data.state === 1) {
                // eslint-disable-next-line no-unused-vars
                var addmacher = response.data.data.addmacher
                this.$message.success('修改成功')
                for (let i = 0; i < this.tableDatatwo.length; i++) {
                  if (this.tableDatatwo[i].id == addmacher.id) {
                    for (let j = 0; j < this.deviceMode.length; j++) {
                      if (this.deviceMode[j].id === parseInt(addmacher.unit_type)) {
                        addmacher.device_mode = this.deviceMode[j].device_mode
                      //   this.$forceUpdate()
                      }
                    }

                    this.tableDatatwo[i] = addmacher
                  // this.$refs.singleTable.setCurrentRow(this.tableDatatwo[i])
                  }
                }
                // this.getAllMachine()
                this.getAllSubregion()
                this.$refs.singleTable.setCurrentRow(addmacher)
                this.$forceUpdate()
              }
            })
          }
        })
      },

      UpdateMacheineTwo(formName) {
        var device_type = this.form.devicetype
        var device_types = parseInt(device_type)
        this.form.devicetype = device_types

        if (this.form.rubbish_reason === '') {
          this.form.rubbish_reason = 0
        }
        var rubbish_reason = this.form.rubbish_reason
        var rubbish_reasons = parseInt(rubbish_reason)
        this.form.rubbish_reason = rubbish_reasons

        var machine_status = this.form.machine_status
        var machine_statuss = parseInt(machine_status)
        this.form.machine_status = machine_statuss

        this.$refs[formName].validate(valid => {
          UpdateMacheineTwo(this.form).then(response => {
            if (response.data.state === 1) {
              var addmacher = response.data.data.addmacher
              this.$message.success('修改成功')
              for (let i = 0; i < this.tableDatatwo.length; i++) {
                if (this.tableDatatwo[i].id == addmacher.id) {
                  for (let j = 0; j < this.deviceMode.length; j++) {
                    if (this.deviceMode[j].id === parseInt(addmacher.unit_type)) {
                      addmacher.device_mode = this.deviceMode[j].device_mode
                      //   this.$forceUpdate()
                    }
                  }

                  this.tableDatatwo[i] = addmacher
                  // this.$refs.singleTable.setCurrentRow(this.tableDatatwo[i])
                }
              }
              // this.getAllMachine()
              this.getAllSubregion()
              this.$refs.singleTable.setCurrentRow(addmacher)
              this.$forceUpdate()
            }
          })
        })
      },
      cleanMainchine() {
        this.confirmShow = false
        this.cancelShow = false
        // this.form.manufacture_factory = ""
        // this.form.service_manufacturer= ""
        // this.form.use_section= ""
        // this.form.buy_date= ""
        // this.form.install_date= ""
        // this.form.start_date= ""
        // this.form.maintenance_engineer= ""
        // this.form.telephone= ""
        // this.form.guarantee_date= ""
        // this.form.user_total= ""
        // this.form.rubbish_date= ""
        // this.form.user_year = ""
        // this.form.work_time = ""
        // this.form.treat_mode = ""
      },
      addPlan() {
        this.$refs.planForm.open()
      },
      ToReminders() {
        this.$refs.remanderform.open()
      },
      changeCheck() {
        this.$refs.multipleTableOne.clearSelection()
        if (this.checkAllStatusOne) {
          this.$refs.multipleTableOne.toggleAllSelection()
        }
      },
      handleSelectionChange(val) {
        this.selectMachinesOne = val
      },
      changeCheckOne() {
        this.$refs.multipleTable.clearSelection()
        if (this.checkAllStatus) {
          this.$refs.multipleTable.toggleAllSelection()
        }
      },
      handleSelectionChangeOne(val) {
        this.selectMachines = val
      },
      changeMachineStatus(val) {
        if (val === 4) {
          this.readisable = false
        } else {
          this.readisable = true
          this.form.rubbish_date = ''
          this.form.rubbish_reason = ''
        }
      },
      getAllPlan() {
        getAllPlan().then(response => {
          if (response.data.state === 1) {
            var plan = response.data.data.plan

            for (let index = 0; index < plan.length; index++) {
              if (plan[index].time === 1) {
                plan[index].time = '周一'
              }

              if (plan[index].time === 2) {
                plan[index].time = '周二'
              }

              if (plan[index].time === 3) {
                plan[index].time = '周三'
              }

              if (plan[index].time === 4) {
                plan[index].time = '周四'
              }
              if (plan[index].time === 5) {
                plan[index].time = '周五'
              }
              if (plan[index].time === 6) {
                plan[index].time = '周六'
              }
              if (plan[index].time === 7) {
                plan[index].time = '周日'
              }

              if (plan[index].classtime === 1) {
                plan[index].classtime = '上午'
              }
              if (plan[index].classtime === 2) {
                plan[index].classtime = '下午'
              }
              if (plan[index].classtime === 3) {
                plan[index].classtime = '晚上'
              }

              if (plan[index].way === 0) {
                plan[index].way = '/'
              }

              if (plan[index].way === 1) {
                plan[index].way = '擦拭'
              }
              if (plan[index].way === 2) {
                plan[index].way = '化学消毒'
              }

              if (plan[index].machine_disinfectant === 0) {
                plan[index].machine_disinfectant = '/'
              }

              if (plan[index].machine_disinfectant === 1) {
                plan[index].machine_disinfectant = '0.22%季铵盐'
              }

              if (plan[index].machine_disinfectant === 2) {
                plan[index].machine_disinfectant = '500mg/l含氯消毒剂'
              }
              if (plan[index].machine_disinfectantant === 3) {
                plan[index].machine_disinfectant = '1000mg/l含氯消毒剂'
              }
              if (plan[index].machine_disinfectant === 4) {
                plan[index].machine_disinfectant = '1500mg/l含氯消毒剂'
              }

              if (plan[index].disinfectan_way === 0) {
                plan[index].disinfectan_way = '/'
              }

              if (plan[index].disinfectan_way === 1) {
                plan[index].disinfectan_way = '热化学消毒'
              }

              if (plan[index].disinfectan_way === 2) {
                plan[index].disinfectan_way = '化学消毒 + 除钙'
              }
              if (plan[index].disinfectan_way === 3) {
                plan[index].disinfectan_way = '热化学消毒 + 除钙'
              }

              if (plan[index].disinfectan_way === 4) {
                plan[index].disinfectan_way = '热消毒'
              }
              if (plan[index].disinfectan_way === 5) {
                plan[index].disinfectan_way = '化学消毒'
              }
              if (plan[index].disinfectan_way === 6) {
                plan[index].disinfectan_way = '除钙'
              }
              if (plan[index].disinfectan_way === 7) {
                plan[index].disinfectan_way = '清洗'
              }

              if (plan[index].disinfectant === 0) {
                plan[index].disinfectant = '/'
              }

              if (plan[index].disinfectant === 1) {
                plan[index].disinfectant = '20%柠檬酸'
              }
              if (plan[index].disinfectant === 2) {
                plan[index].disinfectant = '25%柠檬酸'
              }
              if (plan[index].disinfectant === 3) {
                plan[index].disinfectant = '50%柠檬酸'
              }
              if (plan[index].disinfectant === 4) {
                plan[index].disinfectant = '50%柠檬酸 + 5%次氯酸钠'
              }
              if (plan[index].disinfectant === 5) {
                plan[index].disinfectant = '20%柠檬酸 + 10%冰醋酸'
              }
              if (plan[index].disinfectant === 6) {
                plan[index].disinfectant = '0.2%过氧化乙酸'
              }
              if (plan[index].disinfectant === 7) {
                plan[index].disinfectant = '10%冰醋酸'
              }
              if (plan[index].disinfectant === 8) {
                plan[index].disinfectant = '50%冰醋酸'
              }
              if (plan[index].disinfectant === 9) {
                plan[index].disinfectant = '5%次氯酸钠'
              }
            }
            this.tableData = plan
          }
        })
      },
      getAllPlanDetail(unit_type) {
        getAllPlanDetail(unit_type).then(response => {
          if (response.data.state === 1) {
            var plandetail = response.data.data.plandetail
            // console.log('plandetail', plandetail)
            for (let index = 0; index < plandetail.length; index++) {
              if (plandetail[index].time === 1) {
                plandetail[index].time = '周一'
              }

              if (plandetail[index].time === 2) {
                plandetail[index].time = '周二'
              }

              if (plandetail[index].time === 3) {
                plandetail[index].time = '周三'
              }

              if (plandetail[index].time === 4) {
                plandetail[index].time = '周四'
              }
              if (plandetail[index].time === 5) {
                plandetail[index].time = '周五'
              }
              if (plandetail[index].time === 6) {
                plandetail[index].time = '周六'
              }
              if (plandetail[index].time === 7) {
                plandetail[index].time = '周日'
              }

              if (plandetail[index].classtime === 1) {
                plandetail[index].classtime = '上午'
              }
              if (plandetail[index].classtime === 2) {
                plandetail[index].classtime = '下午'
              }
              if (plandetail[index].classtime === 3) {
                plandetail[index].classtime = '晚上'
              }

              if (plandetail[index].way === 0) {
                plandetail[index].way = '/'
              }

              if (plandetail[index].way === 1) {
                plandetail[index].way = '擦拭'
              }
              if (plandetail[index].way === 2) {
                plandetail[index].way = '化学消毒'
              }

              if (plandetail[index].machine_disinfectant === 0) {
                plandetail[index].machine_disinfectant = '/'
              }

              if (plandetail[index].machine_disinfectant === 1) {
                plandetail[index].machine_disinfectant = '0.22%季铵盐'
              }

              if (plandetail[index].machine_disinfectant === 2) {
                plandetail[index].machine_disinfectant = '500mg/l含氯消毒剂'
              }
              if (plandetail[index].machine_disinfectantant === 3) {
                plandetail[index].machine_disinfectant = '1000mg/l含氯消毒剂'
              }
              if (plandetail[index].machine_disinfectant === 4) {
                plandetail[index].machine_disinfectant = '1500mg/l含氯消毒剂'
              }

              if (plandetail[index].disinfectan_way === 0) {
                plandetail[index].disinfectan_way = '/'
              }

              if (plandetail[index].disinfectan_way === 1) {
                plandetail[index].disinfectan_way = '热化学消毒'
              }

              if (plandetail[index].disinfectan_way === 2) {
                plandetail[index].disinfectan_way = '化学消毒 + 除钙'
              }
              if (plandetail[index].disinfectan_way === 3) {
                plandetail[index].disinfectan_way = '热化学消毒 + 除钙'
              }

              if (plandetail[index].disinfectan_way === 4) {
                plandetail[index].disinfectan_way = '热消毒'
              }
              if (plandetail[index].disinfectan_way === 5) {
                plandetail[index].disinfectan_way = '化学消毒'
              }
              if (plandetail[index].disinfectan_way === 6) {
                plandetail[index].disinfectan_way = '除钙'
              }
              if (plandetail[index].disinfectan_way === 7) {
                plandetail[index].disinfectan_way = '清洗'
              }

              if (plandetail[index].disinfectant === 0) {
                plandetail[index].disinfectant = '/'
              }

              if (plandetail[index].disinfectant === 1) {
                plandetail[index].disinfectant = '20%柠檬酸'
              }
              if (plandetail[index].disinfectant === 2) {
                plandetail[index].disinfectant = '25%柠檬酸'
              }
              if (plandetail[index].disinfectant === 3) {
                plandetail[index].disinfectant = '50%柠檬酸'
              }
              if (plandetail[index].disinfectant === 4) {
                plandetail[index].disinfectant = '50%柠檬酸 + 5%次氯酸钠'
              }
              if (plandetail[index].disinfectant === 5) {
                plandetail[index].disinfectant = '20%柠檬酸 + 10%冰醋酸'
              }
              if (plandetail[index].disinfectant === 6) {
                plandetail[index].disinfectant = '0.2%过氧化乙酸'
              }
              if (plandetail[index].disinfectant === 7) {
                plandetail[index].disinfectant = '10%冰醋酸'
              }
              if (plandetail[index].disinfectant === 8) {
                plandetail[index].disinfectant = '50%冰醋酸'
              }
              if (plandetail[index].disinfectant === 9) {
                plandetail[index].disinfectant = '5%次氯酸钠'
              }
            }
            this.planData = plandetail
          }
        })
      },
      EditMachine(id, index) {
        this.dialogVisible = true
        EditPlanDetail(id).then(response => {
          if (response.data.state === 1) {
            var plan = response.data.data.plan
            this.machineform.id = plan.id
            this.machineform.device_type = plan.device_type
            this.machineform.disinfec_time = plan.disinfec_time
            this.machineform.time = plan.time
            this.machineform.class_time = plan.classtime
            this.machineform.way = plan.way
            this.machineform.machine_disinfectant = plan.machine_disinfectant
            this.machineform.disinfectant_way = plan.disinfectan_way
            this.machineform.disinfectant = plan.disinfectant
           // this.getPatientDetail(this.unitType, this.$route.query.bedid)
          }
        })
      },
      UpdatePlanInfo(formName) {
        var devicetype = this.machineform.device_type
        var devicetypes = parseInt(devicetype)
        this.machineform.device_type = devicetypes

        if (this.machineform.disinfec_time === '') {
          this.machineform.disinfec_time = ''
        }
        if (this.machineform.disinfec_time !== '') {
          var disinfectimes = this.machineform.disinfec_time
          var disinfectime = parseInt(disinfectimes)
          this.machineform.disinfec_time = disinfectime
        }

        var times = this.machineform.time
        var time = parseInt(times)
        this.machineform.time = time

        var classtimes = this.machineform.class_time
        var classtime = parseInt(classtimes)
        this.machineform.class_time = classtime

        var ways = this.machineform.way
        var way = parseInt(ways)
        this.machineform.way = way

        var machinedisinfectant = this.machineform.machine_disinfectant
        var machinedisinfectants = parseInt(machinedisinfectant)
        this.machineform.machine_disinfectant = machinedisinfectants

        var disinfectantways = this.machineform.disinfectant_way
        var disinfectantway = parseInt(disinfectantways)
        this.machineform.disinfectant_way = disinfectantway

        var disinfectants = this.machineform.disinfectant
        var disinfectant = parseInt(disinfectants)
        this.machineform.disinfectant = disinfectant
        UpdatePlanInfo(this.machineform).then(response => {
          if (response.data.state === 1) {
            var plan = response.data.data.plan
            this.dialogVisible = false
            this.$message.success('修改成功')
            this.getAllPlanDetail(this.unitType)
            this.getAllPlan()
          }
        })
      },
      openDeleteMahcine() {
        if (this.selectMachines.length == 0) {
          this.$message.error('请选择要删除的信息')
          return false
        }
        this.$confirm(
          '确认要删除所选记录吗? <br>删除后,信息将无法恢复',
          '删除提示',
          {
            dangerouslyUseHTMLString: true,
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }
        )
          .then(() => {
            var ids = []
            var idMap = {}
            for (const index in this.selectMachines) {
              ids.push(this.selectMachines[index].id)
              idMap[this.selectMachines[index].id] = this.selectMachines[
                index
              ].id
            }

            DeletePlans({ ids: ids }).then(response => {
              // eslint-disable-next-line eqeqeq
              if (response.data.state == 1) {
                // eslint-disable-next-line no-unused-vars
                var msg = response.data.data.msg
                var planDataLength = this.planData.length
                for (let index = planDataLength - 1; index >= 0; index--) {
                  if (this.planData[index].id in idMap) {
                    this.planData.splice(index, 1)
                  }
                }
                var planDataLengths = this.tableData.length
                for (let index = planDataLengths - 1; index >= 0; index--) {
                  if (this.tableData[index].id in idMap) {
                    this.tableData.splice(index, 1)
                  }
                }
                this.$message.success('删除消毒计划成功')
              } else {
                this.$message.error('删除消毒计划失败')
              }
            })
              .catch(e => {})
          })
          .catch(() => {
            return false
          })
      },
      openDelete(id, index) {
        // eslint-disable-next-line no-undef
        this.$confirm(
          '确认要删除所选记录吗? <br>删除后,信息将无法恢复',
          '删除提示',
          {
            dangerouslyUseHTMLString: true,
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }
        ).then(() => {
          openDelete(id, index).then(response => {
            if (response.data.state === 1) {
              var msg = response.data.data.msg
              this.tableData.splice(index, 1)
              this.planData.splice(index, 1)
            }
          })
        })
      },
      openDeleteMahcineOne() {
        if (this.selectMachinesOne.length == 0) {
          this.$message.error('请选择要删除的信息')
          return false
        }
        this.$confirm(
          '确认要删除所选记录吗? <br>删除后,信息将无法恢复',
          '删除提示',
          {
            dangerouslyUseHTMLString: true,
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }
        )
          .then(() => {
            var ids = []
            var idMap = {}
            for (const index in this.selectMachinesOne) {
              ids.push(this.selectMachinesOne[index].id)
              idMap[this.selectMachinesOne[index].id] = this.selectMachinesOne[
                index
              ].id
            }

            DeletePlans({ ids: ids })
              .then(response => {
                if (response.data.state == 1) {
                  var msg = response.data.data.msg

                  var planDataLength = this.tableData.length
                  for (let index = planDataLength - 1; index >= 0; index--) {
                    if (this.tableData[index].id in idMap) {
                      this.tableData.splice(index, 1)
                    }
                  }
                  var planDataLengths = this.planData.length
                  for (let index = planDataLengths - 1; index >= 0; index--) {
                    if (this.planData[index].id in idMap) {
                      this.planData.splice(index, 1)
                    }
                  }
                  this.$message.success('删除消毒计划成功')
                } else {
                  this.$message.error('删除消毒计划失败')
                }
              })
              .catch(e => {})
          })
          .catch(() => {
            return false
          })
      },
      getAllEquimentName() {
        getAllEquimentName().then(response => {
          if (response.data.state === 1) {
            var equit = response.data.data.equit
            // this.DeviceType = equit
          }
        })
      },
      clickQuery() {
        this.$refs.multipleform.open()
      },
      getPatientInfo(bedid) {
        getPatientInfo(bedid).then(response => {
          if (response.data.state === 1) {
            var schedules = response.data.data.schedules
            // this.patientName = schedules
          }
        })
      },
      ChangeClass(id) {
        ChangeClass(this.equimentid, id).then(response => {
          if (response.data.state === 1) {
            var patients = response.data.data.patients

            if (patients.is_infectious === 0) {
              this.userform.contagion = ''
            }
            if (patients.is_infectious === 1) {
              this.userform.contagion = '无'
            }
            if (patients.is_infectious === 2) {
              this.userform.contagion = '有'
            }
            this.userform.date = uParseTime(patients.schedule_date, '{y}-{m}-{d}')
            this.userform.patient_name = patients.name
            this.userform.patient_id = patients.patient_id
            // this.userform.patient_name = patients.name
            var zone = response.data.data.zone
            // console.log('zone==========', zone)
            this.userform.zone = zone.id
            var number = response.data.data.number
            // console.log('nubmer', number)
            this.userform.bed_number = number.id
            // this.userform.bed_number = number.number
            var order = response.data.data.order
            this.userform.start_time = uParseTime(order.start_time, '{y}-{m}-{d} {h}:{i}')
            this.userform.end_time = uParseTime(order.end_time, '{y}-{m}-{d} {h}:{i}')
            var prescription = response.data.data.prescription
            this.userform.dialysis_mode = prescription.mode_id
            var dislysis = response.data.data.dislysis
            this.userform.dialysis_time = dislysis.actual_treatment_hour + 'h' + dislysis.actual_treatment_minute + 'min'
            this.userform.hyperfiltratio = dislysis.actual_ultrafiltration
            this.userform.weight_loss = dislysis.weight_loss
          }
        })
      },
      updateTimes(time) {
        if (time < 0) {
          return ''
        } else {
          return uParseTime(time, '{y}-{m}-{d} {h}:{i}')
        }
      },
      getTimes(time) {
        return uParseTime(time, '{y}-{m}-{d} {h}:{i}')
      },
      getTime(time) {
        return uParseTime(time, '{y}-{m}-{d}')
      },

      SaveInformation(formName) {
        if (this.userform.classtype === '') {
          this.userform.classtype = 0
        }
        var classtypes = this.userform.classtype
        var classtype = parseInt(classtypes)
        this.userform.classtype = classtype

        var zone = this.userform.zone
        var zones = parseInt(zone)
        this.userform.zone = zones

        var bednumber = this.userform.bed_number
        var bednumbers = parseInt(bednumber)
        this.userform.bed_number = bednumbers

        // var patientName = this.userform.patient_name
        // var patient_name = parseInt(patientName)
        // this.userform.patient_name = patient_name
        var dialysismode = this.userform.dialysis_mode
        var dialysis_mode = parseInt(dialysismode)
        this.userform.dialysis_mode = dialysis_mode

        if (this.userform.failure_stage === '') {
          this.userform.failure_stage = 0
        }

        if (this.userform.dialysis_checked === '') {
          this.userform.dialysis_checked = 0
        }

        if (this.userform.dialysis_checked === true) {
          this.userform.dialysis_checked = 1
        }

        if (this.userform.dialysis_checked === false) {
          this.userform.dialysis_checked = 2
        }

        if (this.userform.germ_checked === '') {
          this.userform.germ_checked = 0
        }

        if (this.userform.germ_checked === true) {
          this.userform.germ_checked = 1
        }
        if (this.userform.germ_checked === false) {
          this.userform.germ_checked = 2
        }

        if (this.userform.dialysis_name === '') {
          this.userform.dialysis_name = 0
        }
        var dialysis_name = this.userform.dialysis_name
        var dialysis = parseInt(dialysis_name)
        this.userform.dialysis_name = dialysis

        if (this.userform.germ_name === '') {
          this.userform.germ_name = 0
        }
        var germname = this.userform.germ_name
        var germames = parseInt(germname)
        this.userform.germ_name = germames

        if (this.userform.clean === '') {
          this.userform.clean = 0
        }

        if (this.userform.clean === true) {
          this.userform.clean = 1
        }

        if (this.userform.clean === false) {
          this.userform.clean = 2
        }

        // eslint-disable-next-line eqeqeq
        if (this.userform.start_time == '') {
          this.userform.start_time = '0'
        }
        // eslint-disable-next-line eqeqeq
        if (this.userform.end_time == '') {
          this.userform.end_time = '0'
        }

        // eslint-disable-next-line eqeqeq
        if (this.userform.starttime == '') {
          this.userform.starttime = '0'
        }
        // eslint-disable-next-line eqeqeq
        if (this.userform.endtime == '') {
          this.userform.endtime = '0'
        }

        if (this.userform.hyperfiltratio === '') {
          this.userform.hyperfiltratio = 0
        }
        var hyperfiltratio = this.userform.hyperfiltratio
        var hyperfiltratios = parseInt(hyperfiltratio)
        this.userform.hyperfiltratio = hyperfiltratios

        if (this.userform.weight_loss === '') {
          this.userform.weight_loss = 0
        }
        var weightloss = this.userform.weight_loss
        var weidht = parseInt(weightloss)
        this.userform.weight_loss = weidht

        if (this.userform.user_total === '0') {
          this.userform.user_total = 0
        }
        // console.log('上机时间', this.userform.start_time)
        // console.log('下机时间', this.userform.end_time)
        this.$refs[formName].validate((valid) => {
          if (valid) {
            SaveInformation(this.equimentid, this.userform).then(response => {
              if (response.data.state === 1) {
                // eslint-disable-next-line no-unused-vars
                var information = response.data.data.information
                var infor = response.data.data.infor
                this.userform.start_time = ''
                this.userform.end_time = ''
                this.userform.starttime = ''
                this.userform.endtime = ''
                this.userform.date = ''
                this.userform.classtype = ''
                this.userform.zone = ''
                this.userform.patient_name = ''
                this.userform.sign_name = ''
                this.userform.bed_number = ''
                this.userform.hyperfiltratio = ''
                this.userform.weight_loss = ''
                this.userform.dialysis_time = ''
                this.$message.success('添加成功')
                // this.$refs.child.getInformationData()
              }
            })
          }
        })
      },
      toLink() {
        window.location.href = this.guaForm.images
      },
      // changStartTime(val) {
      //   this.userform.starttime = val
      // },
      // changeEndTime(val) {
      //   this.userform.endtime = val
      //   console.log('val', val)
      //   console.log('开始时间', this.userform.starttime)
      //   console.log('呵呵', this.formatDuring(val))
      // },
      // formatDuring(mss) {
      //   const days = parseInt(mss / (1000 * 60 * 60 * 24)) // 得到天数
      //   const hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)) // 得到小时
      //   const minutes = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60)) // 得到分钟数
      //   const seconds = (mss % (1000 * 60)) / 1000 // 得到秒数
      //   const str1 = hours < 10 ? ('0' + hours) : hours
      //   console.log('str1', str1)
      //   const str2 = minutes < 10 ? ('0' + minutes) : minutes
      //   return str1 + ':' + str2
      // },
      // 获取签名
      getAllOrganization() {
        getAllOrganization().then(response => {
          if (response.data.state === 1) {
            var approle = response.data.data.approle
            // console.log('approle签名',approle)
            this.autograph = approle
            this.sampling = approle
          }
        })
      },
      getUserRegister(id) {
        getUserRegister(id).then(response => {
          if (response.data.state === 1) {
            var information = response.data.data.information
             console.log('产讯使用登记', information)
            // eslint-disable-next-line no-unused-vars
            var role = response.data.data.role
            // console.log('role', role)
            // eslint-disable-next-line eqeqeq
            var dislysis = response.data.data.dislysis

            this.userform.id = information.id
            if (information.date === 0) {
              this.userform.date = moment(new Date()).format('YYYY-MM-DD')
            } else {
              this.userform.date = uParseTime(information.date, '{y}-{m}-{d}')
            }

            this.userform.classtype = information.class
            this.userform.zone = information.zone
            this.userform.bed_number = information.bed_number
            this.userform.patient_name = information.name
            this.userform.patient_id = information.patient_id
            this.userform.contagion = information.contagion
            this.userform.dialysis_mode = information.dialysis_mode
            this.userform.start_time = this.updateTimes(information.start_time)
            // this.userform.start_time = uParseTime(information.start_time, '{y}-{m}-{d} {h}:{i}')
            this.userform.end_time = this.updateTimes(information.end_time)
            // this.userform.end_time = uParseTime(information.end_time, '{y}-{m}-{d} {h}:{i}')
            // this.userform.dialysis_time = information.dialysis_hour
            // this.userform.hyperfiltratio = information.hyperfiltratio
            // this.userform.weight_loss = information.weight_loss
            if (information.hyperfiltratio === '') {
              this.userform.hyperfiltratio = dislysis.actual_ultrafiltration
            } else {
              this.userform.hyperfiltratio = information.hyperfiltratio
            }
            if (information.dialysis_hour === '') {
              this.userform.dialysis_time = dislysis.actual_treatment_hour + 'h' + dislysis.actual_treatment_minute + 'min'
            } else {
              this.userform.dialysis_time = information.dialysis_hour
            }
            // this.userform.dialysis_time = dislysis.actual_treatment_hour + 'h' + dislysis.actual_treatment_minute + 'min'
            // this.userform.hyperfiltratio = dislysis.actual_ultrafiltration
            if (information.weight_loss === '') {
              this.userform.weight_loss = dislysis.weight_loss
            } else {
              this.userform.weight_loss = information.weight_loss
            }

            // this.userform.weight_loss = dislysis.weight_loss
            this.userform.warning_value = information.warning_value
            this.userform.user_total = information.user_total
            if (information.move === 0) {
              this.userform.run = 1
            } else {
              this.userform.run = information.move
            }
            this.userform.failure_stage = information.failure_stage
            this.userform.fault_description = information.fault_description
            this.userform.code_information = information.code_information
            this.userform.disinfect_type = information.disinfect_type
            this.userform.disinfection = information.disinfection
            this.userform.machine_run = information.machine_run
            this.userform.fluid_path = information.fluid_path
            this.userform.disinfectant = information.disinfectant
            this.userform.disinfection_status = information.disinfection_status
            this.userform.disinfection_residue = information.disinfection_residue
            this.userform.longtime = information.long_time
            this.userform.starttime = this.updateTimes(information.disinfec_startime)
            this.userform.endtime = this.updateTimes(information.disinfec_endtime)
            // this.userform.starttime = uParseTime(information.disinfec_startime, '{y}-{m}-{d} {h}:{i}')
            // this.userform.endtime = uParseTime(information.disinfec_endtime, '{y}-{m}-{d} {h}:{i}')

            if (information.dialysis_checked === 1) {
              this.userform.dialysis_checked = true
            }

            if (information.dialysis_checked === 0) {
              this.userform.dialysis_checked = false
            }

            if (information.dialysis_checked === 2) {
              this.userform.dialysis_checked = false
            }

            this.userform.dialysis_name = information.dialysis_name
            this.userform.norms = information.norms
            this.userform.dialysis_concentration = information.dialysis_concentration

            if (information.germ_checked === 0) {
              this.userform.germ_checked = false
            }

            if (information.germ_checked === 2) {
              this.userform.germ_checked = false
            }

            if (information.germ_checked === 1) {
              this.userform.germ_checked = true
            }

            this.userform.germ_name = information.germ_name
            this.userform.germ_number = information.germ_number
            if (information.clean === 1) {
              this.userform.clean = true
            }
            if (information.clean === 0) {
              this.userform.clean = false
            }

            if (information.clean === 2) {
              this.userform.clean = false
            }
            // eslint-disable-next-line eqeqeq
            if (information.admin_user_id == 0) {
              this.userform.sign_name = ''
            } else {
              this.userform.sign_name = information.admin_user_id
            }
            this.$forceUpdate()
          }
        })
      },
      getOrgName() {
        getOrgName().then(response => {
          if (response.data.state === 1) {
            var org = response.data.data.org
            this.qualityForm.detection_unit = org.org_name
            this.qualityFormTwo.detection_unit = org.org_name
            this.qualityFormThree.detection_unit = org.org_name
          }
        })
      },
      SaveBacteria(formName) {
        if (this.qualityForm.specimen === '') {
          this.qualityForm.specimen = 0
        }
        var specimen = this.qualityForm.specimen
        var specimens = parseInt(specimen)
        this.qualityForm.specimen = specimens

        if (this.qualityForm.sampling_locationa === '') {
          this.qualityForm.sampling_locationa = 0
        }
        var samplinglocationa = this.qualityForm.sampling_locationa
        var samplinglocationas = parseInt(samplinglocationa)
        this.qualityForm.sampling_locationa = samplinglocationas
        this.$refs[formName].validate(response => {
          SaveBacteria(this.equimentid, this.qualityForm).then(response => {
            if (response.data.state === 1) {
              var culture = response.data.data.culture
              this.$message.success('保存成功')
              this.qualityForm.specimen = '',
              this.qualityForm.concentrate_noa = '',
              this.qualityForm.concentrate_nob = '',
              this.qualityForm.sampling_locationa = '',
              this.qualityForm.sampler = ''
              this.qualityForm.reporting_date = ''
              this.qualityForm.detection_result = ''
              this.$refs.child.getAllQulityInfo()
            }
          })
        })
      },
      cleanSaveBacteria() {
        this.qualityForm.specimen = '',
        this.qualityForm.concentrate_noa = '',
        this.qualityForm.concentrate_nob = '',
        this.qualityForm.sampling_locationa = '',
        this.qualityForm.sampler = ''
        this.qualityForm.reporting_date = ''
        this.qualityForm.detection_result = ''
      },
      SaveLincomycin(formName) {
        this.$refs[formName].validate((valid) => {
          if (this.qualityFormTwo.specimenb === '') {
            this.qualityFormTwo.specimenb = 0
          }

          var specimen = this.qualityFormTwo.specimenb
          var specimenb = parseInt(specimen)
          this.qualityFormTwo.specimenb = specimenb

          if (this.qualityFormTwo.sampling_locationb === '') {
            this.qualityFormTwo.sampling_locationb = 0
          }
          var sampling = this.qualityFormTwo.sampling_locationb
          var samplings = parseInt(sampling)
          this.qualityFormTwo.sampling_locationb = samplings
          if (valid) {
            SaveLincomycin(this.equimentid, this.qualityFormTwo).then(response => {
              if (response.data.state === 1) {
                var dialysate = response.data.data.dialysate

                this.$message.success('保存成功')
                this.qualityFormTwo.specimenb = ''
                this.qualityFormTwo.concentrate_noc = ''
                this.qualityFormTwo.concentrateb_nod = ''
                this.qualityFormTwo.sampling_locationb = ''
                this.qualityFormTwo.samplerb = ''
                this.qualityFormTwo.reporting_dateb = ''
                this.qualityFormTwo.detection_resultb = ''
                this.$refs.child.getAllQulityInfo()
              }
            })
          }
        })
      },
      cleanLincomycin() {
        this.qualityFormTwo.specimenb = ''
        this.qualityFormTwo.concentrate_noc = ''
        this.qualityFormTwo.concentrateb_nod = ''
        this.qualityFormTwo.sampling_locationb = ''
        this.qualityFormTwo.samplerb = ''
        this.qualityFormTwo.reporting_dateb = ''
        this.qualityFormTwo.detection_resultb = ''
      },
      SaveQualityControl(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            SaveQualityControl(this.equimentid, this.qualityFormThree).then(response => {
              if (response.data.state === 1) {
                var ion = response.data.data.ion
                // console.log('ion', ion)
                this.$message.success('保存成功')
                this.$refs.child.getAllQulityInfo()
                this.qualityFormThree.samplerc = ''
                this.qualityFormThree.concentrate_nof = ''
                this.qualityFormThree.concentrate_nog = ''
                this.qualityFormThree.date_reportc = ''
                this.qualityFormThree.actual_na = ''
                this.qualityFormThree.actual_pna = ''
                this.qualityFormThree.actual_k = ''
                this.qualityFormThree.actual_ca = ''
                this.qualityFormThree.actual_ci = ''
                this.qualityFormThree.actual_hco = ''
                this.qualityFormThree.actual_mg = ''
                this.qualityFormThree.actual_ph = ''
                this.qualityFormThree.remakes = ''
              }
            })
          }
        })
      },
      cleanQuality() {
        this.qualityFormThree.samplerc = ''
        this.qualityFormThree.concentrate_nof = ''
        this.qualityFormThree.concentrate_nog = ''
        this.qualityFormThree.date_reportc = ''
        this.qualityFormThree.actual_na = ''
        this.qualityFormThree.actual_pna = ''
        this.qualityFormThree.actual_k = ''
        this.qualityFormThree.actual_ca = ''
        this.qualityFormThree.actual_ci = ''
        this.qualityFormThree.actual_hco = ''
        this.qualityFormThree.actual_mg = ''
        this.qualityFormThree.actual_ph = ''
        this.qualityFormThree.remakes = ''
      },

      changeSpecimen(val) {
        if (val === 0) {
          this.disable = false
          this.diableTwo = false
        }
        if (val === 1) {
          this.disable = false
          this.diableTwo = false
        }
        if (val === 2) {
          this.qualityForm.concentrate_nob = ''
          this.qualityFormTwo.concentrateb_nod = ''
          this.diableTwo = true
          this.disable = false
        }
        if (val === 3) {
          this.qualityForm.concentrate_noa = ''
          this.qualityFormTwo.concentrate_noc = ''
          this.disable = true
          this.diableTwo = false
        }
        if (val === 4) {
          this.disable = false
          this.diableTwo = false
        }
        if (val === 5) {
          this.disable = false
          this.diableTwo = false
        }
      },
      beforeUploadFile(file) {
        var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
        const extension = testmsg === 'jpg' || testmsg === 'JPG' || testmsg === 'png' || testmsg === 'PNG' || testmsg === 'gif' || testmsg === 'GIF'
    	if (!extension) {
      					// eslint-disable-next-line no-mixed-spaces-and-tabs
      					this.$message({
      						// eslint-disable-next-line no-mixed-spaces-and-tabs
      						message: '上传文件只能是jpg或者png或者gif格式!',
      						type: 'error'
          })
          return false// 必须加上return false; 才能阻止
        }
        this.filename = file.name
        this.classShow = true
        this.guaForm.imageName = file.name
        const isLt2M = file.size / 1024 / 1024 <= 2048
        var date = new Date()
        var ext = getFileExtension(file.name)
        var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours() + date.getMinutes() + date.getSeconds() + '_o_' + file.uid + '.' + ext
        const _self = this
        return new Promise((resolve, reject) => {
          getToken().then(response => {
            const token = response.data.data.uptoken
            console.log('token', token)
            _self._data.uploadFileData.token = token
            _self._data.uploadFileData.key = key
            resolve(true)
          // eslint-disable-next-line handle-callback-err
          }).catch(err => {
            reject(false)
          })
        })
      },
      handleSuccess(res, file, fileList) {
        this.guaForm.images = this.qiniuDomain + res.url
        console.log('图片路径', this.guaForm.images)
        this.$refs.upload.clearFiles()
        this.filename = file.name
        this.guaForm.imageName = file.name
      },
      // eslint-disable-next-line no-dupe-keys
      getTime(value, temp) {
        // eslint-disable-next-line eqeqeq
        if (value != undefined) {
          return parseTime(value, temp)
        }
        return ''
      },
      SaveRepair(formName) {
        if (this.guaForm.start_time === '') {
          this.guaForm.start_time = '0'
        }

        if (this.guaForm.arrive_time === '') {
          this.guaForm.arrive_time = '0'
        }

        if (this.guaForm.finish_time === '') {
          this.guaForm.finish_time = '0'
        }

        if (this.guaForm.failure_stage === '') {
          this.guaForm.failure_stage = '0'
        }

        var failurestages = this.guaForm.failure_stage
        var falur = parseInt(failurestages)
        this.guaForm.failure_stage = falur

        if (this.guaForm.exclude === '') {
          this.guaForm.exclude = 0
        }
        var excludes = this.guaForm.exclude
        var exclude = parseInt(excludes)
        this.guaForm.exclude = exclude
        this.$refs[formName].validate((valid) => {
          if (valid) {
            SaveRepair(this.equimentid, this.guaForm).then(response => {
              if (response.data.state === 1) {
                var repair = response.data.data.repair
                // console.log('reqair', repair)
                this.$message.success('保存成功')
                this.$refs.child.getAllRepair()
                this.guaForm.start_time = ''
                this.guaForm.arrive_time = ''
                this.guaForm.finish_time = ''
                this.guaForm.total_distance = ''
                this.guaForm.code_information = ''
                this.guaForm.fault_description = ''
                this.guaForm.cause_analysis = ''
                this.guaForm.reason = ''
                this.guaForm.failure_stage = 0
                this.guaForm.exclude = 0
                this.guaForm.images = ''
                this.guaForm.treatment_process = ''
                this.classShow = false
                this.guaForm.imageName = ''
              }
            })
          }
        })
      },

      querySearchAsync(keyword, cb) {
        let key = ''
        if (keyword != undefined) {
          key = keyword
        }
        let searchArray = []
        PostSearch(key).then(response => {
          if (response.data.state == 1) {
            searchArray = response.data.data.patient
            // console.log("ser",searchArray)

            cb(searchArray)
          }
        })

        return searchArray
      },
      createFilter(queryString) {
        return (searchArray) => {
          return (searchArray.id.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
        }
      },
      handleSelect(item) {
        this.userform.patient_id = item.id
        this.userform.patient_name = item.name
        // eslint-disable-next-line no-undef
        getPatientDetail(item.id).then(response => {
          // eslint-disable-next-line eqeqeq
          if (response.data.state == 1) {
            var patient = response.data.data.patient
            // console.log('patient', patient)
            // eslint-disable-next-line no-undef
            if (patient.is_infectious === 0) {
              this.userform.contagion = ''
            }
            // eslint-disable-next-line no-undef
            if (patient.is_infectious === 1) {
              this.userform.contagion = '无'
            }
            // eslint-disable-next-line no-undef
            if (patient.is_infectious === 2) {
              this.userform.contagion = '有'
            }
          }
        })
      },
      getAllEquitType() {
        getAllEquitType().then(response => {
          if (response.data.state === 1) {
            var equitname = response.data.data.mode
            this.DeviceType = equitname
          }
        })
      },
      getTotalNumber() {
        getTotalNumber(this.equimentid).then(response => {
          if (response.data.state === 1) {
            var total = response.data.data.total
            if (total === '') {
              this.userform.user_total = ''
            }
            this.userform.user_total = total
          } else {
            this.$message.error('数据返回失败')
          }
        })
      },
      getAllpatient() {
        getAllpatient().then(response => {
          if (response.data.state === 1) {
            var allpatient = response.data.data.allpatient

            this.patientName = allpatient
          }
        })
      },
      getTimeWarning(id) {
        getTimeWarning(id).then(response => {
          if (response.data.state === 1) {
            var information = response.data.data.information
            var time = this.getTimestamp(this.userform.date) - information.stime
            // console.log('时间', time)
            // if (time < 2678400) {
            //   this.warnShow = false
            // }
            var deviceInformation = response.data.data.deviceInformation

            var timetwo = this.getTimestamp(this.userform.date) - deviceInformation.stime
            // if (timetwo < 2678400) {
            //  this.warnShowTwo = false
            // }

            var clean = response.data.data.clean
            // var timethree = this.getTimestamp(this.userform.date) - clean.stime
            // if (timethree < 2678400) {
            //  this.warnShowThree = false
            // }
          }
        })
      },
      getTimeBeteen(id) {
        var todayTime = moment(new Date()).format('YYYY-MM-DD')
        // console.log('todayTime', todayTime)
        getTimeBeteen(id, todayTime).then(response => {
          if (response.data.state === 1) {
            var timedata = response.data.data.timeData
            if (timedata.length === 0) {
              this.warnShow = true
            }
            if (timedata.length !== 0) {
              this.warnShow = false
            }
            var todayTimeTwo = response.data.data.timeDataTwo
            // console.log('todayTimeTwo', todayTimeTwo)
            if (todayTimeTwo.length === 0) {
              this.warnShowTwo = true
            }
            if (todayTimeTwo.length !== 0) {
              this.warnShowTwo = false
            }

            var timeDataThree = response.data.data.timeDataThree
            //console.log('timeDataThree', timeDataThree)
            if (timeDataThree.length === 0) {
              this.warnShowThree = true
            }
            if (timeDataThree.length !== 0) {
              this.warnShowThree = false
            }
          }
        })
      },
      getTimestamp(time) { // 把时间日期转成时间戳
        return (new Date(time)).getTime() / 1000
      },

      // eslint-disable-next-line no-irregular-whitespace
      // 通过自组建传值改变表格数据
      getPlanData(data) {
        if (data === 1) {
          this.getAllPlanDetail(this.unitType)
        }
      },
      getAllMode() {
        getAllMode().then(response => {
          var mode = response.data.data.mode

          this.deviceMode = mode
        })
      },
      selectChange(id) {
        selectChange(id).then(response => {
          if (response.data.state === 1) {
            this.userform.bed_number = ''
            var change = response.data.data.change
            this.bedNumberTwo = change
            // console.log('change', change)
          }
        })
      },
      selectBed(id) {
        selectBed(id).then(response => {
          if (response.data.state === 1) {
            var zone = response.data.data.zone
          }
        })
      },
      getData(id) {
        selectBed(id).then(response => {
          if (response.data.state === 1) {
            var zone = response.data.data.zone
            this.$forceUpdate()
            this.userform.bed_number = zone.id
            this.userform.zone = zone.zone_id
            // console.log('zone', zone)
          }
        })
      },
      hiddenShow() {
        this.$confirm(
          '确认要删除所选图片吗? <br>删除后,信息将无法恢复',
          '删除提示',
          {
            dangerouslyUseHTMLString: true,
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }
        ).then(() => {
          this.filename = ''
          this.guaForm.imageName = ''
          this.guaForm.images = ''
          this.classShow = false
        })
      }
    },
    created() {
      this.getAllSubregion()
      this.getAllMachine()
      var index = this.$route.query.index
      var bedid = this.$route.query.bedid
      // var id = this.$route.query.id
      // this.equimentid = id
      this.bedid = bedid
      this.getAllPlan()
      this.getAllEquimentName()
      this.getAllOrganization()
      this.getOrgName()
      this.getAllEquitType()
      this.getAllpatient()
      this.getAllMode()
  }
  }
</script>
<style lang="scss" scoped>
    .zone{
      //  margin-left: 30px;
      //  text-align: left;
       width: 70px;
       display: inline-block;
       color:#606266;
    }
    .disinfect{
      position: relative;
      .newButton{
        // position: absolute;
        // right: 2%;
        // top:4px;
        // z-index: 9;
        margin-bottom: 10px;
    margin-left: 90%;
      }
    }
    .disinfectOne{
      position: relative;
      .newButtonOne{
        position: absolute;
         right: 0;
         top: -10;
         z-index: 18;
      }
    }
    .but{
      width: 200px;
      height: 50px;
      // border: solid 1px red;
      margin-left: 77%;
    }
    .clearn{
      width: 460px;
      height: 50px;
      // border:solid 1px red;
      margin-left:650px;
    }

  .zClass{
    width: 200px;
    height: 200px;
    // border:solid 1px red;
    margin-left: 450px;
    margin-top: 200px;
  }
  .warn{
    color: red;
    font-size: 14px;
    width: 100%;
    display: inline-block;
    margin-left: 96px;
  }

  .userbutton{
       margin-bottom: 10px;
    margin-left: 82%
  }

</style>
<style lang="scss">
   .a{
     margin-bottom: 10px;
      margin-top: 6px;

   }

   .b{
    .el-button{
      margin-left: 90%;
      margin-bottom: 10px;
    }
   }

   .stoppage{
     .el-form-item__label{
       width:190px;
     }
   }
   .st{
     .el-form-item__label{
       width:-10px;
     }
   }
   .main{
     position: relative;
     .newButtonOne{
       position:absolute;
       right: 0;
       z-index: 2;
     }
   }

    .elbutton{
      // border: solid 1px red;
      height: 50px;
      width: 400px;
      margin-left: 650px;
    }
  // .el-form-item__label {
  //   width: 130px;
  //   font-size: 14px;
  // }
  .el-form-item__error {
    margin-left: 130px;
  }

 .el-upload-list__item-name {
    color: #606266;
    display: block;
    margin-right: 40px;
    overflow: hidden;
    padding-left: 4px;
    text-overflow: ellipsis;
    transition: color .3s;
    white-space: nowrap;
}
.el-main{
  padding-top: 0px;
}
.newMain{
  .el-form-item__label{
    width: 104px;
  }
}
.newDisinfectOne{
  .el-input--prefix .el-input__inner{
    padding-left: 15px
  }
}
.stoppage{
  .el-form-item__label{
    width: 18%;
  }
}
.newItem{
  .el-form-item__label{
    width: 130px;
  }
}
.formItem{
  .el-form-item__label{
    width: 104px;
    line-height: 30px;
  }
}
.newname{
  .el-form-item__label{
    width: 60px;
  }
}
::-webkit-scrollbar{
  height: 20px;
}
</style>
