Commit 74491db1 by qinjianhui

fix: 问题修改

parent dec0aeed
......@@ -22,17 +22,18 @@ const useOrderStore = defineStore('order', {
async setPodBoxList(content: {
boxList: PodMakeOrderData[] | OrderData | null
factoryNo: number | string
warehouseId: number | string
box?: number
data?: OrderData
}) {
const { factoryNo, boxList, box, data } = content
const { factoryNo, warehouseId, boxList, box, data } = content
if (Array.isArray(boxList)) {
this.podBoxList = boxList
} else {
const index = this.podBoxList?.findIndex((item) => item.box === box)
if (index === -1) {
try {
const res = await getPodBoxListApi(factoryNo)
const res = await getPodBoxListApi(factoryNo, warehouseId)
const boxList = res.data.map((item) => {
if (res.data) {
const productList = item?.data?.productList || []
......
......@@ -442,9 +442,7 @@ const messageChange = (data: WebSocketMessage) => {
const setPodBoxList = (data: WebSocketMessage) => {
const obj = data.txt
if (obj && typeof obj === 'string') {
console.log('obj', obj)
const parsedData = JSON.parse(obj)
console.log('parsedData', parsedData)
useOrderStore().setPodBoxList(parsedData)
}
}
......@@ -599,6 +597,7 @@ const initOrderDetailBox = async () => {
orderStore.setPodBoxList({
boxList: res.data,
factoryNo,
warehouseId: warehouseId.value,
})
const boxList = res.data.map((item) => {
if (item.data) {
......@@ -760,6 +759,7 @@ const handleClearBox = async () => {
boxList: null,
factoryNo,
box: boxIndex.value || undefined,
warehouseId: warehouseId.value,
})
boxIndex.value = null
podOrderDetailsData.value = {}
......@@ -808,6 +808,7 @@ const print = (data: OrderData, forcePrint = false) => {
boxList: item ? item.data : null,
factoryNo,
box: _boxIndex || undefined,
warehouseId: warehouseId.value,
})
})
}
......@@ -827,6 +828,7 @@ const clearAllBox = async () => {
orderStore.setPodBoxList({
boxList: res.data,
factoryNo: userStore.user?.factory.id || '',
warehouseId: warehouseId.value,
})
productionOrderRef.value.focus()
podOrderDetailsData.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