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

fix:

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