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
e52f1687
Commit
e52f1687
authored
Mar 30, 2026
by
zhuzhequan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'master'
Dev See merge request
!178
parents
cc86aa8e
0f011c9a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
77 additions
and
13 deletions
+77
-13
src/api/axios.ts
+26
-1
src/api/requestLog.ts
+39
-0
src/views/logistics/logisticsTracking.vue
+1
-1
src/views/order/orderTracking/index.vue
+2
-2
src/views/order/orderTracking/indexcn.vue
+2
-2
src/views/order/podCN/index.vue
+3
-3
src/views/order/podUs/index.vue
+3
-3
src/views/podUsBillOrder/index.vue
+1
-1
No files found.
src/api/axios.ts
View file @
e52f1687
...
@@ -2,6 +2,8 @@ import router from '@/router'
...
@@ -2,6 +2,8 @@ import router from '@/router'
import
Axios
from
'axios'
import
Axios
from
'axios'
import
{
showError
}
from
'@/utils/ui.ts'
import
{
showError
}
from
'@/utils/ui.ts'
import
{
v4
as
uuidv4
}
from
'uuid'
import
{
v4
as
uuidv4
}
from
'uuid'
import
dayjs
from
'dayjs'
import
{
findRequestItemByUUID
,
deleteRequestByUUID
,
addRequestItem
,
getTimeDifferenceInMilliseconds
}
from
'./requestLog.ts'
const
axios
=
Axios
.
create
({
const
axios
=
Axios
.
create
({
baseURL
:
import
.
meta
.
env
.
VITE_API_BASE
,
baseURL
:
import
.
meta
.
env
.
VITE_API_BASE
,
timeout
:
60
*
60
*
1000
,
//半小时
timeout
:
60
*
60
*
1000
,
//半小时
...
@@ -22,9 +24,15 @@ axios.interceptors.request.use(
...
@@ -22,9 +24,15 @@ axios.interceptors.request.use(
const
token
=
getToken
()
const
token
=
getToken
()
if
(
token
)
{
if
(
token
)
{
config
.
headers
[
'jwt-token'
]
=
token
config
.
headers
[
'jwt-token'
]
=
token
}
config
.
headers
.
timestamp
=
new
Date
().
getTime
()
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'
),
uuid
:
config
.
headers
.
uuid
})
return
config
return
config
},
},
(
error
)
=>
{
(
error
)
=>
{
...
@@ -35,6 +43,23 @@ axios.interceptors.response.use(
...
@@ -35,6 +43,23 @@ axios.interceptors.response.use(
(
response
)
=>
{
(
response
)
=>
{
// 1. 判断响应码
// 1. 判断响应码
const
data
=
response
.
data
const
data
=
response
.
data
const
uuid
=
response
.
config
?.
headers
?.
uuid
const
item
=
findRequestItemByUUID
(
uuid
)
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')
const clientResponseTime = getTimeDifferenceInMilliseconds(item.startTime, endTime)
console.log(item)
if((clientResponseTime as number)>=3000){
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)
}
deleteRequestByUUID(uuid)
if (data && typeof data === 'object' && typeof data.code === 'number') {
if (data && typeof data === 'object' && typeof data.code === 'number') {
// token 过期
// token 过期
if (data.code === 403) {
if (data.code === 403) {
...
...
src/api/requestLog.ts
0 → 100644
View file @
e52f1687
export
interface
ApiRequestItem
{
url
:
string
;
method
:
string
;
startTime
:
string
;
uuid
:
string
;
}
const
apiRequestKey
=
'apiRequestStorage'
export
const
getRequestData
=
()
=>
{
return
JSON
.
parse
(
localStorage
.
getItem
(
apiRequestKey
)
||
'[]'
)
}
export
const
getTimeDifferenceInMilliseconds
=
(
time1
:
string
,
time2
:
string
):
number
|
null
=>
{
const
date1
=
new
Date
(
time1
);
const
date2
=
new
Date
(
time2
);
// 检查日期是否有效
if
(
isNaN
(
date1
.
getTime
())
||
isNaN
(
date2
.
getTime
()))
{
return
null
;
// 返回 null 或者其他你想要的错误处理
}
return
date2
.
getTime
()
-
date1
.
getTime
();
}
export
const
findRequestItemByUUID
=
(
uuid
:
string
)
=>
{
const
data
=
getRequestData
()
return
data
.
find
((
d
:
ApiRequestItem
)
=>
d
.
uuid
===
uuid
)
}
export
const
deleteRequestByUUID
=
(
uuid
:
string
)
=>
{
let
data
=
getRequestData
()
data
=
data
.
filter
((
d
:
ApiRequestItem
)
=>
d
.
uuid
!==
uuid
)
localStorage
.
setItem
(
apiRequestKey
,
JSON
.
stringify
(
data
))
}
export
const
addRequestItem
=
(
item
?:
ApiRequestItem
)
=>
{
const
data
=
getRequestData
()
data
.
push
(
item
)
localStorage
.
setItem
(
apiRequestKey
,
JSON
.
stringify
(
data
))
return
data
}
src/views/logistics/logisticsTracking.vue
View file @
e52f1687
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
<
div
>
{{
getStatus
(
row
.
orderStatus
)
}}
<
/div
>
<
div
>
{{
getStatus
(
row
.
orderStatus
)
}}
<
/div
>
<
/template
>
<
/template
>
<
template
#
shipmentType
=
"{ row
}
"
>
<
template
#
shipmentType
=
"{ row
}
"
>
{{
[
'自有物流'
,
'
工厂
物流'
][
row
.
shipmentType
]
}}
{{
[
'自有物流'
,
'
九猫统筹
物流'
][
row
.
shipmentType
]
}}
<
/template
>
<
/template
>
<
template
#
shippingAge
=
"{ row
}
"
>
<
template
#
shippingAge
=
"{ row
}
"
>
{{
getShippingAge
(
row
)
}}
{{
getShippingAge
(
row
)
}}
...
...
src/views/order/orderTracking/index.vue
View file @
e52f1687
...
@@ -879,7 +879,7 @@ onMounted(() => {
...
@@ -879,7 +879,7 @@ onMounted(() => {
style=
"width: 150px"
style=
"width: 150px"
>
>
<ElOption
<ElOption
v-for=
"(item, index) in ['自有物流', '
工厂
物流']"
v-for=
"(item, index) in ['自有物流', '
九猫统筹
物流']"
:key=
"index"
:key=
"index"
:value=
"index"
:value=
"index"
:label=
"item"
:label=
"item"
...
@@ -1175,7 +1175,7 @@ onMounted(() => {
...
@@ -1175,7 +1175,7 @@ onMounted(() => {
<div>
{{
getStatus
(
row
.
status
)
}}
</div>
<div>
{{
getStatus
(
row
.
status
)
}}
</div>
</
template
>
</
template
>
<
template
#
shipmentType=
"{ row }"
>
<
template
#
shipmentType=
"{ row }"
>
{{
[
'自有物流'
,
'
工厂
物流'
][
row
.
shipmentType
]
}}
{{
[
'自有物流'
,
'
九猫统筹
物流'
][
row
.
shipmentType
]
}}
</
template
>
</
template
>
</TableView>
</TableView>
</div>
</div>
...
...
src/views/order/orderTracking/indexcn.vue
View file @
e52f1687
...
@@ -1156,7 +1156,7 @@ onMounted(() => {
...
@@ -1156,7 +1156,7 @@ onMounted(() => {
<ElOption
<ElOption
v-for=
"(item, index) in searchForm.replaceShipment === 0
v-for=
"(item, index) in searchForm.replaceShipment === 0
? ['自提', '快递']
? ['自提', '快递']
: ['自有物流', '
工厂
物流']"
: ['自有物流', '
九猫统筹
物流']"
:key=
"index"
:key=
"index"
:value=
"index"
:value=
"index"
:label=
"item"
:label=
"item"
...
@@ -1267,7 +1267,7 @@ onMounted(() => {
...
@@ -1267,7 +1267,7 @@ onMounted(() => {
{{
{{
(
row
.
replaceShipment
===
0
(
row
.
replaceShipment
===
0
?
[
'自提'
,
'快递'
]
?
[
'自提'
,
'快递'
]
:
[
'自有物流'
,
'
工厂
物流'
])[
row
.
shipmentType
]
:
[
'自有物流'
,
'
九猫统筹
物流'
])[
row
.
shipmentType
]
}}
}}
</
template
>
</
template
>
<
template
#
replaceShipment=
"{ row }"
>
<
template
#
replaceShipment=
"{ row }"
>
...
...
src/views/order/podCN/index.vue
View file @
e52f1687
...
@@ -475,7 +475,7 @@
...
@@ -475,7 +475,7 @@
style=
"width: 150px"
style=
"width: 150px"
>
>
<ElOption
<ElOption
v-for=
"(item, index) in ['自有物流', '
工厂
物流']"
v-for=
"(item, index) in ['自有物流', '
九猫统筹
物流']"
:key=
"index"
:key=
"index"
:value=
"index"
:value=
"index"
:label=
"item"
:label=
"item"
...
@@ -806,7 +806,7 @@
...
@@ -806,7 +806,7 @@
>
>
</ElDropdownMenu>
</ElDropdownMenu>
</template> -->
</template> -->
<!-- 代发:0.自有物流 1.
工厂
物流; 不代发: 0.自提 1.快递-->
<!-- 代发:0.自有物流 1.
九猫统筹
物流; 不代发: 0.自提 1.快递-->
<
template
<
template
v-if=
"
v-if=
"
status === 'CREATE_LOGISTICS' || status === 'WAIT_SHIPMENT'
status === 'CREATE_LOGISTICS' || status === 'WAIT_SHIPMENT'
...
@@ -1644,7 +1644,7 @@
...
@@ -1644,7 +1644,7 @@
>
>
{{
{{
row
.
replaceShipment
===
1
row
.
replaceShipment
===
1
?
[
'自有物流'
,
'
工厂
物流'
][
row
.
shipmentType
]
?
[
'自有物流'
,
'
九猫统筹
物流'
][
row
.
shipmentType
]
:
[
'自提'
,
'快递'
][
row
.
shipmentType
]
:
[
'自提'
,
'快递'
][
row
.
shipmentType
]
}}
}}
</span>
</span>
...
...
src/views/order/podUs/index.vue
View file @
e52f1687
...
@@ -425,7 +425,7 @@
...
@@ -425,7 +425,7 @@
shipmentList=['自提','快递']
shipmentList=['自提','快递']
searchForm.shipmentType=0
searchForm.shipmentType=0
}else{
}else{
shipmentList=['自有物流', '
工厂
物流']
shipmentList=['自有物流', '
九猫统筹
物流']
searchForm.shipmentType=''
searchForm.shipmentType=''
}
}
}
}
...
@@ -1695,7 +1695,7 @@
...
@@ -1695,7 +1695,7 @@
{{
{{
row
.
shipmentType
==
0
&&
row
.
replaceShipment
==
0
row
.
shipmentType
==
0
&&
row
.
replaceShipment
==
0
?
'自提'
?
'自提'
:
[
'自有物流'
,
'
工厂
物流'
][
row
.
shipmentType
]
:
[
'自有物流'
,
'
九猫统筹
物流'
][
row
.
shipmentType
]
}}
}}
</span>
</span>
</div>
</div>
...
@@ -3759,7 +3759,7 @@ const handleBatchDelete = async (type: string, id?: string) => {
...
@@ -3759,7 +3759,7 @@ const handleBatchDelete = async (type: string, id?: string) => {
}
}
}
}
const
shipmentList
=
ref
([
'自有物流'
,
'
工厂
物流'
])
const
shipmentList
=
ref
([
'自有物流'
,
'
九猫统筹
物流'
])
// 批量下载 重新排版
// 批量下载 重新排版
const
handleReComposingDesign
=
async
()
=>
{
const
handleReComposingDesign
=
async
()
=>
{
...
...
src/views/podUsBillOrder/index.vue
View file @
e52f1687
...
@@ -777,7 +777,7 @@
...
@@ -777,7 +777,7 @@
>
>
<
template
#
default
=
"{ row
}
"
>
<
template
#
default
=
"{ row
}
"
>
<
span
v
-
if
=
"row.order"
>
{{
<
span
v
-
if
=
"row.order"
>
{{
row
.
order
.
shipment_type
==
1
?
'
工厂
物流'
:
'自我物流'
row
.
order
.
shipment_type
==
1
?
'
九猫统筹
物流'
:
'自我物流'
}}
<
/span
>
}}
<
/span
>
<
/template
>
<
/template
>
<
/el-table-column
>
<
/el-table-column
>
...
...
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