From b8ba6ed9dd51ed28b703ff1e1f6619069ed08ede Mon Sep 17 00:00:00 2001 From: ck-chenkang Date: Thu, 18 Jun 2026 15:46:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E7=82=B9=E6=A3=80=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E3=80=81=E7=82=B9=E6=A3=80=E8=AE=B0=E5=BD=95=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=89=AB=E7=A0=81=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/equipmentInspectionRecord/index.vue | 10 +++++++++- .../pages/equipmentInspectionTasks/index.vue | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) 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()