From bd20a385dd86cf32735578c4c140a0aebf758e45 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期四, 15 五月 2025 17:15:07 +0800 Subject: [PATCH] fix: bug --- src/views/Reward/components/UploadCertRewardDialog.vue | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 107 insertions(+), 0 deletions(-) diff --git a/src/views/Reward/components/UploadCertRewardDialog.vue b/src/views/Reward/components/UploadCertRewardDialog.vue new file mode 100644 index 0000000..3829d81 --- /dev/null +++ b/src/views/Reward/components/UploadCertRewardDialog.vue @@ -0,0 +1,107 @@ +<template> + <ProDialog + title="涓婁紶鍑瘉" + v-model="visible" + @close="onDialogClose" + destroy-on-close + draggable + width="700px" + > + <ProForm :model="form" ref="dialogForm" label-width="120px"> + <ProFormItemV2 + label="鍏ヨ处绫诲瀷:" + prop="incomeType" + :check-rules="[{ message: '璇烽�夋嫨鍏ヨ处绫诲瀷' }]" + > + <ProFormRadio + v-model="form.incomeType" + :value-enum="incomeTypeEnum" + :button-style="false" + /> + </ProFormItemV2> + <ProFormItemV2 + label="涓婁紶鍏ヨ处鍑瘉:" + prop="fileUrl" + :check-rules="[{ message: '璇蜂笂浼犲叆璐﹀嚟璇�', type: 'upload' }]" + > + <ProFormUpload + v-model:file-url="form.fileUrl" + :limitFileSize="50" + accept="doc,docx,pdf,xls,xlsx,jpg/jpeg,png" + ></ProFormUpload> + </ProFormItemV2> + </ProForm> + <template #footer> + <span class="dialog-footer"> + <el-button @click="emit('onCancel')">鍙� 娑�</el-button> + <el-button type="primary" @click="handleConfirm">纭� 瀹�</el-button> + </span> + </template> + </ProDialog> +</template> + +<script setup lang="ts"> +import { FormInstance } from 'element-plus'; +import { + ProDialog, + ProForm, + ProFormItemV2, + UploadUserFile, + ProFormUpload, + ProFormRadio, +} from '@bole-core/components'; +import { IncomeTypeEnumText, IncomeTypeEnum } from '@/constants'; + +defineOptions({ + name: 'UploadCertRewardDialog', +}); + +const visible = defineModel({ type: Boolean }); + +type Form = { + title?: string; + fileUrl: UploadUserFile[]; + parkBountyApplyId: string; + incomeType: IncomeTypeEnum; + showSuportPlatRecharge: boolean; + showSuportFiscalRecharge: boolean; +}; + +const form = defineModel<Form>('form'); + +const emit = defineEmits<{ + (e: 'onConfirm'): void; + (e: 'onCancel'): void; +}>(); + +const incomeTypeEnum = computed(() => { + return [ + form.value.showSuportFiscalRecharge && { + label: IncomeTypeEnumText[IncomeTypeEnum.Fiscal], + value: IncomeTypeEnum.Fiscal, + }, + form.value.showSuportPlatRecharge && { + label: IncomeTypeEnumText[IncomeTypeEnum.Platform], + value: IncomeTypeEnum.Platform, + }, + ].filter(Boolean); +}); + +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> -- Gitblit v1.9.1