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
c0c86597
Commit
c0c86597
authored
Mar 29, 2022
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Plain Diff
merge: merge v2 into v2-220318
parents
225d029e
eb6f99a4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
18 deletions
+114
-18
index.tsx
src/pages/member/components/ModifyClassifyDrawer/index.tsx
+60
-9
schema.ts
src/pages/member/components/ModifyClassifyDrawer/schema.ts
+51
-0
index.less
...ComingClassify/components/ComingClassifyDrawer/index.less
+0
-7
index.ts
...gClassify/components/ComingClassifyDrawer/schema/index.ts
+0
-0
verify.tsx
src/pages/member/memberPrComingClassify/verify.tsx
+3
-2
No files found.
src/pages/member/components/ModifyClassifyDrawer/index.tsx
View file @
c0c86597
...
...
@@ -13,17 +13,18 @@ import {
}
from
'antd'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
createFormActions
,
createAsyncFormActions
,
FormEffectHooks
,
FormPath
,
}
from
'@formily/antd'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
import
{
ArrayCards
}
from
'@formily/antd-components'
;
import
{
getMemberAbilityMaintenanceDetailRecordClassifyCategoryItems
,
getMemberAbilityMaintenanceDetailRecordClassifyCity
,
getMemberAbilityMaintenanceDetailRecordClassifyProvince
,
getMemberDepositClassifyCategoryItems
,
getMemberDepositClassifyCity
,
getMemberDepositClassifyProvince
,
}
from
'@/services/MemberV2Api'
;
import
{
getProductCustomerGetCustomerCategoryTree
}
from
'@/services/ProductV2Api'
;
import
{
...
...
@@ -107,9 +108,17 @@ export type ValueType = {
* 主营品类列表
*/
categories
:
CategoriesType
[],
/**
* 是否通过
*/
agree
?:
number
,
/**
* 通过理由
*/
reason
?:
string
,
}
export
interface
FormValueType
extends
Omit
<
ValueType
,
(
'maxAmount'
|
'categories'
)
>
{
export
interface
FormValueType
extends
Omit
<
ValueType
,
(
'maxAmount'
|
'categories'
|
'agree'
|
'reason'
)
>
{
/**
* 会员编码
*/
...
...
@@ -184,11 +193,15 @@ interface IProps {
/**
* 值
*/
value
:
FormValueType
,
value
?
:
FormValueType
,
/**
* 确认按钮 loading
*/
submitLoading
:
boolean
,
/**
* 是否可审核的,默认 0
*/
isVerify
?:
0
|
1
,
}
const
formActions
=
createAsyncFormActions
();
...
...
@@ -198,6 +211,27 @@ const {
onFieldInputChange$
,
}
=
FormEffectHooks
;
// 省级接口map
const
PROVINCE_API_MAP
=
{
0
:
getMemberAbilityMaintenanceDetailRecordClassifyProvince
,
1
:
getMemberDepositClassifyProvince
,
};
// 会员品类接口map
const
CATEGORY_TREE_API_MAP
=
{
0
:
getProductCustomerGetCustomerCategoryTree
,
1
:
getProductCustomerGetCustomerCategoryTree
,
};
// 结算类型、发票类型接口map
const
ITEMS_API_MAP
=
{
0
:
getMemberAbilityMaintenanceDetailRecordClassifyCategoryItems
,
1
:
getMemberDepositClassifyCategoryItems
,
};
// 城市接口map
const
CITY_API_MAP
=
{
0
:
getMemberAbilityMaintenanceDetailRecordClassifyCity
,
1
:
getMemberDepositClassifyCity
,
};
const
ComingClassifyDrawer
:
React
.
FC
<
IProps
>
=
(
props
:
IProps
)
=>
{
const
{
visible
,
...
...
@@ -206,6 +240,7 @@ const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => {
partnerTypes
,
value
,
submitLoading
,
isVerify
=
0
,
}
=
props
;
const
categoryTreeRef
=
useRef
<
CategoryItemType
[]
>
([]);
...
...
@@ -291,7 +326,7 @@ const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => {
}
);
getMemberAbilityMaintenanceDetailRecordClassifyCity
({
CITY_API_MAP
[
isVerify
]
({
provinceCode
:
fieldState
.
value
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
...
...
@@ -403,7 +438,7 @@ const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => {
onFormInit$
().
subscribe
(()
=>
{
// 请求省级数据
getMemberAbilityMaintenanceDetailRecordClassifyProvince
().
then
(
res
=>
{
PROVINCE_API_MAP
[
isVerify
]
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
{
data
=
[]
}
=
res
;
const
options
=
data
.
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
code
}));
...
...
@@ -416,10 +451,10 @@ const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => {
});
// 请求会员品类数据
getProductCustomerGetCustomerCategoryTree
().
then
(
res
=>
{
CATEGORY_TREE_API_MAP
[
isVerify
]
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
{
data
=
[]
}
=
res
;
categoryTreeRef
.
current
=
data
as
CategoryItemType
[];
categoryTreeRef
.
current
=
data
as
unknown
as
CategoryItemType
[];
formActions
.
setFieldState
(
'categories.*.category'
,
state
=>
{
FormPath
.
setIn
(
state
,
'props.x-component-props.options'
,
data
);
});
...
...
@@ -429,7 +464,7 @@ const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => {
});
// 请求结算方式与发票类型数据
getMemberAbilityMaintenanceDetailRecordClassifyCategoryItems
().
then
(
res
=>
{
ITEMS_API_MAP
[
isVerify
]
().
then
(
res
=>
{
if
(
res
.
code
===
1000
&&
res
.
data
)
{
const
{
payTypes
=
[],
invoiceTypes
}
=
res
.
data
;
formActions
.
setFieldState
(
'categories.*.payType'
,
state
=>
{
...
...
@@ -448,6 +483,22 @@ const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => {
}).
catch
((
err
)
=>
{
console
.
warn
(
err
);
});
if
(
isVerify
===
0
)
{
setFieldState
(
'VERIFY_APPLY'
,
(
state
)
=>
{
state
.
visible
=
false
;
});
}
});
onFieldValueChange$
(
'agree'
).
subscribe
(
fieldState
=>
{
setFieldState
(
'reason'
,
state
=>
{
state
.
title
=
fieldState
.
value
===
0
?
intl
.
formatMessage
({
id
:
'member.management.common.form.reason.noPass'
})
:
intl
.
formatMessage
({
id
:
'member.management.common.form.reason.pass'
});
state
.
required
=
fieldState
.
value
===
0
;
setTimeout
(()
=>
{
formActions
.
validate
(
'reason'
);
},
0
);
});
});
}
}
actions=
{
formActions
}
...
...
src/pages/member/components/ModifyClassifyDrawer/schema.ts
View file @
c0c86597
...
...
@@ -337,5 +337,55 @@ export const schema: ISchema = {
},
},
},
VERIFY_APPLY
:
{
type
:
'object'
,
'x-component'
:
'FlagBox'
,
'x-component-props'
:
{
title
:
intl
.
formatMessage
({
id
:
'member.management.memberPrComingClassify.drawer.form.verify'
}),
},
properties
:
{
MEGA_LAYOUT
:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
'x-component-props'
:
{
labelCol
:
4
,
wrapperCol
:
18
,
labelAlign
:
'left'
,
},
properties
:
{
agree
:
{
type
:
'string'
,
title
:
intl
.
formatMessage
({
id
:
'member.management.memberPrComingClassify.drawer.form.verify.agree'
}),
default
:
1
,
'x-component'
:
'Radio'
,
required
:
true
,
enum
:
[
{
label
:
intl
.
formatMessage
({
id
:
'member.management.memberPrComingClassify.drawer.form.verify.agree.pass'
}),
value
:
1
},
{
label
:
intl
.
formatMessage
({
id
:
'member.management.memberPrComingClassify.drawer.form.verify.agree.noPass'
}),
value
:
0
},
],
'x-component-props'
:
{},
},
reason
:
{
type
:
'string'
,
title
:
intl
.
formatMessage
({
id
:
'member.management.memberPrComingClassify.drawer.form.verify.reason'
}),
'x-component'
:
'Textarea'
,
'x-component-props'
:
{
placeholder
:
intl
.
formatMessage
({
id
:
'member.management.memberPrComingClassify.drawer.form.verify.placeholder'
}),
rows
:
5
,
},
'x-rules'
:
[
{
required
:
true
,
},
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
120
,
}
],
},
},
},
},
},
},
};
\ No newline at end of file
src/pages/member/memberPrComingClassify/components/ComingClassifyDrawer/index.less
deleted
100644 → 0
View file @
225d029e
@import '~antd/es/style/themes/default.less';
.description {
color: @text-color-secondary;
margin-bottom: @margin-md;
}
\ No newline at end of file
src/pages/member/memberPrComingClassify/components/ComingClassifyDrawer/schema/index.ts
deleted
100644 → 0
View file @
225d029e
This diff is collapsed.
Click to expand it.
src/pages/member/memberPrComingClassify/verify.tsx
View file @
c0c86597
...
...
@@ -13,9 +13,9 @@ import {
import
{
history
,
useIntl
}
from
'umi'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
postMemberDepositClassify
,
getMemberDepositClassifyDetail
}
from
'@/services/MemberV2Api'
;
import
ModifyClassifyDrawer
,
{
ValueType
}
from
'../components/ModifyClassifyDrawer'
;
import
fetchDetailHoc
from
'../common/hoc/fetchDetailHoc'
;
import
MemberProfile
from
'../components/MemberProfile'
;
import
ComingClassifyDrawer
,
{
ValueType
}
from
'./components/ComingClassifyDrawer'
;
const
MemberPrComingClassifyVerify
:
React
.
FC
<
{}
>
=
()
=>
{
const
{
validateId
}
=
usePageStatus
();
...
...
@@ -72,7 +72,7 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
{
intl
.
formatMessage
({
id
:
'member.actions.apply.verify'
})
}
</
Button
>
<
Coming
ClassifyDrawer
<
Modify
ClassifyDrawer
visible=
{
visibleVerifyDrawer
}
partnerTypes=
{
(
info
...
...
@@ -83,6 +83,7 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
onClose=
{
()
=>
handleVisibleVerifyDrawer
(
false
)
}
submitLoading=
{
submitLoading
}
onSubmit=
{
handleSubmit
}
isVerify=
{
1
}
/>
</>
)
}
...
...
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