|
|
|
|
@ -244,11 +244,13 @@ async function fetchList(reset) {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const keyword = searchKeyword.value.trim()
|
|
|
|
|
const machineryId = parseMachineryIdKeyword(keyword)
|
|
|
|
|
const params = {
|
|
|
|
|
pageNo: pageNo.value,
|
|
|
|
|
pageSize: pageSize.value,
|
|
|
|
|
repairCode: keyword || undefined,
|
|
|
|
|
machineryCode: keyword || undefined,
|
|
|
|
|
repairCode: machineryId ? undefined : keyword || undefined,
|
|
|
|
|
machineryCode: machineryId ? undefined : keyword || undefined,
|
|
|
|
|
machineryId: machineryId || undefined,
|
|
|
|
|
deviceLine: selectedLineId.value === '' ? undefined : selectedLineId.value,
|
|
|
|
|
repairStatus: selectedStatus.value === '' ? undefined : selectedStatus.value
|
|
|
|
|
}
|
|
|
|
|
@ -266,6 +268,11 @@ async function fetchList(reset) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function parseMachineryIdKeyword(keyword) {
|
|
|
|
|
const match = String(keyword || '').trim().match(/-(\d+)$/)
|
|
|
|
|
return match ? Number(match[1]) : undefined
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onFetchResult(result) {
|
|
|
|
|
const data = result || { list: [], total: 0 }
|
|
|
|
|
if (pageNo.value === 1) {
|
|
|
|
|
|