diff --git a/src/components/DetailComponent/ApprovalDetail.vue b/src/components/DetailComponent/ApprovalDetail.vue index 4748b36..be2fc96 100644 --- a/src/components/DetailComponent/ApprovalDetail.vue +++ b/src/components/DetailComponent/ApprovalDetail.vue @@ -2,7 +2,20 @@
- + + + + + + + + + + + +
@@ -22,6 +35,8 @@ import OperationRender from '@/views/workflow/common/OperationRender.vue' import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'; import Opinion from './Opinion.vue'; import fvTable from '@/fvcomponents/fvTable/index.vue' +import { ElLoading } from 'element-plus'; +import {deleteFile, downloadFile} from "@/api/project-demand"; const props = defineProps({ formData: { @@ -40,37 +55,99 @@ const props = defineProps({ type: Array, default: [] }, + + // approval 立项, execute 实施, 归档 archivist + type: { + type: String, + default: 'approval' + } }) const form = ref() const localData = reactive({ - fileList: props.formData.fileList + fileList: props.formData.fileList, + singleFile: props.formData.singleFile }) const schema = computed(()=>{ - return [ - { - label: '前置流程', - prop: 'preProcess', - colProps: { - span: 24 - } - }, - { - label: '项目立项附件', - prop: 'singleFile', - colProps: { - span: 24 - } - }, - { - label: '其他文件', - prop: 'fileList', - } - ] + let arr + + if(props.type == 'approval') { + arr = [ + { + label: '前置流程', + prop: 'preProcess', + colProps: { + span: 24 + } + }, + { + label: '项目立项附件', + prop: 'singleFile', + colProps: { + span: 24 + }, + component: ()=>( +
+ { + props.formData.singleFile?.originalFileName ? + handleDownload(props.formData.singleFile)} + > + {props.formData.singleFile?.originalFileName} + : + {'--'} + } +
+ + ) + }, + ] + } else if(props.type == 'execute') { + arr = [ + { + label: '前置流程', + prop: 'preProcess', + colProps: { + span: 24 + } + }, + { + label: '项目验收附件', + prop: 'singleFile', + colProps: { + span: 24 + } + }, + ] + } else { + arr = [ + { + label: '项目归档附件', + prop: 'singleFile', + colProps: { + span: 24 + } + }, + ] + } + return arr }) +const handleDownload = (row) => { + const loading = ElLoading.service({fullscreen: true}) + downloadFile(row.fileId).then(res => { + const blob = new Blob([res]) + let a = document.createElement('a') + a.href = URL.createObjectURL(blob) + a.download = row.originalFileName + a.click() + loading.close() + }) +} + watchEffect(()=>{ Object.keys(props.formData).length && (form.value.setValues(props.formData)) }) diff --git a/src/components/steps/index.vue b/src/components/steps/index.vue index 22142ca..546904e 100644 --- a/src/components/steps/index.vue +++ b/src/components/steps/index.vue @@ -79,6 +79,10 @@ const localSteps = ref([ title: '项目归档', key: 'archivist', }, + // { + // title: '项目结项', + // key: 'end', + // }, ]) const baseForm = ref() @@ -134,9 +138,11 @@ const formatProcedure = (data) => { break case '20': arr.push(2) break - case '30': arr.push(3) + // case '30': arr.push(3) + // break + case '40': arr.push(3) break - case '40': arr.push(4) + case '50': arr.push(4) break } }) @@ -156,9 +162,11 @@ const formatReProcedure = (data) => { break case 2: arr.push('20') break - case 3: arr.push('30') + // case 3: arr.push('30') + // break + case 3: arr.push('40') break - case 4: arr.push('40') + case 4: arr.push('50') break } }) @@ -166,26 +174,13 @@ const formatReProcedure = (data) => { } const formatActive = (val) => { - console.log(val, 'val'); let active = '' - // switch(val) { - // case '0' : active = '00' - // break - // case '1' : active = '10' - // break - // case '2' : active = '20' - // break - // case '3' : active = '30' - // break - // case '4' : active = '40' - // break - // } val == 0 && (active = '00') val == 1 && (active = '10') val == 2 && (active = '20') - val == 3 && (active = '30') - val == 4 && (active = '40') - console.log(active, 'active--'); + // val == 3 && (active = '30') + val == 3 && (active = '40') + val == 4 && (active = '50') return active } @@ -207,9 +202,11 @@ const handleStep = (key, index) => { break case 2: active = '20' break - case 3: active = '30' + // case 3: active = '30' + // break + case 3: active = '40' break - case 4: active = '40' + case 4: active = '50' break } emits('stepChange', { key, active }) diff --git a/src/views/project-management/filing/detail.vue b/src/views/project-management/filing/detail.vue index 30c9220..f95826c 100644 --- a/src/views/project-management/filing/detail.vue +++ b/src/views/project-management/filing/detail.vue @@ -1,23 +1,33 @@