wupengfei
2025-04-30 b3fda48ba53b36f6770f399f58290ed4d95d04a6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<template>
  <LoadingLayout>
    <AppContainer>
      <PageFormLayout title="申报详情">
        <DetailView :form="form">
          <ChunkCellV2 title="申报企业名单">
            <DeclareEnterpriseTableView
              :getList="getList"
              :extra-param-state="extraParamState"
              :pro-table-props="proTableProps"
              :reset="reset"
              :open-dialog="openDialog"
            ></DeclareEnterpriseTableView>
            <MateriaDetailDialog
              v-bind="dialogProps"
              :show-upload-btn="false"
              :show-delete-btn="false"
              :show-check-btn="false"
            />
          </ChunkCellV2>
        </DetailView>
        <template #footer>
          <el-button @click="handleBack" type="primary">确认</el-button>
        </template>
      </PageFormLayout>
    </AppContainer>
  </LoadingLayout>
</template>
 
<script setup lang="ts">
import {
  AppContainer,
  LoadingLayout,
  UploadUserFile,
  PageFormLayout,
  useTable,
  useFormDialog,
} from '@bole-core/components';
import DetailView from '@/components/commonView/DetailView.vue';
import ChunkCellV2 from '@/components/Layout/ChunkCellV2.vue';
import MateriaDetailDialog from '@/components/commonView/MateriaDetailDialog.vue';
import DeclareEnterpriseTableView from '@/components/commonView/DeclareEnterpriseTableView.vue';
import { useQuery } from '@tanstack/vue-query';
import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
import { convertApi2FormUrlObjectBySeparator, setOSSLink } from '@/utils';
import { useRouteView } from '@/hooks';
import { OrderInputType } from '@bole-core/core';
import { EnterpriseTypeText } from '@/constants';
import { FourStreamsMaterialFileTableItem } from '@/components/commonView/types';
import { useIndustrialParkDropDownList } from '@/hooks/industrialPark';
import { FourStreamsMaterialUtils } from '@/components/commonView/utils';
 
defineOptions({
  name: 'RewardDeclareDetail',
});
 
const route = useRoute();
const { closeViewPush } = useRouteView();
const id = route.params?.id as string;
const form = reactive({
  batchNo: '',
  parkName: '',
  parkTypeName: '',
  applyMonth: '',
  applySumAmount: 0,
  enterpriseTaxSubFileUrl: [] as UploadUserFile[],
  enterpriseOperateFileUrl: [] as UploadUserFile[],
  bountyAssignFileUlr: [] as UploadUserFile[],
  bountyCollectFileUrl: [] as UploadUserFile[],
  enterpriseRelateFileUrl: [] as UploadUserFile[],
});
 
const { data: detail, isLoading } = useQuery({
  queryKey: ['parkBountyApplyServices/getParkBountyApplyDetail', id],
  queryFn: async () => {
    return await parkBountyApplyServices.getParkBountyApplyDetailBaseInfo(
      { parkBountyApplyId: id },
      {
        showLoading: false,
      }
    );
  },
  placeholderData: () => ({} as API.OutCheckParkBountyApplyBaseInfo),
  onSuccess(data) {
    form.batchNo = data.batchNo;
    form.parkName = data.parkName;
    form.parkTypeName = data.parkTypeName;
    form.applyMonth = data.applyMonth;
    form.applySumAmount = data.applySumAmount;
    form.enterpriseTaxSubFileUrl = convertApi2FormUrlObjectBySeparator(
      data?.enterpriseTaxSubFileUrl
    );
    form.enterpriseOperateFileUrl = convertApi2FormUrlObjectBySeparator(
      data?.enterpriseOperateFileUrl
    );
    form.bountyAssignFileUlr = convertApi2FormUrlObjectBySeparator(data?.bountyAssignFileUlr);
    form.bountyCollectFileUrl = convertApi2FormUrlObjectBySeparator(data?.bountyCollectFileUrl);
    form.enterpriseRelateFileUrl = convertApi2FormUrlObjectBySeparator(
      data?.enterpriseRelateFileUrl
    );
 
    getList();
  },
});
 
const {
  getDataSource: getList,
  proTableProps,
  paginationState,
  extraParamState,
  reset,
} = useTable(
  async ({ pageIndex, pageSize }, extraParamState) => {
    try {
      let params: API.GetParkBountyApplyInfoInput = {
        pageModel: {
          rows: pageSize,
          page: pageIndex,
          orderInput: extraParamState.orderInput,
        },
        searchKeyWord: extraParamState.searchKeyWord,
        parkBountyApplyId: id,
      };
      let res = await parkBountyApplyServices.getOutCheckParkBountyApplyDetailList(params);
      return res;
    } catch (error) {}
  },
  {
    defaultExtraParams: {
      orderInput: [{ property: 'parkBountyApplyId', order: OrderInputType.Desc }],
      searchKeyWord: '',
    },
    columnsRenderProps: {
      authType: { type: 'enum', valueEnum: EnterpriseTypeText },
      licenseUrl: {
        type: 'urlV2',
        formatter: (row: API.UserCertificationAuditListDto) => setOSSLink(row.licenseUrl),
      },
    },
  }
);
 
const { dialogProps, handleEdit, editForm } = useFormDialog({
  defaultFormParams: {
    list: [] as FourStreamsMaterialFileTableItem[],
    companyId: '',
  },
});
 
const { getIndustrialParkTypeNameById } = useIndustrialParkDropDownList();
 
function openDialog(row: API.ParkBountyApplyDetailInfo) {
  handleEdit({
    list: FourStreamsMaterialUtils.initFourStreamsMaterialFileList(
      row,
      getIndustrialParkTypeNameById(detail.value?.parkId)
    ),
    companyId: row.enterpriseId,
  });
}
 
function handleBack() {
  closeViewPush(route, {
    name: 'RewardGrant',
  });
}
</script>
 
<style lang="scss" scoped>
@use '@/style/common.scss' as *;
</style>