Commit 74491db1 by qinjianhui

fix: 问题修改

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