Commit 00f24691 authored by LeeJiancong's avatar LeeJiancong

'修改支付策略配置参数输入'

parent 4626349e
export interface MemberType {
id: number;
typeName: string;
}
export interface BusinessType {
id: number;
typeName: string;
}
export interface UseType {
memberType: MemberType[];
businessType: BusinessType[];
}
export interface UserRegister {
useType: UseType;
}
export interface RuleConfiguration {
value: number;
label: string;
platformType: number;
}
export interface PayWayResponse {
payType: number;
value: number;
label: string;
}
export interface PayInitializeConfig {
payType: number;
ruleConfigurations: RuleConfiguration[];
payWayResponses: PayWayResponse[];
}
export interface PayPlatformPayConfig {
id: number;
payType: number;
way: string;
isPitchOn: number;
}
export interface PayConfig {
payInitializeConfig: PayInitializeConfig[];
payPlatformPayConfig: PayPlatformPayConfig[];
}
export interface CountryList {
name: string;
key: string;
icon: string;
}
export interface Children {
code: string;
}
export interface MenuList {
code: string;
children: Children[];
}
export interface Global {
logo: string;
countryList: CountryList[];
menuList: MenuList[];
}
export interface RootObject {
userRegister: UserRegister;
payConfig: PayConfig;
global: Global;
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @Date: 2020-08-06 19:07:53
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-30 11:49:39
* @LastEditTime: 2020-09-30 16:30:06
*/
import React, { useEffect , useState,useRef } from 'react'
import {Card,Button,Modal} from 'antd'
......@@ -154,10 +154,13 @@ const PaySetting: React.FC<{}> = () => {
let {data} = res
console.log('结果',res.data)
payActions.setFieldValue('paymentPolicyName',data.paymentPolicyName)
data.paymentPolicyPayWayRequests.forEach((item,index) => {
data.paymentPolicyPayWayRequests.forEach((item:any,index) => {
payActions.setFieldValue(`id-${index}`,item.id)
payActions.setFieldValue(`ruleConfigurationId-${index}`,item.ruleConfigurationId)
payActions.setFieldValue(`payWayIds-${index}`,item.payWayIds)
// payActions.setFieldValue(`payWayIds-${index}`,item.payWayIds)
item.payWays.forEach((v) => {
payActions.setFieldValue(`payWayIds-${index}`,v.id)
})
})
payActions.setFieldValue('isSelected',data.isSelected )
}
......@@ -195,10 +198,33 @@ const PaySetting: React.FC<{}> = () => {
let list:any = []
baseList.forEach((item:any,index:number) => {
let payWayIds = `payWayIds-${index}`, ruleConfigurationId = `ruleConfigurationId-${index}`,_id = `id-${index}`
let v = [values[payWayIds],item.payWayResponses.filter((v=> v.value == values[payWayIds])).map(v => v.label)]
let _payWays:any[] = []
if(v.length === 2){
let obj:any = {}
// if(v[0] &&v[0].length > 0){
v[0].forEach(item => {
obj.id = item
});
// }
// if(v[1] &&v[1].length > 0 ){
v[1].forEach(item => {
obj.way = item
});
// }
_payWays.push(obj)
}
list.push({
id: values[_id],
payType: item.payType,
['payWayIds']: values[payWayIds],
['payWays']: [..._payWays],
// ['payWayIds']: values[payWayIds],
// ['payWays']:{
// id: values[payWayIds],
// way: item.payWayResponses.filter((v=> v.value == values[payWayIds])).map(v => v.label)
// },
['ruleConfigurationId']:values[ruleConfigurationId]
})
......@@ -218,7 +244,6 @@ const PaySetting: React.FC<{}> = () => {
}))
params.memberIdRoleIds = memberIdRoleIds
}
console.log(params)
//新增
if(!usePageStatus().id){
console.log('params',params)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment