Merge pull request 'fix : 修复申请文件校验' (#262) from dj into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/262
This commit is contained in:
2024-06-01 12:34:25 +00:00
6 changed files with 264 additions and 176 deletions

View File

@@ -97,12 +97,12 @@
<!-- </el-input>--> <!-- </el-input>-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column prop="subtotal" label="小计"> <!-- <el-table-column prop="subtotal" label="小计">-->
<template #default="scope"> <!-- <template #default="scope">-->
<el-input v-model="scope.row.subtotal" placeholder="请输入小计" clearable> <!-- <el-input v-model="scope.row.subtotal" placeholder="请输入小计" clearable>-->
</el-input> <!-- </el-input>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column prop="oper" label="操作"> <el-table-column prop="oper" label="操作">
<template #default="scope"> <template #default="scope">
<el-button type="primary" @click="handleCopy(scope.row)" link style="font-size: 18px">复制</el-button> <el-button type="primary" @click="handleCopy(scope.row)" link style="font-size: 18px">复制</el-button>
@@ -147,7 +147,7 @@ const form = ref()
const nameOptions = ref([ const nameOptions = ref([
{ {
label: "某项目", label: "某项目",
value: '2' value: '42'
} }
]) ])
const researchOptions = ref([ const researchOptions = ref([
@@ -168,7 +168,7 @@ const tableData = ref([
annuity: '', annuity: '',
workday: '', workday: '',
researchDuration: '', researchDuration: '',
subtotal: '', // subtotal: '',
} }
]) ])
const handleAdd = () => { const handleAdd = () => {
@@ -183,7 +183,7 @@ const handleAdd = () => {
annuity: '', annuity: '',
workday: '', workday: '',
researchDuration: '', researchDuration: '',
subtotal: '', // subtotal: '',
} }
tableData.value.push(row) tableData.value.push(row)
} }
@@ -199,7 +199,8 @@ const handleSubmit = (instance) => {
if (!valid) return if (!valid) return
let params = { let params = {
...formData.value, ...formData.value,
usrAllocations: tableData.value usrAllocations: tableData.value,
deploymentId: processInstanceData.value.deploymentId,
} }
const {code, msg} = await addAllocation(params) const {code, msg} = await addAllocation(params)
ElNotification({ ElNotification({

View File

@@ -8,7 +8,7 @@
</template> </template>
<script setup lang="jsx"> <script setup lang="jsx">
import fvSelect from '@/fvcomponents/fvSelect/index.vue' // import fvSelect from '@/fvcomponents/fvSelect/index.vue'
const router = useRouter(); const router = useRouter();
const searchConfig = reactive([ const searchConfig = reactive([
@@ -42,16 +42,17 @@ const searchConfig = reactive([
valueFormat: 'YYYY-MM-DD', valueFormat: 'YYYY-MM-DD',
}, },
colProps: {} colProps: {}
}, {
label: '状态',
prop: 'state',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择状态',
clearable: true,
cacheKey: 'special_fund'
}
}, },
// {
// label: '状态',
// prop: 'state',
// component: shallowRef(fvSelect),
// props: {
// placeholder: '请选择状态',
// clearable: true,
// cacheKey: 'special_fund'
// }
// },
]) ])
const tableIns = ref() const tableIns = ref()
const tableConfig = reactive({ const tableConfig = reactive({
@@ -76,7 +77,7 @@ const tableConfig = reactive({
label: '状态', label: '状态',
align: 'center', align: 'center',
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({row, index}) => (<Tag dictType={'special_fund'} value={row.state}/>) // currentRender: ({row, index}) => (<Tag dictType={'special_fund'} value={row.state}/>)
}, },
{ {
prop: 'oper', prop: 'oper',
@@ -89,25 +90,25 @@ const tableConfig = reactive({
if(row.buttons){ if(row.buttons){
buttons = new Set(Array.from(row.buttons)) buttons = new Set(Array.from(row.buttons))
} }
if (buttons.has("details")) { // if (buttons.has("details")) {
btn.push({label: '详情', prem: ['mosr:requirement:info'], func: () => handleDetail(row), type: 'primary'}) btn.push({label: '详情', prem: ['mosr:requirement:info'], func: () => handleDetail(row), type: 'primary'})
} // }
if (buttons.has("edit")) { // if (buttons.has("edit")) {
btn.push({label: '编辑', prem: ['mosr:requirement:resubmit'], func: () => handleEdit(row), type: 'primary'}) btn.push({label: '编辑', prem: ['mosr:requirement:resubmit'], func: () => handleEdit(row), type: 'primary'})
} // }
if (buttons.has("report")) { // if (buttons.has("report")) {
btn.push({label: '明细导出', prem: ['mosr:requirement:info'], func: () => handleReport(row), type: 'primary'}) btn.push({label: '明细导出', prem: ['mosr:requirement:info'], func: () => handleReport(row), type: 'primary'})
} // }
if (buttons.has("report")) { // if (buttons.has("report")) {
btn.push({label: '汇总导出', prem: ['mosr:requirement:info'], func: () => handleReport(row), type: 'primary'}) btn.push({label: '汇总导出', prem: ['mosr:requirement:info'], func: () => handleReport(row), type: 'primary'})
} // }
return ( return (
<div style={{width: '100%'}}> <div style={{width: '100%'}}>
{ {
btn.map(item => ( btn.map(item => (
<el-button <el-button
type={item.type} type={item.type}
v-perm={item.prem} // v-perm={item.prem}
onClick={() => item.func()} onClick={() => item.func()}
link link
> >
@@ -116,11 +117,11 @@ const tableConfig = reactive({
)) ))
} }
{ {
buttons.has("delete") ? // buttons.has("delete") ?
<popover-delete name={row.requirementName} type={'费用分摊'} btnType={'danger'} <popover-delete name={row.requirementName} type={'费用分摊'} btnType={'danger'}
perm={['mosr:requirement:del']} perm={['mosr:requirement:del']}
onDelete={() => handleDelete(row)}/> onDelete={() => handleDelete(row)}/>
: '' // : ''
} }
</div> </div>
) )
@@ -148,7 +149,7 @@ const handleDetail = (row) => {
router.push({ router.push({
name: 'Share/detail', name: 'Share/detail',
query: { query: {
id:row.id id:row.allocationId
} }
}) })
} }

View File

@@ -8,14 +8,14 @@
<el-input v-model="formData.projectName" placeholder="请输入项目名称" clearable></el-input> <el-input v-model="formData.projectName" placeholder="请输入项目名称" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <!-- <el-col :span="5">-->
<el-form-item label="是否专项资金" prop="isSpecialFund"> <!-- <el-form-item label="是否专项资金" prop="isSpecialFund">-->
<el-radio-group v-model="formData.isSpecialFund" > <!-- <el-radio-group v-model="formData.isSpecialFund" >-->
<el-radio :label="true"></el-radio> <!-- <el-radio :label="true"></el-radio>-->
<el-radio :label="false"></el-radio> <!-- <el-radio :label="false"></el-radio>-->
</el-radio-group> <!-- </el-radio-group>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
<el-col :span="6"> <el-col :span="6">
<el-form-item label="专项资金" prop="specialFund" v-if="formData.isSpecialFund"> <el-form-item label="专项资金" prop="specialFund" v-if="formData.isSpecialFund">
<el-select v-model="formData.specialFund" placeholder="请选择专项资金" clearable filterable> <el-select v-model="formData.specialFund" placeholder="请选择专项资金" clearable filterable>
@@ -54,12 +54,6 @@
</el-config-provider> </el-config-provider>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-form-item label="所属公司" prop="affiliatedCompanyId">-->
<!-- <el-tree-select v-model="formData.affiliatedCompanyId" :data="companyOption" style="width: 100%;"-->
<!-- filterable clearable :check-strictly="true"/>-->
<!-- </el-form-item>-->
<!-- </el-col> <el-col :span="12">-->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="项目类型" prop="projectType"> <el-form-item label="项目类型" prop="projectType">
<el-select v-model="formData.projectType" placeholder="请选择项目类型" clearable filterable> <el-select v-model="formData.projectType" placeholder="请选择项目类型" clearable filterable>
@@ -271,7 +265,6 @@ const companyOption = ref([])
const summaryForm = ref() const summaryForm = ref()
const deploymentId = ref() const deploymentId = ref()
const specialFundOption = ref([]) const specialFundOption = ref([])
const isSpecialFund = ref()
const showTable = ref(true) const showTable = ref(true)
const otherFileList = ref([]) const otherFileList = ref([])
const file = ref({}) const file = ref({})
@@ -284,7 +277,6 @@ const rules = reactive({
specialFund: [{required: true, message: '请选择专项资金', trigger: 'blur'}], specialFund: [{required: true, message: '请选择专项资金', trigger: 'blur'}],
startTime: [{required: true, message: '请选择开始时间', trigger: 'blur'}], startTime: [{required: true, message: '请选择开始时间', trigger: 'blur'}],
rdSubject: [{required: true, message: '请输入研发主体', trigger: 'blur'}], rdSubject: [{required: true, message: '请输入研发主体', trigger: 'blur'}],
// affiliatedCompanyId: [{required: true, message: '请输入所属公司', trigger: 'blur'}],
projectType: [{required: true, message: '请选择项目类型', trigger: 'blur'}], projectType: [{required: true, message: '请选择项目类型', trigger: 'blur'}],
endTime: [{required: true, message: '请选择结束时间', trigger: 'blur'}], endTime: [{required: true, message: '请选择结束时间', trigger: 'blur'}],
investmentType: [{required: true, message: '请选择出资类型', trigger: 'blur'}], investmentType: [{required: true, message: '请选择出资类型', trigger: 'blur'}],
@@ -305,16 +297,16 @@ const rules = reactive({
serviceDescription: [{required: true, message: '请输入现有业务描述', trigger: 'blur'}], serviceDescription: [{required: true, message: '请输入现有业务描述', trigger: 'blur'}],
contentDescription: [{required: true, message: '请输入研发项目关键内容描述', trigger: 'blur'}] contentDescription: [{required: true, message: '请输入研发项目关键内容描述', trigger: 'blur'}]
}) })
const getIsFund = async () => { // const getIsFund = async () => {
getFormInfo(route.query.id).then(res => { // getFormInfo(route.query.id).then(res => {
if (res.code === 1000) { // if (res.code === 1000) {
formData.value.isSpecialFund = res.data.isSpecialFund // formData.value.isSpecialFund = res.data.isSpecialFund
if(res.data.isSpecialFund){ // if(res.data.isSpecialFund){
formData.value.specialFund = Number(res.data.specialFund) // formData.value.specialFund = Number(res.data.specialFund)
} // }
} // }
}) // })
} // }
const compositeParam = (item, type) => { const compositeParam = (item, type) => {
let tag = '' let tag = ''
if (name.value === 'Summary/add' || name.value === 'Summary/edit') { if (name.value === 'Summary/add' || name.value === 'Summary/edit') {
@@ -351,74 +343,85 @@ const getFileParam = (item) => {
} }
} }
const handleSubmit = debounce(async (instance) => { const handleSubmit = debounce(async (instance) => {
console.log('formData.value',formData.value)
if (!instance) return if (!instance) return
instance.validate(async (valid, fields) => { instance.validate(async (valid, fields) => {
if (JSON.stringify(file.value) === "{}") {
attachment.value.validate()
} else {
attachment.value.clearValidate()
}
if (!valid) return if (!valid) return
let singleFile = {} // if (JSON.stringify(file.value) === "{}") {
if (file.value.fileId !== undefined) { // attachment.value.validate()
singleFile = { // } else {
fileId: file.value.fileId // attachment.value.clearValidate()
// }
let singleFile = {}
if (file.value.fileId !== undefined) {
singleFile = {
fileId: file.value.fileId
}
} }
} let otherFiles = []
let otherFiles = [] otherFileList.value.forEach(item => {
otherFileList.value.forEach(item => { otherFiles.push(getFileParam(item))
otherFiles.push(getFileParam(item))
})
// let params = {
// "specialFund": "2",
// "projectName": "重新提交全流程测试2024520",
// "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",
// // "affiliatedCompanyId": formData.value.affiliatedCompanyId,
// "serviceDescription": "3",
// "contentDescription": "3",
// "specialFundAmount": "3",
// deploymentId: deploymentId.value,
// "singleFile": singleFile,
// "fileList": otherFiles,
// "requirementId":route.query.id
// }
let params = {
...formData.value,
deploymentId: deploymentId.value,
fileList: otherFiles,
singleFile: singleFile,
requirementId: route.query.id
}
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 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,
deploymentId: deploymentId.value,
fileList: otherFiles,
singleFile: singleFile,
requirementId: route.query.id
}
if (JSON.stringify(singleFile) === "{}") {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
}else {
attachment.value.clearValidate()
}
console.log('params', params)
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(() => { const handleResubmit = debounce(() => {
@@ -426,12 +429,12 @@ const handleResubmit = debounce(() => {
let otherFiles = [] let otherFiles = []
let fileArray let fileArray
if (name.value === 'Summary/edit') { if (name.value === 'Summary/edit') {
console.log('attachment.value', attachment.value.singleFile) // console.log('attachment.value', attachment.value.singleFile)
if (attachment.value.singleFile === null) { // if (attachment.value.singleFile === null) {
attachment.value.validate() // attachment.value.validate()
} else { // } else {
attachment.value.clearValidate() // attachment.value.clearValidate()
} // }
singleFile = { singleFile = {
fileId: attachment.value.singleFile?.fileId fileId: attachment.value.singleFile?.fileId
} }
@@ -455,6 +458,17 @@ const handleResubmit = debounce(() => {
singleFile: singleFile, singleFile: singleFile,
requirementId: route.query.id requirementId: route.query.id
} }
if (JSON.stringify(singleFile) === "{}") {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
}else {
attachment.value.clearValidate()
}
console.log('重新提交params', params) console.log('重新提交params', params)
resubmitReported(params).then(res => { resubmitReported(params).then(res => {
ElNotification({ ElNotification({
@@ -470,6 +484,7 @@ const handleResubmit = debounce(() => {
} }
}) })
}) })
const getDetailInfo = async () => { const getDetailInfo = async () => {
getDetail(route.query.projectId).then(res => { getDetail(route.query.projectId).then(res => {
ElNotification({ ElNotification({
@@ -486,15 +501,10 @@ const getDetailInfo = async () => {
const init = async () => { const init = async () => {
const resFund = await getFundOption() const resFund = await getFundOption()
specialFundOption.value = resFund.data specialFundOption.value = resFund.data
await getIsFund() // await getIsFund()
const res = await getSubCompOpt() const res = await getSubCompOpt()
companyOption.value = res.data companyOption.value = res.data
getProcessInfo().then(res => { getProcessInfo().then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) { if (res.code === 1000) {
let data = res.data let data = res.data
deploymentId.value = data.deploymentId deploymentId.value = data.deploymentId
@@ -507,6 +517,12 @@ const init = async () => {
nextTick(() => { nextTick(() => {
processDiagramViewer.value = true processDiagramViewer.value = true
}) })
} else {
ElNotification({
title: '提示',
message: res.msg,
type: 'error'
})
} }
}) })
} }

View File

@@ -128,12 +128,12 @@ const getFileParam = (item) => {
} }
} }
const handleSubmit = async () => { const handleSubmit = async () => {
if (JSON.stringify(file.value) === "{}") { // if (JSON.stringify(file.value) === "{}") {
attachment.value.validate() // attachment.value.validate()
return; // return;
} else { // } else {
attachment.value.clearValidate() // attachment.value.clearValidate()
} // }
let files = [] let files = []
let singleFile = {} let singleFile = {}
if (file.value.fileId !== undefined) { if (file.value.fileId !== undefined) {
@@ -151,6 +151,17 @@ const handleSubmit = async () => {
singleFile: singleFile, singleFile: singleFile,
projectId: route.query.projectId, projectId: route.query.projectId,
} }
if (JSON.stringify(singleFile) === "{}") {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
}else {
attachment.value.clearValidate()
}
console.log('params', params) console.log('params', params)
let res = await projectConclusion(params) let res = await projectConclusion(params)
ElNotification({ ElNotification({
@@ -169,12 +180,12 @@ const handleResubmit = () => {
let singleFile = {} let singleFile = {}
let otherFiles = [] let otherFiles = []
let fileArray let fileArray
if (JSON.stringify(file.value) === "{}" || attachment.value.singleFile === null) { // if (JSON.stringify(file.value) === "{}" || attachment.value.singleFile === null) {
attachment.value.validate() // attachment.value.validate()
return; // return;
} else { // } else {
attachment.value.clearValidate() // attachment.value.clearValidate()
} // }
if (attachment.value.singleFile !== null && name.value === 'Filing/edit') { if (attachment.value.singleFile !== null && name.value === 'Filing/edit') {
singleFile = { singleFile = {
fileId: attachment.value.singleFile.fileId fileId: attachment.value.singleFile.fileId
@@ -199,6 +210,17 @@ const handleResubmit = () => {
singleFile: singleFile, singleFile: singleFile,
projectId: route.query.projectId, projectId: route.query.projectId,
} }
if (JSON.stringify(singleFile) === "{}") {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
}else {
attachment.value.clearValidate()
}
console.log('重新提交params', params) console.log('重新提交params', params)
resubmitConclusion(params).then(res => { resubmitConclusion(params).then(res => {
ElNotification({ ElNotification({
@@ -229,11 +251,6 @@ const getDetailInfo = async () => {
} }
const init = () => { const init = () => {
getProjectConclusionProcess().then(res => { getProjectConclusionProcess().then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
processDiagramViewer.value = false processDiagramViewer.value = false
if (res.code === 1000) { if (res.code === 1000) {
let data = res.data let data = res.data
@@ -248,6 +265,12 @@ const init = () => {
nextTick(() => { nextTick(() => {
processDiagramViewer.value = true processDiagramViewer.value = true
}) })
}else {
ElNotification({
title: '提示',
message: res.msg,
type: 'error'
})
} }
}) })
} }

View File

@@ -116,6 +116,17 @@ const handleSubmit = (instance) => {
singleFile: singleFile, singleFile: singleFile,
projectId:route.query.projectId, projectId:route.query.projectId,
} }
if (JSON.stringify(singleFile) === "{}") {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
}else {
attachment.value.clearValidate()
}
console.log('params-提交',params) console.log('params-提交',params)
let res = await projectCheck(params) let res = await projectCheck(params)
ElNotification({ ElNotification({
@@ -138,12 +149,12 @@ const handleResubmit = (instance) => {
let singleFile = {} let singleFile = {}
let otherFiles = [] let otherFiles = []
let fileArray let fileArray
if (JSON.stringify(file.value) === "{}"||attachment.value.singleFile===null) { // if (JSON.stringify(file.value) === "{}"||attachment.value.singleFile===null) {
attachment.value.validate() // attachment.value.validate()
return; // return;
} else { // } else {
attachment.value.clearValidate() // attachment.value.clearValidate()
} // }
if (attachment.value.singleFile!==null&&name.value === 'Implementation/edit') { if (attachment.value.singleFile!==null&&name.value === 'Implementation/edit') {
singleFile = { singleFile = {
fileId: attachment.value.singleFile.fileId fileId: attachment.value.singleFile.fileId
@@ -168,6 +179,17 @@ const handleResubmit = (instance) => {
singleFile: singleFile, singleFile: singleFile,
projectId: route.query.projectId, projectId: route.query.projectId,
} }
if (JSON.stringify(singleFile) === "{}") {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
}else {
attachment.value.clearValidate()
}
console.log('重新提交params', params) console.log('重新提交params', params)
resubmitCheck(params).then(res => { resubmitCheck(params).then(res => {
ElNotification({ ElNotification({
@@ -199,11 +221,6 @@ const getDetailInfo = async () => {
} }
const init = () => { const init = () => {
getProjectCheckProcess(route.query.projectId).then(res => { getProjectCheckProcess(route.query.projectId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
processDiagramViewer.value = false processDiagramViewer.value = false
if (res.code === 1000) { if (res.code === 1000) {
let data = res.data let data = res.data
@@ -218,6 +235,12 @@ const init = () => {
nextTick(() => { nextTick(() => {
processDiagramViewer.value = true processDiagramViewer.value = true
}) })
}else {
ElNotification({
title: '提示',
message: res.msg,
type: 'error'
})
} }
}) })
} }

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="apply-block"> <div class="apply-block">
<el-form :model="formData" ref="applyForm" label-width="auto" :rules="rules"> <el-form :model="formData" ref="applyForm" label-width="auto" :rules="rules">
<baseTitle title="项目立项申请"></baseTitle> <baseTitle title="项目立项"></baseTitle>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="前置流程"> <el-form-item label="前置流程">
@@ -93,7 +93,7 @@ const name = ref(router.currentRoute.value.name)
const compositeParam = (item) => { const compositeParam = (item) => {
let tag = '' let tag = ''
if (name.value === 'Initiation/apply' || name.value === 'Initiation/edit') { if (name.value === 'Initiation/apply' || name.value === 'Initiation/edit') {
tag = '项目立项申请' tag = '项目立项'
} }
return { return {
fileId: item.id, fileId: item.id,
@@ -130,7 +130,7 @@ const handleSubmit = (instance) => {
attachment.value.validate() attachment.value.validate()
ElNotification({ ElNotification({
title: '提示', title: '提示',
message: '请上传申请书附件', message: '请上传附件',
type: 'error' type: 'error'
}) })
return; return;
@@ -148,6 +148,17 @@ const handleSubmit = (instance) => {
otherFileList.value.forEach(item => { otherFileList.value.forEach(item => {
files.push(getFileParam(item)) files.push(getFileParam(item))
}) })
if (JSON.stringify(singleFile) === "{}") {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
}else {
attachment.value.clearValidate()
}
let params = { let params = {
deploymentId: deploymentId.value, deploymentId: deploymentId.value,
requirementId: route.query.id, requirementId: route.query.id,
@@ -155,6 +166,7 @@ const handleSubmit = (instance) => {
singleFile: singleFile, singleFile: singleFile,
projectId: route.query.projectId, projectId: route.query.projectId,
} }
console.log('params', params) console.log('params', params)
let res = await projectApply(params) let res = await projectApply(params)
ElNotification({ ElNotification({
@@ -174,12 +186,12 @@ const handleResubmit = async () => {
let files = [] let files = []
let singleFile = {} let singleFile = {}
let fileArray let fileArray
if (JSON.stringify(file.value) === "{}" || attachment.value.singleFile === null) { // if (JSON.stringify(file.value) === "{}" || attachment.value.singleFile === null) {
attachment.value.validate() // attachment.value.validate()
return; // return;
} else { // } else {
attachment.value.clearValidate() // attachment.value.clearValidate()
} // }
if (attachment.value.singleFile !== null && name.value === 'Initiation/edit') { if (attachment.value.singleFile !== null && name.value === 'Initiation/edit') {
singleFile = { singleFile = {
fileId: attachment.value.singleFile.fileId fileId: attachment.value.singleFile.fileId
@@ -203,6 +215,17 @@ const handleResubmit = async () => {
singleFile: singleFile, singleFile: singleFile,
projectId: route.query.projectId, projectId: route.query.projectId,
} }
if (JSON.stringify(singleFile) === "{}") {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
}else {
attachment.value.clearValidate()
}
console.log('params', params) console.log('params', params)
let res = await resubmitApply(params) let res = await resubmitApply(params)
ElNotification({ ElNotification({
@@ -232,11 +255,6 @@ const getDetailInfo = async () => {
} }
const init = () => { const init = () => {
getApplyProcess(route.query.projectId).then(res => { getApplyProcess(route.query.projectId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
processDiagramViewer.value = false processDiagramViewer.value = false
if (res.code === 1000) { if (res.code === 1000) {
let data = res.data let data = res.data
@@ -251,6 +269,12 @@ const init = () => {
nextTick(() => { nextTick(() => {
processDiagramViewer.value = true processDiagramViewer.value = true
}) })
}else {
ElNotification({
title: '提示',
message: res.msg,
type: 'error'
})
} }
}) })
} }