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
5a6add14
Commit
5a6add14
authored
Jul 22, 2026
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 操作单详情下载素材修改
parent
6d844a0d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
34 deletions
+84
-34
src/config/index.js
+1
-0
src/server/entity/function.js
+11
-2
src/views/dtf-batch-detail/components/detailHead.vue
+63
-16
src/views/dtf-batch-detail/detail.vue
+9
-16
No files found.
src/config/index.js
View file @
5a6add14
...
@@ -12,6 +12,7 @@ export const pathMap = {
...
@@ -12,6 +12,7 @@ export const pathMap = {
US
:
"factory/podJomallOrderProductUs/downloadDesignImages"
,
US
:
"factory/podJomallOrderProductUs/downloadDesignImages"
,
GC
:
"factory/podJomallOrder/downloadByProduction"
,
GC
:
"factory/podJomallOrder/downloadByProduction"
,
OP
:
"factory/podOrderOperation/downloadDesignImages"
,
OP
:
"factory/podOrderOperation/downloadDesignImages"
,
DTF
:
"factory/podOrderOperation/softwareProduction-downloadDesignImages"
,
USHLC
:
"factory/podJomallOrderProductUs/downloadCompatibleDesignImages"
,
USHLC
:
"factory/podJomallOrderProductUs/downloadCompatibleDesignImages"
,
CNHLC
:
"factory/podJomallOrderProductCn/downloadCompatibleDesignImages"
,
CNHLC
:
"factory/podJomallOrderProductCn/downloadCompatibleDesignImages"
,
OPHLC
:
"factory/podOrderOperation/downloadCompatibleDesignImages"
OPHLC
:
"factory/podOrderOperation/downloadCompatibleDesignImages"
...
...
src/server/entity/function.js
View file @
5a6add14
...
@@ -156,11 +156,20 @@ export default {
...
@@ -156,11 +156,20 @@ export default {
env
=
getHostApi
().
apiApiHost
;
env
=
getHostApi
().
apiApiHost
;
fileEnv
=
getHostApi
().
fileApiUrl
;
fileEnv
=
getHostApi
().
fileApiUrl
;
const
params
=
req
.
body
;
const
params
=
req
.
body
;
const
targetDir
=
params
.
targetDir
||
""
;
const
token
=
req
.
headers
[
"jwt-token"
];
const
token
=
req
.
headers
[
"jwt-token"
];
const
forceProduction
=
params
.
forceProduction
||
false
;
const
downloadBySubOrderNumber
=
pathMap
[
"downloadBySubOrderNumber"
];
const
downloadBySubOrderNumber
=
pathMap
[
"downloadBySubOrderNumber"
];
try
{
try
{
if
(
Array
.
isArray
(
params
))
{
const
routePath
=
req
.
path
.
replace
(
/^
\/
/
,
""
);
const
postUrl
=
`
${
env
}
/
${
routePath
}
`
;
const
{
data
}
=
await
axios
.
post
(
postUrl
,
params
,
{
headers
:
{
"jwt-token"
:
token
}
});
return
res
.
json
(
data
);
}
const
targetDir
=
params
.
targetDir
||
""
;
const
forceProduction
=
params
.
forceProduction
||
false
;
let
url
=
downloadBySubOrderNumber
[
params
.
orderType
];
let
url
=
downloadBySubOrderNumber
[
params
.
orderType
];
let
postUrl
=
`
${
env
}
/
${
url
}
`
;
let
postUrl
=
`
${
env
}
/
${
url
}
`
;
if
(
params
.
device
==
3
)
{
if
(
params
.
device
==
3
)
{
...
...
src/views/dtf-batch-detail/components/detailHead.vue
View file @
5a6add14
...
@@ -6,6 +6,11 @@ const { pathMap } = require("@/config/index.js");
...
@@ -6,6 +6,11 @@ const { pathMap } = require("@/config/index.js");
const
{
getUser
}
=
require
(
"@/server/utils/store"
);
const
{
getUser
}
=
require
(
"@/server/utils/store"
);
var
path
=
require
(
"path"
);
var
path
=
require
(
"path"
);
import
bus
from
"@/bus"
;
import
bus
from
"@/bus"
;
import
{
submitDownload
,
getDownloadStatus
,
onDownloadStatusChange
}
from
"@/utils/download-api"
;
export
default
{
export
default
{
props
:
{
props
:
{
selection
:
{
type
:
Array
,
default
:
()
=>
[]
},
selection
:
{
type
:
Array
,
default
:
()
=>
[]
},
...
@@ -19,11 +24,13 @@ export default {
...
@@ -19,11 +24,13 @@ export default {
curBatchArrangeNum
:
""
,
curBatchArrangeNum
:
""
,
searchForm
:
{},
searchForm
:
{},
statusMap
:
statusMap
,
statusMap
:
statusMap
,
userData
:
getUser
()
userData
:
getUser
(),
isDownloading
:
false
,
removeStatusListener
:
null
};
};
},
},
mounted
()
{
async
mounted
()
{
const
params
=
this
.
$route
.
params
;
const
params
=
this
.
$route
.
params
;
this
.
curBatchArrangeNum
=
params
.
batchArrangeNum
;
this
.
curBatchArrangeNum
=
params
.
batchArrangeNum
;
bus
.
$on
(
"downLoadFile"
,
async
v
=>
{
bus
.
$on
(
"downLoadFile"
,
async
v
=>
{
...
@@ -49,6 +56,13 @@ export default {
...
@@ -49,6 +56,13 @@ export default {
this
.
$message
.
error
(
error
);
this
.
$message
.
error
(
error
);
}
}
});
});
this
.
removeStatusListener
=
onDownloadStatusChange
(
status
=>
{
this
.
handleDownloadStatus
(
status
);
});
await
this
.
syncDownloadStatus
();
},
beforeDestroy
()
{
if
(
this
.
removeStatusListener
)
this
.
removeStatusListener
();
},
},
created
()
{},
created
()
{},
...
@@ -94,29 +108,62 @@ export default {
...
@@ -94,29 +108,62 @@ export default {
if
(
!
this
.
podOrderProductIds
.
length
)
{
if
(
!
this
.
podOrderProductIds
.
length
)
{
return
this
.
$message
.
warning
(
"请选择操作单"
);
return
this
.
$message
.
warning
(
"请选择操作单"
);
}
}
if
(
this
.
isDownloading
)
{
return
this
.
$message
.
warning
(
"正在下载中,请等待完成后再操作"
);
}
try
{
try
{
this
.
isDownloading
=
true
;
const
res
=
await
this
.
$api
.
post
(
const
res
=
await
this
.
$api
.
post
(
pathMap
[
"downloadBySubOrderNumber"
][
"OP"
],
pathMap
[
"downloadBySubOrderNumber"
][
"DTF"
],
{
this
.
podOrderProductIds
ids
:
this
.
podOrderProductIds
,
);
device
:
4
,
if
(
res
.
code
!==
200
||
!
res
.
data
||
res
.
data
.
length
===
0
)
{
orderType
:
"OP"
,
this
.
$message
.
warning
(
res
.
msg
||
"暂无素材可下载"
);
targetDir
:
path
.
join
(
this
.
isDownloading
=
false
;
return
;
}
const
urls
=
res
.
data
.
map
(
item
=>
({
url
:
item
.
fileUrl
,
fileName
:
item
.
fileName
}));
const
downloadRes
=
await
submitDownload
({
urls
,
targetPath
:
path
.
join
(
getDTFSetting
().
downloadDir
,
getDTFSetting
().
downloadDir
,
`批次号:
${
this
.
curBatchArrangeNum
}
`
,
`批次号:
${
this
.
curBatchArrangeNum
}
`
,
"原素材"
"原素材"
)
),
batchArrangeNum
:
this
.
curBatchArrangeNum
});
if
(
downloadRes
.
code
!==
200
)
{
this
.
isDownloading
=
false
;
this
.
$message
.
error
(
downloadRes
.
msg
);
}
}
);
}
catch
(
error
)
{
if
(
res
.
code
===
200
)
{
console
.
error
(
error
.
message
||
"下载失败"
);
this
.
$message
.
error
(
"下载提交失败,请重试"
);
this
.
isDownloading
=
false
;
}
},
handleDownloadStatus
(
status
)
{
this
.
isDownloading
=
status
.
isRunning
;
if
(
!
status
.
isRunning
&&
status
.
result
)
{
const
{
success
,
failed
}
=
status
.
result
;
const
{
currentBatchNo
}
=
status
;
this
.
$message
.
success
(
this
.
$message
.
success
(
`批次号:
${
this
.
curBatchArrangeNum
}
,素材下载成功
`
`批次号:
${
currentBatchNo
}
,下载完成:成功
${
success
.
length
}
个,失败
${
failed
.
length
}
个
`
);
);
}
else
{
if
(
failed
.
length
>
0
)
{
this
.
$message
.
error
(
res
.
msg
||
"下载失败"
);
console
.
warn
(
"下载失败明细:"
,
failed
);
}
}
}
catch
(
error
)
{
}
this
.
$message
.
error
(
error
.
message
||
"下载失败"
);
},
async
syncDownloadStatus
()
{
try
{
const
res
=
await
getDownloadStatus
();
this
.
isDownloading
=
res
.
data
.
isRunning
;
}
catch
(
err
)
{
console
.
error
(
"同步下载状态失败"
,
err
);
}
}
},
},
getDataInfo
()
{
getDataInfo
()
{
...
...
src/views/dtf-batch-detail/detail.vue
View file @
5a6add14
...
@@ -144,26 +144,18 @@ export default {
...
@@ -144,26 +144,18 @@ export default {
label
:
"全部选择"
,
label
:
"全部选择"
,
click
:
()
=>
{
click
:
()
=>
{
const
cardIds
=
this
.
cardList
.
map
(
el
=>
el
.
id
);
const
cardIds
=
this
.
cardList
.
map
(
el
=>
el
.
id
);
const
cardProIds
=
this
.
cardList
.
map
(
el
=>
el
.
podOrderProductId
);
this
.
podOrderProductIds
=
Array
.
from
(
new
Set
([...
this
.
podOrderProductIds
,
...
cardProIds
])
);
this
.
selection
=
Array
.
from
(
this
.
selection
=
Array
.
from
(
new
Set
([...
this
.
selection
,
...
cardIds
])
new
Set
([...
this
.
selection
,
...
cardIds
])
);
);
this
.
rebuildPodOrderProductIds
();
}
}
},
},
{
{
label
:
"取消选择"
,
label
:
"取消选择"
,
click
:
()
=>
{
click
:
()
=>
{
const
cardIdSet
=
new
Set
(
this
.
cardList
.
map
(
el
=>
el
.
id
));
const
cardIdSet
=
new
Set
(
this
.
cardList
.
map
(
el
=>
el
.
id
));
const
cardProIdsSet
=
new
Set
(
this
.
cardList
.
map
(
el
=>
el
.
podOrderProductId
)
);
this
.
selection
=
this
.
selection
.
filter
(
id
=>
!
cardIdSet
.
has
(
id
));
this
.
selection
=
this
.
selection
.
filter
(
id
=>
!
cardIdSet
.
has
(
id
));
this
.
podOrderProductIds
=
this
.
selection
.
filter
(
this
.
rebuildPodOrderProductIds
();
id
=>
!
cardProIdsSet
.
has
(
id
)
);
}
}
}
}
];
];
...
@@ -215,17 +207,18 @@ export default {
...
@@ -215,17 +207,18 @@ export default {
},
},
changeActive
(
item
)
{
changeActive
(
item
)
{
const
index
=
this
.
selection
.
indexOf
(
item
.
id
);
const
index
=
this
.
selection
.
indexOf
(
item
.
id
);
const
podIndex
=
this
.
podOrderProductIds
.
indexOf
(
item
.
podOrderProductId
);
if
(
podIndex
>
-
1
)
{
this
.
podOrderProductIds
.
splice
(
podIndex
,
1
);
}
else
{
this
.
podOrderProductIds
.
push
(
item
.
podOrderProductId
);
}
if
(
index
>
-
1
)
{
if
(
index
>
-
1
)
{
this
.
selection
.
splice
(
index
,
1
);
this
.
selection
.
splice
(
index
,
1
);
}
else
{
}
else
{
this
.
selection
.
push
(
item
.
id
);
this
.
selection
.
push
(
item
.
id
);
}
}
this
.
rebuildPodOrderProductIds
();
},
rebuildPodOrderProductIds
()
{
const
selectedSet
=
new
Set
(
this
.
selection
);
this
.
podOrderProductIds
=
this
.
cardList
.
filter
(
card
=>
selectedSet
.
has
(
card
.
id
))
.
map
(
card
=>
card
.
podOrderProductId
);
},
},
isSelected
(
item
)
{
isSelected
(
item
)
{
return
this
.
selection
.
includes
(
item
.
id
);
return
this
.
selection
.
includes
(
item
.
id
);
...
...
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