Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pda-ui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pda
pda-ui
Commits
85c7afad
Commit
85c7afad
authored
Mar 28, 2024
by
张海景
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:修改打印相关逻辑
parent
0aed97ae
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
27 deletions
+70
-27
packageLablePrint.js
src/api/mes/pro/packageLablePrint.js
+4
-1
ruoyi.js
src/utils/ruoyi.js
+28
-6
index.vue
src/views/mes/pro/packageLablePrint/index.vue
+14
-8
index.vue
src/views/mes/report/index.vue
+5
-0
index.vue
src/views/mes/tm/tool/index.vue
+19
-12
No files found.
src/api/mes/pro/packageLablePrint.js
View file @
85c7afad
...
...
@@ -43,7 +43,10 @@ export function packagePrintRecordInfo(data) {
return
request
({
url
:
"/pro/packagePrintRecord/recordPackagePrintInfo"
,
method
:
"post"
,
data
:
data
,
data
,
headersheaders
:
{
"Content-Type"
:
"application/x-www-form-urlencoded"
,
},
});
}
src/utils/ruoyi.js
View file @
85c7afad
...
...
@@ -283,15 +283,37 @@ function printPdf(res) {
* responseType: 'blob',
* 接口请求加上responseType
*/
export
function
postPrintPdf
(
data
)
{
export
function
postPrintPdf
(
name
,
value
)
{
request
({
url
:
"/common/print"
,
method
:
"post"
,
responseType
:
'blob'
,
data
}).
then
(
res
=>
{
printPdf
(
res
)
})
responseType
:
"blob"
,
data
:
{
reportName
:
"mysql:"
+
name
,
values
:
value
,
},
}).
then
((
res
)
=>
{
printPdf
(
res
);
});
}
/**
* 批量打印pdf方法
* responseType: 'blob',
* 接口请求加上responseType
*/
export
function
postBatchPrintPdf
(
name
,
values
)
{
request
({
url
:
"/common/printBatch"
,
method
:
"post"
,
responseType
:
"blob"
,
data
:
{
reportName
:
"mysql:"
+
name
,
valueList
:
values
},
}).
then
((
res
)
=>
{
printPdf
(
res
);
});
}
src/views/mes/pro/packageLablePrint/index.vue
View file @
85c7afad
...
...
@@ -228,7 +228,7 @@
<!-- 添加或修改生产BOM对话框 -->
<el-dialog
title=
"选择打印模版"
:visible
.
sync=
"visible"
width=
"960px"
append-to-body
>
<
template
Print
ref=
"templatePrintRef"
v-if=
"visible"
type=
"single"
:operation=
"false"
></templatePrint>
<
template
Print
ref=
"templatePrintRef"
v-if=
"visible"
type=
"single"
reportType=
'package_label'
:operation=
"false"
></templatePrint>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"handleSubmitPrint"
>
确 定
</el-button>
<el-button
@
click=
"visible = false"
>
取 消
</el-button>
...
...
@@ -240,6 +240,7 @@
<
script
>
import
{
workorderList
,
buildPackagePrint
,
workorderPackageList
,
updatePackagePrintRecord
,
packagePrintRecordInfo
}
from
"@/api/mes/pro/packageLablePrint"
;
import
templatePrint
from
'@/views/mes/report/index'
import
{
postBatchPrintPdf
}
from
'@/utils/ruoyi'
export
default
{
name
:
'packageLablePrint'
,
components
:
{
templatePrint
},
...
...
@@ -346,7 +347,12 @@ export default {
workorderId
:
this
.
produceForm
.
workorderId
,
recordIds
:
this
.
selectPackageTable
}
packagePrintRecordInfo
(
params
).
then
((
response
)
=>
{
const
forms
=
new
FormData
()
forms
.
append
(
'workorderId'
,
this
.
produceForm
.
workorderId
)
this
.
selectPackageTable
.
forEach
(
item
=>
{
forms
.
append
(
'recordIds'
,
item
.
recordId
)
})
packagePrintRecordInfo
(
forms
).
then
((
response
)
=>
{
console
.
log
(
response
,
'response'
)
if
(
response
.
code
===
200
)
{
const
valueList
=
response
.
data
.
packagePrintList
.
map
(
item
=>
{
...
...
@@ -354,10 +360,10 @@ export default {
packagePrint
:
item
}
})
post
PrintPdf
({
reportName
:
"mysql:"
+
this
.
$refs
.
templatePrintRef
.
currentData
.
name
,
post
BatchPrintPdf
(
this
.
$refs
.
templatePrintRef
.
currentData
.
name
,
valueList
}
).
then
(()
=>
{
).
then
(()
=>
{
this
.
visible
=
false
this
.
getPackageList
()
})
...
...
src/views/mes/report/index.vue
View file @
85c7afad
...
...
@@ -165,6 +165,10 @@ export default {
type
:
String
,
default
:
'multiple'
}
,
reportType
:
{
type
:
String
,
default
:
''
}
,
operation
:
{
type
:
Boolean
,
default
:
true
...
...
@@ -218,6 +222,7 @@ export default {
/** 查询模版管理列表 */
getList
()
{
this
.
loading
=
true
;
if
(
this
.
reportType
)
this
.
queryParams
.
reportType
=
this
.
reportType
listReport
({...
this
.
queryParams
,
isPrintTemplate
:
1
}
).
then
(
response
=>
{
this
.
listData
=
response
.
rows
;
this
.
total
=
response
.
total
;
...
...
src/views/mes/tm/tool/index.vue
View file @
85c7afad
...
...
@@ -587,18 +587,25 @@ export default {
printQrCode
()
{
const
qrArr
=
[];
const
qrGp
=
[];
this
.
selectRow
.
forEach
(
s
=>
{
postPrintPdf
({
"reportName"
:
"mysql:qrcode-50*50-2"
,
"values"
:{
"detail"
:
[{
let
detail
=
[]
this
.
selectRow
.
forEach
((
s
,
i
)
=>
{
detail
.
push
({
"barcode"
:
s
.
itemCode
+
'-'
+
s
.
toolCode
,
"gp"
:
s
.
itemName
+
'-'
+
s
.
toolCode
}
]
}
}
);
"showText"
:
s
.
itemName
+
'-'
+
s
.
toolCode
,
"gp"
:
i
+
1
}
)
detail
.
push
({
"barcode"
:
s
.
itemCode
+
'-'
+
s
.
toolCode
,
"showText"
:
s
.
itemName
+
'-'
+
s
.
toolCode
,
"gp"
:
i
+
1
}
)
}
);
postPrintPdf
(
"qrcode-50*50-2"
,
{
detail
}
);
}
,
// //自动生成编码
...
...
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