fix : 重新提交全流程初步完成

This commit is contained in:
2024-05-20 23:01:53 +08:00
parent 6c80652416
commit 3270aeef06
12 changed files with 280 additions and 189 deletions

View File

@@ -28,7 +28,7 @@
import {useTagsView} from '@/stores/tagsview.js'
import {ElMessage, ElNotification} from "element-plus";
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import {getProcessInfo, projectApply} from "@/api/project-manage";
import {getApplyProcess, projectApply,resubmitApply,getApplyDetail} from "@/api/project-manage";
import {useProcessStore} from '@/stores/processStore.js';
const tagsViewStore = useTagsView()
@@ -124,11 +124,11 @@ const getFileParam = (item) => {
const handleSubmit = (instance) => {
if (!instance) return
instance.validate(async (valid) => {
// if(JSON.stringify(file.value) == "{}"){
// applyForm.value.validate()
// }else {
// applyForm.value.clearValidate()
// }
if(JSON.stringify(file.value) === "{}"){
attachment.value.validate()
}else {
attachment.value.clearValidate()
}
if (!valid) return
let files = []
let singleFile={}
@@ -143,7 +143,7 @@ const handleSubmit = (instance) => {
let params = {
deploymentId: deploymentId.value,
requirementId: route.query.id,
files: files,
fileList: files,
singleFile: singleFile,
projectId:route.query.projectId,
}
@@ -166,7 +166,12 @@ const handleResubmit =async () => {
let files = []
let singleFile={}
let fileArray
if(name.value === 'Initiation/edit'){
if (JSON.stringify(file.value) === "{}"||attachment.value.singleFile===null) {
attachment.value.validate()
} else {
attachment.value.clearValidate()
}
if(attachment.value.singleFile!==null&&name.value === 'Initiation/edit'){
singleFile = {
fileId: attachment.value.singleFile.fileId
}
@@ -185,39 +190,39 @@ const handleResubmit =async () => {
let params = {
deploymentId: deploymentId.value,
requirementId: route.query.id,
files: files,
fileList: files,
singleFile: singleFile,
projectId:route.query.projectId,
}
console.log('params',params)
// let res = await resubmit(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: 'Initiation'
// })
// }
let res = await resubmitApply(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: 'Initiation'
})
}
}
const getDetailInfo = async () => {
// getDetail(route.query.projectId).then(res => {
// ElNotification({
// title: '提示',
// message: res.msg,
// type: res.code === 1000 ? 'success' : 'error'
// })
// if (res.code === 1000) {
// formData.value = res.data.formData
// loading.value=false
// }
// })
getApplyDetail(route.query.projectId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
formData.value = res.data.formData
loading.value=false
}
})
}
const init = () => {
getProcessInfo().then(res => {
getApplyProcess().then(res => {
processDiagramViewer.value = false
if (res.code === 1000) {
let data = res.data
@@ -237,12 +242,11 @@ const init = () => {
}
init()
onMounted(async () => {
loading.value=true
await init()
if (route.query.projectId) {
if (name.value === 'Initiation/edit') {
loading.value=true
await getDetailInfo()
}
})
</script>