Merge pull request 'fix : 修复提交校验' (#455) from dd into master
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/455
This commit is contained in:
@@ -95,7 +95,6 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|||||||
@@ -279,11 +279,12 @@ const handleSubmit = (instance) => {
|
|||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: '请完善数据,再提交!',
|
message: '请完善数据,再提交!',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
let researchPersonnelId = ''
|
let researchPersonnelId = ''
|
||||||
formData.value.tableData.forEach(item => {
|
formData.value.tableData.forEach(item => {
|
||||||
@@ -326,11 +327,12 @@ const handleResubmit = (instance) => {
|
|||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: '请完善数据,再提交!',
|
message: '请完善数据,再提交!',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
let newUsrAllocationsObj = {}
|
let newUsrAllocationsObj = {}
|
||||||
let newUsrAllocationsObjArray = []
|
let newUsrAllocationsObjArray = []
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-loading="loading" class="add-block">
|
<div v-loading="loading" class="add-block">
|
||||||
<baseTitle title="需求征集信息录入"></baseTitle>
|
<baseTitle title="需求征集信息录入"></baseTitle>
|
||||||
<el-form :model="formData" ref="demandForm" :rules="rules">
|
<el-form :model="formData" ref="demandForm" :rules="rules">
|
||||||
<el-row gutter="30">
|
<el-row gutter="30">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="征集名称" prop="requirementName" label-width="96">
|
<el-form-item label="征集名称" prop="requirementName" label-width="96">
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="专项资金名称" prop="specialFundId" v-if="formData.isSpecialFund">
|
<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
|
<el-option
|
||||||
v-for="item in specialFundOption"
|
v-for="item in specialFundOption"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
@@ -58,7 +58,10 @@
|
|||||||
<el-button color="#DED0B2" @click="showCompany">{{ selectedCompanyList.length === 0 ? '请选择征集公司' : '更改' }}
|
<el-button color="#DED0B2" @click="showCompany">{{ selectedCompanyList.length === 0 ? '请选择征集公司' : '更改' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</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 v-else :class="showExpendClass(showMoreCompany)">{{ getName(selectedCompanyList) }}</div>
|
||||||
<div style="color: #2a99ff;text-align: center;width: 100%;font-size: 15px;cursor: pointer"
|
<div style="color: #2a99ff;text-align: center;width: 100%;font-size: 15px;cursor: pointer"
|
||||||
@click="handleExpend">
|
@click="handleExpend">
|
||||||
@@ -365,14 +368,16 @@ const submitParam = (item) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleSubmit = async (instance) => {
|
const handleSubmit = async (instance) => {
|
||||||
|
console.log('submitParam(formData.value)', submitParam(formData.value))
|
||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: '请完善数据,再提交!',
|
message: '请完善数据,再提交!',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
const {msg, code} = await addRequirement(submitParam(formData.value))
|
const {msg, code} = await addRequirement(submitParam(formData.value))
|
||||||
ElNotification({
|
ElNotification({
|
||||||
@@ -427,7 +432,7 @@ const getDetailInfo = async () => {
|
|||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
selectedCompanyList.value = getCompanyOptionItem(res.data.companyIds)
|
selectedCompanyList.value = getCompanyOptionItem(res.data.companyIds)
|
||||||
formData.value = res.data
|
formData.value = res.data
|
||||||
if(res.data.fileList.length!==0){
|
if (res.data.fileList.length !== 0) {
|
||||||
showTable.value = false
|
showTable.value = false
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
showTable.value = true
|
showTable.value = true
|
||||||
|
|||||||
@@ -214,7 +214,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="16" v-if="formData.isSpecialFund">
|
<el-col :span="16" v-if="formData.isSpecialFund">
|
||||||
<el-form-item label="其中申请公司总部科技创新专项资金(元)">
|
<el-form-item label="其中申请公司总部科技创新专项资金(元)" prop="specialFundAmount">
|
||||||
<el-input-number v-model="formData.specialFundAmount" placeholder="请输入专项资金" :controls="false"/>
|
<el-input-number v-model="formData.specialFundAmount" placeholder="请输入专项资金" :controls="false"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -294,7 +294,7 @@ const formData = ref({
|
|||||||
|
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
projectName: [{required: true, message: '请输入项目名称', trigger: 'blur'}],
|
projectName: [{required: true, message: '请输入项目名称', trigger: 'blur'}],
|
||||||
// specialFundId: [{required: true, message: '请选择专项资金', trigger: 'blur'}],
|
specialFundId: [{required: true, message: '请选择专项资金', trigger: 'blur'}],
|
||||||
startTime: [{required: true, message: '请选择开始时间', trigger: ['blur', 'change']}],
|
startTime: [{required: true, message: '请选择开始时间', trigger: ['blur', 'change']}],
|
||||||
endTime: [{required: true, message: '请选择结束时间', trigger: ['blur', 'change']}],
|
endTime: [{required: true, message: '请选择结束时间', trigger: ['blur', 'change']}],
|
||||||
rdSubject: [{required: true, message: '请选择研发主体', trigger: ['blur', 'change']}],
|
rdSubject: [{required: true, message: '请选择研发主体', trigger: ['blur', 'change']}],
|
||||||
@@ -401,11 +401,12 @@ const handleSubmit = debounce(async (instance) => {
|
|||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid, fields) => {
|
instance.validate(async (valid, fields) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: '请完善数据,再提交!',
|
message: '请完善数据,再提交!',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
let otherFiles = []
|
let otherFiles = []
|
||||||
otherFileList.value.forEach(item => {
|
otherFileList.value.forEach(item => {
|
||||||
|
|||||||
@@ -89,11 +89,12 @@ const handleSubmit = (instance) => {
|
|||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: '请完善数据,再提交!',
|
message: '请完善数据,再提交!',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
let files = []
|
let files = []
|
||||||
otherFileList.value.forEach(item => {
|
otherFileList.value.forEach(item => {
|
||||||
@@ -139,11 +140,12 @@ const handleResubmit = (instance) => {
|
|||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: '请完善数据,再提交!',
|
message: '请完善数据,再提交!',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
let otherFiles = []
|
let otherFiles = []
|
||||||
if (name.value === 'Implementation/edit') {
|
if (name.value === 'Implementation/edit') {
|
||||||
|
|||||||
@@ -183,11 +183,12 @@ const handleSubmit = async (instance) => {
|
|||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: '请完善数据,再提交!',
|
message: '请完善数据,再提交!',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
let params = {
|
let params = {
|
||||||
fileList: fileList.value,
|
fileList: fileList.value,
|
||||||
|
|||||||
@@ -173,11 +173,12 @@ const handleSubmit = (instance) => {
|
|||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: '请完善数据,再提交!',
|
message: '请完善数据,再提交!',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
instance.clearValidate()
|
instance.clearValidate()
|
||||||
tableForm.tableData.forEach(item => {
|
tableForm.tableData.forEach(item => {
|
||||||
|
|||||||
@@ -138,11 +138,12 @@ const handleSubmit = (instance) => {
|
|||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: '请完善数据,再提交!',
|
message: '请完善数据,再提交!',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
let files = []
|
let files = []
|
||||||
otherFileList.value.forEach(item => {
|
otherFileList.value.forEach(item => {
|
||||||
|
|||||||
@@ -189,11 +189,12 @@ const handleSubmit = async (instance) => {
|
|||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: '请完善数据,再提交!',
|
message: '请完善数据,再提交!',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
const {msg, code} = await addFund(submitParam(formData.value))
|
const {msg, code} = await addFund(submitParam(formData.value))
|
||||||
ElNotification({
|
ElNotification({
|
||||||
|
|||||||
Reference in New Issue
Block a user