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
shenshaokai
jinfa-platform
Commits
59c041ef
Commit
59c041ef
authored
Mar 04, 2022
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 对接商品列表导出
parent
d02f486c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
2 deletions
+57
-2
commodity.ts
src/locales/en-US/commodity.ts
+2
-0
common.ts
src/locales/en-US/common.ts
+1
-0
commodity.ts
src/locales/ko-KR/commodity.ts
+2
-0
common.ts
src/locales/ko-KR/common.ts
+1
-0
commodity.ts
src/locales/zh-CN/commodity.ts
+2
-0
common.ts
src/locales/zh-CN/common.ts
+2
-0
index.tsx
src/pages/commodity/products/index.tsx
+47
-2
No files found.
src/locales/en-US/commodity.ts
View file @
59c041ef
...
...
@@ -159,6 +159,7 @@ export default {
'commodity.products.handleBatchDelete.okText'
:
'OK'
,
'commodity.products.handleBatchDelete.cancelText'
:
'Cancel'
,
'commodity.products.handleBatchDelete.error'
:
'Please select the product that needs to be operated'
,
'commodity.products.handleExport.querendaochu'
:
'Are you sure to export the selected item?'
,
'commodity.products.confirmDelete.title'
:
'Are you sure you want to perform the delete operation?'
,
'commodity.products.confirmDelete.okText'
:
'OK'
,
'commodity.products.confirmDelete.cancelText'
:
'Cancel'
,
...
...
@@ -946,6 +947,7 @@ export default {
'commodity.products.schema.fastSchema.daochuchenggong'
:
'Export success'
,
'commodity.products.schema.fastSchema.zuiduodaochuyiqiange'
:
'Export a maximum of 1000 QR codes'
,
'commodity.products.menuMore.5'
:
'Export product QR code'
,
'commodity.products.menuMore.6'
:
'Export'
,
'commodity.products.liebiaogouxuan'
:
'List check:'
,
'commodity.products.geshangpin'
:
'A commodity'
,
'commodity.products.shuoming'
:
'xplain:'
,
...
...
src/locales/en-US/common.ts
View file @
59c041ef
...
...
@@ -31,6 +31,7 @@
'common.tip.select.required'
:
'Please select a record'
,
'common.tip.designpage.leave.confirm'
:
'Are you sure to leave the template decoration page? '
,
'common.tip.save.success'
:
'Save successfully'
,
'common.tip.save.tip'
:
'Notice'
,
/** tabel */
'common.table.action'
:
'Operation'
,
...
...
src/locales/ko-KR/commodity.ts
View file @
59c041ef
...
...
@@ -160,6 +160,7 @@ export default {
'commodity.products.handleBatchDelete.okText'
:
'확정하다'
,
'commodity.products.handleBatchDelete.cancelText'
:
'취소'
,
'commodity.products.handleBatchDelete.error'
:
'필요한 품목을 선택하십시오.'
,
'commodity.products.handleExport.querendaochu'
:
'선택한 상품을 내보내시겠습니까?'
,
'commodity.products.confirmDelete.title'
:
'삭제 작업을 수행하시겠습니까?'
,
'commodity.products.confirmDelete.okText'
:
'확정하다'
,
'commodity.products.confirmDelete.cancelText'
:
'취소'
,
...
...
@@ -946,6 +947,7 @@ export default {
'commodity.products.schema.fastSchema.daochuchenggong'
:
'성공적으로 내보내기'
,
'commodity.products.schema.fastSchema.zuiduodaochuyiqiange'
:
'최대 1000개의 상품 qr 코드를 내보낸다'
,
'commodity.products.menuMore.5'
:
'상품의 qr 코드를 내보내다'
,
'commodity.products.menuMore.6'
:
'이끌어 내다'
,
'commodity.products.liebiaogouxuan'
:
'목록 체크:'
,
'commodity.products.geshangpin'
:
'몇 가지 상품'
,
'commodity.products.shuoming'
:
'해설'
,
...
...
src/locales/ko-KR/common.ts
View file @
59c041ef
...
...
@@ -31,6 +31,7 @@ export default {
'common.tip.select.required'
:
'레코드를 선택하십시오.'
,
'common.tip.designpage.leave.confirm'
:
'템플릿 인테리어 페이지를 떠나시겠습니까?'
,
'common.tip.save.success'
:
'저장 성공'
,
'common.tip.save.tip'
:
'제시하다'
,
/** tabel */
'common.table.action'
:
'조작하다'
,
...
...
src/locales/zh-CN/commodity.ts
View file @
59c041ef
...
...
@@ -160,6 +160,7 @@ export default {
'commodity.products.handleBatchDelete.okText'
:
'确定'
,
'commodity.products.handleBatchDelete.cancelText'
:
'取消'
,
'commodity.products.handleBatchDelete.error'
:
'请选择需要操作的商品'
,
'commodity.products.handleExport.querendaochu'
:
'确认导出所选商品?'
,
'commodity.products.confirmDelete.title'
:
'确定要执行删除操作?'
,
'commodity.products.confirmDelete.okText'
:
'确定'
,
'commodity.products.confirmDelete.cancelText'
:
'取消'
,
...
...
@@ -947,6 +948,7 @@ export default {
'commodity.products.schema.fastSchema.daochuchenggong'
:
'导出成功'
,
'commodity.products.schema.fastSchema.zuiduodaochuyiqiange'
:
'最多导出1000个商品二维码'
,
'commodity.products.menuMore.5'
:
'导出商品二维码'
,
'commodity.products.menuMore.6'
:
'导出'
,
'commodity.products.liebiaogouxuan'
:
'列表勾选:'
,
'commodity.products.geshangpin'
:
'个商品'
,
'commodity.products.shuoming'
:
'说明:'
,
...
...
src/locales/zh-CN/common.ts
View file @
59c041ef
...
...
@@ -31,6 +31,8 @@ export default {
'common.tip.select.required'
:
'请选择一条记录'
,
'common.tip.designpage.leave.confirm'
:
'是否确认离开模板装修页面?'
,
'common.tip.save.success'
:
'保存成功'
,
'common.tip.modal.tip'
:
'提示'
,
/** tabel */
'common.table.action'
:
'操作'
,
...
...
src/pages/commodity/products/index.tsx
View file @
59c041ef
...
...
@@ -30,7 +30,7 @@ import useSetSearchValueInTable from '@/hooks/useSetSearchValueInTable'
import
{
priceTypeLabel
,
productStatusColor
,
productStatusLabel
}
from
'./constant'
import
EyePreview
from
'@/components/EyePreview'
import
UpperProductModalTable
from
'./components/upperProductModalTable'
import
{
getProductCommodityGetCommodityList
,
getProductCommodityGetShop
,
GetProductCommodityGetShopResponse
,
postProductCommodityApplyCheckCommodity
,
postProductCommodityCopyCommodity
,
postProductCommodityDeleteBatchCommodity
,
postProductCommodityExportCommodityQrCode
,
postProductCommodityGetCommodityIsExistStock
,
postProductCommodityGetCommoditySkuIdList
,
postProductCommodityGetShopBatch
,
postProductCommodityOffPublishCommodity
,
postProductCommodityOffPublishCommodityBatch
,
postProductCommodityPublishCommodity
,
postProductCommodityPublishCommodityBatch
}
from
'@/services/ProductV2Api'
import
{
getProductCommodityGetCommodityList
,
getProductCommodityGetShop
,
GetProductCommodityGetShopResponse
,
postProductCommodityApplyCheckCommodity
,
postProductCommodityCopyCommodity
,
postProductCommodityDeleteBatchCommodity
,
postProductCommodityExportCommodityQrCode
,
postProductCommodity
ExportCommoditySkuByCommodityIdList
,
postProductCommodity
GetCommodityIsExistStock
,
postProductCommodityGetCommoditySkuIdList
,
postProductCommodityGetShopBatch
,
postProductCommodityOffPublishCommodity
,
postProductCommodityOffPublishCommodityBatch
,
postProductCommodityPublishCommodity
,
postProductCommodityPublishCommodityBatch
}
from
'@/services/ProductV2Api'
import
{
getTemplateWebMemberShopWebFindCurrMemberShop
}
from
'@/services/TemplateV2Api'
import
PutawayGuide
,
{
GuideMenu
}
from
'./components/putawayGuide'
import
{
useRowSelectionTable
,
useRowSelectionTableCtl
}
from
'@/hooks/useRowSelectionTable'
...
...
@@ -59,6 +59,7 @@ const Products: React.FC<{}> = () => {
const
[
currentOptionId
,
setCurrentOptionId
]
=
useState
<
number
>
()
const
[
isDisabledOKbtn
,
setIsDisabledOKbtn
]
=
useState
<
boolean
>
(
false
)
const
[
exportQrcodeModal
,
setExportQrcodeModal
]
=
useState
<
boolean
>
(
false
)
const
[
exportVisible
,
setExportVisible
]
=
useState
<
boolean
>
(
false
)
const
[
exportLoading
,
setExportLoading
]
=
useState
<
boolean
>
(
false
)
const
currentRefRow
=
useRef
<
any
>
([])
const
currentCtrlRef
=
useRef
<
useRowSelectionTableCtl
>
()
...
...
@@ -610,7 +611,7 @@ const Products: React.FC<{}> = () => {
const
handleMenuClick
=
(
e
)
=>
{
const
selectedRowKeys
=
currentRefRow
.
current
.
map
(
item
=>
item
.
id
)
// 1 批量删除;2 删除导入批次 0 导入上游;3 批量上架;4 批量下架 5导出商品二维码
// 1 批量删除;2 删除导入批次 0 导入上游;3 批量上架;4 批量下架 5导出商品二维码
6导出
if
(
e
.
key
===
'1'
)
{
handleBatchDelete
(
selectedRowKeys
,
true
)
}
else
if
(
e
.
key
===
'2'
)
{
...
...
@@ -627,9 +628,38 @@ const Products: React.FC<{}> = () => {
return
message
.
error
(
intl
.
formatMessage
({
id
:
'commodity.products.schema.fastSchema.qingxuanzeshangjiashangpin'
}))
}
selectedRowKeys
.
length
?
setExportQrcodeModal
(
true
)
:
message
.
error
(
intl
.
formatMessage
({
id
:
'commodity.products.handleBatchDelete.error'
}))
}
else
if
(
e
.
key
===
'6'
)
{
selectedRowKeys
.
length
?
setExportVisible
(
true
)
:
message
.
error
(
intl
.
formatMessage
({
id
:
'commodity.products.handleBatchDelete.error'
}))
}
}
const
handleExport
=
()
=>
{
const
selectedRowKeys
=
currentRefRow
.
current
.
map
(
item
=>
item
.
id
)
let
a
:
any
=
document
.
createElement
(
"a"
)
document
.
body
.
appendChild
(
a
)
a
.
style
=
"display: none"
setExportLoading
(
true
)
if
(
selectedRowKeys
.
length
>
1000
)
{
return
message
.
error
(
intl
.
formatMessage
({
id
:
'commodity.products.schema.fastSchema.zuiduodaochuyiqiange'
}))
}
postProductCommodityExportCommoditySkuByCommodityIdList
({
idList
:
selectedRowKeys
},
{
responseType
:
'blob'
,
getResponse
:
true
}).
then
((
res
:
any
)
=>
{
const
{
data
,
response
}
=
res
const
filename
=
response
.
headers
.
get
(
'content-disposition'
).
split
(
'='
)[
1
]
let
blob
=
new
Blob
([
data
],
{
type
:
"application/vnd.ms-excel"
})
const
url
=
window
.
URL
.
createObjectURL
(
blob
);
a
.
href
=
url
;
a
.
download
=
filename
;
a
.
click
();
window
.
URL
.
revokeObjectURL
(
url
);
}).
finally
(()
=>
{
message
.
success
(
intl
.
formatMessage
({
id
:
'commodity.products.schema.fastSchema.daochuchenggong'
}))
setExportVisible
(
false
)
setExportLoading
(
false
)
currentCtrlRef
.
current
.
setSelectedRowKeys
([])
currentCtrlRef
.
current
.
setSelectRow
([])
})
}
const
handleExportQrcode
=
()
=>
{
let
a
:
any
=
document
.
createElement
(
"a"
)
document
.
body
.
appendChild
(
a
)
...
...
@@ -652,6 +682,8 @@ const Products: React.FC<{}> = () => {
setExportLoading
(
false
)
message
.
success
(
intl
.
formatMessage
({
id
:
'commodity.products.schema.fastSchema.daochuchenggong'
}))
setExportQrcodeModal
(
false
)
currentCtrlRef
.
current
.
setSelectedRowKeys
([])
currentCtrlRef
.
current
.
setSelectRow
([])
})
}
...
...
@@ -725,6 +757,9 @@ const Products: React.FC<{}> = () => {
<
Menu
.
Item
key=
"5"
icon=
{
<
ExportOutlined
/>
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.menuMore.5'
})
}
</
Menu
.
Item
>
<
Menu
.
Item
key=
"6"
icon=
{
<
ExportOutlined
/>
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.menuMore.6'
})
}
</
Menu
.
Item
>
</
Menu
>
)
...
...
@@ -913,6 +948,16 @@ const Products: React.FC<{}> = () => {
data=
{
inconformityProductIds
}
onCancel=
{
handleGuideCancel
}
/>
{
/* 导出SKU级商品 */
}
<
Modal
title=
{
intl
.
formatMessage
({
id
:
'common.tip.modal.tip'
})
}
visible=
{
exportVisible
}
onOk=
{
handleExport
}
onCancel=
{
()
=>
setExportVisible
(
false
)
}
confirmLoading=
{
exportLoading
}
>
<
h2
>
{
intl
.
formatMessage
({
id
:
'commodity.products.handleExport.querendaochu'
})
}
</
h2
>
</
Modal
>
</
PageHeaderWrapper
>
)
}
...
...
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