<template>
  <div class="app-container">

    <div class="header_main">

      <el-dropdown trigger="click" placement="bottom-start">
        <div class="select_address el-dropdown-link">
          <span class="sanjiao-right"></span>
          <p>大足区</p>
        </div>
        <el-dropdown-menu slot="dropdown" style="width: 8vw;text-align: center;">
          <el-dropdown-item v-for="(item,index) in 5">
            <div class="selected">
              <p>张家镇</p>
            </div>
          </el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>

      <el-dropdown trigger="click" placement="bottom-start">
        <div class="select_address el-dropdown-link">
          <span class="sanjiao-right"></span>
          <p>张家镇</p>
        </div>
        <el-dropdown-menu slot="dropdown" style="width: 8vw;text-align: center;">
          <el-dropdown-item v-for="(item,index) in 5">
            <div class="selected">
              <p>张家镇</p>
            </div>
          </el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>

      <el-dropdown trigger="click" placement="bottom-start">
        <div class="select_address el-dropdown-link">
          <span class="sanjiao-right"></span>
          <p>记账</p>
        </div>
        <el-dropdown-menu slot="dropdown" style="width: 8vw;text-align: center;">
          <el-dropdown-item v-for="(item,index) in 5">
            <div class="selected">
              <p>张家镇</p>
            </div>
          </el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>

      <p class="todo_num">合同异常：<span>19</span>个</p>
      <p class="todo_num2">记录异常：<span>1</span>个</p>
      <p class="todo_num3">其他异常：<span>1</span>个</p>

    </div>

    <div class="main">

      <div class="left_main">

        <div class="left_main_block" v-for="(item,index) in 1" :key="index">

          <p class="left_tt">{{index+1}}.购入芒果52公斤 <span>负责人：张三</span><el-button type="danger" size="mini" icon="el-icon-edit"></el-button></p>

          <el-row>
            <el-col span="4"><span>经济组织：</span>田娜合作社</el-col>
            <el-col span="6"><span>所属地：</span>山东省/威海市/环翠区/羊头镇/张家村</el-col>
            <el-col span="6"><span>详细地址：</span>万江路阿巴阿巴阿巴104号楼</el-col>
            <el-col span="4"><span>申请人：</span>林萧天</el-col>
            <el-col span="4"><span>联系电话：</span>158 0366 7149</el-col>
          </el-row>

          <el-row>
            <el-col span="4" style="color: #ef0027;"><span>挂起时间：</span>2023.3.10</el-col>
            <el-col span="6" style="color: #ef0027;"><span>异常原因：</span>缺少收据</el-col>
          </el-row>


        </div>

        <img src="../../assets/images/managerAbnormal_icon_none.png" class="table_none" alt="">
      </div>

      <div class="right_main">
        <div class="title">
          <i></i>
          <p>任务日期</p>
        </div>

        <div class="time_main">
          <span class="sanjiao-top" @click="addDate"></span>
          <p @click = "selectionRange">{{year}}</p>
          <el-date-picker
            v-model="year"
            type="year"
            class="pickerTime"
            ref = "datePicker"
            value-format="yyyy"
            placeholder="选择年">
          </el-date-picker>
          <span class="sanjiao-bottom" @click="reduceDate"></span>
        </div>

        <div class="month_main">
          <p v-for="(item,index) in 12" :class="{'active':index==3}">{{index+1}}月<i v-if="index==3"></i></p>
        </div>

      </div>

    </div>


  </div>
</template>

<script>
export default {
  name: "todo",
  data() {
    return {
      year:'2023',
    }
  },
  created() {

  },
  methods:{
    addDate(){
      this.year = Number(this.year) + 1 ;
    },
    reduceDate(){
      this.year = Number(this.year) - 1 ;
    },
    selectionRange(){
      this.$refs.datePicker.focus();
    },
  },
  mounted(){

  }
}
</script>

