liu
9 天以前 a7dc7b230fcc6abc6ee5a7bfadb90789b03d2ca8
src/views/hrm/leave/modules/form.vue
@@ -4,6 +4,8 @@
import { computed, ref } from 'vue';
import { useUserStore } from '@vben/stores';
import { useVbenModal } from '#/packages/effects/common-ui/src';
import { message } from 'ant-design-vue';
@@ -16,6 +18,8 @@
const emit = defineEmits(['success']);
const formType = ref<FormType>('create');
const userStore = useUserStore();
const isDetail = computed(() => formType.value === 'detail');
const getTitle = computed(() => {
@@ -74,6 +78,8 @@
    formApi.setDisabled(data.formType === 'detail');
    modalApi.setState({ showConfirmButton: data.formType !== 'detail' });
    if (!data?.id) {
      // 新增时默认申请人为当前登录用户,可修改
      await formApi.setFieldValue('userId', userStore.userInfo?.id);
      return;
    }
    modalApi.lock();