<template>
  <div class="right_con">
    <div class="staff_fgx fl"></div>
    <p class="staff_pay fl">薪资结算</p>
    <div class="fr search mar_T_15">
      <Select class="wid_120 fl" placeholder="员工账号" clearable v-model="search.manager_id" :transfer='true' filterable>
        <Option v-for="(item,index) in staffSelectList" :key="index" :value="item.id">{{item.name}}</Option>
      </Select>
      <span class="search_text mar_L_5">按工资月份：</span>
      <DatePicker :transfer='true' id="month_g" type="month" :value="search.start_time" :options="start_time_op" placeholder="开始时间" class="wid_120" @on-change="bgmonchange"></DatePicker> -
      <DatePicker :transfer='true' id="month_a" type="month" :value="search.end_time" :options="end_time_op" placeholder="结束时间" class="wid_120" @on-change="edmonchange"></DatePicker>
      <Button type="primary" @click="getStaffPay()">搜索</Button>
      <Button class="clear_btn" @click="removeSearch">清空</Button>
    </div>
    <Table :columns="staffPayList" border :data="staffPayData" class="tables clear" ></Table>
    <Table :columns="staffPaySumList" :data="staffPaySumData" border :show-header="false" id="staffpay-table" style="font-weight:bold;border-top:0"></Table>
    <div class="page">
      <Page :total="count" :current="pindex" :page-size="10" size="small" show-total show-elevator @on-change="getStaffPay" class="pageExecal fl"/>
      <a class="extent_btn ivu-btn" ref="excelUrl" @click="downExcel">导出Excel</a>
    </div>
  </div>
