<!--
  @description: 日志追踪列表
  @Modifier: 苏志刚
  @date: 2020/08/20 09:50
-->
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="dialogData.dialog"
    :close-on-click-modal="false"
    :title="title"
    width="700px"
    custom-class="el-dialog__body-p0"
    top="calc((100vh - 611px) / 2)"
  >
    <section class="main procurement_Journal" style="margin:10px;height: 500px">
      <!--日志信息组件-->
      <journalComp :journal-data="tabData" />
    </section>
  </el-dialog>
</template>

<script>
/* 接口*/
import { queryPurchaseOrderLog } from '@/api/procurement/datacenterDangtfz' // 采购单日志
/* 公共组件*/
import journalComp from '@/views/procurement/components/procurementJournalComp.vue' // 日志组件
export default {
  name: 'JournalProjectDialog',
  components: {
    journalComp
  },
  props: {
    // 弹框展示状态
    dialogData: {
      type: Object,
      default: function() {

      }
    }
  },
  data() {
    return {
      tabData: [],
      activeName: ['0'], // 默认展开第一个
      title: '日志追踪' // 弹框标题
    }
  },
  created() {

  },
  mounted() {
    this.queryPurchaseOrderLog(this.dialogData.id)
  },
  methods: {
    queryPurchaseOrderLog(id) {
      queryPurchaseOrderLog({ tenderId: id }).then(res => {
        if (res.header.ret === '0') {
          this.tabData = res.data
          this.tabData.forEach((val, idx) => {
            this.activeName.push(idx)
          })
        }
      })
    }
  }
}
</script>

<style scoped lang="less">

</style>

