fix : 修改提交/重新提交功能文件传参问题
This commit is contained in:
@@ -109,7 +109,6 @@ const compositeParam = (item) => {
|
||||
}
|
||||
const getAttachment = (val) => {
|
||||
console.log('上传文件getAttachment', val)
|
||||
file.value = compositeParam(val)
|
||||
formData.value.singleFile = compositeParam(val)
|
||||
}
|
||||
const getOtherFile = (val) => {
|
||||
@@ -130,23 +129,20 @@ const getFileParam = (item) => {
|
||||
}
|
||||
const handleSubmit = async () => {
|
||||
let files = []
|
||||
let singleFile = {}
|
||||
if (file.value.fileId !== undefined) {
|
||||
singleFile = {
|
||||
fileId: file.value.fileId
|
||||
}
|
||||
}
|
||||
otherFileList.value.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
if (formData.value.singleFile !== undefined) {
|
||||
formData.value.singleFile = getFileParam(formData.value.singleFile)
|
||||
}
|
||||
let params = {
|
||||
deploymentId: deploymentId.value,
|
||||
requirementId: route.query.id,
|
||||
fileList: files,
|
||||
singleFile: singleFile,
|
||||
singleFile: formData.value.singleFile,
|
||||
projectId: route.query.projectId,
|
||||
}
|
||||
if (JSON.stringify(singleFile) === "{}") {
|
||||
if (!attachment.value.isSingleFile) {
|
||||
attachment.value.validate()
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
@@ -154,7 +150,7 @@ const handleSubmit = async () => {
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}else {
|
||||
} else {
|
||||
attachment.value.clearValidate()
|
||||
}
|
||||
console.log('params', params)
|
||||
@@ -172,34 +168,20 @@ const handleSubmit = async () => {
|
||||
}
|
||||
}
|
||||
const handleResubmit = () => {
|
||||
let singleFile = {}
|
||||
let otherFiles = []
|
||||
let fileArray
|
||||
if (attachment.value.singleFile !== null && name.value === 'Filing/edit') {
|
||||
singleFile = {
|
||||
fileId: attachment.value.singleFile.fileId
|
||||
}
|
||||
fileArray = attachment.value.allFileList
|
||||
} else {
|
||||
if (file.value.fileId !== undefined) {
|
||||
singleFile = {
|
||||
fileId: file.value.fileId
|
||||
}
|
||||
}
|
||||
fileArray = otherFileList.value
|
||||
if (name.value === 'Filing/edit') {
|
||||
attachment.value.allFileList?.forEach(item => {
|
||||
otherFiles.push(getFileParam(item))
|
||||
})
|
||||
}
|
||||
fileArray.forEach(item => {
|
||||
otherFiles.push(getFileParam(item))
|
||||
})
|
||||
//todo requirementId
|
||||
let params = {
|
||||
deploymentId: deploymentId.value,
|
||||
requirementId: route.query.id,
|
||||
fileList: otherFiles,
|
||||
singleFile: singleFile,
|
||||
singleFile: formData.value.singleFile,
|
||||
projectId: route.query.projectId,
|
||||
}
|
||||
if (JSON.stringify(singleFile) === "{}") {
|
||||
if (!attachment.value.isSingleFile || !formData.value.singleFile) {
|
||||
attachment.value.validate()
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
@@ -207,7 +189,7 @@ const handleResubmit = () => {
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}else {
|
||||
} else {
|
||||
attachment.value.clearValidate()
|
||||
}
|
||||
console.log('重新提交params', params)
|
||||
@@ -254,7 +236,7 @@ const init = () => {
|
||||
nextTick(() => {
|
||||
processDiagramViewer.value = true
|
||||
})
|
||||
}else {
|
||||
} else {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
|
||||
Reference in New Issue
Block a user