18 changed files with 839 additions and 131 deletions
Unified View
Diff Options
-
1.gitignore
-
35apis/clientCreditApi.js
-
10apis/commonApi.js
-
36enums/index.js
-
8pages.json
-
154pages/client-credit-detail/index.vue
-
188pages/client-credit-list/index.vue
-
180pages/fs-credit/index.vue
-
234pages/guarantee-agreement/index.vue
-
29pages/mine/index.vue
-
75pages/month-credit/index.vue
-
9pages/page-view/index.vue
-
BINstatic/imgs/client-credit-list/auditing.png
-
BINstatic/imgs/client-credit-list/client-default.png
-
BINstatic/imgs/client-credit-list/pass.png
-
BINstatic/imgs/client-credit-list/reject.png
-
BINstatic/imgs/client-credit-list/waiting-audit.png
-
11utils/index.js
@ -0,0 +1,154 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="飞算授信"></uni-nav-bar> |
||||
|
<view class="card"> |
||||
|
<text class="label">授信额度(元)</text> |
||||
|
<text class="value">5{{ info.creditLine }}</text> |
||||
|
</view> |
||||
|
<qn-form-item label="授信客户信息" type="title"></qn-form-item> |
||||
|
<qn-form-item label="客户名称" required> |
||||
|
<text class="item_text">{{ info.name }}</text> |
||||
|
</qn-form-item> |
||||
|
<qn-form-item label="结算方式" required> |
||||
|
<text class="item_text">{{ transformMethod(info.settlementMethod) }}</text> |
||||
|
</qn-form-item> |
||||
|
<qn-form-item label="结算周期" required> |
||||
|
<text class="item_text">{{ transformPeriod(info.settlementPeriod) }}</text> |
||||
|
</qn-form-item> |
||||
|
<qn-form-item label="授信状态" required> |
||||
|
<text class="item_text" style="color: #007aff">{{ transform(info.status) }}</text> |
||||
|
</qn-form-item> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { back } from '@/utils/hook.js' |
||||
|
import { fsSettlementPeriodEnum, fsSettlementMethodEnum, fsAuditStatus } from '@/enums/index.js' |
||||
|
import { getFsCreditDetail } from '@/apis/clientCreditApi.js' |
||||
|
const statusMap = [ |
||||
|
{ |
||||
|
label: '待客户申请', |
||||
|
value: fsAuditStatus.WAIT_APPLY |
||||
|
}, |
||||
|
{ |
||||
|
label: '审核中', |
||||
|
value: fsAuditStatus.AUDITING |
||||
|
}, |
||||
|
{ |
||||
|
label: '通过', |
||||
|
value: fsAuditStatus.PASS |
||||
|
}, |
||||
|
{ |
||||
|
label: '拒绝', |
||||
|
value: fsAuditStatus.REJECT |
||||
|
} |
||||
|
] |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
id: null, |
||||
|
info: { |
||||
|
creditLine: 0, |
||||
|
name: '', |
||||
|
settlementMethod: 1, |
||||
|
settlementPeriod: null, |
||||
|
status: null |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
back, |
||||
|
// 获取授信信息 |
||||
|
getCreditInfo() { |
||||
|
getFsCreditDetail({ id: this.id, mallSupplierId: this.$store.state.supplierInfo.supplierId }).then((res) => { |
||||
|
if (res) { |
||||
|
Object.keys(this.info).forEach((key) => { |
||||
|
this.info[key] = res[key] |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
transform(status) { |
||||
|
return statusMap.find((item) => item.value == status)?.label || '' |
||||
|
}, |
||||
|
transformPeriod(period) { |
||||
|
return fsSettlementPeriodEnum.find((item) => item.value == period)?.label || '' |
||||
|
}, |
||||
|
transformMethod(method) { |
||||
|
return fsSettlementMethodEnum.find((item) => item.value == method)?.label || '' |
||||
|
} |
||||
|
}, |
||||
|
onLoad(option) { |
||||
|
if (option) { |
||||
|
this.id = option.id |
||||
|
} else { |
||||
|
uni.showToast({ |
||||
|
title: '参数错误', |
||||
|
icon: 'none', |
||||
|
complete: () => { |
||||
|
setTimeout(() => { |
||||
|
back() |
||||
|
}, 1500) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getCreditInfo() |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.item_text { |
||||
|
font-size: 28rpx; |
||||
|
color: #333333; |
||||
|
} |
||||
|
.button_area { |
||||
|
width: 750rpx; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
padding: 0 32rpx; |
||||
|
.button__submit { |
||||
|
flex-grow: 1; |
||||
|
height: 88rpx; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
background: #007aff; |
||||
|
border-radius: 10rpx; |
||||
|
.text { |
||||
|
font-size: 30rpx; |
||||
|
color: #ffffff; |
||||
|
} |
||||
|
} |
||||
|
.button__submit--disabled { |
||||
|
opacity: 0.5; |
||||
|
} |
||||
|
} |
||||
|
.card { |
||||
|
width: 750rpx; |
||||
|
height: 254rpx; |
||||
|
background: #fff; |
||||
|
border-radius: 10rpx; |
||||
|
padding: 50rpx 32rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
.label { |
||||
|
font-size: 32rpx; |
||||
|
color: #000000; |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
.value { |
||||
|
margin-top: 24rpx; |
||||
|
font-size: 64rpx; |
||||
|
color: #000000; |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,188 @@ |
|||||
|
<template> |
||||
|
<view class="content"> |
||||
|
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="授信记录"></uni-nav-bar> |
||||
|
<view class="list-area"> |
||||
|
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback"> |
||||
|
<view v-for="item in list" :key="item.id" class="container"> |
||||
|
<view class="list-item"> |
||||
|
<image class="item_image" src="/static/imgs/client-credit-list/client-default.png"></image> |
||||
|
<view class="item"> |
||||
|
<view class="name">{{ item.name }}</view> |
||||
|
<text class="business">{{ transformBusiness(item.mainProducts) }}</text> |
||||
|
</view> |
||||
|
<image class="icon" style="width: 160rpx" :src="showIcon(item.status)"></image> |
||||
|
</view> |
||||
|
<view class="item-footer"> |
||||
|
<text class="time">{{ formatTime(item.createTime) }}</text> |
||||
|
<text class="button" @click="go2('client-credit-detail', { id: item.id })">查看授信</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</scroll-list> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { go2, back } from '@/utils/hook.js' |
||||
|
import { dateTimeFormat } from '@/utils/index.js' |
||||
|
import { getFsCreditList } from '@/apis/clientCreditApi' |
||||
|
import { fsAuditStatus } from '@/enums/index.js' |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
option: { |
||||
|
size: 10, |
||||
|
auto: true, |
||||
|
emptyText: '暂无授信~', |
||||
|
background: '#F7F8FA' |
||||
|
}, |
||||
|
list: [], |
||||
|
pagination: { |
||||
|
pageNum: 0, // 初始会执行一次下拉加载 |
||||
|
pageSize: 10 |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
go2, |
||||
|
back, |
||||
|
transformBusiness(business) { |
||||
|
let text = business?.trim() || '' |
||||
|
if (text.length > 17) { |
||||
|
text = text.substr(0, 17) + '...' |
||||
|
} |
||||
|
return '主营:' + (text || '-') |
||||
|
}, |
||||
|
formatTime(time) { |
||||
|
return dateTimeFormat(new Date(time), 'yyyy/mm/dd') |
||||
|
}, |
||||
|
showIcon(status) { |
||||
|
let src = '' |
||||
|
switch (status) { |
||||
|
case fsAuditStatus.AUDITING: |
||||
|
src = '/static/imgs/client-credit-list/auditing.png' |
||||
|
break |
||||
|
case fsAuditStatus.PASS: |
||||
|
src = '/static/imgs/client-credit-list/pass.png' |
||||
|
break |
||||
|
case fsAuditStatus.REJECT: |
||||
|
src = '/static/imgs/client-credit-list/reject.png' |
||||
|
break |
||||
|
default: |
||||
|
src = '/static/imgs/client-credit-list/waiting-audit.png' |
||||
|
break |
||||
|
} |
||||
|
return src |
||||
|
}, |
||||
|
getList() { |
||||
|
return new Promise((resolve, reject) => { |
||||
|
getFsCreditList({ mallSupplierId: this.$store.state.supplierInfo.supplierId, ...this.pagination }) |
||||
|
.then((res) => { |
||||
|
if (res) { |
||||
|
if (this.pagination.pageNum == 1) { |
||||
|
this.list = res.records |
||||
|
} else { |
||||
|
this.list = this.list.concat(res.records) |
||||
|
} |
||||
|
// this.list = [] |
||||
|
// this.list = [...this.list, ...[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]] |
||||
|
resolve({ list: this.list, total: res.total }) |
||||
|
} |
||||
|
}) |
||||
|
.catch((err) => { |
||||
|
reject(err) |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
downCallback() { |
||||
|
this.pagination.pageNum = 1 |
||||
|
this.getList() |
||||
|
.then(({ list, total }) => { |
||||
|
this.$refs.list.refreshSuccess({ list, total }) |
||||
|
}) |
||||
|
.catch(() => { |
||||
|
this.$refs.list.refreshFail() |
||||
|
}) |
||||
|
}, |
||||
|
upCallback(page) { |
||||
|
this.pagination.pageNum++ |
||||
|
this.getList() |
||||
|
.then(({ list, total }) => { |
||||
|
this.$refs.list.loadSuccess({ list, total }) |
||||
|
}) |
||||
|
.catch(() => { |
||||
|
this.$refs.list.loadFail() |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.content { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
flex: 1; |
||||
|
height: 100vh; |
||||
|
.list-area { |
||||
|
flex-grow: 1; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
} |
||||
|
.container { |
||||
|
background-color: #fff; |
||||
|
margin-bottom: 20rpx; |
||||
|
.list-item { |
||||
|
width: 750rpx; |
||||
|
height: 148rpx; |
||||
|
padding: 24rpx 32rpx; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: flex-start; |
||||
|
border-bottom: 2rpx solid #eee; |
||||
|
position: relative; |
||||
|
.item_image { |
||||
|
flex-grow: 0; |
||||
|
flex-basis: auto; |
||||
|
width: 100rpx; |
||||
|
height: 100rpx; |
||||
|
margin-right: 20rpx; |
||||
|
} |
||||
|
.item { |
||||
|
.name { |
||||
|
font-size: 30rpx; |
||||
|
margin-bottom: 26rpx; |
||||
|
color: #333333; |
||||
|
max-width: 400rpx; |
||||
|
} |
||||
|
.business { |
||||
|
font-size: 26rpx; |
||||
|
color: #888888; |
||||
|
} |
||||
|
} |
||||
|
.icon { |
||||
|
position: absolute; |
||||
|
right: 0; |
||||
|
top: 0; |
||||
|
height: 50rpx; |
||||
|
} |
||||
|
} |
||||
|
.item-footer { |
||||
|
width: 750rpx; |
||||
|
height: 80rpx; |
||||
|
padding: 0 32rpx; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
justify-content: space-between; |
||||
|
.time { |
||||
|
font-size: 28rpx; |
||||
|
color: #888888; |
||||
|
} |
||||
|
.button { |
||||
|
font-size: 28rpx; |
||||
|
color: #007aff; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,180 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="飞算授信"></uni-nav-bar> |
||||
|
<view class="card"> |
||||
|
<text class="label">最高授信额度(元)</text> |
||||
|
<text class="value">500,000.00</text> |
||||
|
</view> |
||||
|
<qn-form-item label="授信客户信息" type="title"></qn-form-item> |
||||
|
<qn-form-item label="客户名称" required> |
||||
|
<text class="item_text">{{ form.enterpriseName }}</text> |
||||
|
</qn-form-item> |
||||
|
<qn-form-item label="结算方式" required> |
||||
|
<qn-data-picker |
||||
|
v-model="form.settlementMethod" |
||||
|
text="right" |
||||
|
:border="false" |
||||
|
placeholder="请选择结算方式" |
||||
|
popup-title="请选择结算方式" |
||||
|
:map="{ text: 'label', value: 'value' }" |
||||
|
:clear-icon="false" |
||||
|
:localdata="fsSettlementMethodEnum" |
||||
|
></qn-data-picker> |
||||
|
</qn-form-item> |
||||
|
<qn-form-item label="结算周期" required> |
||||
|
<qn-data-picker |
||||
|
v-model="form.settlementPeriod" |
||||
|
text="right" |
||||
|
:border="false" |
||||
|
placeholder="请选择结算周期" |
||||
|
popup-title="请选择结算周期" |
||||
|
:map="{ text: 'label', value: 'value' }" |
||||
|
:clear-icon="false" |
||||
|
:localdata="fsSettlementPeriodEnum" |
||||
|
></qn-data-picker> |
||||
|
</qn-form-item> |
||||
|
<qn-form-item label="授信额度(元)" required> |
||||
|
<qn-easyinput :maxlength="9" v-model="form.creditLine" :inputBorder="false" text="right" placeholder="请设置授信额度"></qn-easyinput> |
||||
|
</qn-form-item> |
||||
|
<qn-footer fixed height="120rpx"> |
||||
|
<view class="button_area"> |
||||
|
<view :class="{ button__submit: true, 'button__submit--disabled': !canSubmit }" @click="canSubmit && makeCredit()"> |
||||
|
<text class="text">立即授信</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</qn-footer> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { back, go2 } from '@/utils/hook.js' |
||||
|
import { fsSettlementPeriodEnum, fsSettlementMethodEnum } from '@/enums/index.js' |
||||
|
import { makeFsCreditInfo } from '@/apis/clientCreditApi.js' |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
form: { |
||||
|
enterpriseId: null, |
||||
|
legalPersonName: null, |
||||
|
enterpriseName: null, |
||||
|
creditLine: null, |
||||
|
settlementPeriod: 1, |
||||
|
settlementMethod: 1, |
||||
|
mallSupplierId: null |
||||
|
}, |
||||
|
fsSettlementPeriodEnum: Object.freeze(fsSettlementPeriodEnum), |
||||
|
fsSettlementMethodEnum: Object.freeze(fsSettlementMethodEnum), |
||||
|
canSubmit: false |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
back, |
||||
|
makeCredit() { |
||||
|
makeFsCreditInfo(this.form).then((res) => { |
||||
|
if (res) { |
||||
|
uni.showToast({ |
||||
|
title: '授信成功', |
||||
|
icon: 'success', |
||||
|
duration: 2000, |
||||
|
success: () => { |
||||
|
setTimeout(() => { |
||||
|
go2('client-credit-list', {}, true) |
||||
|
}, 1500) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
onLoad(option) { |
||||
|
if (option) { |
||||
|
this.form.enterpriseId = option.enterpriseId |
||||
|
this.form.mallSupplierId = option.mallSupplierId |
||||
|
this.form.legalPersonName = option.legalPersonName |
||||
|
this.form.enterpriseName = option.enterpriseName |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
if (!this.form.enterpriseId) { |
||||
|
uni.showToast({ |
||||
|
title: '进入页面错误', |
||||
|
icon: 'error', |
||||
|
duration: 2000, |
||||
|
complete: () => { |
||||
|
back() |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
form: { |
||||
|
handler(val) { |
||||
|
let keys = Object.keys(val) |
||||
|
let flag = true |
||||
|
for (let key of keys) { |
||||
|
if (!val[key]) { |
||||
|
flag = false |
||||
|
break |
||||
|
} |
||||
|
} |
||||
|
this.canSubmit = flag |
||||
|
}, |
||||
|
deep: true |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.item_text { |
||||
|
font-size: 28rpx; |
||||
|
color: #333333; |
||||
|
} |
||||
|
.button_area { |
||||
|
width: 750rpx; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
padding: 0 32rpx; |
||||
|
.button__submit { |
||||
|
flex-grow: 1; |
||||
|
height: 88rpx; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
background: #007aff; |
||||
|
border-radius: 10rpx; |
||||
|
.text { |
||||
|
font-size: 30rpx; |
||||
|
color: #ffffff; |
||||
|
} |
||||
|
} |
||||
|
.button__submit--disabled { |
||||
|
opacity: 0.5; |
||||
|
} |
||||
|
} |
||||
|
.card { |
||||
|
width: 750rpx; |
||||
|
height: 254rpx; |
||||
|
background: #fff; |
||||
|
border-radius: 10rpx; |
||||
|
padding: 50rpx 32rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
.label { |
||||
|
font-size: 32rpx; |
||||
|
color: #000000; |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
.value { |
||||
|
margin-top: 24rpx; |
||||
|
font-size: 64rpx; |
||||
|
color: #000000; |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save