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
be5de7ac
Commit
be5de7ac
authored
May 25, 2026
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 订单拦截功能接口联调
parent
c7d581fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
70 deletions
+104
-70
src/api/factoryOrderNew.ts
+9
-10
src/views/order/factoryOrderNew/hooks/useOrderBatchActions.ts
+5
-2
src/views/order/factoryOrderNew/index.vue
+90
-58
No files found.
src/api/factoryOrderNew.ts
View file @
be5de7ac
...
...
@@ -116,9 +116,9 @@ export function getFactoryOrderNewLogApi(id: number | string) {
}
export
function
getOperationOrderByIdApi
(
id
:
number
|
string
)
{
return
axios
.
get
<
never
,
BaseRespData
<
operateOrderListData
[]
>>
(
'factory/podOrder
/getOperationOrderBy
Id'
,
'factory/podOrder
Operation/getByPodOrder
Id'
,
{
params
:
{
id
},
params
:
{
podOrderId
:
id
},
},
)
}
...
...
@@ -632,18 +632,17 @@ export function exportFactoryOrderInfo(data: ExportParams) {
}
export
function
interceptUpdateApi
(
ids
:
(
string
|
number
)[])
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'factory/podOrder/
interceptUpdate
'
,
return
axios
.
post
<
never
,
BaseRespData
<
ResultInfoDataItem
[]
>>
(
'factory/podOrder/
factoryOrderUnblock
'
,
ids
,
)
}
export
function
interceptSuccessApi
(
data
:
{
ids
:
(
string
|
number
)[]
interceptType
:
number
})
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'factory/podOrder/interceptSuccess'
,
export
function
interceptSuccessApi
(
data
:
{
factoryOrderNumber
:
string
;
suspendSussessType
:
number
}[],
)
{
return
axios
.
post
<
never
,
BaseRespData
<
ResultInfoDataItem
[]
>>
(
'factory/podOrder/factoryOrderBlockSuccess'
,
data
,
)
}
src/views/order/factoryOrderNew/hooks/useOrderBatchActions.ts
View file @
be5de7ac
...
...
@@ -50,8 +50,11 @@ export function useOrderBatchActions(options: UseOrderBatchActionsOptions) {
const
res
=
await
action
.
api
(
ids
)
if
(
res
.
code
!==
200
)
return
if
(
action
.
successText
)
ElMessage
.
success
(
action
.
successText
)
if
(
action
.
onSuccess
)
await
action
.
onSuccess
(
res
)
await
refreshCurrentView
({
isRefreshTree
:
!!
action
.
refreshTree
})
if
(
action
.
onSuccess
)
{
await
action
.
onSuccess
(
res
)
}
else
{
await
refreshCurrentView
({
isRefreshTree
:
!!
action
.
refreshTree
})
}
if
(
action
.
onAfter
)
await
action
.
onAfter
()
}
catch
(
e
)
{
console
.
error
(
e
)
...
...
src/views/order/factoryOrderNew/index.vue
View file @
be5de7ac
...
...
@@ -597,12 +597,12 @@
>
<
/span
>
<
span
class
=
"item"
>
<
ElButton
type
=
"success"
@
click
=
"
handleInterceptionSuccess
"
<
ElButton
type
=
"success"
@
click
=
"
() => handleInterceptionSuccess()
"
>
拦截成功
<
/ElButto
n
>
<
/span
>
<
span
class
=
"item"
>
<
ElButton
type
=
"danger"
@
click
=
"
handleInterceptionFail
"
<
ElButton
type
=
"danger"
@
click
=
"
() => handleInterceptionFail()
"
>
拦截失败
<
/ElButto
n
>
<
/span
>
...
...
@@ -676,7 +676,7 @@
<
/div
>
<
/div
>
<
div
v
-
if
=
"status === 'CANCELLED'"
class
=
"status-subtabs"
>
<
!--
<
div
v
-
if
=
"status === 'CANCELLED'"
class
=
"status-subtabs"
>
<
div
v
-
for
=
"tab in cancelledTabs"
:
key
=
"tab.value"
...
...
@@ -686,7 +686,7 @@
>
{{
tab
.
label
}}
({{
tab
.
count
||
0
}}
)
<
/div
>
<
/div
>
<
/div>
--
>
<
div
v
-
if
=
"status === 'PENDING_RECEIVE'"
class
=
"status-subtabs"
>
<
div
...
...
@@ -805,6 +805,24 @@
>
取消挂起
<
/ElButton
>
<
ElButton
v
-
if
=
"status === 'SUSPEND'"
type
=
"primary"
link
size
=
"small"
@
click
.
stop
=
"handleInterceptionSuccess(row)"
>
拦截成功
<
/ElButton
>
<
ElButton
v
-
if
=
"status === 'SUSPEND'"
type
=
"primary"
link
size
=
"small"
@
click
.
stop
=
"handleInterceptionFail(row)"
>
拦截失败
<
/ElButton
>
<
/div
>
<
/template
>
<
/TableView
>
...
...
@@ -1007,7 +1025,7 @@
<
ElForm
ref
=
"interceptSuccessFormRef"
:
model
=
"interceptSuccessForm"
>
<
ElFormItem
label
=
"拦截成功类型"
prop
=
"
intercept
Type"
prop
=
"
suspendSussess
Type"
:
rules
=
"[
{
required: true,
...
...
@@ -1017,7 +1035,7 @@
]"
>
<
ElSelect
v
-
model
=
"interceptSuccessForm.
intercept
Type"
v
-
model
=
"interceptSuccessForm.
suspendSussess
Type"
placeholder
=
"请选择"
style
=
"width: 100%"
clearable
...
...
@@ -1177,9 +1195,10 @@ const interceptSuccessTypeOptions = [
{
label
:
'生产拦截成功'
,
value
:
1
}
,
{
label
:
'发货拦截成功'
,
value
:
2
}
,
]
const
interceptSuccessForm
=
ref
<
{
intercept
Type
:
number
|
undefined
}
>
({
intercept
Type
:
undefined
,
const
interceptSuccessForm
=
ref
<
{
suspendSussess
Type
:
number
|
undefined
}
>
({
suspendSussess
Type
:
undefined
,
}
)
const
interceptSuccessRows
=
ref
<
FactoryOrderNewListData
[]
>
([])
const
{
userMarkList
,
...
...
@@ -1224,7 +1243,7 @@ const {
pendingAcceptCounts
,
suspendedTabs
,
suspendedSubTab
,
cancelledTabs
,
//
cancelledTabs,
cancelledSubTab
,
treeRef
,
isCardLayout
,
...
...
@@ -1233,7 +1252,7 @@ const {
getListPageAcceptedSubStatus
,
getPendingReceiveCounts
,
getSuspendCounts
,
getCancelledCounts
,
//
getCancelledCounts,
loadStatusTreeCounts
,
handlePendingAcceptTabClick
:
handlePendingAcceptTabClickRaw
,
toggleExpand
,
...
...
@@ -1400,9 +1419,9 @@ const refreshCurrentView = (options?: { isRefreshTree?: boolean }) => {
if
(
status
.
value
===
'SUSPEND'
)
{
void
getSuspendCounts
()
}
if
(
status
.
value
===
'CANCELLED'
)
{
void
getCancelledCounts
()
}
//
if (status.value === 'CANCELLED')
{
//
void getCancelledCounts()
//
}
refreshTableList
()
}
refreshCurrentViewProxy
.
value
=
()
=>
refreshCurrentView
()
...
...
@@ -1520,13 +1539,13 @@ const handleSuspendTabClick = (value: number) => {
statusCurrentPageRef
.
value
=
1
refreshTableList
()
}
const
handleCancelledTabClick
=
(
value
:
number
)
=>
{
if
(
cancelledSubTab
.
value
===
value
)
return
cancelledSubTab
.
value
=
value
currentPage
.
value
=
1
statusCurrentPageRef
.
value
=
1
refreshTableList
()
}
//
const handleCancelledTabClick = (value: number) =>
{
//
if (cancelledSubTab.value === value) return
//
cancelledSubTab.value = value
//
currentPage.value = 1
//
statusCurrentPageRef.value = 1
//
refreshTableList()
//
}
const
mainColumns
=
computed
(()
=>
[
{
prop
:
'factoryOrderNumber'
,
...
...
@@ -1711,10 +1730,9 @@ function parseOperationOrderImageAry(
}
function
getOperationOrderMarkLabel
(
row
:
operateOrderListData
):
string
{
const
raw
=
row
[
'prodcutMark'
]
??
row
.
productMark
const
mark
=
typeof
raw
===
'string'
?
raw
:
''
if
(
mark
===
'custom_normal'
)
return
'CB'
if
(
mark
===
'normal'
)
return
'G'
const
mark
=
row
.
customizedQuantity
if
(
mark
===
1
)
return
'单面'
if
(
mark
===
2
)
return
'双面'
return
''
}
...
...
@@ -1732,7 +1750,7 @@ const operationOrderColumns = [
prop
:
'imageAry'
,
label
:
'商品图片'
,
minWidth
:
100
,
align
:
'center'
as
const
,
align
:
'center'
,
render
:
(
row
:
operateOrderListData
)
=>
{
const
list
=
parseOperationOrderImageAry
(
row
.
imageAry
)
if
(
!
list
.
length
)
{
...
...
@@ -1760,7 +1778,7 @@ const operationOrderColumns = [
prop
:
'productName'
,
label
:
'商品名称'
,
minWidth
:
180
,
align
:
'left'
as
const
,
align
:
'left'
,
showOverflowTooltip
:
true
,
}
,
{
...
...
@@ -1768,7 +1786,7 @@ const operationOrderColumns = [
prop
:
'variantSku'
,
label
:
'变体SKU'
,
minWidth
:
140
,
align
:
'center'
as
const
,
align
:
'center'
,
showOverflowTooltip
:
true
,
}
,
{
...
...
@@ -1776,7 +1794,7 @@ const operationOrderColumns = [
prop
:
'thirdSkuCode'
,
label
:
'库存SKU'
,
minWidth
:
140
,
align
:
'center'
as
const
,
align
:
'center'
,
showOverflowTooltip
:
true
,
}
,
{
...
...
@@ -1784,11 +1802,11 @@ const operationOrderColumns = [
prop
:
'productMark'
,
label
:
'类型'
,
width
:
72
,
align
:
'center'
as
const
,
align
:
'center'
,
render
:
(
row
:
operateOrderListData
)
=>
{
const
label
=
getOperationOrderMarkLabel
(
row
)
if
(
!
label
)
return
<
span
/>
return
<
ElTag
type
=
"
info
"
>
{
label
}
<
/ElTag
>
return
<
ElTag
type
=
"
primary
"
>
{
label
}
<
/ElTag
>
}
,
}
,
{
...
...
@@ -1796,7 +1814,7 @@ const operationOrderColumns = [
prop
:
'statusName'
,
label
:
'挂起前状态'
,
minWidth
:
120
,
align
:
'
left'
as
const
,
align
:
'
center'
,
showOverflowTooltip
:
true
,
}
,
{
...
...
@@ -1804,7 +1822,7 @@ const operationOrderColumns = [
prop
:
'craftName'
,
label
:
'工艺'
,
minWidth
:
100
,
align
:
'center'
as
const
,
align
:
'center'
,
showOverflowTooltip
:
true
,
}
,
{
...
...
@@ -1812,7 +1830,7 @@ const operationOrderColumns = [
prop
:
'supplierProductNo'
,
label
:
'款号'
,
minWidth
:
120
,
align
:
'center'
as
const
,
align
:
'center'
,
showOverflowTooltip
:
true
,
}
,
{
...
...
@@ -1820,7 +1838,7 @@ const operationOrderColumns = [
prop
:
'batchArrangeNumber'
,
label
:
'批次号'
,
minWidth
:
120
,
align
:
'center'
as
const
,
align
:
'center'
,
showOverflowTooltip
:
true
,
}
,
]
...
...
@@ -2724,19 +2742,11 @@ const handleProductionComplete = async () => {
getIds
:
getSelectedIds
,
api
:
completeDeliveryApi
,
confirmText
:
'确定生产完成吗?'
,
refreshTree
:
true
,
onSuccess
:
(
res
)
=>
{
const
data
=
Array
.
isArray
(
res
.
data
)
?
(
res
.
data
as
ResultInfoDataItem
[])
:
[]
const
hasFailed
=
data
.
some
((
item
)
=>
!
item
.
status
)
if
(
hasFailed
)
{
resultInfo
.
value
=
data
.
filter
((
item
)
=>
!
item
.
status
)
resultRefs
.
value
?.
showDialog
()
}
else
{
ElMessage
.
success
(
'操作成功'
)
refreshCurrentView
({
isRefreshTree
:
true
}
)
}
openResultInfoDialog
(
data
)
}
,
}
)
}
...
...
@@ -2876,9 +2886,14 @@ const getLogisticsWay = async () => {
logisticsWayList
.
value
=
data
}
const
handleInterceptionSuccess
=
()
=>
{
if
(
!
ensureSelection
())
return
interceptSuccessForm
.
value
.
interceptType
=
undefined
const
handleInterceptionSuccess
=
(
row
?:
FactoryOrderNewListData
)
=>
{
if
(
row
)
{
interceptSuccessRows
.
value
=
[
row
]
}
else
{
if
(
!
ensureSelection
())
return
interceptSuccessRows
.
value
=
[...
selectedRows
.
value
]
}
interceptSuccessForm
.
value
.
suspendSussessType
=
undefined
interceptSuccessDialogVisible
.
value
=
true
nextTick
(()
=>
interceptSuccessFormRef
.
value
?.
clearValidate
())
}
...
...
@@ -2891,23 +2906,29 @@ const submitInterceptSuccess = async () => {
}
catch
{
return
}
const
interceptType
=
interceptSuccessForm
.
value
.
intercept
Type
if
(
intercept
Type
===
undefined
)
return
const
suspendSussessType
=
interceptSuccessForm
.
value
.
suspendSussess
Type
if
(
suspendSussess
Type
===
undefined
)
return
const
loading
=
ElLoading
.
service
({
fullscreen
:
true
,
text
:
'操作中...'
,
background
:
'rgba(0, 0, 0, 0.3)'
,
}
)
const
rows
=
interceptSuccessRows
.
value
const
data
=
rows
.
map
((
item
:
FactoryOrderNewListData
)
=>
{
return
{
factoryOrderNumber
:
item
.
factoryOrderNumber
as
string
,
suspendSussessType
,
}
}
)
as
{
factoryOrderNumber
:
string
;
suspendSussessType
:
number
}
[]
try
{
const
res
=
await
interceptSuccessApi
({
ids
:
getSelectedIds
(),
interceptType
,
}
)
const
res
=
await
interceptSuccessApi
(
data
)
if
(
res
.
code
!==
200
)
return
ElMessage
.
success
(
'操作成功'
)
interceptSuccessDialogVisible
.
value
=
false
refreshCurrentView
({
isRefreshTree
:
true
}
)
const
resultData
=
Array
.
isArray
(
res
.
data
)
?
(
res
.
data
as
ResultInfoDataItem
[])
:
[]
openResultInfoDialog
(
resultData
)
}
catch
(
e
)
{
console
.
error
(
e
)
}
finally
{
...
...
@@ -2915,12 +2936,23 @@ const submitInterceptSuccess = async () => {
}
}
const
handleInterceptionFail
=
async
()
=>
{
const
handleInterceptionFail
=
async
(
row
?:
FactoryOrderNewListData
)
=>
{
await
executeBatchAction
({
getIds
:
getSelectedIds
,
api
:
(
ids
)
=>
interceptUpdateApi
(
ids
as
number
[]),
getIds
:
()
=>
row
?
[
row
.
factoryOrderNumber
as
string
]
:
selectedRows
.
value
.
map
(
(
item
:
FactoryOrderNewListData
)
=>
item
.
factoryOrderNumber
as
string
,
),
api
:
(
ids
)
=>
interceptUpdateApi
(
ids
as
string
[]),
confirmText
:
'拦截失败,订单会恢复到拦截前的状态,确认是否拒绝拦截申请?'
,
successText
:
'拦截失败成功'
,
onSuccess
:
(
res
)
=>
{
const
data
=
Array
.
isArray
(
res
.
data
)
?
(
res
.
data
as
ResultInfoDataItem
[])
:
[]
openResultInfoDialog
(
data
)
}
,
}
)
}
onMounted
(()
=>
{
...
...
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