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
4d456ff5
Commit
4d456ff5
authored
Jul 01, 2026
by
wusiyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 工厂订单(NEW)配货分拣功能重复扫码提示优化 #1010127
parent
b24be19f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
11 deletions
+55
-11
src/api/axios.ts
+23
-11
src/api/podUsOrder.ts
+1
-0
src/types/axios.d.ts
+11
-0
src/views/order/podUs/PodMakeOrder.vue
+20
-0
No files found.
src/api/axios.ts
View file @
4d456ff5
...
...
@@ -32,12 +32,12 @@ axios.interceptors.request.use(
config
.
headers
[
'jwt-token'
]
=
token
}
config
.
headers
.
timestamp
=
new
Date
().
getTime
()
config
.
headers
.
uuid
=
uuidv4
().
replace
(
/-/g
,
''
)
config
.
headers
.
uuid
=
uuidv4
().
replace
(
/-/g
,
''
)
addRequestItem
({
url
:
config
.
url
||
''
,
method
:
config
.
method
||
''
,
startTime
:
dayjs
(
new
Date
()).
format
(
'YYYY-MM-DD HH:mm:ss.SSS'
),
uuid
:
config
.
headers
.
uuid
uuid
:
config
.
headers
.
uuid
,
})
return
config
},
...
...
@@ -51,31 +51,39 @@ axios.interceptors.response.use(
const
data
=
response
.
data
const
uuid
=
response
.
config
?.
headers
?.
uuid
const
item
=
findRequestItemByUUID
(
uuid
)
if
(
response
.
config
.
url
)
{
if
(
response
.
config
.
url
)
{
if
(
response
.
config
.
url
.
startsWith
(
'/'
))
{
item
.
url
=
`
${
import
.
meta
.
env
.
VITE_API_BASE
}${
response
.
config
.
url
}
`
}
else
{
item
.
url
=
`
${
import
.
meta
.
env
.
VITE_API_BASE
}${
`/
${
response
.
config
.
url
}
`
}
`
item
.
url
=
`
${
import
.
meta
.
env
.
VITE_API_BASE
}${
`/
${
response
.
config
.
url
}
`
}
`
}
}
const
fm
=
new
FormData
()
const
processTime
=
response
.
headers
[
'processtime'
]
const
endTime
=
dayjs
(
new
Date
()).
format
(
'YYYY-MM-DD HH:mm:ss.SSS'
)
const
clientResponseTime
=
getTimeDifferenceInMilliseconds
(
item
.
startTime
,
endTime
)
const
clientResponseTime
=
getTimeDifferenceInMilliseconds
(
item
.
startTime
,
endTime
,
)
console
.
log
(
item
)
if
((
clientResponseTime
as
number
)
>=
3000
)
{
if
((
clientResponseTime
as
number
)
>=
3000
)
{
const
user
=
localStorage
.
getItem
(
'user'
)
if
(
user
)
{
const
userJson
:
UserJson
=
JSON
.
parse
(
user
)
const
userJson
:
UserJson
=
JSON
.
parse
(
user
)
fm
.
append
(
'factoryCode'
,
userJson
?.
factoryCode
)
}
fm
.
append
(
'processTime'
,
processTime
)
fm
.
append
(
'url'
,
item
.
url
)
fm
.
append
(
'method'
,
item
.
method
)
fm
.
append
(
'requestId'
,
response
.
data
.
requestId
)
fm
.
append
(
'clientResponseTime'
,
String
(
clientResponseTime
)
+
'ms'
)
navigator
.
sendBeacon
(
`
${
import
.
meta
.
env
.
VITE_API_BASE
}
/factory/ops/report-data`
,
fm
)
fm
.
append
(
'clientResponseTime'
,
String
(
clientResponseTime
)
+
'ms'
)
navigator
.
sendBeacon
(
`
${
import
.
meta
.
env
.
VITE_API_BASE
}
/factory/ops/report-data`
,
fm
,
)
}
deleteRequestByUUID
(
uuid
)
if
(
data
&&
typeof
data
===
'object'
&&
typeof
data
.
code
===
'number'
)
{
...
...
@@ -85,14 +93,18 @@ axios.interceptors.response.use(
return
Promise
.
reject
(
data
)
}
if
(
data
.
code
!==
200
)
{
showError
(
data
.
message
)
if
(
!
response
.
config
.
skipGlobalError
)
{
showError
(
data
.
message
)
}
return
Promise
.
reject
(
data
)
}
}
return
data
},
(
error
)
=>
{
showError
(
error
.
message
)
if
(
!
error
.
config
?.
skipGlobalError
)
{
showError
(
error
.
message
)
}
return
Promise
.
reject
(
error
)
},
)
...
...
src/api/podUsOrder.ts
View file @
4d456ff5
...
...
@@ -257,6 +257,7 @@ export function getPackingDataApi(
)
{
return
axios
.
get
<
never
,
BaseRespData
<
PodMakeOrderData
>>
(
url
,
{
params
,
skipGlobalError
:
true
,
})
}
export
function
getPodBoxListApi
(
...
...
src/types/axios.d.ts
0 → 100644
View file @
4d456ff5
import
'axios'
declare
module
'axios'
{
export
interface
AxiosRequestConfig
{
/** 为 true 时跳过全局响应拦截器的默认错误提示,由调用方自行处理 */
skipGlobalError
?:
boolean
}
export
interface
InternalAxiosRequestConfig
{
skipGlobalError
?:
boolean
}
}
src/views/order/podUs/PodMakeOrder.vue
View file @
4d456ff5
...
...
@@ -342,6 +342,7 @@ import { filePath } from '@/api/axios.ts'
import
{
ElButton
,
ElIcon
,
ElTag
}
from
'element-plus'
import
{
BaseRespData
}
from
'@/types/api'
import
type
{
SortingList
}
from
'@/types/api/order'
import
{
showError
}
from
'@/utils/ui.ts'
const
{
getCLodop
}
=
useLodop
()
...
...
@@ -988,7 +989,24 @@ const getPackingData = async (code: string) => {
producingQuantity
:
number
availableInventory
:
number
thirdSkuCode
?:
string
packingId
?:
number
box
?:
number
}
>
if
(
err
.
code
===
208
)
{
loading
.
close
()
const
{
packingId
,
box
}
=
err
.
data
const
area
=
sortingAreaList
.
value
.
find
((
item
)
=>
item
.
id
===
packingId
)
await
ElMessageBox
.
alert
(
`重复扫码!该操作单已在仓库:
${
area
?.
warehouseName
}
,
<
br
/>
配货区:
$
{
area
?.
areaName
}
,箱子:
$
{
box
}
中存在!
`,
'提示',
{
confirmButtonText: '确定',
dangerouslyUseHTMLString: true,
},
)
return
}
if (props.wallType !== 'us' && err?.code === 301) {
loading.close()
await ElMessageBox.alert(
...
...
@@ -1000,7 +1018,9 @@ const getPackingData = async (code: string) => {
dangerouslyUseHTMLString
:
true
,
},
)
return
}
showError
(
err
.
message
)
}
finally
{
isLock
.
value
=
false
productionOrder
.
value
=
''
...
...
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