From e4a8cf4a130b17d3bca957b1de09d2cfde0c5ba2 Mon Sep 17 00:00:00 2001 From: wkc <978997012@qq.com> Date: Thu, 30 Apr 2026 10:05:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8E=86=E5=8F=B2=E8=B4=B7?= =?UTF-8?q?=E6=AC=BE=E5=90=88=E5=90=8C=E5=8D=95=E9=80=89=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...2026-04-30-history-contract-radio-label.md | 27 ++++++++++++++++++ .../components/HistoryContractSelector.vue | 28 +++++++++++++++++-- 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 doc/implementation-report-2026-04-30-history-contract-radio-label.md diff --git a/doc/implementation-report-2026-04-30-history-contract-radio-label.md b/doc/implementation-report-2026-04-30-history-contract-radio-label.md new file mode 100644 index 0000000..13352dd --- /dev/null +++ b/doc/implementation-report-2026-04-30-history-contract-radio-label.md @@ -0,0 +1,27 @@ +# 历史贷款合同单选异常文本修复实施记录 + +## 问题 + +- 历史贷款合同选择弹窗的选择列出现 `{ "cus...` 这类异常文本。 +- 原因是 `el-radio` 使用整行对象 `scope.row` 作为 `label`,Element UI 会把对象值渲染到单选文案区域。 + +## 修改 + +- `HistoryContractSelector.vue` 将单选绑定值从整行对象调整为 `selectedContractKey`。 +- 新增 `contractRadioValue(row, index)` 生成稳定单选值,优先使用历史贷款合同号。 +- 保留 `selectedContract` 单独保存选中行对象,提交时仍向父组件返回完整合同记录。 +- 隐藏单选组件内部 label 文案,选择列只展示单选圆点,不展示对象文本。 +- `business-type-history-rate.test.js` 增加断言,禁止再出现 `:label="scope.row"`。 + +## 验证 + +- 已执行并通过: + - `zsh -lic 'nvm use 14.21.3 >/dev/null && npm --prefix ruoyi-ui run test:business-type-history-rate'` +- 已启动后端和前端后使用 in-app browser 真实页面验证: + - 打开 `http://localhost:8080/index`。 + - 新增个人客户,选择业务种类 `存量转贷`。 + - 历史贷款合同选择弹窗正常展示客户内码、历史贷款合同号、历史贷款利率等字段。 + - 选择列文本为空,不再出现 `{ "cus...` 或行对象 JSON 文本。 + - 验证结果:`hasObjectText=false`。 +- 验证结束后已关闭测试弹窗。 +- 验证结束后已停止本次启动的前端和后端进程,并确认 `8080`、`63310` 端口无监听。 diff --git a/ruoyi-ui/src/views/loanPricing/workflow/components/HistoryContractSelector.vue b/ruoyi-ui/src/views/loanPricing/workflow/components/HistoryContractSelector.vue index 462c602..1fe3ef6 100644 --- a/ruoyi-ui/src/views/loanPricing/workflow/components/HistoryContractSelector.vue +++ b/ruoyi-ui/src/views/loanPricing/workflow/components/HistoryContractSelector.vue @@ -4,7 +4,14 @@ @@ -41,7 +48,8 @@ export default { }, data() { return { - selectedContract: null + selectedContract: null, + selectedContractKey: null } }, computed: { @@ -55,7 +63,14 @@ export default { } }, methods: { - handleRowClick(row) { + contractRadioValue(row, index) { + return row.loan_contract_history || `${row.cust_isn || ''}-${index}` + }, + handleRowClick(row, column, event) { + this.selectedContract = row + this.selectedContractKey = this.contractRadioValue(row, this.contracts.indexOf(row)) + }, + handleRadioChange(row) { this.selectedContract = row }, confirmSelect() { @@ -72,7 +87,14 @@ export default { }, handleClose() { this.selectedContract = null + this.selectedContractKey = null } } } + +