<script setup lang="ts">
import { ref } from "vue";
import Invoice from "/@/components/Invoice";

import { useAsync } from "/@/hooks/core/useAsync";

const visible = ref(false);
const invoiceNumber = ref("");


const { run: detail, data } = useAsync<Record<string, string>>({
  initalData: {},
});

defineExpose({
  onDisplay: ({ invoiceNumber: _invoiceNumber, InvCode }) => {
    visible.value = true;
    invoiceNumber.value = _invoiceNumber;
    console.log(InvCode);


    // detail(httpDetail({ InvCode: id.value }));
  }
});
</script>

<template>
  <el-dialog v-model="visible" width="1040px" :close-on-click-modal="false">


    <Invoice :inv-number="invoiceNumber" type="purchase" />
  </el-dialog>
</template>
