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

fix: 渠道商品上架添加店铺id字段

parent 12ee430b
......@@ -279,12 +279,13 @@ const Goods: React.FC<{}> = () => {
)
const handleMenuClick = (e: any) => {
// console.log('menu', e, selectedRowKeys); // 1 批量删除;2 删除导入批次
// 1 批量删除;2 删除导入批次
if (e.key === '1') {
confirm({
title: '确定要执行批量删除操作?',
icon: <ExclamationCircleOutlined />,
onOk() {
if(!goodsRowCtl.selectedRowKeys.length) { return message.error('请先选择货品') }
PublicApi.postProductGoodsDeleteBatchGoods({ idList: goodsRowCtl.selectedRowKeys }).then(res => {
ref.current.reload()
})
......
......@@ -53,6 +53,7 @@ const DirectChannel: React.FC<{}> = () => {
const [shopsOption, setShopsOption] = useState<GetProductChannelCommodityGetShopResponse>([])
const [shopsBatchOption, setShopsBatchOption] = useState<GetProductChannelCommodityGetShopResponse>([])
const [checkedValues, setCheckedValues] = useState<any>([])
const [shopId, setShopId] = useState<any>()
const [currentOptionId, setCurrentOptionId] = useState<number>()
const [isDisabledOKbtn, setIsDisabledOKbtn] = useState<boolean>(false)
const [isBatchOption, setIsBatchOption] = useState<boolean>(false) // 是否是批量上下架操作
......@@ -302,6 +303,7 @@ const DirectChannel: React.FC<{}> = () => {
PublicApi.getTemplateWebMemberChannelWebFindCurrMemberChannel().then(res => {
if(res.data.id){
setCheckedValues(values)
setShopId(res.data.shopId)
}else{
message.error('您还没有开通店铺,无法上下架商品!')
}
......@@ -326,7 +328,7 @@ const DirectChannel: React.FC<{}> = () => {
if(isBatchOption){ // 批量操作区分上下架
if(isUp){
if(checkedValues.length > 0){
PublicApi.postProductChannelCommodityBatchPublishCommodity(params).then(res => {
PublicApi.postProductChannelCommodityBatchPublishCommodity({...params, storeId: shopId}).then(res => {
setUpDownModal(false)
ref.current.reload()
setIsDisabledOKbtn(false)
......@@ -345,7 +347,7 @@ const DirectChannel: React.FC<{}> = () => {
}else{
if(isUp){
if(checkedValues.length > 0){
PublicApi.postProductChannelCommodityPublishCommodity({...params, isPublish: isUp}).then(res => {
PublicApi.postProductChannelCommodityPublishCommodity({...params, isPublish: isUp, storeId: shopId}).then(res => {
setUpDownModal(false)
ref.current.reload()
setIsDisabledOKbtn(false)
......@@ -355,7 +357,7 @@ const DirectChannel: React.FC<{}> = () => {
message.error('请选择需要上架的渠道商城')
}
}else{
PublicApi.postProductChannelCommodityPublishCommodity({...params, isPublish: isUp}).then(res => {
PublicApi.postProductChannelCommodityPublishCommodity({...params, isPublish: isUp, storeId: shopId}).then(res => {
setUpDownModal(false)
ref.current.reload()
setIsDisabledOKbtn(false)
......
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