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
e10551d7
Commit
e10551d7
authored
Sep 03, 2025
by
wusiyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化生产单查询
parent
bc80f0a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
50 deletions
+95
-50
src/components/searchProdOrder.vue
+95
-50
No files found.
src/components/searchProdOrder.vue
View file @
e10551d7
...
...
@@ -10,18 +10,21 @@ import { filePath } from '@/api/axios.ts'
const
{
getCLodop
}
=
useLodop
()
const
type
=
{
'A'
:
'正面'
,
'B'
:
'反面'
,
'C'
:
'左边'
,
'D'
:
'右边'
,
A
:
'正面'
,
B
:
'反面'
,
C
:
'左边'
,
D
:
'右边'
,
}
const
imageList
=
ref
<
{
sort
:
number
title
?:
'A'
|
'B'
|
'C'
|
'D'
url
?:
string
}[]
>
([])
const
imageList
=
ref
<
{
sort
:
number
title
?:
'A'
|
'B'
|
'C'
|
'D'
url
?:
string
}[]
>
([])
const
detail
=
ref
<
SearchOrderRes
>
({
imgList
:
[],
id
:
0
,
imgList
:
[],
id
:
0
,
})
const
printDevice
=
ref
(
''
)
const
isPrint
=
ref
(
false
)
...
...
@@ -80,14 +83,30 @@ const trackcodeInput = async () => {
return
}
const
user
=
JSON
.
parse
(
localStorage
.
getItem
(
'user'
)
||
'{}'
)
const
orderNumber
=
TrackingNumber
.
value
let
orderNumber
:
string
const
underscoreCount
=
(
TrackingNumber
.
value
.
match
(
/_/g
)
||
[]).
length
if
(
underscoreCount
>
3
)
{
orderNumber
=
TrackingNumber
.
value
.
split
(
'_'
)[
3
]
}
else
{
orderNumber
=
TrackingNumber
.
value
}
try
{
const
res
=
await
getSubOrderBySubOrder
(
orderNumber
,
user
.
factory
?.
countryCode
.
toLowerCase
())
const
res
=
await
getSubOrderBySubOrder
(
orderNumber
,
user
.
factory
?.
countryCode
.
toLowerCase
(),
)
if
(
!
res
.
data
)
{
return
ElMessage
.
error
(
'生产单不存在'
)
}
if
(
printDevice
.
value
&&
isPrint
.
value
)
{
const
data
=
await
printProductionQrCode
(
res
.
data
.
id
,
user
.
factory
?.
countryCode
.
toLowerCase
())
const
data
=
await
printProductionQrCode
(
res
.
data
.
id
,
user
.
factory
?.
countryCode
.
toLowerCase
(),
)
// const path = 'http://10.168.1.209/local_files/factory' + data.message
const
path
=
filePath
+
data
.
message
print
(
path
)
...
...
@@ -108,7 +127,6 @@ const trackcodeInput = async () => {
}
detail
.
value
=
d
playAudio
(
'weight_search_success'
)
nextTick
(()
=>
{
if
(
trackingNumberRef
.
value
)
{
...
...
@@ -157,14 +175,13 @@ const lodopCall = async (fn: (lodop: LODOPObject) => string) => {
window
.
_lodop
.
On_Return_Remain
=
true
window
.
_lodop
.
SET_PRINT_MODE
(
'CATCH_PRINT_STATUS'
,
true
)
window
.
_lodopCallback
=
{}
window
.
_lodop
.
On_Return
=
function
(
id
,
value
)
{
window
.
_lodop
.
On_Return
=
function
(
id
,
value
)
{
const
cb
=
window
.
_lodopCallback
[
id
]
if
(
!
cb
)
return
delete
window
.
_lodopCallback
[
id
]
cb
(
value
)
}
}
}
return
new
Promise
((
resolve
)
=>
{
...
...
@@ -239,13 +256,7 @@ const print = async (url: string) => {
ElMessage
.
warning
(
'设置面单打印机出错'
)
return
}
lodop
.
ADD_PRINT_PDF
(
0
,
0
,
'100%'
,
'100%'
,
downloadPDF
(
url
),
)
lodop
.
ADD_PRINT_PDF
(
0
,
0
,
'100%'
,
'100%'
,
downloadPDF
(
url
))
console
.
log
(
lodop
)
if
(
lodop
.
CVERSION
)
{
const
startTime
=
Date
.
now
()
...
...
@@ -308,14 +319,12 @@ onMounted(() => {
<div
v-if=
"imageList.length > 0"
class=
"left-images"
>
<div
v-for=
"(item, index) in imageList"
:key=
"index"
class=
"img-box"
>
<b
v-if=
"item.title"
>
{{
item
.
title
}}
(
{{
type
[
item
.
title
]
}}
)
</b>
<img
:src=
"item.url"
alt=
""
>
<img
:src=
"item.url"
alt=
""
/
>
</div>
</div>
</div>
<div
class=
"right"
>
<div
class=
"input"
>
<div
class=
"input"
>
<el-input
ref=
"trackingNumberRef"
v-model=
"TrackingNumber"
...
...
@@ -324,32 +333,60 @@ onMounted(() => {
clearable
@
keydown
.
enter=
"trackcodeInput()"
></el-input>
<el-button
style=
"width: 138px;"
type=
"primary"
@
click=
"trackcodeInput()"
>
<el-button
style=
"width: 138px"
type=
"primary"
@
click=
"trackcodeInput()"
>
查询
</el-button>
</div>
<div
class=
"input"
>
<div
class=
"input"
>
<el-select
v-model=
"printDevice"
placeholder=
"请选择打印机"
clearable
filterable
@
change=
"handlePrinterChange"
>
<el-option
v-for=
"(item,i) in printList"
:key=
"i"
:label=
"item"
:value=
"item"
></el-option>
v-model=
"printDevice"
placeholder=
"请选择打印机"
clearable
filterable
@
change=
"handlePrinterChange"
>
<el-option
v-for=
"(item, i) in printList"
:key=
"i"
:label=
"item"
:value=
"item"
></el-option>
</el-select>
<el-checkbox
v-model=
"isPrint"
:disabled=
"!printDevice"
style=
"margin-left: 10px"
>
打印生产码
</el-checkbox>
<el-checkbox
v-model=
"isPrint"
:disabled=
"!printDevice"
style=
"margin-left: 10px"
>
打印生产码
</el-checkbox
>
</div>
<div
class=
"div-text"
>
<b>
生产单信息
</b>
<div
class=
"div-content"
>
<h2
style=
"text-align: center;color: black;font-size: 16px;width: 100%;"
>
{{
detail
.
inputNum
}}
</h2>
<h2
style=
"
text-align: center;
color: black;
font-size: 16px;
width: 100%;
"
>
{{
detail
.
inputNum
}}
</h2>
<div
:title=
"detail?.factorySubOrderNumber"
class=
"div-item"
>
<span>
生产单号
</span>
<p>
{{
detail
?.
factorySubOrderNumber
}}
</p>
<el-icon
v-if=
"detail?.factorySubOrderNumber"
class=
"copy"
style=
"cursor:pointer;"
@
click=
"copyText(detail.factorySubOrderNumber)"
>
v-if=
"detail?.factorySubOrderNumber"
class=
"copy"
style=
"cursor: pointer"
@
click=
"copyText(detail.factorySubOrderNumber)"
>
<DocumentCopy
/>
</el-icon>
</div>
...
...
@@ -357,8 +394,11 @@ onMounted(() => {
<span>
店铺单号
</span>
<p>
{{
detail
?.
shopNumber
}}
</p>
<el-icon
v-if=
"detail?.shopNumber"
class=
"copy"
style=
"cursor:pointer;"
@
click=
"copyText(detail.shopNumber)"
>
v-if=
"detail?.shopNumber"
class=
"copy"
style=
"cursor: pointer"
@
click=
"copyText(detail.shopNumber)"
>
<DocumentCopy
/>
</el-icon>
</div>
...
...
@@ -369,8 +409,10 @@ onMounted(() => {
</p>
<el-icon
v-if=
"detail?.thirdSubOrderNumber"
class=
"copy"
style=
"cursor:pointer;"
@
click=
"copyText(detail.thirdSubOrderNumber)"
>
class=
"copy"
style=
"cursor: pointer"
@
click=
"copyText(detail.thirdSubOrderNumber)"
>
<DocumentCopy
/>
</el-icon>
</div>
...
...
@@ -402,20 +444,23 @@ onMounted(() => {
<!--
</div>
-->
<div
:title=
"String(detail?.faceCount)"
class=
"div-item"
>
<span>
打印面数
</span>
<p
v-if=
"detail?.num || imageList.length"
style=
"color: red"
>
{{
detail
?.
faceCount
}}
(
{{
imageList
.
map
(
el
=>
el
.
title
).
join
(
'+'
)
}}
)
</p>
<p
v-if=
"detail?.num || imageList.length"
style=
"color: red"
>
{{
detail
?.
faceCount
}}
(
{{
imageList
.
map
((
el
)
=>
el
.
title
).
join
(
'+'
)
}}
)
</p>
</div>
</div>
</div>
<div
class=
"div-text"
style=
"
flex: 1;
margin-top: 15px;
flex-shrink: 0;
display: flex;
flex-direction: column;
"
flex: 1;
margin-top: 15px;
flex-shrink: 0;
display: flex;
flex-direction: column;
"
>
<div
style=
"height: 100%"
class=
"div-content"
>
<b
style=
"position: absolute; top: -12px"
>
客户留言信息
</b>
...
...
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