Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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
project
jinfa-admin
Commits
7a9b7da7
Commit
7a9b7da7
authored
Oct 22, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 商品详情添加副单价、
parent
3d53e635
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
3 deletions
+61
-3
checkProducts.tsx
...roductManage/commodity/productWillCheck/checkProducts.tsx
+31
-2
viewProducts.tsx
src/pages/productManage/commodity/products/viewProducts.tsx
+30
-1
No files found.
src/pages/productManage/commodity/productWillCheck/checkProducts.tsx
View file @
7a9b7da7
...
...
@@ -251,7 +251,7 @@ const viewProducts: React.FC<{}> = () => {
}
/* 构建表格数据 */
const
constructTableData
=
(
product
:
string
,
unitPriceAndPicList
:
GetProductCommodityGetCommodityResponse
[
"unitPriceAndPicList"
])
=>
{
const
constructTableData
=
(
product
:
any
,
unitPriceAndPicList
:
GetProductCommodityGetCommodityResponse
[
"unitPriceAndPicList"
])
=>
{
// 构建列
// console.log(productName, unitPriceAndPicList, '构建列')
let
_col
:
any
=
[];
...
...
@@ -294,6 +294,18 @@ const viewProducts: React.FC<{}> = () => {
})
}
})
_col
.
push
({
title
:
product
?.
planPrice
===
3
?
'积分(副单位)'
:
'单价(副单位)'
,
dataIndex
:
'副单价'
,
key
:
'副单价'
,
render
:
(
text
)
=>
{
if
(
text
&&
Array
.
isArray
(
text
))
{
return
text
.
map
(
p
=>
<
p
>
{
product
?.
planPrice
===
3
?
p
:
`¥${p}`
}
</
p
>)
}
else
if
(
text
)
{
return
product
?.
planPrice
===
3
?
text
:
`¥
${
text
}
`
}
}
})
setTableColumns
(
_col
)
...
...
@@ -314,12 +326,19 @@ const viewProducts: React.FC<{}> = () => {
attrWithObj
=
{
...
attrWithObj
,
...
t
}
}
_attributeArrByImageRender
.
push
(
attrWithObj
)
const
_price
=
sortLadderPrice
(
item
.
unitPrice
)
const
_priceRate
=
item
.
priceRate
const
_priceNumber
=
Object
.
keys
(
_price
)[
0
]
===
'0-0'
?
Object
.
values
(
_price
)[
0
]
:
Object
.
values
(
_price
)
let
temp
=
{
"索引"
:
index
,
"商品名称"
:
product
[
'name'
],
"对应货品"
:
item
.
goods
?.
code
+
'/'
+
item
.
goods
?.
name
+
'/'
+
item
.
goods
?.
type
,
...
attrWithObj
,
"单价"
:
sortLadderPrice
(
item
.
unitPrice
),
"单价"
:
_price
,
'副单价率'
:
_priceRate
,
'副单价'
:
Array
.
isArray
(
_priceNumber
)
?
_priceNumber
.
map
(
_p
=>
(
Number
(
_p
)
*
Number
(
_priceRate
)
/
100
).
toFixed
(
2
))
:
(
Number
(
_priceNumber
)
*
Number
(
_priceRate
)
/
100
).
toFixed
(
2
)
}
return
temp
})
...
...
@@ -619,6 +638,16 @@ const viewProducts: React.FC<{}> = () => {
<
p
>
{
productDetail
?.
unitName
}
</
p
>
</
Col
>
</
Row
>
{
productDetail
?.
subUnitName
?
<
Row
>
<
Col
span=
{
2
}
>
<
p
>
计量副单位:
</
p
>
</
Col
>
<
Col
span=
{
22
}
>
<
p
>
{
productDetail
?.
subUnitName
}
</
p
>
</
Col
>
</
Row
>
:
null
}
<
Row
>
<
Col
span=
{
2
}
>
<
p
>
最小起订:
</
p
>
...
...
src/pages/productManage/commodity/products/viewProducts.tsx
View file @
7a9b7da7
...
...
@@ -284,6 +284,18 @@ const viewProducts: React.FC<{}> = () => {
})
}
})
_col
.
push
({
title
:
product
?.
planPrice
===
3
?
'积分(副单位)'
:
'单价(副单位)'
,
dataIndex
:
'副单价'
,
key
:
'副单价'
,
render
:
(
text
)
=>
{
if
(
text
&&
Array
.
isArray
(
text
))
{
return
text
.
map
(
p
=>
<
p
>
{
product
?.
planPrice
===
3
?
p
:
`¥${p}`
}
</
p
>)
}
else
if
(
text
)
{
return
product
?.
planPrice
===
3
?
text
:
`¥
${
text
}
`
}
}
})
setTableColumns
(
_col
)
...
...
@@ -304,12 +316,19 @@ const viewProducts: React.FC<{}> = () => {
attrWithObj
=
{...
attrWithObj
,
...
t
}
}
_attributeArrByImageRender
.
push
(
attrWithObj
)
const
_price
=
sortLadderPrice
(
item
.
unitPrice
)
const
_priceRate
=
item
.
priceRate
const
_priceNumber
=
Object
.
keys
(
_price
)[
0
]
===
'0-0'
?
Object
.
values
(
_price
)[
0
]
:
Object
.
values
(
_price
)
let
temp
=
{
"索引"
:
index
,
"商品名称"
:
product
.
name
,
"对应货品"
:
item
.
goods
?.
code
+
'/'
+
item
.
goods
?.
name
+
'/'
+
item
.
goods
?.
type
,
...
attrWithObj
,
"单价"
:
sortLadderPrice
(
item
.
unitPrice
),
"单价"
:
_price
,
'副单价率'
:
_priceRate
,
'副单价'
:
Array
.
isArray
(
_priceNumber
)
?
_priceNumber
.
map
(
_p
=>
(
Number
(
_p
)
*
Number
(
_priceRate
)
/
100
).
toFixed
(
2
))
:
(
Number
(
_priceNumber
)
*
Number
(
_priceRate
)
/
100
).
toFixed
(
2
)
}
return
temp
})
...
...
@@ -577,6 +596,16 @@ const viewProducts: React.FC<{}> = () => {
<
p
>
{
productDetail
?.
unitName
}
</
p
>
</
Col
>
</
Row
>
{
productDetail
?.
subUnitName
?
<
Row
>
<
Col
span=
{
2
}
>
<
p
>
计量副单位:
</
p
>
</
Col
>
<
Col
span=
{
22
}
>
<
p
>
{
productDetail
?.
subUnitName
}
</
p
>
</
Col
>
</
Row
>
:
null
}
<
Row
>
<
Col
span=
{
2
}
>
<
p
>
最小起订:
</
p
>
...
...
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