Commit cc8c9c88 authored by Bill's avatar Bill

Merge branch 'fix418' into 'v2-220418'

处理编辑商品草稿中部分属性禁用的问题 See merge request linkseeks-design/pro-platform!390
parents d492f803 b5349dca
......@@ -361,14 +361,14 @@ const AddProducts: React.FC<{}> = (props) => {
if (res.code === 1000) {
setIsEnableCheck(false)
setReponseId(res.data)
// 存在草稿即删除草稿
if(draftId) {
postProductCommodityDeleteCommodityDraftBatch({idList: [draftId]}, {ctlType: "none"})
}
} else {
setIsDisableSaveBtn(false)
}
})
// 存在草稿即删除草稿
if(draftId) {
postProductCommodityDeleteCommodityDraftBatch({idList: [draftId]}, {ctlType: "none"})
}
}).then(e => {
if (e) {
setIsDisableSaveBtn(false)
......
......@@ -121,7 +121,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
}
basicForm.setFieldsValue(getBasicFormParamsByEdit)
setSelectBrandId(getBasicFormParamsByEdit.brandId)
setIsUpdateAttribute(productInfoByEdit?.isUpdateAttribute)
setIsUpdateAttribute(draftId ? true : productInfoByEdit?.isUpdateAttribute)
} else {
basicForm.setFieldsValue({'commodityAreaList': [[]]})
}
......
......@@ -897,7 +897,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
// initialValue={planPrice}
>
{
(history.location.query?.id || history.location.query?.draftId) ? <Radio.Group onChange={handlePlanPriceChange} disabled={!productInfoByEdit.isUpdateAttribute}>
(history.location.query?.id || history.location.query?.draftId) ? <Radio.Group onChange={handlePlanPriceChange} disabled={history.location.query?.draftId ? false : !productInfoByEdit.isUpdateAttribute}>
<Radio value={1}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.1' })}</Radio>
<Radio value={2} disabled={isCrossBorder}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.2' })}</Radio>
<Radio value={3} disabled={isCrossBorder}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.form.priceType.option.3' })}</Radio>
......
......@@ -234,9 +234,10 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
let _isPrice = null
let _isUpdateAttribute = null
let _isDisabled = false
if (history.location.query?.id || history.location.query?.draftId) {
const { id, draftId } = history.location.query
if (id || draftId) {
_isPrice = attrItem.isPrice
_isUpdateAttribute = productInfoByEdit.isUpdateAttribute
_isUpdateAttribute = draftId ? true : productInfoByEdit.isUpdateAttribute
_isDisabled = _isPrice && !_isUpdateAttribute
// 编辑中 过滤后续添加的属性
if (!_isUpdateAttribute && (attrItem.createTime > productInfoByEdit.createTime)) {
......
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