
<!--
  @description: 订单日志弹框
  @author: wxy
  @routerPath:
  @date：2020-08-20 14:29:03
-->
<template>
  <el-dialog
    :visible.sync="dialogVisible"
    title="日志追踪"
    width="840px"
    custom-class="el-dialog__body-p8 el-dialog_table"
  >
    <section>
      <!--日志信息-->
      <el-card v-for="(item, index) in flowList" :key="index" class="box-card">
        <div slot="header" class="clearfix">
          <span>{{ item.levelLogNameSecond }}</span>
        </div>
        <el-row type="flex">
          <el-timeline :time-width="200" :reverse="true">
            <el-timeline-item
              v-for="(flow, flowIndex) in item.logList"
              :key="flowIndex"
              placement="top"
            >
              <el-card>
                <p>  {{ flow.logDesc }}</p>
                <p>
                  {{ flow.logContent }}
                </p>
              </el-card>
            </el-timeline-item>
          </el-timeline>
        </el-row>
      </el-card>
    </section>
  </el-dialog>
</template>

<script>
import { queryOrderLog } from '@/api/procurement/datacenterDangtfz'
export default {
  name: 'ProcurementOrderLogDialog',
  data() {
    return {
      dialogVisible: false, // 弹框是否打开状态
      flowList: [
      ] // 订单日志信息
    }
  },
  methods: {
    // 父组件查看--打开弹框-初始化数据
    openDialogInitData(id) {
      // 获取订单日志信息
      this.init(id)
      this.dialogVisible = true
    },
    // 订单日志信息
    init(id) {
      const data = { orderId: id }
      queryOrderLog(data).then(res => {
        this.flowList = res.data
      })
    }
  }
}
</script>

<style>
</style>
