Merge pull request 'fix : 修复阶段变更详情页面细节' (#282) from dj into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/282
This commit is contained in:
2024-06-04 10:43:23 +00:00
2 changed files with 49 additions and 11 deletions

View File

@@ -2,7 +2,7 @@
<div v-loading="loading"> <div v-loading="loading">
<fvForm :schema="schema" @getInstance="(e)=>form = e"></fvForm> <fvForm :schema="schema" @getInstance="(e)=>form = e"></fvForm>
<el-form :model="formData" label-width="auto" > <el-form :model="formData" label-width="auto" >
<file-component title="需求上报附件" tag="需求上报" <file-component :title="getTagName(type)+'附件'" :tag="getTagName(type)"
v-model:value="formData.fileList" :processViewer="processViewer" v-model:value="formData.fileList" :processViewer="processViewer"
:file-list-show="fileListShow"/> :file-list-show="fileListShow"/>
</el-form> </el-form>
@@ -122,7 +122,7 @@ const schema = computed(()=>{
) )
}, },
] ]
} else { } else if(props.type == 'archivist'){
arr = [ arr = [
{ {
label: '项目归档附件', label: '项目归档附件',
@@ -144,13 +144,49 @@ const schema = computed(()=>{
} }
</div> </div>
)
},
]
} else if(props.type == 'phase'){
arr = [
{
label: '阶段变更附件',
prop: 'singleFile',
colProps: {
span: 24
},
component: ()=>(
<div>
{
props.formData.singleFile?.originalFileName?
<span
style={{color: '#409EFF', cursor: 'pointer'}}
onClick={()=>handleDownload(props.formData.singleFile)}
>
{props.formData.singleFile?.originalFileName}
</span> :
<span>{'--'}</span>
}
</div>
) )
}, },
] ]
} }
return arr return arr
}) })
const getTagName = (type) => {
switch (type) {
case 'approval':
return '项目立项'
case 'execute':
return '项目实施'
case 'archivist':
return '项目归档'
case 'phase':
return '阶段变更'
}
}
const handleDownload = (row) => { const handleDownload = (row) => {
const loading = ElLoading.service({fullscreen: true}) const loading = ElLoading.service({fullscreen: true})
downloadFile(row.fileId).then(res => { downloadFile(row.fileId).then(res => {

View File

@@ -1,5 +1,6 @@
<template> <template>
<ApprovalDetail :formData="summaryData.formData" :data="summaryData" <baseTitle title="阶段变更详情"></baseTitle>
<ApprovalDetail :formData="summaryData.formData" :data="summaryData" type="phase"
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow"/> :processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow"/>
<opinion v-if="summaryData.taskId" :formData="summaryData.formData" :taskId="summaryData.taskId"></opinion> <opinion v-if="summaryData.taskId" :formData="summaryData.formData" :taskId="summaryData.taskId"></opinion>
</template> </template>
@@ -8,6 +9,7 @@
import {ElNotification} from "element-plus"; import {ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js'; import {useProcessStore} from '@/stores/processStore.js';
import {getPhaseDetail} from "@/api/project-manage"; import {getPhaseDetail} from "@/api/project-manage";
const route = useRoute() const route = useRoute()
const summaryData = ref({}) const summaryData = ref({})
const summaryProcessViewer = ref(true) const summaryProcessViewer = ref(true)
@@ -15,12 +17,12 @@ const processStore = useProcessStore()
const loading = ref(false) const loading = ref(false)
const fileListShow = ref('READ') const fileListShow = ref('READ')
const getInfo = async () => { const getInfo = async () => {
fileListShow.value='READ' fileListShow.value = 'READ'
const projectId = route.query.projectId const projectId = route.query.projectId
summaryProcessViewer.value = false summaryProcessViewer.value = false
loading.value = true loading.value = true
const {code, data,msg} = await getPhaseDetail(projectId) const {code, data, msg} = await getPhaseDetail(projectId)
if(code===1000){ if (code === 1000) {
summaryData.value = data; summaryData.value = data;
loading.value = false loading.value = false
processStore.setDesign(data) processStore.setDesign(data)
@@ -35,14 +37,14 @@ const getInfo = async () => {
fileListShow.value = data.formPermMap["fileList"].perm fileListShow.value = data.formPermMap["fileList"].perm
} }
}) })
}else { } else {
ElNotification({ ElNotification({
title: '提示', title: '提示',
message: msg, message: msg,
type: 'error' type: 'error'
}) })
if(msg==='查询结果为空'){ if (msg === '查询结果为空') {
summaryData.value=[] summaryData.value = []
} }
loading.value = false loading.value = false
} }