Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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
linweijiong
jinfa-platform
Commits
77e2e162
Commit
77e2e162
authored
Dec 16, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 商品导出二维码仅限上架商品
parent
60302a68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
17 deletions
+12
-17
index.tsx
src/pages/commodity/products/index.tsx
+12
-17
No files found.
src/pages/commodity/products/index.tsx
View file @
77e2e162
...
@@ -523,6 +523,10 @@ const Products: React.FC<{}> = () => {
...
@@ -523,6 +523,10 @@ const Products: React.FC<{}> = () => {
}
else
if
(
e
.
key
===
'3'
||
e
.
key
===
'4'
)
{
}
else
if
(
e
.
key
===
'3'
||
e
.
key
===
'4'
)
{
handleBatch
(
e
.
key
)
handleBatch
(
e
.
key
)
}
else
if
(
e
.
key
===
'5'
)
{
}
else
if
(
e
.
key
===
'5'
)
{
console
.
log
(
currentRefRow
.
current
)
if
(
!
currentRefRow
.
current
.
every
(
item
=>
item
.
status
===
5
))
{
return
message
.
error
(
'请选择上架的商品操作'
)
}
currentRef
.
current
.
length
?
setExportQrcodeModal
(
true
)
:
message
.
error
(
'请选择需要操作的商品'
)
currentRef
.
current
.
length
?
setExportQrcodeModal
(
true
)
:
message
.
error
(
'请选择需要操作的商品'
)
}
}
}
}
...
@@ -533,23 +537,14 @@ const Products: React.FC<{}> = () => {
...
@@ -533,23 +537,14 @@ const Products: React.FC<{}> = () => {
a
.
style
=
"display: none"
a
.
style
=
"display: none"
setExportLoading
(
true
)
setExportLoading
(
true
)
postProductCommodityExportCommodityQrCode
({
idList
:
currentRef
.
current
},
{
responseType
:
'blob'
,
getResponse
:
true
}).
then
((
res
:
any
)
=>
{
postProductCommodityExportCommodityQrCode
({
idList
:
currentRef
.
current
},
{
responseType
:
'blob'
,
getResponse
:
true
}).
then
((
res
:
any
)
=>
{
const
{
code
,
data
,
response
}
=
res
const
{
data
,
response
}
=
res
if
(
code
!==
1000
)
{
const
filename
=
response
.
headers
.
get
(
'content-disposition'
).
split
(
'='
)[
1
]
throw
new
Error
(
res
.
message
)
let
blob
=
new
Blob
([
data
],
{
type
:
"application/x-zip-compressed"
})
}
else
{
const
url
=
window
.
URL
.
createObjectURL
(
blob
);
const
filename
=
response
.
headers
.
get
(
'content-disposition'
).
split
(
'='
)[
1
]
a
.
href
=
url
;
let
blob
=
new
Blob
([
data
],
{
type
:
"application/x-zip-compressed"
})
a
.
download
=
filename
;
// let objectUrl = URL.createObjectURL(blob)
a
.
click
();
// window.location.href = objectUrl
window
.
URL
.
revokeObjectURL
(
url
);
const
url
=
window
.
URL
.
createObjectURL
(
blob
);
a
.
href
=
url
;
a
.
download
=
filename
;
a
.
click
();
window
.
URL
.
revokeObjectURL
(
url
);
}
}).
catch
(
error
=>
{
console
.
log
(
error
,
'error'
)
message
.
error
(
error
)
}).
finally
(()
=>
{
}).
finally
(()
=>
{
setExportLoading
(
false
)
setExportLoading
(
false
)
message
.
success
(
'导出成功'
)
message
.
success
(
'导出成功'
)
...
...
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