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
8f251c0d
Commit
8f251c0d
authored
Aug 21, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:快捷修改价格
parent
c66800e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
fastModifyPrice.tsx
src/pages/commodity/products/fastModifyPrice.tsx
+21
-14
No files found.
src/pages/commodity/products/fastModifyPrice.tsx
View file @
8f251c0d
...
@@ -46,25 +46,15 @@ const FastModifyPrice: React.FC<{}> = () => {
...
@@ -46,25 +46,15 @@ const FastModifyPrice: React.FC<{}> = () => {
const
[
setForm
]
=
Form
.
useForm
()
const
[
setForm
]
=
Form
.
useForm
()
const
[
modifyModal
,
setModifyModal
]
=
useState
(
false
)
const
[
modifyModal
,
setModifyModal
]
=
useState
(
false
)
const
[
ladderPrice
,
setLadderPrice
]
=
useState
(
false
)
const
[
ladderPrice
,
setLadderPrice
]
=
useState
(
false
)
const
[
currentRow
,
setCurrentRow
]
=
useState
<
any
>
()
let
[
isHighSearch
,
setIsHighSearch
]
=
useState
(
false
)
let
[
isHighSearch
,
setIsHighSearch
]
=
useState
(
false
)
const
layout
=
{
const
layout
=
{
labelCol
:
{
span
:
24
},
labelCol
:
{
span
:
24
},
wrapperCol
:
{
span
:
24
},
wrapperCol
:
{
span
:
24
},
}
;
}
// const [filterParams, setFilterParams] = useState<paramItem>({
// name: '',
// code: '',
// priceType: null,
// min: null,
// max: null,
// brandId: 0,
// customerCategoryId: 0,
// status: null,
// })
const
[
filterParams
,
setFilterParams
]
=
useState
<
any
>
({})
const
[
filterParams
,
setFilterParams
]
=
useState
<
any
>
({})
const
[
brandData
,
setBrandData
]
=
useState
<
any
>
([])
const
[
brandData
,
setBrandData
]
=
useState
<
any
>
([])
const
[
brandValue
,
setBrandValue
]
=
useState
(
undefined
)
const
[
brandValue
,
setBrandValue
]
=
useState
(
undefined
)
...
@@ -191,6 +181,7 @@ const FastModifyPrice: React.FC<{}> = () => {
...
@@ -191,6 +181,7 @@ const FastModifyPrice: React.FC<{}> = () => {
const
handleModify
=
(
record
:
any
)
=>
{
const
handleModify
=
(
record
:
any
)
=>
{
console
.
log
(
'点击修改价格'
,
record
)
console
.
log
(
'点击修改价格'
,
record
)
setCurrentRow
(
record
)
const
{
id
,
unitPrice
,
priceType
}
=
record
const
{
id
,
unitPrice
,
priceType
}
=
record
// 阶梯价格回显处理
// 阶梯价格回显处理
setModifyModal
(
true
)
setModifyModal
(
true
)
...
@@ -259,7 +250,23 @@ const FastModifyPrice: React.FC<{}> = () => {
...
@@ -259,7 +250,23 @@ const FastModifyPrice: React.FC<{}> = () => {
const
handleOk
=
()
=>
{
const
handleOk
=
()
=>
{
setForm
.
validateFields
().
then
(
v
=>
{
setForm
.
validateFields
().
then
(
v
=>
{
setModifyModal
(
false
)
console
.
log
(
v
,
'v'
)
const
{
ladderPrice
,
ladderRange
}
=
v
let
_priceRange
=
{}
if
(
ladderPrice
){
// 判断阶梯价格
ladderRange
.
length
>
0
&&
ladderRange
.
map
(
_item
=>
{
_priceRange
[
`
${
_item
.
numberRange
.
numberMin
}
-
${
_item
.
numberRange
.
numberMax
}
`
]
=
_item
.
numberPrice
})
}
else
{
_priceRange
[
'0-0'
]
=
v
.
uniquePrice
}
console
.
log
(
_priceRange
)
PublicApi
.
postProductCommodityUpdateCommodityPrice
({
commodityId
:
currentRow
.
id
,
unitPriceAndPicId
:
currentRow
.
commodityId
,
unitPrice
:
_priceRange
}).
then
(
res
=>
{
if
(
res
.
code
===
100
){
ref
.
current
.
reload
()
setModifyModal
(
false
)
}
})
})
})
}
}
...
@@ -294,7 +301,7 @@ const FastModifyPrice: React.FC<{}> = () => {
...
@@ -294,7 +301,7 @@ const FastModifyPrice: React.FC<{}> = () => {
},
},
[]
[]
)
)
let
result
=
range
.
reduce
((
a
,
b
)
=>
{
console
.
log
(
a
,
b
);
if
(
a
<
b
)
return
b
})
let
result
=
range
.
reduce
((
a
,
b
)
=>
{
if
(
a
<
b
)
return
b
})
// console.log(result, 'result')
// console.log(result, 'result')
if
(
!
result
)
throw
new
Error
(
'请正确输入阶梯数量范围'
);
if
(
!
result
)
throw
new
Error
(
'请正确输入阶梯数量范围'
);
callback
()
callback
()
...
...
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