<!-- 
  提单费用试算结果
 -->
<template>
  <SysDialog
    class="billmoney-count-result"
    :visible="dialog.visible"
    v-bind="getBindValue"
    @onClose="onclose"
    @onConfirm="confirm"
  >
    <template #content>
      <VxeBasicTable v-bind="billMoneyCountResultOptions">
        <template #default_actions="{ row }">
          <el-button
            type="primary"
            :icon="View"
            class="width-100"
            link
            @click="hanleViewDetail(row)"
          >
            明细
          </el-button>
        </template>
      </VxeBasicTable>
    </template>
    <template #defineFooter>
      <span class="dialog-footer">
        <el-button
          type="primary"
          @click="confirm"
        >保存费用</el-button>
        <el-button
          type="danger"
          @click="onclose"
        >取消</el-button>
      </span>
    </template>
  </SysDialog>
  <BillMoneyCountResultDetail ref="billMoneyDetailRef" />
</template>
<script lang="ts" setup>
import SysDialog from "@/components/SysDialog.vue";
import { VxeBasicTable } from '@/components/VxeTable';
import { useBillMoneyCountResult } from "@/composables/lading/useBillMoneyCountResult";
import { View } from '@element-plus/icons-vue';
import useDialog from "@/hooks/useDialog";
import { reactive } from 'vue';
import { LadingBillFeeQueryResultDto } from "@/api/lading/ladingModle";
import BillMoneyCountResultDetail from './billMoneyCountResultDetail.vue';

// 弹框一些配置
const getBindValue = reactive({
    title: "提单费用试算结果",
    width: "80%",
    height: 0,
    isFooter: true
});
const { dialog, onClose, onShow } = useDialog();
const props = defineProps<{ ladingBillFeeQueryResul: LadingBillFeeQueryResultDto[] }>()
const emit = defineEmits(["saveBaseFee"])

const {
    show,
    onclose,
    confirm,
    billMoneyCountResultOptions,
    hanleViewDetail,
    billMoneyDetailRef
} = useBillMoneyCountResult(onClose, onShow, emit, props)

//父组件调用子组件显示弹框
//暴露出去给外部使用
defineExpose({
  show
});
</script>
<style lang="scss" scoped>
.billmoney-count-result {}
</style>