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

fix:

parent f5cf7d1a
......@@ -34,6 +34,9 @@ const AddProducts: React.FC<{}> = (props) => {
const [isDisableSaveBtn, setIsDisableSaveBtn] = useState<boolean>(false)
const [currentTemplateName, setCurrentTemplateName] = useState<string>()
let [formRefs, setFormRefs] = useState([]) //子form的ref数组
const [forceRenderRef, setForceRenderRef] = useState<boolean>(false) // 编辑情况下 是否强制渲染后面的 tabpane
const isFirstRender = useRef<boolean>(true) // 编辑情况下 是否是初始切换品类
const { ProductStore } = store
const {
productSelectAttribute,
......@@ -61,8 +64,17 @@ const AddProducts: React.FC<{}> = (props) => {
setProductName(data?.name)
const attributeRes = await PublicApi.getProductCustomerGetCustomerCategoryById({ id: data?.customerCategory?.id + '' })
setAttributeLists(attributeRes.data?.customerAttributeList)
// return productRes.code
}
makeRequest()
// .then(v => {
// if(v === 1000){
// if(!isFirstRender)
// setForceRenderRef(true)
// else
// isFirstRender.current = false
// }
// })
}
return () => {
......
......@@ -90,8 +90,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
let arr = [...res.data] //裁去最后一级别
for (let index in arr) {
for (let _index in arr[index].areaResponses) {
let o = arr[index].areaResponses
//@ts-ignore
let o: any = arr[index].areaResponses
o[_index].areaResponses = null
}
}
......@@ -114,11 +113,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
}
}, [productInfoByEdit, getBasicFormParamsByEdit])
const onFinish = (values: any) => {
console.log(values,'原values')
}
const handleBrandSearch = (value?: any) => { // end value
const handleBrandSearch = (value?: any) => {
PublicApi.getProductSelectGetSelectBrand({ name: value||'' }).then(res => {
if (res.code === 1000)
setBrandData(res.data)
......
......@@ -90,7 +90,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
if(history.location.query?.id && !flagRef.current) {
flagRef.current = true
} else {
setProductSelectAttribute([])
// setProductSelectAttribute([])
priceForm.resetFields()
priceForm.setFieldsValue({isMemberPrice: false, priceType: planPrice})
}
......
......@@ -34,7 +34,7 @@ const ProductImageForm: React.FC<{}> = (props) => {
// 品类 变动清空数据
// 编辑下 flag为false 不清空;编辑下 flag为true 新建清空
if(history.location.query?.id && !flagRef.current) {
flagRef.current = true
flagRef.current = true
} else {
onChangeSetImageType({target: { value: true }})
}
......
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