fix : 修复详情提交/重新提交功能

This commit is contained in:
2024-06-10 22:34:51 +08:00
parent 3379d851c6
commit 9c812af394
7 changed files with 192 additions and 190 deletions

View File

@@ -2,31 +2,48 @@
<steps :active="route.query.id==='-1'?currentStep-1:currentStep" @setDetail="setDetail" @stepChange="stepChange"
:reportType="route.query.id==='-1'?'direct':''">
<template #content>
<collection-detail
:formData="commonForm.formData"
:data="commonForm"
:processViewer="commonProvessViewer"
v-show="showActive == '00'"
v-model:value="auditOpinion"
<collection-detail :formData="detailData.formData"
:data="detailData"
:processViewer="commonProvessViewer"
v-show="showActive == '00'"
:fileListShow="fileListShow"
v-model:value="auditOpinion"
/>
<summary-detail v-show="showActive == '10'" :formData="commonForm.formData" :data="commonForm"
:processViewer="commonProvessViewer" :fileListShow="fileListShow"
<summary-detail v-show="showActive == '10'"
:formData="detailData.formData"
:data="detailData"
:processViewer="commonProvessViewer"
:fileListShow="fileListShow"
v-model:value="auditOpinion"/>
<ApprovalDetail type="approval" v-show="showActive == '20'&&!showApply" :formData="commonForm.formData"
:data="commonForm" :processViewer="commonProvessViewer"
:fileListShow="fileListShow" v-model:value="auditOpinion"/>
<ApprovalDetail type="execute" v-show="showActive == '40'&&!showCheck" :formData="commonForm.formData"
:data="commonForm" :processViewer="commonProvessViewer"
:fileListShow="fileListShow" v-model:value="auditOpinion"/>
<ApprovalDetail type="archivist" v-show="showActive == '50'&&!showFiling" :formData="commonForm.formData" :data="commonForm"
:processViewer="commonProvessViewer" :fileListShow="fileListShow"
<ApprovalDetail type="approval"
v-if="showActive == '20'&&!editShow"
:formData="detailData.formData"
:data="detailData"
:processViewer="commonProvessViewer"
:fileListShow="fileListShow"
v-model:value="auditOpinion"/>
<project-apply v-if="showApply&&showActive == '20'" :data="commonForm"/>
<project-apply title="项目验收" v-if="showCheck&&showActive == '40'" :data="commonForm"/>
<project-apply title="项目结项" v-if="showFiling&&showActive == '50'" :data="commonForm"/>
<ApprovalDetail type="execute"
v-if="showActive == '40'&&!editShow"
:formData="detailData.formData"
:data="detailData"
:processViewer="commonProvessViewer"
:fileListShow="fileListShow"
v-model:value="auditOpinion"/>
<ApprovalDetail type="archivist"
v-show="showActive == '50'&&!editShow"
:formData="detailData.formData"
:data="detailData"
:processViewer="commonProvessViewer"
:fileListShow="fileListShow"
v-model:value="auditOpinion"/>
<project-apply :title="applyTitle"
v-if="editShow"
:mode="mode"
:data="detailData"
:formData="detailData.formData"/>
</template>
</steps>
<opinion v-if="commonForm.taskId" :formData="commonForm.formData" :taskId="commonForm.taskId"
<opinion v-if="detailData.taskId" :formData="detailData.formData" :taskId="detailData.taskId"
v-model:value="auditOpinion"/>
</template>
@@ -40,101 +57,83 @@ import {ElLoading, ElNotification} from "element-plus";
import Opinion from "@/components/DetailComponent/Opinion.vue";
const route = useRoute()
const showApply = ref(false)
const showCheck = ref(false)
const showFiling = ref(false)
const editShow = ref(false)
const applyTitle = ref('apply')
const loading = ref(false)
const processStore = useProcessStore()
const fileListShow = ref('READ')
const mode = ref('')
const currentStep = ref()
const auditOpinion = ref('')
// const step = ref(route.query.step)
route.query.step == '10' && (currentStep.value = 1)
route.query.step == '20' && (currentStep.value = 2)
route.query.step == '40' && (currentStep.value = 3)
route.query.step == '50' && (currentStep.value = 4)
const showActive = ref()
const commonForm = ref({})
const detailData = ref({})
const commonProvessViewer = ref(true)
const getAllInfo = async (state) => {
const loading = ElLoading.service({fullscreen: true})
try {
fileListShow.value = 'READ'
commonProvessViewer.value = false
const {data, code, msg} = await getMapProjectStateInfo(route.query.projectId, state)
if (code !== 1000) {
if (code === 1000) {
detailData.value = data
mode.value = data.formData.mode
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(() => {
commonProvessViewer.value = true
if (data.formPermMap && data.formPermMap["fileList"]) {
fileListShow.value = data.formPermMap["fileList"].perm
}
})
changeModel(state, mode.value)
loading.close()
} else {
ElNotification({
title: '提示',
message: msg,
type: 'error'
})
if (msg === '查询结果为空') {
commonForm.value = []
detailData.value = []
detailData.value.formData = {}
}
loading.close()
}
if (data === undefined) return;
commonForm.value = data
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(() => {
commonProvessViewer.value = true
if (data.formPermMap && data.formPermMap["fileList"]) {
fileListShow.value = data.formPermMap["fileList"].perm
}
})
loading.close()
} catch {
loading.close()
}
}
const changeModel = (active) => {
if (route.query.step === '20' && active === '20') {
if (route.query.state === '0') {
showApply.value = true
} else if (route.query.state === '3') {
showApply.value = true
getAllInfo(active)
} else {
showApply.value = false
getAllInfo(active)
const changeModel = (active, mode) => {
editShow.value = false
nextTick(() => {
editShow.value = mode === 'submit' || mode === 'resubmit';
if (route.query.step === '20' && active === '20') {
applyTitle.value = 'apply'
} else if (route.query.step === '40' && active === '40') {
applyTitle.value = 'check'
} else if (route.query.step === '50' && active === '50') {
applyTitle.value = 'filing'
}
} else if (route.query.step === '40' && active === '40') {
if (route.query.state === '0') {
showCheck.value = true
} else if (route.query.state === '3') {
showCheck.value = true
getAllInfo(active)
} else {
showCheck.value = false
getAllInfo(active)
}
} else if (route.query.step === '50' && active === '50') {
if (route.query.state === '0') {
showFiling.value = true
} else if (route.query.state === '3') {
showFiling.value = true
getAllInfo(active)
} else {
showFiling.value = false
getAllInfo(active)
}
} else {
getAllInfo(active)
}
})
}
const setDetail = (active) => {
showActive.value = active
changeModel(active)
getAllInfo(active)
}
const stepChange = (data) => {
showActive.value = data.active
changeModel(data.active)
getAllInfo(data.active)
}
</script>