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
6bf82f45
Commit
6bf82f45
authored
Jul 30, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 跟进或者商品列表相关
parent
14712a2d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
11 deletions
+78
-11
index.tsx
...erchantCouponUnsubmitted/components/GoodsDrawer/index.tsx
+58
-7
schema.tsx
...rchantCouponUnsubmitted/components/GoodsDrawer/schema.tsx
+20
-4
No files found.
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponUnsubmitted/components/GoodsDrawer/index.tsx
View file @
6bf82f45
...
@@ -2,20 +2,27 @@
...
@@ -2,20 +2,27 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2021-06-24 16:11:55
* @Date: 2021-06-24 16:11:55
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-
28 14:13:43
* @LastEditTime: 2021-07-
30 10:10:15
* @Description: 商品选择抽屉
* @Description: 商品选择抽屉
*/
*/
import
React
,
{
useEffect
}
from
'react'
;
import
React
,
{
useEffect
}
from
'react'
;
import
{
Drawer
,
Button
,
message
}
from
'antd'
;
import
{
Drawer
,
Button
,
message
}
from
'antd'
;
import
{
FormEffectHooks
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
import
PolymericTable
,
{
EditableColumns
,
FetchParamsType
}
from
'@/components/PolymericTable'
;
import
PolymericTable
,
{
EditableColumns
,
FetchParamsType
}
from
'@/components/PolymericTable'
;
import
{
normalizeUnitPrice
}
from
'../../../utils'
;
import
{
normalizeUnitPrice
}
from
'../../../utils'
;
import
{
querySchema
}
from
'./schema'
;
import
{
querySchema
}
from
'./schema'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
const
{
onFormInit$
,
}
=
FormEffectHooks
;
export
type
ProductItemType
=
{
export
type
ProductItemType
=
{
/**
/**
* 数据id
* 数据id
...
@@ -78,9 +85,17 @@ interface IProps {
...
@@ -78,9 +85,17 @@ interface IProps {
type
ExtraFetchType
=
FetchParamsType
&
{
type
ExtraFetchType
=
FetchParamsType
&
{
/**
/**
* 商城id
* 商品名称
*/
commodityName
?:
string
,
/**
* 会员品类id
*/
customerCategoryId
?:
number
,
/**
* 品牌id
*/
*/
shopId
:
number
,
brandId
?
:
number
,
}
}
const
GoodsDrawer
:
React
.
FC
<
IProps
>
=
(
props
)
=>
{
const
GoodsDrawer
:
React
.
FC
<
IProps
>
=
(
props
)
=>
{
...
@@ -101,11 +116,14 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
...
@@ -101,11 +116,14 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
},
[
checkeds
]);
},
[
checkeds
]);
const
fetchData
=
async
(
params
:
ExtraFetchType
)
=>
{
const
fetchData
=
async
(
params
:
ExtraFetchType
)
=>
{
const
res
=
await
PublicApi
.
getProductCommodityGetCommoditySkuListByShopId
({
if
(
!
shopIds
||
!
shopIds
.
length
)
{
return
;
}
const
res
=
await
PublicApi
.
postProductCommodityGetCommoditySkuListByShopId
({
...
params
,
...
params
,
current
:
`
${
params
.
current
}
`
,
shopIdList
:
shopIds
,
pageSize
:
`
${
params
.
pageSize
}
`
,
},
{
shopId
:
`
${
shopIds
[
0
]
||
''
}
`
,
ctlType
:
'none'
,
});
});
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
return
res
.
data
;
return
res
.
data
;
...
@@ -174,6 +192,26 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
...
@@ -174,6 +192,26 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
}
}
};
};
// 获取品牌
const
fetchBrand
=
async
(
name
=
''
)
=>
{
const
res
=
await
PublicApi
.
getProductSelectGetSelectBrand
({
name
,
});
if
(
res
.
code
===
1000
)
{
return
res
.
data
;
}
return
[];
}
// 获取会员品类
const
fetchCustomerCategory
=
async
()
=>
{
const
res
=
await
PublicApi
.
getProductCustomerGetCustomerCategoryTree
();
if
(
res
.
code
===
1000
)
{
return
res
.
data
;
}
return
[];
}
return
(
return
(
<
Drawer
<
Drawer
title=
"选择适用商品"
title=
"选择适用商品"
...
@@ -205,12 +243,25 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
...
@@ -205,12 +243,25 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
searchFormProps=
{
{
searchFormProps=
{
{
schema
:
querySchema
,
schema
:
querySchema
,
effects
:
(
$
,
actions
)
=>
{
effects
:
(
$
,
actions
)
=>
{
const
linkage
=
useLinkageUtils
();
useStateFilterSearchLinkageEffect
(
useStateFilterSearchLinkageEffect
(
$
,
$
,
actions
,
actions
,
'name'
,
'name'
,
FORM_FILTER_PATH
,
FORM_FILTER_PATH
,
);
);
useAsyncSelect
(
'brandId'
,
fetchBrand
,
[
'name'
,
'id'
]);
onFormInit$
().
subscribe
(()
=>
{
// 初始化远程检索逻辑
fetchCustomerCategory
().
then
(
res
=>
{
linkage
.
componentProps
(
'customerCategoryId'
,
{
dataoption
:
res
,
});
});
});
},
},
}
}
}
}
full
full
...
...
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponUnsubmitted/components/GoodsDrawer/schema.tsx
View file @
6bf82f45
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2021-06-24 16:19:18
* @Date: 2021-06-24 16:19:18
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-
28 10:54:23
* @LastEditTime: 2021-07-
30 10:06:32
* @Description:
* @Description:
*/
*/
import
{
ISchema
}
from
'@formily/antd'
;
import
{
ISchema
}
from
'@formily/antd'
;
...
@@ -34,20 +34,36 @@ export const querySchema: ISchema = {
...
@@ -34,20 +34,36 @@ export const querySchema: ISchema = {
columns
:
6
,
columns
:
6
,
},
},
properties
:
{
properties
:
{
c
ategory
:
{
c
ustomerCategoryId
:
{
type
:
'string'
,
type
:
'string'
,
'x-component'
:
'CustomCategorySearch'
,
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'商品品类'
,
placeholder
:
'商品品类'
,
allowClear
:
true
,
showSearch
:
true
,
notFoundContent
:
null
,
dataoption
:
[],
fieldNames
:
{
label
:
'title'
,
value
:
'id'
,
children
:
'children'
},
changeOnSelect
:
true
,
expandTrigger
:
'hover'
,
},
},
},
},
brand
:
{
brand
Id
:
{
type
:
'string'
,
type
:
'string'
,
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'商品品牌'
,
placeholder
:
'商品品牌'
,
allowClear
:
true
,
allowClear
:
true
,
},
},
},
},
submit
:
{
type
:
'string'
,
'x-component'
:
'Submit'
,
'x-mega-props'
:
{
span
:
1
,
},
'x-component-props'
:
{
children
:
'查询'
,
},
},
},
},
},
},
},
},
...
...
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