feat(huifu): 重构并增强更换结算银行卡功能
将原本简单的卡号输入弹窗重构为完整的表单弹窗。 新增开户支行关键字搜索功能,支持自动带出联行号。 支持修改账户类型,对公账户需上传开户许可证。 增加银行卡照片上传,当卡号变更时强制重新上传。 完善提交前的卡号、手机号及必填项等前端校验逻辑。
这个提交包含在:
@@ -14,6 +14,11 @@
|
|||||||
.onboard-detail .photo-label { font-size: 12px; color: #606266; margin-bottom: 6px; }
|
.onboard-detail .photo-label { font-size: 12px; color: #606266; margin-bottom: 6px; }
|
||||||
.onboard-detail .photo-img { width: 220px; height: 140px; border: 1px solid #ebeef5; border-radius: 4px; background: #f5f7fa; }
|
.onboard-detail .photo-img { width: 220px; height: 140px; border: 1px solid #ebeef5; border-radius: 4px; background: #f5f7fa; }
|
||||||
.onboard-detail .biz-tip { margin-top: 12px; padding: 10px 12px; background: #fdf6ec; border: 1px solid #faecd8; border-radius: 4px; color: #e6a23c; font-size: 13px; line-height: 1.6; }
|
.onboard-detail .biz-tip { margin-top: 12px; padding: 10px 12px; background: #fdf6ec; border: 1px solid #faecd8; border-radius: 4px; color: #e6a23c; font-size: 13px; line-height: 1.6; }
|
||||||
|
.modify-card-dialog .branch-panel { max-height: 180px; overflow-y: auto; border: 1px solid #ebeef5; border-radius: 4px; margin-top: 6px; }
|
||||||
|
.modify-card-dialog .branch-item { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
|
||||||
|
.modify-card-dialog .branch-item:hover { background: #f5f7fa; }
|
||||||
|
.modify-card-dialog .upload-box { width: 160px; height: 100px; border: 1px dashed #dcdfe6; border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fafafa; }
|
||||||
|
.modify-card-dialog .upload-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
|
||||||
</style>
|
</style>
|
||||||
<script src="__CDN__/assets/addons/shopro/libs/vue.js"></script>
|
<script src="__CDN__/assets/addons/shopro/libs/vue.js"></script>
|
||||||
<script src="__CDN__/assets/addons/shopro/libs/element/element.js"></script>
|
<script src="__CDN__/assets/addons/shopro/libs/element/element.js"></script>
|
||||||
@@ -143,4 +148,74 @@
|
|||||||
<el-tag size="mini" type="warning" v-if="detailData && detailData.card_modify_pending" style="margin-left:8px;">换卡审核中</el-tag>
|
<el-tag size="mini" type="warning" v-if="detailData && detailData.card_modify_pending" style="margin-left:8px;">换卡审核中</el-tag>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="更换结算银行卡"
|
||||||
|
custom-class="modify-card-dialog"
|
||||||
|
:visible.sync="modifyCardVisible"
|
||||||
|
width="640px"
|
||||||
|
append-to-body
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<el-alert
|
||||||
|
type="info"
|
||||||
|
:closable="false"
|
||||||
|
show-icon
|
||||||
|
title="仅修改结算卡相关信息;身份/执照资料保持不变。"
|
||||||
|
style="margin-bottom:14px;"
|
||||||
|
></el-alert>
|
||||||
|
<el-form label-width="110px" size="small" v-if="modifyCardForm">
|
||||||
|
<el-form-item label="开户名">
|
||||||
|
<el-input :value="modifyCardForm.card_name || detailData && detailData.form && (detailData.form.card_name || detailData.form.name) || '-'" disabled></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="账户类型" v-if="detailData && detailData.form && detailData.form.account_type === 'ent'">
|
||||||
|
<el-radio-group v-model="modifyCardForm.bank_account_type">
|
||||||
|
<el-radio label="0">对私</el-radio>
|
||||||
|
<el-radio label="1">对公</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="银行卡号" required>
|
||||||
|
<el-input v-model="modifyCardForm.card_no" maxlength="32" placeholder="请输入新结算银行卡号" @input="onModifyCardNoInput"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开户支行" required>
|
||||||
|
<el-input v-model="modifyCardBranchKeyword" placeholder="搜索支行名称,例如:建设银行贵阳XX支行" @input="onModifyBranchInput"></el-input>
|
||||||
|
<div class="branch-panel" v-if="modifyCardBranchResults.length">
|
||||||
|
<div class="branch-item" v-for="(item, idx) in modifyCardBranchResults" :key="idx" @click="selectModifyBranch(item)">
|
||||||
|
<div>{{ item.branch_name }}</div>
|
||||||
|
<div style="color:#909399;font-size:12px;">{{ item.branch_code }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="color:#7536D0;font-size:12px;margin-top:4px;" v-if="modifyCardForm.branch_code">
|
||||||
|
已选:{{ modifyCardForm.branch_name }}(联行号 {{ modifyCardForm.branch_code }})
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联行号" required>
|
||||||
|
<el-input v-model="modifyCardForm.branch_code" maxlength="20" placeholder="可搜索支行自动带出,也可手动填写"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预留手机号" required>
|
||||||
|
<el-input v-model="modifyCardForm.mobile_no" maxlength="11" placeholder="银行预留手机号"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="银行卡照片" :required="modifyCardNeedNewPhoto">
|
||||||
|
<el-upload :action="modifyCardUploadUrl" :show-file-list="false" accept="image/*" :on-success="onModifyCardUploadSuccess">
|
||||||
|
<div class="upload-box">
|
||||||
|
<img v-if="modifyCardForm.bank_card_url" :src="modifyCardForm.bank_card_url">
|
||||||
|
<span v-else style="color:#909399;font-size:12px;">点击上传</span>
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
<div style="color:#E6A23C;font-size:12px;margin-top:4px;" v-if="modifyCardNeedNewPhoto">更换卡号后请重新上传银行卡照片</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开户许可证" v-if="modifyCardForm.bank_account_type === '1'" required>
|
||||||
|
<el-upload :action="modifyCardUploadUrl" :show-file-list="false" accept="image/*" :on-success="onModifyPermitUploadSuccess">
|
||||||
|
<div class="upload-box">
|
||||||
|
<img v-if="modifyCardForm.account_permit_url" :src="modifyCardForm.account_permit_url">
|
||||||
|
<span v-else style="color:#909399;font-size:12px;">点击上传</span>
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer">
|
||||||
|
<el-button @click="modifyCardVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="modifyCardSaving" @click="submitModifyCard">提交更换</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -380,14 +380,36 @@ define(['jquery', 'bootstrap', 'backend'], function ($, undefined, Backend) {
|
|||||||
withVue(function (Vue) {
|
withVue(function (Vue) {
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#huifuOnboardIndex',
|
el: '#huifuOnboardIndex',
|
||||||
data: {
|
data: function () {
|
||||||
listData: [],
|
return {
|
||||||
loading: false,
|
listData: [],
|
||||||
filterStatus: '',
|
loading: false,
|
||||||
detailVisible: false,
|
filterStatus: '',
|
||||||
detailLoading: false,
|
detailVisible: false,
|
||||||
detailData: null,
|
detailLoading: false,
|
||||||
detailId: 0
|
detailData: null,
|
||||||
|
detailId: 0,
|
||||||
|
modifyCardVisible: false,
|
||||||
|
modifyCardSaving: false,
|
||||||
|
modifyCardForm: {
|
||||||
|
card_no: '',
|
||||||
|
card_name: '',
|
||||||
|
bank_account_type: '0',
|
||||||
|
branch_code: '',
|
||||||
|
branch_name: '',
|
||||||
|
prov_id: '',
|
||||||
|
area_id: '',
|
||||||
|
mobile_no: '',
|
||||||
|
mp: '',
|
||||||
|
bank_card_url: '',
|
||||||
|
account_permit_url: ''
|
||||||
|
},
|
||||||
|
modifyCardOriginalCardNo: '',
|
||||||
|
modifyCardBranchKeyword: '',
|
||||||
|
modifyCardBranchResults: [],
|
||||||
|
modifyCardBranchTimer: null,
|
||||||
|
modifyCardUploadUrl: Fast.api.fixurl('ajax/upload')
|
||||||
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
previewList: function () {
|
previewList: function () {
|
||||||
@@ -396,6 +418,11 @@ define(['jquery', 'bootstrap', 'backend'], function ($, undefined, Backend) {
|
|||||||
}
|
}
|
||||||
var f = this.detailData.form;
|
var f = this.detailData.form;
|
||||||
return [f.id_card_front_url, f.id_card_back_url, f.bank_card_url].filter(function (u) { return !!u; });
|
return [f.id_card_front_url, f.id_card_back_url, f.bank_card_url].filter(function (u) { return !!u; });
|
||||||
|
},
|
||||||
|
modifyCardNeedNewPhoto: function () {
|
||||||
|
var oldNo = String(this.modifyCardOriginalCardNo || '').replace(/\s+/g, '');
|
||||||
|
var newNo = String((this.modifyCardForm && this.modifyCardForm.card_no) || '').replace(/\s+/g, '');
|
||||||
|
return !!(oldNo && newNo && oldNo !== newNo);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
@@ -514,39 +541,129 @@ define(['jquery', 'bootstrap', 'backend'], function ($, undefined, Backend) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var form = vm.detailData.form;
|
var form = vm.detailData.form;
|
||||||
Layer.prompt({
|
vm.modifyCardOriginalCardNo = String(form.card_no || '').replace(/\s+/g, '');
|
||||||
title: '输入新结算银行卡号(支行等信息沿用当前资料,更换卡号请同步在资料中更新支行/卡图)',
|
vm.modifyCardForm = {
|
||||||
value: form.card_no || '',
|
card_no: form.card_no || '',
|
||||||
formType: 0,
|
card_name: form.card_name || form.name || '',
|
||||||
maxlength: 32
|
bank_account_type: String(form.bank_account_type || '0'),
|
||||||
}, function (cardNo, index) {
|
branch_code: form.branch_code || '',
|
||||||
Layer.close(index);
|
branch_name: form.branch_name || '',
|
||||||
cardNo = (cardNo || '').replace(/\s+/g, '');
|
prov_id: form.prov_id || '',
|
||||||
if (!/^\d{12,19}$/.test(cardNo)) {
|
area_id: form.area_id || '',
|
||||||
Toastr.error('银行卡号格式不正确');
|
mobile_no: form.mobile_no || form.mp || form.legal_mobile || '',
|
||||||
return;
|
mp: form.mp || form.mobile_no || form.legal_mobile || '',
|
||||||
}
|
bank_card_url: form.bank_card_url || '',
|
||||||
|
account_permit_url: form.account_permit_url || ''
|
||||||
|
};
|
||||||
|
vm.modifyCardBranchKeyword = form.branch_name || '';
|
||||||
|
vm.modifyCardBranchResults = [];
|
||||||
|
vm.modifyCardVisible = true;
|
||||||
|
},
|
||||||
|
onModifyCardNoInput: function () {
|
||||||
|
if (!this.modifyCardNeedNewPhoto) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 卡号变更后清空旧卡图,强制重传
|
||||||
|
this.modifyCardForm.bank_card_url = '';
|
||||||
|
},
|
||||||
|
onModifyBranchInput: function () {
|
||||||
|
var vm = this;
|
||||||
|
clearTimeout(vm.modifyCardBranchTimer);
|
||||||
|
var keyword = (vm.modifyCardBranchKeyword || '').trim();
|
||||||
|
if (keyword.length < 2) {
|
||||||
|
vm.modifyCardBranchResults = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
vm.modifyCardBranchTimer = setTimeout(function () {
|
||||||
Fast.api.ajax({
|
Fast.api.ajax({
|
||||||
url: 'shopro_huifu/onboard/modifyCard/ids/' + vm.detailId,
|
url: 'shopro_huifu/onboard/searchBranch',
|
||||||
type: 'POST',
|
type: 'GET',
|
||||||
data: {
|
data: {
|
||||||
row: {
|
keyword: keyword,
|
||||||
card_no: cardNo,
|
city_code: vm.modifyCardForm.area_id || '',
|
||||||
bank_account_type: form.bank_account_type || '0',
|
limit: 20
|
||||||
branch_code: form.branch_code || '',
|
|
||||||
branch_name: form.branch_name || '',
|
|
||||||
prov_id: form.prov_id || '',
|
|
||||||
area_id: form.area_id || '',
|
|
||||||
mp: form.mobile_no || '',
|
|
||||||
mobile_no: form.mobile_no || '',
|
|
||||||
bank_card_url: form.bank_card_url || '',
|
|
||||||
account_permit_url: form.account_permit_url || ''
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, function () {
|
}, function (ret, res) {
|
||||||
vm.openDetail(vm.detailId);
|
vm.modifyCardBranchResults = (res.data && res.data.list) || [];
|
||||||
vm.getList();
|
return false;
|
||||||
});
|
});
|
||||||
|
}, 300);
|
||||||
|
},
|
||||||
|
selectModifyBranch: function (item) {
|
||||||
|
this.modifyCardForm.branch_code = item.branch_code;
|
||||||
|
this.modifyCardForm.branch_name = item.branch_name;
|
||||||
|
this.modifyCardBranchKeyword = item.branch_name;
|
||||||
|
this.modifyCardBranchResults = [];
|
||||||
|
if (item.prov_id) this.modifyCardForm.prov_id = item.prov_id;
|
||||||
|
if (item.area_id) this.modifyCardForm.area_id = item.area_id;
|
||||||
|
},
|
||||||
|
onModifyCardUploadSuccess: function (res) {
|
||||||
|
if (res && res.code === 1 && res.data && (res.data.fullurl || res.data.url)) {
|
||||||
|
this.modifyCardForm.bank_card_url = res.data.fullurl || res.data.url;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$message.error((res && res.msg) || '上传失败');
|
||||||
|
},
|
||||||
|
onModifyPermitUploadSuccess: function (res) {
|
||||||
|
if (res && res.code === 1 && res.data && (res.data.fullurl || res.data.url)) {
|
||||||
|
this.modifyCardForm.account_permit_url = res.data.fullurl || res.data.url;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$message.error((res && res.msg) || '上传失败');
|
||||||
|
},
|
||||||
|
submitModifyCard: function () {
|
||||||
|
var vm = this;
|
||||||
|
var form = vm.modifyCardForm || {};
|
||||||
|
var cardNo = String(form.card_no || '').replace(/\s+/g, '');
|
||||||
|
if (!/^\d{12,19}$/.test(cardNo)) {
|
||||||
|
Toastr.error('银行卡号格式不正确');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!form.branch_code) {
|
||||||
|
Toastr.error('请搜索并选择开户支行(或填写联行号)');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!form.branch_name && vm.modifyCardBranchKeyword) {
|
||||||
|
form.branch_name = vm.modifyCardBranchKeyword.trim();
|
||||||
|
}
|
||||||
|
if (!form.mobile_no || !/^1\d{10}$/.test(String(form.mobile_no))) {
|
||||||
|
Toastr.error('请填写正确的银行预留手机号');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (vm.modifyCardNeedNewPhoto && !form.bank_card_url) {
|
||||||
|
Toastr.error('更换卡号后请重新上传银行卡照片');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (String(form.bank_account_type) === '1' && !form.account_permit_url) {
|
||||||
|
Toastr.error('对公账户请上传开户许可证');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
vm.modifyCardSaving = true;
|
||||||
|
Fast.api.ajax({
|
||||||
|
url: 'shopro_huifu/onboard/modifyCard/ids/' + vm.detailId,
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
row: {
|
||||||
|
card_no: cardNo,
|
||||||
|
card_name: form.card_name || '',
|
||||||
|
bank_account_type: form.bank_account_type || '0',
|
||||||
|
branch_code: form.branch_code || '',
|
||||||
|
branch_name: form.branch_name || '',
|
||||||
|
prov_id: form.prov_id || '',
|
||||||
|
area_id: form.area_id || '',
|
||||||
|
mp: form.mobile_no || '',
|
||||||
|
mobile_no: form.mobile_no || '',
|
||||||
|
bank_card_url: form.bank_card_url || '',
|
||||||
|
account_permit_url: form.account_permit_url || ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, function () {
|
||||||
|
vm.modifyCardSaving = false;
|
||||||
|
vm.modifyCardVisible = false;
|
||||||
|
vm.openDetail(vm.detailId);
|
||||||
|
vm.getList();
|
||||||
|
}, function () {
|
||||||
|
vm.modifyCardSaving = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
editFromDetail: function () {
|
editFromDetail: function () {
|
||||||
|
|||||||
@@ -14,6 +14,11 @@
|
|||||||
.onboard-detail .photo-label { font-size: 12px; color: #606266; margin-bottom: 6px; }
|
.onboard-detail .photo-label { font-size: 12px; color: #606266; margin-bottom: 6px; }
|
||||||
.onboard-detail .photo-img { width: 220px; height: 140px; border: 1px solid #ebeef5; border-radius: 4px; background: #f5f7fa; }
|
.onboard-detail .photo-img { width: 220px; height: 140px; border: 1px solid #ebeef5; border-radius: 4px; background: #f5f7fa; }
|
||||||
.onboard-detail .biz-tip { margin-top: 12px; padding: 10px 12px; background: #fdf6ec; border: 1px solid #faecd8; border-radius: 4px; color: #e6a23c; font-size: 13px; line-height: 1.6; }
|
.onboard-detail .biz-tip { margin-top: 12px; padding: 10px 12px; background: #fdf6ec; border: 1px solid #faecd8; border-radius: 4px; color: #e6a23c; font-size: 13px; line-height: 1.6; }
|
||||||
|
.modify-card-dialog .branch-panel { max-height: 180px; overflow-y: auto; border: 1px solid #ebeef5; border-radius: 4px; margin-top: 6px; }
|
||||||
|
.modify-card-dialog .branch-item { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
|
||||||
|
.modify-card-dialog .branch-item:hover { background: #f5f7fa; }
|
||||||
|
.modify-card-dialog .upload-box { width: 160px; height: 100px; border: 1px dashed #dcdfe6; border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fafafa; }
|
||||||
|
.modify-card-dialog .upload-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
|
||||||
</style>
|
</style>
|
||||||
<script src="__CDN__/assets/addons/shopro/libs/vue.js"></script>
|
<script src="__CDN__/assets/addons/shopro/libs/vue.js"></script>
|
||||||
<script src="__CDN__/assets/addons/shopro/libs/element/element.js"></script>
|
<script src="__CDN__/assets/addons/shopro/libs/element/element.js"></script>
|
||||||
@@ -143,4 +148,74 @@
|
|||||||
<el-tag size="mini" type="warning" v-if="detailData && detailData.card_modify_pending" style="margin-left:8px;">换卡审核中</el-tag>
|
<el-tag size="mini" type="warning" v-if="detailData && detailData.card_modify_pending" style="margin-left:8px;">换卡审核中</el-tag>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="更换结算银行卡"
|
||||||
|
custom-class="modify-card-dialog"
|
||||||
|
:visible.sync="modifyCardVisible"
|
||||||
|
width="640px"
|
||||||
|
append-to-body
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<el-alert
|
||||||
|
type="info"
|
||||||
|
:closable="false"
|
||||||
|
show-icon
|
||||||
|
title="仅修改结算卡相关信息;身份/执照资料保持不变。"
|
||||||
|
style="margin-bottom:14px;"
|
||||||
|
></el-alert>
|
||||||
|
<el-form label-width="110px" size="small" v-if="modifyCardForm">
|
||||||
|
<el-form-item label="开户名">
|
||||||
|
<el-input :value="modifyCardForm.card_name || detailData && detailData.form && (detailData.form.card_name || detailData.form.name) || '-'" disabled></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="账户类型" v-if="detailData && detailData.form && detailData.form.account_type === 'ent'">
|
||||||
|
<el-radio-group v-model="modifyCardForm.bank_account_type">
|
||||||
|
<el-radio label="0">对私</el-radio>
|
||||||
|
<el-radio label="1">对公</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="银行卡号" required>
|
||||||
|
<el-input v-model="modifyCardForm.card_no" maxlength="32" placeholder="请输入新结算银行卡号" @input="onModifyCardNoInput"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开户支行" required>
|
||||||
|
<el-input v-model="modifyCardBranchKeyword" placeholder="搜索支行名称,例如:建设银行贵阳XX支行" @input="onModifyBranchInput"></el-input>
|
||||||
|
<div class="branch-panel" v-if="modifyCardBranchResults.length">
|
||||||
|
<div class="branch-item" v-for="(item, idx) in modifyCardBranchResults" :key="idx" @click="selectModifyBranch(item)">
|
||||||
|
<div>{{ item.branch_name }}</div>
|
||||||
|
<div style="color:#909399;font-size:12px;">{{ item.branch_code }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="color:#7536D0;font-size:12px;margin-top:4px;" v-if="modifyCardForm.branch_code">
|
||||||
|
已选:{{ modifyCardForm.branch_name }}(联行号 {{ modifyCardForm.branch_code }})
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联行号" required>
|
||||||
|
<el-input v-model="modifyCardForm.branch_code" maxlength="20" placeholder="可搜索支行自动带出,也可手动填写"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预留手机号" required>
|
||||||
|
<el-input v-model="modifyCardForm.mobile_no" maxlength="11" placeholder="银行预留手机号"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="银行卡照片" :required="modifyCardNeedNewPhoto">
|
||||||
|
<el-upload :action="modifyCardUploadUrl" :show-file-list="false" accept="image/*" :on-success="onModifyCardUploadSuccess">
|
||||||
|
<div class="upload-box">
|
||||||
|
<img v-if="modifyCardForm.bank_card_url" :src="modifyCardForm.bank_card_url">
|
||||||
|
<span v-else style="color:#909399;font-size:12px;">点击上传</span>
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
<div style="color:#E6A23C;font-size:12px;margin-top:4px;" v-if="modifyCardNeedNewPhoto">更换卡号后请重新上传银行卡照片</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开户许可证" v-if="modifyCardForm.bank_account_type === '1'" required>
|
||||||
|
<el-upload :action="modifyCardUploadUrl" :show-file-list="false" accept="image/*" :on-success="onModifyPermitUploadSuccess">
|
||||||
|
<div class="upload-box">
|
||||||
|
<img v-if="modifyCardForm.account_permit_url" :src="modifyCardForm.account_permit_url">
|
||||||
|
<span v-else style="color:#909399;font-size:12px;">点击上传</span>
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer">
|
||||||
|
<el-button @click="modifyCardVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="modifyCardSaving" @click="submitModifyCard">提交更换</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -380,14 +380,36 @@ define(['jquery', 'bootstrap', 'backend'], function ($, undefined, Backend) {
|
|||||||
withVue(function (Vue) {
|
withVue(function (Vue) {
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#huifuOnboardIndex',
|
el: '#huifuOnboardIndex',
|
||||||
data: {
|
data: function () {
|
||||||
listData: [],
|
return {
|
||||||
loading: false,
|
listData: [],
|
||||||
filterStatus: '',
|
loading: false,
|
||||||
detailVisible: false,
|
filterStatus: '',
|
||||||
detailLoading: false,
|
detailVisible: false,
|
||||||
detailData: null,
|
detailLoading: false,
|
||||||
detailId: 0
|
detailData: null,
|
||||||
|
detailId: 0,
|
||||||
|
modifyCardVisible: false,
|
||||||
|
modifyCardSaving: false,
|
||||||
|
modifyCardForm: {
|
||||||
|
card_no: '',
|
||||||
|
card_name: '',
|
||||||
|
bank_account_type: '0',
|
||||||
|
branch_code: '',
|
||||||
|
branch_name: '',
|
||||||
|
prov_id: '',
|
||||||
|
area_id: '',
|
||||||
|
mobile_no: '',
|
||||||
|
mp: '',
|
||||||
|
bank_card_url: '',
|
||||||
|
account_permit_url: ''
|
||||||
|
},
|
||||||
|
modifyCardOriginalCardNo: '',
|
||||||
|
modifyCardBranchKeyword: '',
|
||||||
|
modifyCardBranchResults: [],
|
||||||
|
modifyCardBranchTimer: null,
|
||||||
|
modifyCardUploadUrl: Fast.api.fixurl('ajax/upload')
|
||||||
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
previewList: function () {
|
previewList: function () {
|
||||||
@@ -396,6 +418,11 @@ define(['jquery', 'bootstrap', 'backend'], function ($, undefined, Backend) {
|
|||||||
}
|
}
|
||||||
var f = this.detailData.form;
|
var f = this.detailData.form;
|
||||||
return [f.id_card_front_url, f.id_card_back_url, f.bank_card_url].filter(function (u) { return !!u; });
|
return [f.id_card_front_url, f.id_card_back_url, f.bank_card_url].filter(function (u) { return !!u; });
|
||||||
|
},
|
||||||
|
modifyCardNeedNewPhoto: function () {
|
||||||
|
var oldNo = String(this.modifyCardOriginalCardNo || '').replace(/\s+/g, '');
|
||||||
|
var newNo = String((this.modifyCardForm && this.modifyCardForm.card_no) || '').replace(/\s+/g, '');
|
||||||
|
return !!(oldNo && newNo && oldNo !== newNo);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
@@ -514,39 +541,129 @@ define(['jquery', 'bootstrap', 'backend'], function ($, undefined, Backend) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var form = vm.detailData.form;
|
var form = vm.detailData.form;
|
||||||
Layer.prompt({
|
vm.modifyCardOriginalCardNo = String(form.card_no || '').replace(/\s+/g, '');
|
||||||
title: '输入新结算银行卡号(支行等信息沿用当前资料,更换卡号请同步在资料中更新支行/卡图)',
|
vm.modifyCardForm = {
|
||||||
value: form.card_no || '',
|
card_no: form.card_no || '',
|
||||||
formType: 0,
|
card_name: form.card_name || form.name || '',
|
||||||
maxlength: 32
|
bank_account_type: String(form.bank_account_type || '0'),
|
||||||
}, function (cardNo, index) {
|
branch_code: form.branch_code || '',
|
||||||
Layer.close(index);
|
branch_name: form.branch_name || '',
|
||||||
cardNo = (cardNo || '').replace(/\s+/g, '');
|
prov_id: form.prov_id || '',
|
||||||
if (!/^\d{12,19}$/.test(cardNo)) {
|
area_id: form.area_id || '',
|
||||||
Toastr.error('银行卡号格式不正确');
|
mobile_no: form.mobile_no || form.mp || form.legal_mobile || '',
|
||||||
return;
|
mp: form.mp || form.mobile_no || form.legal_mobile || '',
|
||||||
}
|
bank_card_url: form.bank_card_url || '',
|
||||||
|
account_permit_url: form.account_permit_url || ''
|
||||||
|
};
|
||||||
|
vm.modifyCardBranchKeyword = form.branch_name || '';
|
||||||
|
vm.modifyCardBranchResults = [];
|
||||||
|
vm.modifyCardVisible = true;
|
||||||
|
},
|
||||||
|
onModifyCardNoInput: function () {
|
||||||
|
if (!this.modifyCardNeedNewPhoto) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 卡号变更后清空旧卡图,强制重传
|
||||||
|
this.modifyCardForm.bank_card_url = '';
|
||||||
|
},
|
||||||
|
onModifyBranchInput: function () {
|
||||||
|
var vm = this;
|
||||||
|
clearTimeout(vm.modifyCardBranchTimer);
|
||||||
|
var keyword = (vm.modifyCardBranchKeyword || '').trim();
|
||||||
|
if (keyword.length < 2) {
|
||||||
|
vm.modifyCardBranchResults = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
vm.modifyCardBranchTimer = setTimeout(function () {
|
||||||
Fast.api.ajax({
|
Fast.api.ajax({
|
||||||
url: 'shopro_huifu/onboard/modifyCard/ids/' + vm.detailId,
|
url: 'shopro_huifu/onboard/searchBranch',
|
||||||
type: 'POST',
|
type: 'GET',
|
||||||
data: {
|
data: {
|
||||||
row: {
|
keyword: keyword,
|
||||||
card_no: cardNo,
|
city_code: vm.modifyCardForm.area_id || '',
|
||||||
bank_account_type: form.bank_account_type || '0',
|
limit: 20
|
||||||
branch_code: form.branch_code || '',
|
|
||||||
branch_name: form.branch_name || '',
|
|
||||||
prov_id: form.prov_id || '',
|
|
||||||
area_id: form.area_id || '',
|
|
||||||
mp: form.mobile_no || '',
|
|
||||||
mobile_no: form.mobile_no || '',
|
|
||||||
bank_card_url: form.bank_card_url || '',
|
|
||||||
account_permit_url: form.account_permit_url || ''
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, function () {
|
}, function (ret, res) {
|
||||||
vm.openDetail(vm.detailId);
|
vm.modifyCardBranchResults = (res.data && res.data.list) || [];
|
||||||
vm.getList();
|
return false;
|
||||||
});
|
});
|
||||||
|
}, 300);
|
||||||
|
},
|
||||||
|
selectModifyBranch: function (item) {
|
||||||
|
this.modifyCardForm.branch_code = item.branch_code;
|
||||||
|
this.modifyCardForm.branch_name = item.branch_name;
|
||||||
|
this.modifyCardBranchKeyword = item.branch_name;
|
||||||
|
this.modifyCardBranchResults = [];
|
||||||
|
if (item.prov_id) this.modifyCardForm.prov_id = item.prov_id;
|
||||||
|
if (item.area_id) this.modifyCardForm.area_id = item.area_id;
|
||||||
|
},
|
||||||
|
onModifyCardUploadSuccess: function (res) {
|
||||||
|
if (res && res.code === 1 && res.data && (res.data.fullurl || res.data.url)) {
|
||||||
|
this.modifyCardForm.bank_card_url = res.data.fullurl || res.data.url;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$message.error((res && res.msg) || '上传失败');
|
||||||
|
},
|
||||||
|
onModifyPermitUploadSuccess: function (res) {
|
||||||
|
if (res && res.code === 1 && res.data && (res.data.fullurl || res.data.url)) {
|
||||||
|
this.modifyCardForm.account_permit_url = res.data.fullurl || res.data.url;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$message.error((res && res.msg) || '上传失败');
|
||||||
|
},
|
||||||
|
submitModifyCard: function () {
|
||||||
|
var vm = this;
|
||||||
|
var form = vm.modifyCardForm || {};
|
||||||
|
var cardNo = String(form.card_no || '').replace(/\s+/g, '');
|
||||||
|
if (!/^\d{12,19}$/.test(cardNo)) {
|
||||||
|
Toastr.error('银行卡号格式不正确');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!form.branch_code) {
|
||||||
|
Toastr.error('请搜索并选择开户支行(或填写联行号)');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!form.branch_name && vm.modifyCardBranchKeyword) {
|
||||||
|
form.branch_name = vm.modifyCardBranchKeyword.trim();
|
||||||
|
}
|
||||||
|
if (!form.mobile_no || !/^1\d{10}$/.test(String(form.mobile_no))) {
|
||||||
|
Toastr.error('请填写正确的银行预留手机号');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (vm.modifyCardNeedNewPhoto && !form.bank_card_url) {
|
||||||
|
Toastr.error('更换卡号后请重新上传银行卡照片');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (String(form.bank_account_type) === '1' && !form.account_permit_url) {
|
||||||
|
Toastr.error('对公账户请上传开户许可证');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
vm.modifyCardSaving = true;
|
||||||
|
Fast.api.ajax({
|
||||||
|
url: 'shopro_huifu/onboard/modifyCard/ids/' + vm.detailId,
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
row: {
|
||||||
|
card_no: cardNo,
|
||||||
|
card_name: form.card_name || '',
|
||||||
|
bank_account_type: form.bank_account_type || '0',
|
||||||
|
branch_code: form.branch_code || '',
|
||||||
|
branch_name: form.branch_name || '',
|
||||||
|
prov_id: form.prov_id || '',
|
||||||
|
area_id: form.area_id || '',
|
||||||
|
mp: form.mobile_no || '',
|
||||||
|
mobile_no: form.mobile_no || '',
|
||||||
|
bank_card_url: form.bank_card_url || '',
|
||||||
|
account_permit_url: form.account_permit_url || ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, function () {
|
||||||
|
vm.modifyCardSaving = false;
|
||||||
|
vm.modifyCardVisible = false;
|
||||||
|
vm.openDetail(vm.detailId);
|
||||||
|
vm.getList();
|
||||||
|
}, function () {
|
||||||
|
vm.modifyCardSaving = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
editFromDetail: function () {
|
editFromDetail: function () {
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户