fix : 修复提交校验

This commit is contained in:
2024-07-03 00:38:21 +08:00
parent 928f41112c
commit 0d7c303397
9 changed files with 30 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div v-loading="loading" class="add-block">
<baseTitle title="需求征集信息录入"></baseTitle>
<el-form :model="formData" ref="demandForm" :rules="rules">
<el-form :model="formData" ref="demandForm" :rules="rules">
<el-row gutter="30">
<el-col :span="8">
<el-form-item label="征集名称" prop="requirementName" label-width="96">
@@ -42,7 +42,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="专项资金名称" prop="specialFundId" v-if="formData.isSpecialFund">
<el-select v-model="formData.specialFundId" placeholder="请选择专项资金名称" clearable filterable >
<el-select v-model="formData.specialFundId" placeholder="请选择专项资金名称" clearable filterable>
<el-option
v-for="item in specialFundOption"
:key="item.value"
@@ -58,7 +58,10 @@
<el-button color="#DED0B2" @click="showCompany">{{ selectedCompanyList.length === 0 ? '请选择征集公司' : '更改' }}
</el-button>
</div>
<div v-if="route.query.id" :class="showExpendClass(showMoreCompany)">{{ getName(selectedCompanyList) }}</div>
<div v-if="route.query.id" :class="showExpendClass(showMoreCompany)">{{
getName(selectedCompanyList)
}}
</div>
<div v-else :class="showExpendClass(showMoreCompany)">{{ getName(selectedCompanyList) }}</div>
<div style="color: #2a99ff;text-align: center;width: 100%;font-size: 15px;cursor: pointer"
@click="handleExpend">
@@ -365,14 +368,16 @@ const submitParam = (item) => {
}
}
const handleSubmit = async (instance) => {
console.log('submitParam(formData.value)', submitParam(formData.value))
if (!instance) return
instance.validate(async (valid) => {
if (!valid) {
return ElNotification({
ElNotification({
title: '提示',
message: '请完善数据,再提交!',
type: 'error'
})
return;
}
const {msg, code} = await addRequirement(submitParam(formData.value))
ElNotification({
@@ -427,7 +432,7 @@ const getDetailInfo = async () => {
if (res.code === 1000) {
selectedCompanyList.value = getCompanyOptionItem(res.data.companyIds)
formData.value = res.data
if(res.data.fileList.length!==0){
if (res.data.fileList.length !== 0) {
showTable.value = false
nextTick(() => {
showTable.value = true