<template>
  <div class="standingorder">
    <div style="">
      <table class="table doctorTable" border="1">
        <tr>
          <!-- <th width="30">医嘱时间</th>
          <th width="20">开嘱医生</th>
          <th width="60">医嘱内容</th>
          <th width="60">推送频率</th>
          <th width="60">医嘱状态</th> -->
          <th width="50">开嘱医生</th>
          <th width="60">开始时间</th>
          <th width="60">医嘱内容</th>
          <th width="60">推送频率</th>
          <th width="50">是否停用</th>
          <th width="50">停用时间</th>
          
        </tr>
        <template v-for="(group, group_index) in advice_groups">
                <tr
                  v-for="(advice, advice_index) in group.advices"
                  :key="'No' + advice.id + advice_index + group_index"
                  :class="{ 'row-class-active': current_group_index == group_index && current_advice_index < 0 }"
                >
                  <td
                    v-if="advice_index == 0"
                    :rowspan="group.advices.length"
                    @click="selectGroupAdviceAction(group_index, -1, null,group)"
                  >
                    <span v-if="advice.parent_id==0">{{getAdviceName(advice.advice_doctor)}}</span>
                    <span v-else></span>
                  </td>

                  <td
                    v-if="advice_index == 0"
                    :rowspan="group.advices.length"
                    @click="selectGroupAdviceAction(group_index, -1, null,group)"
                  >
                    <span>{{uParseTime(advice.start_time, '{y}-{m}-{d} {h}:{i}')}}</span>
                  </td>

                  <td
                    :class="{ 'advice_content': advice.parent_id == 0, 'subadvice_content': advice.parent_id > 0, 'td-active':current_group_index == group_index  && advice.is_selected == 1 }"
                    @click="selectAdviceAction(group_index, advice_index, advice)"
                  >
                    <div class="txt" v-if="advice.stop_state == 1" style="color: red">
                      <span>{{advice.advice_name }}</span>
                      <span v-if="advice.advice_desc">({{ advice.advice_desc }}{{advice.drug_spec_unit}})</span>
                      <span v-if="advice.prescribing_number">&nbsp;&nbsp;{{advice.prescribing_number}}{{advice.prescribing_number_unit}}</span>
                      <span v-if="advice.single_dose">{{advice.single_dose}}{{advice.single_dose_unit}}</span>
                      <span v-if="advice.single_dose">单次用量{{advice.single_dose}}{{advice.single_dose_unit}}</span>

                      <span v-if="advice.parent_id == 0">{{advice.delivery_way}}</span>
                      <span v-if="advice.parent_id == 0">{{advice.execution_frequency}}</span>
                      <span
                        v-if="advice.parent_id == 0 && advice.remark.length > 0"
                      >({{advice.remark}})</span>
                    </div>

                    <div class="txt" v-if="advice.stop_state == 2 || advice.stop_state == 0">
                      <span>{{advice.advice_name }}</span>
                      <span v-if="advice.advice_desc">({{ advice.advice_desc }}{{advice.drug_spec_unit}})</span>
                      <span v-if="advice.prescribing_number">&nbsp;&nbsp;{{advice.prescribing_number}}{{advice.prescribing_number_unit}}</span>
                      <span v-if="advice.single_dose">{{advice.single_dose}}{{advice.single_dose_unit}}</span>
                      <span v-if="advice.single_dose">单次用量{{advice.single_dose}}{{advice.single_dose_unit}}</span>

                      <span v-if="advice.parent_id == 0">{{advice.delivery_way}}</span>
                      <span v-if="advice.parent_id == 0">{{advice.execution_frequency}}</span>
                      <span
                        v-if="advice.parent_id == 0 && advice.remark.length > 0"
                      >({{advice.remark}})</span>
                    </div>
                  </td>

                  <td
                    :class="{'td-active':current_group_index == group_index  && advice.is_selected == 1}"
                    @click="selectAdviceAction(group_index,advice_index, advice)"
                  >
                  <span v-if="advice.frequency_type==1">每次必推</span>
                  <span v-if="advice.frequency_type==2 && advice.day_count>0">
                      {{ advice.day_count }} 天/次
                  </span>
                  <span v-if="advice.frequency_type==3">
                      {{ advice.week_day }}
                  </span>
                  </td>

                  <td
                    :class="{'td-active':current_group_index == group_index  && advice.is_selected == 1}"
                    @click="selectAdviceAction(group_index,advice_index, advice)"

                  > 
                  <span v-if="advice.stop_state==1">已停用</span>
                  <span v-if="advice.stop_state==2">未停用</span>
                  </td>

                  <td
                    :class="{'td-active':current_group_index == group_index  && advice.is_selected == 1}"
                    @click="selectAdviceAction(group_index,advice_index, advice)"

                  > 
                    {{ uParseTime(advice.stop_time, '{y}-{m}-{d} {h}:{i}') }}
                  </td>
                 
                </tr>
              </template>
        <!-- <tr v-for="(item,index) in adviceList" :key="index">
          <td width="30">{{getTime(item.start_time) }}</td>
          <td width="20">{{ getAdviceName(item.advice_doctor) }}</td>
          <td width="60">
            <span>{{item.advice_name }}</span>
            <span v-if="item.advice_desc">({{ item.advice_desc }}{{item.drug_spec_unit}})</span>
            <span v-if="item.prescribing_number">&nbsp;&nbsp;{{item.prescribing_number}}{{item.prescribing_number_unit}}</span>
            <span v-if="item.single_dose">{{item.single_dose}}{{item.single_dose_unit}}</span>
            <span v-if="item.single_dose">单次用量{{item.single_dose}}{{item.single_dose_unit}}</span>

            <span v-if="item.parent_id == 0">{{item.delivery_way}}</span>
            <span v-if="item.parent_id == 0">{{item.execution_frequency}}</span>
            <span
              v-if="item.parent_id == 0 && item.remark.length > 0"
            >({{item.remark}})</span>
          </td>
          <td width="60">
             <span v-if="item.frequency_type==1">每次必推</span>
             <span v-if="item.frequency_type==2 && item.day_count>0">
                {{ item.day_count }} 天/次
             </span>
             <span v-if="item.frequency_type==3">
                {{ item.week_day }}
             </span>
          </td>
          <td width="60">
            <span v-if="item.stop_state==1">已执行</span>
            <span v-if="item.stop_state==2">未执行</span>
          </td>
        </tr> -->
       
      </table>

      <van-popup v-model="doctorAdviceshow" get-container="#app" class="doctorAdvicePopup" style="z-index:3200;" position="top" :style="{ height: '100%' }">
                <newAddOrder @close="closeDoctorAdviceshow" :drugList="drugList" :unitsOption="unitsOption" :delivery_way_options="deliveryWayOptions" :execution_frequency_options="executionFrequencyOptions"  @child-event="getClose"></newAddOrder>
      </van-popup>
      <van-popup v-model="doctorEditAdviceshow" get-container="#app" class="doctorAdvicePopup" style="z-index:3200;" position="top" :style="{ height: '100%' }">
                <editOrder @close="closeDoctorAdviceshowOne" :drugList="drugList" :unitsOption="unitsOption" :delivery_way_options="deliveryWayOptions"  :adviceObj="adviceObj" :execution_frequency_options="executionFrequencyOptions"  @child-event="getCloseFour" ref="modify_advice_form"></editOrder>
      </van-popup>
      <van-popup v-model="subDrugshow" get-container="#app" class="doctorAdvicePopup" style="z-index:3200;" position="top" :style="{ height: '100%' }">
              <subDrugOrder ref="subdrug_form" @back="subDrugshow = false" :parent_id="parent_id" :drugList="drugList" :unitsOption="unitsOption" :delivery_way_options="deliveryWayOptions" :execution_frequency_options="executionFrequencyOptions" :groupno="groupno" @child-event="getCloseOne"></subDrugOrder>
       </van-popup>

       <van-popup v-model="editDrugshow" get-container="#app" class="doctorAdvicePopup" style="z-index:3200;" position="top" :style="{ height: '100%' }">
              <editDrugOrder ref="subdrug_form_one" @back="subDrugshow = false" :parent_id="parent_id" :drugList="drugList" :unitsOption="unitsOption" :delivery_way_options="deliveryWayOptions" :execution_frequency_options="executionFrequencyOptions" :groupno="groupno" @child-event="getCloseTwo" :adviceObj="adviceObj"></editDrugOrder>
       </van-popup>

       <van-popup v-model="adviceTemplateShow" get-container="#app" class="doctorAdvicePopup" style="z-index:3200;" position="top" :style="{ height: '100%' }">
            <drugTemplate
            @back="adviceTemplateShow = false"
            @finish="didSelectTemplateAdvice"
            :templates="adviceTemplates"
            @child-event="getCloseThree"
           >
          </drugTemplate>
       </van-popup>
    </div>

    <div>
        <div class="preserveBox" >
          <div style="margin: 0 auto;">
            <span @click="modifySubdviceAction">修改子医嘱</span>
            <span @click="deleteSubAdviceAction">删除子医嘱</span>
          </div>
        </div>
        <div class="preserveBox">
          <div style="display: flex;justify-content: space-between;width: 100%;">
              <span :class="{ forbid: is_has_create != true }" @click="showNew">新增</span>
              <span :class="{ forbid: is_has_create != true }" @click="stopAdviceAction">停用</span>
              <span @click="openNewChild">添加子药</span>
              <span  @click="modifyAdviceAction">修改</span>
              <span  @click="deleteAdviceAction">删除</span>
            
              <!-- <span v-if="his_is_open != 1 && user_type ==3" @click="checkAllAdvice">全部核对</span> -->
          </div>
        </div>
    </div>
    <van-action-sheet
      class="actionSheet"
      v-model="sheetShow"
      :actions="actions"
      cancel-text="取消"
      close-on-click-action
      @select="onCancelSheet"
    />

    <mt-datetime-picker
        class="datetimePicker"
        ref="exec_time"
        type="datetime"
        @confirm="BatchHandleExecTime"
        v-model="nowExecTime"
      ></mt-datetime-picker> 
  </div>
