fix : 修复项目立项校验

This commit is contained in:
2024-07-18 11:45:30 +08:00
parent 0c3580768b
commit 60d9b958bc
5 changed files with 66 additions and 25 deletions

View File

@@ -5,7 +5,7 @@
<el-form-item :label="label" prop="attachment" label-width="125"> <el-form-item :label="label" prop="attachment" label-width="125">
<template v-if="preview&&JSON.stringify(singleFile) !== '{}'&&JSON.stringify(singleFile)!=='null'"> <template v-if="preview&&JSON.stringify(singleFile) !== '{}'&&JSON.stringify(singleFile)!=='null'">
<el-button type="primary" link @click="handleDownload(singleFile)" style="font-size: 16px"> <el-button type="primary" link @click="handleDownload(singleFile)" style="font-size: 16px">
{{ singleFile ? singleFile?.originalFileName : formData.singleFile?.originalFileName?formData.singleFile?.originalFileName:_singleFileValue[0]?.originalFileName }} {{ singleFile ? singleFile?.originalFileName : formData.singleFile?.originalFileName }}
</el-button> </el-button>
<el-button type="danger" link @click="deleteSingleFile(singleFile?singleFile:formData.singleFile,1)">删除 <el-button type="danger" link @click="deleteSingleFile(singleFile?singleFile:formData.singleFile,1)">删除
</el-button> </el-button>

View File

