feat: 银行基础信息管理,储蓄卡、信用卡修改。

This commit is contained in:
tianyongbao
2026-01-29 21:11:47 +08:00
parent 4aaf64a4cb
commit 3f2e2ffc69
12 changed files with 1534 additions and 4 deletions

View File

@@ -11,6 +11,11 @@
<view class="form-view">
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
<u-form-item label="银行" required prop="bankName" @click="handleShowBank">
<u--input v-model="form.bankName" disabled disabledColor="#ffffff" placeholder="请选择银行"
inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-down"></u-icon>
</u-form-item>
<u-form-item label="信用卡名称" prop="name" required >
<u--input v-model="form.name" placeholder="请填写信用卡名称"
inputAlign="right" border="none"></u--input>
@@ -53,6 +58,16 @@
<u--input v-model="form.cvv" placeholder="请填写信用卡安全码"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="卡片等级" prop="cardTierName" @click="handleShowCardTier">
<u--input v-model="form.cardTierName" disabled disabledColor="#ffffff" placeholder="请选择卡片等级"
inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-down"></u-icon>
</u-form-item>
<u-form-item label="卡面" prop="cardFace">
<u--input v-model="form.cardFace" placeholder="请填写卡面"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="开户行" prop="openingBank" >
<u--input v-model="form.openingBank" placeholder="请填写开户行"
@@ -97,6 +112,10 @@
@confirm="handleIsZeroBillConfirm"></u-picker>
<u-picker itemHeight="88" :show="showStatus" :columns="statusList" keyName="dictLabel" @cancel="handleStatusCancel"
@confirm="handleStatusConfirm"></u-picker>
<u-picker itemHeight="88" :show="showBank" :columns="bankList" keyName="bankName" @cancel="handleBankCancel"
@confirm="handleBankConfirm"></u-picker>
<u-picker itemHeight="88" :show="showCardTier" :columns="cardTierList" keyName="dictLabel" @cancel="handleCardTierCancel"
@confirm="handleCardTierConfirm"></u-picker>
<u-datetime-picker
:show="datePickShow"
mode="date"
@@ -112,6 +131,7 @@
<script setup>
import { getBankcardLend, addBankcardLend, updateBankcardLend } from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
import { listBankBaseInfo } from '@/api/invest/bankBaseInfo'
const { proxy } = getCurrentInstance()
import dayjs from 'dayjs'
import {onLoad,onReady} from "@dcloudio/uni-app";
@@ -126,6 +146,10 @@ const isZeroBillList = ref([])
const showStatus = ref(false)
const statusList = ref([])
const dateType = ref(1)
const showBank = ref(false)
const bankList = ref([])
const showCardTier = ref(false)
const cardTierList = ref([])
const data = reactive({
form: {
id: null,
@@ -153,10 +177,16 @@ const data = reactive({
nextBillDateTime: null,
isZeroBill: null,
status: '1',
statusName: '正常使用'
statusName: '正常使用',
bankId: null,
bankName: null,
cardTier: null,
cardTierName: null,
cardFace: null
},
// dateType:'1',
rules: {
bankName: [{ type: 'string', required: true, message: '银行不能为空', trigger: ['change', 'blur'] }],
name: [{ type: 'string', required: true, message: '信用卡名称不能为空', trigger: ['change', 'blur'] }],
code: [{ type: 'string', required: true, message: '信用卡卡号不能为空', trigger: ['change', 'blur'] }],
billDate: [{ type: 'number', required: true, message: '账单日不能为空', trigger: ['change', 'blur'] }],
@@ -196,6 +226,14 @@ onLoad((option) => {
getDicts('account_status').then(res => {
statusList.value =[res.data]
})
// 卡片等级
getDicts('card_tier').then(res => {
cardTierList.value =[res.data]
})
// 获取银行列表
listBankBaseInfo({ pageSize: 1000, pageNum: 1 }).then(res => {
bankList.value = [res.rows]
})
if(form.value.id!=null){
getBankcardLend(form.value.id).then(res => {
form.value = res.data
@@ -212,6 +250,17 @@ onLoad((option) => {
getDicts('account_status').then(result => {
form.value.statusName=dictStr(form.value.status, result.data)
})
// 卡片等级
getDicts('card_tier').then(result => {
form.value.cardTierName=dictStr(form.value.cardTier, result.data)
})
// 银行名称
listBankBaseInfo({ pageSize: 1000, pageNum: 1 }).then(res => {
const bank = res.rows.find(item => item.id === form.value.bankId)
if (bank) {
form.value.bankName = bank.bankName
}
})
})
}
@@ -278,6 +327,42 @@ onLoad((option) => {
function handleStatusCancel() {
showStatus.value = false
}
function handleShowBank() {
if (bankList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '银行列表为空 ', type: 'warning'
})
} else {
showBank.value = true
}
}
function handleBankConfirm(e) {
form.value.bankName = e.value[0].bankName
form.value.bankId = e.value[0].id
showBank.value = false
}
function handleBankCancel() {
showBank.value = false
}
function handleShowCardTier() {
if (cardTierList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '卡片等级为空 ', type: 'warning'
})
} else {
showCardTier.value = true
}
}
function handleCardTierConfirm(e) {
form.value.cardTierName = e.value[0].dictLabel
form.value.cardTier = e.value[0].dictValue
showCardTier.value = false
}
function handleCardTierCancel() {
showCardTier.value = false
}
function selectDate(type) {
dateType.value=type