diff --git a/src/views/order/intention/search.vue b/src/views/order/intention/search.vue index 5eb5688..876ba55 100644 --- a/src/views/order/intention/search.vue +++ b/src/views/order/intention/search.vue @@ -2139,14 +2139,23 @@ const buildFieldConditionsPayload = () => { }; } - // 3)只有值(如直接选了某个值,没有字段) + // 3)只有值(没有字段):需要区分是从下拉框选择的还是纯手输的 + // 如果值在 allValues 中存在,说明可能是从下拉框选择的,放在 fieldValue 里 if (!condition.field && condition.value && !condition.fieldLabel) { - return { - fieldName: "", - fieldValue: condition.value, - keyword: "", - queryType, - }; + const isValueFromSuggestion = allValues.value.some( + (item) => String(item.value) === String(condition.value) + ); + + if (isValueFromSuggestion) { + // 从下拉框选择的值,放在 fieldValue 里 + return { + fieldName: "", + fieldValue: condition.value, + keyword: "", + queryType, + }; + } + // 否则继续走方案4,放在 keyword 里 } // 4)其它情况(例如纯手输、无法识别字段),作为关键字查询