feat: 修复
This commit is contained in:
@@ -168,6 +168,7 @@ export function operateLoanApplication(id: string, action: string, data?: any) {
|
||||
case 'sign': item.status = LoanStatus.SIGNED; break;
|
||||
case 'disburse': item.status = LoanStatus.DISBURSED; break;
|
||||
case 'reject': item.status = LoanStatus.REJECTED; break;
|
||||
case 'request_supplement': item.status = LoanStatus.PENDING_SUPPLEMENT; break;
|
||||
}
|
||||
|
||||
// 添加记录
|
||||
|
||||
@@ -398,12 +398,37 @@ function handleBack() {
|
||||
// 商家选择相关
|
||||
import { getUserMerchants, submitLoanApplication } from '@/api/loan'
|
||||
import type { RelatedMerchant } from '@/typings/loan'
|
||||
import { useUserStore } from '@/store/user'
|
||||
|
||||
const merchantList = ref<RelatedMerchant[]>([])
|
||||
const userStore = useUserStore()
|
||||
|
||||
onMounted(async () => {
|
||||
// 1. 获取商户列表
|
||||
const res = await getUserMerchants()
|
||||
merchantList.value = res.list
|
||||
|
||||
// 2. 检查是否需要授权填充个人信息
|
||||
if (!formData.value.personalInfo.name) {
|
||||
uni.showModal({
|
||||
title: '授权申请',
|
||||
content: '允许本应用获取您的个人信息(姓名、电话、身份证)以自动填充申请表?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// 自动填充
|
||||
const { userInfo } = userStore
|
||||
if (userInfo) {
|
||||
formData.value.personalInfo.name = userInfo.nickname || userInfo.username || ''
|
||||
formData.value.personalInfo.phone = userInfo.phone || ''
|
||||
// 模拟身份证和地址 (因为 store 中暂无这些字段)
|
||||
formData.value.personalInfo.idCard = '110101199003078888'
|
||||
formData.value.personalInfo.region = ['北京市', '北京市', '东城区']
|
||||
formData.value.personalInfo.detailAddress = '王府井大街1号'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
function toggleMerchant(item: RelatedMerchant) {
|
||||
@@ -496,6 +521,50 @@ function toggleExpand() {
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 关联商家模块 -->
|
||||
<view class="form-card">
|
||||
<view class="card-title">
|
||||
<view class="title-bar"></view>
|
||||
<text class="title-text">关联商家 (辅助证明)</text>
|
||||
</view>
|
||||
|
||||
<view class="form-content">
|
||||
<view class="merchant-tip">
|
||||
选择交易过的商家,系统将通知商家为您提供交易辅助材料,有助于提高审批通过率。
|
||||
</view>
|
||||
|
||||
<view class="merchant-list">
|
||||
<view
|
||||
v-for="item in displayedMerchants"
|
||||
:key="item.merchantId"
|
||||
class="merchant-item"
|
||||
:class="{ active: item.selected }"
|
||||
@click="toggleMerchant(item)"
|
||||
>
|
||||
<view class="check-box">
|
||||
<text v-if="item.selected" class="i-carbon-checkmark"></text>
|
||||
</view>
|
||||
<view class="merchant-info">
|
||||
<text class="name">{{ item.merchantName }}</text>
|
||||
<text class="time">最近交易: {{ item.lastTradeTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 展开/收起按钮 -->
|
||||
<view
|
||||
v-if="merchantList.length > 3"
|
||||
class="expand-btn"
|
||||
@click="toggleExpand"
|
||||
>
|
||||
<text>{{ isExpanded ? '收起' : '展开更多 (' + (merchantList.length - 3) + ')' }}</text>
|
||||
<text
|
||||
class="i-carbon-chevron-down arrow"
|
||||
:class="{ up: isExpanded }"
|
||||
></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 经营信息模块 -->
|
||||
<view class="form-card">
|
||||
<view class="card-title">
|
||||
@@ -603,50 +672,7 @@ function toggleExpand() {
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 关联商家模块 -->
|
||||
<view class="form-card">
|
||||
<view class="card-title">
|
||||
<view class="title-bar"></view>
|
||||
<text class="title-text">关联商家 (辅助证明)</text>
|
||||
</view>
|
||||
|
||||
<view class="form-content">
|
||||
<view class="merchant-tip">
|
||||
选择交易过的商家,系统将通知商家为您提供交易辅助材料,有助于提高审批通过率。
|
||||
</view>
|
||||
|
||||
<view class="merchant-list">
|
||||
<view
|
||||
v-for="item in displayedMerchants"
|
||||
:key="item.merchantId"
|
||||
class="merchant-item"
|
||||
:class="{ active: item.selected }"
|
||||
@click="toggleMerchant(item)"
|
||||
>
|
||||
<view class="check-box">
|
||||
<text v-if="item.selected" class="i-carbon-checkmark"></text>
|
||||
</view>
|
||||
<view class="merchant-info">
|
||||
<text class="name">{{ item.merchantName }}</text>
|
||||
<text class="time">最近交易: {{ item.lastTradeTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 展开/收起按钮 -->
|
||||
<view
|
||||
v-if="merchantList.length > 3"
|
||||
class="expand-btn"
|
||||
@click="toggleExpand"
|
||||
>
|
||||
<text>{{ isExpanded ? '收起' : '展开更多 (' + (merchantList.length - 3) + ')' }}</text>
|
||||
<text
|
||||
class="i-carbon-chevron-down arrow"
|
||||
:class="{ up: isExpanded }"
|
||||
></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 证件信息模块 -->
|
||||
<view class="form-card">
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { getLoanApplicationDetail, operateLoanApplication } from '@/api/loan'
|
||||
import { LoanStatus } from '@/typings/loan'
|
||||
import type { LoanApplication, RelatedMerchant } from '@/typings/loan'
|
||||
import { mockTransactions } from '@/pagesBank/mock'
|
||||
|
||||
definePage({
|
||||
style: {
|
||||
@@ -30,6 +31,7 @@ const currentStepIndex = computed(() => {
|
||||
const index = steps.findIndex(s => s.key === status)
|
||||
// 特殊处理中间状态映射
|
||||
if (status === LoanStatus.REPORTED) return 3 // 上报后进入审批阶段
|
||||
if (status === LoanStatus.PENDING_SUPPLEMENT) return 2 // 待补充资料,留在中间阶段
|
||||
if (status === LoanStatus.APPROVED) return 4 // 审批通过等待签约
|
||||
if (status === LoanStatus.SIGNED) return 5 // 签约完成等待放款
|
||||
return index > -1 ? index : 0
|
||||
@@ -58,6 +60,14 @@ async function handleAction(action: string) {
|
||||
})
|
||||
if (!res.confirm) return
|
||||
data = { report: res.content }
|
||||
} else if (action === 'request_supplement') {
|
||||
const res = await uni.showModal({
|
||||
title: '要求补充资料',
|
||||
editable: true,
|
||||
placeholderText: '请输入需补充的资料及原因...'
|
||||
})
|
||||
if (!res.confirm) return
|
||||
data = { reason: res.content }
|
||||
} else if (action === 'approve' || action === 'reject') {
|
||||
const res = await uni.showModal({
|
||||
title: action === 'approve' ? '确认通过' : '确认拒绝',
|
||||
@@ -141,6 +151,20 @@ onLoad((options) => {
|
||||
</div>
|
||||
</view>
|
||||
|
||||
<!-- 平台交易流水(Mock) -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">平台交易流水 (最近5笔)</view>
|
||||
<view class="transaction-list">
|
||||
<view class="t-item" v-for="t in mockTransactions" :key="t.id">
|
||||
<view class="t-main">
|
||||
<text class="t-title">{{ t.title }}</text>
|
||||
<text class="t-time">{{ t.time }}</text>
|
||||
</view>
|
||||
<text class="t-amount" :class="t.type">{{ t.type === 'expend' ? '-' : '+' }}{{ t.amount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 关联商家及辅助材料 -->
|
||||
<view class="section-card">
|
||||
<view class="card-header">
|
||||
@@ -213,6 +237,7 @@ onLoad((options) => {
|
||||
|
||||
<template v-else-if="[LoanStatus.REPORTED, LoanStatus.APPROVING].includes(detail.status)">
|
||||
<button class="btn danger" @click="handleAction('reject')">拒绝</button>
|
||||
<button class="btn warning" @click="handleAction('request_supplement')">要求补充</button>
|
||||
<button class="btn primary" @click="handleAction('approve')">通过审批</button>
|
||||
</template>
|
||||
|
||||
@@ -377,6 +402,40 @@ onLoad((options) => {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.transaction-list {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.t-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1rpx solid #f9f9f9;
|
||||
|
||||
&:last-child { border-bottom: none; }
|
||||
|
||||
.t-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.t-title { font-size: 26rpx; color: #333; margin-bottom: 6rpx; }
|
||||
.t-time { font-size: 22rpx; color: #999; }
|
||||
}
|
||||
|
||||
.t-amount {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
|
||||
&.income { color: #fe2c55; }
|
||||
&.expend { color: #333; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.merchant-list {
|
||||
padding: 20rpx 0;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ export const mockCustomerList: BankCustomer[] = [
|
||||
{
|
||||
id: 'C1001',
|
||||
merchantId: 'M1001',
|
||||
merchantName: '广州酷玩玩具城',
|
||||
merchantName: '张三', // 模拟个人客户
|
||||
creditLimit: 500000.00,
|
||||
usedLimit: 125000.00,
|
||||
balance: 375000.00,
|
||||
@@ -65,7 +65,7 @@ export const mockCustomerList: BankCustomer[] = [
|
||||
{
|
||||
id: 'C1002',
|
||||
merchantId: 'M1002',
|
||||
merchantName: '深圳特粉专卖店',
|
||||
merchantName: '李四', // 模拟个人客户
|
||||
creditLimit: 200000.00,
|
||||
usedLimit: 180000.00,
|
||||
balance: 20000.00,
|
||||
|
||||
@@ -18,7 +18,8 @@ const todos = computed(() => {
|
||||
{ icon: 'i-carbon-shopping-bag', label: '待发货订单', count: merchantStore.stats.pendingOrders, path: '/pagesMerchant/order/list' },
|
||||
{ icon: 'i-carbon-warning', label: '库存预警', count: merchantStore.stats.lowStockGoods, path: '/pagesMerchant/goods/list' },
|
||||
{ icon: 'i-carbon-wallet', label: '待结算', count: `¥${(merchantStore.stats.pendingSettlement / 100).toFixed(0)}`, path: '/pagesMerchant/finance/index' },
|
||||
{ icon: 'i-carbon-document', label: '待提供材料', count: 1, path: '/pagesMerchant/loan/assist' }, // 模拟数据
|
||||
{ icon: 'i-carbon-document', label: '待提供材料', count: 1, path: '/pagesMerchant/loan/assist' }, // 模拟数据; 实际应从API获取
|
||||
// 实际项目中应增加获取该count的API,目前保持模拟
|
||||
].filter(item => item.count)
|
||||
})
|
||||
|
||||
|
||||
@@ -109,14 +109,14 @@ onMounted(() => {
|
||||
<view class="upload-tip">请上传与该用户的真实交易凭证</view>
|
||||
|
||||
<view class="material-types">
|
||||
<view class="type-btn" @click="handleUpload(item, 'order', '交易订单')">
|
||||
<text class="i-carbon-upload"></text> 上传订单
|
||||
</view>
|
||||
<view class="type-btn" @click="handleUpload(item, 'flow', '银行流水')">
|
||||
<text class="i-carbon-upload"></text> 上传流水
|
||||
</view>
|
||||
<view class="type-btn" @click="handleUpload(item, 'invoice', '发票')">
|
||||
<text class="i-carbon-upload"></text> 上传发票
|
||||
<text class="i-carbon-receipt"></text> 上传发票
|
||||
</view>
|
||||
<view class="type-btn" @click="handleUpload(item, 'contract', '合同')">
|
||||
<text class="i-carbon-document-pdf"></text> 上传合同
|
||||
</view>
|
||||
<view class="type-btn" @click="handleUpload(item, 'attachment', '附件')">
|
||||
<text class="i-carbon-attachment"></text> 上传附件
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -12,13 +12,14 @@ export enum LoanStatus {
|
||||
APPROVING = 'approving', // 审批中
|
||||
APPROVED = 'approved', // 审批通过
|
||||
REJECTED = 'rejected', // 已拒绝
|
||||
PENDING_SUPPLEMENT = 'pending_supplement', // 待完善(补充资料)
|
||||
SIGNING = 'signing', // 待签约
|
||||
SIGNED = 'signed', // 已签约
|
||||
DISBURSED = 'disbursed', // 已放款
|
||||
}
|
||||
|
||||
/** 辅助材料类型 */
|
||||
export type MaterialType = 'order' | 'flow' | 'invoice' | 'other'
|
||||
export type MaterialType = 'order' | 'flow' | 'invoice' | 'contract' | 'attachment' | 'other'
|
||||
|
||||
/** 商家辅助材料 */
|
||||
export interface AssistMaterial {
|
||||
|
||||
Reference in New Issue
Block a user