feat : 重新提交

This commit is contained in:
clay
2024-05-12 20:27:38 +08:00
parent d0e517e7d9
commit bd220ad5b1
3 changed files with 76 additions and 33 deletions

View File

@@ -19,6 +19,12 @@ export const getInfo = (requirementId) => {
method: "get"
});
};
export const getFormInfo = (requirementId) => {
return request({
url: `/workflow/mosr/requirement/form/${requirementId}`,
method: "get"
});
};
export const agreeTask = (data) => {
return request({
url: `/workflow/mosr/process/task/agree`,
@@ -41,6 +47,13 @@ export const addRequirement = (data) => {
data: data
});
};
export const resubmit = (data) => {
return request({
url: '/workflow/mosr/requirement/resubmit',
method: "post",
data: data
});
};
export const deleteFile = (fileId) => {
return request({
url: `/workflow/process/file/delete/${fileId}`,

View File

@@ -69,6 +69,7 @@
</div>
<div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit">提交</el-button>
<el-button color="#DED0B2" @click="handleResubmit">重新提交</el-button>
<el-button @click="handleBack">返回</el-button>
</div>
</div>
@@ -77,7 +78,7 @@
<script setup lang="jsx">
import {useAuthStore} from '@/stores/userstore.js'
import {useProcessStore} from '@/stores/processStore.js';
import {getWorkflowInfo, addRequirement, getInfo} from "@/api/project-demand/index.js";
import {getWorkflowInfo, addRequirement, getFormInfo,resubmit} from "@/api/project-demand/index.js";
import FileUpload from "@/components/FileUpload.vue";
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import {ElMessage} from "element-plus";
@@ -150,6 +151,8 @@ const getFile = (val) => {
})
fileList.value=newFileArray
}
const init = async () => {
getWorkflowInfo().then(res => {
let data = res.data
@@ -183,11 +186,28 @@ const handleSubmit = () => {
}
})
}
const getDetailInfo = async () => {
getInfo(route.query.id).then(res => {
const handleResubmit = () => {
resubmit({
...formData.value,
files: fileList.value,
deploymentId: processInstanceData.value.deploymentId
}).then(res => {
if (res.code === 1000) {
ElMessage.success(res.msg)
formData.value = res.data.formData
router.push({
path: '/projectdemand/demandcollection'
})
} else {
ElMessage.error(res.msg)
}
})
}
const getDetailInfo = async () => {
getFormInfo(route.query.id).then(res => {
if (res.code === 1000) {
console.log(res)
ElMessage.success(res.msg)
formData.value = res.data
if(route.query.isAdd==undefined){
showTable.value=true
}

View File

@@ -23,31 +23,40 @@
<el-tooltip effect="dark" :content="user.name" placement="bottom-start">
<span class="username">{{ user.name }}</span>
</el-tooltip>
<template v-if="user.auditOpinion">
<div style="margin-top: 10px;background:#f5f5f5;padding: 10px;">
<div>
{{ user.auditOpinion }}
</div>
</div>
</template>
</div>
<div style="margin-left: 10px;">
<div style="color: #c0bebe">{{ operation.operationName }}</div>
<div style="font-size: 14px; font-weight: bold;">{{ operation.remark }}</div>
</div>
</div>
<template v-if="operation.comment">
<div style="margin-top: 10px;background:#f5f5f5;padding: 10px;">
<div>
{{ operation.comment.context }}
</div>
<div style="margin-top: 10px;" v-if="operation.comment.attachments && operation.comment.attachments.length > 0">
<template v-for="(item) in getAttachmentList(operation.comment.attachments,true)">
<el-image
style="width: 100px; height: 100px"
:src="item.url"
:preview-src-list="[item.url]">
</el-image>
</template>
<div v-for="(file) in getAttachmentList(operation.comment.attachments,false)">
<el-link style="color: #2a99ff" :href="file.url" icon="el-icon-document">{{ file.name }}</el-link>
</div>
</div>
</div>
</template>
<!-- <template v-if="operation.comment">-->
<!-- <div style="margin-top: 10px;background:#f5f5f5;padding: 10px;">-->
<!-- <div>-->
<!-- {{ operation.comment.context }}-->
<!-- </div>-->
<!-- <div style="margin-top: 10px;"-->
<!-- v-if="operation.comment.attachments && operation.comment.attachments.length > 0">-->
<!-- <template v-for="(item) in getAttachmentList(operation.comment.attachments,true)">-->
<!-- <el-image-->
<!-- style="width: 100px; height: 100px"-->
<!-- :src="item.url"-->
<!-- :preview-src-list="[item.url]">-->
<!-- </el-image>-->
<!-- </template>-->
<!-- <div v-for="(file) in getAttachmentList(operation.comment.attachments,false)">-->
<!-- <el-link style="color: #2a99ff" :href="file.url" icon="el-icon-document">{{ file.name }}</el-link>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </template>-->
</el-card>
</el-timeline-item>
<el-timeline-item :color="timeline.color" :icon="timeline.icon" size="large">
@@ -278,6 +287,7 @@ init()
position: relative;
margin-right: 5px;
}
.el-timeline-item__node {
position: absolute;
bottom: 20px;