diff --git a/src/pages_function/pages/equipmentInspectionRecord/index.vue b/src/pages_function/pages/equipmentInspectionRecord/index.vue index 030be9f..139bd5e 100644 --- a/src/pages_function/pages/equipmentInspectionRecord/index.vue +++ b/src/pages_function/pages/equipmentInspectionRecord/index.vue @@ -304,10 +304,13 @@ async function fetchList(reset) { } try { + const keyword = searchKeyword.value.trim() + const deviceId = parseDeviceIdKeyword(keyword) const params = { pageNo: pageNo.value, pageSize: pageSize.value, - planNo: searchKeyword.value.trim() || undefined, + planNo: deviceId ? undefined : keyword || undefined, + deviceId: deviceId || undefined, planType: selectedTaskType.value || undefined, jobStatus: selectedJobStatus.value || undefined, deviceLineId: selectedLineId.value || undefined @@ -325,6 +328,11 @@ async function fetchList(reset) { } } +function parseDeviceIdKeyword(keyword) { + const match = String(keyword || '').trim().match(/-(\d+)$/) + return match ? Number(match[1]) : undefined +} + function normalizePageData(res) { const root = res && res.data !== undefined ? res.data : res const candidateList = root?.list || root?.rows || root?.records || root?.data?.list || root?.data?.rows || root?.data?.records || [] diff --git a/src/pages_function/pages/equipmentInspectionTasks/index.vue b/src/pages_function/pages/equipmentInspectionTasks/index.vue index ceb10bb..cab54c0 100644 --- a/src/pages_function/pages/equipmentInspectionTasks/index.vue +++ b/src/pages_function/pages/equipmentInspectionTasks/index.vue @@ -199,10 +199,13 @@ async function fetchList(reset) { } try { + const keyword = searchKeyword.value.trim() + const deviceId = parseDeviceIdKeyword(keyword) const params = { pageNo: pageNo.value, pageSize: pageSize.value, - name: searchKeyword.value.trim() || undefined, + name: deviceId ? undefined : keyword || undefined, + deviceIds: deviceId ? [deviceId] : undefined, taskType: selectedTaskType.value || undefined, deviceLineId: selectedLineId.value || undefined } @@ -219,6 +222,11 @@ async function fetchList(reset) { } } +function parseDeviceIdKeyword(keyword) { + const match = String(keyword || '').trim().match(/-(\d+)$/) + return match ? Number(match[1]) : undefined +} + async function loadLineTree() { try { const res = await getDeviceLineTree()