<template>
  <div class="L-projectProgress">
    <div class="projectProgress-title">【项目进展】</div>
    <div class="schedule-timeline">
      <el-timeline>
        <el-timeline-item
          v-for="(activity, index) in flow"
          :key="index"
          size="large"
          :class="activity.approvalStatus == 1 || activity.approvalStatus == 0 ? 'timeline-item-green' : activity.approvalStatus == 2 ? 'timeline-item-red' : ''"
        >
          <div slot="dot" class="timeline-dot" :class="activity.approvalStatus == 2 ? 'timeline-dot-red' : ''">
            <i class="icon iconfont" :class="activity.approvalStatus == 1 || activity.approvalStatus == 0 ? 'icon-jc-dian-green' : activity.approvalStatus == 2 ? 'icon-jc-dian' : ''"></i>
          </div>
          <el-card> <!-- 去除阴影  shadow="never -->
            <div class="schedule-content">
              <div class="card-content-left">
                <div class="schedule-card-title">{{ activity.approvalByName }}</div>
                <!-- <div class="schedule-card-title" v-if="false">提交项目材料</div> -->
                <!-- <div class="schedule-card-title" v-if="activity.sort == 1 && activity.approvalStatus == 0">待初审</div>
                <div class="schedule-card-title" v-if="activity.sort == 1 && activity.approvalStatus == 1">初审通过</div>
                <div class="schedule-card-title" v-if="activity.sort == 1 && activity.approvalStatus == 2">初审拒绝</div>
                <div class="schedule-card-title" v-if="activity.sort == 2 && activity.approvalStatus == 0">待复审</div>
                <div class="schedule-card-title" v-if="activity.sort == 2 && activity.approvalStatus == 1">复审通过</div>
                <div class="schedule-card-title" v-if="activity.sort == 2 && activity.approvalStatus == 2">复审拒绝</div>
                <div class="schedule-card-title" v-if="activity.sort == 3 && activity.approvalStatus == 0">待专家评审</div>
                <div class="schedule-card-title" v-if="activity.sort == 3 && activity.approvalStatus == 1">专家评审通过</div>
                <div class="schedule-card-title" v-if="activity.sort == 3 && activity.approvalStatus == 2">专家评审拒绝</div>
                <div class="schedule-card-title" v-if="activity.sort == 4 && activity.approvalStatus == 0">待市级评审</div>
                <div class="schedule-card-title" v-if="activity.sort == 4 && activity.approvalStatus == 1">市级评审通过</div>
                <div class="schedule-card-title" v-if="activity.sort == 4 && activity.approvalStatus == 2">市级评审拒绝</div> -->
                <div class="card-content-one" v-show="activity.approvalStatus == 0 && activity.approvalAttachment">
                  <span>提醒</span>
                  <span>已提交xxx材料</span>
                </div>
                <!-- <div class="card-content-one" v-show="activity.approvalStatus == 2">
                  <span>提醒</span>
                  <span>请xxx专家审核</span>
                </div> -->
                <div class="card-content-one" v-show="activity.approvalStatus == 1">
                  <span>审核结果</span>
                  <span>{{ activity.approvalByName }}审核通过</span>
                </div>
                <div class="card-content-one" v-show="activity.approvalStatus == 2">
                  <span>审核结果</span>
                  <span>{{ activity.approvalByName }}审核不通过</span>
                </div>
                <div class="card-content-two">
                  <span>审核意见</span>
                  <span>{{ activity.approvalOpinions }}</span>
                </div>
                <div class="card-content-two" v-if="activity.approvalAttachment">
                  <span>附件</span>
                  <a :href="activity.approvalAttachment" target="_blank">{{ activity.approvalAttachment.split("/")[activity.approvalAttachment.split("/").length - 1] }}</a>
                </div>
                <div class="card-content-two" v-if="!activity.approvalAttachment">
                  <span>附件</span>
                  <a></a>
                </div>
                <div class="card-content-three">{{ activity.approvalTime }}</div>
                <!-- <div class="card-content-three-red" v-show="activity.approvalStatus == 2">请于2023-06-20前审核</div> -->
              </div>
              <div class="card-content-right">
                <i class="icon iconfont" :class="activity.approvalStatus == 2 ? 'icon-jc-yijujue' : activity.approvalStatus == 1 ? 'icon-jc-shenpitongguo-copy' : activity.approvalStatus == 0 ? 'icon-jc-daishenpi1-copy' : ''"></i>
              </div>
            </div>
          </el-card>
        </el-timeline-item>
      </el-timeline>
    </div>
  </div>
</template>
<script>
import { declarationRecordsId } from "@/api/jin_ji_hu/project/index"
export default {
  data() {
    return {
      // activities: [{
      //   status: 2,
      // }, {
      //   status: 1,
      // }, {
      //   status: 1,
      // }, {
      //   status: 0,
      // }],
      flow:[],
    }
  },
  mounted() {
    this.getFlow(this.$route.query.userId)
  },
  methods:{
    // approvalStatus   0:待审核 1:审核通过 2:审核不通过
    getFlow(id){
      declarationRecordsId(id).then(res=>{
        this.flow = res.data[0] ? res.data : [];
      })
    }
  },
}
</script>
