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-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -279,11 +279,12 @@ const handleSubmit = (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return ElNotification({
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请完善数据,再提交!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
let researchPersonnelId = ''
|
||||
formData.value.tableData.forEach(item => {
|
||||
@@ -326,11 +327,12 @@ const handleResubmit = (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return ElNotification({
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请完善数据,再提交!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
let newUsrAllocationsObj = {}
|
||||
let newUsrAllocationsObjArray = []
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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-form-item>
|
||||
</el-col>
|
||||
@@ -294,7 +294,7 @@ const formData = ref({
|
||||
|
||||
const rules = reactive({
|
||||
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']}],
|
||||
endTime: [{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
|
||||
instance.validate(async (valid, fields) => {
|
||||
if (!valid) {
|
||||
return ElNotification({
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请完善数据,再提交!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
let otherFiles = []
|
||||
otherFileList.value.forEach(item => {
|
||||
|
||||
@@ -89,11 +89,12 @@ const handleSubmit = (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return ElNotification({
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请完善数据,再提交!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
let files = []
|
||||
otherFileList.value.forEach(item => {
|
||||
@@ -139,11 +140,12 @@ const handleResubmit = (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return ElNotification({
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请完善数据,再提交!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
let otherFiles = []
|
||||
if (name.value === 'Implementation/edit') {
|
||||
|
||||
@@ -183,11 +183,12 @@ const handleSubmit = async (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return ElNotification({
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请完善数据,再提交!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
let params = {
|
||||
fileList: fileList.value,
|
||||
|
||||
@@ -173,11 +173,12 @@ const handleSubmit = (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return ElNotification({
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请完善数据,再提交!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
instance.clearValidate()
|
||||
tableForm.tableData.forEach(item => {
|
||||
|
||||
@@ -138,11 +138,12 @@ const handleSubmit = (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return ElNotification({
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请完善数据,再提交!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
let files = []
|
||||
otherFileList.value.forEach(item => {
|
||||
|
||||
@@ -189,11 +189,12 @@ const handleSubmit = async (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return ElNotification({
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请完善数据,再提交!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
const {msg, code} = await addFund(submitParam(formData.value))
|
||||
ElNotification({
|
||||
|
||||
Reference in New Issue
Block a user