feat:点检任务、点检记录增加扫码查询

master
ck-chenkang 5 days ago
parent 3411c92ad5
commit b8ba6ed9dd

@ -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 || []

@ -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()

Loading…
Cancel
Save