Commit 05464d1a by qinjianhui

fix: 本次发货数量大于剩余待发货数量”的全部库存sku展示出来

parent 2f9e7868
...@@ -272,22 +272,34 @@ const handleDispatch = async () => { ...@@ -272,22 +272,34 @@ const handleDispatch = async () => {
ElMessage.warning('请填写本次发货数量') ElMessage.warning('请填写本次发货数量')
return return
} }
if (Number(item.currentShipQuantity) > (item.remainingQuantity ?? 0)) { }
const overQuantitySkus = (formData.value.detailsList || [])
.filter(
(item) =>
Number(item.currentShipQuantity) > (item.remainingQuantity ?? 0),
)
.map((item) => item.warehouseSku)
if (overQuantitySkus.length > 0) {
try { try {
await ElMessageBox.confirm( await ElMessageBox.alert(
`库存SKU:${item.warehouseSku}本次发货数量大于剩余待发货数量,是否确认发货?`, `<div style="line-height: 1.6;"><span style="white-space: nowrap; flex-shrink: 0;">库存SKU:</span><span style="word-break: break-all; margin-left: 4px;">${overQuantitySkus.join(
',',
)}</span><span style="margin-top: 12px;">本次发货数量大于剩余待发货数量,是否确认发货?</span></div>`,
'提示', '提示',
{ {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
customClass: 'over-quantity-alert-box',
dangerouslyUseHTMLString: true,
}, },
) )
} catch { } catch {
return return
} }
} }
}
const loading = ElLoading.service({ const loading = ElLoading.service({
lock: true, lock: true,
text: '正在提交...', text: '正在提交...',
...@@ -424,3 +436,16 @@ defineExpose({ open }) ...@@ -424,3 +436,16 @@ defineExpose({ open })
margin-top: 2px; margin-top: 2px;
} }
</style> </style>
<style>
.over-quantity-alert-box {
width: 1000px !important;
max-width: 90vw !important;
}
.over-quantity-alert-box .el-message-box__message {
word-break: break-all;
line-height: 1.6;
padding: 10px 0;
}
</style>
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