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
linweijiong
jinfa-platform
Commits
3307f15f
Commit
3307f15f
authored
Oct 15, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:交易规则排除已设置商品
parent
429dc474
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
RuleSetting.tsx
...s/transaction/transactionRules/components/RuleSetting.tsx
+12
-1
index.tsx
src/pages/transaction/transactionRules/schema/index.tsx
+2
-1
No files found.
src/pages/transaction/transactionRules/components/RuleSetting.tsx
View file @
3307f15f
import
React
,
{
useEffect
,
useState
}
from
'react'
import
React
,
{
useEffect
,
use
Ref
,
use
State
}
from
'react'
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
import
{
useInitValue
}
from
'@/formSchema/effects/useInitValue'
import
EyePreview
from
'@/components/EyePreview'
...
...
@@ -35,6 +35,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
const
[
productRowSelection
,
productRowCtl
]
=
useRowSelectionTable
({
customKey
:
'id'
})
const
[
productsLength
,
setProductsLength
]
=
useState
(
0
)
const
[
initValue
,
setInitialValue
]
=
useState
({})
const
[
idNotInList
,
setIdNotInList
]
=
useState
([])
const
{
id
,
...
...
@@ -51,6 +52,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
...
params
,
shopType
:
shopInfo
[
0
].
type
,
environment
:
shopInfo
[
0
].
environment
,
idNotInList
:
idNotInList
,
})
return
res
.
data
}
else
{
...
...
@@ -266,6 +268,14 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
}
}
// // 查询已设置交易规则的列表
const
fatchSetedProducts
=
(
id
)
=>
{
PublicApi
.
getOrderTradingRulesProductIdList
({
shopId
:
id
}).
then
(
res
=>
{
const
{
data
,
code
}
=
res
setIdNotInList
(()
=>
data
?.
productIds
||
[])
})
}
return
(
<>
<
NiceForm
...
...
@@ -295,6 +305,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
setFieldState
(
'isTacitlyApprove'
,
state
=>
{
state
.
value
=
1
})
fatchSetedProducts
(
parentState
.
value
[
0
])
})
}
}
onSubmit=
{
handleSubmit
}
...
...
src/pages/transaction/transactionRules/schema/index.tsx
View file @
3307f15f
...
...
@@ -173,7 +173,8 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
"x-component-props"
:
{
rowKey
:
'id'
,
columns
:
"{{tableColumns}}"
,
prefix
:
"{{tableAddButton}}"
prefix
:
"{{tableAddButton}}"
,
idNotList
:
[]
}
}
}
...
...
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