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
17e3c2c4
Commit
17e3c2c4
authored
Mar 25, 2026
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 调用接口
parent
70fb178e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
21 deletions
+41
-21
src/api/factoryOrderNew.ts
+9
-2
src/types/api/factoryOrderNew.ts
+5
-0
src/views/order/factoryOrderNew/component/CardLayout.vue
+7
-11
src/views/order/factoryOrderNew/index.vue
+20
-8
No files found.
src/api/factoryOrderNew.ts
View file @
17e3c2c4
...
@@ -38,7 +38,7 @@ export function getFactoryOrderNewListApi(
...
@@ -38,7 +38,7 @@ export function getFactoryOrderNewListApi(
export
function
getFactoryOrderNewDetailApi
(
id
:
number
|
string
)
{
export
function
getFactoryOrderNewDetailApi
(
id
:
number
|
string
)
{
return
axios
.
get
<
never
,
BaseRespData
<
ProductListData
[]
>>
(
return
axios
.
get
<
never
,
BaseRespData
<
ProductListData
[]
>>
(
'factory/podOrder
/get
'
,
'factory/podOrder
Product/getListByPodOrderId
'
,
{
{
params
:
{
id
},
params
:
{
id
},
},
},
...
@@ -47,7 +47,7 @@ export function getFactoryOrderNewDetailApi(id: number | string) {
...
@@ -47,7 +47,7 @@ export function getFactoryOrderNewDetailApi(id: number | string) {
export
function
getFactoryOrderNewLogApi
(
id
:
number
|
string
)
{
export
function
getFactoryOrderNewLogApi
(
id
:
number
|
string
)
{
return
axios
.
get
<
never
,
BaseRespData
<
LogListData
[]
>>
(
return
axios
.
get
<
never
,
BaseRespData
<
LogListData
[]
>>
(
'factory/podOrder
/get
Log'
,
'factory/podOrder
Log/getPodOrder
Log'
,
{
{
params
:
{
id
},
params
:
{
id
},
},
},
...
@@ -275,6 +275,13 @@ export function downloadMaterialApi(id: number[]) {
...
@@ -275,6 +275,13 @@ export function downloadMaterialApi(id: number[]) {
)
)
}
}
export
function
downloadOperationMaterialApi
(
id
:
number
[])
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'factory/podOrderOperation/downloadDesignImages'
,
id
,
)
}
export
function
downloadBatchMaterialApi
(
id
:
number
|
string
)
{
export
function
downloadBatchMaterialApi
(
id
:
number
|
string
)
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'factory/podOrderBatchDownload/download'
,
'factory/podOrderBatchDownload/download'
,
...
...
src/types/api/factoryOrderNew.ts
View file @
17e3c2c4
...
@@ -106,6 +106,11 @@ export interface ProductListData {
...
@@ -106,6 +106,11 @@ export interface ProductListData {
customsValue
?:
number
customsValue
?:
number
remark
?:
string
remark
?:
string
}
}
export
interface
operateOrderListData
{
id
:
number
podOrderProductId
:
number
[
key
:
string
]:
unknown
}
export
interface
LogListData
{
export
interface
LogListData
{
id
:
number
id
:
number
...
...
src/views/order/factoryOrderNew/component/CardLayout.vue
View file @
17e3c2c4
...
@@ -135,11 +135,7 @@ import { ElMessage } from 'element-plus'
...
@@ -135,11 +135,7 @@ import { ElMessage } from 'element-plus'
import
{
getCardLayoutListApi
}
from
'@/api/factoryOrderNew'
import
{
getCardLayoutListApi
}
from
'@/api/factoryOrderNew'
import
type
{
PaginationData
}
from
'@/types/api'
import
type
{
PaginationData
}
from
'@/types/api'
import
usePageList
from
'@/utils/hooks/usePageList'
import
usePageList
from
'@/utils/hooks/usePageList'
import
{
operateOrderListData
}
from
'@/types/api/factoryOrderNew'
interface
CardItem
{
id
:
number
|
string
[
key
:
string
]:
unknown
}
const
props
=
defineProps
<
{
const
props
=
defineProps
<
{
status
:
string
status
:
string
...
@@ -148,7 +144,7 @@ const props = defineProps<{
...
@@ -148,7 +144,7 @@ const props = defineProps<{
}
>
()
}
>
()
const
emit
=
defineEmits
<
{
const
emit
=
defineEmits
<
{
'selection-change'
:
[
items
:
CardItem
[]]
'selection-change'
:
[
items
:
operateOrderListData
[]]
}
>
()
}
>
()
const
{
const
{
...
@@ -160,7 +156,7 @@ const {
...
@@ -160,7 +156,7 @@ const {
onCurrentPageChange
,
onCurrentPageChange
,
onPageSizeChange
,
onPageSizeChange
,
refresh
,
refresh
,
}
=
usePageList
<
CardItem
>
({
}
=
usePageList
<
operateOrderListData
>
({
initPageSize
:
props
.
initPageSize
||
100
,
initPageSize
:
props
.
initPageSize
||
100
,
query
:
async
(
current
,
size
)
=>
{
query
:
async
(
current
,
size
)
=>
{
const
payload
=
{
const
payload
=
{
...
@@ -168,16 +164,16 @@ const {
...
@@ -168,16 +164,16 @@ const {
statusCode
:
props
.
status
===
'ALL'
?
undefined
:
props
.
status
,
statusCode
:
props
.
status
===
'ALL'
?
undefined
:
props
.
status
,
}
}
const
res
=
await
getCardLayoutListApi
(
payload
,
current
,
size
)
const
res
=
await
getCardLayoutListApi
(
payload
,
current
,
size
)
return
res
.
data
as
unknown
as
PaginationData
<
CardItem
>
return
res
.
data
as
unknown
as
PaginationData
<
operateOrderListData
>
},
},
})
})
const
selectedItems
=
ref
<
CardItem
[]
>
([])
const
selectedItems
=
ref
<
operateOrderListData
[]
>
([])
const
isSelected
=
(
item
:
CardItem
)
=>
const
isSelected
=
(
item
:
operateOrderListData
)
=>
selectedItems
.
value
.
some
((
s
)
=>
s
.
id
===
item
.
id
)
selectedItems
.
value
.
some
((
s
)
=>
s
.
id
===
item
.
id
)
const
handleCardClick
=
(
item
:
CardItem
)
=>
{
const
handleCardClick
=
(
item
:
operateOrderListData
)
=>
{
const
idx
=
selectedItems
.
value
.
findIndex
((
s
)
=>
s
.
id
===
item
.
id
)
const
idx
=
selectedItems
.
value
.
findIndex
((
s
)
=>
s
.
id
===
item
.
id
)
if
(
idx
>=
0
)
{
if
(
idx
>=
0
)
{
selectedItems
.
value
.
splice
(
idx
,
1
)
selectedItems
.
value
.
splice
(
idx
,
1
)
...
...
src/views/order/factoryOrderNew/index.vue
View file @
17e3c2c4
...
@@ -868,6 +868,7 @@ import type { BaseRespData } from '@/types/api'
...
@@ -868,6 +868,7 @@ import type { BaseRespData } from '@/types/api'
import
type
{
import
type
{
FactoryOrderNewListData
,
FactoryOrderNewListData
,
LogListData
,
LogListData
,
operateOrderListData
,
ProductListData
,
ProductListData
,
SearchForm
,
SearchForm
,
StatusTreeNode
,
StatusTreeNode
,
...
@@ -891,6 +892,7 @@ import {
...
@@ -891,6 +892,7 @@ import {
getfaceSimplexFileApi
,
getfaceSimplexFileApi
,
cancelLogisticsOrderApi
,
cancelLogisticsOrderApi
,
downloadMaterialApi
,
downloadMaterialApi
,
downloadOperationMaterialApi
,
composingNewPodOrderDesignImages
,
composingNewPodOrderDesignImages
,
printNewPodOrderProductionOrderApi
,
printNewPodOrderProductionOrderApi
,
syncReceiverAddress
,
syncReceiverAddress
,
...
@@ -1138,7 +1140,7 @@ const productList = ref<ProductListData[]>([])
...
@@ -1138,7 +1140,7 @@ const productList = ref<ProductListData[]>([])
const
currentRow
=
ref
<
FactoryOrderNewListData
|
null
>
(
null
)
const
currentRow
=
ref
<
FactoryOrderNewListData
|
null
>
(
null
)
const
selectedRowIds
=
ref
<
(
number
|
string
)[]
>
([])
const
selectedRowIds
=
ref
<
(
number
|
string
)[]
>
([])
const
selectedRows
=
ref
<
FactoryOrderNewListData
[]
>
([])
const
selectedRows
=
ref
<
FactoryOrderNewListData
[]
>
([])
const
cardSelect
edIds
=
ref
<
(
number
|
string
)
[]
>
([])
const
cardSelect
List
=
ref
<
operateOrderListData
[]
>
([])
const
logList
=
ref
<
LogListData
[]
>
([])
const
logList
=
ref
<
LogListData
[]
>
([])
const
tableRef
=
ref
()
const
tableRef
=
ref
()
const
mainColumns
=
[
const
mainColumns
=
[
...
@@ -1444,7 +1446,7 @@ const createLogisticDialogRef = ref()
...
@@ -1444,7 +1446,7 @@ const createLogisticDialogRef = ref()
const
updateCustomsDialogVisible
=
ref
(
false
)
const
updateCustomsDialogVisible
=
ref
(
false
)
const
weightDialogRef
=
ref
()
const
weightDialogRef
=
ref
()
const
getSelectedIds
=
():
(
number
|
string
)[]
=>
{
const
getSelectedIds
=
():
(
number
|
string
)[]
=>
{
if
(
isCardLayout
.
value
)
return
cardSelect
edIds
.
value
if
(
isCardLayout
.
value
)
return
cardSelect
List
.
value
.
map
((
item
)
=>
item
.
id
)
return
selectedRowIds
.
value
return
selectedRowIds
.
value
}
}
const
ensureSelection
=
(
msg
=
'请先选择订单'
):
boolean
=>
{
const
ensureSelection
=
(
msg
=
'请先选择订单'
):
boolean
=>
{
...
@@ -1480,7 +1482,7 @@ const handleStatusNodeClick = (node: StatusTreeNode) => {
...
@@ -1480,7 +1482,7 @@ const handleStatusNodeClick = (node: StatusTreeNode) => {
}
}
selectedRowIds
.
value
=
[]
selectedRowIds
.
value
=
[]
selectedRows
.
value
=
[]
selectedRows
.
value
=
[]
cardSelect
edIds
.
value
=
[]
cardSelect
List
.
value
=
[]
productList
.
value
=
[]
productList
.
value
=
[]
logList
.
value
=
[]
logList
.
value
=
[]
currentRow
.
value
=
null
currentRow
.
value
=
null
...
@@ -1515,8 +1517,8 @@ const handleMainSelectionChange = (rows: FactoryOrderNewListData[]) => {
...
@@ -1515,8 +1517,8 @@ const handleMainSelectionChange = (rows: FactoryOrderNewListData[]) => {
selectedRowIds
.
value
=
rows
.
map
((
row
)
=>
row
.
id
)
selectedRowIds
.
value
=
rows
.
map
((
row
)
=>
row
.
id
)
selectedRows
.
value
=
rows
selectedRows
.
value
=
rows
}
}
const
handleCardSelectionChange
=
(
items
:
{
id
:
number
|
string
}
[])
=>
{
const
handleCardSelectionChange
=
(
items
:
operateOrderListData
[])
=>
{
cardSelect
edIds
.
value
=
items
.
map
((
i
)
=>
i
.
id
)
cardSelect
List
.
value
=
items
}
}
const
getOrderDetailsById
=
async
(
tabName
?:
'product'
|
'log'
)
=>
{
const
getOrderDetailsById
=
async
(
tabName
?:
'product'
|
'log'
)
=>
{
if
(
!
currentRow
.
value
)
{
if
(
!
currentRow
.
value
)
{
...
@@ -1556,7 +1558,7 @@ const handleRowClick = (row: FactoryOrderNewListData) => {
...
@@ -1556,7 +1558,7 @@ const handleRowClick = (row: FactoryOrderNewListData) => {
logList
.
value
=
[]
logList
.
value
=
[]
selectedRowIds
.
value
=
[]
selectedRowIds
.
value
=
[]
selectedRows
.
value
=
[]
selectedRows
.
value
=
[]
cardSelect
edIds
.
value
=
[]
cardSelect
List
.
value
=
[]
}
}
const
handleTabClick
=
(
tab
:
TabsPaneContext
)
=>
{
const
handleTabClick
=
(
tab
:
TabsPaneContext
)
=>
{
...
@@ -1849,14 +1851,24 @@ const downloadPDF = (url: string) => {
...
@@ -1849,14 +1851,24 @@ const downloadPDF = (url: string) => {
}
}
const
handleDownloadMaterial
=
async
()
=>
{
const
handleDownloadMaterial
=
async
()
=>
{
if
(
!
ensureSelection
())
return
if
(
!
ensureSelection
())
return
const
ids
=
getSelectedIds
()
const
usePodOrderDownloadStatuses
=
[
'PENDING_SCHEDULE'
,
'PENDING_DELIVERY'
,
'SUSPEND'
]
const
usePodOrderDownload
=
usePodOrderDownloadStatuses
.
includes
(
status
.
value
)
const
ids
=
usePodOrderDownload
?
selectedRows
.
value
.
map
((
row
)
=>
row
.
id
)
:
cardSelectList
.
value
.
map
((
row
)
=>
row
.
podOrderProductId
)
if
(
!
ids
.
length
)
{
ElMessage
.
warning
(
'未获取到可下载的素材ID'
)
return
}
const
loading
=
ElLoading
.
service
({
const
loading
=
ElLoading
.
service
({
fullscreen
:
true
,
fullscreen
:
true
,
text
:
'操作中...'
,
text
:
'操作中...'
,
background
:
'rgba(0, 0, 0, 0.3)'
,
background
:
'rgba(0, 0, 0, 0.3)'
,
}
)
}
)
try
{
try
{
const
res
=
await
downloadMaterialApi
(
ids
as
number
[])
const
res
=
usePodOrderDownload
?
await
downloadMaterialApi
(
ids
as
number
[])
:
await
downloadOperationMaterialApi
(
ids
as
number
[])
if
(
res
.
message
)
{
if
(
res
.
message
)
{
const
a
=
document
.
createElement
(
'a'
)
const
a
=
document
.
createElement
(
'a'
)
a
.
href
=
filePath
+
res
.
message
a
.
href
=
filePath
+
res
.
message
...
...
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