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
c8e851bc
Commit
c8e851bc
authored
Apr 12, 2024
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 重新生成稿件功能开发
parent
4d4af4f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletions
+41
-1
src/api/order.ts
+7
-0
src/views/order/index.vue
+34
-1
No files found.
src/api/order.ts
View file @
c8e851bc
...
...
@@ -41,6 +41,13 @@ export function downloadOrder(id: number) {
{
params
:
{
id
}
},
)
}
// 重新生成稿件
export
function
reGenerateScriptUrlApi
(
ids
:
number
[])
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'factory/customJomallOrder/downloadAgain'
,
ids
,
)
}
// 打印生产单
export
function
printOrder
(
ids
:
number
[])
{
...
...
src/views/order/index.vue
View file @
c8e851bc
...
...
@@ -81,11 +81,16 @@
<
ElButton
type
=
"success"
@
click
=
"confirmProduce"
>
确认生产
<
/ElButton
>
<
/span
>
<
span
v
-
if
=
"statusCode === 2 || statusCode === 3"
class
=
"item"
>
<
span
v
-
if
=
"statusCode === 2 || statusCode === 3
|| statusCode === 4
"
class
=
"item"
>
<
ElButton
type
=
"warning"
is
-
dark
@
click
=
"downloadManuscript"
>
下载稿件
<
/ElButto
n
>
<
/span
>
<
span
v
-
if
=
"statusCode === 2 || statusCode === 3 || statusCode === 4"
class
=
"item"
>
<
ElButton
type
=
"success"
is
-
dark
@
click
=
"reGenerateManuscript"
>
重新生成稿件
<
/ElButto
n
>
<
/span
>
<
span
v
-
if
=
"statusCode === 2 || statusCode === 3"
class
=
"item"
>
<
ElButton
type
=
"primary"
dark
@
click
=
"printManuscript"
>
打印生产单
<
/ElButto
n
...
...
@@ -485,6 +490,7 @@ import {
getLogList
,
getOrderDetail
,
cancelOrderApi
,
reGenerateScriptUrlApi
,
}
from
'@/api/order'
import
{
showError
,
showConfirm
}
from
'@/utils/ui'
import
{
useValue
}
from
'@/utils/hooks/useValue'
...
...
@@ -678,6 +684,33 @@ const downloadManuscript = async () => {
window
.
open
(
filePath
+
path
)
}
)
}
// 重新生成稿件
const
reGenerateManuscript
=
async
()
=>
{
if
(
selection
.
value
.
length
===
0
)
{
return
ElMessage
({
message
:
'请选择订单'
,
type
:
'warning'
,
offset
:
window
.
innerHeight
/
2
,
}
)
}
const
ids
=
selection
.
value
.
map
((
item
)
=>
item
.
id
)
try
{
await
showConfirm
(
'是否重新生成'
,
{
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}
)
}
catch
{
return
}
try
{
const
res
=
await
reGenerateScriptUrlApi
(
ids
)
ElMessage
.
success
(
res
.
message
)
search
()
}
catch
(
e
)
{
showError
(
e
)
}
}
// 打印生产单
const
printManuscript
=
async
()
=>
{
if
(
selection
.
value
.
length
===
0
)
{
...
...
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