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

fix: 处理渠道商编辑修改阶梯价格无效和新增编辑商品副单价显示null的问题‘

parent 58ce212d
......@@ -220,7 +220,7 @@ const SetPrice: React.FC<IProps> = (props) => {
setSelectedSpecRowKeys([])
}
const clickSetPrice = (record: any) => {
const clickSetPrice = (record) => {
setIsBatchSetting(false) // 点击行操作批量置为false
setCurrentSetPriceRow(record)
setModifyModal(true)
......
......@@ -271,8 +271,12 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
key: intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.planPrice' }),
render: (text, record) => {
const assistPrice = _tableDataSource[record[intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.index' })]][intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.planPrice' })]
console.log(assistPrice, 'assistPrice')
if (assistPrice && Array.isArray(assistPrice)) {
return assistPrice.map((p, i) => <p key={i}>{planPrice === 3 ? p : `${intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.currency' })}${p}`}</p>)
return assistPrice.map((p, i) => {
const _p = p ? p : '0.00'
return <p key={i}>{planPrice === 3 ? _p : `${intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.currency' })}${_p}`}</p>
})
} else if (assistPrice) {
return planPrice === 3 ? assistPrice : (isNaN(assistPrice) ? `¥${0.00}` : `${intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.currency' })}${assistPrice}`)
}
......@@ -630,11 +634,11 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}
const onChangeTax = (e) => {
setIsTax(e.target.checked)
setIsTax(e.target.value)
}
const onChangeFreeTax = (e) => {
setIsFreeTax(e.target.checked)
setIsFreeTax(e.target.value)
}
const formValueChange = (changeValue, values) => {
......@@ -651,7 +655,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
} else {
setAssistantUniquePrice((Number(values['uniquePrice'] || 0) * Number(values['assistantUniquePriceRate'] || 0) / 100).toFixed(2))
}
setAssistantUniquePriceRate(values['assistantUniquePriceRate'])
setAssistantUniquePriceRate(values['assistantUniquePriceRate'] || 0)
}
return (<>
......@@ -824,7 +828,11 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
valuePropName="checked"
initialValue={true}
>
<Checkbox onChange={onChangeTax}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.isTax.check' })}</Checkbox>
{/* <Checkbox onChange={onChangeTax}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.isTax.check' })}</Checkbox> */}
<Radio.Group onChange={onChangeTax} value={isTax}>
<Radio value={true}></Radio>
<Radio value={false}></Radio>
</Radio.Group>
</Form.Item>
{
isTax ?
......@@ -847,13 +855,17 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
:
null
}
{/* <Form.Item
<Form.Item
name="isFreeTax"
label={intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.isTax' })}
valuePropName="checked"
initialValue={true}
>
<Checkbox onChange={onChangeFreeTax}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.isTax.check' })}</Checkbox>
{/* <Checkbox onChange={onChangeFreeTax}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.isTax.check' })}</Checkbox> */}
<Radio.Group onChange={onChangeFreeTax} value={isFreeTax}>
<Radio value={true}></Radio>
<Radio value={false}></Radio>
</Radio.Group>
</Form.Item>
{
isFreeTax ?
......@@ -875,7 +887,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
</Form.Item>
:
null
} */}
}
</Form>
{/* 批量设置按钮 */}
{
......
......@@ -307,7 +307,7 @@ const ModifyDirectChannel: React.FC<{}> = () => {
})
}
setPriceTableData(_newTabeData)
constructedPrarams()
// constructedPrarams()
})
}
......
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