<template>
  <div>
    <van-search v-model="schedulingVal"
     @clear="onclear" @input="onUpdate" placeholder="请输入搜索关键词" />
    <div class="xuanze">
      <div class="xuanze_sele">
        <div class="toolOne" @click="dateShow = true">
          <div style="display: flex;align-items: center;">
            {{nowDate}}<van-icon name="arrow-down" />
          </div>
        </div>
      </div>
      <div class="xuanze_sele">
        <div class="toolOne" @click="classesshow = true">
          <div style="display: flex;align-items: center;">
            {{ type }}<van-icon name="arrow-down" />
          </div>
        </div>
      </div>
      <div class="xuanze_sele">
        <div class="toolOne" @click="endemicshow = true">
          <div style="display: flex;align-items: center;">
            {{ area_type }}<van-icon name="arrow-down" />
          </div>
        </div>
      </div>
    </div>
    <div style="margin-top: 20px;height: 82vh;">
      <el-table
        :row-style="{ color: '#303133' }"
        :header-cell-style="{
          backgroundColor: '#409eff',
          color: 'rgb(235 237 239)',
        }"
        border
        :fit="true"
        :data="scheduleZone"
        height="calc(100% - 0px)"
        ref="table"
        style="table-layout: fixed;"
        class="eltable"
      >
        <el-table-column
          prop="area"
          label="分区"
          min-width="50"
          align="center"
          fixed
        ></el-table-column>
        <el-table-column
          prop="cut"
          label="机号"
          min-width="50"
          align="center"
          fixed
        ></el-table-column>
        <el-table-column prop="Mon_M" label="上午" min-width="60" align="center">
          <template slot-scope="scope">
              <el-popover placement="top"
                title=""width=""
                trigger="click"content=""
                popper-class="ellipsis-pop"
                >
                <div v-if="scope.row.Mon_M.patient_id !=''" >
                  <el-button @click='patientedit(scope.row.Mon_M)'>调班</el-button>
                  <el-button @click="delete_click(scope.row.Mon_M)" v-if="scope.row.Mon_M.stage==0">删除</el-button>
                </div>
                <div style="text-align: center;" v-if="scope.row.Mon_M.patient_id == 0" >
                  <el-button @click='newappend(scope.row.Mon_M)'>新增</el-button>
                </div>
                <schedule-item slot="reference" :schedule-detail="scope.row.Mon_M"></schedule-item>
              </el-popover>
              <!-- <schedule-item v-popover:popover :schedule-detail="scope.row.Mon_M"></schedule-item> -->
          </template>
        </el-table-column>
        <el-table-column prop="Mon_A" label="下午" min-width="60" align="center">
          <template slot-scope="scope">
            <div>
              <el-popover placement="top"
                title="" width=""
                trigger="click" content=""
                popper-class="ellipsis-pop"
                >
                <div v-if="scope.row.Mon_A.patient_id !=''">
                  <el-button @click='patientedit(scope.row.Mon_A)'>调班</el-button>
                  <el-button @click="delete_click(scope.row.Mon_A)" v-if="scope.row.Mon_A.stage==0">删除</el-button>
                </div>
                <div style="text-align: center;" v-if="scope.row.Mon_A.patient_id ==''">
                  <el-button @click='newappend(scope.row.Mon_A)'>新增</el-button>
                </div>
                <schedule-item slot="reference" :schedule-detail="scope.row.Mon_A"></schedule-item>
              </el-popover>
              <!-- <schedule-item v-popover:popover :schedule-detail="scope.row.Mon_A"></schedule-item> ref="popover" -->
            </div>
          </template>
          <!-- <schedule-item slot-scope="scope" :schedule-detail="scope.row.Mon_A"></schedule-item> -->
        </el-table-column>
        <el-table-column prop="Mon_N" label="晚上" min-width="60" align="center">
          <template slot-scope="scope">
            <div>
              <el-popover
                placement="top" title=""
                min-width="" trigger="click"
                content=""
                popper-class="ellipsis-pop"
                
                >
                <div v-if="scope.row.Mon_N.patient_id !=''">
                  <!-- <span @click='patientedit(scope.row.Mon_N)'>调班</span>
                  <span @click='delete_click(scope.row.Mon_N)' v-if="scope.row.Mon_N.stage==0">删除</span> -->
                  <el-button @click='patientedit(scope.row.Mon_N)'>调班</el-button>
                  <el-button @click="delete_click(scope.row.Mon_N)" v-if="scope.row.Mon_N.stage==0">删除</el-button>
                </div>
                <div style="text-align: center;" v-if="scope.row.Mon_N.patient_id ==0">
                  <!-- <span @click='newappend(scope.row.Mon_N)'>新增</span> -->
                  <el-button @click='newappend(scope.row.Mon_N)'>新增</el-button>
                </div>
                <schedule-item slot="reference" :schedule-detail="scope.row.Mon_N"></schedule-item>
              </el-popover>
            </div>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!-- 日期 -->
    <van-popup v-model="dateShow" position="bottom" :style="{ height: '40%' }">
      <van-datetime-picker
        v-model="currentDate"
        type="date"
        @confirm="getNowDate"
        @cancel="dateShow = false"
      />
    </van-popup>
    <!-- 班次 -->
    <van-popup v-model:show="classesshow" round position="bottom">
      <van-picker
        show-toolbar
        :columns="typeColumns"
        @cancel="classesshow = false"
        @confirm="classonConfirm"
      />
    </van-popup>
    <!-- 病区 -->
    <van-popup v-model:show="endemicshow" round position="bottom">
      <van-picker
        show-toolbar
        :columns="areaColumns"
        @cancel="endemicshow = false"
        @confirm="endem_confirm"
      />
    </van-popup>
    <!-- 修改 -->
    <el-dialog class="xiugai xiugai2"
      v-loading="edit_loading"
      title="修改排班"
      :visible.sync="xiugaishow"
      width="90%"
      :modal-append-to-body="false"
      :show-close="false"
      center
      >
      <div style="font-size: 14px;">
        <!-- <div class="xiugaiheader">修改排班</div> -->
        <div>{{editvalue.name}}  {{getmodename(editvalue.mode_name)}}</div>
        <div class="patient_name">当前排班：{{gettouxitime(editvalue.schedule_date)}} {{getschedulType(editvalue.schedulType)}} {{editvalue.bed}} </div>
        <div class="patient_name">修改为</div>
        <div class="patient_name" style="display: flex;">
          <div style="flex: 1;margin-right: 10px;">
            患者：
            <input type="text" v-model="edit_xiu.patient_xiu" onfocus="this.blur();" @click="clickhuanzhes = !clickhuanzhes" class="borders" >
          </div>
            <!-- 点击修改  :close-on-click-modal = 'false'-->
            <el-dialog class="huanzhe_xiu"
            :visible.sync="clickhuanzhes"
            :append-to-body = 'true'

            :show-close="false"
              width="70%">
              <div>
                <div style="border-bottom: 1px solid #e5e5e5;">
                  <van-search v-model="schedulingVal2" @clear="onclear2" 
                  @input="onUpdate2" placeholder="请输入搜索关键词" />
                </div>
                <div class="listBox">
                 
                  <div v-for="(item,index) in huangxiu_arr" :key='index' @click="Select_click(item)">
                    {{ item.name }}
                  </div>
                </div>
                <div class="Cancelclass" @click="Cancel_click">
                  取消
                </div>
              </div>
            </el-dialog>

          <div style="flex: 1;">
             日期：
             <!-- <el-date-picker
              v-model="edit_xiu.date_xiu"
              type="date"
              placeholder="选择日期"
              style="width: 150px;"
              @change="timechange">
            </el-date-picker> -->
            <input type="text" v-model="edit_xiu.date_xiu" onfocus="this.blur();" class="borders">
          </div>
        </div>
        <div class="patient_name">
          透析模式：<input type="text" v-model="edit_xiu.mode_xiu" onfocus="this.blur();" @click="clickmode = true" class="borders">
          <el-dialog class="huanzhe_xiu"
          :visible.sync="clickmode"
          :append-to-body = 'true'

          :show-close="false"
            width="50%">
            <div>
              <div class="listBox">
                <div v-for="(item,index) in mode" :key='index' @click="Select_mode(item)"
                  :style="{'color':item.id==edit_xiu.modeid_xiu ? '#409eff':''}">
                  {{ item.name }}
                </div>
              </div>
              <div class="Cancelclass" @click="mode_click">
                取消
              </div>
            </div>
          </el-dialog>

        </div>

        <div class="patient_name" style="line-height: 40px;display: flex;">
          <div style="flex: 2;">班次：</div>
          <div style="flex: 8;">
            <ul class>
              <li
                :class="item.value == edit_xiu.type_xiu ? 'active' : ''"
                @click="selectSchedulType(item.value)"
                v-for="item in schedulArr"
                :key="item.value"
              >
                {{ item.label }}
              </li>
            </ul>
          </div>
        </div>
        <div class="patient_name">
          分区：<input type="text" v-model="edit_xiu.fenqu_xiu" onfocus="this.blur();" @click="clickfenqu=true" class="borders">
          <el-dialog class="huanzhe_xiu"
          :visible.sync="clickfenqu"
          :append-to-body = 'true'

          :show-close="false"
            width="50%">
            <div>
              <div class="listBox">
                <div v-for="(item,index) in fenqu_arr" :key='index' @click="Select_fenqu(item)"
                  :style="{'color':item.id==edit_xiu.zong_id ? '#409eff':''}">
                  {{ item.name }}
                </div>
              </div>
              <div class="Cancelclass" @click="fenqu_click">
                取消
              </div>
            </div>
          </el-dialog>
        </div>
        <div class="patient_name">
          机号：<input type="text" v-model="edit_xiu.jihao_xiu" onfocus="this.blur();" @click="clickjihao = true" class="borders">
          <el-dialog class="huanzhe_xiu"
          :visible.sync="clickjihao"
          :append-to-body = 'true'

          :show-close="false"
            width="50%">
            <div>
              <div class="listBox">
                <div v-for="(item,index) in jihao_arr" :key='index' @click="Select_jihao(item)"
                  :style="{'color':item.cut==edit_xiu.jihao_xiu ? '#409eff':''}">
                  {{ item.cut }}
                </div>
              </div>
              <div class="Cancelclass" @click="jihao_click">
                取消
              </div>
            </div>
          </el-dialog>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="xiugaishow=!xiugaishow">取 消</el-button>
        <el-button type="primary" @click="xiugai_edit">确 定</el-button>
      </span>
    </el-dialog>
   <!-- 操作弹窗 -->
    <el-dialog class="xiugai"
      :visible.sync="jiaotishow"
      title="温馨提示"
      :show-close="false"
      top="30vh"
      width="70%">
      <div>
        所选位置已有排班({{jiaohuan.name}} {{getmodename(jiaohuan.mode_id)}})，请选择操作
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="success" @click="Replace">替换</el-button>
        <el-button type="primary" @click="interchange">交换</el-button>
        <el-button @click="jiaotishow=!jiaotishow">取 消</el-button>
      </span>
    </el-dialog>
    <!-- 新增排班 -->
    <el-dialog class="xiugai xiugai2"
      v-loading="add_loading"
      title="新增排班"
      :visible.sync="addshow"
      width="90%"
      :modal-append-to-body="false"
      :show-close="false"
      center
      >
      <div style="font-size: 14px;">
        <div class="patient_name" style="display: flex;">
          <div style="flex: 1;margin-right: 10px;">
            患者：
            <input type="text" v-model="add_arr.patient_add" onfocus="this.blur();" @click="clickhuanzhes2= !clickhuanzhes2" class="borders" >
            <!-- <el-input type="text" size="mini" v-model="add_arr.patient_add" onfocus="this.blur();" 
                  @click="clickhuanzhes2= !clickhuanzhes2" style="width: 120px;" >
            </el-input> -->
          </div>
            <!-- 点击修改  :close-on-click-modal = 'false'-->
            <el-dialog class="huanzhe_xiu"
            :visible.sync="clickhuanzhes2"
            :append-to-body = 'true'

            :show-close="false"
              width="70%">
              <div>
                <div style="border-bottom: 1px solid #e5e5e5;">
                  <van-search v-model="schedulingVal2" @clear="onclear2"
                  @input="onUpdate2" placeholder="请输入搜索关键词" />
                </div>
                <div class="listBox">
                  <div v-for="(item,index) in huangxiu_arr" :key='index' @click="Select_click2(item)">
                    {{ item.name }}
                  </div>
                </div>
                <div class="Cancelclass" @click="clickhuanzhes2 = !clickhuanzhes2" >
                  取消
                </div>
              </div>
            </el-dialog>

          <div style="flex: 1;">
            日期：
            <el-date-picker
              class="datepicker"
              v-model="currentData.schedule_date"
              type="date"
              placeholder="选择日期"
              style="width: 70%;font-size: 14px;"
              value-format="yyyy-MM-dd"
              :clearable="false"
              :editable = 'false'
              @change="timechange">
            </el-date-picker>
            <!-- <input type="text" v-model="add_arr.date_add" onfocus="this.blur();" class="borders"> -->
          </div>
        </div>
        <div class="patient_name">
          透析模式：<input type="text" v-model="add_arr.mode_add" onfocus="this.blur();" @click="clickmode2 = true" class="borders">
          <el-dialog class="huanzhe_xiu"
          :visible.sync="clickmode2"
          :append-to-body = 'true'

          :show-close="false"
            width="50%">
            <div>
              <div class="listBox">
                <div v-for="(item,index) in mode" :key='index' @click="Select_mode2(item)"
                  :style="{'color':item.id==add_arr.modeid_add ? '#409eff':''}">
                  {{ item.name }}
                </div>
              </div>
              <div class="Cancelclass" @click="clickmode2 = !clickmode2">
                取消
              </div>
            </div>
          </el-dialog>

        </div>

        <div class="patient_name" style="line-height: 40px;display: flex;">
          <div style="flex: 2;">班次：</div>
          <div style="flex: 8;">
            <ul class>
              <li
                :class="item.value == add_arr.type_add ? 'active' : ''"
                @click="selectSchedulType2(item.value)"
                v-for="item in schedulArr"
                :key="item.value"
              >
                {{ item.label }}
              </li>
            </ul>
          </div>
        </div>
        <div class="patient_name">
          分区：<input type="text" v-model="add_arr.fenqu_add" onfocus="this.blur();" @click="clickfenqu2=true" class="borders">
          <el-dialog class="huanzhe_xiu"
          :visible.sync="clickfenqu2"
          :append-to-body = 'true'

          :show-close="false"
            width="50%">
            <div>
              <div class="listBox">
                <div v-for="(item,index) in fenqu_arr" :key='index' @click="Select_fenqu2(item)"
                  :style="{'color':item.id==add_arr.zong_id ? '#409eff':''}">
                  {{ item.name }}
                </div>
              </div>
              <div class="Cancelclass" @click="clickfenqu2 = !clickfenqu2">
                取消
              </div>
            </div>
          </el-dialog>
        </div>
        <div class="patient_name">
          机号：<input type="text" v-model="add_arr.jihao_add" onfocus="this.blur();" @click="clickjihao2 = true" class="borders">
          <el-dialog class="huanzhe_xiu"
          :visible.sync="clickjihao2"
          :append-to-body = 'true'

          :show-close="false"
            width="50%">
            <div>
              <div class="listBox">
                <div v-for="(item,index) in jihao_arr" :key='index' @click="Select_jihao2(item)"
                  :style="{'color':item.jihao_id==add_arr.bed_id ? '#409eff':''}">
                  {{ item.cut }}
                </div>
              </div>
              <div class="Cancelclass" @click="clickjihao2 =! clickjihao2">
                取消
              </div>
            </div>
          </el-dialog>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="addshow=!addshow">取 消</el-button>
        <el-button type="primary" @click="appendclick">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 删除确认弹窗 -->
    <el-dialog class="xiugai"

      :visible.sync="deleteshow"
      title="温馨提示"
      :show-close="false"
      width="60%">
      <div>
        确定删除排班 {{deletehuan.name}} {{getmodename(deletehuan.mode_id)}}?
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="getDeleteSchedule(deletehuan.schedule_id)">确定</el-button>
        <el-button @click="deleteshow=!deleteshow">取 消</el-button>
      </span>
    </el-dialog>

  </div>
