Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
factory_front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinjianhui
factory_front
Commits
f48383a0
Commit
f48383a0
authored
Jul 14, 2026
by
wusiyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复配货打单/配货分拣断线自动重连未发送消息订阅bug #1001825
parent
54195e1d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
24 deletions
+18
-24
src/views/order/podUs/PodMakeOrder.vue
+18
-24
No files found.
src/views/order/podUs/PodMakeOrder.vue
View file @
f48383a0
...
@@ -624,20 +624,16 @@ watch(visible, async (value: boolean) => {
...
@@ -624,20 +624,16 @@ watch(visible, async (value: boolean) => {
if
(
userStore
.
user
?.
factory
.
id
)
{
if
(
userStore
.
user
?.
factory
.
id
)
{
try
{
try
{
// 断线自动重连成功时会走 open 回调重新订阅
await
socket
.
init
(
await
socket
.
init
(
{
{
account
:
userStore
.
user
?.
account
.
toString
(),
account
:
userStore
.
user
?.
account
.
toString
(),
factoryNo
:
userStore
.
user
?.
factory
.
id
.
toString
(),
factoryNo
:
userStore
.
user
?.
factory
.
id
.
toString
(),
},
},
messageChange
,
messageChange
,
sendWsSubscribe
,
)
)
socket
.
send
({
sendWsSubscribe
()
code
:
props
.
wsOpenCode
,
factoryNo
:
userStore
.
user
?.
factory
.
id
,
warehouseId
:
warehouseId
.
value
,
packingId
:
props
.
wallType
===
'sort'
?
sortingAreaId
.
value
:
undefined
,
})
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
error
)
console
.
error
(
error
)
}
}
...
@@ -1536,6 +1532,17 @@ const _warehouseId = ref<string | number>('')
...
@@ -1536,6 +1532,17 @@ const _warehouseId = ref<string | number>('')
const
sortingAreaList
=
ref
<
SortingList
[]
>
([])
const
sortingAreaList
=
ref
<
SortingList
[]
>
([])
const
sortingAreaId
=
ref
<
number
|
string
>
(
''
)
const
sortingAreaId
=
ref
<
number
|
string
>
(
''
)
const
isAutoPrint
=
ref
<
boolean
>
(
false
)
// 当前配货区是否自动打单
const
isAutoPrint
=
ref
<
boolean
>
(
false
)
// 当前配货区是否自动打单
// WS 消息订阅
const
sendWsSubscribe
=
(
factoryNo
?:
number
|
string
)
=>
{
const
no
=
factoryNo
??
userStore
.
user
?.
factory
.
id
if
(
!
no
)
return
socket
.
send
({
code
:
props
.
wsOpenCode
,
factoryNo
:
no
,
warehouseId
:
warehouseId
.
value
,
packingId
:
props
.
wallType
===
'sort'
?
sortingAreaId
.
value
:
undefined
,
})
}
// 配货分拣 更新配货区
// 配货分拣 更新配货区
const
syncSortingArea
=
(
const
syncSortingArea
=
(
packingId
:
number
|
string
,
packingId
:
number
|
string
,
...
@@ -1547,12 +1554,7 @@ const syncSortingArea = (
...
@@ -1547,12 +1554,7 @@ const syncSortingArea = (
warehouseId
.
value
=
currentArea
.
warehouseId
warehouseId
.
value
=
currentArea
.
warehouseId
sortingAreaId
.
value
=
packingId
sortingAreaId
.
value
=
packingId
isAutoPrint
.
value
=
currentArea
.
autoPrint
isAutoPrint
.
value
=
currentArea
.
autoPrint
socket
.
send
({
sendWsSubscribe
(
factoryNo
)
code
:
props
.
wsOpenCode
,
factoryNo
,
warehouseId
:
warehouseId
.
value
,
packingId
:
sortingAreaId
.
value
,
})
}
}
// 配货分拣 手动切换配货区
// 配货分拣 手动切换配货区
const
handleSortingAreaChange
=
(
const
handleSortingAreaChange
=
(
...
@@ -1582,11 +1584,7 @@ const handleWarehouseChange = (value: string | number) => {
...
@@ -1582,11 +1584,7 @@ const handleWarehouseChange = (value: string | number) => {
}
}
warehouseId
.
value
=
value
warehouseId
.
value
=
value
emit
(
'set-warehouseId'
,
value
)
emit
(
'set-warehouseId'
,
value
)
socket
.
send
({
sendWsSubscribe
()
code
:
props
.
wsOpenCode
,
factoryNo
:
userStore
.
user
?.
factory
.
id
,
warehouseId
:
warehouseId
.
value
,
})
_warehouseId
.
value
=
value
_warehouseId
.
value
=
value
initOrderDetailBox
()
initOrderDetailBox
()
resetPlatform
()
resetPlatform
()
...
@@ -1627,13 +1625,9 @@ const reconnectWebSocket = async () => {
...
@@ -1627,13 +1625,9 @@ const reconnectWebSocket = async () => {
factoryNo
:
userStore
.
user
?.
factory
.
id
.
toString
(),
factoryNo
:
userStore
.
user
?.
factory
.
id
.
toString
(),
},
},
messageChange
,
messageChange
,
sendWsSubscribe
,
)
)
socket
.
send
({
sendWsSubscribe
()
code
:
props
.
wsOpenCode
,
factoryNo
:
userStore
.
user
?.
factory
.
id
,
warehouseId
:
warehouseId
.
value
,
packingId
:
sortingAreaId
.
value
,
})
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'WebSocket 重连失败:'
,
error
)
console
.
error
(
'WebSocket 重连失败:'
,
error
)
ElMessage
.
error
(
'WebSocket 重连失败,请稍后重试'
)
ElMessage
.
error
(
'WebSocket 重连失败,请稍后重试'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment