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

fix:

parent 9fd9e0c4
...@@ -153,14 +153,12 @@ const PropertyValue: React.FC<{}> = () => { ...@@ -153,14 +153,12 @@ const PropertyValue: React.FC<{}> = () => {
const confirm = (record: any) => { const confirm = (record: any) => {
PublicApi.postProductCustomerUpdateCustomerAttributeValueStatus({id: record.id, isEnable: !record.isEnable}).then(res=>{ PublicApi.postProductCustomerUpdateCustomerAttributeValueStatus({id: record.id, isEnable: !record.isEnable}).then(res=>{
//@ts-ignore
ref.current.reload() ref.current.reload()
}) })
} }
const clickDelete = (record: any) => { const clickDelete = (record: any) => {
PublicApi.postProductCustomerDeleteCustomerAttributeValue({ id: record.id }).then(res=>{ PublicApi.postProductCustomerDeleteCustomerAttributeValue({ id: record.id }).then(res=>{
//@ts-ignore
ref.current.reload() ref.current.reload()
}) })
} }
......
...@@ -60,8 +60,8 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -60,8 +60,8 @@ const AddProducts: React.FC<{}> = (props) => {
}, []) }, [])
const onSave = () => { const onSave = () => {
console.log('点击保存') // console.log('点击保存')
console.log(formRefs, 'formrefs') // console.log(formRefs, 'formrefs')
if(formRefs.length > 0){ if(formRefs.length > 0){
try{ try{
let data = formRefs.map(async __ => { let data = formRefs.map(async __ => {
...@@ -69,10 +69,10 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -69,10 +69,10 @@ const AddProducts: React.FC<{}> = (props) => {
await __.current.validateFields() await __.current.validateFields()
) )
}) })
console.log(data,'data') // console.log(data,'data')
Promise.all(data).then((values) => { Promise.all(data).then((values) => {
// 提交的数据进行处理 // 提交的数据进行处理
console.log(values, productSelectAttribute, productAttributeAndImageParams, '所有数据') // console.log(values, productSelectAttribute, productAttributeAndImageParams, '所有数据')
productSelectAttribute.length>0 && productSelectAttribute.map(_itme => { productSelectAttribute.length>0 && productSelectAttribute.map(_itme => {
delete _itme.attributeName delete _itme.attributeName
delete _itme.isPrice delete _itme.isPrice
...@@ -112,7 +112,9 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -112,7 +112,9 @@ const AddProducts: React.FC<{}> = (props) => {
_params.logistics.weight = Number(_params.logistics.weight) _params.logistics.weight = Number(_params.logistics.weight)
// 处理地址 // 处理地址
let _commodityAreaList:any = [] let _commodityAreaList:any = []
// console.log(_params, '_params')
_params.commodityAreaList.length > 0 && _params.commodityAreaList.map(_itme => { _params.commodityAreaList.length > 0 && _params.commodityAreaList.map(_itme => {
if(_itme){
let _temp: any = {} let _temp: any = {}
let pobj = areaOption.filter(_=>_.code===_itme[0])[0] let pobj = areaOption.filter(_=>_.code===_itme[0])[0]
let cobj = pobj.areaResponses.filter(__=>__.code===_itme[1])[0] let cobj = pobj.areaResponses.filter(__=>__.code===_itme[1])[0]
...@@ -121,7 +123,8 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -121,7 +123,8 @@ const AddProducts: React.FC<{}> = (props) => {
_temp.cityCode = cobj.code, _temp.cityCode = cobj.code,
_temp.cityName = cobj.name, _temp.cityName = cobj.name,
_commodityAreaList.push(_temp) _commodityAreaList.push(_temp)
console.log(_itme, _temp, '地址的每一项') // console.log(_itme, _temp, '地址的每一项')
}
}) })
_params.commodityAreaList = _commodityAreaList _params.commodityAreaList = _commodityAreaList
const { id } = history.location.query const { id } = history.location.query
......
...@@ -59,6 +59,7 @@ const Products: React.FC<{}> = () => { ...@@ -59,6 +59,7 @@ const Products: React.FC<{}> = () => {
const [shopsOption, setShopsOption] = useState<GetProductCommodityGetShopResponse>([]) const [shopsOption, setShopsOption] = useState<GetProductCommodityGetShopResponse>([])
const [checkedValues, setCheckedValues] = useState<any>([]) const [checkedValues, setCheckedValues] = useState<any>([])
const [currentOptionId, setCurrentOptionId] = useState() const [currentOptionId, setCurrentOptionId] = useState()
const [isDisabledOKbtn, setIsDisabledOKbtn] = useState<boolean>(false)
let [isHighSearch, setIsHighSearch] = useState(false) let [isHighSearch, setIsHighSearch] = useState(false)
const [filterParams, setFilterParams] = useState<paramItem>({ const [filterParams, setFilterParams] = useState<paramItem>({
...@@ -414,7 +415,7 @@ const Products: React.FC<{}> = () => { ...@@ -414,7 +415,7 @@ const Products: React.FC<{}> = () => {
setCheckedValues(values) setCheckedValues(values)
} }
const clickUp = (param: any, id: any) => { // 0 下架 1上架 const clickUp = (param: any, id: any) => { // param: 0 下架 1上架
setCurrentOptionId(id) setCurrentOptionId(id)
PublicApi.getProductCommodityGetShop({id: id}).then(res => { PublicApi.getProductCommodityGetShop({id: id}).then(res => {
setShopsOption(res.data) setShopsOption(res.data)
...@@ -425,6 +426,7 @@ const Products: React.FC<{}> = () => { ...@@ -425,6 +426,7 @@ const Products: React.FC<{}> = () => {
} }
const handleUp = () => { const handleUp = () => {
setIsDisabledOKbtn(true)
let params = { let params = {
id: currentOptionId, id: currentOptionId,
shopList: checkedValues shopList: checkedValues
...@@ -433,11 +435,13 @@ const Products: React.FC<{}> = () => { ...@@ -433,11 +435,13 @@ const Products: React.FC<{}> = () => {
PublicApi.postProductCommodityPublishCommodity(params).then(res => { PublicApi.postProductCommodityPublishCommodity(params).then(res => {
setUpDownModal(false) setUpDownModal(false)
ref.current.reload() ref.current.reload()
setIsDisabledOKbtn(false)
}) })
else else
PublicApi.postProductCommodityOffPublishCommodity(params).then(res => { PublicApi.postProductCommodityOffPublishCommodity(params).then(res => {
setUpDownModal(false) setUpDownModal(false)
ref.current.reload() ref.current.reload()
setIsDisabledOKbtn(false)
}) })
} }
...@@ -475,7 +479,7 @@ const Products: React.FC<{}> = () => { ...@@ -475,7 +479,7 @@ const Products: React.FC<{}> = () => {
const handleBatchDelete = (ids: string[]) => { const handleBatchDelete = (ids: string[]) => {
console.log('删除', ids) console.log('删除', ids)
//@ts-ignore // @ts-ignore
PublicApi.postProductCommodityDeleteBatchCommodity({idList: ids}).then(res => { PublicApi.postProductCommodityDeleteBatchCommodity({idList: ids}).then(res => {
if(res.code === 1000) if(res.code === 1000)
ref.current.reload() ref.current.reload()
...@@ -487,7 +491,6 @@ const Products: React.FC<{}> = () => { ...@@ -487,7 +491,6 @@ const Products: React.FC<{}> = () => {
setFilterParams(restObj) setFilterParams(restObj)
setBrandValue(undefined) setBrandValue(undefined)
setClassValue(undefined) setClassValue(undefined)
//@ts-ignore
ref.current.reload(restObj) ref.current.reload(restObj)
} }
...@@ -533,7 +536,6 @@ const Products: React.FC<{}> = () => { ...@@ -533,7 +536,6 @@ const Products: React.FC<{}> = () => {
console.log(val) console.log(val)
let obj = val ? {...filterParams, name: val} : { ...filterParams } let obj = val ? {...filterParams, name: val} : { ...filterParams }
setFilterParams(obj) setFilterParams(obj)
//@ts-ignore
ref.current.reload(obj) ref.current.reload(obj)
} }
...@@ -774,6 +776,7 @@ const Products: React.FC<{}> = () => { ...@@ -774,6 +776,7 @@ const Products: React.FC<{}> = () => {
onOk={handleUp} onOk={handleUp}
onCancel={handleCancelUp} onCancel={handleCancelUp}
forceRender={true} forceRender={true}
okButtonProps={{ disabled: isDisabledOKbtn }}
> >
<Form <Form
layout="vertical" layout="vertical"
......
...@@ -142,8 +142,6 @@ const viewProducts: React.FC<{}> = () => { ...@@ -142,8 +142,6 @@ const viewProducts: React.FC<{}> = () => {
}, },
]; ];
/* 商品属性显示 */ /* 商品属性显示 */
//以属性组和属性名称归档的数据 //以属性组和属性名称归档的数据
const renderDataByTab = (data: GetProductCommodityGetCommodityResponse) => { const renderDataByTab = (data: GetProductCommodityGetCommodityResponse) => {
...@@ -582,7 +580,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -582,7 +580,7 @@ const viewProducts: React.FC<{}> = () => {
{/* 视频区块 */} {/* 视频区块 */}
<div className={styles.descriptionBox}> <div className={styles.descriptionBox}>
{ {
productDetail?.commodityRemark?.video.length>0 ? productDetail?.commodityRemark?.video.map((_item, _index)=> <div key={_index} className={styles.videoItem}> productDetail?.commodityRemark?.video?.length>0 ? productDetail?.commodityRemark?.video.map((_item, _index)=> <div key={_index} className={styles.videoItem}>
<video src={_item} controls={true}> <video src={_item} controls={true}>
您的浏览器不支持视频标签,请及时升级。 您的浏览器不支持视频标签,请及时升级。
</video> </video>
......
...@@ -121,18 +121,19 @@ const AddBrand: React.FC<{}> = () => { ...@@ -121,18 +121,19 @@ const AddBrand: React.FC<{}> = () => {
const handleSave = () => { const handleSave = () => {
form.validateFields().then((values:any) => { form.validateFields().then((values:any) => {
if(values?.proveUrl?.fileList&&fileList.length){ console.log(values,'vvv')
delete values.proveUrl.fileList
delete values.proveUrl.file
}
if(history.location.query.id){ if(history.location.query.id){
values.id = Number(history.location.query.id) values.id = Number(history.location.query.id)
let obj = {}; let obj = {};
fileList.forEach((item, index)=>{ fileList.forEach((item, index)=>{
obj[index] = item?.url obj[index] = item?.url || item?.response?.data
}) })
values.proveUrl = obj values.proveUrl = obj
} }
if(values?.proveUrl?.fileList&&fileList.length){
delete values.proveUrl.fileList
delete values.proveUrl.file
}
PublicApi.postProductBrandSaveOrUpdateBrand(values).then(res => { PublicApi.postProductBrandSaveOrUpdateBrand(values).then(res => {
setIsEnableCheck(false) setIsEnableCheck(false)
//@ts-ignore //@ts-ignore
......
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