装柜优化
This commit is contained in:
@@ -159,9 +159,9 @@ async function openDeepLinkedDetail() {
|
||||
detailError.value = null
|
||||
detailOpen.value = true
|
||||
await loadDetail()
|
||||
const expectedStatus = isPreload.value ? 'LOADING' : 'COMPLETED'
|
||||
const expectedStatuses = isPreload.value ? ['EDITING', 'LOADING'] : ['COMPLETED']
|
||||
const loadedDetail = detail.value as LoadingDetail | null
|
||||
if (loadedDetail && loadedDetail.summary.status !== expectedStatus) {
|
||||
if (loadedDetail && !expectedStatuses.includes(loadedDetail.summary.status)) {
|
||||
detail.value = null
|
||||
detailError.value = {
|
||||
code: 'MODE_STATUS_MISMATCH',
|
||||
@@ -211,7 +211,7 @@ function openDetail(rowValue: object) {
|
||||
|
||||
async function openEditFromRow(rowValue: object) {
|
||||
const row = rowValue as LoadingListSummary
|
||||
if (!isPreload.value || !canEdit.value || row.status !== 'LOADING') return
|
||||
if (!isPreload.value || !canEdit.value || !['EDITING', 'LOADING'].includes(row.status)) return
|
||||
selectedPlanId.value = String(row.planId)
|
||||
selectedWarehouseId.value = String(row.warehouseId || '')
|
||||
detail.value = null
|
||||
@@ -219,11 +219,11 @@ async function openEditFromRow(rowValue: object) {
|
||||
detailOpen.value = true
|
||||
await loadDetail()
|
||||
const loadedDetail = detail.value as LoadingDetail | null
|
||||
if (loadedDetail && loadedDetail.summary.status === 'LOADING') openEdit()
|
||||
if (loadedDetail && ['EDITING', 'LOADING'].includes(loadedDetail.summary.status)) openEdit()
|
||||
}
|
||||
|
||||
function openEdit() {
|
||||
if (!detail.value || !('preloadNo' in detail.value.summary) || detail.value.summary.status !== 'LOADING') return
|
||||
if (!detail.value || !('preloadNo' in detail.value.summary) || !['EDITING', 'LOADING'].includes(detail.value.summary.status)) return
|
||||
editForm.containerNo = detail.value.summary.containerNo || ''
|
||||
editForm.voyageNo = detail.value.summary.voyageNo || ''
|
||||
editForm.operationReason = ''
|
||||
@@ -306,7 +306,7 @@ onMounted(() => {
|
||||
>
|
||||
<template #actions="{ row }">
|
||||
<el-button v-if="canView" link type="primary" @click="openDetail(row)"><Eye :size="15" />查看</el-button>
|
||||
<el-button v-if="isPreload && canEdit && row.status === 'LOADING'" link type="primary" @click="openEditFromRow(row)"><Pencil :size="15" />编辑</el-button>
|
||||
<el-button v-if="isPreload && canEdit && ['EDITING', 'LOADING'].includes(row.status)" link type="primary" @click="openEditFromRow(row)"><Pencil :size="15" />编辑</el-button>
|
||||
</template>
|
||||
<template #customers="{ row }">{{ (row as PreloadSummary).customers.map((item) => item.customerName || item.accountId).join('、') || '—' }}</template>
|
||||
<template #vesselVoyage="{ row }">{{ (row as PreloadSummary).vesselName || '—' }} / {{ (row as PreloadSummary).voyageNo || '—' }}</template>
|
||||
|
||||
Reference in New Issue
Block a user