Commit 676ac2a1 by linjinhong

fix:修改单件订单展示

parent 051c5690
......@@ -151,7 +151,9 @@
</div>
<span style="font-size: 30px">件商品</span>
</div>
<div v-else class="box-top-item-box-index-text">单件订单,已配齐</div>
<div v-else class="box-top-item-box-index-text">
单件商品订单,不占用播种墙
</div>
<div class="box-top-item-status">
<span
v-if="
......@@ -203,15 +205,11 @@
:class="{
active: item.box && boxIndex == item.box,
isNull: !item.data,
fontStyle: index == 0,
}"
@click="handleBoxClick(item)"
>
<span
style="font-weight: bold"
:title="index == 0 ? '虚拟箱' : index + '号箱'"
>
{{ index == 0 ? '虚拟箱' : index }}
<span style="font-weight: bold" :title="index + 1 + '号箱'">
{{ index + 1 }}
</span>
<span v-if="item.data?.pickingNumber" class="number">
......@@ -351,7 +349,7 @@ const isLock = ref<boolean>(false)
const productionOrderRef = ref()
const socketConnect = computed(() => orderStore.socketConnect)
const podBoxList = computed(() => {
return [{ box: 0 }, ...(orderStore.podBoxList as PodMakeOrderData[])]
return orderStore.podBoxList
})
const coverImage = ref<string>('')
let currentCode = ''
......@@ -455,16 +453,17 @@ const podBoxIndex = computed(() => orderStore.podBoxIndex)
let renderLock = false
const renderItemBox = (bool: boolean) => {
// if (
// !podBoxList.value ||
// podBoxList.value.length === 0 ||
// !boxIndex.value ||
// (bool && boxIndex.value !== podBoxIndex.value)
// )
// return
if (
!podBoxList.value ||
podBoxList.value.length === 0 ||
!boxIndex.value ||
(bool && boxIndex.value !== podBoxIndex.value)
)
return
if (renderLock) return
renderLock = true
let boxItem = podBoxList.value.find((item) => item.box === boxIndex.value)
let boxItem = podBoxList.value?.find((item) => item.box === boxIndex.value)
if (!boxItem) boxItem = { data: { productList: [] } }
const { data } = boxItem
......@@ -518,7 +517,7 @@ const renderItemBox = (bool: boolean) => {
}
podOrderDetailsData.value = data
console.log(408, podOrderDetailsData.value)
console.log(408, data)
if (productList.every((item) => item.power)) {
print(data, false, () => {
......@@ -645,21 +644,28 @@ const getPackingData = async (code: string) => {
const { box, data } = res.data
console.log('box', box)
if (box) {
boxIndex.value = box
}
// if (box == 0) {
podBoxList.value.forEach((el) => {
if (el.box == box) {
console.log(684, el.box)
if (!el.data) {
el.data = { productList: [] }
// if (box) {
boxIndex.value = box as number
// }
if (boxIndex.value == 0) {
podOrderDetailsData.value = data as OrderData
if (podOrderDetailsData.value.productList?.length) {
const list = podOrderDetailsData.value.productList
for (const product of list) {
if (product.count === product.purchaseNumber) {
product.power = true
print(data as OrderData, false, () => {
renderLock = false
})
}
}
el.data.productList = data?.productList
console.log(684, el)
nextTick(() => {
tableRef.value?.setCurrentRow(list[0])
})
}
})
renderItemBox(true)
}
// renderItemBox(true)
console.log('podBoxList', podBoxList.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