<template>
|
<ProDialog title="签约" v-model="visible" @close="onDialogClose" destroy-on-close draggable>
|
<ProForm :model="form" ref="dialogForm" label-width="100px">
|
<ProFormItemV2 label="请选择模板:" prop="url" :check-rules="[{ message: '请选择模板' }]">
|
<ProFormSelect v-model="form.url" :valueEnum="enterpriseContractTemplateSelect">
|
</ProFormSelect>
|
</ProFormItemV2>
|
</ProForm>
|
<template #footer>
|
<span class="dialog-footer">
|
<el-button type="primary" @click="handleConfirm">提交</el-button>
|
<el-button type="default" @click="emit('onCancel')">取消</el-button>
|
</span>
|
</template>
|
</ProDialog>
|
</template>
|
|
<script setup lang="ts">
|
import {
|
ProDialog,
|
ProForm,
|
ProFormItemV2,
|
ProFormSelect,
|
UploadUserFile,
|
} from '@bole-core/components';
|
import { FormInstance } from 'element-plus';
|
|
defineOptions({
|
name: 'BatchImportDialog',
|
});
|
|
const { enterpriseContractTemplateSelect } = useEnterpriseContractTemplateSelect();
|
|
type Form = {
|
title?: string;
|
url: UploadUserFile[];
|
};
|
|
const visible = defineModel({ type: Boolean });
|
const form = defineModel<Form>('form');
|
|
const emit = defineEmits<{
|
(e: 'onConfirm'): void;
|
(e: 'onCancel'): void;
|
}>();
|
|
const dialogForm = ref<FormInstance>();
|
|
function onDialogClose() {
|
if (!dialogForm.value) return;
|
dialogForm.value.resetFields();
|
}
|
|
function handleConfirm() {
|
if (!dialogForm.value) return;
|
dialogForm.value.validate((valid) => {
|
if (valid) {
|
emit('onConfirm');
|
} else {
|
return;
|
}
|
});
|
}
|
</script>
|