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

fix: 处理商品草稿不填名称编辑回显数据异常问题

parent a0e29074
......@@ -110,16 +110,17 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
useEffect(() => {
const { id, draftId } = history.location.query
if ((id || draftId) && getBasicFormParamsByEdit?.name) {
// if ((id || draftId) && getBasicFormParamsByEdit?.name) {
if (id || draftId) {
handleBrandSearch(getBasicFormParamsByEdit.brandName)
onCustomerCategoryChange(getBasicFormParamsByEdit.customerCategoryId)
// 赋[]初值 显示一行区域选择
if(!getBasicFormParamsByEdit.commodityAreaList.length) {
getBasicFormParamsByEdit.commodityAreaList[0] = []
if(!getBasicFormParamsByEdit?.commodityAreaList?.length) {
getBasicFormParamsByEdit.commodityAreaList = [[]]
}
basicForm.setFieldsValue(getBasicFormParamsByEdit)
setSelectBrandId(getBasicFormParamsByEdit.brandId)
setIsUpdateAttribute(productInfoByEdit.isUpdateAttribute)
setIsUpdateAttribute(productInfoByEdit?.isUpdateAttribute)
} else {
basicForm.setFieldsValue({'commodityAreaList': [[]]})
}
......@@ -149,8 +150,9 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
}
const onCustomerCategoryChange = (value) => {
let seletCategoryId = value[value.length - 1]
if (seletCategoryId) {
// let seletCategoryId = value[value.length - 1]
if (value) {
let seletCategoryId = value[value.length - 1]
getProductCustomerGetCustomerCategoryById({ id: seletCategoryId }).then(res => {
const { data } = res
onChangeAttributeList(data?.customerAttributeList)
......
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