wupengfei
9 天以前 763bec8077191e42a779e8f77e5126e5dd09b27f
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
<template>
  <LoadingLayout :loading="isLoading">
    <AppContainer>
      <ChunkCell title="待处理">
        <div class="data-board-card-list">
          <DataBoardCard title="待审核批次" :contentBetween="true">
            <DataBoardCardPrice
              :value="detail?.waitCheckEnterpriseNumber ?? 0"
              :isInline="true"
              :useThousand="false"
              unit=""
            />
            <el-button type="primary" link @click="goToAudit">去审核</el-button>
          </DataBoardCard>
          <DataBoardCard title="奖励金待发放" :contentBetween="true">
            <DataBoardCardPrice
              :isInline="true"
              :value="detail?.waitForSettleRewardNumber ?? 0"
              :useThousand="false"
              unit=""
            />
            <el-button type="primary" link @click="goToGrant">去发放</el-button>
          </DataBoardCard>
        </div>
      </ChunkCell>
      <ChunkCell title="数据看板">
        <div class="data-board-card-list">
          <DataBoardCard title="累计已审核企业">
            <DataBoardCardPrice
              :value="detail?.accumulatedCheckEnterpriseNumber ?? 0"
              :useThousand="false"
              unit="家"
            />
          </DataBoardCard>
          <DataBoardCard title="累计已审核通过企业">
            <DataBoardCardPrice
              :value="detail?.accumulatedCheckPassEnterpriseNumber ?? 0"
              :useThousand="false"
              unit="家"
            />
          </DataBoardCard>
          <DataBoardCard title="累计未审核通过企业">
            <DataBoardCardPrice
              :value="detail?.accumulatedCheckRejectEnterpriseNumber ?? 0"
              :useThousand="false"
              unit="家"
            />
          </DataBoardCard>
          <DataBoardCard title="累计已发放">
            <DataBoardCardPrice :value="detail?.accumulatedHasSettleRewardAmount ?? 0" unit="元" />
          </DataBoardCard>
          <DataBoardCard title="累计待发放">
            <DataBoardCardPrice
              :value="detail?.accumulatedWaitForSettleRewardAmount ?? 0"
              unit="元"
            />
          </DataBoardCard>
          <DataBoardCard title="累计已使用">
            <DataBoardCardPrice :value="detail?.accumulatedUsedRewardAmount ?? 0" unit="元" />
          </DataBoardCard>
        </div>
      </ChunkCell>
    </AppContainer>
  </LoadingLayout>
</template>
 
<script setup lang="ts">
import { AppContainer, ChunkCell } from '@bole-core/components';
import DataBoardCard from '@/components/DataBoardCard/DataBoardCard.vue';
import DataBoardCardPrice from '@/components/DataBoardCard/DataBoardCardPrice.vue';
import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
import { useQuery, useQueryClient } from '@tanstack/vue-query';
 
defineOptions({
  name: 'Home',
});
 
const router = useRouter();
 
const { data: detail, isLoading } = useQuery({
  queryKey: ['parkBountyApplyServices/getGoverDataBoard'],
  queryFn: async () => {
    return await parkBountyApplyServices.getGoverDataBoard({
      showLoading: false,
    });
  },
  placeholderData: () => ({} as API.GetGoverDataBoardOutput),
});
 
function goToAudit() {
  router.push({
    name: 'MaterialReviewList',
  });
}
function goToGrant() {
  router.push({
    name: 'RewardGrant',
  });
}
 
const queryClient = useQueryClient();
 
onMounted(async () => {
  await queryClient.ensureQueryData({
    queryKey: ['parkBountyApplyServices/getGoverDataBoard'],
  });
});
</script>
 
<style lang="scss" scoped>
@use '@/style/common.scss' as *;
 
.data-board-card-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 40px;
  padding: 20px;
}
</style>