<template>
  <div class="h100" id="handle-status">
    <div class="black-title">差评回复及整改</div>
    <div class="detail_content">
      <div class="single_part" v-for="(item,index) in list" @click="showCommit(item.code)" :key="index" >
        <div :class="item.class">

        </div>
        <div class="single_right">
          <span class="single_num">{{item.value}}</span>
          <span class="single_title">{{item.name}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>

import {mapEvaluateMutations} from "@/units/map-units";

export default {
  name: "RemindHandleS",
  data() {
    return {
      list:[
        {
          name:'差评总数',
          code:'REPLY',
          value:'0',
          class:'single_left1'
        },
        {
          name:'待回复差评',
          code:'NO_REPLY',
          value:'0',
          class:'single_left2'
        },
        {
          name:'需整改事项',
          code:'RECTIFIED_NUM',
          value:'0',
          class:'single_left3'
        },
        {
          name:'未整改事项',
          code:'NO_RECTIFIED_NUM',
          value:'0',
          class:'single_left4'
        },
      ]
    }
  },
  mounted(){
    this.$request({
      url:'/ywtb/evaluationReplyAndRectification',
      method:'post',
      data:{
        // "UNIT_CODE":this.evaFirstLevel,
        // "TIME_TYPE":this.evaTimer,
        // "SATISFACTION":this.evaSecondLevel,
        // "MATTER_CODE":this.evaThirdLevel,
        // "pageIndex":'1',
        // "pageSize":'10'
      }
    }).then(response => {
      let dataArr = response.data.msg[0].Rows[0]
      if(dataArr!=undefined){
        for(let obj in dataArr){
          for(let i=0;i<this.list.length;i++){
            if(this.list[i].code ==  obj){
              this.list[i].value = dataArr[obj];
            }
          }
        }

      }
    })
  },
  methods:{
    showCommit(code){
      if(code=='REPLY'){
        this.$router.push('/origion/evaluate');
        this.evaluateCurrentId('repeat')
        this.evaluateRepeatId('0,1,2,3,4')
      }else if(code=='NO_REPLY'){
        this.$router.push('/origion/evaluate');
        this.evaluateCurrentId('repeat')
        this.evaluateRepeatId('0')
      }else{
        this.$router.push('/origion/evaluate');
        this.evaluateCurrentId('situation')

      }
    },

    ...mapEvaluateMutations(['evaluateCurrentId','evaluateFirstLevel','evaluateSecondLevel','evaluateThirdLevel','evaluateTimer','evaluateRepeatId'])
  }
}
</script>

<style scoped lang="scss">
#handle-status{
  display: flex;
  overflow: hidden;
  flex-direction: column;
  .detail_content{
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    .single_part{
      cursor: pointer;
      width: 50%;
      height: 50%;
      display: flex;
      justify-content: space-evenly;
      align-items: center;
      .single_left1{
        width: 100px;
        height: 100px;
        background: url("../../assets/imgs/待回复差评.png") no-repeat;
        background-size: 100%;
      }
      .single_left2{
        width: 100px;
        height: 100px;
        background: url("../../assets/imgs/15日超期回复.png") no-repeat;
        background-size: 100%;
      }
      .single_left3{
        width: 100px;
        height: 100px;
        background: url("../../assets/imgs/整改次数.png") no-repeat;
        background-size: 100%;
      }
      .single_left4{
        width: 100px;
        height: 100px;
        background: url("../../assets/imgs/未整改次数.png") no-repeat;
        background-size: 100%;
      }
      .single_right{
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        .single_num{
          color: #fff;
          font-size: 40px;
          font-weight: bold;
        }
        .single_title{
          color: #fff;
          font-size: 16px;
        }
      }
    }
  }
}
</style>
