Commit 87ca4491 by qinjianhui

fix: 拣胚成功创建入库单支持所有状态创建

parent 8bcbc948
...@@ -458,17 +458,12 @@ const handleClose = () => { ...@@ -458,17 +458,12 @@ const handleClose = () => {
} }
const handleCreateInbound = async () => { const handleCreateInbound = async () => {
const partialRows = selections.value.filter( if (selections.value.length === 0) {
(r) => r.pickingStatus === 'partial', ElMessage.warning('请选择需创建入库单的数据')
) return
if (
selections.value.length === 0 ||
!selections.value.every((r) => r.pickingStatus === 'partial')
) {
return ElMessage.warning('请选择需调整拣胚顺序的数据')
} }
const firstWid = partialRows[0].warehouseId const firstWid = selections.value[0].warehouseId
if (partialRows.some((r) => r.warehouseId !== firstWid)) { if (selections.value.some((r) => r.warehouseId !== firstWid)) {
return ElMessage.error('请选择相同仓库的库存SKU!') return ElMessage.error('请选择相同仓库的库存SKU!')
} }
resetReceiptEditForm() resetReceiptEditForm()
...@@ -488,7 +483,7 @@ const handleCreateInbound = async () => { ...@@ -488,7 +483,7 @@ const handleCreateInbound = async () => {
} }
} }
receiptEditForm.value.warehouseId = firstWid receiptEditForm.value.warehouseId = firstWid
receiptEditForm.value.warehouseName = partialRows[0].warehouseName || '' receiptEditForm.value.warehouseName = selections.value[0].warehouseName || ''
const wh = warehouseList.value.find((w) => w.id == firstWid) const wh = warehouseList.value.find((w) => w.id == firstWid)
if (wh) { if (wh) {
receiptEditForm.value.warehouseName = wh.name receiptEditForm.value.warehouseName = wh.name
...@@ -498,7 +493,7 @@ const handleCreateInbound = async () => { ...@@ -498,7 +493,7 @@ const handleCreateInbound = async () => {
background: 'rgba(0, 0, 0, 0.3)', background: 'rgba(0, 0, 0, 0.3)',
}) })
try { try {
const skus = partialRows.map((r) => r.thirdSkuCode as string) const skus = selections.value.map((r) => r.thirdSkuCode as string)
const res = await getBySkuAndUserMarkApi(firstWid, skus.join(','), null) const res = await getBySkuAndUserMarkApi(firstWid, skus.join(','), null)
if (res.code !== 200) return if (res.code !== 200) return
otherPurchaseData.value = res.data.map((item: InterskuList) => otherPurchaseData.value = res.data.map((item: InterskuList) =>
......
...@@ -472,8 +472,8 @@ ...@@ -472,8 +472,8 @@
</span> </span>
<template #dropdown> <template #dropdown>
<ElDropdownMenu> <ElDropdownMenu>
<ElDropdownItem command="tiff_42">TIF(40+2cm)</ElDropdownItem> <!-- <ElDropdownItem command="tiff_42">TIF(40+2cm)</ElDropdownItem>
<ElDropdownItem command="tiff_60">TIF(60cm)</ElDropdownItem> <ElDropdownItem command="tiff_60">TIF(60cm)</ElDropdownItem> -->
<ElDropdownItem command="png_42">PNG(40+2cm)</ElDropdownItem> <ElDropdownItem command="png_42">PNG(40+2cm)</ElDropdownItem>
<ElDropdownItem command="png_60">PNG(60cm)</ElDropdownItem> <ElDropdownItem command="png_60">PNG(60cm)</ElDropdownItem>
</ElDropdownMenu> </ElDropdownMenu>
......
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