| | |
| | | import DetailView from '@/components/commonView/DetailView.vue'; |
| | | import DeclareEnterpriseTableView from '@/components/commonView/DeclareEnterpriseTableView.vue'; |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | import * as informationServices from '@/services/api/Information'; |
| | | import * as parkBountyApplyServices from '@/services/api/ParkBountyApply'; |
| | | import { convertApi2FormUrlOnlyOne } from '@/utils'; |
| | | import { useRouteView } from '@/hooks'; |
| | | import { FormInstance } from 'element-plus'; |
| | |
| | | const { closeViewPush } = useRouteView(); |
| | | const id = route.params?.id as string; |
| | | const form = reactive({ |
| | | categoryName: '', |
| | | amount: 0, |
| | | url: [] as UploadUserFile[], |
| | | batchNo: '', |
| | | parkName: '', |
| | | parkTypeName: '', |
| | | applyMonth: '', |
| | | applySumAmount: 0, |
| | | enterpriseTaxSubFileUrl: [] as UploadUserFile[], |
| | | enterpriseOperateFileUrl: [] as UploadUserFile[], |
| | | bountyAssignFileUlr: [] as UploadUserFile[], |
| | | bountyCollectFileUrl: [] as UploadUserFile[], |
| | | |
| | | status: '' as any as DataRangeEnum, |
| | | remark: '', |
| | | }); |
| | | // const state = reactive({ |
| | | // detail: { |
| | | // categoryName: '', |
| | | // amount: 0, |
| | | // url: [] as UploadUserFile[], |
| | | // }, |
| | | // form: { |
| | | // status: '' as any as DataRangeEnum, |
| | | // remark: '', |
| | | // }, |
| | | // }); |
| | | |
| | | const tableRef = ref<InstanceType<typeof DeclareEnterpriseTableView>>(); |
| | | |
| | | const { data: detail, isLoading } = useQuery({ |
| | | queryKey: ['informationServices/getInformationShowDetail', id], |
| | | queryKey: ['parkBountyApplyServices/getParkBountyApplyDetail', id], |
| | | queryFn: async () => { |
| | | return await informationServices.getInformationShowDetail( |
| | | { id: id }, |
| | | return await parkBountyApplyServices.getParkBountyApplyDetailBaseInfo( |
| | | { parkBountyApplyId: id }, |
| | | { |
| | | showLoading: false, |
| | | } |
| | | ); |
| | | }, |
| | | placeholderData: () => ({} as API.InformationShowDetailDto), |
| | | placeholderData: () => ({} as API.ParkBountyApplyBaseInfo), |
| | | onSuccess(data) { |
| | | form.categoryName = data.categoryName; |
| | | form.amount = data.attentionCount; |
| | | form.url = convertApi2FormUrlOnlyOne(data.avatarUrl); |
| | | form.batchNo = data.batchNo; |
| | | form.parkName = data.parkName; |
| | | form.parkTypeName = data.parkTypeName; |
| | | form.applyMonth = data.applyMonth; |
| | | form.applySumAmount = data.applySumAmount; |
| | | form.enterpriseTaxSubFileUrl = convertApi2FormUrlOnlyOne(data?.enterpriseTaxSubFileUrl); |
| | | form.enterpriseOperateFileUrl = convertApi2FormUrlOnlyOne(data?.enterpriseOperateFileUrl); |
| | | form.bountyAssignFileUlr = convertApi2FormUrlOnlyOne(data?.bountyAssignFileUlr); |
| | | form.bountyCollectFileUrl = convertApi2FormUrlOnlyOne(data?.bountyCollectFileUrl); |
| | | |
| | | tableRef.value?.getList(); |
| | | }, |