From ace8b830af14071f99cbe4f52b8ed60a2de9fe8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AF=E4=B9=90=E5=8A=A0=E5=86=B0?= <11869599+addie66@user.noreply.gitee.com> Date: Sun, 15 Nov 2026 16:12:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(huifu):=20=E9=87=8D=E6=9E=84=E5=B9=B6?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E6=9B=B4=E6=8D=A2=E7=BB=93=E7=AE=97=E9=93=B6?= =?UTF-8?q?=E8=A1=8C=E5=8D=A1=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将原本简单的卡号输入弹窗重构为完整的表单弹窗。 新增开户支行关键字搜索功能,支持自动带出联行号。 支持修改账户类型,对公账户需上传开户许可证。 增加银行卡照片上传,当卡号变更时强制重新上传。 完善提交前的卡号、手机号及必填项等前端校验逻辑。 --- .../view/shopro_huifu/onboard/index.html | 75 +++++++ .../assets/js/backend/shopro_huifu/onboard.js | 191 ++++++++++++++---- .../view/shopro_huifu/onboard/index.html | 75 +++++++ .../assets/js/backend/shopro_huifu/onboard.js | 191 ++++++++++++++---- 4 files changed, 458 insertions(+), 74 deletions(-) diff --git a/addons/shopro_huifu/application/admin/view/shopro_huifu/onboard/index.html b/addons/shopro_huifu/application/admin/view/shopro_huifu/onboard/index.html index 8d9e92e..0c503d0 100644 --- a/addons/shopro_huifu/application/admin/view/shopro_huifu/onboard/index.html +++ b/addons/shopro_huifu/application/admin/view/shopro_huifu/onboard/index.html @@ -14,6 +14,11 @@ .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 .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; } @@ -143,4 +148,74 @@ 换卡审核中 + + + + + + + + + + 对私 + 对公 + + + + + + + + + + {{ item.branch_name }} + {{ item.branch_code }} + + + + 已选:{{ modifyCardForm.branch_name }}(联行号 {{ modifyCardForm.branch_code }}) + + + + + + + + + + + + + 点击上传 + + + 更换卡号后请重新上传银行卡照片 + + + + + + 点击上传 + + + + + + 取消 + 提交更换 + + diff --git a/addons/shopro_huifu/public/assets/js/backend/shopro_huifu/onboard.js b/addons/shopro_huifu/public/assets/js/backend/shopro_huifu/onboard.js index 10186e0..628c32c 100644 --- a/addons/shopro_huifu/public/assets/js/backend/shopro_huifu/onboard.js +++ b/addons/shopro_huifu/public/assets/js/backend/shopro_huifu/onboard.js @@ -380,14 +380,36 @@ define(['jquery', 'bootstrap', 'backend'], function ($, undefined, Backend) { withVue(function (Vue) { new Vue({ el: '#huifuOnboardIndex', - data: { - listData: [], - loading: false, - filterStatus: '', - detailVisible: false, - detailLoading: false, - detailData: null, - detailId: 0 + data: function () { + return { + listData: [], + loading: false, + filterStatus: '', + detailVisible: false, + detailLoading: false, + 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: { previewList: function () { @@ -396,6 +418,11 @@ define(['jquery', 'bootstrap', 'backend'], function ($, undefined, Backend) { } 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; }); + }, + 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 () { @@ -514,39 +541,129 @@ define(['jquery', 'bootstrap', 'backend'], function ($, undefined, Backend) { return; } var form = vm.detailData.form; - Layer.prompt({ - title: '输入新结算银行卡号(支行等信息沿用当前资料,更换卡号请同步在资料中更新支行/卡图)', - value: form.card_no || '', - formType: 0, - maxlength: 32 - }, function (cardNo, index) { - Layer.close(index); - cardNo = (cardNo || '').replace(/\s+/g, ''); - if (!/^\d{12,19}$/.test(cardNo)) { - Toastr.error('银行卡号格式不正确'); - return; - } + vm.modifyCardOriginalCardNo = String(form.card_no || '').replace(/\s+/g, ''); + vm.modifyCardForm = { + card_no: form.card_no || '', + card_name: form.card_name || form.name || '', + bank_account_type: String(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 || '', + mobile_no: form.mobile_no || form.mp || form.legal_mobile || '', + 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({ - url: 'shopro_huifu/onboard/modifyCard/ids/' + vm.detailId, - type: 'POST', + url: 'shopro_huifu/onboard/searchBranch', + type: 'GET', data: { - row: { - card_no: cardNo, - 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 || '' - } + keyword: keyword, + city_code: vm.modifyCardForm.area_id || '', + limit: 20 } - }, function () { - vm.openDetail(vm.detailId); - vm.getList(); + }, function (ret, res) { + vm.modifyCardBranchResults = (res.data && res.data.list) || []; + 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 () { diff --git a/application/admin/view/shopro_huifu/onboard/index.html b/application/admin/view/shopro_huifu/onboard/index.html index 8d9e92e..0c503d0 100644 --- a/application/admin/view/shopro_huifu/onboard/index.html +++ b/application/admin/view/shopro_huifu/onboard/index.html @@ -14,6 +14,11 @@ .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 .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; } @@ -143,4 +148,74 @@ 换卡审核中 + + + + + + + + + + 对私 + 对公 + + + + + + + + + + {{ item.branch_name }} + {{ item.branch_code }} + + + + 已选:{{ modifyCardForm.branch_name }}(联行号 {{ modifyCardForm.branch_code }}) + + + + + + + + + + + + + 点击上传 + + + 更换卡号后请重新上传银行卡照片 + + + + + + 点击上传 + + + + + + 取消 + 提交更换 + + diff --git a/public/assets/js/backend/shopro_huifu/onboard.js b/public/assets/js/backend/shopro_huifu/onboard.js index 10186e0..628c32c 100644 --- a/public/assets/js/backend/shopro_huifu/onboard.js +++ b/public/assets/js/backend/shopro_huifu/onboard.js @@ -380,14 +380,36 @@ define(['jquery', 'bootstrap', 'backend'], function ($, undefined, Backend) { withVue(function (Vue) { new Vue({ el: '#huifuOnboardIndex', - data: { - listData: [], - loading: false, - filterStatus: '', - detailVisible: false, - detailLoading: false, - detailData: null, - detailId: 0 + data: function () { + return { + listData: [], + loading: false, + filterStatus: '', + detailVisible: false, + detailLoading: false, + 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: { previewList: function () { @@ -396,6 +418,11 @@ define(['jquery', 'bootstrap', 'backend'], function ($, undefined, Backend) { } 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; }); + }, + 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 () { @@ -514,39 +541,129 @@ define(['jquery', 'bootstrap', 'backend'], function ($, undefined, Backend) { return; } var form = vm.detailData.form; - Layer.prompt({ - title: '输入新结算银行卡号(支行等信息沿用当前资料,更换卡号请同步在资料中更新支行/卡图)', - value: form.card_no || '', - formType: 0, - maxlength: 32 - }, function (cardNo, index) { - Layer.close(index); - cardNo = (cardNo || '').replace(/\s+/g, ''); - if (!/^\d{12,19}$/.test(cardNo)) { - Toastr.error('银行卡号格式不正确'); - return; - } + vm.modifyCardOriginalCardNo = String(form.card_no || '').replace(/\s+/g, ''); + vm.modifyCardForm = { + card_no: form.card_no || '', + card_name: form.card_name || form.name || '', + bank_account_type: String(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 || '', + mobile_no: form.mobile_no || form.mp || form.legal_mobile || '', + 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({ - url: 'shopro_huifu/onboard/modifyCard/ids/' + vm.detailId, - type: 'POST', + url: 'shopro_huifu/onboard/searchBranch', + type: 'GET', data: { - row: { - card_no: cardNo, - 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 || '' - } + keyword: keyword, + city_code: vm.modifyCardForm.area_id || '', + limit: 20 } - }, function () { - vm.openDetail(vm.detailId); - vm.getList(); + }, function (ret, res) { + vm.modifyCardBranchResults = (res.data && res.data.list) || []; + 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 () {