<!-- 
  提单导入
 -->
<template>
  <SysDialog
    class="lading-bill-import"
    :visible="dialog.visible"
    v-bind="getBindValue"
    @onClose="onclose"
    @onConfirm="confirm"
  >
    <template #content>
      <el-form
        ref="ladingBillSetFormRef"
        class="ladingB-bill"
        :model="ladingBillImportState.form"
        :rules="ladingBillImportState.rules"
        inline
      >
        <div class="inline-flex">
          <span class="title">基础信息:</span>
          <el-form-item
            prop="transactionNumber"
            label="导入类型:"
            class="main"
          >
            <el-input
              v-model="ladingBillImportState.form.transactionNumber"
              placeholder="导入类型"
            />
          </el-form-item>
        </div>
        <div>
          <span class="title">说明:</span>
          <div>
            一： xxxx
          </div>
        </div>
      </el-form>
    </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>
</template>
<script lang="ts" setup>
import SysDialog from "@/components/SysDialog.vue";
import useDialog from "@/hooks/useDialog";
import { reactive } from 'vue';

const emit = defineEmits(['saveConfirm'])
// 弹框一些配置
const getBindValue = reactive({
  title: "提单导入",
  width: 520,
  height: 0,
  isFooter: true
});
//弹框属性
const { dialog, onClose, onShow } = useDialog();
const ladingBillImportState = reactive({
  form: {
    transactionNumber: ''
  },
  rules: {}
})
// 显示
const show = () => {
  onShow()
}
// 隐藏
const onclose = () => {
  onClose()
}
// 确定 
const confirm = () => {
  emit("saveConfirm")
}

//父组件调用子组件显示弹框
//暴露出去给外部使用
defineExpose({
  show
});
</script>
<style lang="scss" scoped>
.lading-bill-import {
  .inline-flex {
    display: inline-flex;
    align-items: center;

    .main {
      margin-left: 10px;
    }

    :deep(.el-form-item) {
      margin-bottom: 0;
    }
  }
}
</style>