<template>
|
<MaterialReviewAuditView :confirm="confirm"></MaterialReviewAuditView>
|
</template>
|
|
<script setup lang="ts">
|
import { useQuery, useQueryClient } from '@tanstack/vue-query';
|
import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
|
import { useGlobalEventContext, useRouteView } from '@/hooks';
|
import { Message } from '@bole-core/core';
|
import { EnterpriseApplyFileUtils } from '@/components/commonView/utils';
|
import MaterialReviewAuditView from './components/MaterialReviewAuditView.vue';
|
import { Form } from './components/materialReviewAudit';
|
|
defineOptions({
|
name: 'MaterialReviewAudit',
|
});
|
|
const route = useRoute();
|
const eventContext = useGlobalEventContext();
|
const { closeViewPush } = useRouteView();
|
const id = route.params?.id as string;
|
|
function handleBack() {
|
closeViewPush(route, {
|
name: 'MaterialReviewList',
|
});
|
}
|
|
const queryClient = useQueryClient();
|
|
async function confirm(form: Form) {
|
try {
|
let params: API.OutcheckParkBountyApplyInput = {
|
parkBountyApplyId: id,
|
outCheckStatus: form.status,
|
remark: form.remark,
|
extraListFiles: EnterpriseApplyFileUtils.convertFileTableListToApiBatch(form.extraListFiles),
|
};
|
let res = await parkBountyApplyServices.outcheckParkBountyApply(params);
|
if (res) {
|
Message.successMessage('操作成功');
|
eventContext.emit('materialReviewAudit:audit');
|
queryClient.invalidateQueries({
|
queryKey: ['parkBountyApplyServices/getGoverDataBoard'],
|
});
|
handleBack();
|
}
|
} catch (error) {}
|
}
|
</script>
|