</template>
<script>
import { removeSearch } from "@/assets/js/common";
import { getStore } from '@/utils/utils'
export default {
  name: "staff_pay",
  data() {
    return {
      count: 0,
      pindex: 1,
      search: {
        start_time: '',
        end_time: '',
        userdepartment: '',
        manager_id: '',
        studio_id:'',
        department_id:''
      },
      staffPaySumData:[],
      change_btn: {
        is_base_wage: false,
        // is_recharge:false,
        is_full_reward: false,
        is_grow_wage: false,
        is_elder_bonus: false,
        is_overtime_pay: false,
        is_room: false,
        is_food: false,
        is_other: false
      },
      changeval: '',
      curIndex: null,
      otherindex: null,
      start_time_op: {},
      end_time_op: {},
      allTeamList:[],
      staffPaySumList:[
        {
          title:'text',
          width:80,
          render:(h,params)=>{
            return h('span','总计')
          }
        },
        {
          title:'发放时间',
          width:100,
          render:(h,params)=>{
            return h('span','--')
          }
        },
        {
          title:'账号',
          width:130,
          render:(h,params)=>{
            return h('span','--')
          }
        },
        {
          title:'账号ID',
          width:80,
          render:(h,params)=>{
            return h('span','--')
          }
        },
        {
          title:'基本工资',
          width:80,
          key:'base_wage'
        },
        {
          title:'成长基金',
          width:80,
          key:'grow_wage'
        },
        {
          title:'元老奖金',
          width:80,
          key:'elder_bonus'
        },
        {
          title:'消费提成',
          width:81,
          key:'recharge',
        },
        {
          title:'全勤奖',
          width:80,
          key:'full_reward',
        },
        {
          title:'加班费',
          width:80,
          key:'overtime_pay',
        },
        {
          title:'住宿费',
          width:80,
          key:'room',
        },
        {
          title:'餐费',
          width:80,
          key:'food',
        },
        {
          title:'其他',
          width:130,
          key:'other',
        },
        {
          title:'工资',
          minWidth:90,
          key:"total_salary",
          className: "table-special",
        },
        {
          title:'发放人',
          width:90,
          render:(h,params)=>{
            return h('span','--')
          }
        },
        {
          title:'状态',
          width:80,
          render:(h,params)=>{
            return h('span','--')
          }
        },
        {
          title:'操作',
          minWidth:100,
          render:(h,params)=>{
            return h('span','--')
          }
        },
      ],
      staffPayList: [
        {
          title: "工资单ID",
          width: 80,
          key: "id"
        },
        {
          title: "发放时间",
          render: (h, params) => {
            return h("span", params.row.year + "-" + params.row.month);
          },
          width: 100
        },
        {
          title: "账号",
          width: 130,
          key: "manager_name"
        },
        {
          title: "账号ID",
          width: 80,
          key: "manager_id"
        },
        {
          title: "基本工资",
          width: 80,
          render: (h, params) => {
            if ( this.change_btn.is_base_wage && params.index === this.curIndex) {
              return h("Input", {
                props: {
                  type: "text",
                  value: this.changeval,
                  autofocus: "autofocus"
                },
                style: { width: "50px", margin: "0px 5px" },
                class: "is_show_input",
                on: {
                  input: value => {
                    this.changeval = value;
                  },
                  "on-blur": () => {
                    this.saveStaffPayInfo("is_base_wage", params);
                  },
                  "on-keyup": () => {
                    this.clearNoNum();
                  }
                }
              });
            } else {
              return h(
                "span",
                {
                  class: params.row.status===0?"a_text":'',
                  on: params.row.status===0?{
                    click: () => {
                      this.whichchange_btn("is_base_wage");
                      this.curIndex = params.index;
                      this.changeval = this.translateMoneyData(params.row.base_wage / 100);
                    }
                  }:{}
                },
                this.translateMoneyData(params.row.base_wage / 100)
              );
            }
          }
        },
        {
          title:'成长基金',
          width:80,
          render: (h, params) => {
            if (this.change_btn.is_grow_wage && params.index === this.curIndex) {
              return h("Input", {
                props: {
                  type: "text",
                  value: this.changeval,
                  autofocus: "autofocus"
                },
                style: { width: "50px", margin: "0px 5px" },
                class: "is_show_input",
                on: {
                  input: value => {
                    this.changeval = value;
                  },
                  "on-blur": () => {
                    this.saveStaffPayInfo("is_grow_wage", params);
                  },
                  "on-keyup": () => {
                    this.clearNoNum();
                  }
                }
              });
            } else {
              return h("span",
                {
                  class: params.row.status===0?"a_text":'',
                  on: params.row.status===0?{
                    click: () => {
                      this.whichchange_btn("is_grow_wage");
                      this.curIndex = params.index;
                      this.changeval = this.translateMoneyData(params.row.grow_wage / 100);
                    }
                  }:{}
                },
                this.translateMoneyData(params.row.grow_wage / 100)
              );
            }
          }
        },
        {
          title:'元老奖金',
          width:80,
          render: (h, params) => {
            if (this.change_btn.is_elder_bonus && params.index === this.curIndex) {
              return h("Input", {
                props: {
                  type: "text",
                  value: this.changeval,
                  autofocus: "autofocus"
                },
                style: { width: "50px", margin: "0px 5px" },
                class: "is_show_input",
                on: {
                  input: value => {
                    this.changeval = value;
                  },
                  "on-blur": () => {
                    this.saveStaffPayInfo("is_elder_bonus", params);
                  },
                  "on-keyup": () => {
                    this.clearNoNum();
                  }
                }
              });
            } else {
              return h("span",
                {
                  class: params.row.status===0?"a_text":'',
                  on: params.row.status===0?{
                    click: () => {
                      this.whichchange_btn("is_elder_bonus");
                      this.curIndex = params.index;
                      this.changeval = this.translateMoneyData(params.row.elder_bonus / 100);
                    }
                  }:{}
                },
                this.translateMoneyData(params.row.elder_bonus / 100)
              );
            }
          }
        },
        {
          title: "消费提成",
          width: 81,
          render:(h,params)=>{
            return h('span',(Number(params.row.recharge)/100).toFixed(2))
          }
        },
        {
          title: "全勤奖",
          width: 80,
          render: (h, params) => {
            if (this.change_btn.is_full_reward &&params.index === this.curIndex) {
              return h("Input", {
                props: {
                  type: "text",
                  value: this.changeval,
                  autofocus: "autofocus"
                },
                style: { width: "50px", margin: "0px 5px" },
                class: "is_show_input",
                on: {
                  input: value => {
                    this.changeval = value;
                  },
                  "on-blur": () => {
                    this.saveStaffPayInfo("is_full_reward", params);
                  },
                  "on-keyup": () => {
                    this.clearNoNum();
                  }
                }
              });
            } else {
              return h(
                "span",
                {
                  class: params.row.status===0?"a_text":'',
                  on: params.row.status===0?{
                    click: () => {
                      this.whichchange_btn("is_full_reward");
                      this.curIndex = params.index;
                      this.changeval = this.translateMoneyData(params.row.full_reward / 100);
                    }
                  }:{}
                },
                this.translateMoneyData(params.row.full_reward / 100)
              );
            }
          }
        },
        {
          title: "加班费",
          width: 80,
          render: (h, params) => {
            if (
              this.change_btn.is_overtime_pay &&
              params.index === this.curIndex
            ) {
              return h("Input", {
                props: {
                  type: "text",
                  value: this.changeval,
                  autofocus: "autofocus"
                },
                style: { width: "50px", margin: "0px 5px" },
                class: "is_show_input",
                on: {
                  input: value => {
                    this.changeval = value;
                  },
                  "on-blur": () => {
                    this.saveStaffPayInfo("is_overtime_pay", params);
                  },
                  "on-keyup": () => {
                    this.clearNoNum();
                  }
                }
              });
            } else {
              return h(
                "span",
                {
                  class: params.row.status===0?"a_text":'',
                  on: params.row.status===0?{
                    click: () => {
                      this.whichchange_btn("is_overtime_pay");
                      this.curIndex = params.index;
                      this.changeval = this.translateMoneyData(params.row.overtime_pay / 100);
                    }
                  }:{}
                },
                this.translateMoneyData(params.row.overtime_pay / 100)
              );
            }
          }
        },
        {
          title: "住宿费",
          width: 80,
          render: (h, params) => {
            if (this.change_btn.is_room && params.index === this.curIndex) {
              return h("Input", {
                props: {
                  type: "text",
                  value: this.changeval,
                  autofocus: "autofocus"
                },
                style: { width: "50px", margin: "0px 5px" },
                class: "is_show_input",
                on: {
                  input: value => {
                    this.changeval = value;
                  },
                  "on-blur": () => {
                    this.saveStaffPayInfo("is_room", params);
                  },
                  "on-keyup": () => {
                    this.clearNoNum();
                  }
                }
              });
            } else {
              return h(
                "span",
                {
                  class: params.row.status===0?"a_text":'',
                  on: params.row.status===0?{
                    click: () => {
                      this.whichchange_btn("is_room");
                      this.curIndex = params.index;
                      this.changeval = this.translateMoneyData(params.row.room / 100);
                    }
                  }:{}
                },
                this.translateMoneyData(params.row.room / 100)
              );
            }
          }
        },
        {
          title: "餐费",
          width: 80,
          render: (h, params) => {
            if (this.change_btn.is_food && params.index === this.curIndex) {
              return h("Input", {
                props: {
                  type: "text",
                  value: this.changeval,
                  autofocus: "autofocus"
                },
                style: { width: "50px", margin: "0px 5px" },
                class: "is_show_input",
                on: {
                  input: value => {
                    this.changeval = value;
                  },
                  "on-blur": () => {
                    this.saveStaffPayInfo("is_food", params);
                  },
                  "on-keyup": () => {
                    this.clearNoNum();
                  }
                }
              });
            } else {
              return h(
                "span",
                {
                  class: params.row.status===0?"a_text":'',
                  on: params.row.status===0?{
                    click: () => {
                      this.whichchange_btn("is_food");
                      this.curIndex = params.index;
                      this.changeval = this.translateMoneyData(params.row.food / 100);
                    }
                  }:{}
                },
                this.translateMoneyData(params.row.food / 100)
              );
            }
          }
        },
        {
          title: "其他",
          width: 130,
          render: (h, params) => {
            if (params.row.other && params.row.other.length) {
              return h("div", [
                h("div",
                  params.row.other.map((item, index) => {
                    if ( this.change_btn.is_other && params.index === this.curIndex && index === this.otherindex ) {
                      return h("div", [
                        h("span", item.title),
                        h("Input", {
                          props: {
                            type: "text",
                            value: this.changeval,
                            autofocus: "autofocus"
                          },
                          style: { width: "50px", margin: "0px 5px" },
                          class: "is_show_input",
                          on: {
                            input: value => {
                              this.changeval = value;
                            },
                            "on-blur": () => {
                              let otherobj=params.row.other
                              !!otherobj.length?otherobj.forEach((item, index) => {
                                  item.price = item.price / 100;
                                }): "";
                              let par = {
                                other: otherobj,
                                index: this.otherindex
                              };
                              this.saveStaffPayInfo("is_other", params, par);
                            },
                            "on-keyup": () => {
                              this.clearNoNum();
                            }
                          }
                        }),
                        h("span", "元")
                      ]);
                    } else {
                      return h("div", [
                        h("span", item.title),
                        h(
                          "span",
                          {
                            class: params.row.status===0?"a_text":'',
                            style: { width: "50px", margin: "0px 5px" },
                            on: params.row.status===0?{
                              click: () => {
                                this.whichchange_btn("is_other");
                                this.otherindex = index;
                                this.curIndex = params.index;
                                this.changeval =
                                  this.translateMoneyData(params.row.other[index].price / 100);
                              }
                            }:{}
                          },
                          this.translateMoneyData(item.price / 100)
                        ),
                        h("span", "元")
                      ]);
                    }
                  })
                )
              ]);
            } else {
              return h("span", '');
            }
          }
        },
        {
          title: "工资",
          minWidth:90,
          className: "table-special",
          render:(h,params) => {
            return h('span',this.translateMoneyData(params.row.total_salary/100))
          }
        },
        {
          title: "发放人",
          width: 90,
          key: "send_name"
        },
        {
          title: "状态",
          width: 80,
          render: (h, parmas) => {
            if (parmas.row.status == 0) {
              return h("span", "待发放");
            }
            if (parmas.row.status == 1) {
              return h("span", "已发放");
            }
            if (parmas.row.status == 2) {
              return h("span", "已通知");
            }
          }
        },
        {
          title: "操作",
          minWidth: 100,
          render: (h, parmas) => {
            const send_btn = h(
              "span",
              {
                class: "operate-btn",
                style: {
                  color: "rgb(0, 156, 255)"
                },
                on: {
                  click: () => {
                    this.grantPay(parmas.row.id, parmas.index);
                  }
                }
              },
              "发放"
            );
            const notice_btn = h(
              "span",
              {
                class: "operate-btn",
                style: {
                  color: "rgb(0, 156, 255)"
                },
                on: {
                  click: () => {
                    this.sendMessage(parmas.row.id,parmas.index)
                  }
                }
              },
              "短信通知"
            );
            if (parmas.row.status == 0) {
              return [send_btn, notice_btn];
            } else if (parmas.row.status == 1) {
              return [notice_btn];
            } else {
              return "--";
            }
          }
        }
      ],
      staffPayData: [],
      staffSelectList: [],
      teamlist: []
    };
  },
  watch: {
    "search.start_time"(n) {
      if (n) {
        let mon = new Date(n).getMonth() + 1;
        let datetime = new Date(n).getFullYear() + "-" + mon + "-01";
        this.end_time_op = {
          disabledDate: date => {
            return date && date.valueOf() < new Date(datetime);
          }
        };
      } else {
        this.end_time_op = {};
      }
    },
    "search.end_time"(n) {
      if (n) {
        this.start_time_op = {
          disabledDate: date => {
            return date && date.valueOf() > new Date(n);
          }
        };
      } else {
        this.start_time_op = {};
      }
    }
  },
  methods: {
    sendMessage(id,i){
      this.$api.sendMessage({id}).then(data=>{
        if(data.code==200){
          this.$Message.info(data.msg)
          this.staffPayData[i].status=2
        }else{
          this.$Message.info(data.msg)
        }
      })
    },
    loadData(item, callback){
      item.loading = true;
      this.$api.getDepartmentTreeSelect({studio_id:item.value}).then(data=>{
        if(data.code==200){
          let arr=this.changeTreeList(data.data)
          if(!!arr.length){
            item.children=arr
          }
          item.loading=false
          callback();
        }
      })
    },
    changeTreeList(data){
      if(!!!data.length){
        return []
      }else{
        data.forEach((item,index)=>{
          item.value=item.id
          item.label=item.name
          item.children=item.department?item.department:item.child
          !!item.department?delete item.department:''
          if(!!item.children){
            this.changeTreeList(item.children)
          }
        })
        return data
      }
    },
    showlabel(labels, selectedData){
      return labels[labels.length-1]
    },
    changeTeamVal(value, selectedData){
      selectedData[0]?this.search.studio_id=selectedData[0].value:this.search.studio_id='';
      selectedData.length>1?this.search.department_id=selectedData[selectedData.length-1].id:this.search.department_id=''
    },
    // input验证
    clearNoNum() {
      this.changeval = this.changeval.replace(/[^\d.]/g, '');
      this.changeval = this.changeval.replace(/^\./g, '');
      this.changeval = this.changeval.replace(".", "$#$").replace(/\./g, '').replace("$#$", ".");
      this.changeval = this.changeval.replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3");
    },
    saveStaffPayInfo(btn_name, data, par) {
      if(this.changeval==''){
        for (let i in this.change_btn) {
          if (i.toString() === btn_name.toString()) {
            this.change_btn[i] = false;
          }
        }
        this.getStaffPay(this.pindex);
        return false
      }
      let otherinfo;
      if (par) {
        otherinfo = par.other;
        otherinfo[par.index].price = Number(this.changeval);
      }
      let info = data.row;
      let params = {};
      switch (btn_name) {
        case "is_base_wage":
          params = {
            id: info.id,
            base_wage: Number(this.changeval)
          };
          break;
        case "is_full_reward":
          params = {
            id: info.id,
            full_reward: Number(this.changeval)
          };
          break;
        case "is_overtime_pay":
          params = {
            id: info.id,
            overtime_pay: Number(this.changeval)
          };
          break;

        case "is_room":
          params = {
            id: info.id,
            room: Number(this.changeval)
          };
          break;
        case "is_food":
          params = {
            id: info.id,
            food: Number(this.changeval)
          };
          break;
        case "is_other":
          params = {
            id: info.id,
            other: otherinfo
          };
          break;
        case "is_grow_wage":
          params = {
            id: info.id,
            grow_wage:Number(this.changeval)
          };
          break;
        case "is_elder_bonus":
          params = {
            id: info.id,
            elder_bonus:Number(this.changeval)
          };
          break;
      }
      let mtype = this.search.username ? 2 : 1;
      this.$api.saveStaffPayInfo({ ...params }).then(data => {
        if (data.code == 200) {
          for (let i in this.change_btn) {
            if (i.toString() === btn_name.toString()) {
              this.change_btn[i] = false;
            }
          }
          this.$Message.info(data.msg);
          this.getStaffPay(this.pindex);
        } else {
          for (let i in this.change_btn) {
            if (i.toString() === btn_name.toString()) {
              this.change_btn[i] = false;
            }
          }
          this.$Message.info(data.msg);
          this.getStaffPay(this.pindex);
        }
      });
    },
    bgmonchange(mon) {
      this.search.start_time = mon;
    },
    edmonchange(mon) {
      this.search.end_time = mon;
    },
    getStaffPay(page = 1) {
      this.$store.commit('changeloading',true)
      this.staffPaySumData=[]
      this.pindex = page;
      this.$api.getStaffPay({
          limit: 10,
          page: this.pindex,
          start_time: this.search.start_time,
          end_time: this.search.end_time,
          manager_id: this.search.manager_id
        })
        .then(data => {
          if (data.code == 200) {
            this.staffPayData = data.data;
            this.count = data.count;
            let [base_wage,grow_wage,elder_bonus,spread,recharge,full_reward,overtime_pay,room,food,other,total_salary]=[0,0,0,0,0,0,0,0,0,0,0]
            this.staffPayData.forEach((item,index)=>{
              base_wage+=Number(item.base_wage)/100
              overtime_pay+= Number(item.overtime_pay)/100
              grow_wage+=Number(item.grow_wage)/100
              elder_bonus+=Number(item.elder_bonus)/100
              spread+=Number(item.spread)/100
              recharge+=Number(item.recharge)/100
              full_reward+=Number(item.full_reward)/100
              room+=Number(item.room)/100
              food+=Number(item.food)/100
              total_salary+=Number(item.total_salary)/100
              if(item.other.length){
                for(let i of item.other){
                  other+=Number(i.price)/100
                }
              }
            })

             base_wage = this.translateMoneyData(base_wage)
              grow_wage = this.translateMoneyData(grow_wage)
              spread = this.translateMoneyData(spread)
              recharge = this.translateMoneyData(recharge)
              elder_bonus= this.translateMoneyData(elder_bonus)
              full_reward= this.translateMoneyData(full_reward)
              overtime_pay= this.translateMoneyData(overtime_pay)
              room = this.translateMoneyData(room)
              food= this.translateMoneyData(food)
              other= this.translateMoneyData(other)
              total_salary = this.translateMoneyData(total_salary)

            this.staffPaySumData.push({
              base_wage,
              grow_wage,
              spread,
              recharge,
              elder_bonus,
              full_reward,
              overtime_pay,
              room,
              food,
              other,
              total_salary
            })
            this.$store.commit('changeloading',false)
          } else {
            this.$Message.info(data.msg);
            this.$store.commit('changeloading',false)
          }
        });
    },
    // 控制input显示隐藏
    whichchange_btn(btn) {
      for (let i in this.change_btn) {
        if (i.toString() === btn.toString()) {
          this.change_btn[i] = true;
        } else {
          this.change_btn[i] = false;
        }
      }
      setTimeout(() => {
        document.getElementsByClassName("is_show_input")[0].getElementsByTagName("input")[0].focus();
      }, 10);
    },
    removeSearch() {
      this.search = { ...removeSearch({ ...this.search }) };
    },
    downExcel(){
      let manager_access_token = getStore('userInfo').manager_access_token
      let arr='manager_access_token='+manager_access_token
      let mtype = this.search.manager_id
      arr+='&&mtype='+(!!mtype?mtype:'')
      arr+='&&start_time='+(!!this.search.start_time?this.search.start_time:'')
      arr+='&&end_time='+(!!this.search.end_time?this.search.end_time:'')
      this.$refs.excelUrl.href = this.$api.exportExcel() + arr
    },
    grantPay(id, i) {
      this.$Modal.confirm({
        title: "提示信息",
        class: "vertical-center-modal",
        render: h => {
          return h("div", { class: "login_out" }, [
            h(
              "p",
              {
                style: {
                  width: "100%",
                  padding: "30px 0px 10px 0px",
                  textAlign: "center",
                  backgourndColor: "rgba(52, 64, 78, 1)",
                  fontSize: "18px",
                  color: "rgba(51, 51, 51, 1)",
                  fontWeight: "400"
                }
              },
              "确认进行工资发放？"
            ),
            h(
              "p",
              {
                style: {
                  width: "100%",
                  textAlign: "center",
                  paddingBottom: "14px",
                  backgourndColor: "rgba(52, 64, 78, 1)",
                  fontSize: "13px",
                  color: "rgba(153, 153, 153, 1)",
                  fontWeight: "400"
                }
              },
              "工资发放以线下打款，该处做为确认发放记录"
            )
          ]);
        },
        onOk: () => {
          this.$api.sendWageInfo({ id }).then(data => {
            if (data.code == 200) {
              this.$Message.info(data.msg);
              this.staffPayData[i].status = 1;
            } else {
              this.$Message.info(data.msg);
            }
          });
        }
      });
    },
    // 获取员工列表
    getStaffCountData() {
       this.$api.getAdminList().then(data =>{
        if(data.code===200){
          this.staffSelectList = data.data
        }else{
          this.$Message.info(data.msg)
        }
      })
    },
     translateMoneyData(e) {
      e = e.toFixed(2)
      return e
    }
  },
  created() {
    this.getStaffPay();
    this.getStaffCountData()
  },
};
</script>
<style>
#staffpay-table .ivu-table td{
  background-color: #FAFAFC!important
}
#staffpay-table .ivu-table-row-hover{
  background-color: #FAFAFC
}
.pageExecal.ivu-page{
  width:calc(100% - 100px);
}
.extent_btn{
  text-align: center;
  width: 90px;
  margin-left: 10px;
  background-color: #fff
}
.staff_pay {
  width: 120px;
  font-size: 15px;
  margin-top: 15px;
  margin-left: 5px;
}
.search_text {
  position: relative;
  top: 2px;
  left: 2px;
  right: 2px;
}
#month_g .ivu-date-picker-cells-cell-selected em,
.ivu-date-picker-cells-cell-selected:hover em {
  border-radius: 0px;
}
#month_g .ivu-date-picker-cells span em {
  border-radius: 0px;
}
#month_a .ivu-date-picker-cells-cell-selected em,
.ivu-date-picker-cells-cell-selected:hover em {
  border-radius: 0px;
}
#month_a .ivu-date-picker-cells span em {
  border-radius: 0px;
}
</style>


