From 1cd54adb06267fdda7159cfeb3554d73f23b3b17 Mon Sep 17 00:00:00 2001 From: Leo Date: Fri, 14 Nov 2025 23:48:23 +0800 Subject: [PATCH] 1 --- src/views/system/jd-instruction/index.vue | 37 ++++++++++++++++++++--- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/src/views/system/jd-instruction/index.vue b/src/views/system/jd-instruction/index.vue index fdd4d04..e09369a 100644 --- a/src/views/system/jd-instruction/index.vue +++ b/src/views/system/jd-instruction/index.vue @@ -247,13 +247,20 @@ export default { this.$modal.msgError('执行失败,请稍后重试') }) }, - // 检查是否是地址重复错误 + // 检查是否是地址重复或订单编号重复错误 checkAddressDuplicate(resultList) { if (!resultList || resultList.length === 0) return false for (let i = 0; i < resultList.length; i++) { const result = resultList[i] - if (typeof result === 'string' && result.startsWith('ERROR_CODE:ADDRESS_DUPLICATE')) { - return true + if (typeof result === 'string') { + // 检查是否包含地址重复或订单编号重复错误码 + if (result.includes('ERROR_CODE:ADDRESS_DUPLICATE') || + result.includes('ERROR_CODE:ORDER_NUMBER_DUPLICATE') || + result.startsWith('ERROR_CODE:ADDRESS_DUPLICATE') || + result.startsWith('ERROR_CODE:ORDER_NUMBER_DUPLICATE')) { + console.log('检测到重复错误:', result) + return true + } } } return false @@ -263,7 +270,29 @@ export default { // 生成四位随机数字验证码 this.verifyCode = String(Math.floor(1000 + Math.random() * 9000)) this.verifyInput = '' - this.verifyMessage = '检测到地址重复,请输入验证码以强制生成表单' + // 根据错误类型设置提示信息 + let hasOrderNumberDuplicate = false + let hasAddressDuplicate = false + if (this.resultList && this.resultList.length > 0) { + for (let i = 0; i < this.resultList.length; i++) { + const result = this.resultList[i] + if (typeof result === 'string') { + if (result.includes('ERROR_CODE:ORDER_NUMBER_DUPLICATE')) { + hasOrderNumberDuplicate = true + } + if (result.includes('ERROR_CODE:ADDRESS_DUPLICATE')) { + hasAddressDuplicate = true + } + } + } + } + if (hasOrderNumberDuplicate && hasAddressDuplicate) { + this.verifyMessage = '检测到订单编号和地址重复,请输入验证码以强制生成表单' + } else if (hasOrderNumberDuplicate) { + this.verifyMessage = '检测到订单编号重复,请输入验证码以强制生成表单' + } else { + this.verifyMessage = '检测到地址重复,请输入验证码以强制生成表单' + } this.pendingCommand = command this.verifyDialogVisible = true },