wupengfei
2025-04-09 1b0bbe7fbe3d62779356f0729f086ceb3901e17b
src/views/MaterialReview/MaterialReviewAudit.vue
@@ -62,7 +62,7 @@
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';
@@ -75,41 +75,43 @@
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();
  },