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
0a3ddae3
Commit
0a3ddae3
authored
Mar 27, 2026
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 快捷生产
parent
8ae09219
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
143 additions
and
56 deletions
+143
-56
src/api/factoryOrderNew.ts
+9
-0
src/views/order/factoryOrderNew/index.vue
+32
-3
src/views/order/podCN/FastProduction.vue
+102
-53
No files found.
src/api/factoryOrderNew.ts
View file @
0a3ddae3
...
...
@@ -393,3 +393,12 @@ export function completeDeliveryApi(ids: (number | string)[]) {
}[]
>
>
(
'factory/podOrderOperation/completeDelivery'
,
ids
)
}
export
function
getByOperationNoLogApi
(
operationNo
:
string
)
{
return
axios
.
get
<
never
,
BaseRespData
<
operateOrderListData
>>
(
'factory/podOrderOperation/getByOperationNoLog'
,
{
params
:
{
operationNo
},
},
)
}
src/views/order/factoryOrderNew/index.vue
View file @
0a3ddae3
...
...
@@ -703,7 +703,7 @@
/>
<!--
到派单、配货中子状态
-->
<
div
:
key
=
"status"
v
-
if
=
"isCardLayout
"
class
=
"card-content"
>
<
div
v
-
if
=
"isCardLayout"
:
key
=
"status
"
class
=
"card-content"
>
<
CardLayout
ref
=
"cardLayoutRef"
:
status
=
"status"
...
...
@@ -817,6 +817,18 @@
@
refresh
-
table
=
"refreshCurrentView"
/>
<
WeightDialog
ref
=
"weightDialogRef"
@
update
-
list
=
"refreshCurrentView"
/>
<
FastProduction
v
-
model
:
detail
-
visible
=
"detailVisible"
:
detail
-
data
=
"detailData"
:
fast
-
key
=
"fastKey"
history
-
storage
-
key
=
"historyFactoryOrderNewData"
tracking
-
placeholder
=
"扫描枪输入操作单号,录入下一单本单自动生产完成,最后一单扫两次完成生产"
:
query
-
api
=
"getOperationByNo"
:
complete
-
api
=
"completeOperationById"
:
download
-
api
=
"downloadOperationById"
@
on
-
success
=
"handleFastProductionSuccess"
@
close
=
"fastClose"
/>
<
ArrangeDialog
ref
=
"arrangeDialogRef"
...
...
@@ -894,6 +906,7 @@ import {
syncReceiverAddress
,
updateRemarkApi
,
completeDeliveryApi
,
getByOperationNoLogApi
,
}
from
'@/api/factoryOrderNew'
import
{
getListCraftApi
,
...
...
@@ -926,6 +939,7 @@ import OperateDetailsDialog from './component/OperateDetailsDialog.vue'
import
CreateLogisticDialog
from
'@/views/order/podCN/components/CreateLogisticDialog.vue'
import
UpdateCustomDeclarationInfoDialog
from
'@/views/order/podCN/components/UpdateCustomDeclarationInfoDialog.vue'
import
WeightDialog
from
'@/views/order/podCN/components/WeightDialog.vue'
import
FastProduction
from
'@/views/order/podCN/FastProduction.vue'
import
PodMakeOrder
from
'@/views/order/podUs/PodMakeOrder.vue'
const
cardLayoutStatuses
=
[
...
...
@@ -1494,6 +1508,9 @@ const arrangeDialogRef = ref<InstanceType<typeof ArrangeDialog>>()
const
createLogisticDialogRef
=
ref
()
const
updateCustomsDialogVisible
=
ref
(
false
)
const
weightDialogRef
=
ref
()
const
detailVisible
=
ref
(
false
)
const
fastKey
=
ref
(
''
)
const
detailData
=
ref
<
Record
<
string
,
unknown
>>
({
}
)
const
getSelectedIds
=
():
(
number
|
string
)[]
=>
{
if
(
isCardLayout
.
value
)
return
cardSelectList
.
value
.
map
((
item
)
=>
item
.
id
)
return
selectedRowIds
.
value
...
...
@@ -2165,9 +2182,21 @@ const handleReplenishFail = () => {
if
(
!
ensureSelection
())
return
ElMessage
.
info
(
'补胚失败功能待集成'
)
}
const
getOperationByNo
=
(
operationNo
:
string
)
=>
getByOperationNoLogApi
(
operationNo
)
as
Promise
<
{
data
?:
unknown
}
>
const
completeOperationById
=
(
ids
:
number
[])
=>
completeDeliveryApi
(
ids
)
const
downloadOperationById
=
(
ids
:
number
[])
=>
downloadOperationMaterialApi
(
ids
)
const
handleFastProductionSuccess
=
()
=>
{
refreshCurrentView
({
isRefreshTree
:
true
}
)
}
const
fastClose
=
()
=>
{
detailVisible
.
value
=
false
refreshCurrentView
({
isRefreshTree
:
true
}
)
}
const
handleQuickProduction
=
()
=>
{
if
(
!
ensureSelection
())
return
ElMessage
.
info
(
'快捷生产功能待集成'
)
detailVisible
.
value
=
true
fastKey
.
value
=
'fastProduction'
detailData
.
value
=
{
}
}
const
handleSinglePrint
=
()
=>
{
if
(
!
ensureSelection
())
return
...
...
src/views/order/podCN/FastProduction.vue
View file @
0a3ddae3
...
...
@@ -211,7 +211,7 @@ import {
import
{
cardImages
,
PodOrderRes
}
from
'@/types/api/podCnOrder'
import
{
showConfirm
}
from
'@/utils/ui'
import
{
filePath
}
from
'@/api/axios'
import
{
ref
,
watch
,
defineProps
,
defineEmits
}
from
'vue'
import
{
ref
,
watch
}
from
'vue'
interface
HistoryDataItem
{
orderNumber
:
string
finished
:
boolean
...
...
@@ -251,41 +251,108 @@ const audios = {
).
href
,
}
const
TrackingNumber
=
ref
(
''
)
const
props
=
defineProps
({
type
:
{
default
:
0
,
type
:
Number
,
const
props
=
withDefaults
(
defineProps
<
{
type
?:
number
detailVisible
?:
boolean
detailData
?:
Record
<
string
,
unknown
>
|
null
fastKey
?:
string
historyStorageKey
?:
string
trackingPlaceholder
?:
string
queryApi
?:
(
orderNumber
:
string
)
=>
Promise
<
{
data
?:
unknown
}
>
completeApi
?:
(
ids
:
number
[],
detail
:
Record
<
string
,
unknown
>
)
=>
Promise
<
unknown
>
downloadApi
?:
(
ids
:
number
[])
=>
Promise
<
{
code
?:
number
;
message
?:
string
}
>
}
>
(),
{
type
:
0
,
detailVisible
:
false
,
detailData
:
null
,
fastKey
:
''
,
historyStorageKey
:
'historyCnData'
,
trackingPlaceholder
:
'扫描枪输入生产单号,录入下一单本单自动生产完成,最后一单扫两次完成生产'
,
queryApi
:
(
orderNumber
:
string
)
=>
getSubOrderBySubOrderNumber
(
orderNumber
),
completeApi
:
(
ids
:
number
[],
detailData
:
Record
<
string
,
unknown
>
)
=>
productionQueryApi
(
ids
[
0
],
Number
(
detailData
.
podJomallOrderCnId
||
-
1
),
),
downloadApi
:
(
ids
:
number
[])
=>
downloadMaterialApi
(
ids
),
},
detailVisible
:
{
default
:
false
,
type
:
Boolean
,
},
detailData
:
{
default
:
null
,
type
:
Object
,
},
fastKey
:
{
default
:
''
,
type
:
String
,
},
})
)
const
emit
=
defineEmits
([
'update:detailVisible'
,
'close'
,
'onSuccess'
])
const
parseImages
=
(
value
:
unknown
):
cardImages
[]
=>
{
if
(
!
value
)
return
[]
if
(
Array
.
isArray
(
value
))
{
return
value
.
filter
((
item
)
=>
!!
item
?.
url
)
.
map
((
item
,
index
)
=>
({
title
:
String
(
item
?.
title
||
''
),
url
:
String
(
item
?.
url
||
''
),
sort
:
Number
(
item
?.
sort
??
index
+
1
),
id
:
item
?.
id
,
}))
}
if
(
typeof
value
===
'string'
)
{
const
source
=
value
.
trim
()
if
(
!
source
)
return
[]
if
(
source
.
startsWith
(
'http'
))
{
return
source
.
split
(
','
).
map
((
url
,
index
)
=>
({
title
:
''
,
url
:
url
.
trim
(),
sort
:
index
+
1
,
}))
}
try
{
const
parsed
=
JSON
.
parse
(
source
)
if
(
Array
.
isArray
(
parsed
))
{
return
parsed
.
filter
((
item
)
=>
!!
item
?.
url
)
.
map
((
item
,
index
)
=>
({
title
:
String
(
item
?.
title
||
''
),
url
:
String
(
item
?.
url
||
''
),
sort
:
Number
(
item
?.
sort
??
index
+
1
),
id
:
item
?.
id
,
}))
}
}
catch
(
_e
)
{
return
[]
}
}
return
[]
}
const
normalizeDetail
=
(
value
:
unknown
):
PodOrderRes
=>
{
const
raw
=
(
value
||
{})
as
Record
<
string
,
unknown
>
const
d
=
JSON
.
parse
(
JSON
.
stringify
(
raw
))
as
Record
<
string
,
unknown
>
if
(
typeof
d
.
note
===
'string'
)
{
try
{
d
.
note
=
JSON
.
parse
(
d
.
note
)
}
catch
(
_e
)
{
d
.
note
=
[]
}
}
if
(
!
Array
.
isArray
(
d
.
note
))
d
.
note
=
[]
const
imageSource
=
d
.
imageAry
||
d
.
designImages
||
d
.
imgList
d
.
imgList
=
parseImages
(
imageSource
)
return
d
as
unknown
as
PodOrderRes
}
watch
(
()
=>
props
.
detailVisible
,
(
newVal
:
boolean
)
=>
{
dialogVisible
.
value
=
newVal
detail
.
value
=
{
id
:
-
1
,
podJomallOrderCnId
:
-
1
,
imgList
:
[]
}
if
(
newVal
)
{
const
history
=
localStorage
.
getItem
(
'historyCnData'
)
const
history
=
localStorage
.
getItem
(
props
.
historyStorageKey
)
historyData
.
value
=
history
?
JSON
.
parse
(
history
)
:
[]
const
len
=
historyData
.
value
if
(
len
.
length
>
0
&&
props
.
fastKey
===
'fastProduction'
)
{
confirmQuery
(
len
,
0
)
}
placeholderText
.
value
=
'扫描枪输入生产单号,录入下一单本单自动生产完成,最后一单扫两次完成生产'
placeholderText
.
value
=
props
.
trackingPlaceholder
trackingNumberRef
.
value
&&
trackingNumberRef
.
value
.
focus
()
...
...
@@ -304,18 +371,7 @@ watch(
imgList
:
[],
}
if
(
newVal
&&
Object
.
keys
(
newVal
).
length
>
0
)
{
const
d
=
JSON
.
parse
(
JSON
.
stringify
(
newVal
))
if
(
d
.
note
)
{
d
.
note
=
JSON
.
parse
(
d
.
note
)
}
else
{
d
.
note
=
[]
}
if
(
d
.
imageAry
)
{
d
.
imgList
=
d
.
imageAry
}
else
{
d
.
imgList
=
[]
}
detail
.
value
=
d
detail
.
value
=
normalizeDetail
(
newVal
)
}
},
{
deep
:
true
},
...
...
@@ -342,7 +398,10 @@ const confirmQuery = (len: HistoryDataItem[], i: number) => {
)
if
(
index
>=
0
)
{
historyData
.
value
.
splice
(
index
,
1
)
localStorage
.
setItem
(
'historyCnData'
,
JSON
.
stringify
(
historyData
.
value
))
localStorage
.
setItem
(
props
.
historyStorageKey
,
JSON
.
stringify
(
historyData
.
value
),
)
}
if
(
len
[
i
+
1
])
{
confirmQuery
(
len
,
i
+
1
)
...
...
@@ -367,8 +426,7 @@ const setData = async (orderNumber: string) => {
if
(
!
detail
.
value
||
detail
.
value
?.
id
===
-
1
)
return
try
{
const
id
=
detail
.
value
.
id
const
podJomallOrderCnId
=
detail
.
value
.
podJomallOrderCnId
await
productionQueryApi
(
id
,
podJomallOrderCnId
)
await
props
.
completeApi
([
id
],
detail
.
value
as
unknown
as
Record
<
string
,
unknown
>
)
if
(
orderNumber
)
{
const
index
=
historyData
.
value
.
findIndex
(
...
...
@@ -377,7 +435,10 @@ const setData = async (orderNumber: string) => {
if
(
index
>=
0
)
{
// 扫单完成删除
historyData
.
value
.
splice
(
index
,
1
)
localStorage
.
setItem
(
'historCnData'
,
JSON
.
stringify
(
historyData
.
value
))
localStorage
.
setItem
(
props
.
historyStorageKey
,
JSON
.
stringify
(
historyData
.
value
),
)
}
}
emit
(
'onSuccess'
)
...
...
@@ -418,7 +479,7 @@ const download = async () => {
const
id
=
detail
.
value
.
id
if
(
id
!==
undefined
)
{
try
{
const
res
=
await
downloadMaterial
Api
([
id
])
const
res
=
await
props
.
download
Api
([
id
])
if
(
res
.
code
!==
200
)
return
// window.open(filePath + res.message)
const
a
=
document
.
createElement
(
'a'
)
...
...
@@ -484,7 +545,7 @@ const trackCodeInput = async () => {
orderNumber
:
TrackingNumber
.
value
,
finished
:
false
,
})
localStorage
.
setItem
(
'historyCnData'
,
JSON
.
stringify
(
historyData
.
value
))
localStorage
.
setItem
(
props
.
historyStorageKey
,
JSON
.
stringify
(
historyData
.
value
))
}
const
orderNumber
=
TrackingNumber
.
value
...
...
@@ -496,23 +557,11 @@ const trackCodeInput = async () => {
}
try
{
const
res
=
await
getSubOrderBySubOrderNumber
(
orderNumber
)
const
res
=
await
props
.
queryApi
(
orderNumber
)
if
(
!
res
.
data
)
{
return
ElMessage
.
error
(
'生产单不存在'
)
}
const
d
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
))
if
(
d
.
note
)
{
d
.
note
=
JSON
.
parse
(
d
.
note
)
}
else
{
d
.
note
=
[]
}
if
(
d
.
imageAry
)
{
d
.
imgList
=
JSON
.
parse
(
d
.
imageAry
)
}
else
{
d
.
imgList
=
[]
}
detail
.
value
=
d
detail
.
value
=
normalizeDetail
(
res
.
data
)
if
(
isDownloadImage
.
value
)
{
download
()
...
...
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