Commit 237b7976 by qinjianhui

feat: 拣胚失败创建出库单

parent d648cbc3
...@@ -376,10 +376,6 @@ const open = async (params: OpenParams) => { ...@@ -376,10 +376,6 @@ const open = async (params: OpenParams) => {
const skuList = params.items const skuList = params.items
.map((item) => item.thirdSkuCode) .map((item) => item.thirdSkuCode)
.filter((sku) => !!sku) .filter((sku) => !!sku)
if (!skuList.length) {
newDialogVisible.value = true
return
}
const skuToSuggestQuantity = new Map<string, number>() const skuToSuggestQuantity = new Map<string, number>()
params.items.forEach((item) => { params.items.forEach((item) => {
...@@ -394,7 +390,7 @@ const open = async (params: OpenParams) => { ...@@ -394,7 +390,7 @@ const open = async (params: OpenParams) => {
try { try {
const res = await getBySkuAndWarehouseIdApi( const res = await getBySkuAndWarehouseIdApi(
params.warehouseId, params.warehouseId,
'JM240915008_LBU_L', skuList.join(','),
) )
if (res.code !== 200) return if (res.code !== 200) return
await fetchWarehouseList() await fetchWarehouseList()
......
...@@ -261,7 +261,8 @@ const handleCreateOutbound = () => { ...@@ -261,7 +261,8 @@ const handleCreateOutbound = () => {
} }
const warehouseName = firstSelection.warehouseName const warehouseName = firstSelection.warehouseName
const items = selections.value.map((item) => { const items = selections.value
.map((item) => {
const row = item as operateOrderListData & { const row = item as operateOrderListData & {
thirdSkuCode?: string thirdSkuCode?: string
inventory?: number inventory?: number
...@@ -276,6 +277,12 @@ const handleCreateOutbound = () => { ...@@ -276,6 +277,12 @@ const handleCreateOutbound = () => {
), ),
} }
}) })
.filter((item) => item.suggestOutQuantity !== 0)
if (items.length === 0) {
ElMessage.warning('建议出库数量=0,无法快速创建出库单!')
return
}
createOutboundDialogRef.value?.open({ createOutboundDialogRef.value?.open({
warehouseId, warehouseId,
......
...@@ -109,33 +109,40 @@ const columns = [ ...@@ -109,33 +109,40 @@ const columns = [
render: (row: RestockData) => { render: (row: RestockData) => {
return ( return (
<el-image <el-image
src={row.skuImage ?? ''} src={row.image ?? ''}
style={{ width: '50px', height: '50px' }} style={{ width: '50px', height: '50px' }}
previewSrcList={[row.skuImage ?? '']} previewSrcList={[row.image ?? '']}
previewTeleported previewTeleported
/> />
) )
}, },
}, },
{ {
prop: 'productName', prop: 'skuName',
label: '商品名称', label: '商品名称',
minWidth: 140, minWidth: 140,
showOverflowTooltip: true, showOverflowTooltip: true,
}, },
{ prop: 'supplierProductNo', label: '款号', width: 130 }, { prop: 'supplierProductNo', label: '款号', width: 130 },
{ {
key: 'thirdSkuCode', prop: 'warehouseSku',
prop: 'thirdSkuCode',
label: '库存SKU', label: '库存SKU',
width: 160, width: 200,
align: 'center', align: 'center',
}, },
{ {
prop: 'stockOutNum', prop: 'usableInventory',
label: '缺货数量', label: '缺货数量',
width: 90, width: 90,
align: 'right', align: 'right',
render: (row: RestockData) => {
const v = row.usableInventory ?? 0
return (
<span style="color: #f56c6c; font-weight: bold">
{Math.abs(v)}
</span>
)
},
}, },
{ {
label: '可用数量', label: '可用数量',
...@@ -144,14 +151,13 @@ const columns = [ ...@@ -144,14 +151,13 @@ const columns = [
align: 'right', align: 'right',
}, },
{ {
key: 'stockQuantity', prop: 'inventory',
prop: 'stockQuantity',
label: '库存数量', label: '库存数量',
width: 90, width: 90,
align: 'right', align: 'right',
}, },
{ {
prop: 'occupiedQuantity', prop: 'occupyInventory',
label: '占用数量', label: '占用数量',
width: 90, width: 90,
align: 'right', align: 'right',
...@@ -178,12 +184,21 @@ const handleReset = () => { ...@@ -178,12 +184,21 @@ const handleReset = () => {
const handleRestockCheck = async (row: RestockData) => { const handleRestockCheck = async (row: RestockData) => {
try { try {
await restockCheckApi(row.id, row.thirdSkuCode ?? '', row.warehouseId) await ElMessageBox.confirm('确定补货校验吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
try {
const res = await restockCheckApi(row.id, row.warehouseSku ?? '', row.warehouseId)
if (res.code !== 200) return
ElMessage.success('补货校验成功') ElMessage.success('补货校验成功')
refresh() refresh()
} catch (e) { } catch (e) {
const err = e as Error & { message?: string } console.error(e)
ElMessage.error(err?.message || '补货校验失败')
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment