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
黄庭坚
jinfa-platform
Commits
b6e898be
Commit
b6e898be
authored
Apr 08, 2022
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 商品草稿列表显示单价品类品牌
parent
552e983b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
21 deletions
+55
-21
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+25
-0
basicInfoForm.tsx
...ages/commodity/products/addProductsItem/basicInfoForm.tsx
+2
-0
productAttributeForm.tsx
...mmodity/products/addProductsItem/productAttributeForm.tsx
+1
-1
index.tsx
src/pages/commodity/products/index.tsx
+21
-20
index.ts
src/store/product/index.ts
+6
-0
No files found.
src/pages/commodity/products/addProducts.tsx
View file @
b6e898be
...
...
@@ -50,6 +50,7 @@ const AddProducts: React.FC<{}> = (props) => {
areaOption
,
productDescription
,
brandName
,
categoryName
,
setProductName
,
setAttributeLists
,
clearData
,
...
...
@@ -434,6 +435,7 @@ const AddProducts: React.FC<{}> = (props) => {
let
_params
=
{
...
_bacsicForm
,
brandName
,
categoryName
,
commodityAttributeList
:
productSelectAttribute
,
commodityRemark
:
_productDescription
,
isAllAttributePic
:
isAllAttributePic
,
...
...
@@ -566,6 +568,29 @@ const AddProducts: React.FC<{}> = (props) => {
if
(
_params
?.
logistics
?.
sendCycle
)
{
_params
.
sendCycle
=
_params
.
logistics
.
sendCycle
}
// 处理最大值最小值
if
(
_params
.
unitPriceAndPicList
?.
length
)
{
const
_prices
=
[]
const
prices
=
_params
.
unitPriceAndPicList
.
map
(
item
=>
{
if
(
item
[
'unitPrice'
][
'0-0'
])
{
return
item
[
'unitPrice'
][
'0-0'
]
}
else
{
return
Object
.
values
(
item
[
'unitPrice'
])
}
})
prices
.
forEach
(
element
=>
{
if
(
Array
.
isArray
(
element
))
{
element
.
forEach
(
e
=>
_prices
.
push
(
e
))
}
else
{
_prices
.
push
(
element
)
}
})
if
(
_prices
.
length
)
{
_prices
.
sort
((
a
,
b
)
=>
Number
(
a
)
-
Number
(
b
))
_params
[
'min'
]
=
_prices
[
0
]
_params
[
'max'
]
=
_prices
[
_prices
.
length
-
1
]
}
}
postProductCommoditySaveOrUpdateCommodityDraft
(
draftId
?
{
id
:
draftId
,
draft
:
_params
}
:
{
draft
:
_params
}).
then
(({
code
})
=>
{
if
(
code
===
1000
)
{
setIsDisableSaveDrate
(
false
)
...
...
src/pages/commodity/products/addProductsItem/basicInfoForm.tsx
View file @
b6e898be
...
...
@@ -64,6 +64,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
getBasicFormParamsByEdit
,
setAttributeLists
,
setProductName
,
setCategoryName
,
setBrandName
,
setSelectCategoryId
,
setSelectBrandId
,
...
...
@@ -160,6 +161,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
setAttributeLists
(
data
?.
customerAttributeList
)
setSelectCategoryId
(
seletCategoryId
)
setSendCycle
(
data
?.
sendCycle
||
0
)
setCategoryName
(
data
?.
name
)
})
}
else
{
...
...
src/pages/commodity/products/addProductsItem/productAttributeForm.tsx
View file @
b6e898be
...
...
@@ -266,7 +266,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
<>
{
menu
}
<
Divider
style=
{
{
margin
:
'8px 0'
}
}
/>
<
Space
align=
"
center
"
style=
{
{
padding
:
'0 8px 4px'
}
}
>
<
Space
align=
"
baseline
"
style=
{
{
padding
:
'0 8px 4px'
}
}
>
<
Form
.
Item
>
<
Input
placeholder=
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.productAttributeForm.addAttribute.placeholder'
})
}
value=
{
newValue
}
onChange=
{
onNameChange
}
/>
</
Form
.
Item
>
...
...
src/pages/commodity/products/index.tsx
View file @
b6e898be
...
...
@@ -245,13 +245,13 @@ const Products: React.FC<{}> = () => {
},
{
title
:
intl
.
formatMessage
({
id
:
'commodity.products.columns.customerCategory'
}),
dataIndex
:
[
'draft'
,
'c
ustomerCategory'
,
'n
ame'
],
key
:
'c
ustomerCategory.n
ame'
,
dataIndex
:
[
'draft'
,
'c
ategoryN
ame'
],
key
:
'c
ategoryN
ame'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'commodity.products.columns.brand'
}),
dataIndex
:
[
'draft'
,
'brand
'
,
'n
ame'
],
key
:
'bran
d.n
ame'
,
dataIndex
:
[
'draft'
,
'brand
N
ame'
],
key
:
'bran
N
ame'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'commodity.products.columns.unitName'
}),
...
...
@@ -282,29 +282,30 @@ const Products: React.FC<{}> = () => {
title
:
intl
.
formatMessage
({
id
:
'commodity.products.columns.min'
}),
dataIndex
:
[
'draft'
,
'min'
],
key
:
'min'
,
render
:
(
text
,
reocrd
)
=>
{
if
(
reocrd
.
priceType
===
1
)
{
if
(
reocrd
.
max
===
reocrd
.
min
)
return
<>
{
intl
.
formatMessage
({
id
:
'commodity.products.columns.currency'
})
}{
reocrd
.
min
}
</>
render
:
(
text
,
record
)
=>
{
const
{
min
=
null
,
max
=
null
,
priceType
}
=
record
.
draft
if
((
priceType
===
1
)
&&
min
&&
max
)
{
if
(
max
===
min
)
return
<>
{
intl
.
formatMessage
({
id
:
'commodity.products.columns.currency'
})
}{
min
}
</>
else
return
<>
{
intl
.
formatMessage
({
id
:
'commodity.products.columns.currency'
})
}{
reocrd
.
min
}
~
{
intl
.
formatMessage
({
id
:
'commodity.products.columns.currency'
})
}{
reocrd
.
max
}
</>
return
<>
{
intl
.
formatMessage
({
id
:
'commodity.products.columns.currency'
})
}{
min
}
~
{
intl
.
formatMessage
({
id
:
'commodity.products.columns.currency'
})
}{
max
}
</>
}
if
(
reocrd
.
priceType
===
3
)
{
if
(
reocrd
.
max
===
reocrd
.
min
)
return
<>
{
reocrd
.
min
}
</>
if
(
priceType
===
3
)
{
if
(
max
===
min
)
return
<>
{
min
}
</>
else
return
<>
{
reocrd
.
min
}
~
{
reocrd
.
max
}
</>
return
<>
{
min
}
~
{
max
}
</>
}
if
(
reocrd
.
priceType
===
2
)
if
(
priceType
===
2
)
return
null
}
},
{
title
:
intl
.
formatMessage
({
id
:
'commodity.products.columns.applyTime'
}),
dataIndex
:
[
'draft'
,
'applyTime'
],
key
:
'applyTime'
,
render
:
text
=>
text
&&
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
},
//
{
//
title: intl.formatMessage({ id: 'commodity.products.columns.applyTime' }),
//
dataIndex: ['draft', 'applyTime'],
//
key: 'applyTime',
//
render: text => text && moment(text).format('YYYY-MM-DD HH:mm:ss')
//
},
{
title
:
intl
.
formatMessage
({
id
:
'commodity.products.columns.status'
}),
dataIndex
:
[
'draft'
,
'status'
],
...
...
src/store/product/index.ts
View file @
b6e898be
...
...
@@ -17,6 +17,7 @@ class ProductStore implements IProductModule {
@
observable
public
attributeLists
:
any
[]
=
[];
@
observable
public
productName
:
string
=
""
;
@
observable
public
brandName
:
string
=
""
;
@
observable
public
categoryName
:
string
=
""
;
@
observable
public
selectCategoryId
:
any
=
null
;
@
observable
public
selectBrandId
:
any
=
null
;
@
observable
public
productSelectAttribute
:
IProductSelectAttribute
[]
=
[];
...
...
@@ -123,6 +124,11 @@ class ProductStore implements IProductModule {
}
@
action
.
bound
public
setCategoryName
(
name
:
string
)
{
this
.
categoryName
=
name
;
}
@
action
.
bound
public
setBrandName
(
name
:
string
)
{
this
.
brandName
=
name
;
}
...
...
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