zhengyiming
5 天以前 60107cb11e472d693de543e8ec422bfe8e31dbec
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
<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>