Commit 49848366 authored by Bill's avatar Bill

fix: 修改结算试用会员

parent 39548e5b
......@@ -49,7 +49,7 @@ const common_columns: any = [
]
const MemberSettleAdd: React.FC = () => {
const [visible, setVisible] = useState(false)
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'id' });
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'uniqueId' });
const [initialValue, setInitialValue] = useState({});
const { id, preview } = usePageStatus();
const [submitLoading, setSubmitLoading ] = useState(false);
......@@ -77,7 +77,7 @@ const MemberSettleAdd: React.FC = () => {
title: '操作',
render: (text, record) => {
return (
<div onClick={() => handleRemove(record.memberId)}>删除</div>
<div onClick={() => handleRemove(record.uniqueId)}>删除</div>
)
}
}
......@@ -102,7 +102,11 @@ const MemberSettleAdd: React.FC = () => {
const fetchMemberData = async (params: any) => {
//member/manage/lower/page/bynamerole
const { data } = await PublicApi.getMemberManageLowerPageBynamerole(params);
return data
return {
...data,
data: data.data.map((v) => ({...v, uniqueId: v.memberId + "_" + v.roleId})),
totalCount: data.totalCount
}
}
// 获取适用会员下拉搜索框
......@@ -155,11 +159,11 @@ const MemberSettleAdd: React.FC = () => {
const handleRemove = (id: number) => {
const string = 'Tabs.memberTab.someLists';
const chooseList = formActions.getFieldValue(string);
const res = chooseList.filter((item) => item.memberId !== id);
const res = chooseList.filter((item) => item.uniqueId !== id);
formActions.setFieldValue(string, res);
// 必须设置key
memberRowCtl.setSelectRow(res);
memberRowCtl.setSelectedRowKeys(res.map((item) => item.memberId))
memberRowCtl.setSelectedRowKeys(res.map((item) => item.uniqueId))
}
// 从PAAS平台--规则配置--平台规则配置取已勾选的结算方式决定是否显示结算方式
......@@ -188,10 +192,11 @@ const MemberSettleAdd: React.FC = () => {
otherValues: [res.data.settlementDays, res.data.settlementDate],
}
})
formActions.setFieldValue('Tabs.memberTab.someLists', res.data.memberList);
const list = res.data.memberList.map((item) => ({...item, uniqueId: item.memberId + "_" + item.roleId}))
formActions.setFieldValue('Tabs.memberTab.someLists', list);
// 必须设置key
memberRowCtl.setSelectRow(res.data.memberList);
memberRowCtl.setSelectedRowKeys(res.data.memberList.map((item) => item.memberId))
memberRowCtl.setSelectRow(list);
memberRowCtl.setSelectedRowKeys(res.data.memberList.map((item) => item.memberId + "_" + item.roleId))
} else {
message.error({content: res.message})
}
......@@ -238,7 +243,7 @@ const MemberSettleAdd: React.FC = () => {
rowSelection={memberRowSelection}
fetchTableData={params => fetchMemberData(params)}
tableProps={{
rowKey: 'id',
rowKey: 'uniqueId',
}}
formilyProps={
{
......
......@@ -27,13 +27,13 @@ export const indexSchema = {
},
},
name: {
type: 'string',
'x-component': 'Search',
type: 'string',
'x-component': 'Search',
"x-mega-props": {
"span": 2
},
'x-component-props': {
placeholder: '搜索',
placeholder: '搜索',
advanced: false,
},
},
......@@ -44,7 +44,7 @@ export const indexSchema = {
/**
* 新增会员结算策略schema
*
*
*/
export const addSchema = {
......@@ -129,7 +129,7 @@ export const addSchema = {
},
'x-component': 'MultTable',
'x-component-props': {
rowKey: 'memberId',
rowKey: 'uniqueId',
prefix: "{{tableAddButton}}",
columns: "{{tableColumns}}"
// columns: "{{tableColumns}}",
......@@ -176,7 +176,7 @@ export const memberSchema = {
style: {width: '200px'}
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
......@@ -189,4 +189,4 @@ export const memberSchema = {
}
}
}
}
\ No newline at end of file
}
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