Commit 34637341 authored by Bill's avatar Bill

修改新增仓位

parent 1a3a0dea
......@@ -52,8 +52,8 @@ const transferLabelToValue = (list: any[], label: string, value: string) => {
})
}
const BUSINESS_INTEGRATE = [1, 2];
const CANAL = [3, 4, 5]
const BUSINESS_INTEGRATE = [1, 2]; // 企业商城, 积分商城
const CANAL = [3, 4, 5]; // 渠道商城
const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const { addSchemaAction, schema, formSubmit, onFieldChange = () => {} } = props
......@@ -72,7 +72,8 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const [productState, setProductState] = useState<any>({})
const [membersFilterState, setMemberFilter] = useState({level: [], role: [], type: []});
const [initValue, setInitialValue] = useState({});
const [membersLength, setMembersLength] = useState(0)
const [membersLength, setMembersLength] = useState(0);
// const [channelMemberState, setChannelMemberState] = useState({channelMemberRoleId: '', channelMemberIdList: []})
// useUnitPreview(initValue, addSchemaAction)
......@@ -83,14 +84,14 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const { levels = [], memberTypes = [], roles = [] } = response.data;
const allLevels = all.concat(transferLabelToValue(levels, "levelTag", "level"));
const allMemberTypes = all.concat(transferLabelToValue(memberTypes, "memberTypeName", "memberTypeId"))
const allRoles = all.concat(transferLabelToValue(roles, "roleName", "roleId"))
// const allRoles = all.concat(transferLabelToValue(roles, "roleName", "roleId"))
setMemberFilter((state) => {
return {
...state,
level: allLevels,
role: allMemberTypes,
type: allRoles
// role: allRoles,
type: allMemberTypes
}
})
}
......@@ -235,24 +236,14 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const fetchMemberList = async (params) => {
const shopType = addSchemaAction.getFieldValue('shopType');
// 当商城类型为 渠道商城、渠道自由商城和渠道积分商城时,需要带上memberResponseList
const { memberResponseList } = productState;
if(CANAL.includes(shopType) && memberResponseList == null) {
// 如果为空的话那我就不调用了
return {
code: 200,
message: '',
data: {
data: [],
totalCount: []
}
}
}
// 当商城类型为 渠道商城、渠道自由商城和渠道积分商城时,需要带上下面两个参数
const { channelMemberIdList, channelMemberRoleId } = productState;
const data = {
...params,
shopType: shopType,
members: memberResponseList,
memberIds: channelMemberIdList,
roleId: channelMemberRoleId
}
const res = await PublicApi.postMemberManageAllPageByshoptype(data, {ctlType: 'none'});
return res.data
......@@ -374,15 +365,15 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
}
},
roleId: {
type: 'string',
"x-component": 'Select',
"x-component-props": {
options: membersFilterState.role,
style: {width: '180px'},
placeholder: '请选择会员角色'
}
},
// roleId: {
// type: 'string',
// "x-component": 'Select',
// "x-component-props": {
// options: membersFilterState.role,
// style: {width: '180px'},
// placeholder: '请选择会员角色'
// }
// },
submit: {
"x-component": 'Submit',
"x-mega-props": {
......@@ -501,9 +492,11 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
state.value = []
})
}
return parentState.value
});
// 商城类型修改的时候,就清空商品
addSchemaAction.setFieldValue('productId', "");
addSchemaAction.setFieldValue('productName', "");
}
})
// FormEffectHooks.
......
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