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
668eafb4
Commit
668eafb4
authored
Sep 02, 2020
by
前端-许佳敏
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
3fffd890
81dcc4b2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
24 deletions
+28
-24
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+4
-4
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+23
-20
selectGoodsForm.tsx
...es/commodity/products/addProductsItem/selectGoodsForm.tsx
+1
-0
No files found.
src/pages/commodity/products/addProducts.tsx
View file @
668eafb4
...
...
@@ -31,6 +31,7 @@ const AddProducts: React.FC<{}> = (props) => {
const
{
ProductStore
}
=
store
const
{
productSelectAttribute
,
priceAttributeParams
,
productAttributeAndImageParams
,
areaOption
,
productDescription
,
...
...
@@ -131,9 +132,9 @@ const AddProducts: React.FC<{}> = (props) => {
if
(
productAttributeAndImageParams
.
length
>
0
){
productAttributeAndImageParams
.
map
(
_item
=>
{
console
.
log
(
_item
,
'_item'
)
_item
.
goods
=
{
id
:
_item
.
goodsId
}
// id为0表示无货品
delete
_item
.
goodsId
if
(
_item
.
attributeAndValueList
.
length
>
0
){
_item
.
goods
=
{
id
:
_item
.
goodsId
}
delete
_item
.
goodsId
_item
.
attributeAndValueList
.
map
(
__item
=>
{
delete
__item
.
customerAttributeName
// **** 新字段结构变更
...
...
@@ -154,8 +155,7 @@ const AddProducts: React.FC<{}> = (props) => {
throw
new
Error
(
'每项请至少上传一张商品图片!'
)
}
})
}
else
{
}
else
{
throw
new
Error
(
'每项请至少上传一张商品图片!'
)
}
}
catch
(
e
){
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
668eafb4
...
...
@@ -197,26 +197,29 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
</>
})
}
else
if
(
history
.
location
.
query
?.
id
){
// 此时没有货品并且处于编辑状态 取接口返回的数据
let
goodsInApi
:
any
=
Object
.
values
(
productInfoByEdit
.
unitPriceAndPicList
.
map
(
_
=>
_
.
goods
).
reduce
((
item
,
next
)
=>
{
item
[
next
.
id
]
=
next
return
item
},{}))
_col
.
push
({
title
:
'对应货品'
,
dataIndex
:
'对应货品'
,
key
:
'对应货品'
,
width
:
360
,
render
:
(
text
:
any
,
record
:
any
)
=>
<>
<
Select
style=
{
{
width
:
'100%'
}
}
defaultValue=
{
text
}
onChange=
{
(
v
)
=>
{
tableSelelctChange
(
v
,
record
)
}
}
>
{
goodsInApi
.
length
>
0
&&
goodsInApi
.
map
(
_item
=>
(
<
Option
key=
{
_item
.
id
}
value=
{
_item
.
id
}
>
{
_item
.
code
}
/
{
_item
.
name
}
/
{
_item
.
type
}
/¥
{
_item
.
costPrice
}
</
Option
>
))
}
</
Select
>
</>
})
let
_goods
:
any
[]
=
Object
.
values
(
productInfoByEdit
.
unitPriceAndPicList
.
map
(
_
=>
_
.
goods
))
if
(
_goods
.
indexOf
(
null
)
===-
1
){
let
goodsInApi
:
any
=
Object
.
values
(
_goods
).
reduce
((
item
,
next
)
=>
{
item
[
next
.
id
]
=
next
return
item
},{})
_col
.
push
({
title
:
'对应货品'
,
dataIndex
:
'对应货品'
,
key
:
'对应货品'
,
width
:
360
,
render
:
(
text
:
any
,
record
:
any
)
=>
<>
<
Select
style=
{
{
width
:
'100%'
}
}
defaultValue=
{
text
}
onChange=
{
(
v
)
=>
{
tableSelelctChange
(
v
,
record
)
}
}
>
{
goodsInApi
.
length
>
0
&&
goodsInApi
.
map
(
_item
=>
(
<
Option
key=
{
_item
.
id
}
value=
{
_item
.
id
}
>
{
_item
.
code
}
/
{
_item
.
name
}
/
{
_item
.
type
}
/¥
{
_item
.
costPrice
}
</
Option
>
))
}
</
Select
>
</>
})
}
}
if
(
_attributeNameArr
.
length
>
0
){
...
...
src/pages/commodity/products/addProductsItem/selectGoodsForm.tsx
View file @
668eafb4
...
...
@@ -41,6 +41,7 @@ const SelectGoodsForm: React.FC<Iprops> = (props) => {
item
[
next
.
id
]
=
next
;
return
item
},{}))
console
.
log
(
goodsArr
,
'goods'
)
if
(
goodsArr
.
length
>
0
){
setIsChecked
(
true
)
setIsSelectGoods
(
true
)
...
...
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