<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>

      <div class="header_btn1">
        <p>全部审核</p>
      </div>

      <div class="header_btn2">
        <p>确定提交</p>
      </div>

      <p class="header_tt">
        <i class="el-icon-warning"></i>已选中：年村（a合作社，b合作社，c合作社，d合作社）、张村（百事合作社）...
      </p>

      <p class="todo_num">已处理村庄：<span>19</span>个</p>
      <p class="todo_num2">超时完成村庄：<span>1</span>个</p>

    </div>

    <div class="main">

      <div class="left_main">
        <el-table :data="tableData" style="width: 100%;" :default-sort = "{prop: 'date', order: 'descending'}">

          <el-table-column type="expand">
            <template slot-scope="props">
              <div class="openTable">
                <div class="openTable_block">
                  <el-button type="primary" size="mini">审核</el-button>
                  <p>已选中：百事合作社</p>
                </div>
                <el-table :data="tableData" style="width: 100%;background-color: transparent;" :default-sort = "{prop: 'date', order: 'descending'}">
                  <el-table-column prop="value9" label="操作">
                    <template slot-scope="scope">
                      <el-button type="primary" size="mini">审核</el-button>
                      <el-button type="primary" size="mini" plain>查看</el-button>
                    </template>
                  </el-table-column>
                  <el-table-column prop="value1" label="组织名称" show-overflow-tooltip />
                  <el-table-column prop="value2" label="记账笔数" show-overflow-tooltip >
                    <template slot-scope="scope">
                      5 <span class="num">7</span>
                    </template>
                  </el-table-column>
                  <el-table-column prop="value3" label="合同数量" show-overflow-tooltip />
                  <el-table-column prop="value4" label="其他" show-overflow-tooltip />
                  <el-table-column prop="value5" label="任务总数" show-overflow-tooltip />
                </el-table>
              </div>
            </template>
          </el-table-column>

          <el-table-column prop="value1" label="操作" show-overflow-tooltip >
            <template slot-scope="scope">
              <el-button type="primary" size="mini">审核</el-button>
            </template>
          </el-table-column>
          <el-table-column prop="value2" label="村" show-overflow-tooltip />
          <el-table-column prop="value3" label="合作社数量" show-overflow-tooltip />
          <el-table-column prop="value4" label="记账笔数" show-overflow-tooltip />
          <el-table-column prop="value5" label="合同数量" show-overflow-tooltip />
          <el-table-column prop="value6" label="其他" show-overflow-tooltip />
          <el-table-column prop="value7" label="下发日期" show-overflow-tooltip />
          <el-table-column prop="value8" label="截止日期" show-overflow-tooltip />
          <el-table-column prop="value8" label="完成日期" show-overflow-tooltip />
          <el-table-column prop="value8" label="负责人" show-overflow-tooltip />

        </el-table>

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

      </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: "processed",
  data() {
    return {
      tableData: [{
        value1: '当当村',
        value2: '玩玩玩玩玩玩玩玩合作社玩玩玩玩玩玩玩玩合作社',
        value3: '8',
        value4: '5',
        value5: '5',
        value6: '18',
        value7: '2023.03.05',
        value8: '2023.03.06',
        value9: '111'
      }, {
        value1: '当当村',
        value2: '玩玩玩玩玩玩玩玩合作社',
        value3: '8',
        value4: '5',
        value5: '5',
        value6: '18',
        value7: '2023.03.05',
        value8: '2023.03.06',
        value9: '111'
      }, {
        value1: '当当村',
        value2: '玩玩玩玩玩玩玩玩合作社',
        value3: '8',
        value4: '5',
        value5: '5',
        value6: '18',
        value7: '2023.03.05',
        value8: '2023.03.06',
        value9: '111'
      }, {
        value1: '当当村',
        value2: '玩玩玩玩玩玩玩玩合作社',
        value3: '8',
        value4: '5',
        value5: '5',
        value6: '18',
        value7: '2023.03.05',
        value8: '2023.03.06',
        value9: '111'
      }],
      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;}
  .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;
  }

  .header_tt{
    font-size: 14px;
    color: #7e7e7e;
  }
  .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%);
  }
  ::v-deep .el-table .cell{
    text-align: center;
  }

  ::v-deep .el-table .el-table__cell{
    border: none!important;
  }
  ::v-deep .el-table::before{
    display: none;
  }
  ::v-deep .el-table .el-table__header-wrapper th{
    background-color: transparent;
  }
  ::v-deep .el-table tr{
    background-color: transparent;
  }

  .openTable{
    display: flex;
    align-items: center;
    background-color: #eef3fd;
    padding: 0 2.5vw 2vh;
    .openTable_block{
      width: 10%;
      display: flex;
      flex-direction: column;
      align-items: center;
      p{
        margin-top: 5px;
      }
    }
    ::v-deep .el-table__body{
      background-color: #ffffff;
      border-radius: 15px;
      overflow: hidden;
    }
    .num{
      color: #3976ff;
      display: inline-block;
      background-color: #e2ebff;
      width: 1.8vw;
      border-radius: 5px;
      margin-left: 5px;
    }
  }

  .header_main{
    display: flex;
    align-items: center;
    position: relative;
    .selected{
      width: 16vw;
      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;
        }
      }
    }
    .header_btn1{
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 2vw;
      background-color: #3976ff;
      padding: 0px 0px;
      border-radius: 8px;
      box-shadow: 0 0 10px #dedfe1;
      width: 8vw;
      height: 4vh;
      overflow: hidden;
      color: #ffffff;
    }
    .header_btn2{
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 2vw;
      background-color: #209955;
      padding: 0px 0px;
      border-radius: 8px;
      box-shadow: 0 0 10px #dedfe1;
      width: 8vw;
      height: 4vh;
      overflow: hidden;
      color: #ffffff;
    }
    .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;
      &:nth-child(3){
        border-top-left-radius: initial;
        border-bottom-left-radius: initial;
      }
      .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: #3976ff;
      }
    }
    .todo_num2{
      margin-left: 2vw;
      span{
        font-size: 24px;
        color: #ef0027;
      }
    }
  }

  .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);
      position: relative;
    }

    .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>
