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
f1206a8b
Commit
f1206a8b
authored
Sep 28, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:
parent
f5cf7d1a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
9 deletions
+16
-9
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+12
-0
basicInfoForm.tsx
...ages/commodity/products/addProductsItem/basicInfoForm.tsx
+2
-7
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+1
-1
productImageForm.tsx
...s/commodity/products/addProductsItem/productImageForm.tsx
+1
-1
No files found.
src/pages/commodity/products/addProducts.tsx
View file @
f1206a8b
...
...
@@ -34,6 +34,9 @@ const AddProducts: React.FC<{}> = (props) => {
const
[
isDisableSaveBtn
,
setIsDisableSaveBtn
]
=
useState
<
boolean
>
(
false
)
const
[
currentTemplateName
,
setCurrentTemplateName
]
=
useState
<
string
>
()
let
[
formRefs
,
setFormRefs
]
=
useState
([])
//子form的ref数组
const
[
forceRenderRef
,
setForceRenderRef
]
=
useState
<
boolean
>
(
false
)
// 编辑情况下 是否强制渲染后面的 tabpane
const
isFirstRender
=
useRef
<
boolean
>
(
true
)
// 编辑情况下 是否是初始切换品类
const
{
ProductStore
}
=
store
const
{
productSelectAttribute
,
...
...
@@ -61,8 +64,17 @@ const AddProducts: React.FC<{}> = (props) => {
setProductName
(
data
?.
name
)
const
attributeRes
=
await
PublicApi
.
getProductCustomerGetCustomerCategoryById
({
id
:
data
?.
customerCategory
?.
id
+
''
})
setAttributeLists
(
attributeRes
.
data
?.
customerAttributeList
)
// return productRes.code
}
makeRequest
()
// .then(v => {
// if(v === 1000){
// if(!isFirstRender)
// setForceRenderRef(true)
// else
// isFirstRender.current = false
// }
// })
}
return
()
=>
{
...
...
src/pages/commodity/products/addProductsItem/basicInfoForm.tsx
View file @
f1206a8b
...
...
@@ -90,8 +90,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
let
arr
=
[...
res
.
data
]
//裁去最后一级别
for
(
let
index
in
arr
)
{
for
(
let
_index
in
arr
[
index
].
areaResponses
)
{
let
o
=
arr
[
index
].
areaResponses
//@ts-ignore
let
o
:
any
=
arr
[
index
].
areaResponses
o
[
_index
].
areaResponses
=
null
}
}
...
...
@@ -114,11 +113,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
}
},
[
productInfoByEdit
,
getBasicFormParamsByEdit
])
const
onFinish
=
(
values
:
any
)
=>
{
console
.
log
(
values
,
'原values'
)
}
const
handleBrandSearch
=
(
value
?:
any
)
=>
{
// end value
const
handleBrandSearch
=
(
value
?:
any
)
=>
{
PublicApi
.
getProductSelectGetSelectBrand
({
name
:
value
||
''
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setBrandData
(
res
.
data
)
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
f1206a8b
...
...
@@ -90,7 +90,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
if
(
history
.
location
.
query
?.
id
&&
!
flagRef
.
current
)
{
flagRef
.
current
=
true
}
else
{
setProductSelectAttribute
([])
//
setProductSelectAttribute([])
priceForm
.
resetFields
()
priceForm
.
setFieldsValue
({
isMemberPrice
:
false
,
priceType
:
planPrice
})
}
...
...
src/pages/commodity/products/addProductsItem/productImageForm.tsx
View file @
f1206a8b
...
...
@@ -34,7 +34,7 @@ const ProductImageForm: React.FC<{}> = (props) => {
// 品类 变动清空数据
// 编辑下 flag为false 不清空;编辑下 flag为true 新建清空
if
(
history
.
location
.
query
?.
id
&&
!
flagRef
.
current
)
{
flagRef
.
current
=
true
flagRef
.
current
=
true
}
else
{
onChangeSetImageType
({
target
:
{
value
:
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