fix : 修复需求汇总详情功能

This commit is contained in:
2024-05-19 13:18:03 +08:00
parent 10bc019866
commit 89d5c86d8b
6 changed files with 383 additions and 93 deletions

View File

@@ -7,10 +7,13 @@
@tab-click="handleClick"
>
<el-tab-pane label="需求征集" name="first">
<collection-detail :formData="collectionData.formData" :data="collectionData" :processViewer="processViewer"
:companyOption="companyOption" @getInfo="getDemandCollectionInfo" @download="downloadDetailFile"/>
<collection-detail :formData="collectionData.formData" :data="collectionData"
:processViewer="collectionProcessViewer"
:companyOption="companyOption" @getInfo="getDemandCollectionInfo"/>
</el-tab-pane>
<el-tab-pane label="需求上报" name="second">
<summary-detail :formData="summaryData.formData" :data="summaryData" :processViewer="summaryProcessViewer"/>
</el-tab-pane>
<el-tab-pane label="需求上报" name="second"></el-tab-pane>
<el-tab-pane label="项目立项" name="third" :disabled="true"></el-tab-pane>
</el-tabs>
</div>
@@ -22,14 +25,19 @@ import {getSubCompOpt} from '@/api/user/user.js'
import {useProcessStore} from '@/stores/processStore.js';
import CollectionDetail from "@/components/DetailComponent/CollectionDetail.vue";
import {downloadFile} from "@/api/project-demand";
import SummaryDetail from "@/components/DetailComponent/SummaryDetail.vue";
const route = useRoute()
const activeName = ref('first')
const collectionData = ref({})
const processViewer = ref(false)
const summaryData = ref({})
const collectionProcessViewer = ref(false)
const summaryProcessViewer = ref(false)
const processStore = useProcessStore()
const companyOption = ref([])
const rules = reactive({
auditOpinion: [{required: true, message: '请输入审核意见', trigger: 'blur'}],
})
const getCompanyOption = async () => {
const res = await getSubCompOpt()
companyOption.value = res.data
@@ -48,23 +56,34 @@ const getDemandCollectionInfo = async () => {
processStore.refuseList.value = data.refuseList;
processStore.passList.value = data.passList;
nextTick(() => {
processViewer.value = true
collectionProcessViewer.value = true
})
})
}
const downloadDetailFile = (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 getDemandSummaryInfo = async () => {
if (!route.query.id) return
// await getCompanyOption()
getInfo(route.query.id).then(res => {
let data = res.data
summaryData.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(() => {
summaryProcessViewer.value = true
})
})
}
const handleClick = (tab, event) => {
console.log(tab, event)
if (tab.index.value === 0) {
if (tab.props.name === 'first') {
getDemandCollectionInfo()
} else if (tab.props.name === 'second') {
getDemandSummaryInfo()
}
}
getDemandCollectionInfo()