zhengyiming
5 天以前 368c72d678ec6a1f5b60f109911d190e9c2a2809
src/views/MaterialReview/MaterialReviewAudit.vue
@@ -1,13 +1,50 @@
<template>
  <div>MaterialReviewAudit</div>
  <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',
});
</script>
<style lang="scss" scoped>
@use '@/style/common.scss' as *;
</style>
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>