fix : 详情修改为一个文件上传入口及测试校验,同步移动端详情展示

This commit is contained in:
2024-08-28 14:18:55 +08:00
parent 50504f4e94
commit d59c9d8cca
12 changed files with 380 additions and 388 deletions

View File

@@ -3,7 +3,8 @@
<baseTitle title="项目基本信息"></baseTitle>
<el-form :model="formData" ref="summaryForm" :rules="rules" :label-width="!formData.isSpecialFund?120:160"
:scroll-to-error="true">
<el-row gutter="30" style="margin-bottom: -18px;" :style="{marginLeft:!formData.isSpecialFund?'-8.5px':'-48.5px'}">
<el-row gutter="30" style="margin-bottom: -18px;"
:style="{marginLeft:!formData.isSpecialFund?'-8.5px':'-48.5px'}">
<el-col :span="6">
<el-form-item label="承办单位">
<Tooltip :content="authStore.userinfo?.subCompanyName" placement="bottom-start" width="240"
@@ -151,7 +152,8 @@
<span>{{ formData.specialFund }}</span>
</el-form-item>
</el-col>
<el-col :span="6" v-if="!route.query.id && formData.isSpecialFund" :style="{marginLeft:!formData.isSpecialFund?'0':route.query.id?'':'-40px'}">
<el-col :span="6" v-if="!route.query.id && formData.isSpecialFund"
:style="{marginLeft:!formData.isSpecialFund?'0':route.query.id?'':'-40px'}">
<el-form-item label="所属专项资金" prop="specialFundId">
<el-select v-model="formData.specialFundId" placeholder="请选择专项资金名称" clearable filterable>
<el-option
@@ -174,17 +176,20 @@
{{ optionalChargeLeadershipList.length !== 0 ? '更改' : '请选择' }}
</el-button>
<div v-for="(item,index) in optionalChargeLeadershipList" :key="item.id" style="margin-right: 5px">
{{ item.name }}{{index != optionalChargeLeadershipList?.length - 1 ? '' : ''}}
{{ item.name }}{{ index != optionalChargeLeadershipList?.length - 1 ? '' : '' }}
</div>
<user-picker :multiple="true" ref="optionalChargeLeadershipPickerRef" title="请选择分管领导" @cancelOrClear="optionalChargeLeaderPickerOkOrCancel"
<user-picker :multiple="true" ref="optionalChargeLeadershipPickerRef" title="请选择分管领导"
@cancelOrClear="optionalChargeLeaderPickerOkOrCancel"
v-model:value="optionalChargeLeadershipList" @ok="optionalChargeLeaderPickerOkOrCancel"/>
</el-form-item>
</el-col>
</el-row>
<baseTitle title="预期知识产权"></baseTitle>
<el-row gutter="30" style="margin-bottom: -18px;" :style="{marginLeft:!formData.isSpecialFund?'-8.5px':'-48.5px'}">
<el-row gutter="30" style="margin-bottom: -18px;"
:style="{marginLeft:!formData.isSpecialFund?'-8.5px':'-48.5px'}">
<el-col :span="12">
<el-form-item label="预期成果形式" prop="resultForm" :style="{marginRight:!formData.isSpecialFund?'0':route.query.id?'':'40px'}">
<el-form-item label="预期成果形式" prop="resultForm"
:style="{marginRight:!formData.isSpecialFund?'0':route.query.id?'':'40px'}">
<el-select v-model="formData.resultForm" placeholder="请选择预期成果形式" clearable filterable multiple>
<el-option
v-for="item in cacheStore.getDict('result_form')"
@@ -235,7 +240,8 @@
</el-col>
</el-row>
<baseTitle title="项目描述"></baseTitle>
<el-row gutter="30" style="margin-bottom: -18px;" :style="{marginLeft:!formData.isSpecialFund?'-8.5px':'-48.5px'}">
<el-row gutter="30" style="margin-bottom: -18px;"
:style="{marginLeft:!formData.isSpecialFund?'-8.5px':'-48.5px'}">
<el-col :span="24">
<el-form-item label="现有业务描述" prop="serviceDescription">
<el-input v-model="formData.serviceDescription" placeholder="请输入现有业务描述" rows="4" type="textarea"
@@ -473,44 +479,44 @@ const handleSubmit = debounce(async (instance) => {
})
return;
}
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'
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'
})
}
})
})
const handleResubmit = debounce((instance) => {
@@ -534,17 +540,17 @@ const handleResubmit = debounce((instance) => {
if (formData.value.isSpecialFund && formData.value.specialFund === null) {
formData.value.specialFund = getFundName(formData.value.specialFundId)
}
// 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 params = {
...formData.value,
deploymentId: deploymentId.value,