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
434394e6
Commit
434394e6
authored
Jun 16, 2025
by
wuqian
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wq' into dev
parents
7f9a1976
422dd729
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
2 deletions
+59
-2
src/types/api/podUsOrder.ts
+2
-1
src/views/order/podUs/index.vue
+57
-1
No files found.
src/types/api/podUsOrder.ts
View file @
434394e6
...
...
@@ -18,7 +18,7 @@ export interface SearchForm {
endTime
:
string
|
null
exceptionHandling
:
number
|
undefined
platform
:
string
productionClient
:
string
productionClient
:
string
}
export
interface
PodUsOrderListData
{
id
:
number
...
...
@@ -92,6 +92,7 @@ export interface ProductList {
tagIds
?:
string
isProduction
?:
boolean
createTime
?:
string
startStockingTime
?:
string
|
null
updateTime
?:
string
remark
?:
string
|
null
version
?:
number
...
...
src/views/order/podUs/index.vue
View file @
434394e6
...
...
@@ -674,6 +674,15 @@
{{
row
.
lanshouAddress
}}
</span>
</div>
<div
v-if=
"['TO_BE_CONFIRMED', 'STOCK_OUT'].includes(status)"
class=
"order-detail-item"
>
<span
class=
"order-detail-item-label"
>
订单延期时间:
</span>
<span
class=
"order-detail-item-value red-time"
>
{{
calculateDelayTime
(
row
)
}}
</span>
</div>
</div>
</
template
>
<
template
#
price=
"{ row }"
>
...
...
@@ -1246,7 +1255,7 @@ import { useValue } from '@/utils/hooks/useValue'
import
{
showConfirm
}
from
'@/utils/ui'
import
{
DocumentCopy
,
EditPen
}
from
'@element-plus/icons-vue'
import
{
Column
,
ElFormItem
}
from
'element-plus'
import
{
computed
,
onMounted
,
ref
,
nextTick
}
from
'vue'
import
{
computed
,
onMounted
,
ref
,
nextTick
,
onBeforeUnmount
}
from
'vue'
import
FastProduction
from
'./FastProduction.vue'
import
{
filePath
}
from
'@/api/axios'
import
PodMakeOrder
from
'./PodMakeOrder.vue'
...
...
@@ -2522,13 +2531,56 @@ const refreshMaterial = async () => {
loading
.
close
()
}
}
// 当前时间响应式变量(每60秒更新一次)
const
currentTime
=
ref
(
new
Date
())
// 定时器实例
let
timer
:
number
|
null
=
null
onMounted
(()
=>
{
loadTabData
()
getUserMark
()
loadProductionClient
()
loadWarehouseList
()
// 每60秒更新一次当前时间
timer
=
window
.
setInterval
(()
=>
{
currentTime
.
value
=
new
Date
()
}
,
60000
)
}
)
// 计算时间差(小时数)并向上取整
const
calculateHoursDifference
=
(
startDateString
?:
string
):
string
=>
{
if
(
!
startDateString
)
return
'--'
try
{
const
startTime
=
new
Date
(
startDateString
)
const
diffInMs
=
currentTime
.
value
.
getTime
()
-
startTime
.
getTime
()
// 转换为小时并取整:ceil向上或者round:四舍五入
const
hours
=
Math
.
round
(
diffInMs
/
(
1000
*
60
*
60
))
return
`${hours
}
小时`
}
catch
(
error
)
{
console
.
error
(
'日期解析错误:'
,
error
)
return
'--'
}
}
// 根据订单状态计算延期时间
const
calculateDelayTime
=
computed
(()
=>
(
row
:
ProductList
)
=>
{
switch
(
status
.
value
)
{
case
'TO_BE_CONFIRMED'
:
return
row
.
createTime
?
calculateHoursDifference
(
row
.
createTime
)
:
'--'
case
'STOCK_OUT'
:
return
row
.
startStockingTime
?
calculateHoursDifference
(
row
.
startStockingTime
)
:
'--'
default
:
return
'--'
}
}
)
onBeforeUnmount
(()
=>
{
// 组件卸载时清除定时器
if
(
timer
)
{
clearInterval
(
timer
)
timer
=
null
}
}
)
const
handleExceptionCommand
=
(
command
:
number
)
=>
{
exceptionStatus
.
value
=
command
search
()
...
...
@@ -2614,6 +2666,10 @@ const handleExceptionCommand = (command: number) => {
text
-
overflow
:
ellipsis
;
white
-
space
:
nowrap
;
}
.
red
-
time
{
color
:
red
;
font
-
weight
:
bold
;
}
}
.
card
-
list
{
...
...
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