Commit 05464d1a by qinjianhui

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

parent 2f9e7868
......@@ -272,20 +272,32 @@ const handleDispatch = async () => {
ElMessage.warning('请填写本次发货数量')
return
}
if (Number(item.currentShipQuantity) > (item.remainingQuantity ?? 0)) {
try {
await ElMessageBox.confirm(
`库存SKU:${item.warehouseSku}本次发货数量大于剩余待发货数量,是否确认发货?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
},
)
} catch {
return
}
}
const overQuantitySkus = (formData.value.detailsList || [])
.filter(
(item) =>
Number(item.currentShipQuantity) > (item.remainingQuantity ?? 0),
)
.map((item) => item.warehouseSku)
if (overQuantitySkus.length > 0) {
try {
await ElMessageBox.alert(
`<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: '确定',
cancelButtonText: '取消',
type: 'warning',
customClass: 'over-quantity-alert-box',
dangerouslyUseHTMLString: true,
},
)
} catch {
return
}
}
const loading = ElLoading.service({
......@@ -424,3 +436,16 @@ defineExpose({ open })
margin-top: 2px;
}
</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