feat(wms):减法,去掉批次号等字段

wms
YunaiV 2026-05-13 22:06:37 +08:00
parent fdbb98fe65
commit 8d06f87e0f
22 changed files with 47 additions and 191 deletions

View File

@ -15,9 +15,6 @@ export interface InventoryHistoryVO {
quantity?: number
beforeQuantity?: number
afterQuantity?: number
batchNo?: string
productionDate?: Date
expirationDate?: Date
amount?: number
remark?: string
orderId?: number

View File

@ -12,9 +12,6 @@ export interface CheckOrderDetailVO {
inventoryId?: number
warehouseId?: number
warehouseName?: string
batchNo?: string
productionDate?: Date
expirationDate?: Date
receiptTime?: Date
quantity?: number
checkQuantity?: number

View File

@ -13,9 +13,6 @@ export interface MovementOrderDetailVO {
sourceWarehouseName?: string
targetWarehouseId?: number
targetWarehouseName?: string
batchNo?: string
productionDate?: Date
expirationDate?: Date
quantity?: number
availableQuantity?: number
amount?: number

View File

@ -11,9 +11,6 @@ export interface ReceiptOrderDetailVO {
skuName?: string
warehouseId?: number
warehouseName?: string
batchNo?: string
productionDate?: Date
expirationDate?: Date
quantity?: number
amount?: number
remark?: string

View File

@ -11,9 +11,6 @@ export interface ShipmentOrderDetailVO {
skuName?: string
warehouseId?: number
warehouseName?: string
batchNo?: string
productionDate?: Date
expirationDate?: Date
quantity?: number
availableQuantity?: number
amount?: number

View File

@ -129,9 +129,6 @@ import { InventoryApi, InventoryVO } from '@/api/wms/inventory'
import { formatQuantity } from '@/views/wms/utils/format'
export interface InventorySelectRow extends InventoryVO {
batchNo?: string
productionDate?: Date
expirationDate?: Date
amount?: number
availableQuantity?: number
}

View File

@ -156,17 +156,6 @@
</div>
</template>
</el-table-column>
<el-table-column align="center" label="批号" min-width="140" prop="batchNo" />
<el-table-column label="生产日期/过期日期" min-width="180">
<template #default="scope">
<div v-if="scope.row.productionDate">
生产日期{{ formatDate(scope.row.productionDate, 'YYYY-MM-DD') }}
</div>
<div v-if="scope.row.expirationDate">
过期日期{{ formatDate(scope.row.expirationDate, 'YYYY-MM-DD') }}
</div>
</template>
</el-table-column>
<el-table-column
:formatter="dateFormatter"
align="center"
@ -187,7 +176,7 @@
</template>
<script lang="ts" setup>
import { dateFormatter, defaultShortcuts, formatDate } from '@/utils/formatTime'
import { dateFormatter, defaultShortcuts } from '@/utils/formatTime'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { InventoryHistoryApi, InventoryHistoryVO } from '@/api/wms/inventory/history'
import WarehouseSelect from '@/views/wms/md/warehouse/components/WarehouseSelect.vue'

View File

@ -78,7 +78,13 @@
@selection-change="handleSelectionChange"
@row-dblclick="handleRowDblClick"
>
<el-table-column :reserve-selection="true" align="center" type="selection" width="50" />
<el-table-column
:reserve-selection="true"
:selectable="isRowSelectable"
align="center"
type="selection"
width="50"
/>
<el-table-column label="商品信息" min-width="220">
<template #default="{ row }">
<div>{{ row.itemName || '-' }}</div>
@ -149,6 +155,7 @@ const total = ref(0) // 列表的总条数
const selectedList = ref<ItemSkuVO[]>([]) // SKU
const selectedMap = ref<Map<number, ItemSkuVO>>(new Map()) // SKU
const preSelectedIds = ref<number[]>([]) // SKU
const disabledSelectedIds = ref<Set<number>>(new Set()) // 使 SKU
const tableRef = ref<InstanceType<typeof ElTable>>() // Ref
const queryFormRef = ref() //
const getDefaultQueryParams = () => ({
@ -172,6 +179,7 @@ const open = async (selectedIds?: number[]) => {
selectedList.value = []
selectedMap.value = new Map()
preSelectedIds.value = selectedIds || []
disabledSelectedIds.value = new Set(preSelectedIds.value)
await nextTick()
tableRef.value?.clearSelection()
await loadSkuList()
@ -261,15 +269,24 @@ const applyPreSelection = () => {
}
list.value.forEach((row) => {
if (row.id && selectedMap.value.has(row.id)) {
table.toggleRowSelection(row, true)
table.toggleRowSelection(row, true, true)
}
})
}
/** 是否允许勾选 SKU */
const isRowSelectable = (row: ItemSkuVO) => {
return row.id === undefined || !disabledSelectedIds.value.has(row.id)
}
/** 选择变化 */
const handleSelectionChange = (rows: ItemSkuVO[]) => {
const currentPageIds = list.value.map((row) => row.id).filter((id): id is number => !!id)
currentPageIds.forEach((id) => selectedMap.value.delete(id))
currentPageIds.forEach((id) => {
if (!disabledSelectedIds.value.has(id)) {
selectedMap.value.delete(id)
}
})
rows.forEach((row) => {
if (row.id) {
selectedMap.value.set(row.id, row)
@ -280,16 +297,22 @@ const handleSelectionChange = (rows: ItemSkuVO[]) => {
/** 双击行:切换勾选 */
const handleRowDblClick = (row: ItemSkuVO) => {
if (row.id && disabledSelectedIds.value.has(row.id)) {
return
}
tableRef.value?.toggleRowSelection(row)
}
/** 确认选择 */
const handleConfirm = () => {
if (selectedList.value.length === 0) {
const newSelectedList = selectedList.value.filter(
(sku) => sku.id !== undefined && !disabledSelectedIds.value.has(sku.id)
)
if (newSelectedList.length === 0) {
message.warning('请至少选择一条数据')
return
}
emit('change', selectedList.value)
emit('change', newSelectedList)
dialogVisible.value = false
}
</script>

View File

@ -49,7 +49,6 @@
<div v-if="row.skuCode" class="text-12px text-gray-500">{{ row.skuCode }}</div>
</template>
</el-table-column>
<el-table-column label="批号" min-width="140" prop="batchNo" />
<el-table-column align="right" label="账面数量" prop="quantity" width="120">
<template #default="{ row }">{{ formatQuantity(row.quantity) || '-' }}</template>
</el-table-column>

View File

@ -61,7 +61,6 @@
<div v-if="row.skuCode" class="text-12px text-gray-500">{{ row.skuCode }}</div>
</template>
</el-table-column>
<el-table-column label="批号" min-width="140" prop="batchNo" />
<el-table-column align="right" label="账面数量" width="120">
<template #default="{ row }">{{ formatQuantity(row.quantity) || '-' }}</template>
</el-table-column>
@ -228,9 +227,6 @@ const buildDetail = (inventory: InventorySelectRow): CheckOrderDetailVO => ({
inventoryId: inventory.id,
warehouseId: inventory.warehouseId,
warehouseName: inventory.warehouseName,
batchNo: inventory.batchNo,
productionDate: inventory.productionDate,
expirationDate: inventory.expirationDate,
quantity: inventory.availableQuantity,
checkQuantity: inventory.availableQuantity,
availableQuantity: inventory.availableQuantity,

View File

@ -164,7 +164,6 @@
<div v-if="detail.skuCode" class="text-12px text-gray-500">{{ detail.skuCode }}</div>
</template>
</el-table-column>
<el-table-column label="批号" min-width="140" prop="batchNo" />
<el-table-column align="right" label="账面数量" width="120">
<template #default="{ row: detail }">{{ formatQuantity(detail.quantity) }}</template>
</el-table-column>

View File

@ -56,7 +56,6 @@
<div v-if="row.skuCode" class="text-12px text-gray-500">{{ row.skuCode }}</div>
</template>
</el-table-column>
<el-table-column label="批号" min-width="140" prop="batchNo" />
<el-table-column align="right" label="数量" prop="quantity" width="120">
<template #default="{ row }">{{ formatQuantity(row.quantity) || '-' }}</template>
</el-table-column>

View File

@ -66,7 +66,6 @@
<div v-if="row.skuCode" class="text-12px text-gray-500">{{ row.skuCode }}</div>
</template>
</el-table-column>
<el-table-column label="批号" min-width="140" prop="batchNo" />
<el-table-column align="right" label="可用库存" width="120">
<template #default="{ row }">{{ formatQuantity(row.availableQuantity) || '-' }}</template>
</el-table-column>
@ -229,9 +228,6 @@ const buildDetail = (inventory: InventorySelectRow): MovementOrderDetailVO => ({
sourceWarehouseId: inventory.warehouseId,
sourceWarehouseName: inventory.warehouseName,
targetWarehouseId: formData.value.targetWarehouseId,
batchNo: inventory.batchNo,
productionDate: inventory.productionDate,
expirationDate: inventory.expirationDate,
quantity: undefined,
availableQuantity: inventory.availableQuantity,
amount: undefined,

View File

@ -169,7 +169,6 @@
<div v-if="detail.skuCode" class="text-12px text-gray-500">{{ detail.skuCode }}</div>
</template>
</el-table-column>
<el-table-column label="批号" min-width="140" prop="batchNo" />
<el-table-column align="right" label="移库数量" width="120">
<template #default="{ row: detail }">{{ formatQuantity(detail.quantity) }}</template>
</el-table-column>

View File

@ -71,17 +71,6 @@
</div>
</template>
</el-table-column>
<el-table-column label="批号" min-width="140" prop="batchNo" />
<el-table-column label="生产日期" width="140">
<template #default="scope">
{{ formatNullableDate(scope.row.productionDate, 'YYYY-MM-DD') }}
</template>
</el-table-column>
<el-table-column label="过期日期" width="140">
<template #default="scope">
{{ formatNullableDate(scope.row.expirationDate, 'YYYY-MM-DD') }}
</template>
</el-table-column>
<el-table-column align="right" label="数量" prop="quantity" width="120">
<template #default="scope">
{{ formatQuantity(scope.row.quantity) || '-' }}

View File

@ -107,33 +107,6 @@
</div>
</template>
</el-table-column>
<el-table-column label="批号" min-width="160">
<template #default="scope">
<el-input v-model="scope.row.batchNo" maxlength="64" placeholder="请输入批号" />
</template>
</el-table-column>
<el-table-column label="生产日期" width="180">
<template #default="scope">
<el-date-picker
v-model="scope.row.productionDate"
class="!w-1/1"
placeholder="请选择生产日期"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</template>
</el-table-column>
<el-table-column label="过期日期" width="180">
<template #default="scope">
<el-date-picker
v-model="scope.row.expirationDate"
class="!w-1/1"
placeholder="请选择过期日期"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</template>
</el-table-column>
<el-table-column label="入库数量" width="160">
<template #default="scope">
<el-input-number
@ -303,9 +276,6 @@ const buildDetail = (sku: ItemSkuVO): ReceiptOrderDetailVO => ({
skuId: sku.id,
skuCode: sku.code,
skuName: sku.name,
batchNo: undefined,
productionDate: undefined,
expirationDate: undefined,
quantity: undefined,
amount: undefined,
remark: undefined
@ -313,7 +283,7 @@ const buildDetail = (sku: ItemSkuVO): ReceiptOrderDetailVO => ({
/** 添加商品 */
const handleAddDetail = () => {
skuSelectRef.value?.open()
skuSelectRef.value?.open(getSelectedSkuIds())
}
/** 选择商品 SKU */
@ -322,10 +292,24 @@ const handleSelectSku = (skus: ItemSkuVO[]) => {
return
}
formData.value.details = formData.value.details || []
skus.forEach((sku) => formData.value.details!.push(buildDetail(sku)))
const selectedSkuIds = new Set(getSelectedSkuIds())
skus.forEach((sku) => {
if (!sku.id || selectedSkuIds.has(sku.id)) {
return
}
formData.value.details!.push(buildDetail(sku))
selectedSkuIds.add(sku.id)
})
refreshTotalAmount()
}
/** 获得已选 SKU 编号 */
const getSelectedSkuIds = () => {
return (formData.value.details || [])
.map((detail) => detail.skuId)
.filter((id): id is number => !!id)
}
/** 删除明细 */
const handleDeleteDetail = (index: number) => {
formData.value.details?.splice(index, 1)

View File

@ -23,21 +23,6 @@
<tr>
<th class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left">商品信息</th>
<th class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left">规格信息</th>
<th
class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left"
>
批号
</th>
<th
class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left"
>
生产日期
</th>
<th
class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left"
>
过期日期
</th>
<th class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left">数量</th>
<th class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left">金额()</th>
<th class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left">备注</th>
@ -53,15 +38,6 @@
<div>{{ detail.skuName || '-' }}</div>
<div v-if="detail.skuCode" class="text-12px">{{ detail.skuCode }}</div>
</td>
<td class="border border-solid border-#dcdfe6 p-8px">
{{ detail.batchNo || '-' }}
</td>
<td class="border border-solid border-#dcdfe6 p-8px">
{{ formatNullableDate(detail.productionDate, 'YYYY-MM-DD') }}
</td>
<td class="border border-solid border-#dcdfe6 p-8px">
{{ formatNullableDate(detail.expirationDate, 'YYYY-MM-DD') }}
</td>
<td class="border border-solid border-#dcdfe6 p-8px text-right">
{{ formatQuantity(detail.quantity) || '-' }}
</td>
@ -95,7 +71,7 @@ defineOptions({ name: 'WmsReceiptOrderPrint' })
const printData = ref<ReceiptOrderVO>({}) //
const printButtonRef = ref<HTMLButtonElement>() //
const tableColumnCount = 8
const tableColumnCount = 5
const printObj = ref({
id: 'wmsReceiptOrderPrint',
popTitle: '&nbsp',

View File

@ -237,17 +237,6 @@
</div>
</template>
</el-table-column>
<el-table-column align="center" label="批号" min-width="140" prop="batchNo" />
<el-table-column label="生产日期/过期日期" min-width="180">
<template #default="detailScope">
<div v-if="detailScope.row.productionDate">
生产日期{{ formatNullableDate(detailScope.row.productionDate, 'YYYY-MM-DD') }}
</div>
<div v-if="detailScope.row.expirationDate">
过期日期{{ formatNullableDate(detailScope.row.expirationDate, 'YYYY-MM-DD') }}
</div>
</template>
</el-table-column>
<el-table-column align="right" label="入库数量" width="120">
<template #default="detailScope">
{{ formatQuantity(detailScope.row.quantity) }}

View File

@ -71,17 +71,6 @@
</div>
</template>
</el-table-column>
<el-table-column label="批号" min-width="140" prop="batchNo" />
<el-table-column label="生产日期" width="140">
<template #default="scope">
{{ formatNullableDate(scope.row.productionDate, 'YYYY-MM-DD') }}
</template>
</el-table-column>
<el-table-column label="过期日期" width="140">
<template #default="scope">
{{ formatNullableDate(scope.row.expirationDate, 'YYYY-MM-DD') }}
</template>
</el-table-column>
<el-table-column align="right" label="数量" prop="quantity" width="120">
<template #default="scope">
{{ formatQuantity(scope.row.quantity) || '-' }}

View File

@ -107,21 +107,6 @@
</div>
</template>
</el-table-column>
<el-table-column label="批号" min-width="160">
<template #default="scope">
{{ scope.row.batchNo || '-' }}
</template>
</el-table-column>
<el-table-column label="生产日期" width="180">
<template #default="scope">
{{ formatNullableDate(scope.row.productionDate, 'YYYY-MM-DD') }}
</template>
</el-table-column>
<el-table-column label="过期日期" width="180">
<template #default="scope">
{{ formatNullableDate(scope.row.expirationDate, 'YYYY-MM-DD') }}
</template>
</el-table-column>
<el-table-column align="right" label="可用库存" width="120">
<template #default="scope">
{{ formatQuantity(scope.row.availableQuantity) || '-' }}
@ -304,9 +289,6 @@ const buildDetail = (inventory: InventorySelectRow): ShipmentOrderDetailVO => ({
skuName: inventory.skuName,
warehouseId: inventory.warehouseId,
warehouseName: inventory.warehouseName,
batchNo: inventory.batchNo,
productionDate: inventory.productionDate,
expirationDate: inventory.expirationDate,
quantity: undefined,
availableQuantity: inventory.availableQuantity,
amount: undefined,

View File

@ -23,21 +23,6 @@
<tr>
<th class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left">商品信息</th>
<th class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left">规格信息</th>
<th
class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left"
>
批号
</th>
<th
class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left"
>
生产日期
</th>
<th
class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left"
>
过期日期
</th>
<th class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left">数量</th>
<th class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left">金额()</th>
<th class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-left">备注</th>
@ -53,15 +38,6 @@
<div>{{ detail.skuName || '-' }}</div>
<div v-if="detail.skuCode" class="text-12px">{{ detail.skuCode }}</div>
</td>
<td class="border border-solid border-#dcdfe6 p-8px">
{{ detail.batchNo || '-' }}
</td>
<td class="border border-solid border-#dcdfe6 p-8px">
{{ formatNullableDate(detail.productionDate, 'YYYY-MM-DD') }}
</td>
<td class="border border-solid border-#dcdfe6 p-8px">
{{ formatNullableDate(detail.expirationDate, 'YYYY-MM-DD') }}
</td>
<td class="border border-solid border-#dcdfe6 p-8px text-right">
{{ formatQuantity(detail.quantity) || '-' }}
</td>
@ -95,7 +71,7 @@ defineOptions({ name: 'WmsShipmentOrderPrint' })
const printData = ref<ShipmentOrderVO>({}) //
const printButtonRef = ref<HTMLButtonElement>() //
const tableColumnCount = 8
const tableColumnCount = 5
const printObj = ref({
id: 'wmsShipmentOrderPrint',
popTitle: '&nbsp',

View File

@ -237,17 +237,6 @@
</div>
</template>
</el-table-column>
<el-table-column align="center" label="批号" min-width="140" prop="batchNo" />
<el-table-column label="生产日期/过期日期" min-width="180">
<template #default="detailScope">
<div v-if="detailScope.row.productionDate">
生产日期{{ formatNullableDate(detailScope.row.productionDate, 'YYYY-MM-DD') }}
</div>
<div v-if="detailScope.row.expirationDate">
过期日期{{ formatNullableDate(detailScope.row.expirationDate, 'YYYY-MM-DD') }}
</div>
</template>
</el-table-column>
<el-table-column align="right" label="出库数量" width="120">
<template #default="detailScope">
{{ formatQuantity(detailScope.row.quantity) }}