fix : 修改为一个文件上传入口, 阶段变更增加变更状态,修复项目实施显示
This commit is contained in:
@@ -254,10 +254,13 @@
|
||||
</el-form>
|
||||
<baseTitle title="附件文件"></baseTitle>
|
||||
<div :style="{marginRight:!formData.isSpecialFund?'20px':'80px'}">
|
||||
<AttachmentUpload ref="attachment" label="需求申请书附件" :showTable="showTable" v-model:otherFileList="otherFileList"
|
||||
@getAttachment="getAttachment" v-model:singleList="singleList"
|
||||
:showSingleTable="showSingleTable"
|
||||
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData" tag="需求上报"
|
||||
<AttachmentUpload ref="attachment" label="需求申请书附件"
|
||||
:showTable="showTable"
|
||||
v-model:otherFileList="otherFileList"
|
||||
@getOtherFile="getOtherFile"
|
||||
:showSingleTable="showSingleTable" @getAttachment="getAttachment"
|
||||
v-model:singleList="singleList"
|
||||
:showFileList="true" :formData="formData" tag="需求上报"
|
||||
:preview="name === 'Summary/edit'"/>
|
||||
</div>
|
||||
<div class="approval-record">
|
||||
@@ -470,45 +473,44 @@ const handleSubmit = debounce(async (instance) => {
|
||||
})
|
||||
return;
|
||||
}
|
||||
let otherFiles = []
|
||||
otherFileList.value.forEach(item => {
|
||||
otherFiles.push(getFileParam(item))
|
||||
let otherFiles = []
|
||||
otherFileList.value.forEach(item => {
|
||||
otherFiles.push(getFileParam(item))
|
||||
})
|
||||
formData.value.optionalChargeLeadership = optionalChargeLeadershipList.value
|
||||
if (formData.value.singleFile !== undefined) {
|
||||
formData.value.singleFile = getFileParam(formData.value.singleFile)
|
||||
}
|
||||
// if (!attachment.value.isHaveOneFile) {
|
||||
// attachment.value.validate()
|
||||
// ElNotification({
|
||||
// title: '提示',
|
||||
// message: '请上传附件',
|
||||
// type: 'error'
|
||||
// })
|
||||
// return;
|
||||
// } else {
|
||||
// attachment.value.clearValidate()
|
||||
// }
|
||||
let params = {
|
||||
...formData.value,
|
||||
deploymentId: deploymentId.value,
|
||||
fileList: otherFiles,
|
||||
requirementId: route.query.id ? route.query.id : '-1'
|
||||
}
|
||||
console.log('params', params)
|
||||
let res = await requirementReported(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
await router.push({
|
||||
name: 'Summary'
|
||||
})
|
||||
formData.value.optionalChargeLeadership = optionalChargeLeadershipList.value
|
||||
if (formData.value.singleFile !== undefined) {
|
||||
formData.value.singleFile = getFileParam(formData.value.singleFile)
|
||||
}
|
||||
if (!attachment.value.isSingleFile) {
|
||||
attachment.value.validate()
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请上传附件',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
} else {
|
||||
attachment.value.clearValidate()
|
||||
}
|
||||
let params = {
|
||||
...formData.value,
|
||||
deploymentId: deploymentId.value,
|
||||
fileList: otherFiles,
|
||||
requirementId: route.query.id ? route.query.id : '-1'
|
||||
}
|
||||
console.log('params', params)
|
||||
|
||||
let res = await requirementReported(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
await router.push({
|
||||
name: 'Summary'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
const handleResubmit = debounce((instance) => {
|
||||
@@ -532,17 +534,17 @@ const handleResubmit = debounce((instance) => {
|
||||
if (formData.value.isSpecialFund && formData.value.specialFund === null) {
|
||||
formData.value.specialFund = getFundName(formData.value.specialFundId)
|
||||
}
|
||||
if (attachment.value.singleFile == null) {
|
||||
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 params = {
|
||||
...formData.value,
|
||||
deploymentId: deploymentId.value,
|
||||
|
||||
Reference in New Issue
Block a user