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

fix: 处理品类发货周期字段精度超出的问题,商品编辑兼容商品草稿数据中品牌的回显

parent 15d0e50e
......@@ -105,7 +105,7 @@ export const classSchema: ISchema = {
},
'x-rules': [
{
pattern: /^([1-9]\d*|[0]{1,1})$/,
pattern: /^([1-9]\d{0,8}|[0]{1,1})$/,
message: getIntl().formatMessage({ id: 'classAndProperty.class.classSchema.deadline.placeholder1' }),
}
]
......
......@@ -48,6 +48,7 @@ const AddProducts: React.FC<{}> = (props) => {
productAttributeAndImageParams,
areaOption,
productDescription,
brandName,
setProductName,
setAttributeLists,
clearData,
......@@ -354,6 +355,7 @@ const AddProducts: React.FC<{}> = (props) => {
numberKeys.map(item => delete _params[item])
}
console.log(_params, 'params')
_params.sendCycle = _params.logistics.sendCycle
postProductCommoditySaveOrUpdateCommodity(_params).then(res => {
if (res.code === 1000) {
setIsEnableCheck(false)
......@@ -427,6 +429,7 @@ const AddProducts: React.FC<{}> = (props) => {
let _params = {
..._bacsicForm,
brandName,
commodityAttributeList: productSelectAttribute,
commodityRemark: _productDescription,
isAllAttributePic: isAllAttributePic,
......
......@@ -64,6 +64,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
getBasicFormParamsByEdit,
setAttributeLists,
setProductName,
setBrandName,
setSelectCategoryId,
setSelectBrandId,
setSendCycle,
......@@ -131,9 +132,10 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
})
}
const handleBrandChange = (value) => {
const handleBrandChange = (value, options) => {
setBrandValue(value)
setSelectBrandId(value)
setBrandName(options['children'])
}
const tagRender = (props) => {
......
......@@ -359,7 +359,8 @@ export const filterUsefulDraftData = (data) => {
console.log(data, 'data')
return {
name: data.name,
brandId: data.brandId,
// brandId: data.brandId,
brand: { id: data.brandId, name: data.brandName },
customerCategoryId: data.customerCategoryId,
slogan: data.slogan,
sellingPoint: data.sellingPoint || [],
......
......@@ -16,6 +16,7 @@ export interface IDecsParams {
class ProductStore implements IProductModule {
@observable public attributeLists: any[] = [];
@observable public productName: string = "";
@observable public brandName: string = "";
@observable public selectCategoryId: any = null;
@observable public selectBrandId: any = null;
@observable public productSelectAttribute: IProductSelectAttribute[] = [];
......@@ -39,7 +40,7 @@ class ProductStore implements IProductModule {
@computed
public get getBasicFormParamsByEdit(): IBasicFormParam {
return {
brandId: this.productInfoByEdit?.brandId,
brandId: this.productInfoByEdit?.brand?.id,
brandName: this.productInfoByEdit?.brand?.name,
name: this.productInfoByEdit?.name,
slogan: this.productInfoByEdit?.slogan,
......@@ -122,6 +123,11 @@ class ProductStore implements IProductModule {
}
@action.bound
public setBrandName(name: string) {
this.brandName = name;
}
@action.bound
public setSelectCategoryId(data: any) {
this.selectCategoryId = data
}
......
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