<!-- 顶部状态栏 -->
This commit is contained in:
872
src/api/insurance.ts
Normal file
872
src/api/insurance.ts
Normal file
@@ -0,0 +1,872 @@
|
||||
/**
|
||||
* 保险相关 API 接口
|
||||
*/
|
||||
import type {
|
||||
BankLoanWithInsurance,
|
||||
ClaimApplication,
|
||||
ClaimReviewRequest,
|
||||
CreateClaimApplicationRequest,
|
||||
CreateInsuranceApplicationRequest,
|
||||
InsuranceApplication,
|
||||
InsuranceCompany,
|
||||
InsurancePolicy,
|
||||
InsuranceProduct,
|
||||
UnderwritingReviewRequest,
|
||||
} from '@/api/types/insurance'
|
||||
|
||||
// Mock 数据存储
|
||||
const mockInsuranceCompanies: InsuranceCompany[] = [
|
||||
{
|
||||
id: 'IC001',
|
||||
name: '中国人民财产保险股份有限公司',
|
||||
contactInfo: '400-1234567',
|
||||
status: 'active',
|
||||
},
|
||||
{
|
||||
id: 'IC002',
|
||||
name: '中国平安财产保险股份有限公司',
|
||||
contactInfo: '400-7654321',
|
||||
status: 'active',
|
||||
},
|
||||
{
|
||||
id: 'IC003',
|
||||
name: '中国太平洋财产保险股份有限公司',
|
||||
contactInfo: '400-9876543',
|
||||
status: 'active',
|
||||
},
|
||||
]
|
||||
|
||||
const mockInsuranceProducts: InsuranceProduct[] = [
|
||||
{
|
||||
id: 'IP001',
|
||||
companyId: 'IC001',
|
||||
companyName: '中国人民财产保险股份有限公司',
|
||||
name: '个人住房贷款保险',
|
||||
type: 'housing_loan',
|
||||
description: '为个人住房贷款提供保险保障,保障贷款人因意外事故导致的还款能力丧失',
|
||||
minAmount: 100000,
|
||||
maxAmount: 5000000,
|
||||
status: 'active',
|
||||
},
|
||||
{
|
||||
id: 'IP002',
|
||||
companyId: 'IC001',
|
||||
companyName: '中国人民财产保险股份有限公司',
|
||||
name: '企业信贷履约保证保险',
|
||||
type: 'business_credit',
|
||||
description: '为企业信贷提供履约保证,降低银行信贷风险',
|
||||
minAmount: 50000,
|
||||
maxAmount: 10000000,
|
||||
status: 'active',
|
||||
},
|
||||
{
|
||||
id: 'IP003',
|
||||
companyId: 'IC002',
|
||||
companyName: '中国平安财产保险股份有限公司',
|
||||
name: '小微企业贷款保证保险',
|
||||
type: 'business_credit',
|
||||
description: '为小微企业贷款提供保证保险,支持小微企业发展',
|
||||
minAmount: 30000,
|
||||
maxAmount: 5000000,
|
||||
status: 'active',
|
||||
},
|
||||
{
|
||||
id: 'IP004',
|
||||
companyId: 'IC003',
|
||||
companyName: '中国太平洋财产保险股份有限公司',
|
||||
name: '个人消费贷款保险',
|
||||
type: 'other',
|
||||
description: '为个人消费贷款提供保险保障',
|
||||
minAmount: 20000,
|
||||
maxAmount: 2000000,
|
||||
status: 'active',
|
||||
},
|
||||
]
|
||||
|
||||
const mockInsuranceApplications: InsuranceApplication[] = [
|
||||
{
|
||||
id: 'IA20250112001',
|
||||
loanId: 'LA20251226001',
|
||||
bankId: 'B001',
|
||||
bankName: '中国工商银行',
|
||||
companyId: 'IC001',
|
||||
companyName: '中国人民财产保险股份有限公司',
|
||||
productId: 'IP001',
|
||||
productName: '个人住房贷款保险',
|
||||
customerInfo: {
|
||||
name: '张三',
|
||||
idNumber: '440106199001011234',
|
||||
creditScore: 750,
|
||||
loanAmount: 500000,
|
||||
loanTerm: 120,
|
||||
loanType: 'housing_loan',
|
||||
},
|
||||
insuranceAmount: 500000,
|
||||
insuranceTerm: 120,
|
||||
status: 'pending',
|
||||
createdAt: '2025-01-10 14:30:00',
|
||||
},
|
||||
{
|
||||
id: 'IA20250111001',
|
||||
loanId: 'LA20251226002',
|
||||
bankId: 'B001',
|
||||
bankName: '中国工商银行',
|
||||
companyId: 'IC002',
|
||||
companyName: '中国平安财产保险股份有限公司',
|
||||
productId: 'IP003',
|
||||
productName: '小微企业贷款保证保险',
|
||||
customerInfo: {
|
||||
name: '李四',
|
||||
idNumber: '440106199202025678',
|
||||
creditScore: 720,
|
||||
loanAmount: 800000,
|
||||
loanTerm: 180,
|
||||
loanType: 'business_credit',
|
||||
},
|
||||
insuranceAmount: 800000,
|
||||
insuranceTerm: 180,
|
||||
status: 'approved',
|
||||
createdAt: '2025-01-09 10:15:00',
|
||||
reviewedAt: '2025-01-10 16:20:00',
|
||||
reviewedBy: '核保员001',
|
||||
},
|
||||
{
|
||||
id: 'IA20250110001',
|
||||
loanId: 'LA20251226003',
|
||||
bankId: 'B002',
|
||||
bankName: '中国建设银行',
|
||||
companyId: 'IC003',
|
||||
companyName: '中国太平洋财产保险股份有限公司',
|
||||
productId: 'IP004',
|
||||
productName: '个人消费贷款保险',
|
||||
customerInfo: {
|
||||
name: '王五',
|
||||
idNumber: '440106198803034567',
|
||||
creditScore: 680,
|
||||
loanAmount: 300000,
|
||||
loanTerm: 90,
|
||||
loanType: 'other',
|
||||
},
|
||||
insuranceAmount: 300000,
|
||||
insuranceTerm: 90,
|
||||
status: 'rejected',
|
||||
createdAt: '2025-01-08 09:45:00',
|
||||
reviewedAt: '2025-01-09 11:30:00',
|
||||
reviewedBy: '核保员002',
|
||||
rejectionReason: '客户信用评分低于产品要求最低值700分',
|
||||
},
|
||||
{
|
||||
id: 'IA20250109001',
|
||||
loanId: 'LA20251226004',
|
||||
bankId: 'B001',
|
||||
bankName: '中国工商银行',
|
||||
companyId: 'IC001',
|
||||
companyName: '中国人民财产保险股份有限公司',
|
||||
productId: 'IP002',
|
||||
productName: '企业信贷履约保证保险',
|
||||
customerInfo: {
|
||||
name: '赵六',
|
||||
idNumber: '440106199504045678',
|
||||
creditScore: 780,
|
||||
loanAmount: 600000,
|
||||
loanTerm: 120,
|
||||
loanType: 'business_credit',
|
||||
},
|
||||
insuranceAmount: 600000,
|
||||
insuranceTerm: 120,
|
||||
status: 'pending',
|
||||
createdAt: '2025-01-07 15:20:00',
|
||||
},
|
||||
]
|
||||
|
||||
const mockInsurancePolicies: InsurancePolicy[] = [
|
||||
{
|
||||
id: 'IP20250111001',
|
||||
applicationId: 'IA20250111001',
|
||||
policyNumber: 'POL20250111001',
|
||||
companyId: 'IC002',
|
||||
companyName: '中国平安财产保险股份有限公司',
|
||||
bankId: 'B001',
|
||||
bankName: '中国工商银行',
|
||||
loanId: 'LA20251226002',
|
||||
productId: 'IP003',
|
||||
productName: '小微企业贷款保证保险',
|
||||
insuranceAmount: 800000,
|
||||
insuranceTerm: 180,
|
||||
startDate: '2025-01-10 16:20:00',
|
||||
endDate: '2026-07-09 16:20:00',
|
||||
status: 'active',
|
||||
issuedAt: '2025-01-10 16:20:00',
|
||||
},
|
||||
{
|
||||
id: 'IP20241220001',
|
||||
applicationId: 'IA20241220001',
|
||||
policyNumber: 'POL20241220001',
|
||||
companyId: 'IC001',
|
||||
companyName: '中国人民财产保险股份有限公司',
|
||||
bankId: 'B002',
|
||||
bankName: '中国建设银行',
|
||||
loanId: 'LA20241220001',
|
||||
productId: 'IP001',
|
||||
productName: '个人住房贷款保险',
|
||||
insuranceAmount: 500000,
|
||||
insuranceTerm: 120,
|
||||
startDate: '2024-12-20 10:30:00',
|
||||
endDate: '2025-12-20 10:30:00',
|
||||
status: 'active',
|
||||
issuedAt: '2024-12-20 10:30:00',
|
||||
},
|
||||
{
|
||||
id: 'IP20241115002',
|
||||
applicationId: 'IA20241115002',
|
||||
policyNumber: 'POL20241115002',
|
||||
companyId: 'IC003',
|
||||
companyName: '中国太平洋财产保险股份有限公司',
|
||||
bankId: 'B003',
|
||||
bankName: '中国农业银行',
|
||||
loanId: 'LA20241115002',
|
||||
productId: 'IP004',
|
||||
productName: '个人消费贷款保险',
|
||||
insuranceAmount: 300000,
|
||||
insuranceTerm: 90,
|
||||
startDate: '2024-11-15 14:45:00',
|
||||
endDate: '2025-02-15 14:45:00',
|
||||
status: 'active',
|
||||
issuedAt: '2024-11-15 14:45:00',
|
||||
},
|
||||
{
|
||||
id: 'IP20241010003',
|
||||
applicationId: 'IA20241010003',
|
||||
policyNumber: 'POL20241010003',
|
||||
companyId: 'IC001',
|
||||
companyName: '中国人民财产保险股份有限公司',
|
||||
bankId: 'B004',
|
||||
bankName: '中国银行',
|
||||
loanId: 'LA20241010003',
|
||||
productId: 'IP002',
|
||||
productName: '企业信贷履约保证保险',
|
||||
insuranceAmount: 1000000,
|
||||
insuranceTerm: 240,
|
||||
startDate: '2024-10-10 09:00:00',
|
||||
endDate: '2026-10-10 09:00:00',
|
||||
status: 'active',
|
||||
issuedAt: '2024-10-10 09:00:00',
|
||||
},
|
||||
{
|
||||
id: 'IP20240905004',
|
||||
applicationId: 'IA20240905004',
|
||||
policyNumber: 'POL20240905004',
|
||||
companyId: 'IC002',
|
||||
companyName: '中国平安财产保险股份有限公司',
|
||||
bankId: 'B001',
|
||||
bankName: '中国工商银行',
|
||||
loanId: 'LA20240905004',
|
||||
productId: 'IP003',
|
||||
productName: '小微企业贷款保证保险',
|
||||
insuranceAmount: 450000,
|
||||
insuranceTerm: 120,
|
||||
startDate: '2024-09-05 16:20:00',
|
||||
endDate: '2025-09-05 16:20:00',
|
||||
status: 'expiring',
|
||||
issuedAt: '2024-09-05 16:20:00',
|
||||
},
|
||||
{
|
||||
id: 'IP20240805005',
|
||||
applicationId: 'IA20240805005',
|
||||
policyNumber: 'POL20240805005',
|
||||
companyId: 'IC003',
|
||||
companyName: '中国太平洋财产保险股份有限公司',
|
||||
bankId: 'B002',
|
||||
bankName: '中国建设银行',
|
||||
loanId: 'LA20240805005',
|
||||
productId: 'IP004',
|
||||
productName: '个人消费贷款保险',
|
||||
insuranceAmount: 200000,
|
||||
insuranceTerm: 60,
|
||||
startDate: '2024-08-05 11:30:00',
|
||||
endDate: '2025-02-05 11:30:00',
|
||||
status: 'expiring',
|
||||
issuedAt: '2024-08-05 11:30:00',
|
||||
},
|
||||
{
|
||||
id: 'IP20240701006',
|
||||
applicationId: 'IA20240701006',
|
||||
policyNumber: 'POL20240701006',
|
||||
companyId: 'IC001',
|
||||
companyName: '中国人民财产保险股份有限公司',
|
||||
bankId: 'B003',
|
||||
bankName: '中国农业银行',
|
||||
loanId: 'LA20240701006',
|
||||
productId: 'IP001',
|
||||
productName: '个人住房贷款保险',
|
||||
insuranceAmount: 350000,
|
||||
insuranceTerm: 180,
|
||||
startDate: '2024-07-01 08:00:00',
|
||||
endDate: '2025-07-01 08:00:00',
|
||||
status: 'expiring',
|
||||
issuedAt: '2024-07-01 08:00:00',
|
||||
},
|
||||
{
|
||||
id: 'IP20240602007',
|
||||
applicationId: 'IA20240602007',
|
||||
policyNumber: 'POL20240602007',
|
||||
companyId: 'IC002',
|
||||
companyName: '中国平安财产保险股份有限公司',
|
||||
bankId: 'B004',
|
||||
bankName: '中国银行',
|
||||
loanId: 'LA20240602007',
|
||||
productId: 'IP003',
|
||||
productName: '小微企业贷款保证保险',
|
||||
insuranceAmount: 600000,
|
||||
insuranceTerm: 150,
|
||||
startDate: '2024-06-02 13:15:00',
|
||||
endDate: '2024-12-02 13:15:00',
|
||||
status: 'expired',
|
||||
issuedAt: '2024-06-02 13:15:00',
|
||||
},
|
||||
{
|
||||
id: 'IP20240503008',
|
||||
applicationId: 'IA20240503008',
|
||||
policyNumber: 'POL20240503008',
|
||||
companyId: 'IC003',
|
||||
companyName: '中国太平洋财产保险股份有限公司',
|
||||
bankId: 'B001',
|
||||
bankName: '中国工商银行',
|
||||
loanId: 'LA20240503008',
|
||||
productId: 'IP004',
|
||||
productName: '个人消费贷款保险',
|
||||
insuranceAmount: 150000,
|
||||
insuranceTerm: 90,
|
||||
startDate: '2024-05-03 10:45:00',
|
||||
endDate: '2024-08-03 10:45:00',
|
||||
status: 'expired',
|
||||
issuedAt: '2024-05-03 10:45:00',
|
||||
},
|
||||
{
|
||||
id: 'IP20240404009',
|
||||
applicationId: 'IA20240404009',
|
||||
policyNumber: 'POL20240404009',
|
||||
companyId: 'IC001',
|
||||
companyName: '中国人民财产保险股份有限公司',
|
||||
bankId: 'B002',
|
||||
bankName: '中国建设银行',
|
||||
loanId: 'LA20240404009',
|
||||
productId: 'IP002',
|
||||
productName: '企业信贷履约保证保险',
|
||||
insuranceAmount: 750000,
|
||||
insuranceTerm: 200,
|
||||
startDate: '2024-04-04 15:30:00',
|
||||
endDate: '2024-10-04 15:30:00',
|
||||
status: 'expired',
|
||||
issuedAt: '2024-04-04 15:30:00',
|
||||
},
|
||||
{
|
||||
id: 'IP20240305010',
|
||||
applicationId: 'IA20240305010',
|
||||
policyNumber: 'POL20240305010',
|
||||
companyId: 'IC002',
|
||||
companyName: '中国平安财产保险股份有限公司',
|
||||
bankId: 'B003',
|
||||
bankName: '中国农业银行',
|
||||
loanId: 'LA20240305010',
|
||||
productId: 'IP003',
|
||||
productName: '小微企业贷款保证保险',
|
||||
insuranceAmount: 900000,
|
||||
insuranceTerm: 180,
|
||||
startDate: '2024-03-05 09:20:00',
|
||||
endDate: '2025-03-05 09:20:00',
|
||||
status: 'active',
|
||||
issuedAt: '2024-03-05 09:20:00',
|
||||
},
|
||||
{
|
||||
id: 'IP20240206011',
|
||||
applicationId: 'IA20240206011',
|
||||
policyNumber: 'POL20240206011',
|
||||
companyId: 'IC003',
|
||||
companyName: '中国太平洋财产保险股份有限公司',
|
||||
bankId: 'B004',
|
||||
bankName: '中国银行',
|
||||
loanId: 'LA20240206011',
|
||||
productId: 'IP004',
|
||||
productName: '个人消费贷款保险',
|
||||
insuranceAmount: 250000,
|
||||
insuranceTerm: 120,
|
||||
startDate: '2024-02-06 14:10:00',
|
||||
endDate: '2025-02-06 14:10:00',
|
||||
status: 'active',
|
||||
issuedAt: '2024-02-06 14:10:00',
|
||||
},
|
||||
]
|
||||
|
||||
const mockClaimApplications: ClaimApplication[] = [
|
||||
{
|
||||
id: 'CA20250112001',
|
||||
policyId: 'IP20250111001',
|
||||
policyNumber: 'POL20250111001',
|
||||
loanId: 'LA20251226002',
|
||||
bankId: 'B001',
|
||||
bankName: '中国工商银行',
|
||||
companyId: 'IC002',
|
||||
companyName: '中国平安财产保险股份有限公司',
|
||||
claimAmount: 400000,
|
||||
claimReason: '借款人逾期超过90天,无法偿还贷款本息',
|
||||
materials: [
|
||||
{
|
||||
id: 'CM20250112001',
|
||||
name: '逾期还款记录.pdf',
|
||||
url: 'https://example.com/files/overdue_record.pdf',
|
||||
type: 'application/pdf',
|
||||
size: 1024000,
|
||||
uploadTime: '2025-01-12 10:30:00',
|
||||
},
|
||||
{
|
||||
id: 'CM20250112002',
|
||||
name: '催收记录.docx',
|
||||
url: 'https://example.com/files/collection_record.docx',
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
size: 512000,
|
||||
uploadTime: '2025-01-12 10:31:00',
|
||||
},
|
||||
{
|
||||
id: 'CM20250112003',
|
||||
name: '借款人财务状况.jpg',
|
||||
url: 'https://example.com/files/financial_status.jpg',
|
||||
type: 'image/jpeg',
|
||||
size: 2048000,
|
||||
uploadTime: '2025-01-12 10:32:00',
|
||||
},
|
||||
],
|
||||
status: 'pending',
|
||||
submittedAt: '2025-01-12 10:30:00',
|
||||
},
|
||||
{
|
||||
id: 'CA20250111001',
|
||||
policyId: 'IP20250111001',
|
||||
policyNumber: 'POL20250111001',
|
||||
loanId: 'LA20251226002',
|
||||
bankId: 'B001',
|
||||
bankName: '中国工商银行',
|
||||
companyId: 'IC002',
|
||||
companyName: '中国平安财产保险股份有限公司',
|
||||
claimAmount: 200000,
|
||||
claimReason: '借款人经营困难,申请部分理赔',
|
||||
materials: [
|
||||
{
|
||||
id: 'CM20250111001',
|
||||
name: '经营困难证明.pdf',
|
||||
url: 'https://example.com/files/difficulty_proof.pdf',
|
||||
type: 'application/pdf',
|
||||
size: 768000,
|
||||
uploadTime: '2025-01-11 14:20:00',
|
||||
},
|
||||
],
|
||||
status: 'approved',
|
||||
submittedAt: '2025-01-11 14:20:00',
|
||||
reviewedAt: '2025-01-12 09:15:00',
|
||||
reviewedBy: '理赔审核员001',
|
||||
payoutAmount: 180000,
|
||||
payoutDate: '2025-01-12 09:20:00',
|
||||
},
|
||||
{
|
||||
id: 'CA20250110001',
|
||||
policyId: 'IP20250111001',
|
||||
policyNumber: 'POL20250111001',
|
||||
loanId: 'LA20251226002',
|
||||
bankId: 'B001',
|
||||
bankName: '中国工商银行',
|
||||
companyId: 'IC002',
|
||||
companyName: '中国平安财产保险股份有限公司',
|
||||
claimAmount: 600000,
|
||||
claimReason: '借款人失联,申请全额理赔',
|
||||
materials: [
|
||||
{
|
||||
id: 'CM20250110001',
|
||||
name: '失联证明.pdf',
|
||||
url: 'https://example.com/files/missing_proof.pdf',
|
||||
type: 'application/pdf',
|
||||
size: 512000,
|
||||
uploadTime: '2025-01-10 11:00:00',
|
||||
},
|
||||
],
|
||||
status: 'rejected',
|
||||
submittedAt: '2025-01-10 11:00:00',
|
||||
reviewedAt: '2025-01-10 16:30:00',
|
||||
reviewedBy: '理赔审核员002',
|
||||
rejectionReason: '提供的失联证明材料不充分,需要补充公安部门出具的正式证明文件',
|
||||
},
|
||||
]
|
||||
|
||||
// ==================== 银行端 API ====================
|
||||
|
||||
/**
|
||||
* [银行端] 获取合作保险公司列表
|
||||
*/
|
||||
export function getInsuranceCompanies() {
|
||||
return new Promise<{ list: InsuranceCompany[] }>((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve({
|
||||
list: mockInsuranceCompanies.filter(c => c.status === 'active'),
|
||||
})
|
||||
}, 300)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* [银行端] 获取保险产品列表
|
||||
*/
|
||||
export function getInsuranceProducts(companyId?: string) {
|
||||
return new Promise<{ list: InsuranceProduct[] }>((resolve) => {
|
||||
setTimeout(() => {
|
||||
let products = mockInsuranceProducts.filter(p => p.status === 'active')
|
||||
if (companyId) {
|
||||
products = products.filter(p => p.companyId === companyId)
|
||||
}
|
||||
resolve({ list: products })
|
||||
}, 300)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* [银行端] 创建投保申请
|
||||
*/
|
||||
export function createInsuranceApplication(data: CreateInsuranceApplicationRequest) {
|
||||
return new Promise<{ id: string }>((resolve) => {
|
||||
setTimeout(() => {
|
||||
const application: InsuranceApplication = {
|
||||
id: `IA${Date.now()}`,
|
||||
loanId: data.loanId,
|
||||
bankId: 'B001',
|
||||
bankName: '中国工商银行',
|
||||
companyId: data.companyId,
|
||||
companyName: mockInsuranceCompanies.find(c => c.id === data.companyId)?.name || '',
|
||||
productId: data.productId,
|
||||
productName: mockInsuranceProducts.find(p => p.id === data.productId)?.name || '',
|
||||
customerInfo: {
|
||||
name: '张三',
|
||||
idNumber: '440106199001011234',
|
||||
creditScore: 750,
|
||||
loanAmount: 500000,
|
||||
loanTerm: 120,
|
||||
loanType: 'business_credit',
|
||||
},
|
||||
insuranceAmount: data.insuranceAmount,
|
||||
insuranceTerm: data.insuranceTerm,
|
||||
status: 'pending',
|
||||
createdAt: new Date().toLocaleString(),
|
||||
}
|
||||
mockInsuranceApplications.push(application)
|
||||
resolve({ id: application.id })
|
||||
}, 500)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* [银行端] 获取投保申请详情
|
||||
*/
|
||||
export function getInsuranceApplicationDetail(id: string) {
|
||||
return new Promise<InsuranceApplication>((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
const application = mockInsuranceApplications.find(a => a.id === id)
|
||||
if (application) {
|
||||
resolve(application)
|
||||
}
|
||||
else {
|
||||
reject(new Error('投保申请不存在'))
|
||||
}
|
||||
}, 300)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* [银行端] 获取保险单详情
|
||||
*/
|
||||
export function getInsurancePolicyDetail(id: string) {
|
||||
return new Promise<InsurancePolicy>((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
const policy = mockInsurancePolicies.find(p => p.id === id)
|
||||
if (policy) {
|
||||
resolve(policy)
|
||||
}
|
||||
else {
|
||||
reject(new Error('保险单不存在'))
|
||||
}
|
||||
}, 300)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* [银行端] 创建理赔申请
|
||||
*/
|
||||
export function createClaimApplication(data: CreateClaimApplicationRequest) {
|
||||
return new Promise<{ id: string }>((resolve) => {
|
||||
setTimeout(() => {
|
||||
const policy = mockInsurancePolicies.find(p => p.id === data.policyId)
|
||||
const claim: ClaimApplication = {
|
||||
id: `CA${Date.now()}`,
|
||||
policyId: data.policyId,
|
||||
policyNumber: policy?.policyNumber || '',
|
||||
loanId: data.loanId,
|
||||
bankId: 'B001',
|
||||
bankName: '中国工商银行',
|
||||
companyId: policy?.companyId || '',
|
||||
companyName: policy?.companyName || '',
|
||||
claimAmount: data.claimAmount,
|
||||
claimReason: data.claimReason,
|
||||
materials: data.materials.map((file, index) => ({
|
||||
id: `CM${Date.now()}_${index}`,
|
||||
name: file.name,
|
||||
url: URL.createObjectURL(file),
|
||||
type: file.type,
|
||||
size: file.size,
|
||||
uploadTime: new Date().toLocaleString(),
|
||||
})),
|
||||
status: 'pending',
|
||||
submittedAt: new Date().toLocaleString(),
|
||||
}
|
||||
mockClaimApplications.push(claim)
|
||||
resolve({ id: claim.id })
|
||||
}, 500)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* [银行端] 获取理赔申请详情
|
||||
*/
|
||||
export function getClaimApplicationDetail(id: string) {
|
||||
return new Promise<ClaimApplication>((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
const claim = mockClaimApplications.find(c => c.id === id)
|
||||
if (claim) {
|
||||
resolve(claim)
|
||||
}
|
||||
else {
|
||||
reject(new Error('理赔申请不存在'))
|
||||
}
|
||||
}, 300)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* [银行端] 获取理赔申请列表
|
||||
*/
|
||||
export function getClaimApplicationList(params?: { status?: string }) {
|
||||
return new Promise<{ list: ClaimApplication[] }>((resolve) => {
|
||||
setTimeout(() => {
|
||||
let list = [...mockClaimApplications]
|
||||
if (params?.status) {
|
||||
list = list.filter(c => c.status === params.status)
|
||||
}
|
||||
resolve({ list })
|
||||
}, 300)
|
||||
})
|
||||
}
|
||||
|
||||
// ==================== 保险端 API ====================
|
||||
|
||||
/**
|
||||
* [保险端] 获取待核保申请列表
|
||||
*/
|
||||
export function getUnderwritingApplications(params?: { status?: string }) {
|
||||
return new Promise<{ list: InsuranceApplication[] }>((resolve) => {
|
||||
setTimeout(() => {
|
||||
let list = [...mockInsuranceApplications]
|
||||
if (params?.status) {
|
||||
list = list.filter(a => a.status === params.status)
|
||||
}
|
||||
resolve({ list })
|
||||
}, 300)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* [保险端] 核保审核
|
||||
*/
|
||||
export function reviewUnderwritingApplication(id: string, data: UnderwritingReviewRequest) {
|
||||
return new Promise<void>((resolve) => {
|
||||
setTimeout(() => {
|
||||
const application = mockInsuranceApplications.find(a => a.id === id)
|
||||
if (application) {
|
||||
application.status = data.approved ? 'approved' : 'rejected'
|
||||
application.reviewedAt = new Date().toLocaleString()
|
||||
application.reviewedBy = '核保员001'
|
||||
application.rejectionReason = data.rejectionReason
|
||||
|
||||
// 如果审核通过,生成保险单
|
||||
if (data.approved) {
|
||||
const policy: InsurancePolicy = {
|
||||
id: `IP${Date.now()}`,
|
||||
applicationId: application.id,
|
||||
policyNumber: `POL${Date.now()}`,
|
||||
companyId: application.companyId,
|
||||
companyName: application.companyName,
|
||||
bankId: application.bankId,
|
||||
bankName: application.bankName,
|
||||
loanId: application.loanId,
|
||||
productId: application.productId,
|
||||
productName: application.productName,
|
||||
insuranceAmount: application.insuranceAmount,
|
||||
insuranceTerm: application.insuranceTerm,
|
||||
startDate: new Date().toLocaleString(),
|
||||
endDate: new Date(Date.now() + application.insuranceTerm * 30 * 24 * 60 * 60 * 1000).toLocaleString(),
|
||||
status: 'active',
|
||||
issuedAt: new Date().toLocaleString(),
|
||||
}
|
||||
mockInsurancePolicies.push(policy)
|
||||
}
|
||||
}
|
||||
resolve()
|
||||
}, 500)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* [保险端] 获取待理赔审核列表
|
||||
*/
|
||||
export function getClaimReviewApplications(params?: { status?: string }) {
|
||||
return new Promise<{ list: ClaimApplication[] }>((resolve) => {
|
||||
setTimeout(() => {
|
||||
let list = [...mockClaimApplications]
|
||||
if (params?.status) {
|
||||
list = list.filter(c => c.status === params.status)
|
||||
}
|
||||
resolve({ list })
|
||||
}, 300)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* [保险端] 理赔审核
|
||||
*/
|
||||
export function reviewClaimApplication(id: string, data: ClaimReviewRequest) {
|
||||
return new Promise<void>((resolve) => {
|
||||
setTimeout(() => {
|
||||
const claim = mockClaimApplications.find(c => c.id === id)
|
||||
if (claim) {
|
||||
claim.status = data.approved ? 'approved' : 'rejected'
|
||||
claim.reviewedAt = new Date().toLocaleString()
|
||||
claim.reviewedBy = '理赔审核员001'
|
||||
claim.rejectionReason = data.rejectionReason
|
||||
|
||||
// 如果审核通过,执行赔付
|
||||
if (data.approved && data.payoutAmount) {
|
||||
claim.payoutAmount = data.payoutAmount
|
||||
claim.payoutDate = new Date().toLocaleString()
|
||||
}
|
||||
}
|
||||
resolve()
|
||||
}, 500)
|
||||
})
|
||||
}
|
||||
|
||||
// ==================== 政务端 API ====================
|
||||
|
||||
/**
|
||||
* [政务端] 获取贷款列表(含保险信息)
|
||||
*/
|
||||
export function getGovernmentLoanList(params?: { includeInsurance?: boolean, isBadLoan?: boolean }) {
|
||||
return new Promise<{ list: BankLoanWithInsurance[] }>((resolve) => {
|
||||
setTimeout(() => {
|
||||
// Mock 数据
|
||||
const loans: BankLoanWithInsurance[] = [
|
||||
{
|
||||
id: 'LA20251226001',
|
||||
userId: 'U001',
|
||||
userName: '张三',
|
||||
amount: 500000,
|
||||
term: 120,
|
||||
status: 'approved',
|
||||
isBadLoan: false,
|
||||
},
|
||||
{
|
||||
id: 'LA20251226002',
|
||||
userId: 'U002',
|
||||
userName: '李四',
|
||||
amount: 800000,
|
||||
term: 180,
|
||||
status: 'disbursed',
|
||||
insuranceApplication: mockInsuranceApplications[0],
|
||||
insurancePolicy: mockInsurancePolicies[0],
|
||||
isBadLoan: false,
|
||||
},
|
||||
{
|
||||
id: 'LA20251226003',
|
||||
userId: 'U003',
|
||||
userName: '王五',
|
||||
amount: 300000,
|
||||
term: 90,
|
||||
status: 'disbursed',
|
||||
insuranceApplication: mockInsuranceApplications[1],
|
||||
insurancePolicy: mockInsurancePolicies[1],
|
||||
claimApplications: mockClaimApplications.slice(0, 2),
|
||||
isBadLoan: true,
|
||||
badLoanDays: 45,
|
||||
},
|
||||
]
|
||||
|
||||
let list = [...loans]
|
||||
if (params?.isBadLoan !== undefined) {
|
||||
list = list.filter(l => l.isBadLoan === params.isBadLoan)
|
||||
}
|
||||
resolve({ list })
|
||||
}, 500)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* [政务端] 获取贷款详情(含完整业务流程)
|
||||
*/
|
||||
export function getGovernmentLoanDetail(id: string, params?: { full?: boolean }) {
|
||||
return new Promise<BankLoanWithInsurance>((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
const loan: BankLoanWithInsurance = {
|
||||
id,
|
||||
userId: 'U001',
|
||||
userName: '张三',
|
||||
amount: 500000,
|
||||
term: 120,
|
||||
status: 'disbursed',
|
||||
insuranceApplication: mockInsuranceApplications[0],
|
||||
insurancePolicy: mockInsurancePolicies[0],
|
||||
claimApplications: mockClaimApplications.slice(0, 1),
|
||||
isBadLoan: false,
|
||||
}
|
||||
resolve(loan)
|
||||
}, 500)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* [政务端] 获取不良贷款列表
|
||||
*/
|
||||
export function getBadLoanList() {
|
||||
return new Promise<{ list: BankLoanWithInsurance[] }>((resolve) => {
|
||||
setTimeout(() => {
|
||||
const loans: BankLoanWithInsurance[] = [
|
||||
{
|
||||
id: 'LA20251226003',
|
||||
userId: 'U003',
|
||||
userName: '王五',
|
||||
amount: 300000,
|
||||
term: 90,
|
||||
status: 'disbursed',
|
||||
insuranceApplication: mockInsuranceApplications[1],
|
||||
insurancePolicy: mockInsurancePolicies[1],
|
||||
claimApplications: mockClaimApplications.slice(0, 2),
|
||||
isBadLoan: true,
|
||||
badLoanDays: 45,
|
||||
},
|
||||
{
|
||||
id: 'LA20251226004',
|
||||
userId: 'U004',
|
||||
userName: '赵六',
|
||||
amount: 600000,
|
||||
term: 120,
|
||||
status: 'disbursed',
|
||||
isBadLoan: true,
|
||||
badLoanDays: 30,
|
||||
},
|
||||
]
|
||||
resolve({ list: loans })
|
||||
}, 500)
|
||||
})
|
||||
}
|
||||
191
src/api/types/insurance.ts
Normal file
191
src/api/types/insurance.ts
Normal file
@@ -0,0 +1,191 @@
|
||||
/**
|
||||
* 保险相关类型定义
|
||||
*/
|
||||
|
||||
// 保险公司状态
|
||||
export type InsuranceCompanyStatus = 'active' | 'inactive'
|
||||
|
||||
// 保险产品类型
|
||||
export type InsuranceProductType = 'housing_loan' | 'business_credit' | 'other'
|
||||
|
||||
// 投保申请状态
|
||||
export type InsuranceApplicationStatus = 'pending' | 'approved' | 'rejected'
|
||||
|
||||
// 保险单状态
|
||||
export type InsurancePolicyStatus = 'active' | 'expiring' | 'expired' | 'cancelled'
|
||||
|
||||
// 理赔申请状态
|
||||
export type ClaimApplicationStatus = 'pending' | 'approved' | 'rejected'
|
||||
|
||||
/**
|
||||
* 保险公司
|
||||
*/
|
||||
export interface InsuranceCompany {
|
||||
id: string
|
||||
name: string
|
||||
contactInfo: string
|
||||
status: InsuranceCompanyStatus
|
||||
}
|
||||
|
||||
/**
|
||||
* 保险产品
|
||||
*/
|
||||
export interface InsuranceProduct {
|
||||
id: string
|
||||
companyId: string
|
||||
companyName: string
|
||||
name: string
|
||||
type: InsuranceProductType
|
||||
description: string
|
||||
minAmount: number
|
||||
maxAmount: number
|
||||
status: InsuranceCompanyStatus
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户信息(用于投保申请)
|
||||
*/
|
||||
export interface CustomerInfo {
|
||||
name: string
|
||||
idNumber: string
|
||||
creditScore: number
|
||||
loanAmount: number
|
||||
loanTerm: number
|
||||
loanType: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 投保申请
|
||||
*/
|
||||
export interface InsuranceApplication {
|
||||
id: string
|
||||
loanId: string
|
||||
bankId: string
|
||||
bankName: string
|
||||
companyId: string
|
||||
companyName: string
|
||||
productId: string
|
||||
productName: string
|
||||
customerInfo: CustomerInfo
|
||||
insuranceAmount: number
|
||||
insuranceTerm: number
|
||||
status: InsuranceApplicationStatus
|
||||
createdAt: string
|
||||
reviewedAt?: string
|
||||
reviewedBy?: string
|
||||
rejectionReason?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 保险单
|
||||
*/
|
||||
export interface InsurancePolicy {
|
||||
id: string
|
||||
applicationId: string
|
||||
policyNumber: string
|
||||
companyId: string
|
||||
companyName: string
|
||||
bankId: string
|
||||
bankName: string
|
||||
loanId: string
|
||||
productId: string
|
||||
productName: string
|
||||
insuranceAmount: number
|
||||
insuranceTerm: number
|
||||
startDate: string
|
||||
endDate: string
|
||||
status: InsurancePolicyStatus
|
||||
issuedAt: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 理赔材料
|
||||
*/
|
||||
export interface ClaimMaterial {
|
||||
id: string
|
||||
name: string
|
||||
url: string
|
||||
type: string
|
||||
size: number
|
||||
uploadTime: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 理赔申请
|
||||
*/
|
||||
export interface ClaimApplication {
|
||||
id: string
|
||||
policyId: string
|
||||
policyNumber: string
|
||||
loanId: string
|
||||
bankId: string
|
||||
bankName: string
|
||||
companyId: string
|
||||
companyName: string
|
||||
claimAmount: number
|
||||
claimReason: string
|
||||
materials: ClaimMaterial[]
|
||||
status: ClaimApplicationStatus
|
||||
submittedAt: string
|
||||
reviewedAt?: string
|
||||
reviewedBy?: string
|
||||
rejectionReason?: string
|
||||
payoutAmount?: number
|
||||
payoutDate?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建投保申请请求
|
||||
*/
|
||||
export interface CreateInsuranceApplicationRequest {
|
||||
loanId: string
|
||||
companyId: string
|
||||
productId: string
|
||||
insuranceAmount: number
|
||||
insuranceTerm: number
|
||||
}
|
||||
|
||||
/**
|
||||
* 核保审核请求
|
||||
*/
|
||||
export interface UnderwritingReviewRequest {
|
||||
approved: boolean
|
||||
rejectionReason?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建理赔申请请求
|
||||
*/
|
||||
export interface CreateClaimApplicationRequest {
|
||||
policyId: string
|
||||
loanId: string
|
||||
claimAmount: number
|
||||
claimReason: string
|
||||
materials: File[]
|
||||
}
|
||||
|
||||
/**
|
||||
* 理赔审核请求
|
||||
*/
|
||||
export interface ClaimReviewRequest {
|
||||
approved: boolean
|
||||
rejectionReason?: string
|
||||
payoutAmount?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* 银行贷款信息(扩展)
|
||||
*/
|
||||
export interface BankLoanWithInsurance {
|
||||
id: string
|
||||
userId: string
|
||||
userName: string
|
||||
amount: number
|
||||
term: number
|
||||
status: string
|
||||
insuranceApplication?: InsuranceApplication
|
||||
insurancePolicy?: InsurancePolicy
|
||||
claimApplications?: ClaimApplication[]
|
||||
isBadLoan: boolean
|
||||
badLoanDays?: number
|
||||
}
|
||||
@@ -296,6 +296,54 @@
|
||||
"navigationBarTitleText": "拜访详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "insurance/application/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "投保申请列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "insurance/application/create",
|
||||
"style": {
|
||||
"navigationBarTitleText": "创建投保申请"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "insurance/application/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "投保申请详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "insurance/company/select",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择保险公司"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "insurance/product/select",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择保险产品"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "insurance/claim/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "理赔申请列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "insurance/claim/create",
|
||||
"style": {
|
||||
"navigationBarTitleText": "创建理赔申请"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "insurance/policy/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "保险单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "me/index",
|
||||
"style": {
|
||||
@@ -380,6 +428,30 @@
|
||||
"navigationBarTitleText": "理赔详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "underwriting/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "待核保列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "underwriting/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "核保详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "claim-review/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "理赔审核列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "claim-review/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "理赔审核详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "bank/list",
|
||||
"style": {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -135,12 +135,21 @@ onPullDownRefresh(() => {
|
||||
<text class="merchant-name">{{ item.userName }}的贷款申请</text>
|
||||
<text class="time">{{ item.createTime }}</text>
|
||||
</view>
|
||||
<text
|
||||
class="status-tag"
|
||||
:style="{ color: statusMap[item.status]?.color, backgroundColor: statusMap[item.status]?.bgColor }"
|
||||
>
|
||||
{{ statusMap[item.status]?.text || item.status }}
|
||||
</text>
|
||||
<view class="tags-row">
|
||||
<text
|
||||
class="status-tag"
|
||||
:style="{ color: statusMap[item.status]?.color, backgroundColor: statusMap[item.status]?.bgColor }"
|
||||
>
|
||||
{{ statusMap[item.status]?.text || item.status }}
|
||||
</text>
|
||||
<!-- 保险状态标识 -->
|
||||
<text
|
||||
v-if="item.status === LoanStatus.DISBURSED"
|
||||
class="insurance-tag"
|
||||
>
|
||||
{{ Math.random() > 0.5 ? '已投保' : '未投保' }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-content">
|
||||
@@ -273,14 +282,29 @@ onPullDownRefresh(() => {
|
||||
}
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
font-size: 22rpx;
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
font-weight: 600;
|
||||
.tags-row {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
gap: 8rpx;
|
||||
|
||||
.status-tag {
|
||||
font-size: 22rpx;
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.insurance-tag {
|
||||
font-size: 20rpx;
|
||||
color: #00c05a;
|
||||
background: rgba(0, 192, 90, 0.1);
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.card-content {
|
||||
background: #f8f9fa;
|
||||
border-radius: 12rpx;
|
||||
|
||||
@@ -16,8 +16,8 @@ const quickActions = [
|
||||
{ icon: 'i-carbon-task-approved', label: '待审核', path: '/pagesBank/audit/list' },
|
||||
{ icon: 'i-carbon-group', label: '客户管理', path: '/pagesBank/customer/list' },
|
||||
{ icon: 'i-carbon-calendar', label: '拜访计划', path: '/pagesBank/visit/list' },
|
||||
{ icon: 'i-carbon-add', label: '创建拜访', path: '/pagesBank/visit/create' },
|
||||
{ icon: 'i-carbon-document-download', label: '报表', path: '/pagesBank/report/list' },
|
||||
{ icon: 'i-carbon-security', label: '投保管理', path: '/pagesBank/insurance/application/list' },
|
||||
{ icon: 'i-carbon-money', label: '理赔管理', path: '/pagesBank/insurance/claim/list' },
|
||||
{ icon: 'i-carbon-settings', label: '设置', path: '/pagesBank/me/index' },
|
||||
]
|
||||
|
||||
|
||||
521
src/pagesBank/insurance/application/create.vue
Normal file
521
src/pagesBank/insurance/application/create.vue
Normal file
@@ -0,0 +1,521 @@
|
||||
<script lang="ts" setup>
|
||||
import type { InsuranceCompany, InsuranceProduct } from '@/api/types/insurance'
|
||||
import { createInsuranceApplication, getInsuranceCompanies, getInsuranceProducts } from '@/api/insurance'
|
||||
|
||||
definePage({
|
||||
style: {
|
||||
navigationBarTitleText: '购买保险',
|
||||
},
|
||||
})
|
||||
|
||||
const loanId = ref('')
|
||||
const companyId = ref('')
|
||||
const productId = ref('')
|
||||
const loanAmount = ref(0)
|
||||
const loanTerm = ref(0)
|
||||
const loading = ref(false)
|
||||
const submitting = ref(false)
|
||||
|
||||
// 选中的数据
|
||||
const selectedCompany = ref<InsuranceCompany | null>(null)
|
||||
const selectedProduct = ref<InsuranceProduct | null>(null)
|
||||
const insuranceAmount = ref('')
|
||||
const insuranceTerm = ref('')
|
||||
|
||||
// 列表数据
|
||||
const companies = ref<InsuranceCompany[]>([])
|
||||
const products = ref<InsuranceProduct[]>([])
|
||||
|
||||
// 状态
|
||||
const showCompanyPicker = ref(false)
|
||||
const showProductPicker = ref(false)
|
||||
|
||||
// 加载保险公司列表
|
||||
async function loadCompanies() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getInsuranceCompanies()
|
||||
companies.value = res.list
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 根据ID预选保险公司
|
||||
function preSelectCompany() {
|
||||
if (!companyId.value)
|
||||
return
|
||||
const company = companies.value.find(c => c.id === companyId.value)
|
||||
if (company) {
|
||||
selectedCompany.value = company
|
||||
loadProducts(company.id)
|
||||
}
|
||||
}
|
||||
|
||||
// 选择保险公司
|
||||
function handleSelectCompany(company: InsuranceCompany) {
|
||||
selectedCompany.value = company
|
||||
selectedProduct.value = null
|
||||
insuranceAmount.value = ''
|
||||
insuranceTerm.value = ''
|
||||
loadProducts(company.id)
|
||||
showCompanyPicker.value = false
|
||||
}
|
||||
|
||||
// 加载保险产品列表
|
||||
async function loadProducts(companyId: string) {
|
||||
const res = await getInsuranceProducts(companyId)
|
||||
products.value = res.list
|
||||
}
|
||||
|
||||
// 选择保险产品
|
||||
function handleSelectProduct(product: InsuranceProduct) {
|
||||
selectedProduct.value = product
|
||||
// 默认保险金额等于贷款金额
|
||||
insuranceAmount.value = loanAmount.value.toString()
|
||||
// 默认保险期限等于贷款期限(月)
|
||||
insuranceTerm.value = loanTerm.value.toString()
|
||||
showProductPicker.value = false
|
||||
}
|
||||
|
||||
// 根据ID预选保险产品
|
||||
function preSelectProduct() {
|
||||
if (!productId.value || !selectedCompany.value)
|
||||
return
|
||||
loadProducts(selectedCompany.value.id).then(() => {
|
||||
const product = products.value.find(p => p.id === productId.value)
|
||||
if (product) {
|
||||
handleSelectProduct(product)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 提交投保申请
|
||||
async function handleSubmit() {
|
||||
if (!selectedCompany.value || !selectedProduct.value) {
|
||||
uni.showToast({ title: '请选择保险公司和保险产品', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (!insuranceAmount.value || !insuranceTerm.value) {
|
||||
uni.showToast({ title: '请填写保险金额和期限', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
const amount = Number(insuranceAmount.value)
|
||||
const term = Number(insuranceTerm.value)
|
||||
|
||||
// 验证保险金额
|
||||
if (amount < selectedProduct.value.minAmount) {
|
||||
uni.showToast({ title: `保险金额不能低于${selectedProduct.value.minAmount}元`, icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (amount > selectedProduct.value.maxAmount) {
|
||||
uni.showToast({ title: `保险金额不能高于${selectedProduct.value.maxAmount}元`, icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
submitting.value = true
|
||||
try {
|
||||
await createInsuranceApplication({
|
||||
loanId: loanId.value,
|
||||
companyId: selectedCompany.value.id,
|
||||
productId: selectedProduct.value.id,
|
||||
insuranceAmount: amount,
|
||||
insuranceTerm: term,
|
||||
})
|
||||
uni.showToast({ title: '投保申请已提交', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
if (options?.loanId) {
|
||||
loanId.value = options.loanId
|
||||
}
|
||||
if (options?.loanAmount) {
|
||||
loanAmount.value = Number(options.loanAmount)
|
||||
}
|
||||
if (options?.loanTerm) {
|
||||
loanTerm.value = Number(options.loanTerm)
|
||||
}
|
||||
if (options?.companyId) {
|
||||
companyId.value = options.companyId
|
||||
}
|
||||
if (options?.productId) {
|
||||
productId.value = options.productId
|
||||
}
|
||||
loadCompanies().then(() => {
|
||||
preSelectCompany()
|
||||
if (productId.value) {
|
||||
preSelectProduct()
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="insurance-create-page">
|
||||
<view v-if="loading" class="loading-state">
|
||||
加载中...
|
||||
</view>
|
||||
|
||||
<template v-else>
|
||||
<!-- 保险公司选择 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
<text class="title">选择保险公司</text>
|
||||
<text v-if="selectedCompany" class="selected-text">{{ selectedCompany.name }}</text>
|
||||
</view>
|
||||
<view class="company-list">
|
||||
<view
|
||||
v-for="company in companies"
|
||||
:key="company.id"
|
||||
class="company-item"
|
||||
:class="{ active: selectedCompany?.id === company.id }"
|
||||
@click="handleSelectCompany(company)"
|
||||
>
|
||||
<view class="company-info">
|
||||
<text class="company-name">{{ company.name }}</text>
|
||||
<text class="contact-info">联系方式: {{ company.contactInfo }}</text>
|
||||
</view>
|
||||
<text v-if="selectedCompany?.id === company.id" class="i-carbon-checkmark selected-icon" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 保险产品选择 -->
|
||||
<view v-if="selectedCompany" class="section-card">
|
||||
<view class="card-header">
|
||||
<text class="title">选择保险产品</text>
|
||||
<text v-if="selectedProduct" class="selected-text">{{ selectedProduct.name }}</text>
|
||||
</view>
|
||||
<view class="product-list">
|
||||
<view
|
||||
v-for="product in products"
|
||||
:key="product.id"
|
||||
class="product-item"
|
||||
:class="{ active: selectedProduct?.id === product.id }"
|
||||
@click="handleSelectProduct(product)"
|
||||
>
|
||||
<view class="product-info">
|
||||
<text class="product-name">{{ product.name }}</text>
|
||||
<text class="product-desc">{{ product.description }}</text>
|
||||
<view class="product-meta">
|
||||
<text class="meta-item">类型: {{ product.type === 'housing_loan' ? '住房贷款' : product.type === 'business_credit' ? '企业信贷' : '其他' }}</text>
|
||||
<text class="meta-item">金额范围: {{ product.minAmount }}-{{ product.maxAmount }}元</text>
|
||||
</view>
|
||||
</view>
|
||||
<text v-if="selectedProduct?.id === product.id" class="i-carbon-checkmark selected-icon" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 保险信息 -->
|
||||
<view v-if="selectedProduct" class="section-card">
|
||||
<view class="card-header">
|
||||
保险信息
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<view class="form-item">
|
||||
<text class="label">保险金额(元)</text>
|
||||
<input
|
||||
v-model="insuranceAmount"
|
||||
type="digit"
|
||||
class="input"
|
||||
placeholder="请输入保险金额"
|
||||
>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="label">保险期限(月)</text>
|
||||
<input
|
||||
v-model="insuranceTerm"
|
||||
type="number"
|
||||
class="input"
|
||||
placeholder="请输入保险期限"
|
||||
>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="label">贷款金额(参考)</text>
|
||||
<text class="value">{{ loanAmount }}元</text>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="label">贷款期限(参考)</text>
|
||||
<text class="value">{{ loanTerm }}月</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<view class="tips-card">
|
||||
<view class="tips-header">
|
||||
<text class="i-carbon-information tips-icon" />
|
||||
<text class="tips-title">温馨提示</text>
|
||||
</view>
|
||||
<view class="tips-content">
|
||||
<text class="tips-item">• 保险金额一般不低于抵押物价值</text>
|
||||
<text class="tips-item">• 保险期限应与贷款期限一致</text>
|
||||
<text class="tips-item">• 投保申请提交后,将由保险公司进行核保</text>
|
||||
<text class="tips-item">• 核保通过后将自动生成保险单</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部操作栏 -->
|
||||
<view class="action-bar safe-area-bottom">
|
||||
<button
|
||||
class="btn primary"
|
||||
:disabled="submitting"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
<text v-if="submitting">提交中...</text>
|
||||
<text v-else>提交投保申请</text>
|
||||
</button>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.insurance-create-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
padding: 20rpx;
|
||||
padding-bottom: 120rpx;
|
||||
}
|
||||
|
||||
.loading-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.section-card {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.card-header {
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.selected-text {
|
||||
font-size: 24rpx;
|
||||
color: #00c05a;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.company-list {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.company-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 24rpx;
|
||||
background: #f8f9fa;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 16rpx;
|
||||
border: 2rpx solid transparent;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&.active {
|
||||
border-color: #00c05a;
|
||||
background: #e6f7eb;
|
||||
}
|
||||
|
||||
.company-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
|
||||
.company-name {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.contact-info {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.selected-icon {
|
||||
font-size: 40rpx;
|
||||
color: #00c05a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.product-list {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.product-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 24rpx;
|
||||
background: #f8f9fa;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 16rpx;
|
||||
border: 2rpx solid transparent;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&.active {
|
||||
border-color: #00c05a;
|
||||
background: #e6f7eb;
|
||||
}
|
||||
|
||||
.product-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
|
||||
.product-name {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.product-desc {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.product-meta {
|
||||
display: flex;
|
||||
gap: 16rpx;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.meta-item {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.selected-icon {
|
||||
font-size: 40rpx;
|
||||
color: #00c05a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form-group {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 16rpx 0;
|
||||
font-size: 26rpx;
|
||||
|
||||
.label {
|
||||
color: #666;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.input {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tips-card {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.tips-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.tips-icon {
|
||||
font-size: 28rpx;
|
||||
color: #f59e0b;
|
||||
}
|
||||
|
||||
.tips-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.tips-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12rpx;
|
||||
|
||||
.tips-item {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.action-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: #fff;
|
||||
padding: 20rpx 30rpx;
|
||||
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||
z-index: 100;
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
font-size: 28rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
|
||||
&.primary {
|
||||
background: #00c05a;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
322
src/pagesBank/insurance/application/detail.vue
Normal file
322
src/pagesBank/insurance/application/detail.vue
Normal file
@@ -0,0 +1,322 @@
|
||||
<script lang="ts" setup>
|
||||
import type { InsuranceApplication, InsurancePolicy } from '@/api/types/insurance'
|
||||
import { getInsuranceApplicationDetail, getInsurancePolicyDetail } from '@/api/insurance'
|
||||
|
||||
definePage({
|
||||
style: {
|
||||
navigationBarTitleText: '投保申请详情',
|
||||
},
|
||||
})
|
||||
|
||||
const applicationId = ref('')
|
||||
const application = ref<InsuranceApplication | null>(null)
|
||||
const policy = ref<InsurancePolicy | null>(null)
|
||||
const loading = ref(false)
|
||||
|
||||
// 状态映射
|
||||
const statusMap: Record<string, { text: string, color: string }> = {
|
||||
pending: { text: '待审核', color: '#F59E0B' },
|
||||
approved: { text: '已通过', color: '#00c05a' },
|
||||
rejected: { text: '已拒绝', color: '#fa4350' },
|
||||
}
|
||||
|
||||
const statusInfo = computed(() => {
|
||||
if (!application.value)
|
||||
return null
|
||||
return statusMap[application.value.status] || { text: application.value.status, color: '#666' }
|
||||
})
|
||||
|
||||
async function loadDetail() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getInsuranceApplicationDetail(applicationId.value)
|
||||
application.value = res
|
||||
|
||||
// 如果已通过,加载保险单
|
||||
if (res.status === 'approved') {
|
||||
// 查找对应的保险单
|
||||
const policies = await getInsurancePolicyDetail(res.id)
|
||||
policy.value = policies
|
||||
}
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
if (options?.id) {
|
||||
applicationId.value = options.id
|
||||
loadDetail()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="application-detail-page">
|
||||
<view v-if="loading" class="loading-state">
|
||||
加载中...
|
||||
</view>
|
||||
|
||||
<template v-else-if="application">
|
||||
<!-- 状态卡片 -->
|
||||
<view class="status-card" :style="{ background: statusInfo?.color }">
|
||||
<text class="status-text">{{ statusInfo?.text }}</text>
|
||||
<text v-if="application.status === 'pending'" class="status-desc">保险公司正在审核您的投保申请</text>
|
||||
<text v-else-if="application.status === 'approved'" class="status-desc">投保申请已通过,保险单已生成</text>
|
||||
<text v-else-if="application.status === 'rejected'" class="status-desc">投保申请已被拒绝</text>
|
||||
</view>
|
||||
|
||||
<!-- 基本信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
基本信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">投保申请号</text>
|
||||
<text class="value">{{ application.id }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">贷款编号</text>
|
||||
<text class="value">{{ application.loanId }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">申请时间</text>
|
||||
<text class="value">{{ application.createdAt }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 保险公司信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
保险公司信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">保险公司</text>
|
||||
<text class="value">{{ application.companyName }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">保险产品</text>
|
||||
<text class="value">{{ application.productName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 客户信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
客户信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">客户姓名</text>
|
||||
<text class="value">{{ application.customerInfo.name }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">身份证号</text>
|
||||
<text class="value">{{ application.customerInfo.idNumber }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">信用评分</text>
|
||||
<text class="value score">{{ application.customerInfo.creditScore }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">贷款金额</text>
|
||||
<text class="value">{{ application.customerInfo.loanAmount }}元</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">贷款期限</text>
|
||||
<text class="value">{{ application.customerInfo.loanTerm }}月</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 保险信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
保险信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">保险金额</text>
|
||||
<text class="value amount">{{ application.insuranceAmount }}元</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">保险期限</text>
|
||||
<text class="value">{{ application.insuranceTerm }}月</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 审核信息 -->
|
||||
<view v-if="application.status !== 'pending'" class="section-card">
|
||||
<view class="card-header">
|
||||
审核信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">审核时间</text>
|
||||
<text class="value">{{ application.reviewedAt }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">审核人员</text>
|
||||
<text class="value">{{ application.reviewedBy }}</text>
|
||||
</view>
|
||||
<view v-if="application.rejectionReason" class="info-item full">
|
||||
<text class="label">拒绝原因</text>
|
||||
<text class="value reason">{{ application.rejectionReason }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 保险单信息 -->
|
||||
<view v-if="policy" class="section-card">
|
||||
<view class="card-header">
|
||||
<text>保险单信息</text>
|
||||
<text class="i-carbon-checkmark success-icon" />
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">保险单号</text>
|
||||
<text class="value">{{ policy.policyNumber }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">保险金额</text>
|
||||
<text class="value amount">{{ policy.insuranceAmount }}元</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">保险期限</text>
|
||||
<text class="value">{{ policy.insuranceTerm }}月</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">开始日期</text>
|
||||
<text class="value">{{ policy.startDate }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">结束日期</text>
|
||||
<text class="value">{{ policy.endDate }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">出单时间</text>
|
||||
<text class="value">{{ policy.issuedAt }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.application-detail-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.loading-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.status-card {
|
||||
background: linear-gradient(135deg, #00c05a 0%, #34d19d 100%);
|
||||
border-radius: 16rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
text-align: center;
|
||||
|
||||
.status-text {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.status-desc {
|
||||
font-size: 24rpx;
|
||||
opacity: 0.9;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.section-card {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.card-header {
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
|
||||
.success-icon {
|
||||
font-size: 28rpx;
|
||||
color: #00c05a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.info-list {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 16rpx 0;
|
||||
font-size: 26rpx;
|
||||
border-bottom: 1rpx solid #f9f9f9;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #333;
|
||||
text-align: right;
|
||||
|
||||
&.score {
|
||||
color: #00c05a;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.amount {
|
||||
color: #ff8f0d;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.reason {
|
||||
color: #fa4350;
|
||||
text-align: left;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
&.full {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
|
||||
.value {
|
||||
margin-top: 8rpx;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
439
src/pagesBank/insurance/application/list.vue
Normal file
439
src/pagesBank/insurance/application/list.vue
Normal file
@@ -0,0 +1,439 @@
|
||||
<script lang="ts" setup>
|
||||
import type { InsuranceApplication } from '@/api/types/insurance'
|
||||
import { getInsuranceApplicationList } from '@/api/insurance'
|
||||
|
||||
definePage({
|
||||
style: {
|
||||
navigationBarTitleText: '投保申请',
|
||||
},
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const applications = ref<InsuranceApplication[]>([])
|
||||
const filteredApplications = ref<InsuranceApplication[]>([])
|
||||
const searchKeyword = ref('')
|
||||
const currentTab = ref('all')
|
||||
const pageSize = 20
|
||||
const currentPage = ref(1)
|
||||
const hasMore = ref(true)
|
||||
|
||||
const statusMap: Record<string, { text: string, color: string }> = {
|
||||
pending: { text: '待审核', color: '#F59E0B' },
|
||||
approved: { text: '已通过', color: '#00c05a' },
|
||||
rejected: { text: '已拒绝', color: '#fa4350' },
|
||||
}
|
||||
|
||||
const tabs = [
|
||||
{ key: 'all', label: '全部' },
|
||||
{ key: 'pending', label: '待审核' },
|
||||
{ key: 'approved', label: '已通过' },
|
||||
{ key: 'rejected', label: '已拒绝' },
|
||||
]
|
||||
|
||||
function getStatusInfo(status: string) {
|
||||
return statusMap[status] || { text: status, color: '#999' }
|
||||
}
|
||||
|
||||
function getProductTypeText(type: string) {
|
||||
const typeMap: Record<string, string> = {
|
||||
housing_loan: '住房贷款',
|
||||
business_credit: '企业信贷',
|
||||
other: '其他',
|
||||
}
|
||||
return typeMap[type] || type
|
||||
}
|
||||
|
||||
function filterBySearch(list: InsuranceApplication[]) {
|
||||
if (!searchKeyword.value.trim())
|
||||
return list
|
||||
const keyword = searchKeyword.value.toLowerCase()
|
||||
return list.filter(app =>
|
||||
app.id.toLowerCase().includes(keyword)
|
||||
|| app.companyName.toLowerCase().includes(keyword)
|
||||
|| app.productName.toLowerCase().includes(keyword)
|
||||
|| (app as any).policyNumber?.toLowerCase().includes(keyword),
|
||||
)
|
||||
}
|
||||
|
||||
function filterByStatus(list: InsuranceApplication[]) {
|
||||
if (currentTab.value === 'all')
|
||||
return list
|
||||
return list.filter(app => app.status === currentTab.value)
|
||||
}
|
||||
|
||||
function updateFilteredList() {
|
||||
let list = filterBySearch(applications.value)
|
||||
list = filterByStatus(list)
|
||||
filteredApplications.value = list
|
||||
}
|
||||
|
||||
function handleTabChange(tab: string) {
|
||||
currentTab.value = tab
|
||||
updateFilteredList()
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
currentPage.value = 1
|
||||
updateFilteredList()
|
||||
}
|
||||
|
||||
function handleClearSearch() {
|
||||
searchKeyword.value = ''
|
||||
handleSearch()
|
||||
}
|
||||
|
||||
function handleViewDetail(id: string) {
|
||||
uni.navigateTo({
|
||||
url: `/pagesBank/insurance/application/detail?id=${id}`,
|
||||
})
|
||||
}
|
||||
|
||||
async function loadList(reset = false) {
|
||||
if (reset) {
|
||||
currentPage.value = 1
|
||||
applications.value = []
|
||||
hasMore.value = true
|
||||
}
|
||||
|
||||
if (!hasMore.value)
|
||||
return
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getInsuranceApplicationList()
|
||||
applications.value = res.list
|
||||
updateFilteredList()
|
||||
hasMore.value = res.list.length >= pageSize
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleLoadMore() {
|
||||
if (!loading.value && hasMore.value) {
|
||||
currentPage.value++
|
||||
loadList()
|
||||
}
|
||||
}
|
||||
|
||||
function handleRefresh() {
|
||||
loadList(true)
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
loadList(true)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="application-list-page">
|
||||
<view class="search-bar">
|
||||
<view class="search-input-wrap">
|
||||
<text class="search-icon i-carbon-search" />
|
||||
<input
|
||||
v-model="searchKeyword"
|
||||
class="search-input"
|
||||
placeholder="搜索保单号/公司/产品"
|
||||
@confirm="handleSearch"
|
||||
>
|
||||
<text v-if="searchKeyword" class="clear-icon" @click="handleClearSearch">×</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="tabs">
|
||||
<view
|
||||
v-for="tab in tabs"
|
||||
:key="tab.key"
|
||||
class="tab-item"
|
||||
:class="{ active: currentTab === tab.key }"
|
||||
@click="handleTabChange(tab.key)"
|
||||
>
|
||||
<text class="tab-text">{{ tab.label }}</text>
|
||||
<view v-if="currentTab === tab.key" class="tab-indicator" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="loading && filteredApplications.length === 0" class="loading-state">
|
||||
加载中...
|
||||
</view>
|
||||
|
||||
<view v-else-if="filteredApplications.length > 0" class="application-list">
|
||||
<view
|
||||
v-for="app in filteredApplications"
|
||||
:key="app.id"
|
||||
class="application-item"
|
||||
@click="handleViewDetail(app.id)"
|
||||
>
|
||||
<view class="app-header">
|
||||
<view class="app-info">
|
||||
<text class="app-id">{{ app.id }}</text>
|
||||
<text class="company-name">{{ app.companyName }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="status-tag"
|
||||
:style="{ background: getStatusInfo(app.status).color }"
|
||||
>
|
||||
{{ getStatusInfo(app.status).text }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="app-body">
|
||||
<view class="app-row">
|
||||
<text class="label">保险产品</text>
|
||||
<text class="value">{{ app.productName }}</text>
|
||||
</view>
|
||||
<view class="app-row">
|
||||
<text class="label">产品类型</text>
|
||||
<text class="value">{{ getProductTypeText(app.customerInfo?.loanType || 'other') }}</text>
|
||||
</view>
|
||||
<view class="app-row">
|
||||
<text class="label">保险金额</text>
|
||||
<text class="value amount">{{ (app.insuranceAmount / 10000).toFixed(2) }}万</text>
|
||||
</view>
|
||||
<view class="app-row">
|
||||
<text class="label">保险期限</text>
|
||||
<text class="value">{{ app.insuranceTerm / 12 }}年</text>
|
||||
</view>
|
||||
<view class="app-row">
|
||||
<text class="label">提交时间</text>
|
||||
<text class="value">{{ app.createdAt }}</text>
|
||||
</view>
|
||||
<view v-if="app.rejectionReason" class="app-row reject">
|
||||
<text class="label">拒绝原因</text>
|
||||
<text class="value">{{ app.rejectionReason }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="app-footer">
|
||||
<text class="view-detail">查看详情</text>
|
||||
<text class="arrow-icon i-carbon-chevron-right" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="!loading && filteredApplications.length > 0 && hasMore" class="load-more" @click="handleLoadMore">
|
||||
<text>加载更多</text>
|
||||
</view>
|
||||
|
||||
<view v-if="!loading && filteredApplications.length === 0" class="empty-state">
|
||||
<text class="empty-icon i-carbon-document" />
|
||||
<text class="empty-text">暂无投保申请</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.application-list-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
background: #fff;
|
||||
padding: 20rpx 30rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
.search-input-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #f5f7fa;
|
||||
border-radius: 36rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
|
||||
.search-icon {
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.clear-icon {
|
||||
font-size: 36rpx;
|
||||
color: #999;
|
||||
padding: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tabs {
|
||||
background: #fff;
|
||||
display: flex;
|
||||
padding: 0 30rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
|
||||
&.active {
|
||||
color: #00c05a;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.tab-indicator {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 60rpx;
|
||||
height: 4rpx;
|
||||
background: #00c05a;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.application-list {
|
||||
padding: 20rpx;
|
||||
|
||||
.application-item {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.app-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.app-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
|
||||
.app-id {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.company-name {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
padding: 8rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.app-body {
|
||||
background: #f8f9fa;
|
||||
border-radius: 12rpx;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.app-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 12rpx 0;
|
||||
font-size: 26rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #333;
|
||||
text-align: right;
|
||||
|
||||
&.amount {
|
||||
color: #ff8f0d;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.reject {
|
||||
color: #fa4350;
|
||||
text-align: left;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.app-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-top: 12rpx;
|
||||
|
||||
.view-detail {
|
||||
font-size: 24rpx;
|
||||
color: #00c05a;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
font-size: 28rpx;
|
||||
color: #00c05a;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.load-more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 30rpx;
|
||||
color: #666;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
|
||||
.empty-icon {
|
||||
font-size: 80rpx;
|
||||
margin-bottom: 20rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
421
src/pagesBank/insurance/claim/create.vue
Normal file
421
src/pagesBank/insurance/claim/create.vue
Normal file
@@ -0,0 +1,421 @@
|
||||
<script lang="ts" setup>
|
||||
import type { InsurancePolicy } from '@/api/types/insurance'
|
||||
import { createClaimApplication } from '@/api/insurance'
|
||||
|
||||
definePage({
|
||||
style: {
|
||||
navigationBarTitleText: '发起理赔申请',
|
||||
},
|
||||
})
|
||||
|
||||
const policyId = ref('')
|
||||
const policyNumber = ref('')
|
||||
const loanId = ref('')
|
||||
const claimAmount = ref('')
|
||||
const claimReason = ref('')
|
||||
const materials = ref<any[]>([])
|
||||
const submitting = ref(false)
|
||||
|
||||
// 上传材料
|
||||
function handleUploadMaterial() {
|
||||
uni.chooseImage({
|
||||
count: 9,
|
||||
sizeType: ['compressed'],
|
||||
sourceType: ['album', 'camera'],
|
||||
success: (res) => {
|
||||
const tempFilePaths = res.tempFilePaths as string[]
|
||||
tempFilePaths.forEach((filePath, index) => {
|
||||
materials.value.push({
|
||||
id: `material_${Date.now()}_${index}`,
|
||||
url: filePath,
|
||||
name: `理赔材料${materials.value.length + 1}.jpg`,
|
||||
type: 'image/jpeg',
|
||||
size: 0,
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 删除材料
|
||||
function handleRemoveMaterial(index: number) {
|
||||
materials.value.splice(index, 1)
|
||||
}
|
||||
|
||||
// 预览图片
|
||||
function handlePreviewImage(url: string) {
|
||||
uni.previewImage({
|
||||
urls: [url],
|
||||
})
|
||||
}
|
||||
|
||||
// 提交理赔申请
|
||||
async function handleSubmit() {
|
||||
if (!claimAmount.value || !claimReason.value) {
|
||||
uni.showToast({ title: '请填写理赔金额和原因', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (materials.value.length === 0) {
|
||||
uni.showToast({ title: '请上传理赔材料', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
submitting.value = true
|
||||
try {
|
||||
const files = materials.value.map((m) => {
|
||||
// 模拟 File 对象
|
||||
return new File([], m.name, { type: m.type })
|
||||
})
|
||||
|
||||
await createClaimApplication({
|
||||
policyId: policyId.value,
|
||||
loanId: loanId.value,
|
||||
claimAmount: Number(claimAmount.value),
|
||||
claimReason: claimReason.value,
|
||||
materials: files,
|
||||
})
|
||||
uni.showToast({ title: '理赔申请已提交', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
if (options?.policyId) {
|
||||
policyId.value = options.policyId
|
||||
}
|
||||
if (options?.policyNumber) {
|
||||
policyNumber.value = options.policyNumber
|
||||
}
|
||||
if (options?.loanId) {
|
||||
loanId.value = options.loanId
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="claim-create-page">
|
||||
<!-- 保险单信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
保险单信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">保险单号</text>
|
||||
<text class="value">{{ policyNumber }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 理赔信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
理赔信息
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<view class="form-item">
|
||||
<text class="label">理赔金额(元)</text>
|
||||
<input
|
||||
v-model="claimAmount"
|
||||
type="digit"
|
||||
class="input"
|
||||
placeholder="请输入理赔金额"
|
||||
>
|
||||
</view>
|
||||
<view class="form-item vertical">
|
||||
<text class="label">理赔原因</text>
|
||||
<textarea
|
||||
v-model="claimReason"
|
||||
class="textarea"
|
||||
placeholder="请详细描述理赔原因..."
|
||||
:maxlength="500"
|
||||
/>
|
||||
<text class="char-count">{{ claimReason.length }}/500</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 理赔材料 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
<text>理赔材料</text>
|
||||
<text class="required">至少上传1份</text>
|
||||
</view>
|
||||
<view class="materials-area">
|
||||
<view class="upload-btn" @click="handleUploadMaterial">
|
||||
<text class="i-carbon-add upload-icon" />
|
||||
<text class="upload-text">上传材料</text>
|
||||
</view>
|
||||
<view
|
||||
v-for="(material, index) in materials"
|
||||
:key="material.id"
|
||||
class="material-item"
|
||||
>
|
||||
<image :src="material.url" mode="aspectFill" @click="handlePreviewImage(material.url)" />
|
||||
<view class="material-actions">
|
||||
<text class="delete-btn" @click="handleRemoveMaterial(index)">
|
||||
<text class="i-carbon-close" />
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<view class="tips-card">
|
||||
<view class="tips-header">
|
||||
<text class="i-carbon-information tips-icon" />
|
||||
<text class="tips-title">温馨提示</text>
|
||||
</view>
|
||||
<view class="tips-content">
|
||||
<text class="tips-item">• 请上传清晰的理赔材料,包括但不限于:事故证明、损失清单、相关票据等</text>
|
||||
<text class="tips-item">• 理赔申请提交后,将由保险公司进行审核</text>
|
||||
<text class="tips-item">• 审核通过后将执行赔付,审核失败将返回拒绝原因</text>
|
||||
<text class="tips-item">• 理赔金额不得超过保险金额</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部操作栏 -->
|
||||
<view class="action-bar safe-area-bottom">
|
||||
<button
|
||||
class="btn primary"
|
||||
:disabled="submitting"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
<text v-if="submitting">提交中...</text>
|
||||
<text v-else>提交理赔申请</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.claim-create-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
padding: 20rpx;
|
||||
padding-bottom: 120rpx;
|
||||
}
|
||||
|
||||
.section-card {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.card-header {
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.required {
|
||||
font-size: 22rpx;
|
||||
color: #fa4350;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.info-list {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 16rpx 0;
|
||||
font-size: 26rpx;
|
||||
|
||||
.label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form-group {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 16rpx 0;
|
||||
font-size: 26rpx;
|
||||
|
||||
&.vertical {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #666;
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.input {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.textarea {
|
||||
width: 100%;
|
||||
min-height: 150rpx;
|
||||
padding: 16rpx;
|
||||
background: #f8f9fa;
|
||||
border-radius: 8rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.char-count {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
text-align: right;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.materials-area {
|
||||
padding: 20rpx 0;
|
||||
display: flex;
|
||||
gap: 16rpx;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.upload-btn {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border: 2rpx dashed #d9d9d9;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8rpx;
|
||||
background: #f8f9fa;
|
||||
|
||||
.upload-icon {
|
||||
font-size: 48rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.upload-text {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.material-item {
|
||||
position: relative;
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.material-actions {
|
||||
position: absolute;
|
||||
top: 8rpx;
|
||||
right: 8rpx;
|
||||
|
||||
.delete-btn {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tips-card {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.tips-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.tips-icon {
|
||||
font-size: 28rpx;
|
||||
color: #f59e0b;
|
||||
}
|
||||
|
||||
.tips-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.tips-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12rpx;
|
||||
|
||||
.tips-item {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.action-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: #fff;
|
||||
padding: 20rpx 30rpx;
|
||||
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||
z-index: 100;
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
font-size: 28rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
|
||||
&.primary {
|
||||
background: #00c05a;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
332
src/pagesBank/insurance/claim/list.vue
Normal file
332
src/pagesBank/insurance/claim/list.vue
Normal file
@@ -0,0 +1,332 @@
|
||||
<script lang="ts" setup>
|
||||
import type { ClaimApplication } from '@/api/types/insurance'
|
||||
import { getClaimApplicationList } from '@/api/insurance'
|
||||
|
||||
definePage({
|
||||
style: {
|
||||
navigationBarTitleText: '理赔申请',
|
||||
},
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const claims = ref<ClaimApplication[]>([])
|
||||
const currentTab = ref('all')
|
||||
|
||||
// 状态映射
|
||||
const statusMap: Record<string, { text: string, color: string }> = {
|
||||
pending: { text: '待审核', color: '#F59E0B' },
|
||||
approved: { text: '已通过', color: '#00c05a' },
|
||||
rejected: { text: '已拒绝', color: '#fa4350' },
|
||||
}
|
||||
|
||||
const tabs = [
|
||||
{ key: 'all', label: '全部' },
|
||||
{ key: 'pending', label: '待审核' },
|
||||
{ key: 'approved', label: '已通过' },
|
||||
{ key: 'rejected', label: '已拒绝' },
|
||||
]
|
||||
|
||||
// 筛选后的列表
|
||||
const filteredClaims = computed(() => {
|
||||
if (currentTab.value === 'all') {
|
||||
return claims.value
|
||||
}
|
||||
return claims.value.filter(c => c.status === currentTab.value)
|
||||
})
|
||||
|
||||
// 切换标签
|
||||
function handleTabChange(tab: string) {
|
||||
currentTab.value = tab
|
||||
}
|
||||
|
||||
// 查看详情
|
||||
function handleViewDetail(id: string) {
|
||||
uni.navigateTo({
|
||||
url: `/pagesBank/insurance/claim/detail?id=${id}`,
|
||||
})
|
||||
}
|
||||
|
||||
// 加载列表
|
||||
async function loadList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getClaimApplicationList()
|
||||
claims.value = res.list
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
loadList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="claim-list-page">
|
||||
<!-- 标签页 -->
|
||||
<view class="tabs">
|
||||
<view
|
||||
v-for="tab in tabs"
|
||||
:key="tab.key"
|
||||
class="tab-item"
|
||||
:class="{ active: currentTab === tab.key }"
|
||||
@click="handleTabChange(tab.key)"
|
||||
>
|
||||
<text class="tab-text">{{ tab.label }}</text>
|
||||
<view v-if="currentTab === tab.key" class="tab-indicator" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<view v-if="loading" class="loading-state">
|
||||
加载中...
|
||||
</view>
|
||||
|
||||
<view v-else-if="filteredClaims.length > 0" class="claim-list">
|
||||
<view
|
||||
v-for="claim in filteredClaims"
|
||||
:key="claim.id"
|
||||
class="claim-item"
|
||||
@click="handleViewDetail(claim.id)"
|
||||
>
|
||||
<view class="claim-header">
|
||||
<view class="claim-info">
|
||||
<text class="policy-no">保险单号: {{ claim.policyNumber }}</text>
|
||||
<text class="company-name">{{ claim.companyName }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="status-tag"
|
||||
:style="{ background: statusMap[claim.status]?.color }"
|
||||
>
|
||||
{{ statusMap[claim.status]?.text }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="claim-body">
|
||||
<view class="claim-row">
|
||||
<text class="label">理赔金额</text>
|
||||
<text class="value amount">{{ claim.claimAmount }}元</text>
|
||||
</view>
|
||||
<view class="claim-row">
|
||||
<text class="label">理赔原因</text>
|
||||
<text class="value reason">{{ claim.claimReason }}</text>
|
||||
</view>
|
||||
<view class="claim-row">
|
||||
<text class="label">提交时间</text>
|
||||
<text class="value">{{ claim.submittedAt }}</text>
|
||||
</view>
|
||||
<view v-if="claim.payoutAmount" class="claim-row">
|
||||
<text class="label">赔付金额</text>
|
||||
<text class="value payout">{{ claim.payoutAmount }}元</text>
|
||||
</view>
|
||||
<view v-if="claim.payoutDate" class="claim-row">
|
||||
<text class="label">赔付日期</text>
|
||||
<text class="value">{{ claim.payoutDate }}</text>
|
||||
</view>
|
||||
<view v-if="claim.rejectionReason" class="claim-row">
|
||||
<text class="label">拒绝原因</text>
|
||||
<text class="value reject">{{ claim.rejectionReason }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="claim-footer">
|
||||
<text class="material-count">已上传 {{ claim.materials.length }} 份材料</text>
|
||||
<text class="arrow-icon i-carbon-chevron-right" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view v-else class="empty-state">
|
||||
<text class="empty-icon i-carbon-document" />
|
||||
<text class="empty-text">暂无理赔申请</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.claim-list-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
background: #fff;
|
||||
display: flex;
|
||||
padding: 0 30rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
|
||||
&.active {
|
||||
color: #00c05a;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.tab-indicator {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 60rpx;
|
||||
height: 4rpx;
|
||||
background: #00c05a;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.claim-list {
|
||||
padding: 20rpx;
|
||||
|
||||
.claim-item {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.claim-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.claim-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
|
||||
.policy-no {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.company-name {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
padding: 8rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.claim-body {
|
||||
background: #f8f9fa;
|
||||
border-radius: 12rpx;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.claim-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 12rpx 0;
|
||||
font-size: 26rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #333;
|
||||
text-align: right;
|
||||
flex: 1;
|
||||
|
||||
&.amount {
|
||||
color: #ff8f0d;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.reason {
|
||||
text-align: left;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
&.payout {
|
||||
color: #00c05a;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.reject {
|
||||
color: #fa4350;
|
||||
text-align: left;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.claim-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-top: 12rpx;
|
||||
|
||||
.material-count {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
font-size: 28rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
|
||||
.empty-icon {
|
||||
font-size: 80rpx;
|
||||
margin-bottom: 20rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
380
src/pagesBank/insurance/company/select.vue
Normal file
380
src/pagesBank/insurance/company/select.vue
Normal file
@@ -0,0 +1,380 @@
|
||||
<script lang="ts" setup>
|
||||
import type { InsuranceCompany, InsuranceProduct } from '@/api/types/insurance'
|
||||
import { getInsuranceCompanies, getInsuranceProducts } from '@/api/insurance'
|
||||
|
||||
definePage({
|
||||
style: {
|
||||
navigationBarTitleText: '选择保险公司',
|
||||
},
|
||||
})
|
||||
|
||||
const loanId = ref('')
|
||||
const loanAmount = ref(0)
|
||||
const loanTerm = ref(0)
|
||||
const loading = ref(false)
|
||||
const searchKeyword = ref('')
|
||||
const companies = ref<InsuranceCompany[]>([])
|
||||
const productsCount = ref<Record<string, number>>({})
|
||||
|
||||
const filteredCompanies = computed(() => {
|
||||
if (!searchKeyword.value.trim())
|
||||
return companies.value
|
||||
const keyword = searchKeyword.value.toLowerCase()
|
||||
return companies.value.filter(company =>
|
||||
company.name.toLowerCase().includes(keyword)
|
||||
|| company.contactInfo.toLowerCase().includes(keyword),
|
||||
)
|
||||
})
|
||||
|
||||
function handleSearch() {
|
||||
}
|
||||
|
||||
function handleClearSearch() {
|
||||
searchKeyword.value = ''
|
||||
}
|
||||
|
||||
async function loadCompanies() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getInsuranceCompanies()
|
||||
companies.value = res.list
|
||||
for (const company of companies.value) {
|
||||
const productsRes = await getInsuranceProducts(company.id)
|
||||
productsCount.value[company.id] = productsRes.list.length
|
||||
}
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSelectCompany(company: InsuranceCompany) {
|
||||
uni.navigateTo({
|
||||
url: `/pagesBank/insurance/product/select?loanId=${loanId.value}&companyId=${company.id}&loanAmount=${loanAmount.value}&loanTerm=${loanTerm.value}`,
|
||||
})
|
||||
}
|
||||
|
||||
function handleGoBack() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
if (options?.loanId)
|
||||
loanId.value = options.loanId
|
||||
if (options?.loanAmount)
|
||||
loanAmount.value = Number(options.loanAmount)
|
||||
if (options?.loanTerm)
|
||||
loanTerm.value = Number(options.loanTerm)
|
||||
loadCompanies()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="company-select-page">
|
||||
<view class="header">
|
||||
<view class="back-btn" @click="handleGoBack">
|
||||
<text class="i-carbon-arrow-left" />
|
||||
</view>
|
||||
<text class="header-title">选择保险公司</text>
|
||||
</view>
|
||||
|
||||
<view class="search-bar">
|
||||
<view class="search-input-wrap">
|
||||
<text class="search-icon i-carbon-search" />
|
||||
<input
|
||||
v-model="searchKeyword"
|
||||
class="search-input"
|
||||
placeholder="搜索公司名称或联系方式"
|
||||
@input="handleSearch"
|
||||
>
|
||||
<text v-if="searchKeyword" class="clear-icon" @click="handleClearSearch">×</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="loading" class="loading-state">
|
||||
加载中...
|
||||
</view>
|
||||
|
||||
<view v-else-if="filteredCompanies.length > 0" class="company-list">
|
||||
<view
|
||||
v-for="company in filteredCompanies"
|
||||
:key="company.id"
|
||||
class="company-item"
|
||||
@click="handleSelectCompany(company)"
|
||||
>
|
||||
<view class="company-main">
|
||||
<view class="company-avatar">
|
||||
<text class="i-carbon-building" />
|
||||
</view>
|
||||
<view class="company-info">
|
||||
<text class="company-name">{{ company.name }}</text>
|
||||
<view class="company-meta">
|
||||
<text class="contact">
|
||||
<text class="i-carbon-phone" />
|
||||
{{ company.contactInfo }}
|
||||
</text>
|
||||
<text class="status active">
|
||||
<text class="i-carbon-checkmark" />
|
||||
合作中
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="company-action">
|
||||
<text class="product-count">{{ productsCount[company.id] || 0 }}个产品</text>
|
||||
<text class="select-icon i-carbon-chevron-right" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-else class="empty-state">
|
||||
<text class="empty-icon i-carbon-search" />
|
||||
<text class="empty-text">未找到相关保险公司</text>
|
||||
</view>
|
||||
|
||||
<view v-if="!loading && filteredCompanies.length > 0" class="tips-card">
|
||||
<view class="tips-header">
|
||||
<text class="tips-icon i-carbon-information" />
|
||||
<text class="tips-title">温馨提示</text>
|
||||
</view>
|
||||
<view class="tips-content">
|
||||
<text class="tips-item">请选择为您发放贷款的保险公司</text>
|
||||
<text class="tips-item">选择后将进入产品选择页面</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.company-select-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 20rpx 30rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
.back-btn {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
|
||||
text {
|
||||
font-size: 36rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.header-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
background: #fff;
|
||||
padding: 20rpx 30rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
.search-input-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #f5f7fa;
|
||||
border-radius: 36rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
|
||||
.search-icon {
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.clear-icon {
|
||||
font-size: 36rpx;
|
||||
color: #999;
|
||||
padding: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.company-list {
|
||||
padding: 20rpx;
|
||||
|
||||
.company-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.company-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
|
||||
.company-avatar {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
background: linear-gradient(135deg, #00c05a 0%, #34d19d 100%);
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
|
||||
text {
|
||||
font-size: 40rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.company-info {
|
||||
flex: 1;
|
||||
|
||||
.company-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 12rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.company-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
|
||||
.contact {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
|
||||
text:first-child {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
&.active {
|
||||
color: #00c05a;
|
||||
}
|
||||
|
||||
text:first-child {
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.company-action {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
|
||||
.product-count {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.select-icon {
|
||||
font-size: 28rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
|
||||
.empty-icon {
|
||||
font-size: 80rpx;
|
||||
margin-bottom: 20rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.tips-card {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: #fff;
|
||||
padding: 24rpx 30rpx;
|
||||
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
.tips-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
margin-bottom: 12rpx;
|
||||
|
||||
.tips-icon {
|
||||
font-size: 28rpx;
|
||||
color: #f59e0b;
|
||||
}
|
||||
|
||||
.tips-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.tips-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
|
||||
.tips-item {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
270
src/pagesBank/insurance/policy/detail.vue
Normal file
270
src/pagesBank/insurance/policy/detail.vue
Normal file
@@ -0,0 +1,270 @@
|
||||
<script lang="ts" setup>
|
||||
import type { InsurancePolicy } from '@/api/types/insurance'
|
||||
import { getInsurancePolicyDetail } from '@/api/insurance'
|
||||
|
||||
definePage({
|
||||
style: {
|
||||
navigationBarTitleText: '保险单详情',
|
||||
},
|
||||
})
|
||||
|
||||
const policyId = ref('')
|
||||
const policy = ref<InsurancePolicy | null>(null)
|
||||
const loading = ref(false)
|
||||
|
||||
// 状态映射
|
||||
const statusMap: Record<string, { text: string, color: string }> = {
|
||||
active: { text: '生效中', color: '#00c05a' },
|
||||
expired: { text: '已过期', color: '#999' },
|
||||
cancelled: { text: '已取消', color: '#fa4350' },
|
||||
}
|
||||
|
||||
const statusInfo = computed(() => {
|
||||
if (!policy.value)
|
||||
return null
|
||||
return statusMap[policy.value.status] || { text: policy.value.status, color: '#666' }
|
||||
})
|
||||
|
||||
async function loadDetail() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getInsurancePolicyDetail(policyId.value)
|
||||
policy.value = res
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
if (options?.id) {
|
||||
policyId.value = options.id
|
||||
loadDetail()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="policy-detail-page">
|
||||
<view v-if="loading" class="loading-state">
|
||||
加载中...
|
||||
</view>
|
||||
|
||||
<template v-else-if="policy">
|
||||
<!-- 状态卡片 -->
|
||||
<view class="status-card" :style="{ background: statusInfo?.color }">
|
||||
<text class="status-text">{{ statusInfo?.text }}</text>
|
||||
<text class="policy-no">保险单号: {{ policy.policyNumber }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 基本信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
基本信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">保险单号</text>
|
||||
<text class="value">{{ policy.policyNumber }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">出单时间</text>
|
||||
<text class="value">{{ policy.issuedAt }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 保险公司信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
保险公司信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">保险公司</text>
|
||||
<text class="value">{{ policy.companyName }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">保险产品</text>
|
||||
<text class="value">{{ policy.productName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 保险信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
保险信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">保险金额</text>
|
||||
<text class="value amount">{{ policy.insuranceAmount }}元</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">保险期限</text>
|
||||
<text class="value">{{ policy.insuranceTerm }}月</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">开始日期</text>
|
||||
<text class="value">{{ policy.startDate }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">结束日期</text>
|
||||
<text class="value">{{ policy.endDate }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 关联信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
关联信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">投保申请号</text>
|
||||
<text class="value">{{ policy.applicationId }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">贷款编号</text>
|
||||
<text class="value">{{ policy.loanId }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 操作提示 -->
|
||||
<view v-if="policy.status === 'active'" class="tips-card">
|
||||
<view class="tips-header">
|
||||
<text class="i-carbon-information tips-icon" />
|
||||
<text class="tips-title">温馨提示</text>
|
||||
</view>
|
||||
<view class="tips-content">
|
||||
<text class="tips-item">• 保险单生效期间,如发生保险事故,可发起理赔申请</text>
|
||||
<text class="tips-item">• 理赔申请需提供相关证明材料</text>
|
||||
<text class="tips-item">• 保险单到期后自动失效,需重新购买保险</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.policy-detail-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.loading-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.status-card {
|
||||
background: linear-gradient(135deg, #00c05a 0%, #34d19d 100%);
|
||||
border-radius: 16rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
text-align: center;
|
||||
|
||||
.status-text {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.policy-no {
|
||||
font-size: 24rpx;
|
||||
opacity: 0.9;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.section-card {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.card-header {
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.info-list {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 16rpx 0;
|
||||
font-size: 26rpx;
|
||||
border-bottom: 1rpx solid #f9f9f9;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #333;
|
||||
text-align: right;
|
||||
|
||||
&.amount {
|
||||
color: #ff8f0d;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tips-card {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.tips-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.tips-icon {
|
||||
font-size: 28rpx;
|
||||
color: #f59e0b;
|
||||
}
|
||||
|
||||
.tips-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.tips-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12rpx;
|
||||
|
||||
.tips-item {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
582
src/pagesBank/insurance/product/select.vue
Normal file
582
src/pagesBank/insurance/product/select.vue
Normal file
@@ -0,0 +1,582 @@
|
||||
<script lang="ts" setup>
|
||||
import type { InsuranceCompany, InsuranceProduct } from '@/api/types/insurance'
|
||||
import { getInsuranceCompanies, getInsuranceProducts } from '@/api/insurance'
|
||||
|
||||
definePage({
|
||||
style: {
|
||||
navigationBarTitleText: '选择保险产品',
|
||||
},
|
||||
})
|
||||
|
||||
const loanId = ref('')
|
||||
const companyId = ref('')
|
||||
const companyName = ref('')
|
||||
const loanAmount = ref(0)
|
||||
const loanTerm = ref(0)
|
||||
const loading = ref(false)
|
||||
const searchKeyword = ref('')
|
||||
const products = ref<InsuranceProduct[]>([])
|
||||
const selectedProduct = ref<InsuranceProduct | null>(null)
|
||||
const showDetailModal = ref(false)
|
||||
|
||||
const filteredProducts = computed(() => {
|
||||
if (!searchKeyword.value.trim())
|
||||
return products.value
|
||||
const keyword = searchKeyword.value.toLowerCase()
|
||||
return products.value.filter(product =>
|
||||
product.name.toLowerCase().includes(keyword)
|
||||
|| product.description.toLowerCase().includes(keyword)
|
||||
|| product.type.toLowerCase().includes(keyword),
|
||||
)
|
||||
})
|
||||
|
||||
function getProductTypeText(type: string) {
|
||||
const typeMap: Record<string, string> = {
|
||||
housing_loan: '住房贷款',
|
||||
business_credit: '企业信贷',
|
||||
other: '其他',
|
||||
}
|
||||
return typeMap[type] || type
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
}
|
||||
|
||||
function handleClearSearch() {
|
||||
searchKeyword.value = ''
|
||||
}
|
||||
|
||||
async function loadProducts() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getInsuranceProducts(companyId.value)
|
||||
products.value = res.list
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleShowDetail(product: InsuranceProduct) {
|
||||
selectedProduct.value = product
|
||||
showDetailModal.value = true
|
||||
}
|
||||
|
||||
function handleCloseDetail() {
|
||||
showDetailModal.value = false
|
||||
selectedProduct.value = null
|
||||
}
|
||||
|
||||
function handleSelectProduct(product: InsuranceProduct) {
|
||||
uni.navigateTo({
|
||||
url: `/pagesBank/insurance/application/create?loanId=${loanId.value}&companyId=${companyId.value}&productId=${product.id}&loanAmount=${loanAmount.value}&loanTerm=${loanTerm.value}`,
|
||||
})
|
||||
}
|
||||
|
||||
function handleGoBack() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
onLoad(async (options) => {
|
||||
if (options?.loanId)
|
||||
loanId.value = options.loanId
|
||||
if (options?.companyId)
|
||||
companyId.value = options.companyId
|
||||
if (options?.loanAmount)
|
||||
loanAmount.value = Number(options.loanAmount)
|
||||
if (options?.loanTerm)
|
||||
loanTerm.value = Number(options.loanTerm)
|
||||
|
||||
if (companyId.value) {
|
||||
const companyRes = await getInsuranceCompanies()
|
||||
const company = companyRes.list.find(c => c.id === companyId.value)
|
||||
if (company)
|
||||
companyName.value = company.name
|
||||
loadProducts()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="product-select-page">
|
||||
<view class="header">
|
||||
<view class="back-btn" @click="handleGoBack">
|
||||
<text class="i-carbon-arrow-left" />
|
||||
</view>
|
||||
<text class="header-title">{{ companyName }} - 选择产品</text>
|
||||
</view>
|
||||
|
||||
<view class="search-bar">
|
||||
<view class="search-input-wrap">
|
||||
<text class="search-icon i-carbon-search" />
|
||||
<input
|
||||
v-model="searchKeyword"
|
||||
class="search-input"
|
||||
placeholder="搜索产品名称/类型/描述"
|
||||
@input="handleSearch"
|
||||
>
|
||||
<text v-if="searchKeyword" class="clear-icon" @click="handleClearSearch">×</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="loading" class="loading-state">
|
||||
加载中...
|
||||
</view>
|
||||
|
||||
<view v-else-if="filteredProducts.length > 0" class="product-list">
|
||||
<view
|
||||
v-for="product in filteredProducts"
|
||||
:key="product.id"
|
||||
class="product-item"
|
||||
@click="handleSelectProduct(product)"
|
||||
>
|
||||
<view class="product-main">
|
||||
<view class="product-icon">
|
||||
<text class="i-carbon-security" />
|
||||
</view>
|
||||
<view class="product-info">
|
||||
<text class="product-name">{{ product.name }}</text>
|
||||
<view class="product-tags">
|
||||
<view class="tag type">
|
||||
{{ getProductTypeText(product.type) }}
|
||||
</view>
|
||||
</view>
|
||||
<text class="product-desc">{{ product.description }}</text>
|
||||
<view class="product-range">
|
||||
<text class="range-label">保险金额范围:</text>
|
||||
<text class="range-value">{{ (product.minAmount / 10000).toFixed(0) }}万 - {{ (product.maxAmount / 10000).toFixed(0) }}万</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="product-actions">
|
||||
<view class="info-btn" @click.stop="handleShowDetail(product)">
|
||||
<text class="i-carbon-information" />
|
||||
<text>详情</text>
|
||||
</view>
|
||||
<text class="select-icon i-carbon-chevron-right" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-else class="empty-state">
|
||||
<text class="empty-icon i-carbon-search" />
|
||||
<text class="empty-text">未找到相关产品</text>
|
||||
</view>
|
||||
|
||||
<view v-if="!loading && filteredProducts.length > 0" class="tips-card">
|
||||
<view class="tips-header">
|
||||
<text class="tips-icon i-carbon-information" />
|
||||
<text class="tips-title">温馨提示</text>
|
||||
</view>
|
||||
<view class="tips-content">
|
||||
<text class="tips-item">请选择适合的保险产品</text>
|
||||
<text class="tips-item">保险金额建议与贷款金额一致</text>
|
||||
<text class="tips-item">保险期限建议与贷款期限一致</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="showDetailModal && selectedProduct" class="modal-mask" @click="handleCloseDetail">
|
||||
<view class="modal-content" @click.stop>
|
||||
<view class="modal-header">
|
||||
<text class="modal-title">产品详情</text>
|
||||
<view class="close-btn" @click="handleCloseDetail">
|
||||
<text class="i-carbon-close" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="modal-body">
|
||||
<view class="detail-row">
|
||||
<text class="detail-label">产品名称</text>
|
||||
<text class="detail-value">{{ selectedProduct.name }}</text>
|
||||
</view>
|
||||
<view class="detail-row">
|
||||
<text class="detail-label">所属公司</text>
|
||||
<text class="detail-value">{{ companyName }}</text>
|
||||
</view>
|
||||
<view class="detail-row">
|
||||
<text class="detail-label">产品类型</text>
|
||||
<text class="detail-value">{{ getProductTypeText(selectedProduct.type) }}</text>
|
||||
</view>
|
||||
<view class="detail-row">
|
||||
<text class="detail-label">产品描述</text>
|
||||
<text class="detail-value desc">{{ selectedProduct.description }}</text>
|
||||
</view>
|
||||
<view class="detail-row">
|
||||
<text class="detail-label">最低金额</text>
|
||||
<text class="detail-value amount">{{ (selectedProduct.minAmount / 10000).toFixed(2) }}万</text>
|
||||
</view>
|
||||
<view class="detail-row">
|
||||
<text class="detail-label">最高金额</text>
|
||||
<text class="detail-value amount">{{ (selectedProduct.maxAmount / 10000).toFixed(2) }}万</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="modal-footer">
|
||||
<button class="btn" @click="handleSelectProduct(selectedProduct)">
|
||||
选择此产品
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.product-select-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
padding-bottom: 200rpx;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 20rpx 30rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
.back-btn {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
|
||||
text {
|
||||
font-size: 36rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.header-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
margin-right: 60rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
background: #fff;
|
||||
padding: 20rpx 30rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
.search-input-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #f5f7fa;
|
||||
border-radius: 36rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
|
||||
.search-icon {
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.clear-icon {
|
||||
font-size: 36rpx;
|
||||
color: #999;
|
||||
padding: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.product-list {
|
||||
padding: 20rpx;
|
||||
|
||||
.product-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.product-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
|
||||
.product-icon {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
background: linear-gradient(135deg, #00c05a 0%, #34d19d 100%);
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
|
||||
text {
|
||||
font-size: 40rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.product-info {
|
||||
flex: 1;
|
||||
|
||||
.product-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 8rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.product-tags {
|
||||
display: flex;
|
||||
gap: 12rpx;
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
.tag {
|
||||
display: inline-block;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 6rpx;
|
||||
font-size: 22rpx;
|
||||
|
||||
&.type {
|
||||
background: #e6f7eb;
|
||||
color: #00c05a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.product-desc {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 12rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.product-range {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
|
||||
.range-label {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.range-value {
|
||||
font-size: 24rpx;
|
||||
color: #ff8f0d;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.product-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
|
||||
.info-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6rpx;
|
||||
padding: 8rpx 16rpx;
|
||||
background: #f5f7fa;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
|
||||
text:first-child {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
text:last-child {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.select-icon {
|
||||
font-size: 28rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
|
||||
.empty-icon {
|
||||
font-size: 80rpx;
|
||||
margin-bottom: 20rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.tips-card {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: #fff;
|
||||
padding: 24rpx 30rpx;
|
||||
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
.tips-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
margin-bottom: 12rpx;
|
||||
|
||||
.tips-icon {
|
||||
font-size: 28rpx;
|
||||
color: #f59e0b;
|
||||
}
|
||||
|
||||
.tips-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.tips-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
|
||||
.tips-item {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.modal-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
width: 600rpx;
|
||||
max-height: 80vh;
|
||||
overflow-y: auto;
|
||||
|
||||
.modal-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
|
||||
.modal-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
text {
|
||||
font-size: 36rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
padding: 0 30rpx 30rpx;
|
||||
|
||||
.detail-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 16rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
flex-shrink: 0;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
|
||||
&.desc {
|
||||
text-align: left;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
&.amount {
|
||||
color: #ff8f0d;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
padding: 20rpx 30rpx 30rpx;
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
background: #00c05a;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
491
src/pagesInsurance/claim-review/detail.vue
Normal file
491
src/pagesInsurance/claim-review/detail.vue
Normal file
@@ -0,0 +1,491 @@
|
||||
<script lang="ts" setup>
|
||||
import type { ClaimApplication } from '@/api/types/insurance'
|
||||
import { getClaimApplicationDetail, reviewClaimApplication } from '@/api/insurance'
|
||||
|
||||
definePage({
|
||||
style: {
|
||||
navigationBarTitleText: '理赔审核详情',
|
||||
},
|
||||
})
|
||||
|
||||
const claimId = ref('')
|
||||
const claim = ref<ClaimApplication | null>(null)
|
||||
const loading = ref(false)
|
||||
const reviewing = ref(false)
|
||||
const rejectionReason = ref('')
|
||||
const payoutAmount = ref('')
|
||||
|
||||
// 状态映射
|
||||
const statusMap: Record<string, { text: string, color: string }> = {
|
||||
pending: { text: '待审核', color: '#F59E0B' },
|
||||
approved: { text: '已通过', color: '#00c05a' },
|
||||
rejected: { text: '已拒绝', color: '#fa4350' },
|
||||
}
|
||||
|
||||
const statusInfo = computed(() => {
|
||||
if (!claim.value)
|
||||
return null
|
||||
return statusMap[claim.value.status] || { text: claim.value.status, color: '#666' }
|
||||
})
|
||||
|
||||
async function loadDetail() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getClaimApplicationDetail(claimId.value)
|
||||
claim.value = res
|
||||
if (res.payoutAmount) {
|
||||
payoutAmount.value = res.payoutAmount.toString()
|
||||
}
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 预览图片
|
||||
function handlePreviewImage(url: string) {
|
||||
uni.previewImage({
|
||||
urls: [url],
|
||||
})
|
||||
}
|
||||
|
||||
// 理赔审核通过
|
||||
async function handleApprove() {
|
||||
if (!payoutAmount.value || Number(payoutAmount.value) <= 0) {
|
||||
uni.showToast({ title: '请输入赔付金额', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
reviewing.value = true
|
||||
try {
|
||||
await reviewClaimApplication(claimId.value, {
|
||||
approved: true,
|
||||
payoutAmount: Number(payoutAmount.value),
|
||||
})
|
||||
uni.showToast({ title: '审核通过', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
finally {
|
||||
reviewing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 理赔审核拒绝
|
||||
async function handleReject() {
|
||||
if (!rejectionReason.value) {
|
||||
uni.showToast({ title: '请填写拒绝原因', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
reviewing.value = true
|
||||
try {
|
||||
await reviewClaimApplication(claimId.value, {
|
||||
approved: false,
|
||||
rejectionReason: rejectionReason.value,
|
||||
})
|
||||
uni.showToast({ title: '已拒绝', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
finally {
|
||||
reviewing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
if (options?.id) {
|
||||
claimId.value = options.id
|
||||
loadDetail()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="claim-review-detail-page">
|
||||
<view v-if="loading" class="loading-state">
|
||||
加载中...
|
||||
</view>
|
||||
|
||||
<template v-else-if="claim">
|
||||
<!-- 状态卡片 -->
|
||||
<view class="status-card" :style="{ background: statusInfo?.color }">
|
||||
<text class="status-text">{{ statusInfo?.text }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 银行信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
银行信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">银行名称</text>
|
||||
<text class="value">{{ claim.bankName }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">保险单号</text>
|
||||
<text class="value">{{ claim.policyNumber }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 保险公司信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
保险公司信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">保险公司</text>
|
||||
<text class="value">{{ claim.companyName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 理赔信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
理赔信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">理赔金额</text>
|
||||
<text class="value amount">{{ claim.claimAmount }}元</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">理赔原因</text>
|
||||
<text class="value reason">{{ claim.claimReason }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">提交时间</text>
|
||||
<text class="value">{{ claim.submittedAt }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 理赔材料 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
理赔材料
|
||||
</view>
|
||||
<view class="materials-list">
|
||||
<view
|
||||
v-for="material in claim.materials"
|
||||
:key="material.id"
|
||||
class="material-item"
|
||||
@click="handlePreviewImage(material.url)"
|
||||
>
|
||||
<image :src="material.url" mode="aspectFill" />
|
||||
<view class="material-info">
|
||||
<text class="material-name">{{ material.name }}</text>
|
||||
<text class="upload-time">{{ material.uploadTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 审核操作 -->
|
||||
<view v-if="claim.status === 'pending'" class="action-card">
|
||||
<view class="card-header">
|
||||
理赔审核
|
||||
</view>
|
||||
<view class="action-buttons">
|
||||
<button
|
||||
class="btn approve"
|
||||
:disabled="reviewing"
|
||||
@click="handleApprove"
|
||||
>
|
||||
<text v-if="reviewing">处理中...</text>
|
||||
<text v-else>通过</text>
|
||||
</button>
|
||||
<button
|
||||
class="btn reject"
|
||||
:disabled="reviewing"
|
||||
@click="handleReject"
|
||||
>
|
||||
<text v-if="reviewing">处理中...</text>
|
||||
<text v-else>拒绝</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="payout-input">
|
||||
<text class="label">赔付金额(元)</text>
|
||||
<input
|
||||
v-model="payoutAmount"
|
||||
type="digit"
|
||||
class="input"
|
||||
placeholder="请输入赔付金额"
|
||||
>
|
||||
</view>
|
||||
<view v-if="!reviewing" class="reject-reason">
|
||||
<textarea
|
||||
v-model="rejectionReason"
|
||||
class="textarea"
|
||||
placeholder="请输入拒绝原因..."
|
||||
:maxlength="500"
|
||||
/>
|
||||
<text class="char-count">{{ rejectionReason.length }}/500</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 已审核信息 -->
|
||||
<view v-if="claim.status !== 'pending'" class="section-card">
|
||||
<view class="card-header">
|
||||
审核信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">审核时间</text>
|
||||
<text class="value">{{ claim.reviewedAt }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">审核人员</text>
|
||||
<text class="value">{{ claim.reviewedBy }}</text>
|
||||
</view>
|
||||
<view v-if="claim.payoutAmount" class="info-item">
|
||||
<text class="label">赔付金额</text>
|
||||
<text class="value payout">{{ claim.payoutAmount }}元</text>
|
||||
</view>
|
||||
<view v-if="claim.payoutDate" class="info-item">
|
||||
<text class="label">赔付日期</text>
|
||||
<text class="value">{{ claim.payoutDate }}</text>
|
||||
</view>
|
||||
<view v-if="claim.rejectionReason" class="info-item full">
|
||||
<text class="label">拒绝原因</text>
|
||||
<text class="value reason">{{ claim.rejectionReason }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.claim-review-detail-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
padding: 20rpx;
|
||||
padding-bottom: 120rpx;
|
||||
}
|
||||
|
||||
.loading-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.status-card {
|
||||
background: linear-gradient(135deg, #00c05a 0%, #34d19d 100%);
|
||||
border-radius: 16rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
text-align: center;
|
||||
|
||||
.status-text {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.section-card {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.card-header {
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.info-list {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 16rpx 0;
|
||||
font-size: 26rpx;
|
||||
border-bottom: 1rpx solid #f9f9f9;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #333;
|
||||
text-align: right;
|
||||
|
||||
&.amount {
|
||||
color: #ff8f0d;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.reason {
|
||||
text-align: left;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
&.payout {
|
||||
color: #00c05a;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
&.full {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
|
||||
.value {
|
||||
margin-top: 8rpx;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.materials-list {
|
||||
padding: 20rpx 0;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 16rpx;
|
||||
|
||||
.material-item {
|
||||
position: relative;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
background: #f8f9fa;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.material-info {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
padding: 12rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4rpx;
|
||||
|
||||
.material-name {
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.upload-time {
|
||||
font-size: 20rpx;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.action-card {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.card-header {
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
padding: 20rpx 0;
|
||||
|
||||
.btn {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
|
||||
&.approve {
|
||||
background: #00c05a;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&.reject {
|
||||
background: #fa4350;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.payout-input {
|
||||
padding: 0 0 20rpx 0;
|
||||
|
||||
.label {
|
||||
display: block;
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
padding: 16rpx;
|
||||
background: #f8f9fa;
|
||||
border-radius: 8rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.reject-reason {
|
||||
padding: 0 0 20rpx 0;
|
||||
|
||||
.textarea {
|
||||
width: 100%;
|
||||
min-height: 150rpx;
|
||||
padding: 16rpx;
|
||||
background: #f8f9fa;
|
||||
border-radius: 8rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.char-count {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
text-align: right;
|
||||
margin-top: 8rpx;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
339
src/pagesInsurance/claim-review/list.vue
Normal file
339
src/pagesInsurance/claim-review/list.vue
Normal file
@@ -0,0 +1,339 @@
|
||||
<script lang="ts" setup>
|
||||
import type { ClaimApplication } from '@/api/types/insurance'
|
||||
import { getClaimReviewApplications } from '@/api/insurance'
|
||||
|
||||
definePage({
|
||||
style: {
|
||||
navigationBarTitleText: '理赔审核',
|
||||
},
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const claims = ref<ClaimApplication[]>([])
|
||||
const currentTab = ref('pending')
|
||||
|
||||
// 状态映射
|
||||
const statusMap: Record<string, { text: string, color: string }> = {
|
||||
pending: { text: '待审核', color: '#F59E0B' },
|
||||
approved: { text: '已通过', color: '#00c05a' },
|
||||
rejected: { text: '已拒绝', color: '#fa4350' },
|
||||
}
|
||||
|
||||
const tabs = [
|
||||
{ key: 'pending', label: '待审核' },
|
||||
{ key: 'approved', label: '已通过' },
|
||||
{ key: 'rejected', label: '已拒绝' },
|
||||
]
|
||||
|
||||
// 筛选后的列表
|
||||
const filteredClaims = computed(() => {
|
||||
if (currentTab.value === 'pending') {
|
||||
return claims.value.filter(c => c.status === 'pending')
|
||||
}
|
||||
return claims.value.filter(c => c.status === currentTab.value)
|
||||
})
|
||||
|
||||
// 切换标签
|
||||
function handleTabChange(tab: string) {
|
||||
currentTab.value = tab
|
||||
}
|
||||
|
||||
// 查看详情
|
||||
function handleViewDetail(id: string) {
|
||||
uni.navigateTo({
|
||||
url: `/pagesInsurance/claim-review/detail?id=${id}`,
|
||||
})
|
||||
}
|
||||
|
||||
// 加载列表
|
||||
async function loadList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getClaimReviewApplications()
|
||||
claims.value = res.list
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
loadList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="claim-review-list-page">
|
||||
<!-- 标签页 -->
|
||||
<view class="tabs">
|
||||
<view
|
||||
v-for="tab in tabs"
|
||||
:key="tab.key"
|
||||
class="tab-item"
|
||||
:class="{ active: currentTab === tab.key }"
|
||||
@click="handleTabChange(tab.key)"
|
||||
>
|
||||
<text class="tab-text">{{ tab.label }}</text>
|
||||
<view v-if="currentTab === tab.key" class="tab-indicator" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<view v-if="loading" class="loading-state">
|
||||
加载中...
|
||||
</view>
|
||||
|
||||
<view v-else-if="filteredClaims.length > 0" class="claim-list">
|
||||
<view
|
||||
v-for="claim in filteredClaims"
|
||||
:key="claim.id"
|
||||
class="claim-item"
|
||||
@click="handleViewDetail(claim.id)"
|
||||
>
|
||||
<view class="claim-header">
|
||||
<view class="claim-info">
|
||||
<text class="claim-id">理赔申请号: {{ claim.id }}</text>
|
||||
<text class="bank-name">{{ claim.bankName }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="status-tag"
|
||||
:style="{ background: statusMap[claim.status]?.color }"
|
||||
>
|
||||
{{ statusMap[claim.status]?.text }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="claim-body">
|
||||
<view class="claim-row">
|
||||
<text class="label">保险单号</text>
|
||||
<text class="value">{{ claim.policyNumber }}</text>
|
||||
</view>
|
||||
<view class="claim-row">
|
||||
<text class="label">保险公司</text>
|
||||
<text class="value">{{ claim.companyName }}</text>
|
||||
</view>
|
||||
<view class="claim-row">
|
||||
<text class="label">理赔金额</text>
|
||||
<text class="value amount">{{ claim.claimAmount }}元</text>
|
||||
</view>
|
||||
<view class="claim-row">
|
||||
<text class="label">理赔原因</text>
|
||||
<text class="value reason">{{ claim.claimReason }}</text>
|
||||
</view>
|
||||
<view class="claim-row">
|
||||
<text class="label">提交时间</text>
|
||||
<text class="value">{{ claim.submittedAt }}</text>
|
||||
</view>
|
||||
<view v-if="claim.payoutAmount" class="claim-row">
|
||||
<text class="label">赔付金额</text>
|
||||
<text class="value payout">{{ claim.payoutAmount }}元</text>
|
||||
</view>
|
||||
<view v-if="claim.payoutDate" class="claim-row">
|
||||
<text class="label">赔付日期</text>
|
||||
<text class="value">{{ claim.payoutDate }}</text>
|
||||
</view>
|
||||
<view v-if="claim.rejectionReason" class="claim-row">
|
||||
<text class="label">拒绝原因</text>
|
||||
<text class="value reject">{{ claim.rejectionReason }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="claim-footer">
|
||||
<text class="material-count">已上传 {{ claim.materials.length }} 份材料</text>
|
||||
<text class="arrow-icon i-carbon-chevron-right" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view v-else class="empty-state">
|
||||
<text class="empty-icon i-carbon-document" />
|
||||
<text class="empty-text">暂无理赔申请</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.claim-review-list-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
background: #fff;
|
||||
display: flex;
|
||||
padding: 0 30rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
|
||||
&.active {
|
||||
color: #00c05a;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.tab-indicator {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 60rpx;
|
||||
height: 4rpx;
|
||||
background: #00c05a;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.claim-list {
|
||||
padding: 20rpx;
|
||||
|
||||
.claim-item {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.claim-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.claim-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
|
||||
.claim-id {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.bank-name {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
padding: 8rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.claim-body {
|
||||
background: #f8f9fa;
|
||||
border-radius: 12rpx;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.claim-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 12rpx 0;
|
||||
font-size: 26rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #333;
|
||||
text-align: right;
|
||||
flex: 1;
|
||||
|
||||
&.amount {
|
||||
color: #ff8f0d;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.reason {
|
||||
text-align: left;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
&.payout {
|
||||
color: #00c05a;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.reject {
|
||||
color: #fa4350;
|
||||
text-align: left;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.claim-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-top: 12rpx;
|
||||
|
||||
.material-count {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
font-size: 28rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
|
||||
.empty-icon {
|
||||
font-size: 80rpx;
|
||||
margin-bottom: 20rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -58,7 +58,10 @@
|
||||
|
||||
<view class="card-status-bar">
|
||||
<text class="status-btn" :class="item.status">{{ item.statusText }}</text>
|
||||
<text class="i-carbon-chevron-right text-gray-400" />
|
||||
<view class="actions">
|
||||
<view class="view-policy-btn" @click="goPolicyDetail">查看保单</view>
|
||||
<text class="i-carbon-chevron-right text-gray-400" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -109,16 +112,58 @@ const claimList = ref([
|
||||
reason: '意外事故导致还款能力丧失',
|
||||
status: 'processing',
|
||||
statusText: '复核中'
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
claimNo: 'C20251228005',
|
||||
time: '2025-12-28 11:00',
|
||||
amount: 80000,
|
||||
bankName: '某某商业银行',
|
||||
customerName: '赵某某',
|
||||
reason: '企业破产清算',
|
||||
status: 'processing',
|
||||
statusText: '审核中'
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
claimNo: 'C20251215001',
|
||||
time: '2025-12-15 14:00',
|
||||
amount: 200000,
|
||||
bankName: '某某商业银行',
|
||||
customerName: '钱某某',
|
||||
reason: '贷款逾期超过180天',
|
||||
status: 'completed',
|
||||
statusText: '已赔付'
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
claimNo: 'C20251120003',
|
||||
time: '2025-11-20 09:30',
|
||||
amount: 60000,
|
||||
bankName: '某某村镇银行',
|
||||
customerName: '孙某某',
|
||||
reason: '资料不全,无法证明损失',
|
||||
status: 'rejected',
|
||||
statusText: '已拒绝'
|
||||
}
|
||||
])
|
||||
|
||||
const filteredList = computed(() => {
|
||||
if (currentTab.value === 'completed') {
|
||||
return claimList.value.filter(item => ['completed', 'rejected'].includes(item.status))
|
||||
}
|
||||
return claimList.value.filter(item => item.status === currentTab.value)
|
||||
})
|
||||
|
||||
function goDetail(id: string) {
|
||||
uni.navigateTo({ url: `/pagesInsurance/claim/detail?id=${id}` })
|
||||
}
|
||||
|
||||
function goPolicyDetail(e: Event) {
|
||||
e.stopPropagation()
|
||||
uni.showToast({ title: '查看保单详情', icon: 'none' })
|
||||
// uni.navigateTo({ url: `/pagesInsurance/policy/detail?id=1` })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -249,6 +294,26 @@ function goDetail(id: string) {
|
||||
&.pending { color: #f57c00; }
|
||||
&.processing { color: #0957DE; }
|
||||
&.completed { color: #38a169; }
|
||||
&.rejected { color: #fa4350; }
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
|
||||
.view-policy-btn {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
padding: 8rpx 20rpx;
|
||||
background: #f5f5f5;
|
||||
border-radius: 24rpx;
|
||||
|
||||
&:active {
|
||||
opacity: 0.8;
|
||||
background: #eee;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,18 @@
|
||||
<view class="policy-list">
|
||||
<!-- 搜索和筛选 -->
|
||||
<view class="header-search">
|
||||
<view class="action-buttons">
|
||||
<view class="action-btn" @click="goToUnderwriting">
|
||||
<text class="i-carbon-task icon"></text>
|
||||
<text>待核保</text>
|
||||
<view class="badge">3</view>
|
||||
</view>
|
||||
<view class="action-btn" @click="goToClaimReview">
|
||||
<text class="i-carbon-review icon"></text>
|
||||
<text>理赔审核</text>
|
||||
<view class="badge warning">2</view>
|
||||
</view>
|
||||
</view>
|
||||
<wd-search v-model="keyword" placeholder="搜索保单号/客户名" @search="onSearch" />
|
||||
<view class="filter-tabs">
|
||||
<view
|
||||
@@ -147,6 +159,14 @@ function goDetail(id: string) {
|
||||
function handleRenew(item: any) {
|
||||
uni.showToast({ title: '发起续保', icon: 'none' })
|
||||
}
|
||||
|
||||
function goToUnderwriting() {
|
||||
uni.navigateTo({ url: '/pagesInsurance/underwriting/list' })
|
||||
}
|
||||
|
||||
function goToClaimReview() {
|
||||
uni.navigateTo({ url: '/pagesInsurance/claim-review/list' })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -162,6 +182,48 @@ function handleRenew(item: any) {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
.action-btn {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12rpx;
|
||||
padding: 16rpx;
|
||||
background: #f8f9fa;
|
||||
border-radius: 12rpx;
|
||||
position: relative;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
|
||||
.icon {
|
||||
font-size: 32rpx;
|
||||
color: #0957DE;
|
||||
}
|
||||
|
||||
.badge {
|
||||
position: absolute;
|
||||
top: -6rpx;
|
||||
right: -6rpx;
|
||||
background: #fa4350;
|
||||
color: #fff;
|
||||
font-size: 20rpx;
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 20rpx;
|
||||
transform: scale(0.9);
|
||||
|
||||
&.warning {
|
||||
background: #ff8f0d;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.filter-tabs {
|
||||
|
||||
405
src/pagesInsurance/underwriting/detail.vue
Normal file
405
src/pagesInsurance/underwriting/detail.vue
Normal file
@@ -0,0 +1,405 @@
|
||||
<script lang="ts" setup>
|
||||
import type { InsuranceApplication } from '@/api/types/insurance'
|
||||
import { getInsuranceApplicationDetail, reviewUnderwritingApplication } from '@/api/insurance'
|
||||
|
||||
definePage({
|
||||
style: {
|
||||
navigationBarTitleText: '核保申请详情',
|
||||
},
|
||||
})
|
||||
|
||||
const applicationId = ref('')
|
||||
const application = ref<InsuranceApplication | null>(null)
|
||||
const loading = ref(false)
|
||||
const reviewing = ref(false)
|
||||
const rejectionReason = ref('')
|
||||
|
||||
// 状态映射
|
||||
const statusMap: Record<string, { text: string, color: string }> = {
|
||||
pending: { text: '待审核', color: '#F59E0B' },
|
||||
approved: { text: '已通过', color: '#00c05a' },
|
||||
rejected: { text: '已拒绝', color: '#fa4350' },
|
||||
}
|
||||
|
||||
const statusInfo = computed(() => {
|
||||
if (!application.value)
|
||||
return null
|
||||
return statusMap[application.value.status] || { text: application.value.status, color: '#666' }
|
||||
})
|
||||
|
||||
async function loadDetail() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getInsuranceApplicationDetail(applicationId.value)
|
||||
application.value = res
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 核保通过
|
||||
async function handleApprove() {
|
||||
reviewing.value = true
|
||||
try {
|
||||
await reviewUnderwritingApplication(applicationId.value, {
|
||||
approved: true,
|
||||
})
|
||||
uni.showToast({ title: '核保通过', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
finally {
|
||||
reviewing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 核保拒绝
|
||||
async function handleReject() {
|
||||
if (!rejectionReason.value) {
|
||||
uni.showToast({ title: '请填写拒绝原因', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
reviewing.value = true
|
||||
try {
|
||||
await reviewUnderwritingApplication(applicationId.value, {
|
||||
approved: false,
|
||||
rejectionReason: rejectionReason.value,
|
||||
})
|
||||
uni.showToast({ title: '已拒绝', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
finally {
|
||||
reviewing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
if (options?.id) {
|
||||
applicationId.value = options.id
|
||||
loadDetail()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="underwriting-detail-page">
|
||||
<view v-if="loading" class="loading-state">
|
||||
加载中...
|
||||
</view>
|
||||
|
||||
<template v-else-if="application">
|
||||
<!-- 状态卡片 -->
|
||||
<view class="status-card" :style="{ background: statusInfo?.color }">
|
||||
<text class="status-text">{{ statusInfo?.text }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 银行信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
银行信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">银行名称</text>
|
||||
<text class="value">{{ application.bankName }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">贷款编号</text>
|
||||
<text class="value">{{ application.loanId }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 保险公司信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
保险公司信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">保险公司</text>
|
||||
<text class="value">{{ application.companyName }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">保险产品</text>
|
||||
<text class="value">{{ application.productName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 客户信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
客户信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">客户姓名</text>
|
||||
<text class="value">{{ application.customerInfo.name }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">身份证号</text>
|
||||
<text class="value">{{ application.customerInfo.idNumber }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">信用评分</text>
|
||||
<text class="value score">{{ application.customerInfo.creditScore }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">贷款金额</text>
|
||||
<text class="value">{{ application.customerInfo.loanAmount }}元</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">贷款期限</text>
|
||||
<text class="value">{{ application.customerInfo.loanTerm }}月</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 保险信息 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
保险信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">保险金额</text>
|
||||
<text class="value amount">{{ application.insuranceAmount }}元</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">保险期限</text>
|
||||
<text class="value">{{ application.insuranceTerm }}月</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">申请时间</text>
|
||||
<text class="value">{{ application.createdAt }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 审核操作 -->
|
||||
<view v-if="application.status === 'pending'" class="action-card">
|
||||
<view class="card-header">
|
||||
核保审核
|
||||
</view>
|
||||
<view class="action-buttons">
|
||||
<button
|
||||
class="btn approve"
|
||||
:disabled="reviewing"
|
||||
@click="handleApprove"
|
||||
>
|
||||
<text v-if="reviewing">处理中...</text>
|
||||
<text v-else>通过</text>
|
||||
</button>
|
||||
<button
|
||||
class="btn reject"
|
||||
:disabled="reviewing"
|
||||
@click="handleReject"
|
||||
>
|
||||
<text v-if="reviewing">处理中...</text>
|
||||
<text v-else>拒绝</text>
|
||||
</button>
|
||||
</view>
|
||||
<view v-if="!reviewing" class="reject-reason">
|
||||
<textarea
|
||||
v-model="rejectionReason"
|
||||
class="textarea"
|
||||
placeholder="请输入拒绝原因..."
|
||||
:maxlength="500"
|
||||
/>
|
||||
<text class="char-count">{{ rejectionReason.length }}/500</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 已审核信息 -->
|
||||
<view v-if="application.status !== 'pending'" class="section-card">
|
||||
<view class="card-header">
|
||||
审核信息
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="label">审核时间</text>
|
||||
<text class="value">{{ application.reviewedAt }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">审核人员</text>
|
||||
<text class="value">{{ application.reviewedBy }}</text>
|
||||
</view>
|
||||
<view v-if="application.rejectionReason" class="info-item full">
|
||||
<text class="label">拒绝原因</text>
|
||||
<text class="value reason">{{ application.rejectionReason }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.underwriting-detail-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
padding: 20rpx;
|
||||
padding-bottom: 120rpx;
|
||||
}
|
||||
|
||||
.loading-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.status-card {
|
||||
background: linear-gradient(135deg, #00c05a 0%, #34d19d 100%);
|
||||
border-radius: 16rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
text-align: center;
|
||||
|
||||
.status-text {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.section-card {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.card-header {
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.action-card {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.card-header {
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
padding: 20rpx 0;
|
||||
|
||||
.btn {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
|
||||
&.approve {
|
||||
background: #00c05a;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&.reject {
|
||||
background: #fa4350;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.reject-reason {
|
||||
padding: 0 0 20rpx 0;
|
||||
|
||||
.textarea {
|
||||
width: 100%;
|
||||
min-height: 150rpx;
|
||||
padding: 16rpx;
|
||||
background: #f8f9fa;
|
||||
border-radius: 8rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.char-count {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
text-align: right;
|
||||
margin-top: 8rpx;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.info-list {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 16rpx 0;
|
||||
font-size: 26rpx;
|
||||
border-bottom: 1rpx solid #f9f9f9;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #333;
|
||||
text-align: right;
|
||||
|
||||
&.score {
|
||||
color: #00c05a;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.amount {
|
||||
color: #ff8f0d;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.reason {
|
||||
color: #fa4350;
|
||||
text-align: left;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
&.full {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
|
||||
.value {
|
||||
margin-top: 8rpx;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
321
src/pagesInsurance/underwriting/list.vue
Normal file
321
src/pagesInsurance/underwriting/list.vue
Normal file
@@ -0,0 +1,321 @@
|
||||
<script lang="ts" setup>
|
||||
import type { InsuranceApplication } from '@/api/types/insurance'
|
||||
import { getUnderwritingApplications } from '@/api/insurance'
|
||||
|
||||
definePage({
|
||||
style: {
|
||||
navigationBarTitleText: '待核保申请',
|
||||
},
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const applications = ref<InsuranceApplication[]>([])
|
||||
const currentTab = ref('pending')
|
||||
|
||||
// 状态映射
|
||||
const statusMap: Record<string, { text: string, color: string }> = {
|
||||
pending: { text: '待审核', color: '#F59E0B' },
|
||||
approved: { text: '已通过', color: '#00c05a' },
|
||||
rejected: { text: '已拒绝', color: '#fa4350' },
|
||||
}
|
||||
|
||||
const tabs = [
|
||||
{ key: 'pending', label: '待审核' },
|
||||
{ key: 'approved', label: '已通过' },
|
||||
{ key: 'rejected', label: '已拒绝' },
|
||||
]
|
||||
|
||||
// 筛选后的列表
|
||||
const filteredApplications = computed(() => {
|
||||
if (currentTab.value === 'pending') {
|
||||
return applications.value.filter(a => a.status === 'pending')
|
||||
}
|
||||
return applications.value.filter(a => a.status === currentTab.value)
|
||||
})
|
||||
|
||||
// 切换标签
|
||||
function handleTabChange(tab: string) {
|
||||
currentTab.value = tab
|
||||
}
|
||||
|
||||
// 查看详情
|
||||
function handleViewDetail(id: string) {
|
||||
uni.navigateTo({
|
||||
url: `/pagesInsurance/underwriting/detail?id=${id}`,
|
||||
})
|
||||
}
|
||||
|
||||
// 加载列表
|
||||
async function loadList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getUnderwritingApplications()
|
||||
applications.value = res.list
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
loadList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="underwriting-list-page">
|
||||
<!-- 标签页 -->
|
||||
<view class="tabs">
|
||||
<view
|
||||
v-for="tab in tabs"
|
||||
:key="tab.key"
|
||||
class="tab-item"
|
||||
:class="{ active: currentTab === tab.key }"
|
||||
@click="handleTabChange(tab.key)"
|
||||
>
|
||||
<text class="tab-text">{{ tab.label }}</text>
|
||||
<view v-if="currentTab === tab.key" class="tab-indicator" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<view v-if="loading" class="loading-state">
|
||||
加载中...
|
||||
</view>
|
||||
|
||||
<view v-else-if="filteredApplications.length > 0" class="application-list">
|
||||
<view
|
||||
v-for="app in filteredApplications"
|
||||
:key="app.id"
|
||||
class="application-item"
|
||||
@click="handleViewDetail(app.id)"
|
||||
>
|
||||
<view class="app-header">
|
||||
<view class="app-info">
|
||||
<text class="app-id">投保申请号: {{ app.id }}</text>
|
||||
<text class="bank-name">{{ app.bankName }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="status-tag"
|
||||
:style="{ background: statusMap[app.status]?.color }"
|
||||
>
|
||||
{{ statusMap[app.status]?.text }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="app-body">
|
||||
<view class="app-row">
|
||||
<text class="label">保险公司</text>
|
||||
<text class="value">{{ app.companyName }}</text>
|
||||
</view>
|
||||
<view class="app-row">
|
||||
<text class="label">保险产品</text>
|
||||
<text class="value">{{ app.productName }}</text>
|
||||
</view>
|
||||
<view class="app-row">
|
||||
<text class="label">保险金额</text>
|
||||
<text class="value amount">{{ app.insuranceAmount }}元</text>
|
||||
</view>
|
||||
<view class="app-row">
|
||||
<text class="label">保险期限</text>
|
||||
<text class="value">{{ app.insuranceTerm }}月</text>
|
||||
</view>
|
||||
<view class="app-row">
|
||||
<text class="label">客户姓名</text>
|
||||
<text class="value">{{ app.customerInfo.name }}</text>
|
||||
</view>
|
||||
<view class="app-row">
|
||||
<text class="label">信用评分</text>
|
||||
<text class="value score">{{ app.customerInfo.creditScore }}</text>
|
||||
</view>
|
||||
<view class="app-row">
|
||||
<text class="label">贷款金额</text>
|
||||
<text class="value">{{ app.customerInfo.loanAmount }}元</text>
|
||||
</view>
|
||||
<view class="app-row">
|
||||
<text class="label">申请时间</text>
|
||||
<text class="value">{{ app.createdAt }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="app-footer">
|
||||
<text class="arrow-icon i-carbon-chevron-right" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view v-else class="empty-state">
|
||||
<text class="empty-icon i-carbon-document" />
|
||||
<text class="empty-text">暂无投保申请</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.underwriting-list-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
background: #fff;
|
||||
display: flex;
|
||||
padding: 0 30rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
|
||||
&.active {
|
||||
color: #00c05a;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.tab-indicator {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 60rpx;
|
||||
height: 4rpx;
|
||||
background: #00c05a;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.application-list {
|
||||
padding: 20rpx;
|
||||
|
||||
.application-item {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.app-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.app-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
|
||||
.app-id {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.bank-name {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
padding: 8rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.app-body {
|
||||
background: #f8f9fa;
|
||||
border-radius: 12rpx;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.app-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 12rpx 0;
|
||||
font-size: 26rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #333;
|
||||
text-align: right;
|
||||
flex: 1;
|
||||
|
||||
&.amount {
|
||||
color: #ff8f0d;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.score {
|
||||
color: #00c05a;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.app-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding-top: 12rpx;
|
||||
|
||||
.arrow-icon {
|
||||
font-size: 28rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
|
||||
.empty-icon {
|
||||
font-size: 80rpx;
|
||||
margin-bottom: 20rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user