Commit c7717cdd by wusiyi

feat: 工厂订单new配货打单添加库存校验 #1008656

parent 29ccc2e0
......@@ -288,6 +288,7 @@ import socket from '@/utils/websocket'
import { WarehouseListData } from '@/types/index'
import { filePath } from '@/api/axios.ts'
import { ElButton, ElIcon, ElTag } from 'element-plus'
import { BaseRespData } from '@/types/api'
const { getCLodop } = useLodop()
......@@ -793,6 +794,7 @@ const getPackingData = async (code: string) => {
}
}
const res = await getPackingDataApi(url, params)
if (res.code !== 200) {
ElMessage.warning(res.message)
isLock.value = false
......@@ -829,7 +831,22 @@ const getPackingData = async (code: string) => {
// }
} catch (error) {
console.log(error)
const err = error as BaseRespData<{
inventory: number
producingQuantity: number
availableInventory: number
}>
if (props.isNewOrder && err?.code === 301) {
loading.close()
await ElMessageBox.alert(
`库存不足,无法进入生产!请联系仓库管理人员核对库存。<br/>库存数量:${err.data?.inventory},生产中的数量:${err.data?.producingQuantity}<span style="color: red">可调配库存:${err.data?.availableInventory}</span>`,
'提示',
{
type: 'warning',
dangerouslyUseHTMLString: true,
},
)
}
} finally {
isLock.value = false
productionOrder.value = ''
......
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