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

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

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