Commit 34637341 authored by Bill's avatar Bill

修改新增仓位

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