Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
electron-printer
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
0
Merge Requests
0
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
zhuzhequan
electron-printer
Commits
4c37f10e
Commit
4c37f10e
authored
Jan 31, 2026
by
linjinhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:添加打印标识
parent
4dfa24d6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
20 deletions
+72
-20
src/server/entity/function.js
+13
-4
src/server/routes/index.js
+3
-0
src/views/design/head/index.vue
+25
-5
src/views/design/main/index.vue
+31
-11
No files found.
src/server/entity/function.js
View file @
4c37f10e
...
...
@@ -3,6 +3,7 @@ import {
downloadOtherImage
,
toSend
,
writeProfileXml
,
copySingleImage
,
}
from
"@/server/utils"
;
const
{
cropImageTransparentEdges
,
...
...
@@ -196,14 +197,11 @@ export default {
};
let
url
=
urlArr
[
params
.
orderType
].
url
;
let
paramsField
=
urlArr
[
params
.
orderType
].
field
;
// console.log("url", url);
// console.log("paramsField", paramsField);
// console.log("thirdSubOrderNumber", params.thirdSubOrderNumber);
console
.
log
(
`187,
${
env
}
/
${
url
}
`
);
let
{
data
}
=
await
axios
.
get
(
`
${
env
}
/
${
url
}
`
,
{
params
:
{
[
paramsField
]:
params
.
thirdSubOrderNumber
,
resizable
:
params
.
resizable
,
},
headers
:
{
"jwt-token"
:
token
},
});
...
...
@@ -552,4 +550,15 @@ export default {
res
.
json
({
code
:
500
,
msg
:
error
});
}
},
//复制文件夹下文件
copySingleImageFn
:
async
(
req
,
res
)
=>
{
try
{
const
{
imgPath
,
targetPath
}
=
req
.
body
;
await
copySingleImage
(
imgPath
,
targetPath
);
res
.
json
({
code
:
200
});
}
catch
(
error
)
{
console
.
log
(
error
);
res
.
json
({
code
:
500
,
msg
:
error
});
}
},
};
src/server/routes/index.js
View file @
4c37f10e
...
...
@@ -47,4 +47,7 @@ router.post("/getAllCountry", fn.getAllCountry);
//根据图片地址保存文件到本地
router
.
post
(
"/saveImgByUrl"
,
fn
.
saveImgByUrl
);
//复制文件夹下文件
router
.
post
(
"/copySingleImageFn"
,
fn
.
copySingleImageFn
);
export
{
router
as
default
};
src/views/design/head/index.vue
View file @
4c37f10e
...
...
@@ -155,6 +155,7 @@ export default {
this
.
checked
=
false
;
},
imgList
:
{
//监听当前网格内数据,并把power设置为true
handler
(
value
)
{
if
(
this
.
detail
&&
value
?.
length
&&
this
.
desktopDevice
===
3
)
{
const
item
=
this
.
detail
?.
saveImgList
?.
find
(
...
...
@@ -163,6 +164,7 @@ export default {
if
(
item
)
{
item
.
power
=
true
;
try
{
//复制图片到当前文件夹下
copySingleImage
(
item
.
productionFile
,
getLocation
(
"downloadLocation1"
),
...
...
@@ -171,13 +173,21 @@ export default {
item
.
productionFile
,
getLocation
(
"downloadLocation2"
),
);
// this.$api.post("/copySingleImageFn", {
// imgPath: item.productionFile,
// targetPath: getLocation("downloadLocation1"),
// });
// this.$api.post("/copySingleImageFn", {
// imgPath: item.productionFile,
// targetPath: getLocation("downloadLocation2"),
// });
this
.
$message
.
success
(
"图片已发送目标文件夹下"
);
}
catch
(
error
)
{
this
.
$message
.
error
(
"发送失败"
);
console
.
log
(
error
);
}
//更新数据到本地数据
updateOrderInfoItem
(
this
.
detail
.
newId
,
this
.
detail
);
}
console
.
log
(
"updateOrderInfoItemitem"
,
item
);
...
...
@@ -230,14 +240,17 @@ export default {
}
else
if
(
this
.
orderType
===
"US"
)
{
params
.
podJomallOrderUsId
=
data
.
podJomallOrderUsId
;
}
//如果为惠立彩则判断当前saveImgList字段中的power是否全是true 是则生产完成
const
canCallApi
=
this
.
desktoVersion
!==
3
||
(
data
.
saveImgList
?.
every
((
el
)
=>
el
.
power
)
??
false
);
if
(
canCallApi
)
{
console
.
log
(
"生产完成数据"
,
data
);
console
.
log
(
"本地数据removeFromOrderInfo:"
,
getOrderInfo
());
console
.
log
(
"生产完成"
);
removeFromOrderInfo
(
data
.
newId
);
console
.
log
(
"本地数据removeFromOrderInfo:"
,
getOrderInfo
());
//生产完成后在本地删除
return
;
await
this
.
$api
.
post
(
"/completeDelivery"
,
params
);
this
.
$message
.
success
(
"操作成功"
);
...
...
@@ -509,13 +522,14 @@ export default {
height: this.detail.mssHeight,
};
}
//设置储存图片的字段,并添加power标识
if (!this.detail["
saveImgList
"]?.length) {
this.detail["
saveImgList
"] = [...newImgList].map((el) => {
el.power = false;
return { ...el };
});
}
//如果该数据的图片第一次出现且素材图大于1张则把该数据储存到本地
if (newImgList.length > 1 && !bool) {
addToOrderInfo(this.detail);
console.log("
本地数据
addToOrderInfo
:
", getOrderInfo());
...
...
@@ -570,19 +584,24 @@ export default {
}
try {
//获取本地数组
const arr = await getOrderInfo();
//查询当前生产单号是否在本地数据
const localItem = getOrderInfoItem(this.productionNo)
? { data: getOrderInfoItem(this.productionNo) }
: null;
console.log("
本地数据
getOrderInfoItem
:
", getOrderInfo());
let findByPodProductionNo;
const apiRequestParams = {
thirdSubOrderNumber: this.productionNo,
orderType: this.orderType,
resizable: this.desktopDevice == 3 ? true : false,
};
//判断是否为惠立彩
if (this.desktopDevice === 3) {
if (arr.length > 0) {
//如果查询到生产单号 直接复制否则调用接口获取详情
findByPodProductionNo =
localItem ||
(await this.$api.post(
...
...
@@ -603,6 +622,7 @@ export default {
}
this.detail = findByPodProductionNo.data;
//赋值当前扫码为生产单号的标识
this.detail["
newId
"] = this.productionNo;
let designImagesCanvasJsonList = this.detail.drParam;
...
...
src/views/design/main/index.vue
View file @
4c37f10e
...
...
@@ -1264,17 +1264,19 @@ export default {
}
else
{
this
.
selectImgIndex
=
0
;
}
this
.
getBackFile
(
{
files
:
[
value
[
this
.
selectImgIndex
]],
size
:
this
.
detail
.
designImageSize
||
null
,
},
()
=>
{
this
.
imgHistoryList
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
this
.
imgList
)),
);
},
);
if
(
this
.
selectImgIndex
!=
-
1
)
{
this
.
getBackFile
(
{
files
:
[
value
[
this
.
selectImgIndex
]],
size
:
this
.
detail
.
designImageSize
||
null
,
},
()
=>
{
this
.
imgHistoryList
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
this
.
imgList
)),
);
},
);
}
}
break
;
default
:
...
...
@@ -1377,6 +1379,12 @@ export default {
<div
v-if=
"img.title && img.title.length
<
2
"
class=
"imgTitle"
>
{{
img
.
title
}}
</div>
<div
v-if=
"img.power && i != selectImgList.length - 1"
class=
"printTitle"
>
已打印
</div>
</div>
</div>
<el-empty
v-else
description=
"素材图为空"
></el-empty>
...
...
@@ -2076,6 +2084,18 @@ img {
background-color
:
#409eff
;
line-height
:
25px
;
}
.printTitle
{
font-weight
:
700
;
font-size
:
18px
;
position
:
absolute
;
top
:
8px
;
right
:
8px
;
width
:
65px
;
height
:
25px
;
border
:
3px
solid
red
;
color
:
red
;
line-height
:
25px
;
}
}
}
.boxImg
>
*
{
...
...
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