Commit 1c8c8872 by linjinhong Committed by qinjianhui

fix:修改问题

parent a4d7ad37
......@@ -29,6 +29,7 @@ export interface OrderData {
remark?: string
version?: number
factoryOrderNumber?: number | string
replaceShipment?: number | string
orderParamList?: IorderItem[]
}
export interface IorderItem {
......
......@@ -400,9 +400,9 @@ watch(visible, async (value: boolean) => {
initPrintDevice()
inputActive()
const locaclPrinter = localStorage.getItem('sheetPrinter')
const locaclWarehouseId = localStorage.getItem('locaclWarehouseId')
if (locaclPrinter) sheetPrinter.value = JSON.parse(locaclPrinter)
if (locaclWarehouseId) warehouseId.value = JSON.parse(locaclWarehouseId)
emit('set-printer', sheetPrinter.value)
}
})
......
......@@ -375,6 +375,8 @@ watch(visible, async (value: boolean) => {
if (value) {
podOrderDetailsData.value = {}
currentCode = ''
currentItem.value = {}
const localRaw = sessionStorage.getItem('locaclCnWarehouseId')
const localId = localRaw ? JSON.parse(localRaw) : ''
/* 先找一次,确认本地值是否存在于列表 */
......@@ -400,6 +402,13 @@ watch(visible, async (value: boolean) => {
console.error(error)
}
}
console.log(
8888,
currentItem.value,
currentCode,
podOrderDetailsData.value,
boxIndex.value,
)
initOrderDetailBox()
initPrintDevice()
......@@ -422,6 +431,11 @@ watch(boxIndex, (value: number | null) => {
const bool = !boxChange.value
boxChange.value = false
console.log('boxChange', bool, value)
const item = podBoxList.value?.find((item) => item.box === value)
currentItem.value = item?.data as OrderData
console.log('currentItem.value', currentItem.value)
renderItemBox(bool)
}
})
......@@ -431,6 +445,7 @@ watch(
if (value) {
const item = value.find((item) => item.box === podBoxIndex.value)
console.log('podBoxList', value, podBoxIndex.value, item)
currentItem.value = item?.data as OrderData
if (item?.data) {
renderItemBox(true)
} else {
......@@ -838,19 +853,23 @@ const handleOpened = () => {
productionOrderRef.value.focus()
}
const handleClose = (done: () => void) => {
console.log(999, currentItem.value)
nextStep(() => {
done()
})
}, currentItem.value)
}
const onClose = () => {
// orderStore.clearPodBox()
emit('refresh')
}
// 下一步
const nextStep = async (callback: () => void) => {
const nextStep = async (callback: () => void, data?: OrderData) => {
const everyPicked = podOrderDetailsData.value?.productList?.every(
(item) => item.count === item.purchaseNumber,
)
console.log(854, data)
if (
everyPicked &&
(podOrderDetailsData.value?.printResult === 'printSuccess' ||
......@@ -858,7 +877,9 @@ const nextStep = async (callback: () => void) => {
) {
try {
await ElMessageBox.alert(
'当前订单验货完成并打印面单成功,是否转至已完成',
`当前订单验货完成并打印面单成功,是否转至${
data?.replaceShipment == 1 ? '待称重' : '已完成'
}`,
'提示',
{
confirmButtonText: '确定',
......@@ -876,8 +897,12 @@ const nextStep = async (callback: () => void) => {
callback && callback()
}
}
const currentItem = ref<OrderData>({})
const handleBoxClick = (item: PodMakeOrderData) => {
const { box, data } = item
console.log('data11111111', data)
currentItem.value = item as OrderData
isBillLading.value = !data?.filePath
nextStep(() => {
if (!data) {
......@@ -887,7 +912,7 @@ const handleBoxClick = (item: PodMakeOrderData) => {
boxIndex.value = box || null
boxChange.value = true
productionOrderRef.value.focus()
})
}, currentItem.value)
}
const handleClearBox = async () => {
try {
......
......@@ -97,11 +97,11 @@
@row-click="handleRowClick"
>
<template #image="{ row }">
<div
style="display: flex; flex-wrap: nowrap"
>
<div style="display: flex; flex-wrap: nowrap">
<div
v-for="img in row.productMark!=='normal'?row.previewImgs:[{url:row.variantImage}]"
v-for="img in row.productMark !== 'normal'
? row.previewImgs
: [{ url: row.variantImage }]"
:key="img"
@click.stop="handleCurrentChange(img.url)"
style="cursor: pointer; margin-right: 5px; flex: 1"
......@@ -156,12 +156,7 @@
@click="podOrderDetailsData && print(podOrderDetailsData, true)"
>手动打印</ElButton
>
<ElButton
type="primary"
@click="printNormal"
>普货拣货
</ElButton
>
<ElButton type="primary" @click="printNormal">普货拣货 </ElButton>
<ElButton type="success" @click="handlePrintFinish"
>打单完成</ElButton
>
......@@ -328,6 +323,7 @@ watch(visible, async (value: boolean) => {
if (value) {
podOrderDetailsData.value = {}
currentCode = ''
currentItem.value = {}
if (userStore.user?.factory.id) {
try {
await socket.init(
......@@ -350,6 +346,7 @@ watch(visible, async (value: boolean) => {
initPrintDevice()
const locaclPrinter = localStorage.getItem('sheetPrinter')
if (locaclPrinter) sheetPrinter.value = JSON.parse(locaclPrinter)
emit('set-printer', sheetPrinter.value)
} else {
if (userStore.user?.factory.id) {
socket.send({
......@@ -365,6 +362,9 @@ watch(boxIndex, (value: number | null) => {
const bool = !boxChange.value
boxChange.value = false
console.log('boxChange', bool, value)
const item = podBoxList.value?.find((item) => item.box === value)
currentItem.value = item?.data as OrderData
renderItemBox(bool)
}
})
......@@ -374,6 +374,8 @@ watch(
if (value) {
const item = value.find((item) => item.box === podBoxIndex.value)
console.log('podBoxList', value, podBoxIndex.value, item)
currentItem.value = item?.data as OrderData
if (item?.data) {
renderItemBox(true)
} else {
......@@ -486,8 +488,8 @@ const messageChange = (data: WebSocketMessage) => {
}
const printNormal = async () => {
const arr: (number | undefined)[] = [];
(podBoxList.value || []).forEach((item: PodMakeOrderData) => {
const arr: (number | undefined)[] = []
;(podBoxList.value || []).forEach((item: PodMakeOrderData) => {
if (item.data) {
if (item.data.productList && item.data.productList.length > 0) {
const flag = item.data.productList.some((item1) => {
......@@ -659,8 +661,8 @@ const initOrderDetailBox = async () => {
ElMessage.warning(res.message)
return
}
res.data.forEach(r=>{
r.data?.productList?.forEach(d=>{
res.data.forEach((r) => {
r.data?.productList?.forEach((d) => {
if (d.productMark === 'normal') {
d.previewImgs = [{ url: d.variantImage || '' }]
} else {
......@@ -764,14 +766,14 @@ const handleOpened = () => {
const handleClose = (done: () => void) => {
nextStep(() => {
done()
})
}, currentItem.value)
}
const onClose = () => {
// orderStore.clearPodBox()
emit('refresh')
}
// 下一步
const nextStep = async (callback: () => void) => {
const nextStep = async (callback: () => void, data?: OrderData) => {
const everyPicked = podOrderDetailsData.value?.productList?.every(
(item) => item.count === item.purchaseNumber,
)
......@@ -782,7 +784,9 @@ const nextStep = async (callback: () => void) => {
) {
try {
await ElMessageBox.alert(
'当前订单验货完成并打印面单成功,是否转至已完成',
`当前订单验货完成并打印面单成功,是否转至${
data?.replaceShipment == 0 ? '已完成' : '待称重'
}`,
'提示',
{
confirmButtonText: '确定',
......@@ -800,9 +804,13 @@ const nextStep = async (callback: () => void) => {
callback && callback()
}
}
const currentItem = ref<OrderData>({})
const handleBoxClick = (item: PodMakeOrderData) => {
const { box, data } = item
isBillLading.value = !data?.filePath
currentItem.value = data as OrderData
nextStep(() => {
if (!data) {
ElMessage.warning('暂无数据')
......@@ -811,7 +819,7 @@ const handleBoxClick = (item: PodMakeOrderData) => {
boxIndex.value = box || null
boxChange.value = true
productionOrderRef.value.focus()
})
}, currentItem.value)
}
const handleClearBox = async () => {
try {
......@@ -920,8 +928,9 @@ const clearAllBox = async () => {
}
const handleRowClick = (row: ProductList) => {
console.log(907, row)
const previewImages = row.productMark!=='normal'?row.previewImgs:[{url:row.variantImage}]
coverImage.value =previewImages?.[0]?.url || ''
const previewImages =
row.productMark !== 'normal' ? row.previewImgs : [{ url: row.variantImage }]
coverImage.value = previewImages?.[0]?.url || ''
productionOrderRef.value.focus()
}
const handleCurrentChange = (url: string) => {
......
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