reviewStatus.vue 5.12 KB
<template>
  <div class="wrapper">
    <div class="status-wrap">
      <div class="status-item" v-for="(item, index) in statusList" :key="index">
        <div class="step-icon-wrapper">
          <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'" />
                <div v-if="!item.active && item.type < 2" class="circle_text">{{ index + 1 }}</div>
              </div>
            </div>
          </div>
          <div :class="['line', item.type == 2 ? 'line_color' : '']" v-if="index != statusList.length - 1"></div>
        </div>
        <div class="step-label">
          <div :class="['name', `name${index}`]" :style="{ color: item.active || item.type > 1 ? '#292D33' : '#999EA8' }">{{ item.name }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    infoData: {
      type: Object,
      default: () => {}
    },
    status: {
      type: Number,
      default: 0
    }
  },
  watch: {
    infoData(val) {
      this.updateSatus(val)
    }
  },
  data() {
    return {
      staffType: this.$route.query.staffType, // (2-运营审核 3-商务审核 4-采购发货审核,5-总监审核)
      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 },
        { name: '商务审核', active: false, type: 1 },
        { name: '采购发货审核', active: false, type: 1 }
      ]
    }
  },
  methods: {
    updateSatus(val) {
      this.statusList.forEach(item => {
        item.active = false
        item.type = 1
      })

      // 待运营审核
      if (val.status == 1) {
        this.statusList[0].active = true
        this.statusList[0].type = 1
        if (this.staffType == 2) {
          this.statusList[0].active = true
        }
      }
      // 待经理审核
      if (val.status == 2) {
        this.statusList[0].type = 2
        this.statusList[1].active = true
        this.statusList[1].type = 1
      }
      // 待总监审核
      if (val.status == 10) {
        this.statusList[0].type = 2
        this.statusList[1].type = 2
        this.statusList[2].active = true
        this.statusList[2].type = 1
      }
      // 待商务审核
      if (val.status == 8) {
        this.statusList[0].type = 2
        this.statusList[1].type = 2
        this.statusList[2].type = 2
        this.statusList[3].active = true
        this.statusList[3].type = 1
        // if (this.staffType == 3) {
        //   this.statusList[1].active = true
        // }
      }
      if (val.status == 5) {
        this.statusList.forEach(item => {
          item.active = true
          item.type = 2
        })
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.wrapper {
  overflow: hidden;
  width: 100%;
}
.status-wrap {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  margin: 16px 0 0;
  overflow: scroll;
  .status-item {
    display: flex;
    flex-direction: column;
    .step-icon-wrapper {
      display: flex;
      flex-wrap: nowrap;
      font-size: 12px;
      font-weight: 500;
      color: #999ea8;
      padding-left: 12px;
    }
    .step-label {
      white-space: nowrap;
      margin: 10px 0;
    }
    .info {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 80rpx;
      .circle-box {
        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;
        }
      }
    }
    .line {
      margin: 12px 0px 0 12px;
      width: 28px;
      height: 4px;
      background: #dee0e3;
      border-radius: 4px;
    }
    .line_color {
      background: #347bff1a;
    }
  }
}
.status-txt-box {
  position: relative;
  margin: 10px 0;
  height: 17px;

  .name {
    display: inline-block;
    font-weight: 500;
    white-space: nowrap;
    color: #7a8299;
  }
  .name0 {
    position: absolute;
    top: 0;
    left: 0;
  }
  .name1 {
    position: absolute;
    top: 0;
    left: 26%;
  }
  .name2 {
    position: absolute;
    top: 0;
    left: 54%;
  }
  .name3 {
    position: absolute;
    top: 0;
    left: 77%;
  }
}
</style>