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
86d2fc4c
Commit
86d2fc4c
authored
Apr 01, 2022
by
Bill
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix418' into 'v2-220418'
feat: 对接商品列表删除导入批次 See merge request linkseeks-design/pro-platform!110
parents
484dc138
b1992d07
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
17 deletions
+72
-17
productAttributeForm.tsx
...mmodity/products/addProductsItem/productAttributeForm.tsx
+4
-4
index.tsx
src/pages/commodity/products/index.tsx
+68
-13
No files found.
src/pages/commodity/products/addProductsItem/productAttributeForm.tsx
View file @
86d2fc4c
...
...
@@ -163,12 +163,12 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
}
const
handleAdd
=
()
=>
{
setLoading
(
true
)
addForm
.
submit
()
}
const
addSubmit
=
(
values
)
=>
{
postProductCustomerSaveOrUpdateCustomerAttributeValue
({
setLoading
(
true
)
values
?.
value
?
postProductCustomerSaveOrUpdateCustomerAttributeValue
({
customerAttribute
:
{
id
:
values
.
id
,
name
:
values
.
name
,
groupName
:
currentRow
.
current
.
groupName
},
isEnable
:
true
,
value
:
values
.
value
...
...
@@ -188,7 +188,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
setAddVisible
(
false
)
setLoading
(
false
)
}
})
})
:
setLoading
(
false
)
}
const
handleCancel
=
()
=>
{
...
...
@@ -203,7 +203,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
const
addItem
=
(
e
,
record
)
=>
{
e
.
preventDefault
();
postProductCustomerSaveOrUpdateCustomerAttributeValue
({
newValue
&&
postProductCustomerSaveOrUpdateCustomerAttributeValue
({
customerAttribute
:
{
id
:
record
.
id
,
name
:
record
.
name
,
groupName
:
record
.
groupName
},
isEnable
:
true
,
value
:
newValue
...
...
src/pages/commodity/products/index.tsx
View file @
86d2fc4c
...
...
@@ -29,7 +29,28 @@ import useSetSearchValueInTable from '@/hooks/useSetSearchValueInTable'
import
{
priceTypeLabel
,
productStatusColor
,
productStatusLabel
}
from
'./constant'
import
EyePreview
from
'@/components/EyePreview'
import
UpperProductModalTable
from
'./components/upperProductModalTable'
import
{
getProductCommodityExportCommodityTemplate
,
getProductCommodityGetCommodityList
,
getProductCommodityGetShop
,
GetProductCommodityGetShopResponse
,
postProductCommodityApplyCheckCommodity
,
postProductCommodityCopyCommodity
,
postProductCommodityDeleteBatchCommodity
,
postProductCommodityExportCommodityQrCode
,
postProductCommodityExportCommoditySkuByCommodityIdList
,
postProductCommodityGetCommodityIsExistStock
,
postProductCommodityGetCommoditySkuIdList
,
postProductCommodityGetShopBatch
,
postProductCommodityOffPublishCommodity
,
postProductCommodityOffPublishCommodityBatch
,
postProductCommodityPublishCommodity
,
postProductCommodityPublishCommodityBatch
}
from
'@/services/ProductV2Api'
import
{
getProductCommodityExportCommodityTemplate
,
getProductCommodityGetCommodityList
,
getProductCommodityGetShop
,
GetProductCommodityGetShopResponse
,
postProductCommodityApplyCheckCommodity
,
postProductCommodityCopyCommodity
,
postProductCommodityDeleteBatchCommodity
,
postProductCommodityExportCommodityQrCode
,
postProductCommodityExportCommoditySkuByCommodityIdList
,
postProductCommodityGetCommodityIsExistStock
,
postProductCommodityGetCommoditySkuIdList
,
postProductCommodityGetShopBatch
,
postProductCommodityOffPublishCommodity
,
postProductCommodityOffPublishCommodityBatch
,
postProductCommodityPublishCommodity
,
postProductCommodityPublishCommodityBatch
,
getProductCommodityGetCommodityDraftList
,
postProductCommodityDeleteCommodityDraftBatch
,
getProductCommodityGetCommodityImportBath
,
postProductCommodityDeleteCommodityByImportBath
}
from
'@/services/ProductV2Api'
import
{
getTemplateWebMemberShopWebFindCurrMemberShop
}
from
'@/services/TemplateV2Api'
import
PutawayGuide
,
{
GuideMenu
}
from
'./components/putawayGuide'
import
{
useRowSelectionTable
,
useRowSelectionTableCtl
}
from
'@/hooks/useRowSelectionTable'
...
...
@@ -37,7 +58,6 @@ import AuthButton from '@/components/AuthButton'
import
{
AuthUrl
}
from
'@/components/AuthButton/AuthUrl'
import
{
postOrderCommonProductProcessFind
}
from
'@/services/OrderNewV2Api'
import
{
ProductView
,
ProductSel
}
from
'./productModal'
import
{
getProductCommodityGetCommodityDraftList
,
postProductCommodityDeleteCommodityDraftBatch
}
from
'@/services/ProductV2Api'
const
{
confirm
}
=
Modal
;
...
...
@@ -69,6 +89,8 @@ const Products: React.FC<{}> = () => {
const
[
giudeStep
,
setGiudeStep
]
=
useState
<
number
>
()
const
[
inconformityProductIds
,
setInconformityProductIds
]
=
useState
<
number
[]
>
([])
const
{
token
}
=
getAuth
()
||
{}
const
[
importBathData
,
setImportBathData
]
=
useState
<
any
>
([])
const
[
importBathValue
,
setImportBathValue
]
=
useState
(
undefined
)
// 上游弹窗
const
[
upModal
,
setUpModal
]
=
useState
(
false
)
...
...
@@ -475,16 +497,23 @@ const Products: React.FC<{}> = () => {
const
[
exceptionContent
,
setExceptionContent
]
=
useState
<
string
>
()
const
[
exceptionCheck
,
setExceptionCheck
]
=
useState
(
false
);
// 默认无异常
const
[
importLoading
,
setImpor
tLoading
]
=
useState
(
false
)
const
[
loading
,
se
tLoading
]
=
useState
(
false
)
const
handleOkDeleteBatch
=
()
=>
{
setDeleteBatchModal
(
false
)
console
.
log
(
'删除批次'
)
setLoading
(
true
)
if
(
importBathValue
)
{
postProductCommodityDeleteCommodityByImportBath
({
commodityImportBath
:
importBathValue
}).
then
(({
code
})
=>
{
if
(
code
===
1000
)
{
setLoading
(
false
)
ref
.
current
.
reload
()
}
setDeleteBatchModal
(
false
)
})
}
}
const
handleCancelDelete
=
()
=>
{
setDeleteBatchModal
(
false
)
console
.
log
(
'取消删除'
)
}
const
clickUp
=
(
param
:
number
,
record
:
any
)
=>
{
// param: 0 下架 1上架 record.id为null批量上架
...
...
@@ -859,9 +888,9 @@ const Products: React.FC<{}> = () => {
<
Menu
.
Item
key=
"0"
icon=
{
<
ImportOutlined
/>
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.menuMore.1'
})
}
</
Menu
.
Item
>
{
/*
<Menu.Item key="2" icon={<DeleteOutlined />}>
删除导入批次
</Menu.Item>
*/
}
<
Menu
.
Item
key=
"2"
icon=
{
<
DeleteOutlined
/>
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.modal.title.1'
})
}
</
Menu
.
Item
>
<
Menu
.
Item
key=
"3"
icon=
{
<
ArrowUpOutlined
/>
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.menuMore.2'
})
}
</
Menu
.
Item
>
...
...
@@ -908,6 +937,17 @@ const Products: React.FC<{}> = () => {
console
.
log
(
key
,
'key'
)
}
const
handleImportBathSearch
=
(
value
?:
string
)
=>
{
getProductCommodityGetCommodityImportBath
({
name
:
value
||
''
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setImportBathData
(
res
.
data
)
})
}
const
handleImportBathChange
=
(
value
,
options
)
=>
{
setImportBathValue
(
value
)
}
// 导入商品
const
importProps
=
{
name
:
'file'
,
...
...
@@ -919,7 +959,7 @@ const Products: React.FC<{}> = () => {
maxCount
:
1
,
className
:
styles
.
importBtn
,
onChange
(
info
)
{
set
Import
Loading
(
true
)
setLoading
(
true
)
setModalTitle
(
intl
.
formatMessage
({
id
:
'commodity.products.modalTitle.1'
}))
if
(
info
.
file
.
status
!==
'uploading'
)
{
console
.
log
(
info
.
file
);
...
...
@@ -936,7 +976,9 @@ const Products: React.FC<{}> = () => {
setExceptionCheck
(
true
)
setStep1DescriptState
(
step1Exception
)
}
setLoading
(
false
)
}
else
if
(
info
.
file
.
status
===
'error'
)
{
setLoading
(
false
)
console
.
log
(
info
.
file
)
}
},
...
...
@@ -1013,7 +1055,7 @@ const Products: React.FC<{}> = () => {
title=
{
step0Description
}
extra=
{
<
Upload
{
...
importProps
}
>
<
Button
style=
{
{
width
:
'100%'
}
}
type=
"primary"
loading=
{
importL
oading
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.modal.button.1'
})
}
</
Button
>
<
Button
style=
{
{
width
:
'100%'
}
}
type=
"primary"
loading=
{
l
oading
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.modal.button.1'
})
}
</
Button
>
</
Upload
>
}
/>
...
...
@@ -1043,13 +1085,26 @@ const Products: React.FC<{}> = () => {
onOk=
{
handleOkDeleteBatch
}
onCancel=
{
handleCancelDelete
}
okButtonProps=
{
{
danger
:
true
}
}
confirmLoading=
{
loading
}
>
<
Form
layout=
"vertical"
>
<
Form
.
Item
label=
{
intl
.
formatMessage
({
id
:
'commodity.products.modal.form.label'
})
}
>
<
Select
placeholder=
{
intl
.
formatMessage
({
id
:
'commodity.products.modal.form.placeholder'
})
}
>
<
Select
.
Option
value=
"542424"
>
4245242452
</
Select
.
Option
>
<
Select
showSearch=
{
true
}
showArrow=
{
true
}
placeholder=
{
intl
.
formatMessage
({
id
:
'commodity.products.modal.form.placeholder'
})
}
allowClear
value=
{
importBathValue
}
defaultActiveFirstOption=
{
false
}
filterOption=
{
false
}
onSearch=
{
handleImportBathSearch
}
onChange=
{
handleImportBathChange
}
onFocus=
{
()
=>
handleImportBathSearch
(
null
)
}
style=
{
{
width
:
'100%'
}
}
>
{
importBathData
.
map
(
d
=>
<
Option
value=
{
d
}
key=
{
d
}
>
{
d
}
</
Option
>)
}
</
Select
>
</
Form
.
Item
>
</
Form
>
...
...
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