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
shenshaokai
jinfa-platform
Commits
ed7867bb
Commit
ed7867bb
authored
Nov 26, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:商品货品区块更改为NiceForm筛选
parent
6331efc7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
413 additions
and
194 deletions
+413
-194
index.tsx
src/pages/commodity/goods/effect/index.tsx
+31
-0
index.tsx
src/pages/commodity/goods/index.tsx
+27
-186
index.tsx
src/pages/commodity/goods/schema/index.tsx
+19
-4
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+1
-0
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+2
-2
fastModifyPrice.tsx
src/pages/commodity/products/fastModifyPrice.tsx
+0
-0
index.tsx
src/pages/commodity/products/index.tsx
+0
-0
channelSchema.tsx
src/pages/commodity/products/schema/channelSchema.tsx
+0
-2
productSchema.tsx
src/pages/commodity/products/schema/productSchema.tsx
+333
-0
No files found.
src/pages/commodity/goods/effect/index.tsx
0 → 100644
View file @
ed7867bb
import
React
,
{
useEffect
}
from
'react'
import
{
ISchemaFormActions
,
FormEffectHooks
,
IFormActions
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
const
{
onFieldValueChange$
}
=
FormEffectHooks
// 高级筛选schema中用于输入搜索品牌的Effect
export
const
searchBrandOptionEffect
=
(
context
:
any
,
fieldName
:
string
)
=>
{
context
.
getFieldState
(
fieldName
,
state
=>
{
// console.log(state.props['x-component-props'].searchValue, 'pagesearchvalue') // 此处可以实时获取到输入并暂存在schema props的值
PublicApi
.
getProductSelectGetSelectBrand
({
name
:
state
.
props
[
'x-component-props'
].
searchValue
}).
then
(
res
=>
{
context
.
setFieldState
(
fieldName
,
state
=>
{
state
.
props
[
'x-component-props'
].
dataoption
=
res
.
data
})
})
})
}
// 高级筛选schema中用于输入搜索商品品类的Effect
export
const
searchCustomerCategoryOptionEffect
=
(
context
:
any
,
fieldName
:
string
)
=>
{
context
.
getFieldState
(
fieldName
,
state
=>
{
PublicApi
.
getProductSelectGetSelectCustomerCategory
({
name
:
state
.
props
[
'x-component-props'
].
searchValue
}).
then
(
res
=>
{
context
.
setFieldState
(
fieldName
,
state
=>
{
state
.
props
[
'x-component-props'
].
dataoption
=
res
.
data
})
})
})
}
\ No newline at end of file
src/pages/commodity/goods/index.tsx
View file @
ed7867bb
This diff is collapsed.
Click to expand it.
src/pages/commodity/goods/schema/index.tsx
View file @
ed7867bb
...
@@ -53,15 +53,30 @@ export const goodsSchema: ISchema = {
...
@@ -53,15 +53,30 @@ export const goodsSchema: ISchema = {
type
:
'string'
,
type
:
'string'
,
'x-component'
:
'CustomInputSearch'
,
'x-component'
:
'CustomInputSearch'
,
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'品牌'
,
placeholder
:
'商品品牌'
,
showSearch
:
true
,
showArrow
:
true
,
defaultActiveFirstOption
:
false
,
filterOption
:
false
,
notFoundContent
:
null
,
style
:
{
width
:
'174px'
},
searchValue
:
null
,
dataoption
:
[],
},
},
},
},
customerCategoryId
:
{
customerCategoryId
:
{
type
:
'string'
,
type
:
'string'
,
enum
:
[]
,
'x-component'
:
'CustomInputSearch'
,
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'品类'
,
placeholder
:
'商品品类'
,
style
:
{
width
:
'100%'
}
showSearch
:
true
,
showArrow
:
true
,
defaultActiveFirstOption
:
false
,
filterOption
:
false
,
notFoundContent
:
null
,
style
:
{
width
:
'174px'
},
searchValue
:
null
,
dataoption
:
[]
},
},
},
},
batch
:
{
batch
:
{
...
...
src/pages/commodity/products/addProducts.tsx
View file @
ed7867bb
...
@@ -179,6 +179,7 @@ const AddProducts: React.FC<{}> = (props) => {
...
@@ -179,6 +179,7 @@ const AddProducts: React.FC<{}> = (props) => {
commodityAttributeList
:
productSelectAttribute
,
commodityAttributeList
:
productSelectAttribute
,
commodityRemark
:
_productDescription
,
commodityRemark
:
_productDescription
,
isAllAttributePic
:
isAllAttributePic
,
isAllAttributePic
:
isAllAttributePic
,
isUpdateAttribute
:
true
,
}
}
// 处理地址
// 处理地址
let
_commodityAreaList
:
any
=
[]
let
_commodityAreaList
:
any
=
[]
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
ed7867bb
...
@@ -349,8 +349,8 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
...
@@ -349,8 +349,8 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
let
_tempObj
:
any
=
{
索引
:
0
,
商品名称
:
productName
}
let
_tempObj
:
any
=
{
索引
:
0
,
商品名称
:
productName
}
_tempObj
[
'对应货品'
]
=
selectedGoods
.
length
>
0
?
selectedGoods
[
0
].
id
:
0
// 编辑情况下 对应货品id和单价 特殊处理
_tempObj
[
'对应货品'
]
=
selectedGoods
.
length
>
0
?
selectedGoods
[
0
].
id
:
0
// 编辑情况下 对应货品id和单价 特殊处理
// 携带unitPriceAndPicList的id字段
// 携带unitPriceAndPicList的id字段
if
(
!
productInfoByEdit
.
isUpdateAttribute
){
if
(
!
productInfoByEdit
?
.
isUpdateAttribute
){
_tempObj
[
'规格ID'
]
=
productInfoByEdit
.
unitPriceAndPicList
[
0
]?.
id
_tempObj
[
'规格ID'
]
=
productInfoByEdit
?
.
unitPriceAndPicList
[
0
]?.
id
}
}
if
(
updateFlag
.
current
){
if
(
updateFlag
.
current
){
_tempObj
[
'单价'
]
=
productInfoByEdit
?.
unitPriceAndPicList
[
0
]?.
unitPrice
||
{}
_tempObj
[
'单价'
]
=
productInfoByEdit
?.
unitPriceAndPicList
[
0
]?.
unitPrice
||
{}
...
...
src/pages/commodity/products/fastModifyPrice.tsx
View file @
ed7867bb
This diff is collapsed.
Click to expand it.
src/pages/commodity/products/index.tsx
View file @
ed7867bb
This diff is collapsed.
Click to expand it.
src/pages/commodity/products/schema/channelSchema.tsx
View file @
ed7867bb
import
{
ISchema
}
from
'@formily/antd'
;
import
{
ISchema
}
from
'@formily/antd'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
PublicApi
}
from
'@/services/api'
;
// 渠道商品列表高级搜索
// 渠道商品列表高级搜索
export
const
channelSchema
:
ISchema
=
{
export
const
channelSchema
:
ISchema
=
{
...
...
src/pages/commodity/products/schema/productSchema.tsx
0 → 100644
View file @
ed7867bb
This diff is collapsed.
Click to expand it.
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