Commit c6b3162c by linjinhong

fix:修改问题

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