<template>
  <view>
    <Navbar :title="title" canBack></Navbar>
    <view class="usuallyCard margin flex padding" v-if="list.length">
      <u-steps :current="list.length - 1" dot direction="column" activeColor="#CF000D" >
        <u-steps-item v-for="(item,index) in list" :key="index" :title="item.procRole+'_'+item.procUser"
          :desc="descMethods(item)">
        </u-steps-item>
      </u-steps>
    </view>
    <u-empty mode="data" class="padding-top-xl" v-else></u-empty>
  </view>
</template>

<script>
  import {
    getMcOperationLogList
  } from '@/api/charge.js'
  export default {
    components: {},
    props: {

    },
    data() {
      return {
        title:"",
        id: "",
        list: [],
        type:"",
      }
    },
    computed: {

    },
    onLoad(data) {
      if (data.id) {
        this.id = data.id;
      }
      if (data.type) {
        this.type = data.type;
        console.log(this.type);
        if(this.type === 'cllc'){
          this.title =  "处理流程"
        }else{
          this.title =  "异动流程"
        }
      }
      this.init()
    },
    methods: {
      descMethods(item){
        return `提交与${item.procTime}\n操作:${item.opName?item.opName:'无'}\n意见:${item.opRemark?item.opRemark:'无'}`
      },
      async init() {
        let data = {
          dataForm: 'mc_visit',
          opType: this.type==='cllc'?"1":"2",
          dataId: this.id
        }
        let {
          code,
          rows
        } = await getMcOperationLogList(data);
        console.log(rows);
        this.list = rows.reverse();
      }
    }
  }
</script>

<style lang="scss" scoped>

</style>
