diff --git a/src/locales/en-US.js b/src/locales/en-US.js
index 991503e..81e1159 100644
--- a/src/locales/en-US.js
+++ b/src/locales/en-US.js
@@ -582,6 +582,8 @@ export default {
selectAllDecisionError: 'Please choose a result for all pending items',
noResultData: 'No inspection items',
lineFilter: 'Line',
+ moreFilter: 'More Filters',
+ filterScope: 'Filter Scope',
},
moldWorkOrder: {
moduleName: 'Inspection Records',
diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js
index 238e22a..1d1861e 100644
--- a/src/locales/zh-CN.js
+++ b/src/locales/zh-CN.js
@@ -582,6 +582,8 @@ export default {
selectAllDecisionError: '请为所有待检项选择结果',
noResultData: '暂无点检项数据',
lineFilter: '产线',
+ moreFilter: '更多筛选',
+ filterScope: '筛选范围',
},
moldWorkOrder: {
moduleName: '点检记录',
diff --git a/src/pages_function/pages/equipmentInspectionRecord/detail.vue b/src/pages_function/pages/equipmentInspectionRecord/detail.vue
index 6db5f06..ea25ae3 100644
--- a/src/pages_function/pages/equipmentInspectionRecord/detail.vue
+++ b/src/pages_function/pages/equipmentInspectionRecord/detail.vue
@@ -133,7 +133,7 @@
{{ t('dashboard.back') }}
- {{ t('functionCommon.save') }}
+ {{ t('functionCommon.save') }}
@@ -153,7 +153,7 @@ const resultList = ref([])
const resultLoading = ref(false)
const managementId = ref('')
const saveLoading = ref(false)
-const isExecuted = computed(() => String(detailData.jobStatus || '') === '2')
+const isExecuted = computed(() => String(detailData.jobStatus || '') !== '0')
const planTypeText = computed(() => {
const value = String(detailData.planType || '')
diff --git a/src/pages_function/pages/equipmentInspectionRecord/index.vue b/src/pages_function/pages/equipmentInspectionRecord/index.vue
index 139bd5e..c77c743 100644
--- a/src/pages_function/pages/equipmentInspectionRecord/index.vue
+++ b/src/pages_function/pages/equipmentInspectionRecord/index.vue
@@ -3,36 +3,38 @@
-
- {{ selectedLineLabel }}
-
-
-
-
+
+
+ {{ selectedLineLabel }}
+
+
+
+
+ {{ currentJobStatusLabel }}
+
+
+
-
-
- {{ currentTaskTypeLabel }}
-
+
+
+
-
-
-
- {{ currentJobStatusLabel }}
-
+
+
-
- {{ t('functionCommon.reset') }}
+
+
+
+
-
@@ -75,7 +77,49 @@
-
+
+
[
const searchKeyword = ref('')
const selectedTaskType = ref('')
-const selectedJobStatus = ref('')
+const selectedJobStatus = ref('0')
+const selectedJobResult = ref('')
+const filterPopupRef = ref(null)
const list = ref([])
const loading = ref(false)
const loadingMore = ref(false)
@@ -138,22 +186,24 @@ const selectedLineLabel = computed(() => {
return found?.name || t('equipmentInspectionRecord.lineFilter')
})
const taskTypeOptions = computed(() => [
- { label: t('functionCommon.all'), value: '' },
{ label: t('equipmentInspectionRecord.taskTypeInspect'), value: '1' },
{ label: t('equipmentInspectionRecord.taskTypeMaintain'), value: '2' }
])
-const jobStatusOptions = computed(() => [
- { label: t('functionCommon.all'), value: '' },
- { label: t('equipmentInspectionRecord.jobStatusPending'), value: '0' },
- { label: t('equipmentInspectionRecord.jobStatusProcessing'), value: '1' },
- { label: t('equipmentInspectionRecord.jobStatusCompleted'), value: '2' },
- { label: t('equipmentInspectionRecord.jobStatusTimeout'), value: '3' },
- { label: t('equipmentInspectionRecord.jobStatusCancelled'), value: '4' }
+const jobStatusOptions = computed(() => {
+ const dicts = dictStore.getDict(DICT_TYPE.JOB_STATUS) || []
+ return dicts
+ .filter((item) => item?.value !== null && item?.value !== undefined && String(item.value) !== '')
+ .map((item) => ({ label: item.label, value: String(item.value) }))
+})
+const jobResultOptions = computed(() => [
+ { label: t('equipmentInspectionRecord.jobResultOk'), value: 'OK' },
+ { label: t('equipmentInspectionRecord.jobResultNg'), value: 'NG' }
])
const taskTypeLabels = computed(() => taskTypeOptions.value.map((item) => item.label))
const jobStatusLabels = computed(() => jobStatusOptions.value.map((item) => item.label))
+const jobResultLabels = computed(() => jobResultOptions.value.map((item) => item.label))
const taskTypeIndex = computed(() => {
const index = taskTypeOptions.value.findIndex((item) => item.value === selectedTaskType.value)
return index >= 0 ? index : 0
@@ -162,13 +212,24 @@ const jobStatusIndex = computed(() => {
const index = jobStatusOptions.value.findIndex((item) => item.value === selectedJobStatus.value)
return index >= 0 ? index : 0
})
+const jobResultIndex = computed(() => {
+ const index = jobResultOptions.value.findIndex((item) => item.value === selectedJobResult.value)
+ return index >= 0 ? index : 0
+})
const currentTaskTypeLabel = computed(() => {
+ if (selectedTaskType.value === '') return t('equipmentInspectionRecord.taskType')
const current = taskTypeOptions.value.find((item) => item.value === selectedTaskType.value)
- return current ? current.label : t('functionCommon.all')
+ return current ? current.label : t('equipmentInspectionRecord.taskType')
})
const currentJobStatusLabel = computed(() => {
+ if (selectedJobStatus.value === '') return t('equipmentInspectionRecord.jobStatus')
const current = jobStatusOptions.value.find((item) => item.value === selectedJobStatus.value)
- return current ? current.label : t('functionCommon.all')
+ return current ? current.label : t('equipmentInspectionRecord.jobStatus')
+})
+const currentJobResultLabel = computed(() => {
+ if (selectedJobResult.value === '') return t('equipmentInspectionRecord.jobResult')
+ const current = jobResultOptions.value.find((item) => item.value === selectedJobResult.value)
+ return current ? current.label : t('equipmentInspectionRecord.jobResult')
})
onLoad(async () => {
@@ -313,6 +374,7 @@ async function fetchList(reset) {
deviceId: deviceId || undefined,
planType: selectedTaskType.value || undefined,
jobStatus: selectedJobStatus.value || undefined,
+ jobResult: selectedJobResult.value || undefined,
deviceLineId: selectedLineId.value || undefined
}
const res = await getEquipmentInspectionRecordPage(params)
@@ -361,16 +423,29 @@ async function resetFilters() {
searchKeyword.value = ''
selectedTaskType.value = ''
selectedJobStatus.value = ''
+ selectedJobResult.value = ''
resetLineFilter()
activateKeywordFocus()
await nextTick()
await fetchList(true)
}
+function openFilterDrawer() {
+ filterPopupRef.value?.open()
+}
+
+function closeFilterDrawer() {
+ filterPopupRef.value?.close()
+}
+
+async function confirmFilterDrawer() {
+ closeFilterDrawer()
+ await fetchList(true)
+}
+
function onTaskTypeChange(event) {
const index = Number(event?.detail?.value || 0)
selectedTaskType.value = taskTypeOptions.value[index]?.value ?? ''
- fetchList(true)
}
function onJobStatusChange(event) {
@@ -379,6 +454,11 @@ function onJobStatusChange(event) {
fetchList(true)
}
+function onJobResultChange(event) {
+ const index = Number(event?.detail?.value || 0)
+ selectedJobResult.value = jobResultOptions.value[index]?.value ?? ''
+}
+
async function loadMore() {
if (loading.value || loadingMore.value || finished.value) return
pageNo.value += 1
@@ -481,70 +561,43 @@ function formatDateTime(value) {