| | |
| | | <div class="upload-container"> |
| | | <el-upload |
| | | :http-request="handleHttpRequest" |
| | | :limit="3" |
| | | :on-success="handleUploadSuccess" |
| | | :on-error="handleUploadError" |
| | | :on-remove="handleFileRemove" |
| | |
| | | catalogResourceName: fieldRules(true), |
| | | objectionDesc: fieldRules(true), |
| | | objectionBasis: fieldRules(true), |
| | | // attachId: dialogMode.value === 'add' ? fieldRules(true) : fieldRules(false) |
| | | |
| | | } |
| | | |
| | | // 异议反馈表单校验规则 |
| | |
| | | async function submitForm(objectionStatus) { |
| | | const isValid = await formRef.value?.validate().catch(() => false) |
| | | if (!isValid) return |
| | | if (uploadedFiles.value.length === 0) { |
| | | return ElMessage.warning('请上传附件') |
| | | // 只在新增时校验附件是否上传 |
| | | if (dialogMode.value === 'add' && uploadedFiles.value.length === 0) { |
| | | ElMessage.warning('请上传附件') |
| | | return |
| | | } |
| | | submitting.value = true |
| | | |
| | |
| | | objectionBasis: formData.value.objectionBasis, |
| | | areaCode: formData.value.areaCode || '', |
| | | handleUnit: formData.value.handleUnit || '', |
| | | // 构建附件列表 |
| | | attachmentList: uploadedFiles.value.map(file => ({ |
| | | attachId: file.attachId, |
| | | attachName: file.originalName, |
| | | })), |
| | | // 只在有附件时才构建附件列表 |
| | | ...(uploadedFiles.value.length > 0 && { |
| | | attachmentList: uploadedFiles.value.map(file => ({ |
| | | attachId: file.attachId, |
| | | attachName: file.originalName, |
| | | })), |
| | | }), |
| | | objectionStatus: objectionStatus |
| | | } |
| | | await gdDataObjectionSubmitApi(submitData) |