<template>
  <div class="reserved">
    <el-dialog
      title="货权预留单"
      :visible.sync="visible"
      :before-close="handleClose"
      width="70%"
    >
      <el-table :data="tableList1">
        <el-table-column property="date" label="预留单型号" width="150"></el-table-column>
        <el-table-column property="date" label="来源单据号" width="150"></el-table-column>
        <el-table-column property="date" label="客户" width="150"></el-table-column>
        <el-table-column property="date" label="客户名称" width="150"></el-table-column>
        <el-table-column property="date" label="创建人" width="150"></el-table-column>
        <el-table-column property="date" label="创建人名称" width="150"></el-table-column>
        <el-table-column property="date" label="创建时间" width="150"></el-table-column>
        <el-table-column property="date" label="更新人" width="150"></el-table-column>
        <el-table-column property="date" label="更新人名称" width="150"></el-table-column>
        <el-table-column property="date" label="更新时间" width="150"></el-table-column>
      </el-table>
      <el-table style="margin-top: 50px" :data="tableList2">
        <el-table-column property="date" label="物料编码" width="150"></el-table-column>
        <el-table-column property="date" label="物料名称" width="150"></el-table-column>
        <el-table-column property="date" label="单位" width="150"></el-table-column>
        <el-table-column property="date" label="单位名称" width="150"></el-table-column>
        <el-table-column property="date" label="预留数量" width="150"></el-table-column>
        <el-table-column property="date" label="预留比例" width="150"></el-table-column>
        <el-table-column property="date" label="预留周期" width="150"></el-table-column>
        <el-table-column property="date" label="仓库" width="150"></el-table-column>
        <el-table-column property="date" label="仓库名称" width="150"></el-table-column>
        <el-table-column property="date" label="货位" width="150"></el-table-column>
        <el-table-column property="date" label="货位名称" width="150"></el-table-column>
        <el-table-column property="date" label="可用量" width="150"></el-table-column>
        <el-table-column property="date" label="已用量" width="150"></el-table-column>
      </el-table>
      <el-table style="margin-top: 50px" :data="tableList3">
        <el-table-column property="date" label="物料编码" width="150"></el-table-column>
        <el-table-column property="date" label="物料名称" width="150"></el-table-column>
        <el-table-column property="date" label="单位" width="150"></el-table-column>
        <el-table-column property="date" label="单位名称" width="150"></el-table-column>
        <el-table-column property="date" label="预留数量" width="150"></el-table-column>
        <el-table-column property="date" label="预留比例" width="150"></el-table-column>
        <el-table-column property="date" label="预留周期" width="150"></el-table-column>
        <el-table-column property="date" label="调出仓库" width="150"></el-table-column>
        <el-table-column property="date" label="调出仓库名称" width="150"></el-table-column>
        <el-table-column property="date" label="调出货位" width="150"></el-table-column>
        <el-table-column property="date" label="调出货位名称" width="150"></el-table-column>
        <el-table-column property="date" label="调入仓库" width="150"></el-table-column>
        <el-table-column property="date" label="调入仓库名称" width="150"></el-table-column>
        <el-table-column property="date" label="调入货位" width="150"></el-table-column>
        <el-table-column property="date" label="调入货位名称" width="150"></el-table-column>
        <el-table-column property="date" label="调拨数量" width="150"></el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>

<script>
import {getResevedDetail} from '@/api/purchase/transferOrder.js'
export default {
  props: {
    isVisible: {
      type: Boolean,
      default: false
    },
    info: {
      type: Object,
      default: null
    }
  },
  mounted() {
    console.log('出现')
    console.log(this.info)
    this.getDetails(this.info)
  },
  data() {
    return {
      visible:this.isVisible,
      tableList1: [],
      tableList2: [],
      tableList3: [],
    }
  },
  methods: {
    getDetails(row) {
      getResevedDetail(row.code).then(res => {
        if (res.code === 200) {
          // this.basicForm = res.data
        }
      })
    },
    handleClose() {
      console.log('调用')
      this.$emit('updateReserved', false)
    }
  }
}
</script>