<script setup lang="ts">
import { ref } from "vue";
import { SALE_COLUMNS } from "/@/utils/details/sale";
import BasicDescriptions from "/@/components/BasicDescriptions";
import { httpDetail } from "/@/api/InvoiceSales/sheetOrderPool";
import { useAsync } from "/@/hooks";

const visible = ref(false);
const { data, run, loading } = useAsync({
  initalData: {}
});

const requesetSheetOrderDetail = sequenceNo => run(httpDetail({ sequenceNo }));

defineExpose({
  onDisplay(sequenceNo) {
    visible.value = true;
    requesetSheetOrderDetail(sequenceNo);
  }
});
</script>

<template>
  <ElDialog center title="确认单详情" v-model="visible" width="1100px">
    <BasicDescriptions
      v-loading="loading"
      ref="defaultRef"
      :data="data"
      :columns="SALE_COLUMNS"
      :col-number="3"
    />
  </ElDialog>
</template>
