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

@@ -1,6 +1,6 @@
import request from '@/utils/request.js' import request from '@/utils/request.js'
//项目立项
export const getProcessInfo = () => { export const getApplyProcess = () => {
return request({ return request({
url: '/workflow/mosr/project/approval/initiation/process', url: '/workflow/mosr/project/approval/initiation/process',
method: "post" method: "post"
@@ -10,34 +10,79 @@ export const projectApply = (data) => {
return request({ return request({
url: '/workflow/mosr/project/approval/initiation/apply', url: '/workflow/mosr/project/approval/initiation/apply',
method: "post", method: "post",
data:data data: data
}); });
}; };
export const getApplyDetail = (ProjectId) => {
return request({
url: `/workflow/mosr/project/approval/info/${ProjectId}`,
method: "get"
});
};
export const resubmitApply = (data) => {
return request({
url: '/workflow/mosr/project/approval/initiation/resubmit',
method: "post",
data: data
});
};
//项目实施
export const getCheckDetail = (projectId) => {
return request({
url: `/workflow/mosr/project/implementation/info/${projectId}`,
method: "get"
});
};
export const resubmitCheck = (data) => {
return request({
url: '/workflow/mosr/project/implementation/resubmit',
method: "post",
data: data
});
};
export const projectCheck = (data) => { export const projectCheck = (data) => {
return request({ return request({
url: '/workflow/mosr/project/implementation/initiation/check', url: '/workflow/mosr/project/implementation/initiation/check',
method: "post", method: "post",
data:data data: data
}); });
}; };
export const getProjectCheckProcess = (data) => { export const getProjectCheckProcess = (data) => {
return request({ return request({
url: '/workflow/mosr/project/implementation/process', url: '/workflow/mosr/project/implementation/process',
method: "post", method: "post",
data:data data: data
}); });
}; };
//项目归档
export const getConclusionDetail = (ProjectId) => {
return request({
url: `/workflow/mosr/project/filing/info/${ProjectId}`,
method: "get"
});
};
export const resubmitConclusion = (data) => {
return request({
url: '/workflow/mosr/project/filing/resubmit',
method: "post",
data: data
});
};
export const projectConclusion = (data) => { export const projectConclusion = (data) => {
return request({ return request({
url: '/workflow/mosr/project/filing/project/entry', url: '/workflow/mosr/project/filing/project/entry',
method: "post", method: "post",
data:data data: data
}); });
}; };
export const getProjectConclusionProcess = (data) => { export const getProjectConclusionProcess = (data) => {
return request({ return request({
url: '/workflow/mosr/project/filing/process', url: '/workflow/mosr/project/filing/process',
method: "post", method: "post",
data:data data: data
}); });
}; };

View File

@@ -3,10 +3,13 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item :label="label" prop="attachment"> <el-form-item :label="label" prop="attachment">
<template v-if="preview"> <template v-if="preview&&JSON.stringify(singleFile) !== '{}'&&JSON.stringify(singleFile)!=='null'">
<el-button type="primary" link @click="handleDownload(singleFile)" style="font-size: 18px">{{ singleFile?.originalFileName }}</el-button> <el-button type="primary" link @click="handleDownload(singleFile)" style="font-size: 18px">
{{ singleFile?.originalFileName }}
</el-button>
<el-button type="danger" link @click="deleteOtherFile(singleFile,1)">删除</el-button>
</template> </template>
<template v-else> <template v-else-if="!preview||JSON.stringify(singleFile) === '{}'||singleFile==null">
<file-upload @getFile="getAttachment" :showFileList="showFileList" :maxSize="0" @delete="deleteAttachment"/> <file-upload @getFile="getAttachment" :showFileList="showFileList" :maxSize="0" @delete="deleteAttachment"/>
</template> </template>
</el-form-item> </el-form-item>
@@ -31,7 +34,7 @@
<script setup lang="jsx"> <script setup lang="jsx">
import FileUpload from '@/components/FileUpload.vue' import FileUpload from '@/components/FileUpload.vue'
import {deleteFile, downloadFile} from "../api/project-demand"; import {deleteFile, downloadFile} from "../api/project-demand";
import {ElMessage, ElMessageBox} from "element-plus"; import {ElMessage, ElMessageBox, ElNotification} from "element-plus";
const emit = defineEmits(["getAttachment", "getOtherFile"]) const emit = defineEmits(["getAttachment", "getOtherFile"])
const formData = ref({}) const formData = ref({})
@@ -77,11 +80,11 @@ const tableConfig = reactive({
] ]
}) })
const rules = reactive({ const rules = reactive({
attachment: [{required: true, message: '请上传附件', trigger: ['blur','change']}], attachment: [{required: true, message: '请上传附件', trigger: ['blur', 'change']}],
}) })
const applyForm=ref() const applyForm = ref()
const singleFile=ref() const singleFile = ref()
const allFileList=ref([]) const allFileList = ref([])
const props = defineProps({ const props = defineProps({
showFileList: { showFileList: {
type: Boolean, type: Boolean,
@@ -95,10 +98,10 @@ const props = defineProps({
}, preview: { }, preview: {
type: Boolean, type: Boolean,
default: false default: false
},otherFileList: { }, otherFileList: {
type: Array, type: Array,
default: [] default: []
},formData: { }, formData: {
type: Array, type: Array,
default: [] default: []
} }
@@ -107,16 +110,19 @@ watch(() => props.showTable, (newVal) => {
props.showTable = newVal props.showTable = newVal
}, {deep: true}) }, {deep: true})
watch(() => props.otherFileList, (newVal) => { watch(() => props.otherFileList, (newVal) => {
newVal.forEach(item=>{ newVal.forEach(item => {
allFileList.value.push(item) allFileList.value.push(item)
}) })
}, {deep: true}) }, {deep: true})
watch(() => props.formData.fileList, (newVal) => { watch(() => props.formData.fileList, (newVal) => {
newVal.forEach(item=>{ if (props.preview) {
allFileList.value.push(item) newVal.forEach(item => {
}) allFileList.value.push(item)
})
}
}, {deep: true}) }, {deep: true})
watch(() => props.formData.singleFile, (newVal) => { watch(() => props.formData.singleFile, (newVal) => {
// singleFile.value = {}
singleFile.value = newVal singleFile.value = newVal
}, {deep: true}) }, {deep: true})
const getAttachment = (val) => { const getAttachment = (val) => {
@@ -132,20 +138,32 @@ const deleteAttachment = (val) => {
} }
}); });
} }
const deleteOtherFile = (row) => { const deleteOtherFile = (row, type) => {
ElMessageBox.confirm(`确认删除名称为${row.originalFileName}的表格吗?`, '系统提示', { ElMessageBox.confirm(`确认删除名称为${row.originalFileName}的表格吗?`, '系统提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteFile(row.fileId).then(res => { deleteFile(row.fileId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) { if (res.code === 1000) {
ElMessage.success("删除成功"); if (type === 1) {
props.otherFileList.splice(props.otherFileList.findIndex((item) => item.id === row.fileId), 1); singleFile.value = {}
} else {
props.otherFileList.splice(props.otherFileList.findIndex((item) => item.id === row.fileId), 1);
}
} }
}); });
}).catch(() => { }).catch(() => {
ElMessage.warning("用户取消删除! "); ElNotification({
title: '提示',
message: "用户取消删除! ",
type: 'warning'
})
}) })
} }
const handleDownload = (row) => { const handleDownload = (row) => {
@@ -158,10 +176,10 @@ const handleDownload = (row) => {
}) })
} }
defineExpose({ defineExpose({
validate(){ validate() {
return applyForm.value.validate() return applyForm.value.validate()
}, },
clearValidate(){ clearValidate() {
return applyForm.value.clearValidate() return applyForm.value.clearValidate()
}, },
allFileList, allFileList,

View File

@@ -163,8 +163,10 @@ watch(() => props.loading, (newVal) => {
watch(() => props.companyOption, (newVal) => { watch(() => props.companyOption, (newVal) => {
props.companyOption = newVal props.companyOption = newVal
}, {deep: true}) }, {deep: true})
watch(() => props.formData.companyIds, (newVal) => { watch(() => props.formData, (newVal) => {
props.formData.companyIds = getDataSourceOptionItem(newVal) if(newVal!=null){
props.formData.companyIds = getDataSourceOptionItem(newVal.companyIds)
}
}, {deep: true}) }, {deep: true})
watch(() => props.processViewer, (newVal) => { watch(() => props.processViewer, (newVal) => {
props.processViewer = newVal props.processViewer = newVal

View File

@@ -23,8 +23,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属公司" prop="companyName"> <el-form-item label="所属公司" prop="affiliatedCompanyId">
<span>{{ localFormData.companyName }}</span> <span>{{ localFormData.affiliatedCompanyId }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@@ -158,9 +158,9 @@
<div class="process"> <div class="process">
<operation-render v-if="processViewer" :operation-list="data.operationList" <operation-render v-if="processViewer" :operation-list="data.operationList"
:state="data.state"/> :state="data.state"/>
<process-diagram-viewer v-if="processViewer"/>
</div> </div>
</div> </div>
<div class="oper-page-btn" v-if="data.state === '1' && data.taskId"> <div class="oper-page-btn" v-if="data.state === '1' && data.taskId">
<el-button @click="handleReject(summaryForm)">驳回</el-button> <el-button @click="handleReject(summaryForm)">驳回</el-button>
<el-button color="#DED0B2" @click="handleAgree">同意</el-button> <el-button color="#DED0B2" @click="handleAgree">同意</el-button>

View File

@@ -229,7 +229,7 @@ const submitParam = (item) => {
deadline: item.deadline, deadline: item.deadline,
requirementId: item.requirementId ? item.requirementId : 0, requirementId: item.requirementId ? item.requirementId : 0,
requirementName: item.requirementName, requirementName: item.requirementName,
files: files, fileList: files,
deploymentId: processInstanceData.value.deploymentId deploymentId: processInstanceData.value.deploymentId
} }
} }

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="detail-block"> <div class="detail-block" v-loading="loading">
<el-form :model="formData" ref="demandForm" label-width="auto" :rules="rules"> <el-form :model="formData" ref="demandForm" label-width="auto" :rules="rules">
<baseTitle title="需求征集详情"></baseTitle> <baseTitle title="需求征集详情"></baseTitle>
<el-row> <el-row>
@@ -87,6 +87,7 @@ const tagsViewStore = useTagsView()
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const form = ref(); const form = ref();
const loading = ref(false)
const demandForm = ref() const demandForm = ref()
const processStore = useProcessStore() const processStore = useProcessStore()
const companyOption = ref([]) const companyOption = ref([])
@@ -202,6 +203,7 @@ const init = async () => {
if (!route.query.id) return; if (!route.query.id) return;
await getCompanyOption() await getCompanyOption()
getInfo(route.query.id).then(res => { getInfo(route.query.id).then(res => {
loading.value=false
let data = res.data let data = res.data
formData.value = data.formData; formData.value = data.formData;
data.formData.companyIds = getDataSourceOptionItem(data.formData.companyIds) data.formData.companyIds = getDataSourceOptionItem(data.formData.companyIds)
@@ -218,7 +220,10 @@ const init = async () => {
}) })
}) })
} }
init() onMounted(async () => {
loading.value=true
await init()
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -344,7 +344,7 @@ const handleSubmit = async (instance) => {
}) })
let params = { let params = {
"specialFund": "2", "specialFund": "2",
"projectName": "重新提交全流程测试", "projectName": "重新提交全流程测试2024520",
"startTime": "2024-05-24 00:00:00", "startTime": "2024-05-24 00:00:00",
"endTime": "2024-05-29 00:00:00", "endTime": "2024-05-29 00:00:00",
"projectType": "3", "projectType": "3",
@@ -363,19 +363,18 @@ const handleSubmit = async (instance) => {
"resultForm": "3", "resultForm": "3",
"projectImpact": "3", "projectImpact": "3",
"rdSubject": "3", "rdSubject": "3",
"affiliatedCompanyId": 93, "affiliatedCompanyId": formData.value.affiliatedCompanyId,
"serviceDescription": "3", "serviceDescription": "3",
"contentDescription": "3", "contentDescription": "3",
"specialFundAmount": "3", "specialFundAmount": "3",
deploymentId: deploymentId.value, deploymentId: deploymentId.value,
"singleFile": singleFile, "singleFile": singleFile,
"files": otherFiles, "files": otherFiles,
// "requirementId":route.query.id, "requirementId":route.query.id
"requirementId": 102
} }
// ...formData.value, // ...formData.value,
// deploymentId: deploymentId.value, // deploymentId: deploymentId.value,
// files: files, // fileList: files,
// requirementId:102 // requirementId:102
// } // }
let res = await requirementReported(params) let res = await requirementReported(params)
@@ -416,9 +415,9 @@ const handleResubmit = () => {
let params={ let params={
...formData.value, ...formData.value,
deploymentId: deploymentId.value, deploymentId: deploymentId.value,
files: otherFiles, fileList: otherFiles,
singleFile: singleFile, singleFile: singleFile,
requirementId: 102 requirementId: route.query.id
} }
console.log('重新提交params',params) console.log('重新提交params',params)
resubmitReported(params).then(res => { resubmitReported(params).then(res => {
@@ -473,12 +472,11 @@ const init = async () => {
}) })
} }
onMounted(async () => { onMounted(async () => {
loading.value=true
await init() await init()
if (route.query.projectId) { if (route.query.projectId) {
loading.value=true
await getDetailInfo() await getDetailInfo()
} }
}) })
const staging = async () => { const staging = async () => {
} }

View File

@@ -15,6 +15,7 @@ import {useProcessStore} from '@/stores/processStore.js';
import {getMapProjectStateInfo} from '@/components/steps/api'; import {getMapProjectStateInfo} from '@/components/steps/api';
import CollectionDetail from "@/components/DetailComponent/CollectionDetail.vue"; import CollectionDetail from "@/components/DetailComponent/CollectionDetail.vue";
import {getSubCompOpt} from "@/api/user/user"; import {getSubCompOpt} from "@/api/user/user";
import {ElNotification} from "element-plus";
const route = useRoute() const route = useRoute()
const companyOption = ref([]) const companyOption = ref([])
@@ -33,18 +34,25 @@ const getInfo = async (state) => {
await getCompanyOption() await getCompanyOption()
summaryProcessViewer.value = false summaryProcessViewer.value = false
loading.value = true loading.value = true
const {code, data} = await getMapProjectStateInfo(projectId, state) const {code, data,msg} = await getMapProjectStateInfo(projectId, state)
summaryData.value = data; ElNotification({
loading.value = false title: '提示',
processStore.setDesign(data) message: msg,
processStore.runningList.value = data.runningList; type: code === 1000 ? 'success' : 'error'
processStore.endList.value = data.endList;
processStore.noTakeList.value = data.noTakeList;
processStore.refuseList.value = data.refuseList;
processStore.passList.value = data.passList;
nextTick(() => {
summaryProcessViewer.value = true
}) })
if(code===1000){
summaryData.value = data;
loading.value = false
processStore.setDesign(data)
processStore.runningList.value = data.runningList;
processStore.endList.value = data.endList;
processStore.noTakeList.value = data.noTakeList;
processStore.refuseList.value = data.refuseList;
processStore.passList.value = data.passList;
nextTick(() => {
summaryProcessViewer.value = true
})
}
} }
const setDetail = (active) => { const setDetail = (active) => {

View File

@@ -23,7 +23,7 @@ import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.v
import {downloadFile} from "@/api/project-demand"; import {downloadFile} from "@/api/project-demand";
import {ElNotification} from "element-plus"; import {ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js'; import {useProcessStore} from '@/stores/processStore.js';
import {getProjectConclusionProcess, projectConclusion} from "@/api/project-manage"; import {getProjectConclusionProcess, projectConclusion,getConclusionDetail, resubmitConclusion} from "@/api/project-manage";
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
@@ -128,11 +128,11 @@ const handleSubmit = (instance) => {
if (!instance) return if (!instance) return
instance.validate(async (valid) => { instance.validate(async (valid) => {
if (!valid) return if (!valid) return
// if(JSON.stringify(file.value) == "{}"){ if(JSON.stringify(file.value) === "{}"){
// applyForm.value.validate() attachment.value.validate()
// } else { } else {
// applyForm.value.clearValidate() attachment.value.clearValidate()
// } }
if (!valid) return if (!valid) return
let files = [] let files = []
let singleFile={} let singleFile={}
@@ -147,7 +147,7 @@ const handleSubmit = (instance) => {
let params = { let params = {
deploymentId: deploymentId.value, deploymentId: deploymentId.value,
requirementId: route.query.id, requirementId: route.query.id,
files: files, fileList: files,
singleFile: singleFile, singleFile: singleFile,
projectId:route.query.projectId, projectId:route.query.projectId,
} }
@@ -170,7 +170,12 @@ const handleResubmit = () => {
let singleFile = {} let singleFile = {}
let otherFiles = [] let otherFiles = []
let fileArray let fileArray
if(name.value === 'Filing/edit'){ if (JSON.stringify(file.value) === "{}"||attachment.value.singleFile===null) {
attachment.value.validate()
} else {
attachment.value.clearValidate()
}
if(attachment.value.singleFile!==null&&name.value === 'Filing/edit'){
singleFile = { singleFile = {
fileId: attachment.value.singleFile.fileId fileId: attachment.value.singleFile.fileId
} }
@@ -190,37 +195,37 @@ const handleResubmit = () => {
let params={ let params={
deploymentId: deploymentId.value, deploymentId: deploymentId.value,
requirementId: route.query.id, requirementId: route.query.id,
files: otherFiles, fileList: otherFiles,
singleFile: singleFile, singleFile: singleFile,
projectId:route.query.projectId, projectId:route.query.projectId,
} }
console.log('重新提交params',params) console.log('重新提交params',params)
// resubmitReported(params).then(res => { resubmitConclusion(params).then(res => {
// ElNotification({ ElNotification({
// title: '提示', title: '提示',
// message: res.msg, message: res.msg,
// type: res.code === 1000 ? 'success' : 'error' type: res.code === 1000 ? 'success' : 'error'
// }) })
// if (res.code === 1000) { if (res.code === 1000) {
// tagsViewStore.delVisitedViews(router.currentRoute.value.path) tagsViewStore.delVisitedViews(router.currentRoute.value.path)
// router.push({ router.push({
// name: 'Filing' name: 'Filing'
// }) })
// } }
// }) })
} }
const getDetailInfo = async () => { const getDetailInfo = async () => {
// getDetail(route.query.projectId).then(res => { getConclusionDetail(route.query.projectId).then(res => {
// ElNotification({ ElNotification({
// title: '提示', title: '提示',
// message: res.msg, message: res.msg,
// type: res.code === 1000 ? 'success' : 'error' type: res.code === 1000 ? 'success' : 'error'
// }) })
// if (res.code === 1000) { if (res.code === 1000) {
// formData.value = res.data.formData formData.value = res.data.formData
// loading.value=false loading.value=false
// } }
// }) })
} }
const init = () => { const init = () => {
getProjectConclusionProcess().then(res => { getProjectConclusionProcess().then(res => {
@@ -242,12 +247,11 @@ const init = () => {
}) })
} }
onMounted(async () => { onMounted(async () => {
loading.value=true
await init() await init()
if (route.query.projectId) { if (name.value === 'Filing/edit') {
loading.value=true
await getDetailInfo() await getDetailInfo()
} }
}) })
</script> </script>

View File

@@ -19,18 +19,17 @@
</div> </div>
<div class="oper-page-btn"> <div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button> <el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button>
<el-button color="#DED0B2" @click="handleResubmit">重新提交</el-button> <el-button color="#DED0B2" @click="handleResubmit(applyForm)">重新提交</el-button>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="jsx"> <script setup lang="jsx">
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'; import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import {getProjectCheckProcess, projectCheck} from "@/api/project-manage"; import {getProjectCheckProcess, projectCheck,getCheckDetail,resubmitCheck} from "@/api/project-manage";
import {ElNotification} from "element-plus"; import {ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js'; import {useProcessStore} from '@/stores/processStore.js';
import {useTagsView} from '@/stores/tagsview.js' import {useTagsView} from '@/stores/tagsview.js'
import {getDetail, resubmitReported} from "../../project-demand/summary/api";
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
@@ -83,11 +82,11 @@ const handleSubmit = (instance) => {
if (!instance) return if (!instance) return
instance.validate(async (valid) => { instance.validate(async (valid) => {
if (!valid) return if (!valid) return
// if(JSON.stringify(file.value) == "{}"){ if(JSON.stringify(file.value) === "{}"){
// applyForm.value.validate() attachment.value.validate()
// }else { }else {
// applyForm.value.clearValidate() attachment.value.clearValidate()
// } }
if (!valid) return if (!valid) return
let files = [] let files = []
let singleFile={} let singleFile={}
@@ -111,11 +110,11 @@ const handleSubmit = (instance) => {
let params = { let params = {
deploymentId: deploymentId.value, deploymentId: deploymentId.value,
requirementId: route.query.id, requirementId: route.query.id,
files: files, fileList: files,
singleFile: singleFile, singleFile: singleFile,
projectId:route.query.projectId, projectId:route.query.projectId,
} }
console.log('params',params) console.log('params-提交',params)
let res = await projectCheck(params) let res = await projectCheck(params)
ElNotification({ ElNotification({
title: '提示', title: '提示',
@@ -130,61 +129,70 @@ const handleSubmit = (instance) => {
} }
}) })
} }
const handleResubmit = () => { const handleResubmit = (instance) => {
let singleFile = {} if (!instance) return
let otherFiles = [] instance.validate(async (valid) => {
let fileArray if (!valid) return
if(name.value === 'Implementation/edit'){ let singleFile = {}
singleFile = { let otherFiles = []
fileId: attachment.value.singleFile.fileId let fileArray
if (JSON.stringify(file.value) === "{}"||attachment.value.singleFile===null) {
attachment.value.validate()
} else {
attachment.value.clearValidate()
} }
fileArray=attachment.value.allFileList if (attachment.value.singleFile!==null&&name.value === 'Implementation/edit') {
}else {
if (file.value.fileId !== undefined) {
singleFile = { singleFile = {
fileId: file.value.fileId fileId: attachment.value.singleFile.fileId
} }
fileArray = attachment.value.allFileList
} else {
if (file.value.fileId !== undefined) {
singleFile = {
fileId: file.value.fileId
}
}
fileArray = otherFileList.value
} }
fileArray=otherFileList.value fileArray.forEach(item => {
} otherFiles.push(getFileParam(item))
fileArray.forEach(item => { })
otherFiles.push(getFileParam(item)) //todo requirementId
let params = {
deploymentId: deploymentId.value,
requirementId: route.query.id,
fileList: otherFiles,
singleFile: singleFile,
projectId: route.query.projectId,
}
console.log('重新提交params', params)
resubmitCheck(params).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
router.push({
name: 'Implementation'
})
}
})
}) })
//todo requirementId
let params={
deploymentId: deploymentId.value,
requirementId: route.query.id,
files: otherFiles,
singleFile: singleFile,
projectId:route.query.projectId,
}
console.log('重新提交params',params)
// resubmitReported(params).then(res => {
// ElNotification({
// title: '提示',
// message: res.msg,
// type: res.code === 1000 ? 'success' : 'error'
// })
// if (res.code === 1000) {
// tagsViewStore.delVisitedViews(router.currentRoute.value.path)
// router.push({
// name: 'Implementation'
// })
// }
// })
} }
const getDetailInfo = async () => { const getDetailInfo = async () => {
// getDetail(route.query.projectId).then(res => { getCheckDetail(route.query.projectId).then(res => {
// ElNotification({ ElNotification({
// title: '提示', title: '提示',
// message: res.msg, message: res.msg,
// type: res.code === 1000 ? 'success' : 'error' type: res.code === 1000 ? 'success' : 'error'
// }) })
// if (res.code === 1000) { if (res.code === 1000) {
// formData.value = res.data.formData formData.value = res.data.formData
// loading.value=false loading.value=false
// } }
// }) })
} }
const init = () => { const init = () => {
getProjectCheckProcess().then(res => { getProjectCheckProcess().then(res => {
@@ -206,12 +214,11 @@ const init = () => {
}) })
} }
onMounted(async () => { onMounted(async () => {
loading.value=true
await init() await init()
if (route.query.projectId) { if (name.value === 'Implementation/edit'){
loading.value=true
await getDetailInfo() await getDetailInfo()
} }
}) })
</script> </script>

View File

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

View File

@@ -86,7 +86,7 @@ const init = () => {
break break
} }
// let operationListNew = [] // let operationListNew = []
for (let i = 0; i < props.operationList.length; i++) { for (let i = 0; i < props.operationList?.length; i++) {
let operationNew = initOperationFun(props.operationList[i]) let operationNew = initOperationFun(props.operationList[i])
let userList = [] let userList = []
if (operationNew.userInfo) { if (operationNew.userInfo) {