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
3209488d
Commit
3209488d
authored
Dec 03, 2025
by
wuqian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:物流跟踪优化:#ID:1001056
parent
f14854e6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
182 additions
and
2 deletions
+182
-2
components.d.ts
+1
-0
src/api/logistics.ts
+2
-0
src/views/logistics/logisticsTracking.vue
+176
-1
src/views/logistics/types/logistics.ts
+3
-0
src/views/order/podUsSchedulingRules/index.vue
+0
-1
No files found.
components.d.ts
View file @
3209488d
...
...
@@ -54,6 +54,7 @@ declare module 'vue' {
ElTag
:
typeof
import
(
'element-plus/es'
)[
'ElTag'
]
ElTimeline
:
typeof
import
(
'element-plus/es'
)[
'ElTimeline'
]
ElTimelineItem
:
typeof
import
(
'element-plus/es'
)[
'ElTimelineItem'
]
ElTimePicker
:
typeof
import
(
'element-plus/es'
)[
'ElTimePicker'
]
ElTooltip
:
typeof
import
(
'element-plus/es'
)[
'ElTooltip'
]
ElTree
:
typeof
import
(
'element-plus/es'
)[
'ElTree'
]
ElUpload
:
typeof
import
(
'element-plus/es'
)[
'ElUpload'
]
...
...
src/api/logistics.ts
View file @
3209488d
...
...
@@ -63,6 +63,8 @@ export interface ILogisticsCompany {
authCode
:
string
|
null
// varchar(500)
redirectUri
:
string
|
null
// varchar(256)
createTime
:
string
|
null
// timestamp
orderStatus
:
string
|
null
// varchar(60)
signTime
:
string
|
null
// timestamp
vat
:
string
|
null
// varchar(60)
ioss
:
string
|
null
// varchar(60)
basicType
:
number
// int(11)
...
...
src/views/logistics/logisticsTracking.vue
View file @
3209488d
...
...
@@ -27,6 +27,23 @@
<
template
#
top
>
<
el
-
card
>
<
el
-
form
inline
:
model
=
"searchForm"
ref
=
"searchFormRef"
>
<
el
-
form
-
item
label
=
"创建时间"
>
<
el
-
date
-
picker
v
-
model
=
"tradingTime"
:
shortcuts
=
"pickerOptions.shortcuts"
:
default
-
time
=
"[
new Date(0, 0, 0, 0, 0, 0),
new Date(0, 0, 0, 23, 59, 59),
]"
type
=
"datetimerange"
start
-
placeholder
=
"开始时间"
end
-
placeholder
=
"结束时间"
clearable
style
=
"width: 260px"
format
=
"YYYY-MM-DD HH:mm:ss"
value
-
format
=
"YYYY-MM-DD HH:mm:ss"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"物流跟踪号"
>
<
el
-
input
v
-
model
=
"searchForm.trackNumber"
...
...
@@ -87,6 +104,9 @@
<
template
#
shipmentType
=
"{ row
}
"
>
{{
[
'自有物流'
,
'工厂物流'
][
row
.
shipmentType
]
}}
<
/template
>
<
template
#
shippingAge
=
"{ row
}
"
>
{{
getShippingAge
(
row
)
}}
<
/template
>
<
/TableView
>
<
/div
>
<
div
class
=
"pagination"
>
...
...
@@ -139,7 +159,124 @@ const searchForm = ref<SearchForm>({
shopNumber
:
''
,
trackNumber
:
''
,
}
)
function
getStartTime
()
{
const
date
=
new
Date
()
const
year
=
date
.
getFullYear
()
const
month
=
date
.
getMonth
()
+
1
const
day
=
date
.
getDate
()
return
`${year
}
-${month
}
-${day
}
00:00:00`
}
const
tradingTime
=
ref
<
string
[]
>
([])
const
pickerOptions
=
{
shortcuts
:
[
{
text
:
'今日'
,
value
:
()
=>
{
const
start
=
new
Date
(
new
Date
(
getStartTime
()).
getTime
())
const
end
=
new
Date
()
return
[
start
,
end
]
}
,
}
,
{
text
:
'昨天'
,
value
:
()
=>
{
const
start
=
new
Date
()
const
end
=
new
Date
(
new
Date
(
getStartTime
()).
getTime
()
-
1
)
start
.
setTime
(
end
.
getTime
()
-
3600
*
1000
*
24
*
1
+
1
)
return
[
start
,
end
]
}
,
}
,
{
text
:
'最近7天'
,
value
:
()
=>
{
const
end
=
new
Date
()
const
start
=
new
Date
(
getStartTime
())
start
.
setTime
(
start
.
getTime
()
-
3600
*
1000
*
24
*
6
)
return
[
start
,
end
]
}
,
}
,
{
text
:
'最近14天'
,
value
:
()
=>
{
const
end
=
new
Date
()
const
start
=
new
Date
(
getStartTime
())
start
.
setTime
(
start
.
getTime
()
-
3600
*
1000
*
24
*
13
)
return
[
start
,
end
]
}
,
}
,
{
text
:
'最近30天'
,
value
:
()
=>
{
const
end
=
new
Date
()
const
start
=
new
Date
(
getStartTime
())
start
.
setTime
(
start
.
getTime
()
-
3600
*
1000
*
24
*
29
)
return
[
start
,
end
]
}
,
}
,
{
text
:
'本星期'
,
value
:
()
=>
{
const
end
=
new
Date
()
const
start
=
new
Date
()
const
nowDay
=
new
Date
().
getDay
()
-
1
start
.
setTime
(
new
Date
(
getStartTime
()).
getTime
()
-
3600
*
1000
*
24
*
nowDay
,
)
return
[
start
,
end
]
}
,
}
,
{
text
:
'上星期'
,
value
:
()
=>
{
const
end
=
new
Date
()
const
start
=
new
Date
()
const
nowDay
=
new
Date
().
getDay
()
-
1
end
.
setTime
(
new
Date
(
getStartTime
()).
getTime
()
-
3600
*
1000
*
24
*
nowDay
-
1
,
)
start
.
setTime
(
end
.
getTime
()
-
3600
*
1000
*
24
*
7
+
1
)
return
[
start
,
end
]
}
,
}
,
{
text
:
'这个月'
,
value
:
()
=>
{
const
end
=
new
Date
()
const
start
=
new
Date
()
const
nowDate
=
new
Date
().
getDate
()
-
1
start
.
setTime
(
new
Date
(
getStartTime
()).
getTime
()
-
3600
*
1000
*
24
*
nowDate
,
)
return
[
start
,
end
]
}
,
}
,
{
text
:
'上个月'
,
value
:
()
=>
{
const
date
=
new
Date
()
let
year
=
date
.
getFullYear
()
let
month
=
date
.
getMonth
()
const
end
=
new
Date
(
new
Date
(
`${year
}
-${month + 1
}
-1 00:00:00`
).
getTime
()
-
1
,
)
if
(
month
===
0
)
{
month
=
12
year
=
year
-
1
}
const
start
=
new
Date
(
new
Date
(
`${year
}
-${month
}
-1 00:00:00`
).
getTime
(),
)
return
[
start
,
end
]
}
,
}
,
{
text
:
'历史'
,
value
:
()
=>
{
return
[
''
,
''
]
}
,
}
,
],
}
const
treeData
=
ref
<
LogisticsTrackingTree
[]
>
()
const
treeRef
=
ref
<
InstanceType
<
typeof
ElTree
>>
()
const
tableRef
=
ref
<
{
internalIsMore
?:
boolean
}
>
()
...
...
@@ -183,6 +320,19 @@ const tableColumns = computed(() => {
align
:
'center'
,
}
,
{
label
:
'创建时间'
,
prop
:
'createTime'
,
width
:
200
,
align
:
'center'
,
}
,
{
label
:
'发货时效(天)'
,
prop
:
'shippingAge'
,
slot
:
'shippingAge'
,
width
:
120
,
align
:
'center'
,
}
,
{
label
:
'订单状态'
,
prop
:
'orderStatus'
,
slot
:
'orderStatus'
,
...
...
@@ -261,13 +411,38 @@ const getTree = async () => {
console
.
error
(
e
)
}
}
/** 计算发货时效(天)
* 已签收 → 停止计时
* <12h = 0天;≥12h & <24h = 1天;≥48h = 2天 ...
*/
function
getShippingAge
(
row
:
ILogisticsCompany
):
number
{
// 成功签收就固定: 已签收时间 - 创建时间
if
(
row
.
orderStatus
===
'COMPLETE'
)
{
const
signTime
=
new
Date
(
row
.
signTime
??
0
).
getTime
()
const
createTime
=
new
Date
(
row
.
createTime
??
0
).
getTime
()
return
msToDays
(
signTime
-
createTime
)
}
// 未签收:当前时间 - 创建时间
const
now
=
Date
.
now
()
const
create
=
new
Date
(
row
.
createTime
??
0
).
getTime
()
return
msToDays
(
now
-
create
)
}
/** 毫秒 → 天数(≥12h 向上取整) */
function
msToDays
(
ms
:
number
):
number
{
const
hours
=
ms
/
(
1000
*
60
*
60
)
if
(
hours
<
12
)
return
0
return
Math
.
ceil
(
hours
/
24
)
}
// 列表查询
async
function
getData
()
{
const
res
=
await
logisticsTrackingPage
({
trackingStatus
:
nodeId
.
value
,
shopNumber
:
searchForm
.
value
.
shopNumber
,
trackNumber
:
searchForm
.
value
.
trackNumber
,
startTime
:
tradingTime
.
value
&&
tradingTime
.
value
[
0
],
endTime
:
tradingTime
.
value
&&
tradingTime
.
value
[
1
],
queryDateType
:
tradingTime
.
value
&&
1
,
}
)
leftData
.
value
=
res
.
data
.
records
pagination
.
value
.
total
=
res
.
data
.
total
...
...
src/views/logistics/types/logistics.ts
View file @
3209488d
...
...
@@ -59,4 +59,7 @@ export interface LogisticsTrackingParams {
trackNumber
?:
number
|
string
shopNumber
?:
string
|
number
trackingStatus
?:
number
startTime
?:
string
endTime
?:
string
queryDateType
?:
number
|
string
}
src/views/order/podUsSchedulingRules/index.vue
View file @
3209488d
...
...
@@ -307,7 +307,6 @@ import { debounce } from 'lodash-es'
const
editForm
=
ref
<
BaseForm
>
({
isAuto
:
false
,
status
:
'ACTIVE'
})
const
tableData
=
ref
([])
import
userUserStore
from
'@/store/user'
import
{
tr
}
from
'element-plus/es/locales.mjs'
const
userStore
=
userUserStore
()
const
userInfo
=
userStore
.
user
const
loading
=
ref
(
false
)
...
...
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