fix : 修改详情页数据回显问题及简化代码

This commit is contained in:
2024-06-01 00:45:13 +08:00
parent 14abf64e5d
commit f4ad871831
10 changed files with 108 additions and 294 deletions

View File

@@ -211,7 +211,7 @@ const getFundOptions = async () => {
specialFundOption.value = res.data
}
const getDataSourceOptionItem = (val) => {
const getCompanyOptionItem = (val) => {
if (val !== undefined) {
val.forEach(item => {
matterTree(companyNameArray.value, companyOption.value, item)
@@ -237,7 +237,7 @@ const init = async () => {
loading.value = false
let data = res.data
formData.value = data.formData;
data.formData.companyIds = getDataSourceOptionItem(data.formData.companyIds)
data.formData.companyIds = getCompanyOptionItem(data.formData.companyIds)
if(data.formData.specialFund){
specialFundOption.value.forEach(item => {
if(data.formData.specialFund==item.value){

View File

@@ -2,7 +2,7 @@
<steps :active="1" @setDetail="setDetail" @stepChange="stepChange">
<template #content>
<collection-detail v-show="showActive == '00'" :formData="summaryData.formData" :data="summaryData"
:processViewer="summaryProcessViewer" :companyOption="companyOption" :loading="loading"/>
:processViewer="summaryProcessViewer" :loading="loading"/>
<summary-detail v-show="showActive == '10'" :formData="summaryData.formData" :data="summaryData"
:processViewer="summaryProcessViewer" :loading="loading"/>
<ApprovalDetail v-show="showActive == '20'" :formData="summaryData.formData" :data="summaryData" :processViewer="summaryProcessViewer" :loading="loading"></ApprovalDetail>
@@ -21,34 +21,20 @@ import SummaryDetail from '@/components/DetailComponent/SummaryDetail.vue';
import {useProcessStore} from '@/stores/processStore.js';
import {getMapProjectStateInfo} from '@/components/steps/api';
import CollectionDetail from "@/components/DetailComponent/CollectionDetail.vue";
import {getSubCompOpt} from "@/api/user/user";
import {ElNotification} from "element-plus";
const route = useRoute()
const companyOption = ref([])
const summaryData = ref({})
const summaryProcessViewer = ref(true)
const loading = ref(false)
const processStore = useProcessStore()
const active = ref(route.query.state)
const showActive = ref()
const getCompanyOption = async () => {
const res = await getSubCompOpt()
companyOption.value = res.data
}
const getInfo = async (state) => {
const projectId = route.query.projectId
if(showActive == '00'){
await getCompanyOption()
}
summaryProcessViewer.value = false
loading.value = true
const {code, data,msg} = await getMapProjectStateInfo(projectId, state)
ElNotification({
title: '提示',
message: msg,
type: code === 1000 ? 'success' : 'error'
})
if(data===undefined)return;
if(code===1000){
summaryData.value = data;
@@ -62,24 +48,15 @@ const getInfo = async (state) => {
nextTick(() => {
summaryProcessViewer.value = true
})
}else {
ElNotification({
title: '提示',
message: msg,
type: 'error'
})
}
}
// const back = () => {
// switch (route.name) {
// case 'Summary/detail':
// setDetail('1')
// break;
// case 'Initiation/detail':
// setDetail('2')
// break;
// case 'Implementation/detail':
// setDetail('3')
// break;
// case 'Filing/detail':
// setDetail('4')
// break;
// }
// }
const setDetail = (active) => {
showActive.value = active
getInfo(active)
@@ -89,7 +66,6 @@ const stepChange = (data) => {
showActive.value = data.active
getInfo(data.active)
}
// back()
</script>
<style scoped>