import { axios } from '@/utils/request'

//  优惠活动 规则 列表  无分页
export const promoRuleQueryList = (params) => {
  return axios({
    url: '/promoRule/queryList',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('列表查询')
    }
  })
}
//  优惠活动 保存
export const promoRuleSave = (params) => {
  return axios({
    url: '/promoRule/save',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('新增/编辑')
    }
  })
}
//  优惠活动 删除
export const promoRuleDel = (params) => {
  const url = `/promoRule/delete/${params.sn}`
  return axios({
    url: url,
    method: 'get',
    headers:{
        'module': encodeURIComponent('删除')
    }
  })
}
//  优惠活动 详情
export const promoRuleDetail = (params) => {
  const url = `/promoRule/findBySn/${params.sn}`
  return axios({
    url: url,
    method: 'get',
    headers:{
        'module': encodeURIComponent('详情')
    }
  })
}
//  优惠活动 详情  包含规则
export const promoRuleDetailD = (params) => {
  const url = `/promoRule/findDetailBySn/${params.sn}`
  return axios({
    url: url,
    method: 'get',
    headers:{
        'module': encodeURIComponent('详情')
    }
  })
}
//  促销规则  获取可导入和不可导入列表数据
export const promoRuleGoods = (params) => {
  return axios({
    url: '/promoRule/parseGoods',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('选择产品')
    }
  })
}
