Commit e9cfd2d5 by linjinhong

修改播种墙单件入库

parent 4cc8a6db
export interface PodMakeOrderData { export interface PodMakeOrderData {
data: OrderData | null data?: OrderData | null
warehouseId?: number warehouseId?: number
box?: number box?: number
addDate?: string addDate?: string
......
...@@ -138,10 +138,11 @@ ...@@ -138,10 +138,11 @@
</div> </div>
<div class="middle-content"> <div class="middle-content">
<div class="box-top"> <div class="box-top">
<div class="box-top-item"> <div class="box-top-item" v-if="boxIndex !== 0">
<span class="box-top-item-box-index"> <span class="box-top-item-box-index">
{{ boxIndex }} {{ boxIndex }}
</span> </span>
<span class="box-top-item-box-index-text">号箱</span> <span class="box-top-item-box-index-text">号箱</span>
<span style="font-size: 30px">放入第</span> <span style="font-size: 30px">放入第</span>
...@@ -150,6 +151,7 @@ ...@@ -150,6 +151,7 @@
</div> </div>
<span style="font-size: 30px">件商品</span> <span style="font-size: 30px">件商品</span>
</div> </div>
<div v-else class="box-top-item-box-index-text">单件订单,已配齐</div>
<div class="box-top-item-status"> <div class="box-top-item-status">
<span <span
v-if=" v-if="
...@@ -201,14 +203,19 @@ ...@@ -201,14 +203,19 @@
:class="{ :class="{
active: item.box && boxIndex == item.box, active: item.box && boxIndex == item.box,
isNull: !item.data, isNull: !item.data,
fontStyle: index == 0,
}" }"
@click="handleBoxClick(item)" @click="handleBoxClick(item)"
> >
<span style="font-weight: bold" :title="index + 1 + '号箱'"> <span
{{ index + 1 }} style="font-weight: bold"
:title="index == 0 ? '虚拟箱' : index + '号箱'"
>
{{ index == 0 ? '虚拟箱' : index }}
</span> </span>
<span v-if="item.data" class="number">
{{ item.data.pickingNumber }}/{{ item.data.purchaseNumber }} <span v-if="item.data?.pickingNumber" class="number">
{{ item.data?.pickingNumber }}/{{ item.data.purchaseNumber }}
</span> </span>
<div <div
v-if=" v-if="
...@@ -343,7 +350,9 @@ const orderStore = useOrderStore() ...@@ -343,7 +350,9 @@ const orderStore = useOrderStore()
const isLock = ref<boolean>(false) const isLock = ref<boolean>(false)
const productionOrderRef = ref() const productionOrderRef = ref()
const socketConnect = computed(() => orderStore.socketConnect) const socketConnect = computed(() => orderStore.socketConnect)
const podBoxList = computed(() => orderStore.podBoxList) const podBoxList = computed(() => {
return [{ box: 0 }, ...(orderStore.podBoxList as PodMakeOrderData[])]
})
const coverImage = ref<string>('') const coverImage = ref<string>('')
let currentCode = '' let currentCode = ''
const tableRef = ref() const tableRef = ref()
...@@ -355,8 +364,8 @@ watch(visible, async (value: boolean) => { ...@@ -355,8 +364,8 @@ watch(visible, async (value: boolean) => {
const localId = localRaw ? JSON.parse(localRaw) : '' const localId = localRaw ? JSON.parse(localRaw) : ''
/* 先找一次,确认本地值是否存在于列表 */ /* 先找一次,确认本地值是否存在于列表 */
const hit = props.warehouseList.find((w) => w.id === localId) const hit = props.warehouseList.find((w) => w.id === localId)
warehouseId.value = hit ? localId : props.warehouseList[0].id warehouseId.value = hit ? localId : props.warehouseList[0]?.id
_warehouseId.value = hit ? localId : props.warehouseList[0].id _warehouseId.value = hit ? localId : props.warehouseList[0]?.id
if (userStore.user?.factory.id) { if (userStore.user?.factory.id) {
try { try {
...@@ -405,6 +414,8 @@ watch(boxIndex, (value: number | null) => { ...@@ -405,6 +414,8 @@ watch(boxIndex, (value: number | null) => {
watch( watch(
podBoxList, podBoxList,
(value) => { (value) => {
console.log('podBoxIndex1111', podBoxIndex.value)
if (value) { if (value) {
const item = value.find((item) => item.box === podBoxIndex.value) const item = value.find((item) => item.box === podBoxIndex.value)
console.log('podBoxList', value, podBoxIndex.value, item) console.log('podBoxList', value, podBoxIndex.value, item)
...@@ -444,13 +455,13 @@ const podBoxIndex = computed(() => orderStore.podBoxIndex) ...@@ -444,13 +455,13 @@ const podBoxIndex = computed(() => orderStore.podBoxIndex)
let renderLock = false let renderLock = false
const renderItemBox = (bool: boolean) => { const renderItemBox = (bool: boolean) => {
if ( // if (
!podBoxList.value || // !podBoxList.value ||
podBoxList.value.length === 0 || // podBoxList.value.length === 0 ||
!boxIndex.value || // !boxIndex.value ||
(bool && boxIndex.value !== podBoxIndex.value) // (bool && boxIndex.value !== podBoxIndex.value)
) // )
return // return
if (renderLock) return if (renderLock) return
renderLock = true renderLock = true
let boxItem = podBoxList.value.find((item) => item.box === boxIndex.value) let boxItem = podBoxList.value.find((item) => item.box === boxIndex.value)
...@@ -507,6 +518,7 @@ const renderItemBox = (bool: boolean) => { ...@@ -507,6 +518,7 @@ const renderItemBox = (bool: boolean) => {
} }
podOrderDetailsData.value = data podOrderDetailsData.value = data
console.log(408, podOrderDetailsData.value)
if (productList.every((item) => item.power)) { if (productList.every((item) => item.power)) {
print(data, false, () => { print(data, false, () => {
...@@ -630,12 +642,27 @@ const getPackingData = async (code: string) => { ...@@ -630,12 +642,27 @@ const getPackingData = async (code: string) => {
productionOrder.value = '' productionOrder.value = ''
return return
} }
const { box } = res.data const { box, data } = res.data
console.log('box', box) console.log('box', box)
if (box) { if (box) {
boxIndex.value = 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: [] }
}
el.data.productList = data?.productList
console.log(684, el)
}
})
renderItemBox(true)
console.log('podBoxList', podBoxList.value)
// }
} catch (error) { } catch (error) {
console.log(error) console.log(error)
} finally { } finally {
...@@ -952,7 +979,7 @@ const print = (data: OrderData, forcePrint = false, callback?: () => void) => { ...@@ -952,7 +979,7 @@ const print = (data: OrderData, forcePrint = false, callback?: () => void) => {
const factoryNo = userStore.user?.factory.id const factoryNo = userStore.user?.factory.id
if (!factoryNo) return if (!factoryNo) return
orderStore.setPodBoxList({ orderStore.setPodBoxList({
boxList: item ? item.data : null, boxList: item ? (item.data as PodMakeOrderData[]) : null,
factoryNo, factoryNo,
box: _boxIndex || undefined, box: _boxIndex || undefined,
warehouseId: warehouseId.value, warehouseId: warehouseId.value,
...@@ -1231,6 +1258,9 @@ const printNormal = async () => { ...@@ -1231,6 +1258,9 @@ const printNormal = async () => {
background-color: red; background-color: red;
} }
} }
.fontStyle {
font-size: 12px;
}
</style> </style>
<style lang="scss"> <style lang="scss">
.pod-make-order-dialog { .pod-make-order-dialog {
......
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