1
This commit is contained in:
@@ -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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user