</template>

<script>

import newAddOrder from './components/newAddOrder'
import editOrder from './components/editOrder.vue'
import subDrugOrder from './components/subDrugOrder'
import editDrugOrder from './components/editDrugOrder'
import drugTemplate from "./components/drugTemplate.vue"
import { getAllMobileDrugList,getAdviceConfig,getLongDoctorAdviceByPatient,deleteSelfAdvcieSubAdvice,getEditAdviceAction,stopLongAdvice } from '@/api/advice'
import { getDataConfig } from '@/utils/data'
import { uParseTime } from "@/utils/tools";
import { Dialog,Toast} from 'vant'
  export default{
    components:{
      newAddOrder,
      subDrugOrder,
      editOrder,
      editDrugOrder,
      drugTemplate
    },
    data(){
      return{
        nowExecTime: new Date(),
        org_id:'',
        is_has_create: true,
        sheetShow: false,
        subDrugshow: false,
        doctorAdviceshow:false,
        actions: [{name: '选择模版'},{ name: '新增医嘱' }],
        drugList:[],
        unitsOption:[],
        deliveryWayOptions: [],
        executionFrequencyOptions: [],
        adviceTemplates:[],
        advice_groups:[],
        adminRoles:[],
        current_group_index: -1,
        curerentAdvice: {},
        currentAdvices:[],
        currentSubAdvices: [],
        current_select_object: -1,
        current_advice_index: -1,
        current_advice: null,
        currentAdviceIdsStr: '',
        currentAdvices: [],
        currentSubAdvices: [],
        parent_id:0,
        groupno:0,
        doctorEditAdviceshow:false,
        adviceObj:{},
        editDrugshow:false,
        adviceTemplateShow:false,
        adviceTemplates: [],
      }
    },
    methods:{
      didSelectTemplateAdvice(){

      },
      uParseTime (time, format) {
      if (time == 0) {
        return ''
      }
      return uParseTime(time, format)
     },
      getTime(time) {
       return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
      },
      getClose(){
        this.doctorAdviceshow = false
        this.getLongDoctorAdviceByPatient()
      },
      getCloseOne(){
        this.subDrugshow= false
        this.getLongDoctorAdviceByPatient()
      },
      getCloseTwo(){
        this.editDrugshow= false
        this.getLongDoctorAdviceByPatient()
      },
      getCloseThree(){
        this.adviceTemplateShow = false
        this.getLongDoctorAdviceByPatient()
      },
      getCloseFour(){
        this.doctorEditAdviceshow = false
        this.getLongDoctorAdviceByPatient()
      },
      // 修改子医嘱
      modifySubdviceAction(){
        if(this.current_advice.parent_id == 0){
          Toast.fail('请不要勾选主药')
          return
        }
        var params = {
          id:this.current_advice.id
        }
        getEditAdviceAction(params).then(response=>{
          if(response.data.state == 1){
             var advice = response.data.data.advice
             this.adviceObj = advice
             this.drugList = []
             this.drugList = response.data.data.drugList
             this.$nextTick(() => {
               this.$refs.subdrug_form_one.showWithModify(advice)
            })
             this.editDrugshow = true
          }
        })
      },
      deleteSubAdviceAction: function () {
        if(this.current_advice!=null){
           if(this.current_advice.parent_id == 0){
             Toast.fail('所属医嘱不是子药，无法删除')
             return
           }
        }
        var params = {
          id:this.current_advice.id
        }
        Dialog.confirm({
          title: '删除医嘱',
          message: '确认删除医嘱吗?'
        }).then(() => {
          Toast.loading({forbidClick: true, duration: 0})
          deleteSelfAdvcieSubAdvice(params).then(response => {
              if(response.data.state == 1) {
                var msg = response.data.data.msg
                Toast.success('删除成功!')
                this.getLongDoctorAdviceByPatient()
              } else {
                Toast.fail(response.data.msg)
              }
            }).catch(err => {
              Toast.fail(err)
            })
        })
      },
      // 添加子药
      openNewChild(){
        this.current_advice = this.currentAdvices[0]
        if(this.currentAdvices.length == 0){
          Toast.fail('请选中1条医嘱')
          return
        }
        console.log("hahhahahah",this.current_advice)
        if(this.current_advice.parent_id>0){
          Toast.fail('所属医嘱为子药无法再添加子药')
          return
        }
        this.parent_id = this.current_advice.id
        this.groupno = this.current_advice.groupno
        getAllMobileDrugList().then(response=>{
          if(response.data.state == 1){
              var drugList = response.data.data.drugList
              console.log("druglsit2222222222222",drugList)
              this.drugList = []
              this.drugList = drugList
              this.subDrugshow = true
          }
        })
     
        
      
      },
      // 修改
      modifyAdviceAction(){
        if(this.current_advice.parent_id >0){
          Toast.fail('请不要勾选子药')
          return
        }
        var params = {
          id:this.current_advice.id
        }
        getEditAdviceAction(params).then(response=>{
          if(response.data.state == 1){
              var advice = response.data.data.advice
             this.adviceObj = advice
             this.drugList = []
             this.drugList = response.data.data.drugList
             this.doctorEditAdviceshow = true
             this.$nextTick(() => {
               this.$refs.modify_advice_form.showWithModify(advice)
            })
           
          }
        })
      
      },
      // 删除
      deleteAdviceAction(){
        if(this.current_advice!=null){
           if(this.current_advice.parent_id > 0){
             Toast.fail('所属医嘱是子药，无法删除')
             return
           }
        }
        var params = {
          id:this.current_advice.id
        }
        Dialog.confirm({
          title: '删除医嘱',
          message: '确认删除医嘱吗?'
        }).then(() => {
          Toast.loading({forbidClick: true, duration: 0})
          deleteSelfAdvcieSubAdvice(params).then(response => {
              if(response.data.state == 1) {
                var msg = response.data.data.msg
                Toast.success('删除成功!')
                this.getLongDoctorAdviceByPatient()
              } else {
                Toast.fail(response.data.msg)
              }
            }).catch(err => {
              Toast.fail(err)
            })
        })

      },
      stopAdviceAction(){
        if(this.current_advice ==null){
          Toast.success('请选择要停用的医嘱!')
        }
        this.nowExecTime = new Date()
        this.$refs.exec_time.open()

      },
      showNew () {
        this.sheetShow = true
      },
      onCancelSheet (action, index) {
        console.log("aciton-====",action)
        if (action.name == '新增医嘱') {
          getAllMobileDrugList().then(response=>{
            if(response.data.state ==1){
              var drugList = response.data.data.drugList
              console.log("druglsit2222222222222",drugList)
               this.drugList = []
               this.drugList = drugList
              this.doctorAdviceshow = true
            }
          })
        } else if (action.name == '选择模版') {
          console.log("选择模版-----------------------")
          this.adviceTemplateShow = true
        }
      },
      closeDoctorAdviceshow () {
        this.doctorAdviceshow = false
      },
      closeDoctorAdviceshowOne(){
       this.doctorEditAdviceshow = false
      },
      getAdviceConfig () {
        getAdviceConfig().then(response => {
        if (response.data.state == 1) {
          this.deliveryWayOptions = response.data.data.drugways === null ? []: response.data.data.drugways
          this.executionFrequencyOptions = response.data.data.efs === null ? [] : response.data.data.efs
          this.adviceTemplates = response.data.data.advice_templates === null ? []  : response.data.data.advice_templates
          console.log("模版内容----------------------------",this.adviceTemplates)
        }
      })
     },
     getLongDoctorAdviceByPatient(){
       var params= {
         patient_id:parseInt(this.$route.query.patient_id),
       }
      getLongDoctorAdviceByPatient(params).then(response=>{
          if(response.data.state ==1){
            var adviceList = response.data.data.adviceList
            console.log("长期adviceList",adviceList)
            if(adviceList!=null && adviceList.length >0){
              for(let i=0;i<adviceList.length;i++){
                let dataInfo = {}
                adviceList.forEach((item, index) => {
              
                  let { groupno } = item
                  if (!dataInfo[groupno]) {
                    dataInfo[groupno] = {
                      groupno:item.groupno,
                      advices: [],
                    }
                  }
                })
                let arr = Object.values(dataInfo)
               
               if(arr!=null && arr.length>0){
                  for(let i=0;i<arr.length;i++){
                    for(let j=0;j<adviceList.length;j++){
                       if(arr[i].groupno == adviceList[j].groupno){
                           arr[i].advices.push(adviceList[j])
                       }
                    }
                  }
               }
               console.log("arr-----------",arr)
               this.advice_groups = []
               this.advice_groups = arr
              }
            }
           
            var adminRoles = response.data.data.adminRoles
            console.log("hahhahaha",adminRoles)
            this.adminRoles = adminRoles
          }
      })
     },
     getAdviceName(admin_user_id){
       var user_name = ""
       for(let i=0;i<this.adminRoles.length;i++){
          if(admin_user_id == this.adminRoles[i].admin_user_id){
             user_name = this.adminRoles[i].user_name
          }
       }
       return user_name
     },
     selectAdviceAction: function (group_index, advice_index, advice) {

      this.curerentAdvice = advice
      if ((this.current_group_index != -1 &&this.current_group_index != group_index) || advice.parent_id > 0) {
        // 选择其他组，将原来的组选择状态清除
        this.currentAdvices = []
        this.currentSubAdvices = []
        for (let i = 0; i < this.advice_groups.length; i++) {
          for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
            var advices = this.advice_groups[i].advices[y]
            advices.is_selected = 0
          }
        }
      }

      for (let i = 0; i < this.advice_groups.length; i++) {
        // 选择子医嘱，将已经选择的医嘱选择状态清除
        for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
          var advices = this.advice_groups[i].advices[y]
          if (advices.parent_id > 0) {
            advices.is_selected = 0
          }
        }
      }

      for (let i = 0; i < this.advice_groups.length; i++) {
        // 设置选择状态
        for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
          var advices = this.advice_groups[i].advices[y]
          if (advices.id == advice.id) {
            if (advice.is_selected == 1) {
              advice.is_selected = 0
              for (let a = this.currentAdvices.length - 1; a >= 0; a--) {
                if (this.currentAdvices[a].id == advice.id) {
                  this.currentAdvices.splice(a, 1)
                }
              }
            } else {
              advice.is_selected = 1
              if (advice.parent_id == 0) {
                this.currentAdvices.push(advice)
              }
            }
          }
        }
      }

      if (advice.parent_id == 0) {
        this.currentSubAdvices = []
      } else {
        this.currentSubAdvices.push(advice)
      }

      this.current_select_object = 1 // 单条医嘱
      this.current_group_index = group_index
      this.current_advice_index = advice_index
      this.current_advice = advice
      },
      selectGroupAdviceAction: function (group_index,advice_index,advice,group) {
        console.log("group====================",group)
      if (this.current_group_index != -1 &&this.current_group_index != group_index) {

        // 选择其他组，将原来的组选择状态清除
        this.currentAdvices = []
        this.currentSubAdvices = []
        for (let i = 0; i < this.advice_groups.length; i++) {
          for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
            var advices = this.advice_groups[i].advices[y]
            advices.is_selected = 0
          }
        }
      }

      for (let i = 0; i < this.advice_groups.length; i++) {
        // 选择子医嘱，将已经选择的医嘱选择状态清除
        for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
          var advices = this.advice_groups[i].advices[y]
          if (advices.parent_id > 0) {
            advices.is_selected = 0
          }
        }
      }
      this.currentAdvices = []
      for (let i = 0; i < this.advice_groups.length; i++) {
        for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
          var advices = this.advice_groups[i].advices[y]
          if (advices.groupno == group.group_no) {
            advices.is_selected = 1
            this.currentAdvices.push(advices)
          }
        }
      }
      this.current_select_object = 2 // 单组医嘱
      this.current_group_index = group_index
      this.current_advice_index = advice_index
      this.current_advice = advice

    },
    BatchHandleExecTime(time){
       var exceTime = this.handleTime(time)
       var params = {
        execution_time: exceTime,
        patient_id:parseInt(this.$route.query.patient_id),
        id:this.curerentAdvice.id,
       }
       console.log("params----",params)
      stopLongAdvice(params).then(response=>{
         if(response.data.state == 1){
          Toast.success('停用成功!')
          this.getLongDoctorAdviceByPatient()
         }
      })
    },
    handleTime (time) {
      var year = time.getFullYear()
      var month = time.getMonth() + 1
      var day = time.getDate()
      var hour = time.getHours()
      var minute = time.getMinutes()
      if (month < 10) {
        month = '0' + month
      }
      if (day < 10) {
        day = '0' + day
      }
      if (hour < 10) {
        hour = '0' + hour
      }
      if (minute < 10) {
        minute = '0' + minute
      }
      return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':00'
    },
   
    },
    created(){
      this.getLongDoctorAdviceByPatient()
      this.getAdviceConfig()
      this.unitsOption = getDataConfig('hemodialysis', 'units')
      
      for (var index in this.unitsOption) {
        this.unitsObj[this.unitsOption[index].id] = this.unitsOption[index]
      }
      this.org_id = this.$store.getters.user.template_info.org_id

      
    }
  }
