fix: 借贷账户管理,功能优化。
This commit is contained in:
@@ -11,6 +11,11 @@
|
|||||||
<view class="form-view">
|
<view class="form-view">
|
||||||
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
|
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
|
||||||
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
|
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
|
||||||
|
<u-form-item label="银行" 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-form-item label="借贷名称" prop="name" required >
|
||||||
<u--input v-model="form.name" placeholder="请填写借贷名称"
|
<u--input v-model="form.name" placeholder="请填写借贷名称"
|
||||||
inputAlign="right" border="none"></u--input>
|
inputAlign="right" border="none"></u--input>
|
||||||
@@ -33,6 +38,14 @@
|
|||||||
<u--input v-model="form.balance" type="number" placeholder="请填写余额"
|
<u--input v-model="form.balance" type="number" placeholder="请填写余额"
|
||||||
inputAlign="right" border="none"></u--input>
|
inputAlign="right" border="none"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
<u-form-item label="开通日期" prop="activationDate" @click="selectDate(1)">
|
||||||
|
<u--input v-model="form.activationDate" disabled disabledColor="#ffffff" placeholder="请选择开通日期" inputAlign="right" border="none"></u--input>
|
||||||
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="注销日期" prop="effectiveDate" @click="selectDate(2)">
|
||||||
|
<u--input v-model="form.effectiveDate" disabled disabledColor="#ffffff" placeholder="请选择注销日期" inputAlign="right" border="none"></u--input>
|
||||||
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||||
|
</u-form-item>
|
||||||
<!-- <u-form-item label="可用额度" prop="availableLimit" >
|
<!-- <u-form-item label="可用额度" prop="availableLimit" >
|
||||||
<u--input v-model="form.availableLimit" placeholder="请填写可用额度"
|
<u--input v-model="form.availableLimit" placeholder="请填写可用额度"
|
||||||
inputAlign="right" border="none"></u--input>
|
inputAlign="right" border="none"></u--input>
|
||||||
@@ -52,6 +65,8 @@
|
|||||||
@confirm="handleConfirm"></u-picker>
|
@confirm="handleConfirm"></u-picker>
|
||||||
<u-picker itemHeight="88" :show="showStatus" :columns="statusList" keyName="dictLabel" @cancel="handleStatusCancel"
|
<u-picker itemHeight="88" :show="showStatus" :columns="statusList" keyName="dictLabel" @cancel="handleStatusCancel"
|
||||||
@confirm="handleStatusConfirm"></u-picker>
|
@confirm="handleStatusConfirm"></u-picker>
|
||||||
|
<u-picker itemHeight="88" :show="showBank" :columns="bankList" keyName="bankName" @cancel="handleBankCancel"
|
||||||
|
@confirm="handleBankConfirm"></u-picker>
|
||||||
<u-datetime-picker
|
<u-datetime-picker
|
||||||
:show="datePickShow"
|
:show="datePickShow"
|
||||||
mode="date"
|
mode="date"
|
||||||
@@ -67,6 +82,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { getBankcardLend, addBankcardLend, updateBankcardLend } from '@/api/invest/bankcardlend'
|
import { getBankcardLend, addBankcardLend, updateBankcardLend } from '@/api/invest/bankcardlend'
|
||||||
import { getDicts } from '@/api/system/dict/data.js'
|
import { getDicts } from '@/api/system/dict/data.js'
|
||||||
|
import { listBankBaseInfo } from '@/api/invest/bankBaseInfo'
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import {onLoad,onReady} from "@dcloudio/uni-app";
|
import {onLoad,onReady} from "@dcloudio/uni-app";
|
||||||
@@ -79,6 +95,8 @@ const lendTypeList = ref([])
|
|||||||
const dateType = ref(1)
|
const dateType = ref(1)
|
||||||
const showStatus = ref(false)
|
const showStatus = ref(false)
|
||||||
const statusList = ref([])
|
const statusList = ref([])
|
||||||
|
const showBank = ref(false)
|
||||||
|
const bankList = ref([])
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {
|
form: {
|
||||||
id: null,
|
id: null,
|
||||||
@@ -103,7 +121,9 @@ const data = reactive({
|
|||||||
remark: null,
|
remark: null,
|
||||||
debitType: null,
|
debitType: null,
|
||||||
status: '1',
|
status: '1',
|
||||||
statusName: '正常使用'
|
statusName: '正常使用',
|
||||||
|
bankId: null,
|
||||||
|
bankName: null
|
||||||
},
|
},
|
||||||
// dateType:'1',
|
// dateType:'1',
|
||||||
rules: {
|
rules: {
|
||||||
@@ -127,7 +147,6 @@ onLoad((option) => {
|
|||||||
})
|
})
|
||||||
onReady(() => {
|
onReady(() => {
|
||||||
form.value.activationDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
|
form.value.activationDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
|
||||||
form.value.effectiveDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
|
|
||||||
})
|
})
|
||||||
function getDict() {
|
function getDict() {
|
||||||
// 类型
|
// 类型
|
||||||
@@ -138,6 +157,10 @@ onLoad((option) => {
|
|||||||
getDicts('account_status').then(res => {
|
getDicts('account_status').then(res => {
|
||||||
statusList.value =[res.data]
|
statusList.value =[res.data]
|
||||||
})
|
})
|
||||||
|
// 获取银行列表
|
||||||
|
listBankBaseInfo({ pageSize: 1000, pageNum: 1 }).then(res => {
|
||||||
|
bankList.value = [res.rows]
|
||||||
|
})
|
||||||
if(form.value.id!=null){
|
if(form.value.id!=null){
|
||||||
getBankcardLend(form.value.id).then(res => {
|
getBankcardLend(form.value.id).then(res => {
|
||||||
form.value = res.data
|
form.value = res.data
|
||||||
@@ -148,6 +171,13 @@ onLoad((option) => {
|
|||||||
// 类型
|
// 类型
|
||||||
getDicts('account_status').then(result => {
|
getDicts('account_status').then(result => {
|
||||||
form.value.statusName=dictStr(form.value.status, result.data)
|
form.value.statusName=dictStr(form.value.status, 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
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -196,6 +226,29 @@ onLoad((option) => {
|
|||||||
function handleStatusCancel() {
|
function handleStatusCancel() {
|
||||||
showStatus.value = false
|
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
|
||||||
|
// 新增时自动赋值账户名称
|
||||||
|
if (!form.value.id) {
|
||||||
|
form.value.name = e.value[0].bankName
|
||||||
|
}
|
||||||
|
showBank.value = false
|
||||||
|
}
|
||||||
|
function handleBankCancel() {
|
||||||
|
showBank.value = false
|
||||||
|
}
|
||||||
|
|
||||||
function selectDate(type) {
|
function selectDate(type) {
|
||||||
dateType.value=type
|
dateType.value=type
|
||||||
datePickShow.value = true
|
datePickShow.value = true
|
||||||
|
|||||||
@@ -28,6 +28,10 @@
|
|||||||
<text>账户信息</text>
|
<text>账户信息</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-list">
|
<view class="info-list">
|
||||||
|
<view class="list-item">
|
||||||
|
<text class="item-label">银行</text>
|
||||||
|
<text class="item-value">{{ detailInfo.bankName || '--' }}</text>
|
||||||
|
</view>
|
||||||
<view class="list-item">
|
<view class="list-item">
|
||||||
<text class="item-label">类型</text>
|
<text class="item-label">类型</text>
|
||||||
<text class="item-value">{{ detailInfo.lendTypeText }}</text>
|
<text class="item-value">{{ detailInfo.lendTypeText }}</text>
|
||||||
@@ -36,6 +40,14 @@
|
|||||||
<text class="item-label">账户状态</text>
|
<text class="item-label">账户状态</text>
|
||||||
<text class="item-value" :class="getStatusClass(detailInfo.status, detailInfo.statusText)">{{ detailInfo.statusText }}</text>
|
<text class="item-value" :class="getStatusClass(detailInfo.status, detailInfo.statusText)">{{ detailInfo.statusText }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="list-item" v-if="detailInfo.activationDate">
|
||||||
|
<text class="item-label">开通日期</text>
|
||||||
|
<text class="item-value">{{ detailInfo.activationDate }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="list-item" v-if="detailInfo.effectiveDate">
|
||||||
|
<text class="item-label">注销日期</text>
|
||||||
|
<text class="item-value">{{ detailInfo.effectiveDate }}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -58,6 +70,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { getBankcardLend} from '@/api/invest/bankcardlend'
|
import { getBankcardLend} from '@/api/invest/bankcardlend'
|
||||||
import { getDicts } from '@/api/system/dict/data.js'
|
import { getDicts } from '@/api/system/dict/data.js'
|
||||||
|
import { listBankBaseInfo } from '@/api/invest/bankBaseInfo'
|
||||||
import {onLoad} from "@dcloudio/uni-app";
|
import {onLoad} from "@dcloudio/uni-app";
|
||||||
import {reactive ,toRefs,ref,computed }from "vue";
|
import {reactive ,toRefs,ref,computed }from "vue";
|
||||||
const id = ref('')
|
const id = ref('')
|
||||||
@@ -95,6 +108,13 @@ onLoad((option) => {
|
|||||||
// 类型
|
// 类型
|
||||||
getDicts('account_status').then(result => {
|
getDicts('account_status').then(result => {
|
||||||
detailInfo.value.statusText=dictStr(detailInfo.value.status, result.data)
|
detailInfo.value.statusText=dictStr(detailInfo.value.status, result.data)
|
||||||
|
})
|
||||||
|
// 银行名称
|
||||||
|
listBankBaseInfo({ pageSize: 1000, pageNum: 1 }).then(res => {
|
||||||
|
const bank = res.rows.find(item => item.id === detailInfo.value.bankId)
|
||||||
|
if (bank) {
|
||||||
|
detailInfo.value.bankName = bank.bankName
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
|
|
||||||
<view class="card-body">
|
<view class="card-body">
|
||||||
<view class="info-row">
|
<view class="info-row">
|
||||||
|
|
||||||
<view class="info-item" v-if="dictStr(item.lendType, lendTypeList) || true">
|
<view class="info-item" v-if="dictStr(item.lendType, lendTypeList) || true">
|
||||||
<text class="info-label">账户类型</text>
|
<text class="info-label">账户类型</text>
|
||||||
<text class="info-value">{{ dictStr(item.lendType, lendTypeList) || '--' }}</text>
|
<text class="info-value">{{ dictStr(item.lendType, lendTypeList) || '--' }}</text>
|
||||||
@@ -53,9 +54,19 @@
|
|||||||
<text class="info-label">账户状态</text>
|
<text class="info-label">账户状态</text>
|
||||||
<text class="info-value" :class="getStatusClass(item.status, dictStr(item.status, statusList))">{{ dictStr(item.status, statusList) || '--' }}</text>
|
<text class="info-value" :class="getStatusClass(item.status, dictStr(item.status, statusList))">{{ dictStr(item.status, statusList) || '--' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="info-item" v-if="item.bankName">
|
||||||
<view class="info-row">
|
<text class="info-label">银行</text>
|
||||||
<view class="info-item info-item-full" v-if="item.remark">
|
<text class="info-value">{{ item.bankName }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="item.activationDate">
|
||||||
|
<text class="info-label">开通日期</text>
|
||||||
|
<text class="info-value">{{ item.activationDate }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="item.effectiveDate ">
|
||||||
|
<text class="info-label">注销日期</text>
|
||||||
|
<text class="info-value">{{ item.effectiveDate }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="item.remark">
|
||||||
<text class="info-label">备注</text>
|
<text class="info-label">备注</text>
|
||||||
<text class="info-value">{{ item.remark }}</text>
|
<text class="info-value">{{ item.remark }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Reference in New Issue
Block a user