import request from '@/utils/request'

//直供商品列表
export function getDirectList(params) {
  return request({
    url: '/sale/manage/t-wares/list/' + params.source,
    method: 'get',
    params
  })
}

//三方供应链平台
export function getJxhhSource(params) {
  return request({
    url: '/system/pub/enums/jxhh-source',
    method: 'get',
    params
  })
}

//是否枚举
export function getDealerYesNo() {
  return request({
    url: '/system/pub/enums/dealer-yes-no',
    method: 'get',
  })
}

//商品分类下拉选
export function getOptionList(params) {
  return request({
    url: '/sale/manage/t-wares-category/option-list',
    method: 'get',
    params
  })
}

//直供商品-商品定价
export function fixPrice(data) {
  return request({
    url: '/sale/manage/t-wares/fix-price/' + data.source,
    method: 'post',
    data
  })
}

//商品列表
export function getWaresList(params) {
  return request({
    url: '/sale/manage/sa-t-wares/list/' + params.source,
    method: 'get',
    params
  })
}

//商品列表-修改上下架
export function updatePuton(data) {
  return request({
    url: '/sale/manage/sa-t-wares/put-on/' + data.source,
    method: 'PUT',
    data
  })
}

//商品列表-修改推荐状态
export function updateRecommend(data) {
  return request({
    url: '/sale/manage/sa-t-wares/recommend/' + data.source,
    method: 'PUT',
    data
  })
}

//商品列表-获取商品详情
export function getWaresDetailList(params) {
  return request({
    url: '/sale/manage/sa-t-wares/' + params.source + '/' + params.pkId,
    method: 'get',
    params
  })
}

//商品列表-修改
export function updateWaresList(data) {
  return request({
    url: '/sale/manage/sa-t-wares/update/' + data.source,
    method: 'PUT',
    data
  })
}

//商品订单列表
export function getOrderGoodsList(params) {
  return request({
    url: '/sale/manage/sa-t-order/list',
    method: 'get',
    params
  })
}


//三方分类列表
export function getCategoryList(params) {
  return request({
    url: '/sale/manage/t-wares-category/list/0' ,
    method: 'get',
    params
  })
}

//新增三方分类
export function saveWaresCategory(data) {
  return request({
    url: '/sale/manage/t-wares-category/save',
    method: 'post',
    data
  })
}

//修改三方分类
export function updateWaresCategory(data) {
  return request({
    url: '/sale/manage/t-wares-category/update',
    method: 'post',
    data
  })
}

//删除三方分类
export function deleteWaresCategory(params) {
  return request({
    url: '/sale/manage/t-wares-category/delete',
    method: 'get',
    params
  })
}



//三方分类单条详情
export function getCategoryDetailList(params) {
  return request({
    url: '/sale/manage/t-wares-category/detail',
    method: 'get',
    params
  })
}



//商品隐藏显示
export function threeGoodsShowHide(data) {
  return request({
    url: '/sale/manage/t-wares/show-hide/' + data.source,
    method: 'post',
    data
  })
}

//商品列表删除
export function deletSatWares(data) {
  return request({
    url: '/sale/manage/sa-t-wares/delete',
    method: 'PUT',
    data
  })
}



//三方分类修改状态
export function categoryUpdateEnable(data) {
  return request({
    url: '/sale/manage/t-wares-category/updateEnable/' + data.pkId + '/' + data.status,
    method: 'post',
    data
  })
}

//渠道维护列表
export function getMangeTsouceList(params) {
  return request({
    url: '/sale/manage/t-source/list/1',
    method: 'get',
    params
  })
}

// 渠道启用/禁用
export function enableTsource(data) {
  return request({
    url: '/sale/manage/t-source/enable/1',
    method: 'PUT',
    data
  })
}

//获取渠道详情
export function getMangeTsouceDetailList(params) {
  return request({
    url: '/sale/manage/t-source/1'+'/'+params.source,
    method: 'get',
    params
  })
}

//保存渠道
export function saveTsource(data) {
  return request({
    url: '/sale/manage/t-source/save/1' ,
    method: 'post',
    data
  })
}

//获取商品统计列表
export function getStatisticsList(params) {
  return request({
    url: '/sale/manage/sa-t-wares/statistics',
    method: 'get',
    params
  })
}

//统计合计
export function getStatisticsTotal(params) {
  return request({
    url: '/sale/manage/sa-t-wares/statistics-total',
    method: 'get',
    params
  })
}


