From c55c548308e6a1adef6670f8acf1ee5f57e77da6 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期六, 28 六月 2025 15:46:25 +0800
Subject: [PATCH] feat: v2.2
---
src/constants/insuranceClaim.ts | 24 +++
src/views/Home/constants/index.ts | 70 ++++++++
src/services/api/typings.d.ts | 42 +++++
src/router/index.ts | 36 ++++
src/views/Home/InsurePayDetail.vue | 62 +++++++
src/views/Home/components/InsureOrderInfoView.vue | 14 +
src/views/Home/InsurancePolicyStampFiles.vue | 58 +++++++
src/hooks/insuranceClaim.ts | 21 ++
src/views/Home/Home.vue | 72 ++++++++
src/services/api/InsuranceOrder.ts | 15 +
src/views/Home/InsureDownloadInvoice.vue | 58 +++++++
11 files changed, 470 insertions(+), 2 deletions(-)
diff --git a/src/constants/insuranceClaim.ts b/src/constants/insuranceClaim.ts
index a5d90ae..f694a89 100644
--- a/src/constants/insuranceClaim.ts
+++ b/src/constants/insuranceClaim.ts
@@ -106,3 +106,27 @@
/**鐢熺厧淇� */
SJB = 'A05C1397S00',
}
+
+export enum InsurancePolicyPayStatusEnum {
+ /**寰呮敮浠� */
+ WaitPay = 1,
+ /**宸叉敮浠� */
+ CompletePay = 2,
+}
+
+export const InsurancePolicyPayStatusEnumText = {
+ [InsurancePolicyPayStatusEnum.WaitPay]: '寰呮敮浠�',
+ [InsurancePolicyPayStatusEnum.CompletePay]: '宸叉敮浠�',
+};
+
+export enum InsurancePolicyListPayStatusEnum {
+ /**寰呮敮浠� */
+ WaitPay = 1,
+ /**宸叉敮浠� */
+ CompletePay = 2,
+}
+
+export const InsurancePolicyListPayStatusEnumText = {
+ [InsurancePolicyListPayStatusEnum.WaitPay]: '寰呮敮浠�',
+ [InsurancePolicyListPayStatusEnum.CompletePay]: '宸叉敮浠�',
+};
diff --git a/src/hooks/insuranceClaim.ts b/src/hooks/insuranceClaim.ts
index 1f0aaef..836852b 100644
--- a/src/hooks/insuranceClaim.ts
+++ b/src/hooks/insuranceClaim.ts
@@ -29,3 +29,24 @@
refetch,
};
}
+
+type UseInsurancePolicyPayOptions = {
+ id: MaybeRef<string>;
+};
+
+export function useInsurancePolicyPay({ id }: UseInsurancePolicyPayOptions) {
+ const { data: insurancePolicyPayList, isLoading } = useQuery({
+ queryKey: ['insuranceOrderServices/getInsurancePolicyPay', id],
+ queryFn: async () => {
+ return await insuranceOrderServices.getInsurancePolicyPay({
+ id: unref(id),
+ });
+ },
+ placeholderData: () => [] as API.InsurancePolicyPayDto[],
+ });
+
+ return {
+ insurancePolicyPayList,
+ isLoading,
+ };
+}
diff --git a/src/router/index.ts b/src/router/index.ts
index 6f35405..f283d1a 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -109,6 +109,42 @@
},
},
{
+ path: '/InsurancePolicyStampFiles/:id',
+ name: 'InsurancePolicyStampFiles',
+ hidden: true,
+ component: () => import('@/views/Home/InsurancePolicyStampFiles.vue'),
+ meta: {
+ rank: 10003,
+ title: '淇濆崟涓嬭浇',
+ // rootMenu: true,
+ icon: 'home',
+ },
+ },
+ {
+ path: '/InsureDownloadInvoice/:id',
+ name: 'InsureDownloadInvoice',
+ hidden: true,
+ component: () => import('@/views/Home/InsureDownloadInvoice.vue'),
+ meta: {
+ rank: 10004,
+ title: '鍙戠エ涓嬭浇',
+ // rootMenu: true,
+ icon: 'home',
+ },
+ },
+ {
+ path: '/InsurePayDetail/:id',
+ name: 'InsurePayDetail',
+ hidden: true,
+ component: () => import('@/views/Home/InsurePayDetail.vue'),
+ meta: {
+ rank: 10005,
+ title: '鏀粯璇︽儏',
+ // rootMenu: true,
+ icon: 'home',
+ },
+ },
+ {
path: '/BatchChange/:id',
name: 'BatchChange',
hidden: true,
diff --git a/src/services/api/InsuranceOrder.ts b/src/services/api/InsuranceOrder.ts
index f9dd132..9fcaae5 100644
--- a/src/services/api/InsuranceOrder.ts
+++ b/src/services/api/InsuranceOrder.ts
@@ -274,6 +274,21 @@
});
}
+/** 鑾峰彇淇濆崟鏀粯淇℃伅 GET /api/InsuranceOrder/GetInsurancePolicyPay */
+export async function getInsurancePolicyPay(
+ // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄)
+ params: API.APIgetInsurancePolicyPayParams,
+ options?: API.RequestConfig
+) {
+ return request<API.InsurancePolicyPayDto[]>('/api/InsuranceOrder/GetInsurancePolicyPay', {
+ method: 'GET',
+ params: {
+ ...params,
+ },
+ ...(options || {}),
+ });
+}
+
/** 鑾峰彇鐩栫珷鏂囦欢 GET /api/InsuranceOrder/GetInsurancePolicyStampFiles */
export async function getInsurancePolicyStampFiles(
// 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄)
diff --git a/src/services/api/typings.d.ts b/src/services/api/typings.d.ts
index d901aec..b9fa5c0 100644
--- a/src/services/api/typings.d.ts
+++ b/src/services/api/typings.d.ts
@@ -274,6 +274,10 @@
id?: string;
}
+ interface APIgetInsurancePolicyPayParams {
+ id?: string;
+ }
+
interface APIgetInsurancePolicyStampFilesParams {
id?: string;
}
@@ -925,6 +929,9 @@
productIdNumber?: string;
/** 鏄惁璧扮嚎涓婃祦绋� */
productOnline?: boolean;
+ payStatus?: InsurancePolicyListPayStatusEnum;
+ /** 浠绘剰鍒嗘壒鏀粯瀹屾垚 */
+ anyPayComplete?: boolean;
}
interface GetInsurancePageOutputPageOutput {
@@ -1517,6 +1524,41 @@
type InsurancePolicyAuditStatusEnum = 10 | 20 | -10;
+ type InsurancePolicyListPayStatusEnum = 1 | 2;
+
+ interface InsurancePolicyPayDto {
+ id?: string;
+ /** 璁㈠崟鍙� */
+ channelOrderNo?: string;
+ /** 鎶曚繚鍗曞彿 */
+ proposalNo?: string;
+ /** 鏀粯鐭摼 */
+ payUrl?: string;
+ /** 鏀粯娴佹按鍙� */
+ payRegistrationNo?: string;
+ /** 淇濊垂閲戦 */
+ sumSignPremium?: number;
+ status?: InsurancePolicyPayStatusEnum;
+ /** 淇濆崟鍙� */
+ policyNo?: string;
+ /** 鐢靛瓙淇濆崟閾炬帴 */
+ policyUrl?: string;
+ /** 鐢靛瓙淇濆崟閾炬帴 */
+ policyOssUrl?: string;
+ /** 瀹屾垚鏃堕棿 */
+ completionTime?: string;
+ /** 鍙戠エ鍙风爜 */
+ invoiceSerialNo?: string;
+ /** 鍙戠エ浠风◣鍚堣 */
+ invoicePlanFee?: number;
+ /** 鍙戠エ涓嬭浇鍦板潃 */
+ invoiceDownloadUrl?: string;
+ /** 鍙戠エ涓嬭浇鍦板潃 */
+ invoiceDownloadOssUrl?: string;
+ }
+
+ type InsurancePolicyPayStatusEnum = 1 | 2;
+
type InsurancePolicyStatusEnum = 10 | 20 | 30;
interface InsureBatchBillDetailDto {
diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue
index b78a7ca..81a68ce 100644
--- a/src/views/Home/Home.vue
+++ b/src/views/Home/Home.vue
@@ -139,6 +139,8 @@
InsurancePolicyAuditStatusEnumText,
InsurancePolicyAuditStatusEnum,
InsurancePolicyProductIdNumberEnum,
+ InsurancePolicyListPayStatusEnum,
+ InsurancePolicyListPayStatusEnumText,
} from '@/constants';
import dayjs from 'dayjs';
import _ from 'lodash';
@@ -193,9 +195,47 @@
onClick: (role) => handleDownloadInsureFile(role),
},
extraProps: {
- hide: (row: API.GetInsurancePageOutput) => !row.insureBillUrl,
+ hide: (row: API.GetInsurancePageOutput) => row.productOnline || !row.insureBillUrl,
},
},
+ {
+ data: {
+ enCode: 'payBtn',
+ name: '鏀粯',
+ },
+ emits: {
+ onClick: (role) => handlePay(role),
+ },
+ extraProps: {
+ hide: (row: API.GetInsurancePageOutput) =>
+ row.payStatus != InsurancePolicyListPayStatusEnum.WaitPay,
+ },
+ },
+ {
+ data: {
+ enCode: 'stampFilesBtn',
+ name: '淇濆崟涓嬭浇',
+ },
+ emits: {
+ onClick: (role) => handleGoStampFiles(role),
+ },
+ extraProps: {
+ hide: (row: API.GetInsurancePageOutput) => !(row.productOnline && row.anyPayComplete),
+ },
+ },
+ {
+ data: {
+ enCode: 'downloadInvoiceBtn',
+ name: '鍙戠エ涓嬭浇',
+ },
+ emits: {
+ onClick: (role) => handleGoDownloadInvoice(role),
+ },
+ extraProps: {
+ hide: (row: API.GetInsurancePageOutput) => !(row.productOnline && row.anyPayComplete),
+ },
+ },
+
// {
// data: {
// enCode: 'standarEndoBtn',
@@ -259,6 +299,7 @@
formatter: (row: API.GetInsurancePageOutput) =>
row.amount == null ? '' : toThousand(row.amount),
},
+ payStatus: { type: 'enum', valueEnum: InsurancePolicyListPayStatusEnumText },
},
}
);
@@ -488,4 +529,33 @@
// }
} catch (error) {}
}
+
+async function handleGoStampFiles(row: API.GetInsurancePageOutput) {
+ try {
+ router.push({
+ name: 'InsurancePolicyStampFiles',
+ params: {
+ id: row.id,
+ },
+ });
+ } catch (error) {}
+}
+
+function handlePay(row: API.GetInsurancePageOutput) {
+ router.push({
+ name: 'InsurePayDetail',
+ params: {
+ id: row.id,
+ },
+ });
+}
+
+function handleGoDownloadInvoice(row: API.GetInsurancePageOutput) {
+ router.push({
+ name: 'InsureDownloadInvoice',
+ params: {
+ id: row.id,
+ },
+ });
+}
</script>
diff --git a/src/views/Home/InsurancePolicyStampFiles.vue b/src/views/Home/InsurancePolicyStampFiles.vue
new file mode 100644
index 0000000..c0aa1e1
--- /dev/null
+++ b/src/views/Home/InsurancePolicyStampFiles.vue
@@ -0,0 +1,58 @@
+<template>
+ <LoadingLayout :loading="isLoading">
+ <AppContainer>
+ <ProTableV2
+ :columns="InsurancePolicyStampFilesColumns"
+ :operationBtns="operationBtns"
+ :tableData="insurancePolicyPayList"
+ :columnRenderMap="InsurancePolicyPayRenderProps"
+ >
+ </ProTableV2>
+ </AppContainer>
+ </LoadingLayout>
+</template>
+
+<script setup lang="ts">
+import {
+ OperationBtnType,
+ ProTableV2,
+ LoadingLayout,
+ AppContainer,
+ useTable,
+ ProTableV2Props,
+ defineOperationBtns,
+} from '@bole-core/components';
+import { useAccess, useInsurancePolicyPay } from '@/hooks';
+import { paginateList, downloadFileByUrl, setOSSLink, downloadFile } from '@/utils';
+import { InsurancePolicyStampFilesColumns } from './constants';
+
+defineOptions({
+ name: 'InsurancePolicyStampFiles',
+});
+
+const operationBtns = defineOperationBtns([
+ {
+ data: {
+ enCode: 'downloadBtn',
+ name: '涓嬭浇',
+ },
+ emits: { onClick: (role) => handleDownload(role) },
+ extraProps: {
+ hide: (row: API.InsurancePolicyPayDto) => !row.policyOssUrl,
+ },
+ },
+]);
+
+const route = useRoute();
+const id = route.params.id as string;
+
+const { insurancePolicyPayList, isLoading } = useInsurancePolicyPay({ id: id });
+
+const InsurancePolicyPayRenderProps: ProTableV2Props['columnRenderMap'] = {
+ sumSignPremium: { type: 'money' },
+};
+
+function handleDownload(row: API.InsurancePolicyPayDto) {
+ downloadFileByUrl(setOSSLink(row.policyOssUrl), `淇濆崟_${row.channelOrderNo}`);
+}
+</script>
diff --git a/src/views/Home/InsureDownloadInvoice.vue b/src/views/Home/InsureDownloadInvoice.vue
new file mode 100644
index 0000000..b639765
--- /dev/null
+++ b/src/views/Home/InsureDownloadInvoice.vue
@@ -0,0 +1,58 @@
+<template>
+ <LoadingLayout :loading="isLoading">
+ <AppContainer>
+ <ProTableV2
+ :columns="InsureDownloadInvoiceColumns"
+ :operationBtns="operationBtns"
+ :tableData="insurancePolicyPayList"
+ :columnRenderMap="InsurancePolicyPayRenderProps"
+ >
+ </ProTableV2>
+ </AppContainer>
+ </LoadingLayout>
+</template>
+
+<script setup lang="ts">
+import {
+ OperationBtnType,
+ ProTableV2,
+ LoadingLayout,
+ AppContainer,
+ useTable,
+ ProTableV2Props,
+ defineOperationBtns,
+} from '@bole-core/components';
+import { useAccess, useInsurancePolicyPay } from '@/hooks';
+import { downloadFileByUrl, setOSSLink } from '@/utils';
+import { InsureDownloadInvoiceColumns } from './constants';
+
+defineOptions({
+ name: 'InsureDownloadInvoice',
+});
+
+const operationBtns = defineOperationBtns([
+ {
+ data: {
+ enCode: 'downloadBtn',
+ name: '涓嬭浇',
+ },
+ emits: { onClick: (role) => handleDownload(role) },
+ extraProps: {
+ hide: (row: API.InsurancePolicyPayDto) => !row.invoiceDownloadOssUrl,
+ },
+ },
+]);
+
+const route = useRoute();
+const id = route.params.id as string;
+
+const { insurancePolicyPayList, isLoading } = useInsurancePolicyPay({ id: id });
+
+const InsurancePolicyPayRenderProps: ProTableV2Props['columnRenderMap'] = {
+ invoicePlanFee: { type: 'money' },
+};
+
+function handleDownload(row: API.InsurancePolicyPayDto) {
+ downloadFileByUrl(setOSSLink(row.invoiceDownloadOssUrl));
+}
+</script>
diff --git a/src/views/Home/InsurePayDetail.vue b/src/views/Home/InsurePayDetail.vue
new file mode 100644
index 0000000..9fe65dd
--- /dev/null
+++ b/src/views/Home/InsurePayDetail.vue
@@ -0,0 +1,62 @@
+<template>
+ <LoadingLayout :loading="isLoading">
+ <AppContainer>
+ <ProTableV2
+ :columns="InsurePayDetailColumns"
+ :operationBtns="operationBtns"
+ :showPagination="false"
+ :tableData="insurancePolicyPayList"
+ :columnRenderMap="InsurancePolicyPayRenderProps"
+ >
+ </ProTableV2>
+ </AppContainer>
+ </LoadingLayout>
+</template>
+
+<script setup lang="ts">
+import {
+ OperationBtnType,
+ ProTableV2,
+ LoadingLayout,
+ AppContainer,
+ useTable,
+ ProTableV2Props,
+ defineOperationBtns,
+} from '@bole-core/components';
+import { useAccess, useInsurancePolicyPay } from '@/hooks';
+import * as insuranceOrderServices from '@/services/api/InsuranceOrder';
+import { InsurancePolicyPayStatusEnumText, InsurancePolicyPayStatusEnum } from '@/constants';
+import { useQuery } from '@tanstack/vue-query';
+import { InsurePayDetailColumns } from './constants';
+
+defineOptions({
+ name: 'InsurePayDetail',
+});
+
+const operationBtns = defineOperationBtns([
+ {
+ data: {
+ enCode: 'payBtn',
+ name: '鏀粯',
+ },
+ emits: { onClick: (role) => handlePay(role) },
+ extraProps: {
+ hide: (row: API.InsurancePolicyPayDto) => row.status !== InsurancePolicyPayStatusEnum.WaitPay,
+ },
+ },
+]);
+
+const route = useRoute();
+const id = route.params.id as string;
+
+const { insurancePolicyPayList, isLoading } = useInsurancePolicyPay({ id: id });
+
+const InsurancePolicyPayRenderProps: ProTableV2Props['columnRenderMap'] = {
+ sumSignPremium: { type: 'money' },
+ status: { type: 'enum', valueEnum: InsurancePolicyPayStatusEnumText },
+};
+
+function handlePay(row: API.InsurancePolicyPayDto) {
+ window.open(row.payUrl, '_blank');
+}
+</script>
diff --git a/src/views/Home/components/InsureOrderInfoView.vue b/src/views/Home/components/InsureOrderInfoView.vue
index b05a03e..6451e8b 100644
--- a/src/views/Home/components/InsureOrderInfoView.vue
+++ b/src/views/Home/components/InsureOrderInfoView.vue
@@ -101,7 +101,10 @@
</template>
<template v-else>
<el-button @click="handleDownloadPerson()" type="primary">涓嬭浇浜哄憳娓呭崟</el-button>
- <el-button @click="handleDownloadOrder()" type="primary">涓嬭浇淇濆崟</el-button>
+ <el-button v-if="detail.productOnline" @click="handleGoStampFiles()" type="primary"
+ >涓嬭浇淇濆崟</el-button
+ >
+ <el-button v-else @click="handleDownloadOrder()" type="primary">涓嬭浇淇濆崟</el-button>
</template>
</template>
</ProTableQueryFilterBar>
@@ -397,6 +400,15 @@
downloadFileByUrl(setOSSLink(detail.value?.insureBillUrl));
}
+function handleGoStampFiles() {
+ router.push({
+ name: 'InsurancePolicyStampFiles',
+ params: {
+ id: id,
+ },
+ });
+}
+
function handleBatchChange() {
if (
dayjs(detail.value?.effectEndTime).isBefore(dayjs()) ||
diff --git a/src/views/Home/constants/index.ts b/src/views/Home/constants/index.ts
index 86c9edb..9582a45 100644
--- a/src/views/Home/constants/index.ts
+++ b/src/views/Home/constants/index.ts
@@ -86,6 +86,12 @@
width: 160,
},
{
+ id: '141',
+ enCode: 'payStatus',
+ name: '鏀粯鐘舵��',
+ width: 160,
+ },
+ {
id: '15',
enCode: 'status',
name: '鎶曚繚鐘舵��',
@@ -98,3 +104,67 @@
width: 160,
},
]).filter(Boolean);
+
+export const InsurancePolicyStampFilesColumns = defineColumns([
+ {
+ id: '1',
+ enCode: 'channelOrderNo',
+ name: '璁㈠崟鍙�',
+ },
+ {
+ id: '2',
+ enCode: 'proposalNo',
+ name: '鎶曚繚鍗曞彿',
+ },
+ {
+ id: '3',
+ enCode: 'sumSignPremium',
+ name: '淇濊垂閲戦',
+ },
+]);
+
+export const InsureDownloadInvoiceColumns = defineColumns([
+ {
+ id: '1',
+ enCode: 'channelOrderNo',
+ name: '璁㈠崟鍙�',
+ },
+ {
+ id: '2',
+ enCode: 'proposalNo',
+ name: '鎶曚繚鍗曞彿',
+ },
+ {
+ id: '3',
+ enCode: 'invoiceSerialNo',
+ name: '鍙戠エ鍙风爜',
+ },
+ {
+ id: '4',
+ enCode: 'invoicePlanFee',
+ name: '浠风◣鍚堣',
+ },
+]);
+
+export const InsurePayDetailColumns = defineColumns([
+ {
+ id: '1',
+ enCode: 'channelOrderNo',
+ name: '璁㈠崟鍙�',
+ },
+ {
+ id: '2',
+ enCode: 'proposalNo',
+ name: '鎶曚繚鍗曞彿',
+ },
+ {
+ id: '3',
+ enCode: 'sumSignPremium',
+ name: '淇濊垂閲戦',
+ },
+ {
+ id: '4',
+ enCode: 'status',
+ name: '鏀粯鐘舵��',
+ },
+]);
--
Gitblit v1.9.1