reviewStatus.vue 4.41 KB
<template>
  <div class="status-wrap">
    <div class="status-item" v-for="(item, index) in statusList" :key="index">
      <div :class="['info', item.active && item.type == 1 ? 'active' : '']">
        <div class="circle-box">
          <div class="circle">
            <img v-if="item.active" class="status-img" :src="IMG_URL + 'equity/review_icon.png'" />
            <img v-if="item.type == 2" class="status-img" :src="IMG_URL + 'equity/review_success_icon.png'" />
            <img v-if="item.active && item.type == 3" class="status-img" :src="IMG_URL + 'equity/review_error_icon.png'" />
            <div v-if="!item.active && item.type < 2" class="circle_text">{{ index + 1 }}</div>
          </div>
        </div>
        <div class="name" :style="{ color: item.active || item.type > 1 ? '#292D33' : '#999EA8' }">{{ item.name }}</div>
        <!-- <template>
          <div v-if="(index == 1 || index == 2) && item.type > 1" class="status-text" :style="{ color: item.type == 2 ? '#292D33' : '#E75E58' }">{{ item.type == 2 ? '通过' : '不通过' }}</div>
          <div style="height: var(--fontSize32)" v-else>{{ ' ' }}</div>
        </template> -->
      </div>
      <div :class="['line', item.type == 2 ? 'line_color' : '']" v-if="index != statusList.length - 1"></div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    infoData: {
      type: Object,
      default: () => {}
    },
    status: {
      type: Number,
      default: 0
    }
  },
  watch: {
    infoData:{
      handler(val){
        this.updateSatus(val)
      },
      immediate: true
    }
  },
  data() {
    return {
      staffType: this.$route.query.staffType,// (2-运营审核 3-商务审核 4-采购发货审核)
      IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/',
      statusList: [
        { name: '运营审核', active: false, type: 1 },
        { name: '商务审核', active: false, type: 1 },
        { name: '调拨发货审核', active: false, type: 1 }
      ]
    }
  },
  methods: {
    updateSatus(val) {
      console.log('updateSatus', val)
      this.statusList.forEach(item => {
        item.active = false
        item.type=1
      })
      if (val.billStatus == 1) {
        this.statusList[0].active = true
        this.statusList[0].type = 1
        if (this.staffType == 2) {
          this.statusList[0].active = true
        }
      } else if (val.billStatus == 2) {
        this.statusList[0].type = 2
        this.statusList[1].active = true
        this.statusList[1].type = 1
      
      } else if (val.billStatus == 5) {
        this.statusList.forEach(item => {
          item.active = true
          item.type = 2
        })
        this.statusList[2].active = true
        this.statusList[2].type = 2
        
      } else {
        this.statusList.forEach(item => {
          item.active = false
        })
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.status-wrap {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  margin: 16px 0;
  .status-item {
    display: flex;
    flex-wrap: nowrap;
    font-size: 12px;
    font-weight: 500;
    color: #999ea8;
    .info {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 80rpx;
      .circle-box {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        .circle {
          width: 20px;
          height: 20px;
          display: flex;
          align-items: center;
          justify-content: center;
          color: #ffffff;
          font-size: 12px;
          font-weight: 500;
          .circle_text {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background: #dee0e3;
          }
        }
        .status-img {
          position: absolute;
          top: 0;
          left: 0;
          z-index: 1;
          width: 28px;
          height: 28px;
        }
      }
      .name {
        margin-top: 10px;
        font-weight: 500;
        white-space: nowrap;
        color: #7a8299;
        margin-bottom: 2px;
      }
    }
    .line {
      margin: 12px 4px 0;
      width: 50px;
      height: 4px;
      background: #dee0e3;
      border-radius: 4px;
    }
    .line_color {
      background: #347bff1a;
    }
  }
}
</style>