Commit d16fb273 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 新增价格策略移除会员必选

parent 8600a63d
...@@ -95,12 +95,13 @@ export const transformParamsForApi = (data: any, ctx: ISchemaFormActions | ISche ...@@ -95,12 +95,13 @@ export const transformParamsForApi = (data: any, ctx: ISchemaFormActions | ISche
let _params: any = {} let _params: any = {}
_params["name"] = data.name _params["name"] = data.name
_params["priceType"] = data.priceType _params["priceType"] = data.priceType
let shopInfo = ctx.getFieldState("shopId").dataSource[0] let shopInfo = ctx.getFieldState("shopId")['values'][1]
_params["shopId"] = shopInfo["id"] _params["shopId"] = shopInfo["id"]
_params["type"] = shopInfo["type"] _params["type"] = shopInfo["type"]
_params["environment"] = shopInfo["environment"] _params["environment"] = shopInfo["environment"]
_params["commodity"] = { id: data.productId } _params["commodity"] = { id: data.productId }
if(data?.commodityMemberList) {
_params["commodityMemberList"] = data.commodityMemberList.map(item => ({ _params["commodityMemberList"] = data.commodityMemberList.map(item => ({
memberId: item.memberId, memberId: item.memberId,
memberName: item.name, memberName: item.name,
...@@ -108,6 +109,7 @@ export const transformParamsForApi = (data: any, ctx: ISchemaFormActions | ISche ...@@ -108,6 +109,7 @@ export const transformParamsForApi = (data: any, ctx: ISchemaFormActions | ISche
memberRoleId: item.roleId, memberRoleId: item.roleId,
memberRoleName: item.roleName, memberRoleName: item.roleName,
})) }))
}
_params["memberUnitPriceList"] = data.memberUnitPriceList.map(item => ({ _params["memberUnitPriceList"] = data.memberUnitPriceList.map(item => ({
commodityUnitPrice: { id: item.id }, commodityUnitPrice: { id: item.id },
unitPrice: item["单价"] unitPrice: item["单价"]
......
...@@ -27,10 +27,10 @@ const SetStrategy: React.FC<{}> = () => { ...@@ -27,10 +27,10 @@ const SetStrategy: React.FC<{}> = () => {
const formSubmit = useCallback(async (values) => { const formSubmit = useCallback(async (values) => {
setBtnLoading(true) setBtnLoading(true)
if(!values['commodityMemberList'] && !values['commodityMemberList']?.length) { // if(!values['commodityMemberList'] && !values['commodityMemberList']?.length) {
message.error('请选择指定适用会员') // message.error('请选择指定适用会员')
setBtnLoading(false) // setBtnLoading(false)
} else { // } else {
const { params } = transformParamsForApi(values, addSchemaAction) const { params } = transformParamsForApi(values, addSchemaAction)
let _params = {} let _params = {}
...@@ -44,7 +44,7 @@ const SetStrategy: React.FC<{}> = () => { ...@@ -44,7 +44,7 @@ const SetStrategy: React.FC<{}> = () => {
}, 1000) }, 1000)
} }
setBtnLoading(false) setBtnLoading(false)
} // }
}, []) }, [])
return ( return (
......
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