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

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

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