wupengfei
2025-12-03 fa5ee26bb701b816efc811c193ee55504a6efd51
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<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>