feat(huifu): 支持汇付进件通过后更换结算银行卡
- 用户端及后台管理端新增更换结算卡接口与页面交互 - 服务层实现换卡核心逻辑、参数校验及汇付接口调用 - 增加换卡异步通知处理与定时轮询补偿以同步审核状态 - 完善进件状态网关,补充换卡审核状态及驳回原因等字段
这个提交包含在:
@@ -13,6 +13,7 @@
|
||||
:required="huifuRequired"
|
||||
:statusInfo="huifuStatus"
|
||||
:readonly="huifuFormReadonly"
|
||||
:editMode="formEditMode"
|
||||
></huifu-onboard-form>
|
||||
<view class="foot-box safe-area-inset-bottom" v-if="showOnboardSubmitBtn">
|
||||
<button
|
||||
@@ -38,6 +39,9 @@ export default {
|
||||
huifuStatus: {},
|
||||
onboardRoleLabels: [],
|
||||
canSubmitOnboard: false,
|
||||
canModifyCard: false,
|
||||
roleType: '',
|
||||
roleRefId: 0,
|
||||
onboardSubmitting: false
|
||||
};
|
||||
},
|
||||
@@ -46,19 +50,33 @@ export default {
|
||||
if (!this.onboardRoleLabels.length) return '';
|
||||
return `适用角色:${this.onboardRoleLabels.join('、')}`;
|
||||
},
|
||||
formEditMode() {
|
||||
if (this.canModifyCard || (this.huifuStatus && this.huifuStatus.status === 'approved')) {
|
||||
return 'bank_only';
|
||||
}
|
||||
return 'full';
|
||||
},
|
||||
huifuFormReadonly() {
|
||||
if (!this.huifuRequired) return true;
|
||||
if (this.huifuStatus && this.huifuStatus.card_modify_pending) return true;
|
||||
if (this.canModifyCard) return false;
|
||||
return !this.canSubmitOnboard;
|
||||
},
|
||||
showOnboardSubmitBtn() {
|
||||
return this.canSubmitOnboard;
|
||||
return this.canSubmitOnboard || this.canModifyCard;
|
||||
},
|
||||
onboardSubmitText() {
|
||||
if (this.canModifyCard) return '提交更换结算卡';
|
||||
if (this.huifuStatus && this.huifuStatus.can_submit) return '重新提交进件资料';
|
||||
return '提交开户认证';
|
||||
},
|
||||
onboardNoticeText() {
|
||||
const h = this.huifuStatus || {};
|
||||
if (h.card_modify_pending) return '结算卡更换审核中,请耐心等待';
|
||||
if (h.card_modify_reject_reason) {
|
||||
return `结算卡更换被驳回:${h.card_modify_reject_reason},请修改后重新提交`;
|
||||
}
|
||||
if (this.canModifyCard) return '汇付进件已通过,可更换结算银行卡';
|
||||
if (h.can_submit) return '汇付进件被驳回,请修改下方资料后重新提交';
|
||||
if (h.await_admin) return '进件资料已提交,请等待后台审核;审核通过后将自动提交汇付';
|
||||
if (h.status === 'busi_pending' || h.status === 'submitting' || h.status === 'basic_ok') {
|
||||
@@ -75,6 +93,15 @@ export default {
|
||||
this.loadOnboardBind();
|
||||
},
|
||||
methods: {
|
||||
applyOnboardData(data) {
|
||||
this.huifuRequired = !!data.required;
|
||||
this.huifuStatus = data.huifu_onboard || {};
|
||||
this.onboardRoleLabels = Array.isArray(data.role_labels) ? data.role_labels : [];
|
||||
this.canSubmitOnboard = !!data.can_submit_bind;
|
||||
this.canModifyCard = !!data.can_modify_card_bind || !!(this.huifuStatus && this.huifuStatus.can_modify_card);
|
||||
this.roleType = data.role_type || (this.huifuStatus.role_type || '');
|
||||
this.roleRefId = parseInt(data.role_ref_id || this.huifuStatus.role_ref_id || 0, 10) || 0;
|
||||
},
|
||||
loadOnboardBind() {
|
||||
this.$http('money.walletOnboard', {}, '', false).then(res => {
|
||||
if (res.code !== 1) {
|
||||
@@ -88,10 +115,7 @@ export default {
|
||||
setTimeout(() => this.$Router.back(), 1500);
|
||||
return;
|
||||
}
|
||||
this.huifuRequired = !!data.required;
|
||||
this.huifuStatus = data.huifu_onboard || {};
|
||||
this.onboardRoleLabels = Array.isArray(data.role_labels) ? data.role_labels : [];
|
||||
this.canSubmitOnboard = !!data.can_submit_bind;
|
||||
this.applyOnboardData(data);
|
||||
this.loaded = true;
|
||||
});
|
||||
},
|
||||
@@ -99,20 +123,22 @@ export default {
|
||||
if (!this.$refs.huifuForm) return;
|
||||
const valid = this.$refs.huifuForm.validate();
|
||||
if (valid !== true) return;
|
||||
const isModifyCard = this.canModifyCard && !this.canSubmitOnboard;
|
||||
const api = isModifyCard ? 'money.walletOnboardModifyCard' : 'money.walletOnboardSubmit';
|
||||
const payload = {
|
||||
huifu_onboard: this.$refs.huifuForm.getPayload()
|
||||
};
|
||||
if (isModifyCard) {
|
||||
if (this.roleType) payload.role_type = this.roleType;
|
||||
if (this.roleRefId) payload.role_ref_id = this.roleRefId;
|
||||
}
|
||||
this.onboardSubmitting = true;
|
||||
this.$http(
|
||||
'money.walletOnboardSubmit',
|
||||
{ huifu_onboard: this.$refs.huifuForm.getPayload() },
|
||||
'提交中...',
|
||||
false
|
||||
).then(res => {
|
||||
this.$http(api, payload, '提交中...', false).then(res => {
|
||||
this.onboardSubmitting = false;
|
||||
if (res.code === 1) {
|
||||
this.$u.toast(res.msg || '提交成功');
|
||||
if (res.data) {
|
||||
this.huifuStatus = res.data.huifu_onboard || {};
|
||||
this.onboardRoleLabels = Array.isArray(res.data.role_labels) ? res.data.role_labels : [];
|
||||
this.canSubmitOnboard = !!res.data.can_submit_bind;
|
||||
this.applyOnboardData(res.data);
|
||||
if (!res.data.show) {
|
||||
setTimeout(() => this.$Router.back(), 1500);
|
||||
}
|
||||
|
||||
@@ -177,6 +177,9 @@
|
||||
onboardEntryDesc() {
|
||||
if (this.canSubmitOnboard) return '请完善实名与银行卡信息';
|
||||
const h = this.huifuStatus || {};
|
||||
if (h.card_modify_pending) return '结算卡更换审核中';
|
||||
if (h.card_modify_reject_reason) return '结算卡更换被驳回,点击重新更换';
|
||||
if (h.can_modify_card || h.status === 'approved') return '进件已通过,可查看或更换结算银行卡';
|
||||
if (h.await_admin) return '资料已提交,等待平台审核';
|
||||
if (h.status === 'busi_pending' || h.status === 'submitting' || h.status === 'basic_ok') {
|
||||
return '汇付进件审核中';
|
||||
@@ -193,9 +196,12 @@
|
||||
submitting: '提交中',
|
||||
basic_ok: '开户成功',
|
||||
busi_pending: '审核中',
|
||||
approved: '已通过',
|
||||
rejected: '已驳回',
|
||||
failed: '失败'
|
||||
};
|
||||
if (h.card_modify_pending) return '换卡审核中';
|
||||
if (h.card_modify_reject_reason) return '换卡驳回';
|
||||
if (h.can_submit) return '待修改';
|
||||
if (h.await_admin) return '待审核';
|
||||
if (h.status && map[h.status]) return map[h.status];
|
||||
@@ -204,11 +210,12 @@
|
||||
},
|
||||
onboardStatusClass() {
|
||||
const h = this.huifuStatus || {};
|
||||
if (h.can_submit || h.status === 'rejected' || h.status === 'failed') return 'is-warn';
|
||||
if (h.await_admin || h.status === 'draft') return 'is-pending';
|
||||
if (h.can_submit || h.status === 'rejected' || h.status === 'failed' || h.card_modify_reject_reason) return 'is-warn';
|
||||
if (h.await_admin || h.status === 'draft' || h.card_modify_pending) return 'is-pending';
|
||||
if (h.status === 'busi_pending' || h.status === 'submitting' || h.status === 'basic_ok') {
|
||||
return 'is-pending';
|
||||
}
|
||||
if (h.status === 'approved') return 'is-ok';
|
||||
if (this.canSubmitOnboard) return 'is-warn';
|
||||
return '';
|
||||
}
|
||||
@@ -430,6 +437,10 @@
|
||||
&.is-pending {
|
||||
color: #1677FF;
|
||||
}
|
||||
|
||||
&.is-ok {
|
||||
color: #52c41a;
|
||||
}
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
|
||||
在新工单中引用
屏蔽一个用户