</script>
<style lang="scss" scoped>
.standingorder{
    font-size: .875rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    >:first-child{
        flex: 1;
        overflow-y: auto;
    }
    .adviceTitle{
        display: flex;
        justify-content: space-between;
    }
    .executionBox{
        font-size: .75rem;
        display: flex;
        color: #4bb467;
    }
    .preserveBox{
        height: 3.125rem;
        display: flex;
        justify-content: space-between;
        padding: 0 .625rem;
        align-items: center;
        font-size: 1rem;
        >div>span{
            height: 2.25rem;
            line-height: 2.25rem;
            padding: 0 .375rem;
            font-size: .875rem;
            border-radius: 5px;
            border: 1px solid #409eff;
            color: #409eff;
            display: inline-block;
        }

        .forbid {
            color: #c6cdd2 !important;
            border: 1px solid #c6cdd2 !important;
        }
    }
    .actionSheet{
        top:initial;
        transform: translate3d(0, 0, 0);
        border-radius: 1.25rem 1.25rem 0 0;
    }
    .startTimePicker{
        z-index: 4010 !important;
    }
    .van-button--mini {
        height: 1.5rem;
        padding: 0 .25rem;
        font-size: .625rem;
    }
    .forbid{
        color: #c6cdd2;
    }
    .paddingLeft{
        padding-left: 1.6875rem;
    }
    .deleteColor{
        color: #f56c6c !important;
        border: 1px solid #f56c6c !important;
    }
    .doctorTable{
        font-size: .875rem !important;
        tr th{
            height: 2.25rem !important;
        }
        tr td{
            padding: .5rem 0;
        }
    }

}
.td-active {
  background: #badcff !important;
}
.row-class-active {
    td {
    background: #badcff;
    }
}
.table tr td .txt{
    padding: 0 10px;
    text-align: left;
}
.table tr .subadvice_content {
    padding-left: 20px !important;
}
@media only screen and (max-width: 415px){
    .table {
        width: 850px;
    }
}