</template>

<script>
import { getPatientScheduleList, GetAllZone, GetAllZonePb, DeleteSchedule,
   searchPatient, updatePatientSchedule, getAllPatient, createSchedule, updateScheduleInfo,
    updateScheduleMode, updateScheduleDialysisPrescription, getSolutionSchedule, getAllBedList,
    changeScheduleModeById, changeScheduleType, changeScheduleBed } from '@/api/staff_schedule'
import {GetRangeValue, GetAllPatients, GetInspectionIndexInit} from '@/api/statistics'
const moment = require('moment')
import { Toast } from 'vant';
import { showToast } from 'vant';
import { Loading } from 'vant';
import {postUrgentSchedule,getexchange,getcoversch,updateschedule} from '@/api/dialysis'
import ScheduleItem from './ScheduleItem'
export default{
  components: {
    ScheduleItem
  },

  data(){
    return {
      value:'',
      currentDate: new Date(),
      nowDate:new Date(),
      typeColumns:['全部班', '上午', '下午', '晚上'],
      columns:[],
      options:[],
      dateShow:false,
      classesshow:false,
      endemicshow:false,
      dialogVisible:false,
      dele_dialogVisible:false,
      xiugaishow:false,
      visible:false,
      clickhuanzhes:false,
      clickhuanzhes2:false,
      clickmode:false,
      clickmode2:false,
      clickfenqu:false,
      clickfenqu2:false,
      clickjihao:false,
      clickjihao2:false,
      jiaotishow:false,
      addshow:false,//新增弹窗
      deleteshow:false,//删除弹窗
      loading:false,//删除的加载
      add_loading:false,//新增的加载
      edit_loading:false,//修改的加载
      timeOutEvent:0,
      tableContainHeight:"calc(100% -20px)",
      class_type: 0,
      type: '全部班',
      schedulingVal2:'',
      start_time:moment(new Date()).format("YYYY-MM-DD"),
      // start_time: 0,
      scheduleAll:[],
      scheduleZone:[],
      schedulingVal:'',
      area_type: '全部病区',
      areaColumns: [],
      list:[],
      value1:'',
      state1:'',
      active: true,
      schedulType:1,
      schedulArr: [
        { value: 1, label: "上午" },
        { value: 2, label: "下午" },
        { value: 3, label: "晚上" }
      ],
      editvalue:{
        name:'',
        mode_name:'',
        schedule_date:'',
        schedulType:0,
        bed:'',
        schedule_id:'',
        bed_id:'',
        zong_id:'',
        patient_id:0,
        mode_id:0
      },
      edit_xiu:{
        patient_xiu:'',
        date_xiu:'',
        mode_xiu:'',
        type_xiu:'',
        fenqu_xiu:'',
        jihao_xiu:'',
        schedule_id:'',
        bed_id:'',
        zong_id:'',
        date:'',
        modeid_xiu:0,
        patientid_xiu:0,
        schedule_week:0,
      },
      // 新增
      add_arr:{
        patient_add:'',
        date_add:'',
        mode_add:'',
        type_add:'',
        fenqu_add:'',
        jihao_add:'',
        schedule_id:'',
        bed_id:'',
        zong_id:'',
        date:'',
        modeid_add:0,
        patientid_add:0,
        schedule_week:0,
      },
      //新增
      currentData: {
        id: 0,
        schedule_date: '',
        schedule_type: 0,
        bed_id: 0,
        partition_id: 0,
        patient_id: 0,
        schedule_week: 0,
        mode_id: 0,
        type_name: '',
        bed_name: '',
        partition_type: 0,
        contagions: [],
        patient: ''
      },

      jiaohuan:{id:'',name:'',mode_id:0},
      deletehuan:{id:'',name:'',mode_id:0,schedule_id:''},
      fenqu_arr:[],
      huangxiu_arr:[],
      jihao_arr:[],
      jihao_arr2:[],
      mode:[{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:'IUF+HD'},{id:16,name:'UF'},{id:17,name:'HD+'},{id:18,name:'血浆胆红素吸附+HDF'},{id:19,name:'H血浆胆红素吸附'},{id:20,name:'I-HDF'},{id:21,name:'HD高通'}
      ,{id:22,name:'CVVH'},{id:23,name:'CVVHD'},{id:24,name:'CVVHDF'},{id:25,name:'PE'},{id:26,name:'血浆胆红素吸附+HP'},{id:27,name:'HPD'},{id:28,name:'HDP'}
      ,{id:29,name:'HFD'},{id:30,name:'HDF100'},{id:31,name:'HDF600'},{id:32,name:'HDF800'},{id:33,name:'HDF1000'}],
      options_arr:[],
    }
  },
  computed:{

  },
  methods:{
    showPopver(){
      console.log('1111111222222');
      
    },
    // 数据源
    getlist () {
      if (this.type == '全部班') {
        this.class_type = 0
      }
      if (this.type == '上午') {
        this.class_type = 1
      }
      if (this.type == '下午') {
        this.class_type = 2
      }
      if (this.type == '晚上') {
        this.class_type = 3
      }

      const params = {
        start_time: this.start_time,
        classtype: this.class_type
      }
      GetAllZonePb(params).then(response => {
        if (response.data.state == 1) {
          var resp_data = response.data.data.schedule
          this.list = resp_data
          const list = this.list
          console.log('resp_date23233223222', resp_data)
          // this.scheduleAll = resp_data
          var scheduleZone= []
          var arr = []
          const fenqu_arr=[]
          const jihao=[]

          var bingqu='全部病区'
          this.areaColumns.push(bingqu)
          if(resp_data.length>0){
            for(let i in resp_data){
              bingqu=resp_data[i].name
              this.areaColumns.push(bingqu)
            }
            list.forEach(function(params) {
              var fenquobj={
                id:params.id,
                name:params.name
              }
              fenqu_arr.push(fenquobj)
              if(params.device.length>0){

                params.device.forEach(function(device) {
                  var thisPa = {
                    area: params.name,
                    zone_id: params.id,
                    zone_type: params.type,
                    cut: device.number,
                    jihao_id: device.id,
                    sort:device.sort,

                    Mon_M: {
                      schedule_id: 0,
                      mode_id: 0,
                      mode_name: '',
                      patient_id: 0,
                      patient: '',
                      dialysis_machine_name:'',
                      schedule_date:"",
                      Count:0,
                      schedule_type:1,
                      cut: device.number,
                      jihao_id: device.id,
                      zone_id:device.zone_id,
                      area: params.name,
                      schedule_week:'',
                      stage:''
                    },
                    Mon_A: {
                      schedule_id: 0,
                      mode_id: 0,
                      mode_name: '',
                      patient_id: 0,
                      patient: '',
                      dialysis_machine_name:'',
                      schedule_date:"",
                      Count:0,
                      schedule_type:2,
                      cut: device.number,
                      jihao_id: device.id,
                      zone_id:device.zone_id,
                      area: params.name,
                      schedule_week:'',
                      stage:''
                    },
                    Mon_N: {
                      schedule_id: 0,
                      mode_id: 0,
                      mode_name: '',
                      patient_id: 0,
                      patient: '',
                      dialysis_machine_name:'',
                      schedule_date:"",
                      Count:0,
                      schedule_type:3,
                      cut: device.number,
                      jihao_id: device.id,
                      zone_id:device.zone_id,
                      area: params.name,
                      schedule_week:'',
                      stage:''
                    },
                  }
                  var jihaoobj = {
                    cut: device.number,
                    jihao_id: device.id,
                    zone_id:device.zone_id,
                    sort: device.sort
                  }
                  device.schedule.forEach(function(item){

                    if(item.schedule_type==1&&item.bed_id==device.id){
                      thisPa['Mon_M']={
                        schedule_id: item.id,
                        mode_id:item.mode_id,
                        mode_name: '',
                        patient_id: item.patient_id,
                        patient: item.patient.name,
                        dialysis_machine_name:item.dialysis_machine_name,
                        schedule_date:item.schedule_date,
                        Count:0,
                        schedule_type:item.schedule_type,
                        cut: device.number,
                        jihao_id: device.id,
                        area: params.name,
                        zone_id:device.zone_id,
                        schedule_week:item.schedule_week,
                        stage:item.order.stage
                      }
                    }
                    if(item.schedule_type==2&&item.bed_id==device.id){
                      thisPa['Mon_A']={
                        schedule_id: item.id,
                        mode_id:item.mode_id,
                        mode_name: '',
                        patient_id: item.patient_id,
                        patient: item.patient.name,
                        dialysis_machine_name:'',
                        schedule_date:item.schedule_date,
                        Count:0,
                        schedule_type:item.schedule_type,
                        cut: device.number,
                        jihao_id: device.id,
                        area: params.name,
                        zone_id:device.zone_id,
                        schedule_week:item.schedule_week,
                        stage:item.order.stage
                      }
                    }
                    if(item.schedule_type==3&&item.bed_id==device.id){
                      thisPa['Mon_N']={
                        schedule_id: item.id,
                        mode_id:item.mode_id,
                        mode_name: '',
                        patient_id: item.patient_id,
                        patient: item.patient.name,
                        dialysis_machine_name:'',
                        schedule_date:item.schedule_date,
                        Count:0,
                        schedule_type:item.schedule_type,
                        cut: device.number,
                        jihao_id: device.id,
                        area: params.name,
                        zone_id:device.zone_id,
                        schedule_week:item.schedule_week,
                        stage:item.order.stage
                      }
                    }
                  })
                   arr.push(thisPa)
                   jihao.push(jihaoobj)
                })
              }
            })

            arr.sort(this.compare('sort'))

              this.fenqu_arr=fenqu_arr
              this.jihao_arr = jihao
              this.jihao_arr2 = jihao
              console.log("3445555557777777",this.jihao_arr);
            // console.log("34455555566666",this.schedulingVal);
            if(this.area_type=='全部病区'){
              scheduleZone =arr
            }else{
              for(let i in arr){
                if(this.area_type==arr[i].area){
                  scheduleZone.push(arr[i])
                }
              }
            }
            this.scheduleZone=scheduleZone
            this.schedule_list = scheduleZone
          }
          console.log("34455555566666",this.scheduleZone)
        }
      })
    },
    // 全部患者数据源
    getGetAllPatients(){
      GetAllPatients().then(response =>{
        if(response.data.state==1){
          const huanzhi_arr = response.data.data.patients
          this.huangxiu_arr = huanzhi_arr
          this.options_arr = huanzhi_arr
          // console.log('cccccc',this.huangxiu_arr);
        }
      })
    },
    // 排序
    compare(property){
      return function(a,b){
          var value1 = a[property];
          var value2 = b[property];
          return value1 - value2;//升序,降序为value2 - value1
      }
    },

    // 选择时间
    getNowDate (value) {
      let year = value.getFullYear()
      let month = value.getMonth() + 1
      let day = value.getDate()
      if (month >= 1 && month <= 9) {
        month = `0${month}`
      }
      if (day >= 1 && day <= 9) {
        day = `0${day}`
      }
      this.nowDate = `${year}-${month}-${day}`
      this.start_time = `${year}-${month}-${day}`
      this.dateShow = false
      this.getlist()
    },
    // 选择班次
    classonConfirm(value){
      this.type = value
      this.classesshow = false
      // this.areaColumns = []
      this.getlist()
    },
    // 选择病区
    endem_confirm(value){
      this.area_type = value
      this.endemicshow=false

      this.getlist()
    },
    // 清除搜索
    onclear(){
      this.getlist()
    },
    onclear2(){    
      this.getGetAllPatients()
    },
    // 搜索
    onUpdate(val){
      if(val !=''){
        this.schedulingVal = val
        this.scheduleZone
        var suos=[]
        for(let i in this.schedule_list){
          if(this.schedulingVal!=''){
            if(this.schedule_list[i].Mon_A.patient.indexOf(this.schedulingVal) != -1||
              this.schedule_list[i].Mon_M.patient.indexOf(this.schedulingVal) != -1 ||
              this.schedule_list[i].Mon_N.patient.indexOf(this.schedulingVal) != -1)
            {
              suos.push(this.schedule_list[i])
            }
          }else{
            this.getlist()
          }
        }
        this.scheduleZone=suos
      }else{
        this.getlist()
      }
    },
    onUpdate2(val){
      if(val != ''){
        this.schedulingVal2=val
        const namearr = []
        for(let i in this.options_arr){
          if(this.options_arr[i].name.indexOf(this.schedulingVal2) !=-1){
            namearr.push(this.options_arr[i])
          } 
        }
        this.huangxiu_arr = namearr
      }else{
        this.getGetAllPatients()
      }
    },
    // 修改
    patientedit(value){
      this.xiugaishow=true
      this.editvalue={
        name:value.patient,
        mode_name:value.mode_id,
        schedule_date:value.schedule_date,
        schedulType:value.schedule_type,
        bed_id:value.jihao_id,
        bed:value.cut,
        schedule_id:value.schedule_id,
        zong_id:value.zone_id,
        patient_id:value.patient_id,
        mode_id:value.mode_id,
      }
      this.edit_xiu={
        patient_xiu:value.patient,
        date_xiu:this.gettouxitime(value.schedule_date),
        mode_xiu:this.getmodename(value.mode_id),
        type_xiu:value.schedule_type,
        fenqu_xiu:value.area,
        jihao_xiu:value.cut,
        schedule_id:value.schedule_id,
        bed_id:value.jihao_id,
        zong_id:value.zone_id,
        date:value.schedule_date,
        modeid_xiu:value.mode_id,
        patientid_xiu:value.patient_id,
        schedule_week:value.schedule_week
      }
      const hao_arr = []
      for(let i in this.jihao_arr){
        if(this.jihao_arr[i].zone_id==value.zone_id){
          hao_arr.push(this.jihao_arr[i])
        }
      }
      this.jihao_arr = hao_arr
      console.log('nnnnn',this.edit_xiu);
    },
    // 新增
    newappend(item){
      this.addshow = true
      console.log('444444',item);
      this.add_arr={
        patient_add:'',
        date_add: this.gettouxitime(new Date()) ,
        mode_add:'',
        type_add: item.schedule_type,
        fenqu_add:item.area,
        jihao_add: item.cut,
        schedule_id:'',
        bed_id: item.jihao_id,
        zong_id: item.zone_id,
        date:'',
        modeid_add:0,
        patientid_add:0,
        schedule_week:0,
      }
      this.currentData={
        id: 0,
        schedule_date: this.nowDate,
        schedule_type:item.schedule_type,
        bed_id: item.jihao_id,
        partition_id: item.zone_id,
        patient_id: 0,
        schedule_week: this.getWeekDay(new Date(this.nowDate)),
        mode_id: 0,
        bed_name: '',
        partition_type: 0,
        contagions: [],
        patient: ''
      }
      switch (item.schedule_type) {
        case 1:
          this.currentData.type_name = '上午'
          break
        case 2:
          this.currentData.type_name = '下午'
          break
        case 3:
          this.currentData.type_name = '晚上'
          break
      }
      console.log('gggggg',this.currentData);
    },
    // 星期
    getWeekDay (date) {
      console.log('11111',date);
      var week
      if (date.getDay() == 0) week = 7
      if (date.getDay() == 1) week = 1
      if (date.getDay() == 2) week = 2
      if (date.getDay() == 3) week = 3
      if (date.getDay() == 4) week = 4
      if (date.getDay() == 5) week = 5
      if (date.getDay() == 6) week = 6
      return week
    },
    // 删除
    delete_click(item){
      // this.loading=true
      this.deleteshow=true
      this.deletehuan={
        id:item.patient_id,
        name:item.patient,
        mode_id:item.mode_id,
        schedule_id:item.schedule_id.toString()
      }
    },
    // 透析模式
    getmodename(id){
      for(let i in this.mode){
        if(this.mode[i].id==id){
          return this.mode[i].name
        }
      }
    },
    // 透析时间
    gettouxitime(time){
      time = moment()
      const times = moment(time).format("yyyy-MM-DD")
      return times
    },
    //透析班次
    getschedulType(val){
      for(let i in this.schedulArr){
        if(this.schedulArr[i].value==val){
          return this.schedulArr[i].label
        }
      }
    },
    // 取消患者修改
    Cancel_click(){
      this.clickhuanzhes=false
    },
    // 选中修改患者
    Select_click(val){
      console.log('val',val);
        this.edit_xiu.patient_xiu=val.name
        this.edit_xiu.patientid_xiu =val.id
        this.clickhuanzhes = false
        // return this.edit_xiu.patient_xiu
    },
    // 选中新增患者
    Select_click2(val){
      console.log('val',val);
        this.add_arr.patient_add = val.name
        this.add_arr.patientid_add = val.id
        this.currentData.patient_id = val.id
        this.currentData.patient = val.name
        this.clickhuanzhes2 = false

    },
    // 取消修改模式
    mode_click(){
      this.clickmode = false
    },
    // 选中时间
    timechange(val){
      // this.edit_xiu.date_xiu = val
      this.currentData.schedule_date = val
      // this.nowDate = val
      // this.getlist()
      // this.edit_xiu.date = val.getTime()/1000
      // moment(val).format('yyyy-MM-DD')
      console.log('rrrrrrr',val);
    },

    // 选中修改模式
    Select_mode(val){
      console.log('val',val);

        this.edit_xiu.mode_xiu = val.name
        this.edit_xiu.modeid_xiu = val.id
        this.clickmode = false
    },
    // 选中新增模式
    Select_mode2(val){
      console.log('val',val);
        this.add_arr.mode_add = val.name
        this.currentData.mode_id = val.id
        this.add_arr.modeid_add = val.id
        this.clickmode2 = false
    },
    // 取消分区
    fenqu_click(){
      this.clickfenqu=false
    },
    // 选中修改分区
    Select_fenqu(val){
      const hao_arr = []
        this.edit_xiu.fenqu_xiu = val.name
        this.edit_xiu.zong_id = val.id
      for(let i in this.jihao_arr2){
        if(this.jihao_arr2[i].zone_id==val.id){
          console.log('val',val,this.jihao_arr2[i]);
          hao_arr.push(this.jihao_arr2[i])
        }
      }
      this.jihao_arr = hao_arr
      this.clickfenqu = false

    },
    // 新增修改分区
    Select_fenqu2(val){
      const hao_arr = []
        // this.add_arr.fenqu_add =this.hao
        this.add_arr.fenqu_add = val.name
        this.add_arr.zong_id = val.id
      for(let i in this.jihao_arr2){
        if(this.jihao_arr2[i].zone_id==val.id){
          console.log('val',val,this.jihao_arr2[i]);
          hao_arr.push(this.jihao_arr2[i])
        }
      }
      this.jihao_arr = hao_arr
      this.clickfenqu2 = false

    },
    // 修改班次
    selectSchedulType(value){
      this.edit_xiu.type_xiu = value
    },
    // 新增的班次
    selectSchedulType2(value){
      this.add_arr.type_add = value
    },
    // 修改选中机号
    Select_jihao(val){
        console.log('vvvvv',val);
        this.clickjihao = false
        this.edit_xiu.jihao_xiu =val.cut
        this.edit_xiu.bed_id = val.jihao_id
        this.edit_xiu.zong_id = val.zone_id
    },
    // 新增的机号
    Select_jihao2(val){

        console.log('vvvvv',val);
        this.clickjihao2 = false
        this.add_arr.jihao_add =val.cut
        this.add_arr.bed_id = val.jihao_id
        this.add_arr.zong_id = val.zone_id

    },
    // 取消修改机号
    jihao_click(){
      this.clickjihao = false
    },
    // 确认修改
    xiugai_edit(){
      // && this.edit_xiu.patientid_xiu==this.editvalue.patient_id
      const scheduleZone = this.scheduleZone

      if(this.edit_xiu.patientid_xiu==this.editvalue.patient_id &&
         this.edit_xiu.modeid_xiu==this.editvalue.mode_id &&
         this.edit_xiu.date == this.editvalue.schedule_date){
        for(let i in scheduleZone){
          if(this.edit_xiu.bed_id==scheduleZone[i].jihao_id){
            // console.log('88888883');
            if(this.edit_xiu.type_xiu==1){
              if(scheduleZone[i].Mon_M.patient_id != ' '){
                this.jiaotishow=true
                this.jiaohuan={
                  id : scheduleZone[i].Mon_M.schedule_id,
                  name: scheduleZone[i].Mon_M.patient,
                  mode_id: scheduleZone[i].Mon_M.mode_id
                }

              }else{
                let params={
                  schedule_type: this.edit_xiu.type_xiu,
                  schedule_date: this.edit_xiu.date,
                  patient_id: this.edit_xiu.patientid_xiu,
                  bed_id: this.edit_xiu.bed_id,
                  schedule_week:this.edit_xiu.schedule_week,
                  mode_id: this.edit_xiu.modeid_xiu,
                  id: this.edit_xiu.schedule_id
                }
                this.kongbai(params)
                this.xiugaishow=false
              }
            }else if(this.edit_xiu.type_xiu==2){
              if(scheduleZone[i].Mon_A.patient_id != ''){
                this.jiaotishow=true
                this.jiaohuan={
                  id : scheduleZone[i].Mon_A.schedule_id,
                  name: scheduleZone[i].Mon_A.patient,
                  mode_id: scheduleZone[i].Mon_A.mode_id
                }
              }else{
                let params={
                  schedule_type: this.edit_xiu.type_xiu,
                  schedule_date: this.edit_xiu.date,
                  patient_id: this.edit_xiu.patientid_xiu,
                  bed_id: this.edit_xiu.bed_id,
                  schedule_week:this.edit_xiu.schedule_week,
                  mode_id: this.edit_xiu.modeid_xiu,
                  id: this.edit_xiu.schedule_id
                }
                this.kongbai(params)
                this.xiugaishow=false
              }
            }else{
              if(scheduleZone[i].Mon_N.patient_id != ''){
                this.jiaotishow=true
                this.jiaohuan={
                  id : scheduleZone[i].Mon_N.schedule_id,
                  name: scheduleZone[i].Mon_N.patient,
                  mode_id: scheduleZone[i].Mon_N.mode_id
                }
              }else{
                let params={
                  schedule_type: this.edit_xiu.type_xiu,
                  schedule_date: this.edit_xiu.date,
                  patient_id: this.edit_xiu.patientid_xiu,
                  bed_id: this.edit_xiu.bed_id,
                  schedule_week:this.edit_xiu.schedule_week,
                  mode_id: this.edit_xiu.modeid_xiu,
                  id: this.edit_xiu.schedule_id
                }
                this.kongbai(params)
                this.xiugaishow=false
              }
            }
          }

        }
      }else{
        if(this.edit_xiu.bed_id == this.editvalue.bed_id &&
            this.edit_xiu.type_xiu == this.editvalue.schedulType ){

              let params={
                id_one:this.editvalue.patient_id,
                id_two:this.edit_xiu.patientid_xiu,
                mode_id:this.edit_xiu.modeid_xiu,
                schedule_date:this.edit_xiu.date,
                bed_id:this.edit_xiu.bed_id,
                zone_id:this.edit_xiu.zong_id,
                schedule_type:this.edit_xiu.type_xiu
              }
          this.updateschedule(params)
        }else{
          for(let i in scheduleZone){
            if(this.edit_xiu.bed_id==scheduleZone[i].jihao_id){

              if(this.edit_xiu.type_xiu==1){
                if(scheduleZone[i].Mon_M.patient_id != ' '){
                  this.jiaotishow=true
                  this.jiaohuan={
                    id : scheduleZone[i].Mon_M.schedule_id,
                    name: scheduleZone[i].Mon_M.patient,
                    mode_id: scheduleZone[i].Mon_M.mode_id
                  }
                  console.log('1111111',scheduleZone[i].Mon_M.schedule_id);
                }else{
                  let params={
                    schedule_type: this.edit_xiu.type_xiu,
                    schedule_date: this.edit_xiu.date,
                    patient_id: this.edit_xiu.patientid_xiu,
                    bed_id: this.edit_xiu.bed_id,
                    schedule_week:this.edit_xiu.schedule_week,
                    mode_id: this.edit_xiu.modeid_xiu,
                    id: this.edit_xiu.schedule_id
                  }
                  this.kongbai(params)
                  this.xiugaishow=false
                }
              }else if(this.edit_xiu.type_xiu==2){
                if(scheduleZone[i].Mon_A.patient_id != ''){
                  this.jiaotishow=true
                  this.jiaohuan={
                    id : scheduleZone[i].Mon_A.schedule_id,
                    name: scheduleZone[i].Mon_A.patient,
                    mode_id: scheduleZone[i].Mon_A.mode_id
                  }
                }else{
                  let params={
                    schedule_type: this.edit_xiu.type_xiu,
                    schedule_date: this.edit_xiu.date,
                    patient_id: this.edit_xiu.patientid_xiu,
                    bed_id: this.edit_xiu.bed_id,
                    schedule_week:this.edit_xiu.schedule_week,
                    mode_id: this.edit_xiu.modeid_xiu,
                    id: this.edit_xiu.schedule_id
                  }
                  this.kongbai(params)
                  this.xiugaishow=false
                }
              }else{
                if(scheduleZone[i].Mon_N.patient_id != ''){
                  this.jiaotishow=true
                  this.jiaohuan={
                    id : scheduleZone[i].Mon_N.schedule_id,
                    name: scheduleZone[i].Mon_N.patient,
                    mode_id: scheduleZone[i].Mon_N.mode_id
                  }
                }else{
                  let params={
                    schedule_type: this.edit_xiu.type_xiu,
                    schedule_date: this.edit_xiu.date,
                    patient_id: this.edit_xiu.patientid_xiu,
                    bed_id: this.edit_xiu.bed_id,
                    schedule_week:this.edit_xiu.schedule_week,
                    mode_id: this.edit_xiu.modeid_xiu,
                    id: this.edit_xiu.schedule_id
                  }
                  this.kongbai(params)
                  this.xiugaishow=false
                }
              }
            }
          }
        }
      }

      return this.jiaohuan.id
    },
    // 替换
    Replace(){
      let params={
        id_one:this.edit_xiu.schedule_id,
        id_two:this.jiaohuan.id
      }
      getcoversch(params).then((response) => {
        console.log('response',response.data);
        if(response.data.state ==1){
          Toast('替换成功')
        }else{
          Toast('操作失败')
        }
        this.getlist()
        this.jiaotishow=false
        this.xiugaishow=false
      })
    },
    // 交换
    interchange(){
      let params={
        id_one:this.edit_xiu.schedule_id,
        id_two:this.jiaohuan.id
      }
      getexchange(params).then((response) =>{
        if(response.data.state ==1){
          Toast('互换成功')
        }else{
          Toast('操作失败')
        }
        this.jiaotishow=false
        this.xiugaishow=false
        // console.log('22222222',response.data)
        this.getlist()
      })
    },
    // 空床调班
    kongbai(params){
      changeScheduleBed(params).then((response) =>{
        if(response.data.state ==1){
          Toast('调班成功')
        }else{
          Toast('操作失败')
        }
        this.getlist()
      })
    },
    // 新增患者
    appendclick(){
      const scheduleZone = this.scheduleZone
      let params={
        patient_id: this.add_arr.patientid_add,
        mode: this.add_arr.modeid_add,
        schedule_type: this.add_arr.type_add,
        bed: this.add_arr.bed_id
      }
      if(this.add_arr.patient_add == '' || this.add_arr.mode_add ==''){

        if(this.add_arr.patient_add == ''){
          this.$toast({
              message : '请选择患者',
              className : 'toastIndex',
          });
        }else{
          this.$toast({
              message : '请选择透析模式',
              className : 'toastIndex',
          });
        }
      }else{
        createSchedule(this.add_arr.patientid_add, this.currentData).then(res => {
          console.log("处方2332323232322332")
          console.log('5555',res.data);
          if (res.data.state == 0) {
            this.$toast({
                message : res.data.msg,
                className : 'toastIndex',
            });
          } else {
            this.addshow = false
            Toast.success('排班成功!')
            this.getlist()
          }
        }).catch(() => {})

        // postUrgentSchedule(params).then((response) =>{
        //   this.getlist()
        //   this.addshow=false
        // })
      }


    },
    // 删除排班接口
    getDeleteSchedule(id){
      DeleteSchedule(id).then((response) =>{

        if(response.data.state==1){
          Toast('删除成功')
        }else{
          var msg = response.data.msg
          this.$toast(msg)
        }
        this.getlist()
      })
      this.deleteshow=false
    },
    updateschedule(params){

      updateschedule(params).then((response) => {
        console.log('response.data',response.data);
        this.xiugaishow=false
        this.getlist()
      })
    }
  },
  created(){
    this.getGetAllPatients()
    this.getlist()
    let value = new Date()
    let year = value.getFullYear()
    let month = value.getMonth() + 1
    let day = value.getDate()
    if (month >= 1 && month <= 9) {
      month = `0${month}`
    }
    if (day >= 1 && day <= 9) {
      day = `0${day}`
    }
    this.nowDate = `${year}-${month}-${day}`
    // this.start_time = `${year}-${month}-${day}`
  }
}
</script>

