Commit 013bdcbc authored by LeeJiancong's avatar LeeJiancong

'修改支付策略弹窗接口'

parent f942d16d
......@@ -2,7 +2,7 @@ import React, { ReactText, useRef, useEffect } from 'react'
import {StandardTable} from 'god'
import { IStandardTableProps } from 'god/dist/src/standard-table'
import { Row, Col, Modal } from 'antd'
import { productModalSchema, productModalByMemberSchema, memberModalSchema, inquirySchema, demandSchema,enquirySchema, mergeOrderSchema } from './schema'
import { productModalSchema, productModalByMemberSchema, memberModalSchema, inquirySchema, demandSchema,enquirySchema, mergeOrderSchema, payStrategySchema} from './schema'
import Search from '../NiceForm/components/Search'
import SearchSelect from '../NiceForm/components/SearchSelect'
import Submit from '../NiceForm/components/Submit'
......@@ -17,7 +17,7 @@ export interface ModalTableProps extends IStandardTableProps<any> {
cancel?(),
visible?: boolean,
resetModal?: object,
modalType?: 'productByDefault' | 'productByMember' | 'memberByDefault' | 'inquiryByDefault' | 'demandByDefault' | 'enquiryModel' | 'MergeOrderByDefault' | 'none'
modalType?: 'productByDefault' | 'productByMember' | 'memberByDefault' | 'inquiryByDefault' | 'demandByDefault' | 'enquiryModel' | 'MergeOrderByDefault' |'payStrategyFilter' |'none'
}
const ModalTable:React.FC<ModalTableProps> = (props) => {
......@@ -61,6 +61,10 @@ const ModalTable:React.FC<ModalTableProps> = (props) => {
case 'MergeOrderByDefault': {
return mergeOrderSchema
}
case 'payStrategyFilter':{
return payStrategySchema
}
case 'none': {
return {}
}
......
......@@ -383,4 +383,76 @@ export const mergeOrderSchema: ISchema = {
}
}
}
}
export const payStrategySchema:ISchema = {
type: 'object',
properties: {
name: {
type: 'string',
"x-component": 'Search',
"x-component-props": {
placeholder: '请输入会员名称'
}
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
memberTypeId: {
type: 'string',
"x-component": 'Input',
enum: [],
"x-component-props": {
placeholder: '会员类型',
style: {
width: 160
}
}
},
roleId: {
type: 'string',
"x-component": 'Input',
enum: [],
"x-component-props": {
placeholder: '会员角色',
style: {
width: 160
}
}
},
level: {
type: 'string',
"x-component": 'Input',
enum: [],
"x-component-props": {
placeholder: '会员等级',
style: {
width: 160
}
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
\ 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 16:30:06
* @LastEditTime: 2020-10-15 17:09:26
*/
import React, { useEffect , useState,useRef } from 'react'
import {Card,Button,Modal} from 'antd'
......@@ -15,15 +15,28 @@ import EyePreview from '@/components/EyePreview'
import {createFormActions,ISchema} from '@formily/antd'
import PayForm from '../components/PayForm'
import ModalTable from '@/components/ModalTable'
import Search from '@/components/NiceForm/components/Search'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import {useInitValue} from '@/formSchema/effects/useInitValue'
import {strategyDetailTab} from '../schema'
import {usePageStatus, PageStatus} from '@/hooks/usePageStatus'
import { useRowSelectionTable} from '@/hooks/useRowSelectionTable'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import {history} from 'umi'
import {findItemAndDelete} from '@/utils'
import { GlobalConfig } from '@/global/config'
import { PublicApi } from '@/services/api'
import style from './index.less'
import {Submit} from '@formily/antd'
import {
Input,
NumberPicker,
FormTab,
FormMegaLayout,
Select,
ArrayTable
} from '@formily/antd-components'
const payActions = createFormActions()
/**
* @description: 会员弹窗列表
......@@ -31,7 +44,7 @@ const payActions = createFormActions()
* @return {type}
*/
const fetchMemberList = async (params) => {
const res = await PublicApi.getPayApplyMemberList(params)
const res = await PublicApi.getMemberManageAllProviderPage(params)
return res.data
}
......@@ -42,6 +55,11 @@ const PaySetting: React.FC<{}> = () => {
const [searchParams, setsearchParams] = useState({
memberName: ''
})
const [filterParams,setfilterParams] = useState<any>({
memberTypeList: [],
levelList: [],
roleList: []
})
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({customKey:'memberId'})
const [optionType, setoptionType] = useState(0)
const {preview,pageStatus} = usePageStatus()
......@@ -174,7 +192,28 @@ const PaySetting: React.FC<{}> = () => {
}
})
}
PublicApi.getMemberManagePageitems().then(res => {
if(res.code === 1000){
let {data} = res
let a = [{value:'',label:'请选择'}]
let roleList = data.roles.map(v => ({
value: v.roleId,
label: v.roleName
}))
let memberTypeList = data.memberTypes.map(v => ({
value: v.memberTypeId,
label: v.memberTypeName
}))
let leverList = data.levels.map(v => ({
value: v.level,
label: v.levelTag
}))
setfilterParams({...filterParams,roleList:[...a,...roleList],levelList:[...a,...leverList],memberTypeList: [...a,...memberTypeList] })
}
})
return () => {
}
......@@ -182,12 +221,71 @@ const PaySetting: React.FC<{}> = () => {
const formSearch: ISchema = {
type: 'object',
properties: {
memberName: {
name: {
type: 'string',
"x-component": 'Search',
"x-component-props": {
placeholder: '请输入会员名称'
}
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
memberTypeId: {
type: 'string',
"x-component": 'Input',
enum: filterParams.memberTypeList,
"x-component-props": {
placeholder: '会员类型',
style: {
width: 160
}
}
},
roleId: {
type: 'string',
"x-component": 'Input',
enum: filterParams.roleList,
"x-component-props": {
placeholder: '会员角色',
style: {
width: 160
}
}
},
level: {
type: 'string',
"x-component": 'Input',
enum: filterParams.levelList,
"x-component-props": {
placeholder: '会员等级',
style: {
width: 160
}
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
......@@ -287,6 +385,7 @@ const PaySetting: React.FC<{}> = () => {
/>
</Card>
<ModalTable
width={800}
modalTitle='选择适用会员'
confirm={handleOkAddMember}
cancel={handleCancelAddMember}
......@@ -294,10 +393,21 @@ const PaySetting: React.FC<{}> = () => {
columns={columnsSetMember}
rowSelection={memberRowSelection}
fetchTableData={params => fetchMemberList(params)}
modalType='payStrategyFilter'
formilyProps={
{
ctx: { schema: formSearch }
ctx: {
schema: formSearch,
components: { ModalSearch: Search, SearchSelect, Submit, Input },
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name1',
FORM_FILTER_PATH,
);
}
}
}
}
tableProps={{
......
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