fix(admin): keep co-load validation action scoped
This commit is contained in:
@@ -828,7 +828,8 @@ function coLoadSelectionMembersLabel(rows: UnifiedOrderResource[]) {
|
||||
|
||||
const coLoadSelectionProblem = computed(() => {
|
||||
if (selectedOrders.value.length < 2) return null
|
||||
if (selectedOrders.value.some((row) => row.coLoadGroup)) return '所选订单中已有同柜组,请先解除原同柜组'
|
||||
const groupedRows = selectedOrders.value.filter((row) => row.coLoadGroup && row.coLoadGroup.status !== 'CANCELLED')
|
||||
if (groupedRows.length) return `以下入仓码已有同柜组:${coLoadSelectionMembersLabel(groupedRows)},请先解除原同柜组`
|
||||
const missingWarehouseRows = selectedOrders.value.filter((row) => !String(row.receivingWarehouseId || '').trim())
|
||||
if (missingWarehouseRows.length) return `以下入仓码缺少平台收货仓:${coLoadSelectionMembersLabel(missingWarehouseRows)},请刷新后重试`
|
||||
const warehouseIds = selectedOrders.value.map((row) => String(row.receivingWarehouseId).trim())
|
||||
@@ -894,10 +895,7 @@ function openCoLoadDetail(row: UnifiedOrderResource) {
|
||||
}
|
||||
|
||||
function openCoLoadCreate() {
|
||||
if (!canCreateCoLoadGroup.value) {
|
||||
if (coLoadSelectionProblem.value) ElMessage.warning(coLoadSelectionProblem.value)
|
||||
return
|
||||
}
|
||||
if (!canCreateCoLoadGroup.value) return
|
||||
coLoadError.value = null
|
||||
coLoadCreateOpen.value = true
|
||||
}
|
||||
@@ -1432,8 +1430,7 @@ onBeforeUnmount(() => {
|
||||
<template #toolbar-actions>
|
||||
<el-button v-if="can('platform:order:approve')" type="success" :loading="batchApprovalSaving" :disabled="loading || !selectedApprovalOrders.length" @click="batchApproveOrders"><CircleCheck :size="16" />批量审核通过<span v-if="selectedApprovalOrders.length">({{ selectedApprovalOrders.length }})</span></el-button>
|
||||
<div v-if="can('platform:firstleg:smart-loading:assign')" class="coload-toolbar-action">
|
||||
<el-button type="primary" plain :loading="coLoadSaving" :disabled="loading || !canCreateCoLoadGroup" :title="coLoadSelectionProblem || undefined" @click="openCoLoadCreate"><Link2 :size="16" />设为同柜不可拆组<span v-if="selectedOrders.length">({{ selectedOrders.length }})</span></el-button>
|
||||
<small v-if="selectedOrders.length >= 2 && coLoadSelectionProblem" role="status">{{ coLoadSelectionProblem }}</small>
|
||||
<el-button type="primary" plain :loading="coLoadSaving" :disabled="loading || !canCreateCoLoadGroup" aria-label="设为同柜不可拆组" @click="openCoLoadCreate"><Link2 :size="16" />设为同柜不可拆组<span v-if="selectedOrders.length">({{ selectedOrders.length }})</span></el-button>
|
||||
</div>
|
||||
<el-button v-if="can('platform:firstleg:smart-loading:list')" type="primary" @click="smartLoadingOpen = true"><PackageOpen :size="16" />智能装柜</el-button>
|
||||
</template>
|
||||
@@ -1587,7 +1584,6 @@ onBeforeUnmount(() => {
|
||||
.coload-detail-table td span { color: var(--cc-muted); }
|
||||
.coload-detail-table :deep(.el-button) { min-height: 24px; padding: 2px 0; }
|
||||
.coload-toolbar-action { display: flex; min-width: 0; align-items: center; gap: 8px; }
|
||||
.coload-toolbar-action small { max-width: 360px; overflow: hidden; color: var(--el-color-danger); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.subsequent-fulfillment { min-height: 72px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--cc-border); }
|
||||
.subsequent-fulfillment h3 { margin: 0 0 10px; font-size: 15px; }
|
||||
.fulfillment-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 10px; border: 1px solid var(--cc-border); border-radius: 6px; overflow: hidden; }
|
||||
|
||||
Reference in New Issue
Block a user