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