refactor(ProjectApply): 优化归档附件上传逻辑
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user