diff --git a/src/components/DetailComponent/CollectionDetail.vue b/src/components/DetailComponent/CollectionDetail.vue index 03a965b..5bda21d 100644 --- a/src/components/DetailComponent/CollectionDetail.vue +++ b/src/components/DetailComponent/CollectionDetail.vue @@ -1,36 +1,70 @@ @@ -38,8 +72,9 @@ import OperationRender from '@/views/workflow/common/OperationRender.vue' import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue' import {matterTree} from '@/utils/matterTree.js'; +import {downloadFile} from "@/api/project-demand"; -const emit = defineEmits(['getInfo','download']) +const emit = defineEmits(['getInfo']) const form = ref() const showForm = ref(true) const loading = ref(false) @@ -64,36 +99,6 @@ const props = defineProps({ default: [] }, }) -const schame = computed(() => { - return [ - { - label: '名称', - prop: 'requirementName', - colProps: { - span: 12 - } - }, - { - label: '所属公司', - prop: 'companyIds', - colProps: { - span: 12 - } - }, { - label: '征集类型', - prop: 'collectType', - colProps: { - span: 12 - } - }, { - label: '截止时间', - prop: 'deadline', - colProps: { - span: 12 - } - } - ] -}) const tableConfig = reactive({ columns: [ { @@ -132,15 +137,17 @@ const tableConfig = reactive({ ] }) -const init = (newVal) => { - newVal.companyIds = getDataSourceOptionItem(newVal.companyIds) - form.value.setValues(newVal) -} const getInfo = () => { emit('getInfo') } const handleDownload = (row) => { - emit('download',row) + 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() + }) } const getDataSourceOptionItem = (val) => { if (val instanceof Array) { @@ -155,7 +162,8 @@ watch(() => props.companyOption, (newVal) => { }, {deep: true}) watch(() => props.formData, (newVal) => { if (newVal) { - init(newVal) + newVal.companyIds = getDataSourceOptionItem(newVal.companyIds) + props.formData=newVal } }, {deep: true}) watch(() => props.processViewer, (newVal) => { diff --git a/src/components/DetailComponent/SummaryDetail.vue b/src/components/DetailComponent/SummaryDetail.vue new file mode 100644 index 0000000..860ddb2 --- /dev/null +++ b/src/components/DetailComponent/SummaryDetail.vue @@ -0,0 +1,210 @@ + + + + + diff --git a/src/views/project-demand/collection/add.vue b/src/views/project-demand/collection/add.vue index 03f594e..9b632ff 100644 --- a/src/views/project-demand/collection/add.vue +++ b/src/views/project-demand/collection/add.vue @@ -61,10 +61,17 @@ + + diff --git a/src/views/project-demand/summary/index.vue b/src/views/project-demand/summary/index.vue index 7dc3c19..7de1892 100644 --- a/src/views/project-demand/summary/index.vue +++ b/src/views/project-demand/summary/index.vue @@ -124,7 +124,7 @@ const tableConfig = reactive({ currentRender: ({row, index}) => { return (
- {}} >详情 + handleDetail()} >详情 handleAdd()} >上报
) @@ -164,6 +164,12 @@ const handleAdd = () => { query: {} }) } +const handleDetail = () => { + router.push({ + name: 'Summary/detail', + query: {} + }) +}