<script setup lang="ts">
import { ref } from "vue";
import { httpDetail } from "/@/api/InvoiceSales/capitalPool";
import BasicDescriptions from "/@/components/BasicDescriptions";
import { CAPITAL_COLUMNS } from "/@/utils/details/tragelog";
import { useAsync } from "/@/hooks";
import { ORDER_COLUMNS, GOOD_COLUMNS } from "/@/utils/details/sale";
const visible = ref(false);

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

defineExpose({
  onDisplay(logNo) {
    visible.value = true;

    run(
      httpDetail({
        logNo
      })
    );
  }
});
</script>

<template>
  <el-dialog
    v-model="visible"
    center
    title="资金详情"
    width="1040px"
    :close-on-click-modal="false"
  >
    <BasicDescriptions
      style="width: 100%"
      v-loading="loading"
      :columns="CAPITAL_COLUMNS"
      :data="data"
    />
    <BasicDescriptions
      style="width: 100%"
      v-loading="loading"
      :columns="ORDER_COLUMNS"
      :data="data && data.orderinfo ? data.orderinfo : {}"
    />
    <BasicDescriptions
      style="width: 100%"
      v-loading="loading"
      :columns="GOOD_COLUMNS"
      :data="data && data.orderinfo ? data.orderinfo : {}"
    />
  </el-dialog>
</template>
