refactor(ProjectApply): 优化归档附件上传逻辑

This commit is contained in:
dj
2025-05-28 16:50:55 +08:00
parent f61d50dbfc
commit f4330b60d5

View File

@@ -669,26 +669,26 @@ const handleSubmit = async (instance) => {
if (props.step == 50) {
let files = []
if (props.mode === 'resubmit') {
attachment.value.allFileList.forEach(item => {
attachment.value.allFileList?.forEach(item => {
files.push(getFileParam(item))
})
} else {
otherFileList.value.forEach(item => {
otherFileList.value?.forEach(item => {
files.push(getFileParam(item))
})
}
// console.info("🚀 ~method:handleSubmit -----", files,attachment.value.isHaveOneFile)
if (!attachment.value.isHaveOneFile) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
// if (!attachment.value.isHaveOneFile) {
// attachment.value.validate()
// ElNotification({
// title: '提示',
// message: '请上传附件',
// type: 'error'
// })
// return;
// } else {
// attachment.value.clearValidate()
// }
let projectPersonIds = []
for (const item of projectPersonUserList.value) {
projectPersonIds.push(parseInt(item.id))
@@ -696,7 +696,7 @@ const handleSubmit = async (instance) => {
let params = {
deploymentId: deploymentId.value,
requirementId: route.query.id,
fileList: files,
fileList: files||[],
// singleFile: attachment.value.singleFile,
projectId: route.query.projectId,
...localFormData.value,