<style lang="scss" scoped>
  p{margin: 0;line-height: 1;}
  ::-webkit-scrollbar{display:none}
  .app-container{
    background-color: #f5f6f8;
    width: 100%;
    height: 91vh;
  }

  .selected{
    display: flex;
    height: 4vh;
    p{
      width: 8vw;
      line-height: 4vh;
      text-align: center;
    }
  }
  .pickerTime{
    opacity: 0;
    position: absolute;
    left: 0px;
    top: 30px;
    width: 5px;
    height: 5px;
    z-index: -1;
  }
  .el-dropdown-link {
    cursor: pointer;
  }

  .title{
    display: flex;
    align-items: center;
    i{
      display: inline-block;
      width: 5px;
      height: 20px;
      background: #4d7cfe;
      border-radius: 5px;
      margin-right: 10px;
    }
    p{
      font-size: 16px;
    }
  }
  .table_none{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
  }
  .header_main{
    display: flex;
    align-items: center;
    position: relative;
    .selected{
      width: 8vw;
      background-color: #ffffff;
      position: absolute;
      top: 4vh;
      left: 10vw;
      z-index: 9;
      border-radius: 8px;
      box-shadow: 0 10px 10px #dedfe1;
      padding: 1vh 0;
      div{
        display: flex;
        height: 4vh;
        p{
          width: 8vw;
          line-height: 4vh;
          text-align: center;
        }
      }
    }
    .select_address{
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 2vw;
      background-color: #ffffff;
      padding: 0px 0px;
      border-radius: 8px;
      box-shadow: 0 0 10px #dedfe1;
      width: 8vw;
      height: 4vh;
      overflow: hidden;

      .sanjiao-right {
        display: inline-block;
        border-left: 8px solid #000;
        border-left-color: initial;
        border-top: 5px solid transparent;
        border-bottom: 5px solid transparent;
        margin-right: 5px;
      }
      .select_time{
        text-align: center;
        width: 100%;
        height: 4vh;
        line-height: 4vh;
        background-color: #3976ff;
        color: #ffffff;
      }
    }
    .todo_num{
      margin-left: auto;
      span{
        font-size: 24px;
        color: #ef0027;
      }
    }
    .todo_num2{
      margin-left: 2vw;
      span{
        font-size: 24px;
        color: #ef0027;
      }
    }
    .todo_num3{
      margin-left: 2vw;
      span{
        font-size: 24px;
        color: #9a9a9a;
      }
    }
  }

  .main{
    display: flex;
    .left_main{
      width: 92%;
      margin-right: 0.57%;
      margin-top: 15px;
      border-radius: 8px;
      box-shadow: 4px 0px 10px rgba(0, 0, 0, 0.13);
      background: #fff;
      padding: 15px 20px;
      height: calc(91vh - 91px);
      overflow-y: scroll;
      position: relative;
      .left_main_block{
        border-radius: 8px;
        box-shadow: 4px 0px 10px rgba(0, 0, 0, 0.13);
        margin-bottom: 15px;
        padding: 15px 20px;
        .left_tt{
          padding-bottom: 15px;
          border-bottom: 1px solid #e4e5e6;
          display: flex;
          align-items: center;
          justify-content: space-between;
          margin-bottom: 10px;
          span{
            color: #3976ff;
            margin-left: auto;
            margin-right: 2vw;
          }
        }
        .el-col{
          padding: 10px 0;
        }
        span{
          color: #8b8b8b;
        }
      }
    }

    .right_main{
      width: 7.43%;
      margin-top: 15px;
      border-radius: 8px;
      box-shadow: 4px 0px 10px rgba(0, 0, 0, 0.13);
      background: #fff;
      padding: 15px 20px;
      height: calc(91vh - 91px);
    }

  }

  .sanjiao-top {
    display: inline-block;
    border-bottom: 8px solid #414141;
    border-bottom-color: initial;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
  }

  .sanjiao-bottom {
    display: inline-block;
    border-top: 8px solid #414141;
    border-top-color: initial;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
  }

  .time_main{
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f5f6f8;
    color: #414141;
    width: 75%;
    margin: 0 auto;
    margin-top: 15px;
    padding: 15px 0;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    p{
      margin: 10px 0;
    }
  }

  .month_main{
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #414141;
    p{
      margin-top: 3vh;
      position: relative;
      &.active{
        color: #3976ff;
      }
      &:hover{
        color: #3976ff;
        cursor: pointer;
      }
      i{
        display: block;
        width: 5px;
        height: 5px;
        background-color: #fc5659;
        position: absolute;
        top: -5px;
        right: -5px;
        border-radius: 100%;
      }
    }

  }

</style>
