fix : 修复专项资金显示情况
This commit is contained in:
@@ -9,17 +9,21 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5" v-if="!route.query.id">
|
||||
<el-form-item label="是否专项资金" prop="isSpecialFund" >
|
||||
<el-form-item label="是否专项资金" prop="isSpecialFund">
|
||||
<el-radio-group v-model="formData.isSpecialFund">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="formData.isSpecialFund?(!route.query.id?6:12):6">
|
||||
<el-form-item label="专项资金" prop="specialFund" v-if="formData.isSpecialFund">
|
||||
<span v-if="route.query.id">{{ getSpecialFundName(formData.specialFund) }}</span>
|
||||
<el-select v-else v-model="formData.specialFund" placeholder="请选择专项资金" clearable filterable>
|
||||
<el-col :span="6" v-if="route.query.id&&formData.specialFund">
|
||||
<el-form-item label="专项资金" prop="specialFundId" >
|
||||
<span>{{ formData.specialFund }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" v-if="!route.query.id&&formData.isSpecialFund">
|
||||
<el-form-item label="专项资金" prop="specialFundId">
|
||||
<el-select v-model="formData.specialFundId" placeholder="请选择专项资金" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in specialFundOption"
|
||||
:key="item.value"
|
||||
@@ -44,7 +48,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-form-item label="结束时间" prop="endTime"
|
||||
:title="!formData.startTime?'请先选择开始时间!':''">
|
||||
<el-config-provider>
|
||||
<el-date-picker
|
||||
v-model="formData.endTime"
|
||||
@@ -209,18 +214,23 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="其中申请公司总部科技创新专项资金(元)" prop="specialFundAmount" v-if="formData.isSpecialFund">
|
||||
<el-form-item label="其中申请公司总部科技创新专项资金(元)" prop="specialFundAmount" v-if="!route.query.id&&formData.isSpecialFund">
|
||||
<el-input-number v-model="formData.specialFundAmount" placeholder="请输入专项资金" :controls="false"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="其中申请公司总部科技创新专项资金(元)" prop="specialFundAmount" v-if="route.query.id&&formData.specialFundAmount">
|
||||
<el-input-number v-model="formData.specialFundAmount" placeholder="请输入专项资金" :controls="false"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="现有业务描述" prop="serviceDescription">
|
||||
<el-input v-model="formData.serviceDescription" type="textarea" clearable></el-input>
|
||||
<el-input v-model="formData.serviceDescription" placeholder="请输入现有业务描述" rows="4" type="textarea"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="研发项目关键内容描述" prop="contentDescription">
|
||||
<el-input v-model="formData.contentDescription" type="textarea" clearable></el-input>
|
||||
<el-input v-model="formData.contentDescription" placeholder="请输入研发项目关键内容描述" rows="4" type="textarea"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -277,7 +287,7 @@ const formData = ref({
|
||||
|
||||
const rules = reactive({
|
||||
projectName: [{required: true, message: '请输入项目名称', trigger: 'blur'}],
|
||||
specialFund: [{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']}],
|
||||
@@ -313,19 +323,21 @@ const getIsFund = async () => {
|
||||
loading.value = false
|
||||
formData.value.isSpecialFund = res.data.isSpecialFund
|
||||
if (res.data.isSpecialFund) {
|
||||
formData.value.specialFund = Number(res.data.specialFund)
|
||||
res.data.specialFundId = getSpecialFundId(res.data.specialFund)
|
||||
formData.value.specialFundId = res.data.specialFundId
|
||||
formData.value.specialFund = res.data.specialFund
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
const getSpecialFundName = (val) => {
|
||||
let label
|
||||
const getSpecialFundId = (val) => {
|
||||
let value
|
||||
specialFundOption.value.forEach(item => {
|
||||
if (item.value == val) {
|
||||
label = item.label
|
||||
if (item.label == val) {
|
||||
value = item.value
|
||||
}
|
||||
})
|
||||
return label
|
||||
return value
|
||||
}
|
||||
const compositeParam = (item, type) => {
|
||||
let tag = ''
|
||||
@@ -383,44 +395,15 @@ const handleSubmit = debounce(async (instance) => {
|
||||
otherFileList.value.forEach(item => {
|
||||
otherFiles.push(getFileParam(item))
|
||||
})
|
||||
// let params = {
|
||||
// "specialFund": "2",
|
||||
// "projectName": "测试全流程功能-上报",
|
||||
// "startTime": "2024-05-24 00:00:00",
|
||||
// "endTime": "2024-05-29 00:00:00",
|
||||
// "projectType": "3",
|
||||
// "investmentType": "3",
|
||||
// "businessSegment": "2",
|
||||
// "technicalStandard": "2",
|
||||
// "governmentDeclaration": 0,
|
||||
// "inventionPatent": "3",
|
||||
// "newPatent": "3",
|
||||
// "economicEstimate": "3",
|
||||
// "other": "3",
|
||||
// "copyright": "3",
|
||||
// "softwareCopyright": "3",
|
||||
// "industryUniversityResearch": 0,
|
||||
// "intellectualProperty": "00",
|
||||
// "resultForm": "3",
|
||||
// "projectImpact": "3",
|
||||
// "rdSubject": "3",
|
||||
// "serviceDescription": "3",
|
||||
// "contentDescription": "3",
|
||||
// "specialFundAmount": "3",
|
||||
// deploymentId: deploymentId.value,
|
||||
// "singleFile": singleFile,
|
||||
// "fileList": otherFiles,
|
||||
// "requirementId":route.query.id
|
||||
// }
|
||||
let params = {
|
||||
...formData.value,
|
||||
isSpecialFund: formData.value.isSpecialFund ? formData.value.isSpecialFund : false,
|
||||
// isSpecialFund: formData.value.isSpecialFund ? formData.value.isSpecialFund : false,
|
||||
deploymentId: deploymentId.value,
|
||||
fileList: otherFiles,
|
||||
singleFile: singleFile,
|
||||
requirementId: route.query.id ? route.query.id : '-1'
|
||||
}
|
||||
console.log('params', params)
|
||||
console.log('params', params, formData.value)
|
||||
if (JSON.stringify(singleFile) === "{}") {
|
||||
attachment.value.validate()
|
||||
ElNotification({
|
||||
@@ -432,18 +415,18 @@ const handleSubmit = debounce(async (instance) => {
|
||||
} else {
|
||||
attachment.value.clearValidate()
|
||||
}
|
||||
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 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(() => {
|
||||
@@ -469,12 +452,14 @@ const handleResubmit = debounce(() => {
|
||||
//todo requirementId
|
||||
let params = {
|
||||
...formData.value,
|
||||
isSpecialFund: formData.value.isSpecialFund ? formData.value.isSpecialFund : false,
|
||||
// isSpecialFund: formData.value.isSpecialFund ? formData.value.isSpecialFund : false,
|
||||
deploymentId: deploymentId.value,
|
||||
fileList: otherFiles,
|
||||
singleFile: singleFile,
|
||||
requirementId: route.query.id ? route.query.id : '-1'
|
||||
}
|
||||
|
||||
console.log('重新提交params', params, formData.value)
|
||||
if (JSON.stringify(singleFile) === "{}") {
|
||||
attachment.value.validate()
|
||||
ElNotification({
|
||||
@@ -486,7 +471,6 @@ const handleResubmit = debounce(() => {
|
||||
} else {
|
||||
attachment.value.clearValidate()
|
||||
}
|
||||
console.log('重新提交params', params)
|
||||
resubmitReported(params).then(res => {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
@@ -503,6 +487,7 @@ const handleResubmit = debounce(() => {
|
||||
})
|
||||
|
||||
const getDetailInfo = async () => {
|
||||
loading.value = true
|
||||
getDetail(route.query.projectId).then(res => {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
@@ -510,26 +495,22 @@ const getDetailInfo = async () => {
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
// if(res.data.formData.specialFund===null&&res.data.formData.isSpecialFund===null){
|
||||
// res.data.formData.isSpecialFund=false
|
||||
// }else if(res.data.formData.specialFund&&res.data.formData.isSpecialFund===null){
|
||||
// res.data.formData.isSpecialFund=true
|
||||
// }
|
||||
formData.value = res.data.formData
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
const init = async () => {
|
||||
loading.value = true
|
||||
const resFund = await getFundOption()
|
||||
specialFundOption.value = resFund.data
|
||||
await getIsFund()
|
||||
const res = await getSubCompOpt()
|
||||
companyOption.value = res.data
|
||||
getProcessInfo().then(res => {
|
||||
if (res.code === 1000) {
|
||||
let data = res.data
|
||||
deploymentId.value = data.deploymentId
|
||||
loading.value = false
|
||||
processStore.setDesign(data)
|
||||
processStore.runningList.value = data.runningList;
|
||||
processStore.endList.value = data.endList;
|
||||
@@ -539,6 +520,7 @@ const init = async () => {
|
||||
nextTick(() => {
|
||||
processDiagramViewer.value = true
|
||||
})
|
||||
getIsFund()
|
||||
} else {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
@@ -551,7 +533,6 @@ const init = async () => {
|
||||
onMounted(async () => {
|
||||
await init()
|
||||
if (route.query.projectId) {
|
||||
loading.value = true
|
||||
await getDetailInfo()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user