Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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-admin
Commits
b875a9d0
Commit
b875a9d0
authored
Nov 09, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://10.0.0.22:3000/lingxi/lingxi-business-system
into dev
parents
63f94004
7c60ea56
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
60 deletions
+104
-60
ruleSettingRoutes.ts
config/routes/ruleSettingRoutes.ts
+10
-1
app.tsx
src/app.tsx
+2
-0
menu.ts
src/locales/zh-CN/menu.ts
+1
-0
index.tsx
...pages/ruleSettingManage/components/SettleMethod/index.tsx
+0
-3
index.tsx
...leSettingManage/platformSettlementStrategy/info/index.tsx
+54
-37
schema.tsx
...eSettingManage/platformSettlementStrategy/info/schema.tsx
+31
-13
index.tsx
...leSettingManage/platformSettlementStrategy/list/index.tsx
+6
-6
No files found.
config/routes/ruleSettingRoutes.ts
View file @
b875a9d0
...
...
@@ -81,7 +81,16 @@ const router = {
path
:
'/ruleSettingManager/platformSettlementStrategy/add'
,
name
:
'addplatformSettlementStrategy'
,
component
:
'@/pages/ruleSettingManage/platformSettlementStrategy/info'
,
hidePageHeader
:
true
hidePageHeader
:
true
,
hideInMenu
:
true
},
// 平台结算策略配置, 平台策略配置详情页
{
path
:
'/ruleSettingManager/platformSettlementStrategy/detail'
,
name
:
'platformSettlementStrategyDetail'
,
component
:
'@/pages/ruleSettingManage/platformSettlementStrategy/info'
,
hidePageHeader
:
true
,
hideInMenu
:
true
}
]
}
...
...
src/app.tsx
View file @
b875a9d0
...
...
@@ -70,6 +70,8 @@ export function render(oldRender:Function) {
}
console
.
log
(
'render'
)
oldRender
()
}).
catch
(()
=>
{
oldRender
()
})
}
else
{
oldRender
()
...
...
src/locales/zh-CN/menu.ts
View file @
b875a9d0
...
...
@@ -109,6 +109,7 @@ export default {
'menu.ruleSettingManager.memberAuthManageDetail'
:
'会员角色权限设置'
,
'menu.ruleSettingManager.platformSettlementStrategy'
:
'平台结算策略配置'
,
'menu.ruleSettingManager.addplatformSettlementStrategy'
:
'新增平台结算策略'
,
'menu.ruleSettingManager.platformSettlementStrategyDetail'
:
'平台结算策略详情'
,
// 品类和属性
'menu.classAndProperty'
:
'平台品类及属性'
,
...
...
src/pages/ruleSettingManage/components/SettleMethod/index.tsx
View file @
b875a9d0
...
...
@@ -44,10 +44,8 @@ const SettleMethod = (props) => {
const
handleInputChange
=
(
value
,
type
)
=>
{
const
target
=
type
-
1
;
console
.
log
(
target
);
const
temp
=
[...
otherValues
];
temp
[
target
]
=
value
;
console
.
log
(
temp
[
target
]);
props
.
onChange
({
active
:
type
,
otherValues
:
temp
...
...
@@ -129,7 +127,6 @@ const Index = (props) => {
},
[
props
.
initialValue
,
options
])
const
onChange
=
(
value
)
=>
{
console
.
log
(
value
);
props
.
mutators
.
change
(
value
);
}
...
...
src/pages/ruleSettingManage/platformSettlementStrategy/info/index.tsx
View file @
b875a9d0
...
...
@@ -8,7 +8,7 @@ import React, { useEffect, useState } from 'react';
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
NiceForm
from
'@/components/NiceForm'
;
import
{
Card
,
Button
,
message
}
from
'antd'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
import
ModalTable
from
'@/components/ModalTable'
;
import
SearchSelect
from
'@/components/NiceForm/components/SearchSelect'
...
...
@@ -23,6 +23,8 @@ import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import
{
PublicApi
}
from
'@/services/api'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
history
,
Prompt
}
from
'umi'
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
const
{
onFormInit$
,
onFieldValueChange$
}
=
FormEffectHooks
export
const
fetchOptions
=
(
service
)
=>
{
return
async
function
()
{
...
...
@@ -35,7 +37,6 @@ export const fetchOptions = (service) => {
}
const
formActions
=
createFormActions
();
const
{
getSettleAccountsPlatformConfigGetMemberSettlementStrategyDetail
}
=
PublicApi
const
common_columns
:
any
=
[
{
title
:
'ID'
,
dataIndex
:
'memberId'
},
...
...
@@ -60,6 +61,7 @@ const MemberSettleAdd: React.FC = () => {
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
[
memberRowSelection
,
memberRowCtl
]
=
useRowSelectionTable
({
customKey
:
'memberId'
});
const
[
initialValue
,
setInitialValue
]
=
useState
({});
const
[
cacheMember
,
setCacheMember
]
=
useState
([]);
const
{
id
,
preview
}
=
usePageStatus
();
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
[
unsaved
,
setUnsaved
]
=
useState
(
true
);
...
...
@@ -97,33 +99,33 @@ const MemberSettleAdd: React.FC = () => {
setVisible
(
false
);
}
// 从PAAS平台--规则配置--平台规则配置取已勾选的结算方式决定是否显示结算方式
const
fetchBalancedMethods
=
async
()
=>
{
const
{
data
}
=
await
PublicApi
.
getManageRuleConfigurationList
({
platformType
:
'5'
});
const
length
=
data
.
length
return
{
days
:
length
>
0
&&
data
[
0
].
check
,
month
:
length
>
1
&&
data
[
1
].
check
};
}
// 获取适用会员
const
fetchMemberData
=
async
(
params
:
any
)
=>
{
const
{
data
}
=
await
PublicApi
.
getMemberManageLowerPageBynamerole
(
params
);
return
data
}
// 获取适用会员下拉搜索框
const
fetchMemberSearchFilter
=
async
()
=>
{
// /member/manage/role/sub/list
const
{
data
,
code
}
=
await
PublicApi
.
postMemberManageRoleSubList
({},
{
method
:
'GET'
,
ctlType
:
"none"
});
// console.log(data);
///member/manage/all/provider/page
const
{
data
,
code
}
=
await
PublicApi
.
getMemberManageAllProviderPage
(
params
);
if
(
code
===
1000
)
{
return
data
}
return
[];
}
// 获取适用会员下拉搜索框
const
fetchMemberSearchFilter
=
()
=>
{
const
linkage
=
useLinkageUtils
();
onFormInit$
().
subscribe
(()
=>
{
PublicApi
.
getMemberManagePageitems
({
roleTypeEnum
:
'1'
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
{
levels
,
memberTypes
,
roles
}
=
res
.
data
;
linkage
.
enum
(
'level'
,
levels
.
map
((
item
)
=>
({
label
:
item
.
levelTag
,
value
:
item
.
level
})))
linkage
.
enum
(
'memberTypeId'
,
memberTypes
.
map
((
item
)
=>
({
label
:
item
.
memberTypeName
,
value
:
item
.
memberTypeId
})))
linkage
.
enum
(
'roleId'
,
roles
.
map
((
item
)
=>
({
label
:
item
.
roleName
,
value
:
item
.
roleId
})))
}
});
})
}
// 使用会员弹框确认
const
handleOkAddMember
=
()
=>
{
formActions
.
setFieldValue
(
'Tabs.memberTab.someLists'
,
memberRowCtl
.
selectRow
);
...
...
@@ -132,29 +134,34 @@ const MemberSettleAdd: React.FC = () => {
// 提交
const
handleSubmit
=
(
value
)
=>
{
console
.
log
(
value
);
return
;
const
memberList
=
value
.
someLists
.
map
((
item
)
=>
({
memberId
:
item
.
memberId
,
roleId
:
item
.
roleId
}));
const
memberList
=
value
.
someLists
.
map
((
item
)
=>
(
{
memberId
:
item
.
memberId
,
roleId
:
item
.
roleId
,
}
)
);
const
tempData
=
{
name
:
value
.
name
,
settlementOrderType
:
value
.
settlementOrderType
,
memberList
:
memberList
,
memberList
:
value
.
isDefault
?
[]
:
memberList
,
settlementWay
:
value
.
settlementWay
.
active
,
settlementDays
:
value
.
settlementWay
.
otherValues
[
0
],
settlementDate
:
value
.
settlementWay
.
otherValues
[
1
],
isDefault
:
value
.
isDefault
}
const
serviceActions
=
isAdd
?
PublicApi
.
postSettleAccountsPlatformConfigAdd
Member
SettlementStrategy
:
PublicApi
.
postSettleAccountsPlatformConfigUpdate
Member
SettlementStrategy
?
PublicApi
.
postSettleAccountsPlatformConfigAdd
Platform
SettlementStrategy
:
PublicApi
.
postSettleAccountsPlatformConfigUpdate
Platform
SettlementStrategy
const
postData
=
{...
tempData
,
id
:
id
||
0
}
console
.
log
(
postData
)
setSubmitLoading
(
true
);
setUnsaved
(
false
);
serviceActions
(
postData
).
then
((
data
)
=>
{
setSubmitLoading
(
false
);
if
(
data
.
code
===
1000
)
{
history
.
push
(
'/
memberCenter/balance/settleRules/memberSettleList
'
)
history
.
push
(
'/
ruleSettingManager/platformSettlementStrategy
'
)
}
})
...
...
@@ -175,6 +182,16 @@ const MemberSettleAdd: React.FC = () => {
memberRowCtl
.
setSelectedRowKeys
(
res
.
map
((
item
)
=>
item
.
memberId
))
}
// 从PAAS平台--规则配置--平台规则配置取已勾选的结算方式决定是否显示结算方式
const
fetchBalancedMethods
=
async
()
=>
{
const
{
data
}
=
await
PublicApi
.
getManageRuleConfigurationList
({
platformType
:
'5'
});
const
length
=
data
.
length
return
{
days
:
length
>
0
&&
data
[
0
].
check
,
month
:
length
>
1
&&
data
[
1
].
check
};
}
// 从PAAS平台--规则配置--平台规则配置取已勾选的结算方式决定是否显示结算方式
useEffect
(()
=>
{
fetchBalancedMethods
().
then
(
data
=>
{
...
...
@@ -191,7 +208,7 @@ const MemberSettleAdd: React.FC = () => {
useEffect
(()
=>
{
if
(
id
)
{
async
function
getInfo
()
{
const
res
=
await
getSettleAccountsPlatformConfigGetMember
SettlementStrategyDetail
({
id
})
const
res
=
await
PublicApi
.
getSettleAccountsPlatformConfigGetPlatform
SettlementStrategyDetail
({
id
})
if
(
res
.
code
===
1000
)
{
setInitialValue
({
name
:
res
.
data
.
name
,
...
...
@@ -200,8 +217,10 @@ const MemberSettleAdd: React.FC = () => {
settlementWay
:
{
active
:
res
.
data
.
settlementWay
,
otherValues
:
[
res
.
data
.
settlementDays
,
res
.
data
.
settlementDate
],
}
},
})
formActions
.
setFieldValue
(
'Tabs.memberTab.layout.isDefault'
,
res
.
data
.
isDefault
)
formActions
.
setFieldValue
(
'Tabs.memberTab.someLists'
,
res
.
data
.
memberList
);
// 必须设置key
memberRowCtl
.
setSelectRow
(
res
.
data
.
memberList
);
...
...
@@ -236,9 +255,10 @@ const MemberSettleAdd: React.FC = () => {
onSubmit=
{
values
=>
handleSubmit
(
values
)
}
schema=
{
addSchema
}
effects=
{
()
=>
{
// 获取单据类型
useAsyncSelect
(
"settlementOrderType"
,
fetchOptions
(
PublicApi
.
getSettleAccountsCommonGet
StrategySettlementOrderType
)
fetchOptions
(
PublicApi
.
getSettleAccountsCommonGet
PlatformStrategySettlementOrderType
)
)
}
}
/>
...
...
@@ -254,6 +274,7 @@ const MemberSettleAdd: React.FC = () => {
tableProps=
{
{
rowKey
:
'memberId'
,
}
}
width=
{
1000
}
formilyProps=
{
{
ctx
:
{
...
...
@@ -267,11 +288,7 @@ const MemberSettleAdd: React.FC = () => {
'name'
,
FORM_FILTER_PATH
,
)
// useAsyncSelect(
// 'roleId',
// fetchMemberSearchFilter,
// ['roleName', 'roleId']
// )
fetchMemberSearchFilter
()
}
}
}
...
...
src/pages/ruleSettingManage/platformSettlementStrategy/info/schema.tsx
View file @
b875a9d0
...
...
@@ -61,14 +61,14 @@ export const addSchema: ISchema = {
}
}
},
//
settlementOrderType: {
//
type: 'string',
//
enum: [],
//
title: '结算单据',
//
'x-rules': [
//
{required: true, message: '请填写策略名称'},
//
]
//
}
settlementOrderType
:
{
type
:
'string'
,
enum
:
[],
title
:
'结算单据'
,
'x-rules'
:
[
{
required
:
true
,
message
:
'请填写策略名称'
},
]
}
},
}
}
...
...
@@ -89,11 +89,11 @@ export const addSchema: ISchema = {
labelAlign
:
'left'
},
properties
:
{
is
AllMember
:
{
is
Default
:
{
type
:
'radio'
,
enum
:
[
{
label
:
'所有会员(默认)'
,
value
:
1
},
{
label
:
'指定会员'
,
value
:
2
},
{
label
:
'指定会员'
,
value
:
0
},
],
default
:
1
,
title
:
'适用会员'
,
...
...
@@ -101,7 +101,7 @@ export const addSchema: ISchema = {
{
type
:
'value:visible'
,
target
:
'*(someLists)'
,
condition
:
'{{$value ===
2
}}'
condition
:
'{{$value ===
0
}}'
}
]
}
...
...
@@ -158,10 +158,28 @@ export const memberSchema: ISchema = {
enum
:
[],
"x-component-props"
:
{
placeholder
:
'选择会员角色'
,
style
:
{
width
:
'200px'
}
style
:
{
width
:
'200px'
},
allowClear
:
true
,
}
},
memberTypeId
:
{
type
:
'string'
,
enum
:
[],
"x-component-props"
:
{
placeholder
:
'选择会员角色'
,
style
:
{
width
:
'200px'
},
allowClear
:
true
,
}
},
level
:
{
type
:
'string'
,
enum
:
[],
"x-component-props"
:
{
placeholder
:
'选择会员角色'
,
style
:
{
width
:
'200px'
},
allowClear
:
true
,
}
},
submit
:
{
"x-component"
:
'Submit'
,
"x-mega-props"
:
{
...
...
src/pages/ruleSettingManage/platformSettlementStrategy/list/index.tsx
View file @
b875a9d0
...
...
@@ -25,12 +25,12 @@ const MemberSettle: React.FC<{}> = () => {
console
.
log
(
params
);
const
{
current
,
pageSize
,
name
}
=
params
const
postData
=
{
current
,
pageSize
,
name
:
name
||
''
}
const
{
data
}
=
await
PublicApi
.
getSettleAccountsPlatformConfigPage
Member
SettlementStrategy
(
postData
);
const
{
data
}
=
await
PublicApi
.
getSettleAccountsPlatformConfigPage
Platform
SettlementStrategy
(
postData
);
return
data
;
};
const
handleModify
=
async
(
record
)
=>
{
const
{
code
}
=
await
PublicApi
.
postSettleAccountsPlatformConfigSet
Member
SettlementStrategyStatus
({
id
:
record
.
id
,
status
:
record
.
status
?
0
:
1
})
const
{
code
}
=
await
PublicApi
.
postSettleAccountsPlatformConfigSet
Platform
SettlementStrategyStatus
({
id
:
record
.
id
,
status
:
record
.
status
?
0
:
1
})
if
(
code
==
1000
)
{
formActions
.
submit
();
}
...
...
@@ -45,7 +45,7 @@ const MemberSettle: React.FC<{}> = () => {
return
(
<
div
>
<
EyePreview
url=
{
`/
memberCenter/balance/settleRules/memberSettleList
/detail?id=${record.id}&preview=1`
}
url=
{
`/
ruleSettingManager/platformSettlementStrategy
/detail?id=${record.id}&preview=1`
}
>
{
text
}
</
EyePreview
>
...
...
@@ -53,8 +53,8 @@ const MemberSettle: React.FC<{}> = () => {
)
}
},
{
title
:
'结算方式'
,
dataIndex
:
'settlement
OrderType
Name'
},
{
title
:
'结算单据'
,
dataIndex
:
'settlement
Way
Name'
},
{
title
:
'结算方式'
,
dataIndex
:
'settlement
Way
Name'
},
{
title
:
'结算单据'
,
dataIndex
:
'settlement
OrderType
Name'
},
{
title
:
'状态'
,
dataIndex
:
'status'
,
...
...
@@ -71,7 +71,7 @@ const MemberSettle: React.FC<{}> = () => {
]
const
goToCreate
=
()
=>
{
history
.
push
(
'/
memberCenter/balance/settleRules/memberSettleList
/add'
);
history
.
push
(
'/
ruleSettingManager/platformSettlementStrategy
/add'
);
}
return
(
<
Card
>
...
...
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