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
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
zhuzhequan
electron-printer
Commits
1a6d16c7
Commit
1a6d16c7
authored
Jul 07, 2026
by
linjinhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:对接后端接口
parent
4fbb5e26
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
318 additions
and
232 deletions
+318
-232
src/background.js
+26
-35
src/components/BaseTable.vue
+3
-15
src/config/index.js
+30
-1
src/server/entity/function.js
+111
-4
src/server/routes/index.js
+13
-0
src/server/utils/store.js
+4
-4
src/utils/download-queue.js
+0
-0
src/views/dtf-batch-detail/components/detailHead.vue
+42
-49
src/views/dtf-batch-detail/detail.vue
+18
-28
src/views/dtf-list/components/head.vue
+43
-52
src/views/dtf-list/index.vue
+0
-0
src/views/dtf-setting/index.vue
+28
-44
No files found.
src/background.js
View file @
1a6d16c7
...
@@ -4,8 +4,8 @@ import { app, protocol, BrowserWindow, globalShortcut } from "electron";
...
@@ -4,8 +4,8 @@ import { app, protocol, BrowserWindow, globalShortcut } from "electron";
import
{
createProtocol
}
from
"vue-cli-plugin-electron-builder/lib"
;
import
{
createProtocol
}
from
"vue-cli-plugin-electron-builder/lib"
;
import
{
createServer
}
from
"@/server/index.js"
;
import
{
createServer
}
from
"@/server/index.js"
;
import
{
autoUpdater
}
from
"electron-updater"
;
import
{
autoUpdater
}
from
"electron-updater"
;
const
axios
=
require
(
"axios"
);
const
createDownloadQueue
=
require
(
"@/utils/download-queue"
);
const
{
createBatchDownloadQueue
}
=
require
(
"@/utils/download-queue"
);
const
fs
=
require
(
"fs"
);
const
fs
=
require
(
"fs"
);
import
path
from
"path"
;
// 引入 path 模块
import
path
from
"path"
;
// 引入 path 模块
...
@@ -31,23 +31,32 @@ const winURL =
...
@@ -31,23 +31,32 @@ const winURL =
:
`file://
${
__dirname
}
/index.html`
;
:
`file://
${
__dirname
}
/index.html`
;
// 全局唯一下载队列,服务启动时初始化一次
// 全局唯一下载队列,服务启动时初始化一次
const
downloadQueue
=
createDownloadQueue
({
const
downloadQueue
=
create
Batch
DownloadQueue
({
concurrency
:
2
,
concurrency
:
3
,
retryTimes
:
2
,
retryTimes
:
2
,
// 根目录:系统下载目录/排版素材,可自行修改为固定盘符
basePath
:
""
,
basePath
:
path
.
join
(
app
.
getPath
(
"downloads"
),
"自动排版素材"
),
// 单文件下载成功
// 文件名规则,可自定义
fileNameRule
:
task
=>
`
${
task
.
batchArrangeNum
}
_自动排版素材.zip`
,
onSuccess
:
task
=>
{
onSuccess
:
task
=>
{
console
.
log
(
`批次
${
task
.
batchArrangeNum
}
下载完成`
);
win
?.
webContents
.
send
(
"download:file-success"
,
{
win
.
webContents
.
send
(
"download:success"
,
task
.
batchArrangeNum
);
batchArrangeNum
:
task
.
batchArrangeNum
,
fileName
:
task
.
fileName
});
},
},
// 单文件下载失败
onError
:
(
task
,
err
)
=>
{
onError
:
(
task
,
err
)
=>
{
console
.
error
(
`批次
${
task
.
batchArrangeNum
}
下载失败:`
,
err
.
message
);
win
?.
webContents
.
send
(
"download:file-error"
,
{
win
.
webContents
.
send
(
"download:error"
,
{
batchArrangeNum
:
task
.
batchArrangeNum
,
batchArrangeNum
:
task
.
batchArrangeNum
,
fileName
:
task
.
fileName
,
msg
:
err
.
message
msg
:
err
.
message
});
});
},
// 批次校验失败(新增:返回所有异常批次)
onBatchInvalid
:
invalidList
=>
{
win
?.
webContents
.
send
(
"download:batch-invalid"
,
invalidList
);
},
// 全部任务完成
onIdle
:
()
=>
{
win
?.
webContents
.
send
(
"download:all-finish"
);
}
}
});
});
...
@@ -504,31 +513,13 @@ async function createWindow() {
...
@@ -504,31 +513,13 @@ async function createWindow() {
const
{
width
,
height
}
=
win
.
getBounds
();
const
{
width
,
height
}
=
win
.
getBounds
();
win
.
webContents
.
send
(
"window-size"
,
{
width
,
height
});
win
.
webContents
.
send
(
"window-size"
,
{
width
,
height
});
});
});
// IPC 通信
// 1. 批量添加下载任务
ipcMain
.
on
(
"download:submit-batch-list"
,
(
event
,
list
)
=>
{
ipcMain
.
on
(
"download:addTasks"
,
(
event
,
tasks
)
=>
{
downloadQueue
.
addBatchList
(
list
);
const
BASE_URL
=
""
;
event
.
returnValue
=
{
code
:
200
,
msg
:
"已处理"
};
// 给每个任务挂载获取下载地址的方法
const
taskList
=
tasks
.
map
(
item
=>
({
...
item
,
fetchUrl
:
async
()
=>
{
const
params
=
{};
const
res
=
await
axios
({
method
:
"get"
,
url
:
`
${
BASE_URL
}
/material/getDownloadUrl`
,
params
})({
batchArrangeNum
:
item
.
batchArrangeNum
});
return
res
.
data
.
downloadUrl
;
}
}));
downloadQueue
.
addTasks
(
taskList
);
event
.
returnValue
=
{
code
:
200
,
msg
:
"已加入队列"
};
});
});
// 2. 查询队列运行状态
ipcMain
.
on
(
"download:get-status"
,
event
=>
{
ipcMain
.
on
(
"download:getStatus"
,
event
=>
{
event
.
returnValue
=
{
isRunning
:
downloadQueue
.
isRunning
};
event
.
returnValue
=
{
isRunning
:
downloadQueue
.
isRunning
};
});
});
}
}
...
...
src/components/BaseTable.vue
View file @
1a6d16c7
...
@@ -44,18 +44,6 @@
...
@@ -44,18 +44,6 @@
v-html=
"col.render(scope.row, scope.column, scope.$index)"
v-html=
"col.render(scope.row, scope.column, scope.$index)"
></span>
></span>
<!-- 2. tag标签 -->
<el-tag
v-else-if=
"col.type === 'tag'"
:type=
"col.getTagType ? col.getTagType(scope.row) : 'primary'"
:effect=
"col.tagEffect || 'light'"
size=
"mini"
>
{{
col
.
getTagText
?
col
.
getTagText
(
scope
.
row
)
:
scope
.
row
[
col
.
prop
]
}}
</el-tag>
<!-- 3. 图片 -->
<!-- 3. 图片 -->
<el-image
<el-image
v-else-if=
"col.type === 'image'"
v-else-if=
"col.type === 'image'"
...
@@ -107,7 +95,7 @@
...
@@ -107,7 +95,7 @@
class=
"table-pagination"
class=
"table-pagination"
@
size-change=
"handleSizeChange"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
@
current-change=
"handleCurrentChange"
:current-page=
"pageInfo.
pageNum
"
:current-page=
"pageInfo.
currentPage
"
:page-sizes=
"[10, 20, 50, 100]"
:page-sizes=
"[10, 20, 50, 100]"
:page-size=
"pageInfo.pageSize"
:page-size=
"pageInfo.pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
layout=
"total, sizes, prev, pager, next, jumper"
...
@@ -170,12 +158,12 @@ export default {
...
@@ -170,12 +158,12 @@ export default {
},
},
/**
/**
* 分页信息
* 分页信息
* {
pageNum
: 1, pageSize: 10, total: 0 }
* {
currentPage
: 1, pageSize: 10, total: 0 }
*/
*/
pageInfo
:
{
pageInfo
:
{
type
:
Object
,
type
:
Object
,
default
:
()
=>
({
default
:
()
=>
({
pageNum
:
1
,
currentPage
:
1
,
pageSize
:
10
,
pageSize
:
10
,
total
:
0
total
:
0
})
})
...
...
src/config/index.js
View file @
1a6d16c7
...
@@ -34,7 +34,36 @@ export const pathMap = {
...
@@ -34,7 +34,36 @@ export const pathMap = {
},
},
checkInventory
:
{
checkInventory
:
{
OP
:
"factory/podOrderOperation/check-inventory"
OP
:
"factory/podOrderOperation/check-inventory"
}
},
//烫画
//获取生产配置
productionConfig
:
"api/factory/production-config"
,
//更新生产配置
productionConfigUpdate
:
"/api/factory/production-config/update"
,
//排版列表(分页)
productionSoftware
:
"/api/factory/podOrderBatchDownload/page-production-software"
,
//查询该批次下的所有素材
listMaterialsByBatch
:
"/api/factory/podOrderBatchDownload/list-materials-by-batch"
,
//重新合成排版
psReComposingDesignImages
:
"/api/factory/podOrderBatchDownload/psReComposingDesignImages"
,
//根据批次分页查询操作单
listOperationByBatch
:
"/api/factory/podOrderBatchDownload/listOperationByBatch"
};
// 操作单状态枚举
export
const
statusMap
=
{
待排单
:
"PENDING_SCHEDULE"
,
待拣胚
:
"PENDING_PICK"
,
待补胚
:
"PENDING_REPLENISH"
,
生产中
:
"IN_PRODUCTION"
,
待配货
:
"PENDING_PACKING"
,
配货完成
:
"PACKING_COMPLETED"
,
已完成
:
"COMPLETED"
,
已取消
:
"CANCELLED"
,
已归档
:
"ARCHIVE"
};
};
export
function
autoRegisterRouter
(
router
,
funcKey
,
handler
)
{
export
function
autoRegisterRouter
(
router
,
funcKey
,
handler
)
{
...
...
src/server/entity/function.js
View file @
1a6d16c7
...
@@ -6,7 +6,7 @@ import {
...
@@ -6,7 +6,7 @@ import {
copySingleImage
,
copySingleImage
,
createBatchFolder
createBatchFolder
}
from
"@/server/utils"
;
}
from
"@/server/utils"
;
const
{
downloadPngList
}
=
require
(
"@/utils/download-queue"
);
const
{
const
{
cropImageTransparentEdges
,
cropImageTransparentEdges
,
cropTransparentEdges
,
cropTransparentEdges
,
...
@@ -668,12 +668,119 @@ export default {
...
@@ -668,12 +668,119 @@ export default {
},
},
downloadMaterial
:
async
(
req
,
res
)
=>
{
downloadMaterial
:
async
(
req
,
res
)
=>
{
try
{
try
{
const
{
downloadDir
,
isArray
,
base
Path
}
=
req
.
body
;
const
{
urls
,
target
Path
}
=
req
.
body
;
const
data
=
await
downloadPngList
(
urls
,
targetPath
);
res
.
send
();
res
.
send
(
data
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
"downloadMaterial"
,
error
);
console
.
log
(
"downloadMaterial"
,
error
);
res
.
json
({
code
:
500
,
msg
:
error
});
res
.
json
({
code
:
500
,
msg
:
error
});
}
}
},
//获取生产配置
productionConfig
:
async
(
req
,
res
)
=>
{
env
=
getHostApi
().
apiApiHost
;
const
token
=
req
.
headers
[
"jwt-token"
];
let
url
=
pathMap
[
"productionConfig"
];
try
{
let
{
data
}
=
await
axios
.
get
(
`
${
env
}
/
${
url
}
`
,
{
headers
:
{
"jwt-token"
:
token
}
});
res
.
send
(
data
);
}
catch
(
error
)
{
console
.
log
(
"checkInventory"
,
error
);
res
.
json
({
code
:
500
,
msg
:
error
});
}
},
//更新生产配置
productionConfigUpdate
:
async
(
req
,
res
)
=>
{
env
=
getHostApi
().
apiApiHost
;
const
token
=
req
.
headers
[
"jwt-token"
];
const
params
=
req
.
body
;
let
url
=
pathMap
[
"productionConfigUpdate"
];
try
{
let
{
data
}
=
await
axios
.
post
(
`
${
env
}
/
${
url
}
`
,
{
headers
:
{
"jwt-token"
:
token
},
params
});
res
.
send
(
data
);
}
catch
(
error
)
{
console
.
log
(
"checkInventory"
,
error
);
res
.
json
({
code
:
500
,
msg
:
error
});
}
},
//排版列表(分页)
productionSoftware
:
async
(
req
,
res
)
=>
{
env
=
getHostApi
().
apiApiHost
;
const
token
=
req
.
headers
[
"jwt-token"
];
const
params
=
req
.
body
;
let
url
=
pathMap
[
"productionSoftware"
];
try
{
let
{
data
}
=
await
axios
.
post
(
`
${
env
}
/
${
url
}
`
,
{
headers
:
{
"jwt-token"
:
token
},
params
});
res
.
send
(
data
);
}
catch
(
error
)
{
console
.
log
(
"checkInventory"
,
error
);
res
.
json
({
code
:
500
,
msg
:
error
});
}
},
//查询该批次下的所有素材
listMaterialsByBatch
:
async
(
req
,
res
)
=>
{
env
=
getHostApi
().
apiApiHost
;
const
token
=
req
.
headers
[
"jwt-token"
];
const
params
=
req
.
body
;
let
url
=
pathMap
[
"listMaterialsByBatch"
];
try
{
let
{
data
}
=
await
axios
.
get
(
`
${
env
}
/
${
url
}
`
,
{
headers
:
{
"jwt-token"
:
token
},
params
});
res
.
send
(
data
);
}
catch
(
error
)
{
console
.
log
(
"checkInventory"
,
error
);
res
.
json
({
code
:
500
,
msg
:
error
});
}
},
//重新合成排版
psReComposingDesignImages
:
async
(
req
,
res
)
=>
{
env
=
getHostApi
().
apiApiHost
;
const
token
=
req
.
headers
[
"jwt-token"
];
const
params
=
req
.
body
;
let
url
=
pathMap
[
"psReComposingDesignImages"
];
try
{
let
{
data
}
=
await
axios
.
get
(
`
${
env
}
/
${
url
}
`
,
{
headers
:
{
"jwt-token"
:
token
},
params
});
res
.
send
(
data
);
}
catch
(
error
)
{
console
.
log
(
"checkInventory"
,
error
);
res
.
json
({
code
:
500
,
msg
:
error
});
}
},
//根据批次分页查询操作单
listOperationByBatch
:
async
(
req
,
res
)
=>
{
env
=
getHostApi
().
apiApiHost
;
const
token
=
req
.
headers
[
"jwt-token"
];
const
params
=
req
.
body
;
let
url
=
pathMap
[
"listOperationByBatch"
];
try
{
let
{
data
}
=
await
axios
.
post
(
`
${
env
}
/
${
url
}
`
,
{
headers
:
{
"jwt-token"
:
token
},
params
});
res
.
send
(
data
);
}
catch
(
error
)
{
console
.
log
(
"checkInventory"
,
error
);
res
.
json
({
code
:
500
,
msg
:
error
});
}
}
}
};
};
src/server/routes/index.js
View file @
1a6d16c7
...
@@ -60,6 +60,19 @@ router.post("/downloadMaterial", fn.downloadMaterial);
...
@@ -60,6 +60,19 @@ router.post("/downloadMaterial", fn.downloadMaterial);
//复制文件夹下文件
//复制文件夹下文件
router
.
post
(
"/copySingleImageFn"
,
fn
.
copySingleImageFn
);
router
.
post
(
"/copySingleImageFn"
,
fn
.
copySingleImageFn
);
//获取生产配置
router
.
post
(
"/productionConfig"
,
fn
.
productionConfig
);
//更新生产配置
router
.
post
(
"/productionConfigUpdate"
,
fn
.
productionConfigUpdate
);
//排版列表(分页)
router
.
post
(
"/productionSoftware"
,
fn
.
productionSoftware
);
//查询该批次下的所有素材
router
.
post
(
"/productionSoftware"
,
fn
.
productionSoftware
);
//重新合成排版
router
.
post
(
"/psReComposingDesignImages"
,
fn
.
psReComposingDesignImages
);
//根据批次分页查询操作单
router
.
post
(
"/listOperationByBatch"
,
fn
.
listOperationByBatch
);
// 根据生产单号查询详情
// 根据生产单号查询详情
autoRegisterRouter
(
router
,
"findByPodProductionNo"
,
fn
.
findByPodProductionNo
);
autoRegisterRouter
(
router
,
"findByPodProductionNo"
,
fn
.
findByPodProductionNo
);
...
...
src/server/utils/store.js
View file @
1a6d16c7
...
@@ -215,13 +215,13 @@ module.exports = {
...
@@ -215,13 +215,13 @@ module.exports = {
},
},
getDTFSetting
:
()
=>
getDTFSetting
:
()
=>
store
.
get
(
"DTFSetting"
)
||
{
store
.
get
(
"DTFSetting"
)
||
{
overWidthMode
:
"autoScale
"
,
widthStrategy
:
"1
"
,
// 最大素材数模式:batch / custom
// 最大素材数模式:batch / custom
ma
xPicMode
:
"batch
"
,
ma
terialStrategy
:
"1
"
,
// 自定义素材数量
// 自定义素材数量
customPicNum
:
30
,
materialCount
:
30
,
// 自动排版规格 40+2 / 60 / none
// 自动排版规格 40+2 / 60 / none
autoLayout
Type
:
"none
"
,
autoLayout
Strategy
:
"3
"
,
// 默认下载目录
// 默认下载目录
downloadDir
:
""
downloadDir
:
""
},
},
...
...
src/utils/download-queue.js
View file @
1a6d16c7
This diff is collapsed.
Click to expand it.
src/views/dtf-batch-detail/components/detailHead.vue
View file @
1a6d16c7
<
script
>
<
script
>
import
{
mapState
}
from
"vuex"
;
const
{
getDTFSetting
}
=
require
(
"@/server/utils/store"
);
const
{
getDesktopDevice
,
getDTFSetting
}
=
require
(
"@/server/utils/store"
);
const
{
ipcRenderer
}
=
require
(
"electron"
);
const
{
ipcRenderer
}
=
require
(
"electron"
);
export
default
{
export
default
{
...
@@ -18,39 +17,13 @@ export default {
...
@@ -18,39 +17,13 @@ export default {
return
{
return
{
dialogVisible
:
false
,
dialogVisible
:
false
,
dtfSetting
:
getDTFSetting
(),
dtfSetting
:
getDTFSetting
(),
radio
:
""
radio
:
""
,
searchForm
:
{}
};
};
},
},
computed
:
{
computed
:
{},
...
mapState
([
mounted
()
{},
"defaultProportion"
,
created
()
{},
"countryList"
,
"orderType"
,
"grid"
,
"imgList"
])
},
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
.
searchRef
?.
focus
();
if
(
this
.
desktopDevice
!==
3
)
{
this
.
selectGridIndex
=
0
;
this
.
setting
.
gridValue
=
0
;
}
else
{
this
.
selectGridIndex
=
5
;
this
.
setting
.
gridValue
=
5
;
}
});
this
.
$store
.
commit
(
"changeDesktopDevice"
,
getDesktopDevice
());
},
created
()
{
localStorage
.
setItem
(
"desktoVersion"
,
"print"
);
if
(
this
.
$dataStore
.
get
(
"setting"
))
{
this
.
setting
=
this
.
$dataStore
.
get
(
"setting"
);
}
else
{
this
.
$dataStore
.
set
(
"setting"
,
this
.
setting
);
}
},
methods
:
{
methods
:
{
dropdownCommand
(
v
)
{
dropdownCommand
(
v
)
{
...
@@ -87,13 +60,10 @@ export default {
...
@@ -87,13 +60,10 @@ export default {
goBack
()
{
goBack
()
{
this
.
$router
.
push
({
name
:
"design-dtf"
});
this
.
$router
.
push
({
name
:
"design-dtf"
});
},
},
goSetting
()
{
goSetting
()
{},
this
.
$router
.
push
({
getDataInfo
()
{
path
:
"/DTFsetting"
,
this
.
$emit
(
"search"
,
this
.
searchForm
);
query
:
{
id
:
123
}
});
},
},
getDataInfo
()
{},
productionCompleted
()
{
productionCompleted
()
{
this
.
$confirm
(
"确认完成生产?"
,
"提示"
,
{
this
.
$confirm
(
"确认完成生产?"
,
"提示"
,
{
confirmButtonText
:
"确定"
,
confirmButtonText
:
"确定"
,
...
@@ -106,13 +76,12 @@ export default {
...
@@ -106,13 +76,12 @@ export default {
changeTypesetting
()
{
changeTypesetting
()
{
this
.
dialogVisible
=
true
;
this
.
dialogVisible
=
true
;
},
},
submit
()
{
async
submit
()
{
console
.
log
(
this
.
radio
);
if
(
!
this
.
radio
)
{
if
(
!
this
.
radio
)
{
return
this
.
$message
.
error
(
"请选择排版宽度"
);
return
this
.
$message
.
error
(
"请选择排版宽度"
);
}
}
if
(
this
.
dtfSetting
.
overWidthMode
===
"biggerSize"
&&
this
.
radio
==
60
)
{
if
(
this
.
dtfSetting
.
widthStrategy
==
3
&&
this
.
radio
==
60
)
{
this
.
$confirm
(
this
.
$confirm
(
"由于排版设置中选择“按更大规格排版”仅适用于40+2,选60时,默认超60的规格不排版"
,
"由于排版设置中选择“按更大规格排版”仅适用于40+2,选60时,默认超60的规格不排版"
,
"提示"
,
"提示"
,
...
@@ -120,13 +89,19 @@ export default {
...
@@ -120,13 +89,19 @@ export default {
confirmButtonText
:
"确定"
,
confirmButtonText
:
"确定"
,
type
:
"warning"
type
:
"warning"
}
}
).
then
(()
=>
{
);
this
.
dialogVisible
=
false
;
await
this
.
$api
.
post
(
"/psReComposingDesignImages"
,
{
this
.
$message
(
batchArrangeNum
:
this
.
templateBatchArrangeNum
,
"排版进行中,请查看处理状态,排版完成的素材至文件夹排版素材查看"
templateWidth
:
this
.
radio
);
});
});
this
.
$message
(
"排版进行中,请查看处理状态,排版完成的素材至文件夹排版素材查看"
);
}
else
{
}
else
{
await
this
.
$api
.
post
(
"/psReComposingDesignImages"
,
{
batchArrangeNum
:
this
.
templateBatchArrangeNum
,
templateWidth
:
this
.
radio
});
this
.
$message
(
this
.
$message
(
"排版进行中,请查看处理状态,排版完成的素材至文件夹排版素材查看"
"排版进行中,请查看处理状态,排版完成的素材至文件夹排版素材查看"
);
);
...
@@ -161,8 +136,26 @@ export default {
...
@@ -161,8 +136,26 @@ export default {
>
返回
</el-button
>
返回
</el-button
></el-form-item
></el-form-item
>
>
<el-form-item>
<el-input></el-input></el-form-item>
<el-form-item>
<el-form-item
label=
"操作单状态"
>
<el-input></el-input></el-form-item>
<el-input
placeholder=
"请扫描操作单"
v-model=
"searchForm.operationNo"
></el-input
></el-form-item>
<el-form-item
label=
"操作单状态"
>
<el-select
v-model=
"searchForm.status"
placeholder=
"请选择"
clearable
>
<el-option
v-for=
"(value, label) in statusMap"
:key=
"value"
:label=
"label"
:value=
"value"
></el-option>
</el-select
></el-form-item>
<el-form-item
label=
"操作单排版状态"
>
<el-select
v-model=
"searchForm.layout"
placeholder=
"请选择"
>
<el-option
label=
"是"
:value=
"true"
></el-option>
<el-option
label=
"否"
:value=
"false"
>
</el-option>
</el-select
></el-form-item>
<el-form-item>
<el-form-item>
<el-button
@
click=
"getDataInfo"
type=
"primary"
<el-button
@
click=
"getDataInfo"
type=
"primary"
...
...
src/views/dtf-batch-detail/detail.vue
View file @
1a6d16c7
...
@@ -18,12 +18,7 @@ export default {
...
@@ -18,12 +18,7 @@ export default {
}),
}),
type
:
Object
type
:
Object
},
},
factoryType
:
{
type
:
String
,
default
:
"CN"
},
factoryType
:
{
type
:
String
,
default
:
"CN"
}
cardConfig
:
{
imageSrc
:
"./src/assets/template-bg-1.jpg"
,
title
:
"title"
,
time
:
"time"
}
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -31,7 +26,7 @@ export default {
...
@@ -31,7 +26,7 @@ export default {
detailVisible
:
false
,
detailVisible
:
false
,
logList
:
[],
logList
:
[],
pageInfo
:
{
pageInfo
:
{
pageNum
:
1
,
currentPage
:
1
,
pageSize
:
10
,
pageSize
:
10
,
total
:
2
total
:
2
},
},
...
@@ -49,14 +44,14 @@ export default {
...
@@ -49,14 +44,14 @@ export default {
};
};
}),
}),
detailRow
:
{
detailRow
:
{
name
:
{
label
:
"批次号"
,
value
:
111
},
batchArrangeNumber
:
{
label
:
"批次号"
,
value
:
111
},
name1
:
{
label
:
"操作单数量"
,
value
:
111
},
operationNum
:
{
label
:
"操作单数量"
,
value
:
111
},
name2
:
{
label
:
"素材数量"
,
value
:
111
},
materialNum
:
{
label
:
"素材数量"
,
value
:
111
},
name3
:
{
label
:
"工艺类型"
,
value
:
111
},
craftType
:
{
label
:
"工艺类型"
,
value
:
111
},
name6
:
{
label
:
"规范素材"
,
value
:
111
},
standardDesignImage
:
{
label
:
"规范素材"
,
value
:
111
},
name4
:
{
label
:
"创建时间"
,
value
:
111
},
createTime
:
{
label
:
"创建时间"
,
value
:
111
},
name5
:
{
label
:
"排版状态"
,
value
:
111
},
layoutStatus
:
{
label
:
"排版状态"
,
value
:
111
},
name7
:
{
label
:
"操作单状态"
,
value
:
111
}
status
:
{
label
:
"操作单状态"
,
value
:
111
}
}
}
};
};
},
},
...
@@ -180,30 +175,25 @@ export default {
...
@@ -180,30 +175,25 @@ export default {
{{
item
.
operationNo
}}
{{
item
.
operationNo
}}
</span>
</span>
</
template
>
</
template
>
<
template
#
top_
lef
t
>
<
template
#
top_
righ
t
>
<el-tooltip
<el-tooltip
v-if=
"item.
outOfStock
"
v-if=
"item.
layout
"
effect=
"light"
effect=
"light"
content=
"
缺货
"
content=
"
排版完成
"
placement=
"bottom"
placement=
"bottom"
>
>
<div
<div
style=
"
style=
"
background-color: #f
56c6c
;
background-color: #f
0f9eb
;
color: #fff;
color: #fff;
padding: 2px 4px;
padding: 2px 4px;
border-radius: 4px;
font-size: 12px;
font-size: 12px;
"
"
>
>
缺
排
</div>
</div>
</el-tooltip>
</el-tooltip>
<span
v-if=
"item.tagsId"
class=
"flex-row flex-row-gap6"
>
<el-tag
v-for=
"tag in getItemTags(item.tagsId)"
:key=
"tag.id"
>
{{
tag
.
name
}}
</el-tag>
</span>
</
template
>
</
template
>
<
template
#
images
>
<
template
#
images
>
...
@@ -291,9 +281,9 @@ export default {
...
@@ -291,9 +281,9 @@ export default {
<div
class=
"card-info-row full"
>
<div
class=
"card-info-row full"
>
<span
<span
class=
"info-value ellipsis"
class=
"info-value ellipsis"
:title=
"item.
productName
|| ''"
:title=
"item.
operationNo
|| ''"
>
>
{{
item
.
productName
}}
{{
item
.
operationNo
}}
</span>
</span>
</div>
</div>
<div
class=
"card-info-row"
>
<div
class=
"card-info-row"
>
...
...
src/views/dtf-list/components/head.vue
View file @
1a6d16c7
<
script
>
<
script
>
import
{
mapState
}
from
"vuex"
;
const
{
getDesktopDevice
}
=
require
(
"@/server/utils/store"
);
export
default
{
export
default
{
props
:
{
props
:
{
user
:
{
user
:
{
...
@@ -13,38 +11,13 @@ export default {
...
@@ -13,38 +11,13 @@ export default {
factoryType
:
{
type
:
String
,
default
:
"CN"
}
factoryType
:
{
type
:
String
,
default
:
"CN"
}
},
},
data
()
{
data
()
{
return
{};
return
{
},
searchForm
:
{
batchArrangeNumber
:
""
,
layoutStatus
:
""
,
startTime
:
""
}
computed
:
{
};
...
mapState
([
"defaultProportion"
,
"countryList"
,
"orderType"
,
"grid"
,
"imgList"
])
},
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
.
searchRef
?.
focus
();
if
(
this
.
desktopDevice
!==
3
)
{
this
.
selectGridIndex
=
0
;
this
.
setting
.
gridValue
=
0
;
}
else
{
this
.
selectGridIndex
=
5
;
this
.
setting
.
gridValue
=
5
;
}
});
this
.
$store
.
commit
(
"changeDesktopDevice"
,
getDesktopDevice
());
},
created
()
{
localStorage
.
setItem
(
"desktoVersion"
,
"print"
);
if
(
this
.
$dataStore
.
get
(
"setting"
))
{
this
.
setting
=
this
.
$dataStore
.
get
(
"setting"
);
}
else
{
this
.
$dataStore
.
set
(
"setting"
,
this
.
setting
);
}
},
},
computed
:
{},
mounted
()
{},
created
()
{},
methods
:
{
methods
:
{
dropdownCommand
(
v
)
{
dropdownCommand
(
v
)
{
...
@@ -78,14 +51,7 @@ export default {
...
@@ -78,14 +51,7 @@ export default {
return
""
;
return
""
;
},
},
goBack
()
{
// Vue路由返回
this
.
$router
.
push
({
name
:
"design"
});
// 如果需要关闭当前弹窗/子窗口,搭配:
// ipcRenderer.send("close-current-win");
},
goSetting
()
{
goSetting
()
{
this
.
$router
.
push
({
this
.
$router
.
push
({
name
:
"dtf-setting"
name
:
"dtf-setting"
...
@@ -96,7 +62,9 @@ export default {
...
@@ -96,7 +62,9 @@ export default {
name
:
"dtf-batch-detail"
name
:
"dtf-batch-detail"
});
});
},
},
getDataInfo
()
{}
getDataInfo
()
{
this
.
$emit
(
"search"
,
this
.
searchForm
);
}
}
}
};
};
</
script
>
</
script
>
...
@@ -104,10 +72,39 @@ export default {
...
@@ -104,10 +72,39 @@ export default {
<
template
>
<
template
>
<div>
<div>
<div
class=
"page-header"
>
<div
class=
"page-header"
>
<el-form
style=
"display: flex;flex-wrap: nowrap;"
inline
>
<el-form
<el-form-item
label=
"批次号"
>
<el-input></el-input></el-form-item>
style=
"display: flex;flex-wrap: nowrap;"
<el-form-item
label=
"排版状态"
>
<el-input></el-input></el-form-item>
inline
<el-form-item
label=
"创建时间"
>
<el-input></el-input></el-form-item>
:model=
"searchForm"
>
<el-form-item
label=
"批次号"
>
<el-input
v-model=
"searchForm.batchArrangeNumber"
placeholder=
"请输入批次号"
></el-input
></el-form-item>
<el-form-item
label=
"排版状态"
>
<el-select
v-model=
"searchForm.layoutStatus"
placeholder=
"请选择排版状态"
>
<el-option
label=
"待排版"
:value=
"1"
></el-option>
<el-option
label=
"排版中"
:value=
"2"
>
</el-option>
<el-option
label=
"排版成功"
:value=
"3"
>
</el-option>
<el-option
label=
"排版失败"
:value=
"4"
>
</el-option>
<el-option
label=
"部分成功"
:value=
"5"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"创建时间"
>
<el-date-picker
v-model=
"searchForm.startTime"
type=
"datetime"
placeholder=
"选择创建时间"
format=
"yyyy 年 MM 月 dd 日"
value-format=
"yyyy-MM-dd"
>
</el-date-picker
></el-form-item>
<el-form-item>
<el-form-item>
<el-button
@
click=
"getDataInfo"
type=
"primary"
<el-button
@
click=
"getDataInfo"
type=
"primary"
>
查询
>
查询
...
@@ -118,12 +115,6 @@ export default {
...
@@ -118,12 +115,6 @@ export default {
>
DTF排版设置
>
DTF排版设置
</el-button></el-form-item
</el-button></el-form-item
>
>
<el-form-item>
<el-button
@
click=
"goSetting1"
type=
"success"
>
详情页
</el-button></el-form-item
>
</el-form>
</el-form>
<div
class=
"right-user"
>
<div
class=
"right-user"
>
...
...
src/views/dtf-list/index.vue
View file @
1a6d16c7
This diff is collapsed.
Click to expand it.
src/views/dtf-setting/index.vue
View file @
1a6d16c7
...
@@ -21,26 +21,24 @@
...
@@ -21,26 +21,24 @@
<div
class=
"setting-group"
>
<div
class=
"setting-group"
>
<div
class=
"group-title"
>
素材超排版宽度时:
</div>
<div
class=
"group-title"
>
素材超排版宽度时:
</div>
<el-radio-group
v-model=
"form.overWidthMode"
>
<el-radio-group
v-model=
"form.widthStrategy"
>
<el-radio
label=
"autoScale"
>
自动缩小素材,适配烫画模宽度
</el-radio>
<el-radio
:label=
"1"
>
自动缩小素材,适配烫画模宽度
</el-radio>
<el-radio
label=
"skip"
>
超出排版宽度不排版
</el-radio>
<el-radio
:label=
"2"
>
超出排版宽度不排版
</el-radio>
<el-radio
label=
"biggerSize"
<el-radio
:label=
"3"
>
超出排版宽度,使用更大规格排版
</el-radio>
>
超出排版宽度,使用更大规格排版
</el-radio
>
</el-radio-group>
</el-radio-group>
</div>
</div>
<div
class=
"setting-group"
>
<div
class=
"setting-group"
>
<div
class=
"group-title"
>
单张排版最大素材数:
</div>
<div
class=
"group-title"
>
单张排版最大素材数:
</div>
<el-radio-group
v-model=
"form.ma
xPicMode
"
>
<el-radio-group
v-model=
"form.ma
terialStrategy
"
>
<el-radio
label=
"batch
"
>
批次素材数
</el-radio>
<el-radio
:label=
"1
"
>
批次素材数
</el-radio>
<div
class=
"custom-num-row"
>
<div
class=
"custom-num-row"
>
<el-radio
label=
"custom
"
>
自定义素材数(建议数量30):
</el-radio>
<el-radio
:label=
"2
"
>
自定义素材数(建议数量30):
</el-radio>
<el-input
<el-input
v-model
.
number=
"form.
customPicNum
"
v-model
.
number=
"form.
materialCount
"
placeholder=
"请输入素材数"
placeholder=
"请输入素材数"
style=
"width: 180px; margin-left: 8px"
style=
"width: 180px; margin-left: 8px"
:disabled=
"form.ma
xPicMode !== 'custom
'"
:disabled=
"form.ma
terialStrategy !== '2
'"
/>
/>
</div>
</div>
</el-radio-group>
</el-radio-group>
...
@@ -48,10 +46,10 @@
...
@@ -48,10 +46,10 @@
<div
class=
"setting-group"
>
<div
class=
"setting-group"
>
<div
class=
"group-title"
>
自动排版设置
</div>
<div
class=
"group-title"
>
自动排版设置
</div>
<el-radio-group
v-model=
"form.autoLayout
Type
"
>
<el-radio-group
v-model=
"form.autoLayout
Strategy
"
>
<el-radio
label=
"40+2
"
>
40+2
</el-radio>
<el-radio
:label=
"1
"
>
40+2
</el-radio>
<el-radio
label=
"60
"
>
60
</el-radio>
<el-radio
:label=
"2
"
>
60
</el-radio>
<el-radio
label=
"none
"
>
不执行自动排版
</el-radio>
<el-radio
:label=
"3
"
>
不执行自动排版
</el-radio>
</el-radio-group>
</el-radio-group>
</div>
</div>
...
@@ -78,25 +76,19 @@
...
@@ -78,25 +76,19 @@
<
script
>
<
script
>
const
{
ipcRenderer
}
=
require
(
"electron"
);
const
{
ipcRenderer
}
=
require
(
"electron"
);
const
{
const
{
setDTFSetting
,
getDTFSetting
}
=
require
(
"@/server/utils/store"
);
getProductType
,
setProductType
,
setDTFSetting
,
getDTFSetting
}
=
require
(
"@/server/utils/store"
);
export
default
{
export
default
{
name
:
"dtf-setting"
,
name
:
"dtf-setting"
,
data
()
{
data
()
{
return
{
return
{
// 表单配置,可从本地配置文件读取初始化
// 表单配置,可从本地配置文件读取初始化
form
:
{
...
getDTFSetting
()
},
form
:
{
...
getDTFSetting
()
}
activeName
:
getProductType
()
};
};
},
},
mounted
()
{
mounted
()
{
// 页面加载读取本地配置回填表单
// 页面加载读取本地配置回填表单
this
.
loadLocalConfig
();
//
this.loadLocalConfig();
},
},
methods
:
{
methods
:
{
// 返回上一页
// 返回上一页
...
@@ -105,12 +97,13 @@ export default {
...
@@ -105,12 +97,13 @@ export default {
},
},
// 读取本地配置
// 读取本地配置
async
loadLocalConfig
()
{
async
loadLocalConfig
()
{
ipcRenderer
.
send
(
"read-layout-config"
);
try
{
ipcRenderer
.
once
(
"layout-config-data"
,
(
_
,
cfg
)
=>
{
const
{
data
}
=
await
this
.
$api
.
post
(
"/productionConfig"
);
if
(
cfg
)
{
this
.
form
=
{
...
data
};
this
.
form
=
Object
.
assign
({},
this
.
form
,
cfg
);
setDTFSetting
({
...
this
.
form
});
}
}
catch
(
error
)
{
});
console
.
log
(
error
);
}
},
},
// 选择文件夹弹窗
// 选择文件夹弹窗
selectFolder
()
{
selectFolder
()
{
...
@@ -120,11 +113,8 @@ export default {
...
@@ -120,11 +113,8 @@ export default {
});
});
},
},
// 保存配置到本地文件
// 保存配置到本地文件
saveConfig
()
{
async
saveConfig
()
{
if
(
if
(
this
.
form
.
autoLayoutStrategy
==
2
&&
this
.
form
.
widthStrategy
==
3
)
{
this
.
form
.
autoLayoutType
==
"60"
&&
this
.
form
.
overWidthMode
===
"biggerSize"
)
{
this
.
$confirm
(
this
.
$confirm
(
"由于排版设置中选择“按更大规格排版”仅适用于40+2,选60时,默认超60的规格不排版"
,
"由于排版设置中选择“按更大规格排版”仅适用于40+2,选60时,默认超60的规格不排版"
,
"提示"
,
"提示"
,
...
@@ -132,17 +122,11 @@ export default {
...
@@ -132,17 +122,11 @@ export default {
confirmButtonText
:
"确定"
,
confirmButtonText
:
"确定"
,
type
:
"warning"
type
:
"warning"
}
}
).
then
(()
=>
{
);
this
.
$message
.
success
(
"排版设置保存成功!"
);
});
}
else
{
this
.
$message
.
success
(
"排版设置保存成功!"
);
}
}
await
this
.
$api
.
post
(
"/productionConfigUpdate"
,
this
.
form
);
setDTFSetting
({
...
this
.
form
});
setDTFSetting
({
...
this
.
form
});
},
this
.
$message
.
success
(
"排版设置保存成功!"
);
tabClick
(
tab
)
{
if
(
tab
.
name
==
"DTG"
)
this
.
goBack
();
setProductType
(
tab
.
name
);
}
}
}
}
};
};
...
...
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