style:设备维修/模具维修列表-默认待维修状态

master
黄伟杰 21 hours ago
parent c352c4a783
commit 55dfe8ac4d

@ -225,8 +225,9 @@ import {
import { getDeviceLineTree } from '@/api/mes/deviceLine'
const { t } = useI18n()
const DEFAULT_REPAIR_STATUS = '0'
const searchKeyword = ref('')
const selectedStatus = ref('')
const selectedStatus = ref(DEFAULT_REPAIR_STATUS)
const selectedLineId = ref('')
const repairNameFilter = ref('')
const acceptedByFilter = ref('')
@ -503,7 +504,7 @@ function onLineCascaderConfirm(values) {
async function resetFilters() {
searchKeyword.value = ''
selectedStatus.value = ''
selectedStatus.value = DEFAULT_REPAIR_STATUS
selectedLineId.value = ''
repairNameFilter.value = ''
acceptedByFilter.value = ''

@ -190,8 +190,9 @@ import {
} from '@/api/mes/moldrepair'
const { t } = useI18n()
const DEFAULT_REPAIR_STATUS = '0'
const searchKeyword = ref('')
const selectedStatus = ref('')
const selectedStatus = ref(DEFAULT_REPAIR_STATUS)
const list = ref([])
const loading = ref(false)
const loadingMore = ref(false)
@ -208,23 +209,20 @@ const focusNoKeyboardRef = ref(null)
const keywordInputSelector = '#mold-repair-keyword-input input, input#mold-repair-keyword-input'
const statusOptions = computed(() => [
{ label: t('moldRepair.statusPending'), value: '0' },
{ label: t('moldRepair.statusPending'), value: DEFAULT_REPAIR_STATUS },
{ label: t('moldRepair.statusPassed'), value: '1' },
{ label: t('moldRepair.statusRejected'), value: '2' }
])
const statusLabels = computed(() => [t('moldRepair.allStatus'), ...statusOptions.value.map((item) => item.label)])
const statusLabels = computed(() => statusOptions.value.map((item) => item.label))
const statusPickerIndex = computed(() => {
if (selectedStatus.value === '') return 0
const index = statusOptions.value.findIndex((item) => item.value === selectedStatus.value)
return index >= 0 ? index + 1 : 0
return index >= 0 ? index : 0
})
const selectedStatusLabel = computed(() => {
if (selectedStatus.value === '') return t('moldRepair.allStatus')
const current = statusOptions.value.find((item) => item.value === selectedStatus.value)
return current ? current.label : t('moldRepair.allStatus')
return current ? current.label : t('moldRepair.statusPending')
})
//
const drawerStatusOptions = computed(() => [
{ label: t('moldRepair.orderStatusPending'), value: '0' },
@ -361,7 +359,7 @@ function onSearchInput() {
async function resetFilters() {
searchKeyword.value = ''
selectedStatus.value = ''
selectedStatus.value = DEFAULT_REPAIR_STATUS
selectedMoldId.value = ''
filterRepairCode.value = ''
filterRepairName.value = ''
@ -378,11 +376,7 @@ async function resetFilters() {
function onStatusFilterChange(event) {
const index = Number(event?.detail?.value || 0)
if (index === 0) {
selectedStatus.value = ''
} else {
selectedStatus.value = statusOptions.value[index - 1]?.value ?? ''
}
selectedStatus.value = statusOptions.value[index]?.value ?? DEFAULT_REPAIR_STATUS
fetchList(true)
}

Loading…
Cancel
Save