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) { // 合法的 税率