<template>
|
<nut-popup v-model:visible="visible">
|
<div class="dialog-form-wrapper">
|
<nut-form :model-value="form" ref="formRef" label-position="top">
|
<nut-form-item
|
label="谢绝原因:"
|
class="bole-form-item alignTop"
|
prop="remark"
|
label-width="90px"
|
>
|
<nut-textarea v-model="form.remark" rows="4" placeholder="请输入谢绝原因"> </nut-textarea>
|
</nut-form-item>
|
</nut-form>
|
<div class="dialog-form-footer">
|
<nut-button @click="visible = false" plain>取消</nut-button>
|
<nut-button type="primary" @click="handleConfirm">确认</nut-button>
|
</div>
|
</div>
|
</nut-popup>
|
</template>
|
|
<script setup lang="ts">
|
defineOptions({
|
name: 'RefuseDialog',
|
});
|
|
type Form = {
|
remark: string;
|
};
|
|
const form = defineModel<Form>('form');
|
|
const visible = defineModel<boolean>();
|
|
const emit = defineEmits<{
|
(e: 'onConfirm'): void;
|
}>();
|
|
const formRef = ref<any>(null);
|
|
function handleConfirm() {
|
if (!formRef.value) return;
|
formRef.value.validate().then(({ valid, errors }: any) => {
|
if (valid) {
|
emit('onConfirm');
|
}
|
});
|
}
|
</script>
|
|
<style lang="scss">
|
@import '@/styles/common.scss';
|
|
.payroll-form-wrapper {
|
width: 600px;
|
}
|
</style>
|