<script setup lang="ts">
import { ref } from "vue";
import { preview_columns } from "./columns";
const visible = ref(false);
const data = ref({});

defineExpose({
  onDisplay: _data => {
    visible.value = true;
    data.value = _data;
  }
});
</script>

<template>
  <el-dialog v-model="visible" title="采购单详情" center>
    <el-descriptions :column="2" border size="small">
      <el-descriptions-item
        v-for="(item, index) in preview_columns"
        :label="item.label"
        :key="index"
        >{{ data[item.field] }}</el-descriptions-item
      >
    </el-descriptions>
  </el-dialog>
</template>
