<template>
  <el-dialog
    title="查看"
    width="60%"
    :close-on-click-modal="false"
    :visible.sync="visible">
    <el-row class="my-row">
      <el-col :span="24">
        <div style="height: 300px;">
          <el-steps direction="vertical" :active="1">
            <el-step v-for="(item,index) in dataForm.workFlowStepInfoList" :key="index" :title="item.stepName" 
              :description="item.processLogInfoList.length > 0 ? item.processLogInfoList[0].approvalValue : ''"></el-step>
          </el-steps>
        </div>
      </el-col>
    </el-row>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">返回</el-button>
    </span>
  </el-dialog>
</template>

<script>
  import { getApprovalInfo } from '@/api/msg'
  export default {
    name: 'notice-add-or-update',
    data () {
      return {
        visible: false,
        dictType: 'material_type',
        options: [],
        options1: [],
        dataList: [],
        fileList: [],
        id: 0,
        dataForm: {
          workFlowStepInfoList: []
        },
        display: false
      }
    },
    methods: {
      async init (id) {
        this.visible = true
        this.id = id || 0
        this.getApprovalInfo()
      },
      getApprovalInfo () {
        getApprovalInfo(this.id).then(({data}) => {
          if (data && data.code === '200') {
            this.dataForm = data.data
          }
        })
      },
      submitUpload () {
        this.$refs.upload.submit()
      },
      handleRemove (file, fileList) {
        console.log(file, fileList)
      },
      handlePreview (file) {
        console.log(file)
      },
      // 表单提
      validateField (type) {
        this.$refs.dataForm.validateField(type)
      }
    }
  }
</script>

<style scoped>
.my-line{
  border-bottom: 1px solid #c0c4cc;
  margin-bottom: 10px;
}
.title{
  padding: 10px 0 ;
}
</style>
