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
f5bb4f4e
Commit
f5bb4f4e
authored
Apr 15, 2026
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 时间添加排序
parent
663cd9c1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
5 deletions
+83
-5
src/types/api/factoryOrderNew.ts
+4
-0
src/types/api/order/factoryOrderNew.ts
+4
-0
src/views/order/factoryOrderNew/hooks/useOrderListAndDetail.ts
+64
-2
src/views/order/factoryOrderNew/index.vue
+11
-3
No files found.
src/types/api/factoryOrderNew.ts
View file @
f5bb4f4e
...
...
@@ -38,6 +38,10 @@ export interface SearchForm {
productMarkList
?:
string
[]
podCustomizedQuantity
?:
string
cpCustomizedQuantity
?:
string
/** list_page 排序字段,需与 order 同时传递 */
prop
?:
string
/** list_page 排序方向:asc 正序,desc 倒序 */
order
?:
'asc'
|
'desc'
}
export
interface
FactoryOrderNewListData
{
...
...
src/types/api/order/factoryOrderNew.ts
View file @
f5bb4f4e
...
...
@@ -42,6 +42,10 @@ export interface SearchForm {
/** list_page:一件定制局部印单面/多面,与 productMarkList 中 custom_part 联动 */
cpCustomizedQuantity
?:
string
operationNo
?:
string
/** list_page 排序字段,需与 order 同时传递 */
prop
?:
string
/** list_page 排序方向:asc 正序,desc 倒序 */
order
?:
'asc'
|
'desc'
}
export
interface
FactoryOrderNewListData
{
...
...
src/views/order/factoryOrderNew/hooks/useOrderListAndDetail.ts
View file @
f5bb4f4e
...
...
@@ -7,6 +7,7 @@ import {
getFactoryOrderNewLogApi
,
getSuspendListApi
,
}
from
'@/api/factoryOrderNew'
import
type
{
SearchForm
}
from
'@/types/api/factoryOrderNew'
import
type
{
FactoryOrderNewListData
,
LogListData
,
...
...
@@ -43,6 +44,21 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
const
selectedRows
=
ref
<
FactoryOrderNewListData
[]
>
([])
const
cardSelectList
=
ref
<
operateOrderListData
[]
>
([])
const
listSortProp
=
ref
<
string
|
null
>
(
null
)
const
listSortOrder
=
ref
<
'asc'
|
'desc'
|
null
>
(
null
)
const
buildListQueryBody
=
():
SearchForm
=>
{
const
base
=
{
...
getQueryPayload
()
}
as
SearchForm
if
(
listSortProp
.
value
&&
listSortOrder
.
value
)
{
return
{
...
base
,
prop
:
listSortProp
.
value
,
order
:
listSortOrder
.
value
,
}
}
return
base
}
const
{
loading
,
currentPage
,
...
...
@@ -56,7 +72,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
query
:
(
page
,
size
)
=>
{
if
(
status
.
value
===
'SUSPEND'
)
{
return
getSuspendListApi
(
getQueryPayload
(),
buildListQueryBody
(),
page
,
size
,
suspendedSubTab
.
value
,
...
...
@@ -72,7 +88,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
})
}
return
getFactoryOrderNewListApi
(
getQueryPayload
(),
buildListQueryBody
(),
page
,
size
,
status
.
value
===
'ALL'
?
undefined
:
status
.
value
,
...
...
@@ -100,6 +116,51 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
productList
.
value
=
[]
logList
.
value
=
[]
currentRow
.
value
=
null
listSortProp
.
value
=
null
listSortOrder
.
value
=
null
}
const
SORTABLE_COLUMN_PROPS
=
[
'createTime'
,
'startStockingTime'
,
'finishTime'
,
]
as
const
/** 表格列 prop → 后端 list_page 排序字段(如 MyBatis 列别名) */
const
LIST_SORT_PROP_BY_COLUMN
:
Record
<
(
typeof
SORTABLE_COLUMN_PROPS
)[
number
],
string
>
=
{
createTime
:
'po.create_time'
,
startStockingTime
:
'po.start_stocking_time'
,
finishTime
:
'po.finish_time'
,
}
const
handleMainTableSortChange
=
(
data
:
{
prop
?:
string
order
:
string
|
null
})
=>
{
const
{
prop
,
order
}
=
data
if
(
!
prop
||
!
SORTABLE_COLUMN_PROPS
.
includes
(
prop
as
(
typeof
SORTABLE_COLUMN_PROPS
)[
number
],
)
)
{
return
}
const
sortProp
=
LIST_SORT_PROP_BY_COLUMN
[
prop
as
keyof
typeof
LIST_SORT_PROP_BY_COLUMN
]
if
(
order
===
'ascending'
)
{
listSortProp
.
value
=
sortProp
listSortOrder
.
value
=
'asc'
}
else
if
(
order
===
'descending'
)
{
listSortProp
.
value
=
sortProp
listSortOrder
.
value
=
'desc'
}
else
{
listSortProp
.
value
=
null
listSortOrder
.
value
=
null
}
refreshTableList
()
}
const
handleMainSelectionChange
=
(
rows
:
FactoryOrderNewListData
[])
=>
{
...
...
@@ -197,5 +258,6 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
getOrderDetailsById
,
handleRowClick
,
handleTabClick
,
handleMainTableSortChange
,
}
}
src/views/order/factoryOrderNew/index.vue
View file @
f5bb4f4e
...
...
@@ -674,6 +674,7 @@
serial
-
numberable
selectionable
@
selection
-
change
=
"handleMainSelectionChange"
@
sort
-
change
=
"handleMainTableSortChange"
@
row
-
click
=
"handleRowClick"
>
<
template
#
operation
=
"{ row
}
"
>
...
...
@@ -1046,6 +1047,7 @@ const {
getOrderDetailsById
,
handleRowClick
,
handleTabClick
,
handleMainTableSortChange
,
}
=
useOrderListAndDetail
({
status
,
isCardLayout
,
...
...
@@ -1272,18 +1274,24 @@ const mainColumns = computed(() => [
)
}
,
}
,
{
prop
:
'createTime'
,
label
:
'创建时间'
,
minWidth
:
180
,
align
:
'center'
}
,
{
prop
:
'createTime'
,
label
:
'创建时间'
,
minWidth
:
180
,
align
:
'center'
,
sortable
:
'custom'
,
}
,
{
prop
:
'startStockingTime'
,
label
:
'接单时间'
,
sortable
:
true
,
sortable
:
'custom'
,
minWidth
:
180
,
align
:
'center'
,
}
,
{
prop
:
'finishTime'
,
label
:
'完成时间'
,
sortable
:
true
,
sortable
:
'custom'
,
minWidth
:
180
,
}
,
{
...
...
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