@@ -31,7 +31,7 @@
<el-form :model="localFormData" ref="formRef" label-width="auto" v-if="step!=='50'"> <el-form :model="localFormData" ref="formRef" label-width="auto" v-if="step!=='50'">
<el-row> <el-row>
<el-col :span="24" v-if="title==='apply'"> <el-col :span="24" v-if="title==='apply'">
<el-form-item label="项目负责人" :required="true" prop="projectChargePerson" <el-form-item label="项目负责人" :required="true" prop=""
label-width="125"> label-width="125">
<el-button style="margin-right: 10px" color="#DED0B2" @click="handleShowProjectChargePersonTable"> <el-button style="margin-right: 10px" color="#DED0B2" @click="handleShowProjectChargePersonTable">
<!-- {{ localFormData.projectChargePerson ? '更改' : '请选择' }}--> <!-- {{ localFormData.projectChargePerson ? '更改' : '请选择' }}-->
@@ -45,7 +45,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" v-if="title==='apply'"> <el-col :span="24" v-if="title==='apply'">
<el-form-item label="项目成员" :required="true" prop="projectPerson" <el-form-item label="项目成员" :required="true" prop=""
label-width="125"> label-width="125">
<el-button color="#DED0B2" style="margin-right: 10px" @click="handleShowProjectPersonTable"> <el-button color="#DED0B2" style="margin-right: 10px" @click="handleShowProjectPersonTable">
<!-- {{ localFormData.projectPersonIds ? '更改' : '请选择' }}--> <!-- {{ localFormData.projectPersonIds ? '更改' : '请选择' }}-->
@@ -59,7 +59,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="前置流程" :required="preProcessRequired" prop="preProcess" label-width="125"> <!-- :required="preProcessRequired"-->
<el-form-item label="前置流程" prop="preProcess" label-width="125">
<el-button color="#DED0B2" @click="handleShowPreTable" style="margin-right: 10px"> <el-button color="#DED0B2" @click="handleShowPreTable" style="margin-right: 10px">
{{ localFormData.preProcess&&localFormData.preProcess.length>0 ? '更改' :sessionParams.preProcess&&sessionParams.preProcess.length>0 ? '更改' : '请选择' }} {{ localFormData.preProcess&&localFormData.preProcess.length>0 ? '更改' :sessionParams.preProcess&&sessionParams.preProcess.length>0 ? '更改' : '请选择' }}
</el-button> </el-button>
@@ -77,7 +78,7 @@
v-model:otherFileList="otherFileList" :tag="getTitleName(props.title)" v-model:otherFileList="otherFileList" :tag="getTitleName(props.title)"
@getAttachment="getAttachment" v-model:singleList="singleList" :showSingleTable="showSingleTable" @getAttachment="getAttachment" v-model:singleList="singleList" :showSingleTable="showSingleTable"
@getOtherFile="getOtherFile" :showFileList="true" :formData="localFormData" @getOtherFile="getOtherFile" :showFileList="true" :formData="localFormData"
:preview="mode == 'resubmit'||mode == 'submit'"/> :preview="mode == 'resubmit'"/>
<div> <div>
<div class="approval-record"> <div class="approval-record">
<div class="approval-title"> <div class="approval-title">
@@ -260,11 +261,11 @@ const pageInfo = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
}) })
const rules = reactive({ // const rules = reactive({
preProcess: [{required: true, message: '请选择前置流程', trigger: 'blur'}], // preProcess: [{required: true, message: '请选择前置流程', trigger: 'blur'}],
projectChargePerson: [{required: true, message: '请选择项目负责人', trigger: 'blur'}], // projectChargePerson: [{required: true, message: '请选择项目负责人', trigger: 'blur'}],
projectPerson: [{required: true, message: '请选择项目成员', trigger: 'blur'}], // projectPerson: [{required: true, message: '请选择项目成员', trigger: 'blur'}],
}) // })
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
const processStore = useProcessStore() const processStore = useProcessStore()
const localProjectPerson = ref([]) const localProjectPerson = ref([])
@@ -303,27 +304,22 @@ if(localStorage.getItem('singleFile')){
localFormData.value.singleFile=param localFormData.value.singleFile=param
singleList.value=[param] singleList.value=[param]
localStorage.setItem('singleFile', JSON.stringify(param)) localStorage.setItem('singleFile', JSON.stringify(param))
showSingleTable.value=false
nextTick(()=>{
showSingleTable.value=true
})
} }
if(localStorage.getItem('otherFileList')){ if(localStorage.getItem('otherFileList')){
let param=JSON.parse(localStorage.getItem('otherFileList')) let param=JSON.parse(localStorage.getItem('otherFileList'))
localFormData.value.otherFileList=param localFormData.value.otherFileList=param
otherFileList.value=param otherFileList.value=param
localStorage.setItem('otherFileList', JSON.stringify(param)) localStorage.setItem('otherFileList', JSON.stringify(param))
showTable.value=false
nextTick(()=>{
showTable.value=true
})
} }
// if(localStorage.getItem('sessionParams')){
// let param=JSON.parse(localStorage.getItem('sessionParams'))
// if(param.otherFileList){
// localFormData.value.otherFileList = param.otherFileList
// // localStorage.setItem('sessionParams', JSON.stringify(localFormData.value))
// otherFileList.value=param.otherFileList
// // showTable.value=false
// // nextTick(()=>{
// // showTable.value=true
// // })
// }
//
// localStorage.setItem('sessionParams', JSON.stringify(localFormData.value))
// }
if(localStorage.getItem('projectChargePersonUserList')){ if(localStorage.getItem('projectChargePersonUserList')){
let param=JSON.parse(localStorage.getItem('projectChargePersonUserList')) let param=JSON.parse(localStorage.getItem('projectChargePersonUserList'))
projectChargePersonUserList.value=param projectChargePersonUserList.value=param
@@ -538,7 +534,19 @@ const getAttachment = (val) => {
singleList.value.push(compositeParam(val)) singleList.value.push(compositeParam(val))
nextTick(() => { nextTick(() => {
showSingleTable.value = true showSingleTable.value = true
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
}) })
localStorage.setItem('singleFile', JSON.stringify(compositeParam(val))) localStorage.setItem('singleFile', JSON.stringify(compositeParam(val)))
} }
watch(() => singleList.value, (newVal) => { watch(() => singleList.value, (newVal) => {

View File

@@ -383,6 +383,17 @@ const getAttachment = (val) => {
singleList.value.push(compositeParam(val)) singleList.value.push(compositeParam(val))
nextTick(() => { nextTick(() => {
showSingleTable.value = true showSingleTable.value = true
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
}) })
} }
const getOtherFile = (val) => { const getOtherFile = (val) => {

View File

@@ -123,6 +123,17 @@ const getAttachment = (val) => {
singleList.value.push( compositeParam(val)) singleList.value.push( compositeParam(val))
nextTick(() => { nextTick(() => {
showSingleTable.value = true showSingleTable.value = true
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
}) })
} }
watch(() => singleList.value, (newVal) => { watch(() => singleList.value, (newVal) => {

View File

@@ -3,7 +3,7 @@
<el-form :model="localFormData" ref="formRef" label-width="auto" :rules="rules" v-if="step!=='50'"> <el-form :model="localFormData" ref="formRef" label-width="auto" :rules="rules" v-if="step!=='50'">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="前置流程" :required="preProcessRequired" prop="requestName"> <el-form-item label="前置流程" prop="requestName">
<div v-for="item in localFormData.preProcess" :key="item.requestId"> <div v-for="item in localFormData.preProcess" :key="item.requestId">
<a :href="item.baseUrl" target="_blank" <a :href="item.baseUrl" target="_blank"
style="color: #2a99ff;margin-right: 10px;cursor: pointer">{{ item.requestName }}</a> style="color: #2a99ff;margin-right: 10px;cursor: pointer">{{ item.requestName }}</a>
@@ -270,6 +270,17 @@ const compositeParam = (item) => {
const getAttachment = (val) => { const getAttachment = (val) => {
// console.log('上传文件getAttachment', val) // console.log('上传文件getAttachment', val)
localFormData.value.singleFile = compositeParam(val) localFormData.value.singleFile = compositeParam(val)
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
} }
const getOtherFile = (val) => { const getOtherFile = (val) => {
// console.log('上传文件getOtherFile', val) // console.log('上传文件getOtherFile', val)