<style lang="scss" scoped>
 .xuanze{
  display: flex;
  .xuanze_sele{
    flex: 1;
    .toolOne {
    width: 6.25rem;
    height: 1.875rem;
    background: rgba(246, 246, 246, 1);
    border-radius: 5px;
    text-align: center;
    font-size: 0.8125rem;
    color: #8d8d8d;
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-left: 0.8125rem;
    -webkit-touch-callout:none;
    -webkit-user-select:none;
    -khtml-user-select:none;
    -moz-user-select:none;
    -ms-user-select:none;
    user-select:none;
  }
  }
 }
.dialog{
  margin-bottom:10px;
}
.huanze_xinxi{
  width: 100%;
  height: 80%;
  background: rgb(188, 236, 247);
  font-size: 18px;
  text-align: center;
  padding: 5px;
}
.patient_name{
  padding: 6px 0;
}
.el-dialog__wrapper{
  /deep/.el-dialog__header {
      padding: 20px 20px 10px !important;
      background: #409EFE !important;
  }
  // ::deep(.el-dialog__header){
  //   padding: 20px 20px 10px !important;
  //     background: #409EFE !important;
  // }
}
.xiugai2{
  .toolOne {
    width: 6.25rem;
    height: 1.875rem;
    background: hsl(0, 0%, 96%);
    border-radius: 5px;
    text-align: center;
    font-size: 0.8125rem;
    color: #8d8d8d;
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-left: 0.8125rem;
    -webkit-touch-callout:none;
    -webkit-user-select:none;
    -khtml-user-select:none;
    -moz-user-select:none;
    -ms-user-select:none;
    user-select:none;
  }
  .borders{
    border: 1px solid #DCDFE6;
    border-radius: 5px;
    width: 70%;
    line-height: 40px;
    padding: 0 5px;
  }
  .active{
    border: 1px solid #409EFE;
    color: #409EFE;
    /* padding: 5px; */
    width: 50px;
    line-height: 40px;
    text-align: center;
    border-radius: 5px;
  }
  ul li{
    float: left;
    margin-right: 20px;
  }
  .modestyle{
    color: #409EFE;
  }

}
.Cancelclass{
    text-align: center;
    line-height: 40px;
    font-size: 18px;
    border-top: 1px solid #e5e5e5;
  }
