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