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

fix:添加商品价格需要询问类型价格校验问题,商品列表显示异常

parent 0ca7ff75
......@@ -214,8 +214,8 @@ const AddProducts: React.FC<{}> = (props) => {
try{
let hasPriceArray = _params.unitPriceAndPicList.map(item => item.unitPrice)
hasPriceArray.map(item => {
if(JSON.stringify(item) === '{}')
throw new Error('商品价格为必填项!')
if(JSON.stringify(item) === '{}' && _params.priceType !== 2) // 除价格需要询问类型 其他都需要校验价格或积分
throw new Error(_params.priceType === 1 ? '商品价格为必填项!' : '商品积分为必填项!')
})
}catch(e){
return e
......@@ -229,7 +229,7 @@ const AddProducts: React.FC<{}> = (props) => {
PublicApi.postProductCommoditySaveOrUpdateCommodity(_params).then(res => {
if(res.code === 1000){
setIsEnableCheck(false)
setIsDisableSaveBtn(false)
// setIsDisableSaveBtn(false)
setReponseId(res.data)
history.goBack()
}
......
......@@ -79,7 +79,6 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
if(!item.children.length)
delete item.children
})
console.log(data)
setCustomerCategoryTree(data)
}
})
......
......@@ -140,7 +140,14 @@ const Products: React.FC<{}> = () => {
title: '价格',
dataIndex: 'min',
key: 'min',
render: (text:any, reocrd:any)=>(<>{reocrd.min} ~ ¥{reocrd.max}</>)
render: (text:any, reocrd:any) => {
if(reocrd.priceType === 1)
return <>{reocrd.min} ~ ¥{reocrd.max}</>
if(reocrd.priceType === 3)
return <>{reocrd.min} ~ {reocrd.max}</>
if(reocrd.priceType === 2)
return null
}
},
{
title: '审核时间',
......
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