</style>
<style lang="scss">
  .xiugai{
    .el-dialog{
      .el-dialog__header{
        padding: 20px 20px 10px !important;
        background: #409EFE !important;
        .el-dialog__title {
            line-height: 24px;
            font-size: 18px;
            color: white;
        }
      }
      .el-dialog__body{
        padding: 25px 10px 30px ;
      }
      .el-dialog__footer{
        padding: 10px 10px 20px
      }
    }

  }
  .huanzhe_xiu{
    .el-dialog{
      .el-dialog__body{
        padding: 0 0 !important;
        // color: #606266;
        // font-size: 14px;
        // word-break: break-all;
      }
    }
    .listBox{
      height: 400px;
      overflow: overlay;
      >div{
        padding: 1rem .625rem;
        border-bottom: 1px solid #e5e5e5;
        font-size: .975rem;
        color:#323233;
      }
      >ul li{
        padding: 1rem .625rem;
        border-bottom: 1px solid #e5e5e5;
        font-size: .875rem;
        color:#323233;
      }
    }
  }
  .toastIndex{
    z-index: 10000 !important;
  }
  .datepicker{
    font-size: 14px;
    .el-input__inner{
      font-size: 14px;
      padding: 0 5px;
      padding-right: 0px !important;
      padding-left: 0px !important;
    }
    .el-input__prefix{
      font-size: 14px;
      .el-icon-date:before {
          content: "";
      }
    }
  }
  .ellipsis-pop{
    min-width: 83px !important;
  }
  .el-table .el-table__cell {
    padding: 5px 0 !important;
    min-width: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    text-overflow: ellipsis;
    vertical-align: middle;
    position: relative;
    text-align: left;
  }
  .eltable{
    .cell{
      padding-left: 0px !important;
      padding-right: 0px !important;
    }
  }
</style>
