From f3c29ef2bfc1d631d13795bb41910ebc7998a14c Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Tue, 25 Aug 2026 13:44:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=84=E5=88=86=E9=87=8F?= =?UTF-8?q?=E5=8C=96=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vehicle/credit-score-quantification.vue | 22 ++++++------- src/views/vehicle/customer-archive.vue | 31 ++++++++++++++++--- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/src/views/vehicle/credit-score-quantification.vue b/src/views/vehicle/credit-score-quantification.vue index f148242..5f863b6 100644 --- a/src/views/vehicle/credit-score-quantification.vue +++ b/src/views/vehicle/credit-score-quantification.vue @@ -232,7 +232,7 @@ = base : input <= base; + if (!valid) return null; + + const distance = increase ? input - base : base - input; + const stepScore = Math.abs(Number(rule.score || 0)); + if (!Number.isFinite(stepScore)) return null; + + const projectScore = this.getScoreItemFullScore(detail); + const signedStep = rule.scoreType === 'subtract' ? -stepScore : stepScore; + const calculatedScore = Number(detail.score || 0) + distance * signedStep; + return Number(Math.min(Math.max(calculatedScore, 0), projectScore).toFixed(2)); + }, handleScoreValueInput(detail, value) { const raw = String(value ?? '') .replace(/[^\d.-]/g, '') @@ -4007,10 +4026,7 @@ export default { this.calculateScore(this.currentScore); return; } - const distance = increase ? input - base : base - input; - const stepScore = Math.abs(Number(rule.score || 0)); - const signedStep = rule.scoreType === 'subtract' ? -stepScore : stepScore; - detail.selfScore = Number((Number(detail.score || 0) + distance * signedStep).toFixed(2)); + detail.selfScore = this.getScoreTypeCalculatedScore(detail); this.calculateScore(this.currentScore); }, scoreOptionChange(detail, optionValue) { @@ -4124,6 +4140,11 @@ export default { }, calculateScore(score) { const details = score.details || []; + details.forEach(detail => { + if (!this.isScoreTypeDetail(detail) || String(detail.scoreInput ?? '').trim() === '') return; + const calculatedScore = this.getScoreTypeCalculatedScore(detail); + if (calculatedScore !== null) detail.selfScore = calculatedScore; + }); const basicDetails = this.getScoreCategoryDetailsByList(details, 'basic'); const plusDetails = this.getScoreCategoryDetailsByList(details, 'plus'); const minusDetails = this.getScoreCategoryDetailsByList(details, 'minus'); @@ -4238,7 +4259,7 @@ export default { const invalidScoreInput = this.currentScore.details.find(item => { if (!this.isScoreTypeDetail(item)) return false; const input = String(item.scoreInput ?? '').trim(); - return input !== '' && item.selfScore === ''; + return input !== '' && this.getScoreTypeCalculatedScore(item) === null; }); if (invalidScoreInput) { this.$message.warning(