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
7c8c16d3
Commit
7c8c16d3
authored
Sep 14, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into dev
parents
1851a8ab
f087d4ba
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
236 additions
and
177 deletions
+236
-177
index.tsx
src/pages/classAndProperty/propertyValue/index.tsx
+2
-2
selectChannel.tsx
...pages/commodity/products/addChannelItem/selectChannel.tsx
+2
-2
addDirectChannel.tsx
src/pages/commodity/products/addDirectChannel.tsx
+11
-6
productAttributeForm.tsx
...mmodity/products/addProductsItem/productAttributeForm.tsx
+13
-6
productImageForm.tsx
...s/commodity/products/addProductsItem/productImageForm.tsx
+2
-2
directChannel.tsx
src/pages/commodity/products/directChannel.tsx
+75
-45
index.tsx
src/pages/commodity/products/index.tsx
+84
-30
modifyDirectChannel.tsx
src/pages/commodity/products/modifyDirectChannel.tsx
+1
-1
viewDirectChannel.tsx
src/pages/commodity/products/viewDirectChannel.tsx
+4
-54
viewProducts.tsx
src/pages/commodity/products/viewProducts.tsx
+39
-26
viewBrand.tsx
src/pages/trademark/viewBrand.tsx
+3
-3
No files found.
src/pages/classAndProperty/propertyValue/index.tsx
View file @
7c8c16d3
...
...
@@ -93,7 +93,7 @@ const PropertyValue: React.FC<{}> = () => {
}
const
handleSee
=
(
record
:
any
)
=>
{
history
.
push
(
`/memberCenter/commodityAbility/classAndProperty/propertyValue/addPropertyValue?attrId=
${
selectKey
}
&attrName=
${
selectNode
.
_titl
e
}
&attrValueId=
${
record
.
id
}
&isSee=true&type=
${
record
.
type
}
`
)
history
.
push
(
`/memberCenter/commodityAbility/classAndProperty/propertyValue/addPropertyValue?attrId=
${
selectKey
}
&attrName=
${
record
.
customerAttribute
.
nam
e
}
&attrValueId=
${
record
.
id
}
&isSee=true&type=
${
record
.
type
}
`
)
}
const
columns
:
ColumnType
<
any
>
[]
=
[
...
...
@@ -146,7 +146,7 @@ const PropertyValue: React.FC<{}> = () => {
record
.
isEnable
?
''
:
<>
<
Button
type=
'link'
onClick=
{
()
=>
history
.
push
(
`/memberCenter/commodityAbility/classAndProperty/propertyValue/addPropertyValue?attrId=${selectKey}&attrName=${
selectNode._titl
e}&attrValueId=${record.id}`
)
}
onClick=
{
()
=>
history
.
push
(
`/memberCenter/commodityAbility/classAndProperty/propertyValue/addPropertyValue?attrId=${selectKey}&attrName=${
record.customerAttribute.nam
e}&attrValueId=${record.id}`
)
}
>
编辑
</
Button
>
...
...
src/pages/commodity/products/addChannelItem/selectChannel.tsx
View file @
7c8c16d3
...
...
@@ -232,7 +232,7 @@ const SelectChannel:React.FC<IProps> = (props) => {
return
(<>
<
Row
>
{
memberRoleList
.
length
>
0
&&
<>
memberRoleList
.
length
>
0
?
<>
<
Col
span=
{
18
}
>
<
Form
{
...
layout
}
...
...
@@ -287,7 +287,7 @@ const SelectChannel:React.FC<IProps> = (props) => {
</
p
>
</
div
>
</
Col
>
</>
</>
:
<
span
style=
{
{
opacity
:
0.6
}
}
>
暂无数据!
</
span
>
}
</
Row
>
{
...
...
src/pages/commodity/products/addDirectChannel.tsx
View file @
7c8c16d3
import
React
,
{
useState
,
useRef
,
useEffect
}
from
'react'
import
{
history
}
from
'umi'
;
import
{
Button
,
Form
,
Card
,
Tabs
}
from
'antd'
import
{
Button
,
Form
,
Card
,
Tabs
,
message
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PlusOutlined
,
...
...
@@ -55,14 +55,19 @@ const AddDirectChannel:React.FC<{}> = (props) => {
params
.
commodityId
=
productSelectRowInStore
.
id
params
.
parentMemberId
=
productSelectRowInStore
.
memberId
params
.
parentMemberName
=
productSelectRowInStore
.
memberName
params
.
childMemberRoleName
=
selectedRole
.
children
params
.
childMemberRoleName
=
selectedRole
?.
children
||
null
params
.
commodityMemberList
=
selectChannel
.
map
(
item
=>
({
memberId
:
item
.
memberId
,
memberName
:
item
.
name
}))
PublicApi
.
postProductChannelCommoditySaveChannelCommodity
(
params
).
then
(
res
=>
{
if
(
params
.
childMemberRoleName
)
PublicApi
.
postProductChannelCommoditySaveChannelCommodity
(
params
).
then
(
res
=>
{
setIsDisabledSave
(
false
)
if
(
res
.
code
===
1000
)
history
.
goBack
()
})
else
{
message
.
error
(
'暂无渠道角色数据!'
)
setIsDisabledSave
(
false
)
if
(
res
.
code
===
1000
)
history
.
goBack
()
})
}
})
}
...
...
src/pages/commodity/products/addProductsItem/productAttributeForm.tsx
View file @
7c8c16d3
...
...
@@ -150,8 +150,15 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
}
const
renderTabPanchildren
=
(
attrItem
:
any
)
=>
{
const
{
isPrice
}
=
attrItem
const
{
isUpdateAttribute
}
=
productInfoByEdit
let
_isPrice
=
null
let
_isUpdateAttribute
=
null
let
_isEdit
=
productInfoByEdit
?.
id
let
_isDisabled
=
false
if
(
_isEdit
){
_isPrice
=
attrItem
.
isPrice
_isUpdateAttribute
=
productInfoByEdit
.
isUpdateAttribute
_isDisabled
=
_isPrice
&&
!
_isUpdateAttribute
}
return
(
<>
...
...
@@ -166,7 +173,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
}]
}
>
<
Select
disabled=
{
isPrice
&&
!
isUpdateAttribute
}
disabled=
{
_isDisabled
}
placeholder=
"请选择"
allowClear
onChange=
{
(
v
)
=>
onChange
(
v
,
attrItem
)
}
...
...
@@ -190,7 +197,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
}]
}
>
<
RangePicker
disabled=
{
isPrice
&&
!
isUpdateAttribute
}
disabled=
{
_isDisabled
}
onChange=
{
(
v
)
=>
onChange
(
v
,
attrItem
)
}
format=
"YYYY-MM-DD"
/>
...
...
@@ -206,7 +213,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
>
<
Checkbox
.
Group
onChange=
{
(
v
)
=>
onChange
(
v
,
attrItem
)
}
disabled=
{
isPrice
&&
!
isUpdateAttribute
}
disabled=
{
_isDisabled
}
>
{
attrItem
?.
customerAttributeValueList
.
length
>
0
&&
attrItem
.
customerAttributeValueList
.
map
((
item
:
any
,
index
:
string
)
=>
(
...
...
@@ -228,7 +235,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
}]
}
>
<
TextArea
disabled=
{
isPrice
&&
!
isUpdateAttribute
}
disabled=
{
_isDisabled
}
onChange=
{
(
v
)
=>
onChange
(
v
,
attrItem
)
}
maxLength=
{
50
}
placeholder=
"最多输入50个字符"
...
...
src/pages/commodity/products/addProductsItem/productImageForm.tsx
View file @
7c8c16d3
...
...
@@ -189,9 +189,9 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
<
Col
span=
{
4
}
className=
{
styles
.
colBox
}
>
<
ul
>
{
!
setImageType
?
<
span
className=
{
styles
.
tipTitle
}
>
按特定属性添加图片
</
span
>
!
setImageType
?
<
span
className=
{
styles
.
tipTitle
}
>
按特定属性添加图片
<
i
style=
{
{
color
:
'red'
}
}
>
*
</
i
>
</
span
>
:
<
li
className=
{
defaultChecked
==
0
?
styles
.
activedLi
:
""
}
onClick=
{
()
=>
clickItemTab
(
0
)
}
>
{
/* -1 */
}
<
span
>
所有属性共用
</
span
>
<
span
>
所有属性共用
<
i
style=
{
{
color
:
'red'
}
}
>
*
</
i
>
</
span
>
</
li
>
}
{
!
setImageType
&&
...
...
src/pages/commodity/products/directChannel.tsx
View file @
7c8c16d3
...
...
@@ -51,9 +51,11 @@ const DirectChannel: React.FC<{}> = () => {
const
[
isUp
,
setIsUp
]
=
useState
(
1
)
// 1上0下架状态
const
[
upDownModal
,
setUpDownModal
]
=
useState
(
false
)
const
[
shopsOption
,
setShopsOption
]
=
useState
<
GetProductChannelCommodityGetShopResponse
>
([])
const
[
shopsBatchOption
,
setShopsBatchOption
]
=
useState
<
GetProductChannelCommodityGetShopResponse
>
([])
const
[
checkedValues
,
setCheckedValues
]
=
useState
<
any
>
([])
const
[
currentOptionId
,
setCurrentOptionId
]
=
useState
<
number
>
()
const
[
isDisabledOKbtn
,
setIsDisabledOKbtn
]
=
useState
<
boolean
>
(
false
)
const
[
isBatchOption
,
setIsBatchOption
]
=
useState
<
boolean
>
(
false
)
// 是否是批量上下架操作
const
columns
:
ColumnType
<
any
>
[]
=
[
{
...
...
@@ -109,6 +111,19 @@ const DirectChannel: React.FC<{}> = () => {
key
:
'id'
,
render
:
(
text
,
record
)
=>
text
===
1
?
'上级渠道'
:
'渠道自有'
},
// {
// title: '产品定价',
// dataIndex: ['channelCommodity', 'commodity', 'priceType'],
// key: 'id',
// render: (text:any, reocrd:any)=>{
// if(text===1)
// return '现货价格'
// else if(text===2)
// return '价格需要询价'
// else if(text===3)
// return '积分兑换商品'
// }
// },
{
title
:
'操作时间'
,
dataIndex
:
[
'channelCommodity'
,
'createTime'
],
...
...
@@ -165,7 +180,7 @@ const DirectChannel: React.FC<{}> = () => {
];
const
clickModify
=
(
params
:
any
)
=>
{
history
.
push
(
`/memberCenter/commodityAbility/commodity/products/directChannel/modifyDirectChannel?id=
${
params
.
id
}
&commodityId=
${
params
.
channelCommodity
.
commodity
.
id
}
`
)
history
.
push
(
`/memberCenter/commodityAbility/commodity/products/directChannel/modifyDirectChannel?id=
${
params
.
id
}
&commodityId=
${
params
.
channelCommodity
.
id
}
`
)
}
// paramId ? 单个删除 : 批量删除
...
...
@@ -202,48 +217,54 @@ const DirectChannel: React.FC<{}> = () => {
})
}
const
getPageItemsMemberRole
=
async
()
=>
{
const
res
=
await
PublicApi
.
getMemberManageRoleList
()
const
{
data
}:
any
=
res
console
.
log
(
data
,
'data'
)
if
(
res
.
code
===
1000
)
{
return
{
memberRoleId
:
data
.
map
(
item
=>
({
label
:
item
.
roleName
,
value
:
item
.
roleId
})),
}
const
rowSelection
=
{
selectedRowKeys
:
selectedRowKeys
,
onChange
:
(
selectedRowKeys
:
any
,
selectedRows
:
any
)
=>
{
setSelectRow
(
selectedRows
);
setSelectedRowKeys
(
selectedRowKeys
);
}
return
{}
}
const
handleBatchUp
=
()
=>
{
console
.
log
(
'批量上架'
)
if
(
selectedRowKeys
.
length
){
setUpDownModal
(
true
)
setIsUp
(
1
)
}
else
{
message
.
error
(
'请先选择需要操作的商品!'
)
// 判断所选商品 priceType, source, status一致
const
judgeType
=
()
=>
{
let
sourceArr
=
Array
.
from
(
new
Set
(
selectRow
.
map
((
item
:
any
)
=>
item
.
channelCommodity
.
source
)))
let
priceTypeArr
=
Array
.
from
(
new
Set
(
selectRow
.
map
((
item
:
any
)
=>
item
.
channelCommodity
.
commodity
.
priceType
)))
let
statusArr
=
Array
.
from
(
new
Set
(
selectRow
.
map
((
item
:
any
)
=>
item
.
channelCommodity
.
status
)))
return
{
isPassJudge
:
sourceArr
.
length
===
1
&&
priceTypeArr
.
length
===
1
&&
statusArr
.
length
===
1
,
source
:
sourceArr
,
priceType
:
priceTypeArr
}
}
const
handleBatchDown
=
()
=>
{
console
.
log
(
'批量下架'
)
const
handleBatchClick
=
(
param
:
string
)
=>
{
setIsBatchOption
(
true
)
setShopsOption
([])
if
(
selectedRowKeys
.
length
){
setUpDownModal
(
true
)
setIsUp
(
0
)
let
_judge
=
judgeType
()
if
(
_judge
.
isPassJudge
){
setUpDownModal
(
true
)
// 获取渠道商品批量上架商城
PublicApi
.
getProductChannelCommodityGetShopBatch
({
priceType
:
_judge
.
priceType
[
0
],
source
:
_judge
.
source
[
0
]}).
then
(
res
=>
{
const
{
data
}
=
res
setShopsBatchOption
(
data
)
setCheckedValues
([])
})
if
(
param
===
'2'
)
// 2批量上架 3批量下架
setIsUp
(
1
)
else
setIsUp
(
0
)
}
else
{
message
.
error
(
'请正确选择需要批量操作的商品!'
)
}
}
else
{
message
.
error
(
'请先选择需要操作的商品!'
)
}
}
const
rowSelection
=
{
selectedRowKeys
:
selectedRowKeys
,
onChange
:
(
selectedRowKeys
:
any
,
selectedRows
:
any
)
=>
{
setSelectRow
(
selectedRows
);
setSelectedRowKeys
(
selectedRowKeys
);
}
}
const
clickUp
=
(
param
:
number
,
paramId
:
number
)
=>
{
setIsBatchOption
(
false
)
setShopsBatchOption
([])
setIsUp
(
param
)
setCurrentOptionId
(
paramId
)
// 获取渠道商品上架商城
...
...
@@ -268,22 +289,28 @@ const DirectChannel: React.FC<{}> = () => {
const
handleUpDown
=
()
=>
{
setIsDisabledOKbtn
(
true
)
let
params
=
{
id
:
currentOptionId
,
let
params
:
any
=
{
id
List
:
isBatchOption
?
selectRow
.
map
(
item
=>
item
.
id
)
:
[
currentOptionId
]
,
shopList
:
checkedValues
}
if
(
isUp
)
PublicApi
.
postProductChannelCommodityPublishCommodity
(
params
).
then
(
res
=>
{
setUpDownModal
(
false
)
ref
.
current
.
reload
()
if
(
checkedValues
.
length
>
0
){
PublicApi
.
postProductChannelCommodityPublishCommodity
(
params
).
then
(
res
=>
{
setUpDownModal
(
false
)
ref
.
current
.
reload
()
setIsDisabledOKbtn
(
false
)
})
}
else
{
setIsDisabledOKbtn
(
false
)
})
message
.
error
(
'请选择需要上架的渠道商城'
)
}
else
PublicApi
.
postProductChannelCommodityOffPublishCommodity
(
params
).
then
(
res
=>
{
setUpDownModal
(
false
)
ref
.
current
.
reload
()
setIsDisabledOKbtn
(
false
)
})
}
const
handleCancelUpDown
=
()
=>
{
...
...
@@ -293,10 +320,8 @@ const DirectChannel: React.FC<{}> = () => {
const
handleMenuClick
=
(
param
)
=>
{
// param: 1.批量删除 2.批量上架 3.批量下架
if
(
param
.
key
===
'1'
){
clickDelete
()
}
else
if
(
param
.
key
===
'2'
){
handleBatchUp
()
}
else
if
(
param
.
key
===
'3'
){
handleBatchDown
()
}
else
{
handleBatchClick
(
param
.
key
)
}
}
...
...
@@ -370,29 +395,34 @@ const DirectChannel: React.FC<{}> = () => {
/>
</
Card
>
<
Modal
title=
{
isUp
?
'商品上架'
:
'商品下架'
}
title=
{
isUp
?
(
isBatchOption
?
'批量上架'
:
'商品上架'
):(
isBatchOption
?
'批量下架'
:
'商品下架'
)
}
visible=
{
upDownModal
}
onOk=
{
handleUpDown
}
onCancel=
{
()
=>
setUpDownModal
(
false
)
}
onCancel=
{
()
=>
{
setUpDownModal
(
false
);
setCheckedValues
([])}
}
forceRender=
{
true
}
okButtonProps=
{
{
disabled
:
isDisabledOKbtn
}
}
>
<
Form
layout=
"vertical"
>
<
Form
.
Item
label
=
{
<
Form
.
Item
label
=
{
<
span
>
请选择需要
{
isUp
?
'上架'
:
'下架'
}
的商城
<
Tooltip
title=
"已上架的商城为已勾选的商城,不可选择,只可以选择未勾选的商城。"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
span
>
}
>
</
span
>
}
>
<
Checkbox
.
Group
style=
{
{
width
:
'100%'
}
}
onChange=
{
onChangeUpShop
}
value=
{
checkedValues
}
>
<
Row
>
{
isBatchOption
?
Array
.
isArray
(
shopsBatchOption
)
&&
shopsBatchOption
.
map
((
item
,
index
)
=>
<
Col
key=
{
index
}
span=
{
8
}
>
<
Checkbox
value=
{
item
}
>
{
item
.
name
}
</
Checkbox
>
</
Col
>)
:
Array
.
isArray
(
shopsOption
)
&&
shopsOption
.
map
((
item
,
index
)
=>
<
Col
key=
{
index
}
span=
{
8
}
>
<
Checkbox
value=
{
item
}
>
{
item
.
name
}
</
Checkbox
>
</
Col
>)
</
Col
>)
}
</
Row
>
</
Checkbox
.
Group
>
...
...
src/pages/commodity/products/index.tsx
View file @
7c8c16d3
...
...
@@ -50,6 +50,7 @@ let timeChange: any;
const
Products
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
[
upForm
]
=
Form
.
useForm
()
const
[
selectRow
,
setSelectRow
]
=
useState
<
Item
[]
>
([])
// 模态框选择的行数据
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
string
>>
([])
const
[
importModal
,
setImportModal
]
=
useState
(
false
)
...
...
@@ -141,16 +142,24 @@ const Products: React.FC<{}> = () => {
dataIndex
:
'min'
,
key
:
'min'
,
render
:
(
text
:
any
,
reocrd
:
any
)
=>
{
if
(
reocrd
.
priceType
===
1
)
return
<>
¥
{
reocrd
.
min
}
~ ¥
{
reocrd
.
max
}
</>
if
(
reocrd
.
priceType
===
3
)
return
<>
{
reocrd
.
min
}
~
{
reocrd
.
max
}
</>
if
(
reocrd
.
priceType
===
1
){
if
(
reocrd
.
min
===
reocrd
.
min
)
return
<>
¥
{
reocrd
.
min
}
</>
else
return
<>
¥
{
reocrd
.
min
}
~ ¥
{
reocrd
.
max
}
</>
}
if
(
reocrd
.
priceType
===
3
){
if
(
reocrd
.
min
===
reocrd
.
min
)
return
<>
{
reocrd
.
min
}
</>
else
return
<>
{
reocrd
.
min
}
~
{
reocrd
.
max
}
</>
}
if
(
reocrd
.
priceType
===
2
)
return
null
}
},
{
title
:
'审核时间'
,
title
:
'
申请
审核时间'
,
dataIndex
:
'applyTime'
,
key
:
'applyTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
text
&&
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
...
...
@@ -222,7 +231,7 @@ const Products: React.FC<{}> = () => {
{
record
.
status
===
1
?
<
Menu
.
Item
><
Button
type=
'link'
onClick=
{
()
=>
clickSubmitCheck
(
record
)
}
>
提交审核
</
Button
></
Menu
.
Item
>
:
''
}
{
(
record
.
status
===
4
||
record
.
status
===
6
)
?
<
Menu
.
Item
><
Button
type=
'link'
onClick=
{
()
=>
clickUp
(
1
,
record
.
id
)
}
>
上架
</
Button
></
Menu
.
Item
>
:
''
}
{
(
record
.
status
!==
5
)
?
<
Menu
.
Item
><
Button
type=
'link'
onClick=
{
()
=>
clickModify
(
record
.
id
)
}
>
修改
</
Button
></
Menu
.
Item
>
:
''
}
{
(
record
.
status
===
1
||
record
.
status
===
3
)
?
<
Menu
.
Item
><
Button
type=
'link'
onClick=
{
()
=>
confirmDelete
(
record
.
id
)
}
>
删除
</
Button
></
Menu
.
Item
>
:
''
}
{
(
record
.
status
===
1
&&
!
record
.
checkTime
)
?
<
Menu
.
Item
><
Button
type=
'link'
onClick=
{
()
=>
confirmDelete
(
record
.
id
)
}
>
删除
</
Button
></
Menu
.
Item
>
:
''
}
</
Menu
>
}
>
<
a
className=
"ant-dropdown-link"
onClick=
{
e
=>
e
.
preventDefault
()
}
>
...
...
@@ -414,7 +423,10 @@ const Products: React.FC<{}> = () => {
setShopId
(
res
.
data
.
id
)
setCheckedValues
(
values
)
}
else
{
message
.
error
(
'您还没有开通店铺,无法上下架商品!'
)
message
.
error
(
'您还还未创建店铺,请先创建店铺!'
)
setTimeout
(()
=>
{
history
.
push
(
'/memberCenter/shopAbility/infoManage'
)
},
3000
)
}
})
}
...
...
@@ -436,30 +448,47 @@ const Products: React.FC<{}> = () => {
shopList
:
checkedValues
}
if
(
isUp
)
PublicApi
.
postProductCommodityPublishCommodity
({
storeId
:
shopId
,
...
params
}).
then
(
res
=>
{
setUpDownModal
(
false
)
ref
.
current
.
reload
()
if
(
checkedValues
.
length
>
0
){
PublicApi
.
postProductCommodityPublishCommodity
({
storeId
:
shopId
,
...
params
}).
then
(
res
=>
{
setUpDownModal
(
false
)
ref
.
current
.
reload
()
setIsDisabledOKbtn
(
false
)
})
}
else
{
setIsDisabledOKbtn
(
false
)
})
message
.
error
(
'请选择需要上架的商城!'
)
}
else
PublicApi
.
postProductCommodityOffPublishCommodity
(
params
).
then
(
res
=>
{
setUpDownModal
(
false
)
ref
.
current
.
reload
()
setIsDisabledOKbtn
(
false
)
})
}
const
handleCancelUp
=
()
=>
{
upForm
.
resetFields
()
setUpDownModal
(
false
)
}
const
clickCopy
=
(
record
:
any
)
=>
{
console
.
log
(
'复制商品'
)
const
{
id
}
=
record
;
if
(
id
){
PublicApi
.
postProductCommodityCopyCommodity
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
ref
.
current
.
reload
()
confirm
({
title
:
'确定要执行复制操作?'
,
icon
:
<
ExclamationCircleOutlined
/>,
onOk
()
{
PublicApi
.
postProductCommodityCopyCommodity
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
ref
.
current
.
reload
()
})
},
onCancel
()
{
console
.
log
(
'Cancel'
);
},
okText
:
'确定'
,
cancelText
:
'取消'
})
}
}
...
...
@@ -478,20 +507,42 @@ const Products: React.FC<{}> = () => {
console
.
log
(
'menu'
,
e
,
selectedRowKeys
);
// 1 批量删除;2 删除导入批次
if
(
e
.
key
===
'1'
){
console
.
log
(
'批量删除'
)
handleBatchDelete
(
selectedRowKeys
)
handleBatchDelete
(
selectedRowKeys
,
true
)
}
else
if
(
e
.
key
===
'2'
){
console
.
log
(
'删除导入批次'
)
setDeleteBatchModal
(
true
)
}
}
const
handleBatchDelete
=
(
ids
:
string
[])
=>
{
console
.
log
(
'删除'
,
ids
)
// @ts-ignore
PublicApi
.
postProductCommodityDeleteBatchCommodity
({
idList
:
ids
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
ref
.
current
.
reload
()
})
const
handleBatchDelete
=
(
ids
:
string
[],
param
?:
boolean
)
=>
{
if
(
ids
.
length
)
if
(
param
){
confirm
({
title
:
'确定要执行批量删除操作?'
,
icon
:
<
ExclamationCircleOutlined
/>,
onOk
()
{
//@ts-ignore
PublicApi
.
postProductCommodityDeleteBatchCommodity
({
idList
:
ids
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
ref
.
current
.
reload
()
})
},
okType
:
'danger'
,
onCancel
()
{
console
.
log
(
'Cancel'
);
},
okText
:
'确定'
,
cancelText
:
'取消'
})
}
else
{
//@ts-ignore
PublicApi
.
postProductCommodityDeleteBatchCommodity
({
idList
:
ids
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
ref
.
current
.
reload
()
})
}
else
message
.
error
(
'请选择需要操作的商品!'
)
}
const
confirmDelete
=
(
paramId
:
any
)
=>
{
...
...
@@ -794,13 +845,16 @@ const Products: React.FC<{}> = () => {
<
Form
layout=
"vertical"
>
<
Form
.
Item
label=
{
<
span
>
请选择需要
{
isUp
?
'上架'
:
'下架'
}
的商城
<
Tooltip
title=
"已上架的商城为已勾选的商城,不可选择,只可以选择未勾选的商城。"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
span
>
}
>
<
Form
.
Item
label=
{
<
span
>
请选择需要
{
isUp
?
'上架'
:
'下架'
}
的商城
<
Tooltip
title=
"已上架的商城为已勾选的商城,不可选择,只可以选择未勾选的商城。"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
span
>
}
>
<
Checkbox
.
Group
style=
{
{
width
:
'100%'
}
}
onChange=
{
onChangeUpShop
}
value=
{
checkedValues
}
>
<
Row
>
{
...
...
src/pages/commodity/products/modifyDirectChannel.tsx
View file @
7c8c16d3
...
...
@@ -87,7 +87,7 @@ const ModifyDirectChannel:React.FC<{}> = () => {
// 获取商品规格列表
const
fetchSpecData
=
()
=>
{
PublicApi
.
getProductChannelCommodityGetCommodityUnitPrice
({
id
:
history
.
location
.
query
.
commodityId
}).
then
(
res
=>
{
PublicApi
.
getProductChannelCommodityGetCommodityUnitPrice
ByChannel
({
id
:
history
.
location
.
query
.
commodityId
}).
then
(
res
=>
{
const
{
data
}
=
res
setOriginTableData
(
data
)
if
(
data
.
length
>
0
)
...
...
src/pages/commodity/products/viewDirectChannel.tsx
View file @
7c8c16d3
...
...
@@ -102,57 +102,6 @@ const ViewDriectChannel: React.FC<{}> = () => {
}
}
const
dataMember
=
[
{
key
:
'1'
,
name
:
'渠道名称'
,
type
:
'渠道企业会员'
,
role
:
'渠道采购商'
,
class
:
'青铜会员'
,
},
{
key
:
'2'
,
name
:
'渠道名称'
,
type
:
'渠道企业会员'
,
role
:
'渠道采购商'
,
class
:
'铁皮会员'
,
},
]
const
columnsMember
:
ColumnType
<
any
>
[]
=
[
{
title
:
'ID'
,
dataIndex
:
'key'
,
align
:
'center'
,
key
:
'key'
,
},
{
title
:
'会员名称'
,
dataIndex
:
'name'
,
align
:
'center'
,
key
:
'name'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
span
className=
"commonPickColor"
>
{
text
}
<
EyeOutlined
/></
span
>
},
{
title
:
'会员类型'
,
dataIndex
:
'type'
,
align
:
'center'
,
key
:
'type'
,
},
{
title
:
'会员角色'
,
dataIndex
:
'role'
,
align
:
'center'
,
key
:
'role'
,
},
{
title
:
'会员等级'
,
dataIndex
:
'class'
,
align
:
'center'
,
key
:
'class'
,
},
]
const
renderStatus
=
(
status
:
any
)
=>
{
if
(
status
===
5
)
return
<
span
className=
{
styles
.
pruductStatus
}
>
已上架
</
span
>
...
...
@@ -165,7 +114,7 @@ const ViewDriectChannel: React.FC<{}> = () => {
const
content
=
<>
<
Descriptions
colon=
{
true
}
style=
{
{
marginTop
:
50
}
}
>
<
Descriptions
.
Item
label=
"商品状态"
>
{
renderStatus
(
channelDetails
?.
channelCommodity
?.
status
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"上级渠道"
>
{
channelDetails
?.
parentMemberName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"上级渠道"
>
{
channelDetails
?.
channelCommodity
?.
source
===
1
&&
channelDetails
?.
channelCommodity
?.
parentMemberName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"上架商城"
>
{
shopList
.
length
>
0
&&
shopList
.
map
((
item
,
index
)
=>
item
.
isCheck
&&
<
span
key=
{
index
}
>
{
item
.
name
}
</
span
>)
...
...
@@ -189,8 +138,9 @@ const ViewDriectChannel: React.FC<{}> = () => {
<
p
>
<
Avatar
size=
{
48
}
shape=
"square"
src=
{
channelDetails
?.
unitPriceAndPicList
[
0
]?.
commodityPic
&&
channelDetails
.
unitPriceAndPicList
[
0
].
commodityPic
[
0
]
}
/>
<
span
style=
{
{
color
:
'rgba(23,43,77,1)'
,
fontSize
:
20
,
fontWeight
:
500
,
marginLeft
:
16
}
}
>
{
channelDetails
?.
name
}
</
span
>
<
span
style=
{
{
color
:
'#E63F3B'
,
padding
:
'2px 5px'
,
background
:
'rgba(255,235,230,1)'
,
borderRadius
:
'4px'
,
marginLeft
:
16
,
marginRight
:
16
}
}
>
{
channelDetails
?.
source
===
1
?
"上级渠道"
:
"渠道自有"
}
</
span
>
<
a
href=
{
channelDetails
?.
source
===
1
?
`/shop/commodity/detail?id=${channelDetails?.channelCommodity?.commodity?.id}`
:
`/memberCenter/commodityAbility/commodity/products/viewProducts?id=${channelDetails?.channelCommodity?.commodity?.id}`
}
>
去查看
>
</
a
>
<
span
style=
{
{
color
:
'#E63F3B'
,
padding
:
'2px 5px'
,
background
:
'rgba(255,235,230,1)'
,
borderRadius
:
'4px'
,
marginLeft
:
16
,
marginRight
:
16
}
}
>
{
channelDetails
?.
channelCommodity
?.
source
===
1
?
"上级渠道"
:
"渠道自有"
}
</
span
>
<
a
>
去查看
>
</
a
>
{
/* <a href={channelDetails?.source === 1 ? `/shop/commodity/detail?id=${channelDetails?.channelCommodity?.commodity?.id}` : `/memberCenter/commodityAbility/commodity/products/viewProducts?id=${channelDetails?.channelCommodity?.commodity?.id}`}>去查看 ></a> */
}
</
p
>
{
content
}
</
Card
>
...
...
src/pages/commodity/products/viewProducts.tsx
View file @
7c8c16d3
...
...
@@ -123,11 +123,11 @@ const viewProducts: React.FC<{}> = () => {
key
:
'operation'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
if
(
record
.
operation
===
1
)
return
'
新增
'
return
'
提交审核
'
else
if
(
record
.
operation
===
2
)
return
'修改'
return
'修改
商品
'
else
if
(
record
.
operation
===
3
)
return
'审核'
return
'审核
商品
'
}
},
{
...
...
@@ -585,31 +585,44 @@ const viewProducts: React.FC<{}> = () => {
<
Space
direction=
"vertical"
style=
{
{
width
:
'100%'
}
}
>
<
Card
headStyle=
{
{
borderBottom
:
'none'
}
}
title=
"商品描述"
>
{
/* 文字区块 */
}
<
div
className=
{
cx
(
styles
.
descriptionBox
,
styles
.
descriptionWordBox
)
}
>
{
productDetail
?.
commodityRemark
?.
word
?.
length
>
0
?
productDetail
?.
commodityRemark
?.
word
.
map
((
_item
,
_index
)
=>
_item
&&
<
p
>
{
_item
}
</
p
>
)
:
<
p
className=
{
styles
.
descriptNull
}
>
暂无文字数据
</
p
>
}
</
div
>
{
productDetail
?.
commodityRemark
?.
word
?.
length
>
0
&&
<
div
className=
{
cx
(
styles
.
descriptionBox
,
styles
.
descriptionWordBox
)
}
>
{
productDetail
?.
commodityRemark
?.
word
.
map
((
_item
,
_index
)
=>
_item
&&
<
p
>
{
_item
}
</
p
>
)
}
</
div
>
}
{
/* 视频区块 */
}
<
div
className=
{
styles
.
descriptionBox
}
>
{
productDetail
?.
commodityRemark
?.
video
?.
length
>
0
?
productDetail
?.
commodityRemark
?.
video
.
map
((
_item
,
_index
)
=>
<
div
key=
{
_index
}
className=
{
styles
.
videoItem
}
>
<
video
src=
{
_item
}
controls=
{
true
}
>
您的浏览器不支持视频标签,请及时升级。
</
video
>
</
div
>)
:
<
p
className=
{
styles
.
descriptNull
}
>
暂无视频数据
</
p
>
}
</
div
>
{
productDetail
?.
commodityRemark
?.
video
?.
length
>
0
&&
<
div
className=
{
styles
.
descriptionBox
}
>
{
productDetail
?.
commodityRemark
?.
video
.
map
((
_item
,
_index
)
=>
<
div
key=
{
_index
}
className=
{
styles
.
videoItem
}
>
<
video
src=
{
_item
}
controls=
{
true
}
>
您的浏览器不支持视频标签,请及时升级。
</
video
>
</
div
>)
}
</
div
>
}
{
/* 图片区块 */
}
<
div
className=
{
styles
.
descriptionBox
}
>
{
productDetail
?.
commodityRemark
?.
image
?.
length
>
0
?
productDetail
?.
commodityRemark
?.
image
.
map
((
_item
,
_index
)
=>
_item
&&
<
div
key=
{
_index
}
className=
{
styles
.
imgItem
}
>
<
img
src=
{
_item
}
/>
</
div
>)
:
<
p
className=
{
styles
.
descriptNull
}
>
暂无图片数据
</
p
>
}
</
div
>
{
productDetail
?.
commodityRemark
?.
image
?.
length
>
0
&&
<
div
className=
{
styles
.
descriptionBox
}
>
{
productDetail
?.
commodityRemark
?.
image
.
map
((
_item
,
_index
)
=>
_item
&&
<
div
key=
{
_index
}
className=
{
styles
.
imgItem
}
>
<
img
src=
{
_item
}
/>
</
div
>)
}
</
div
>
}
{
productDetail
?.
commodityRemark
?.
image
?.
length
===
0
&&
productDetail
?.
commodityRemark
?.
video
?.
length
===
0
&&
productDetail
?.
commodityRemark
?.
word
?.
length
===
0
&&
<
p
className=
{
styles
.
descriptNull
}
>
暂无数据!
</
p
>
}
</
Card
>
</
Space
>
<
Space
direction=
"vertical"
style=
{
{
width
:
'100%'
}
}
>
...
...
src/pages/trademark/viewBrand.tsx
View file @
7c8c16d3
...
...
@@ -80,11 +80,11 @@ const viewBrand: React.FC<{}> = () => {
render
:
(
text
:
any
,
record
:
any
)
=>
{
let
component
:
ReactNode
=
null
if
(
record
.
operation
===
1
)
component
=
(<>
新增
</>)
component
=
(<>
提交审核
</>)
else
if
(
record
.
operation
===
2
)
component
=
(<>
修改
</>)
component
=
(<>
修改
品牌
</>)
else
if
(
record
.
operation
===
3
)
component
=
(<>
审核
</>)
component
=
(<>
审核
品牌
</>)
return
component
}
},
...
...
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