Commit 207f313e authored by Bill's avatar Bill

平台结算策略修改

parent 69ea0998
......@@ -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
}
]
}
......
......@@ -70,6 +70,8 @@ export function render(oldRender:Function) {
}
console.log('render')
oldRender()
}).catch(() => {
oldRender()
})
} else {
oldRender()
......
......@@ -109,6 +109,7 @@ export default {
'menu.ruleSettingManager.memberAuthManageDetail': '会员角色权限设置',
'menu.ruleSettingManager.platformSettlementStrategy': '平台结算策略配置',
'menu.ruleSettingManager.addplatformSettlementStrategy': '新增平台结算策略',
'menu.ruleSettingManager.platformSettlementStrategyDetail': '平台结算策略详情',
// 品类和属性
'menu.classAndProperty': '平台品类及属性',
......
......@@ -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);
}
......
......@@ -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$ } = 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' },
......@@ -97,33 +98,34 @@ 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,9 +134,13 @@ 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,
......@@ -144,17 +150,17 @@ const MemberSettleAdd: React.FC = () => {
settlementDate: value.settlementWay.otherValues[1],
}
const serviceActions = isAdd
? PublicApi.postSettleAccountsPlatformConfigAddMemberSettlementStrategy
: PublicApi.postSettleAccountsPlatformConfigUpdateMemberSettlementStrategy
? PublicApi.postSettleAccountsPlatformConfigAddPlatformSettlementStrategy
: PublicApi.postSettleAccountsPlatformConfigUpdatePlatformSettlementStrategy
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 +181,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,11 +207,11 @@ const MemberSettleAdd: React.FC = () => {
useEffect(() => {
if(id) {
async function getInfo() {
const res = await getSettleAccountsPlatformConfigGetMemberSettlementStrategyDetail({id})
const res = await PublicApi.getSettleAccountsPlatformConfigGetPlatformSettlementStrategyDetail({id})
if(res.code === 1000) {
setInitialValue({
name: res.data.name,
settlementOrderType: res.data.settlementOrderType,
// settlementOrderType: res.data.settlementOrderType,
memberList: res.data.memberList,
settlementWay: {
active: res.data.settlementWay,
......@@ -236,10 +252,11 @@ const MemberSettleAdd: React.FC = () => {
onSubmit={values => handleSubmit(values)}
schema={addSchema}
effects={() => {
useAsyncSelect(
"settlementOrderType",
fetchOptions(PublicApi.getSettleAccountsCommonGetStrategySettlementOrderType)
)
// 获取单据类型
// useAsyncSelect(
// "settlementOrderType",
// fetchOptions(PublicApi.getSettleAccountsCommonGetStrategySettlementOrderType)
// )
}}
/>
......@@ -254,6 +271,7 @@ const MemberSettleAdd: React.FC = () => {
tableProps={{
rowKey: 'memberId',
}}
width={1000}
formilyProps={
{
ctx: {
......@@ -267,11 +285,7 @@ const MemberSettleAdd: React.FC = () => {
'name',
FORM_FILTER_PATH,
)
// useAsyncSelect(
// 'roleId',
// fetchMemberSearchFilter,
// ['roleName', 'roleId']
// )
fetchMemberSearchFilter()
}
}
}
......
......@@ -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": {
......
......@@ -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.getSettleAccountsPlatformConfigPageMemberSettlementStrategy(postData);
const { data } = await PublicApi.getSettleAccountsPlatformConfigPagePlatformSettlementStrategy(postData);
return data;
};
const handleModify = async (record) => {
const { code } = await PublicApi.postSettleAccountsPlatformConfigSetMemberSettlementStrategyStatus({id: record.id, status: record.status ? 0 : 1})
const { code } = await PublicApi.postSettleAccountsPlatformConfigSetPlatformSettlementStrategyStatus({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>
......@@ -71,7 +71,7 @@ const MemberSettle: React.FC<{}> = () => {
]
const goToCreate = () => {
history.push('/memberCenter/balance/settleRules/memberSettleList/add');
history.push('/ruleSettingManager/platformSettlementStrategy/add');
}
return (
<Card>
......
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