</style>
<style lang="scss">
.standingorder{
  padding-top:2.75rem;
    .datetimePicker{
        z-index: 4010 !important;
        .picker-item{
            font-size: .875rem !important;
            height: 44px;
            line-height: 44px;

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

    }
    @media only screen and (min-width: 415px) and (max-width: 767px){
        .table {
            width: 700px;
        }
    }
    @media only screen and (max-width: 415px){
        .table[data-v-365ae4b7] {
            width: 500px;
        }
    }
    .dateInput .mu-text-field-input{
        height: 2.25rem;
        line-height: 2.25rem;
        padding: 0 0.375rem;
        font-size: .875rem;
        border-radius: 5px;
        border: 1px solid #409eff;
        color: #fff;
        display: inline-block;
        width: 2.625rem;
    }
    .dateInput2 .mu-text-field-input{
        height: 2.25rem;
        line-height: 2.25rem;
        padding: 0 0.375rem;
        font-size: .875rem;
        border-radius: 5px;
        border: 1px solid #409eff;
        color: #fff;
        display: inline-block;
        width: 4.375rem;
    }
    .mu-input{
        width: auto;
        margin-bottom: 0;
    }
    .mu-input.has-label .mu-input-label{
        top: 50%;
        transform: translateY(-50%);
        text-align: center;
        font-size: .875rem;
        color: #409eff;
        text-align: center;
        width: 100%;
    }
    .mu-input.has-label{
        padding: 0;
        min-height:auto;
    }

}
</style>