From 1e305b17340bdf99cf6b5657c8945892f7c3b0c5 Mon Sep 17 00:00:00 2001 From: zhoulinf <2507241354@qq.com> Date: Wed, 6 Nov 2024 16:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=90=8C=E6=AD=A5=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/index/uploadInvoice.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/views/index/uploadInvoice.vue b/src/views/index/uploadInvoice.vue index e251d824..2c6558d4 100644 --- a/src/views/index/uploadInvoice.vue +++ b/src/views/index/uploadInvoice.vue @@ -368,12 +368,17 @@ difference++; } } + + //如果前面部分都对得上,但是长度不同,则差异是长度 + if(difference == 0 && str1.length != str2.length){ + difference = Math.abs(str1.length - str2.length) + } // 同样遍历字符串2,处理字符串1中不存在的字符 - for (let i = 0; i < str2.length; i++) { + /*for (let i = 0; i < str2.length; i++) { if (str1.indexOf(str2[i]) === -1) { difference++; } - } + }*/ return difference; }, legalRate(rateList) { // 合法的 税率