import request from '@/utils/request'

// 销售政策
export function getList(params) {
  return request({
    url: '/policy/list',
    method: 'get',
    params
  })
}
// 新增政策
export function addPoliy(params) {
  return request({
    url: '/policy/add',
    method: 'post',
    data: params
  })
}
// 新增政策条件

export function addPoliyCondition(params) {
  return request({
    url: '/policy/condition/add',
    method: 'post',
    data: params
  })
}
// 政策条件列表
export function getConditionList(params) {
  return request({
    url: '/policy/condition/list',
    method: 'get',
    params
  })
}

// 克隆
export function cloneList(params) {
  return request({
    url: '/policy/material/clone',
    method: 'post',
    params
  })
}

// 弃审
export function setAbandon(params) {
  return request({
    url: '/policy/abandon',
    method: 'post',
    params
  })
}

// 物料列表
export function getK3List(params) {
  return request({
    url: '/k3/material/list',
    method: 'get',
    params
  })
}

// 现金钱包（非返利钱包）
export function getNoRebateWalletList(params) {
  return request({
    url: '/wallet/list',
    method: 'get',
    params
  })
}

// 政策货品-保存(不传id新增，传id修改)
export function savePolicy(params) {
  return request({
    url: '/policy/material/save',
    method: 'post',
    data: params
  })
}

export function updatePolicy(params) {
  return request({
    url: '/policy/update',
    method: 'post',
    data: params
  })
}

export function deletePolicy(params) {
  return request({
    url: '/policy/delete',
    method: 'post',
    params
  })
}

// 修改条件
export function updateCondition(params) {
  return request({
    url: '/policy/condition/update',
    method: 'post',
    params
  })
}

export function getConditionMaterialDetail(params) {
  return request({
    url: '/policy/condition/detail',
    method: 'get',
    params
  })
}
// 政策条件的机型列表
export function getConditionMaterialList(params) {
  return request({
    url: '/policy/condition/material/list',
    method: 'get',
    params
  })
}
// 经销商api

export function getCrList(params) {
  return request({
    url: '/customer/list',
    method: 'get',
    params
  })
}

// 政策销售商列表
export function getCustomerList(params) {
  return request({
    url: '/policy/customer/list',
    method: 'get',
    params
  })
}
// 获取销售政策编号
export function getId(params) {
  return request({
    url: '/policy/id',
    method: 'get',
    params
  })
}

export function deleteCondition(params) {
  return request({
    url: '/policy/condition/delete',
    method: 'post',
    params
  })
}
export function toExamine(params) {
  return request({
    url: '/policy/examine',
    method: 'post',
    params
  })
}
// 导入政策货品
// /policy/material/import

// 政策货品列表
export function getMaterialList(params) {
  return request({
    url: '/policy/material/list',
    method: 'get',
    params
  })
}
// 提审政策
export function getpolicySubmit(params) {
  return request({
    url: '/policy/policy/submit',
    method: 'post',
    params
  })
}

// 删除政策货品

export function deleteMaterialPolicy(params) {
  return request({
    url: '/policy/material/delete',
    method: 'post',
    params
  })
}

// 获取经销商详情
export function getPolicyDetail(params) {
  return request({
    url: '/policy/detail',
    method: 'get',
    params
  })
}

// 对应经销商

export function getCustomerlist(params) {
  return request({
    url: '/policy/customer_count/list',
    method: 'get',
    params
  })
}

export function eidtBatch(params) {
  return request({
    url: '/policy/customer_count/batch',
    method: 'post',
    params
  })
}

// 销售类型

export function getTypeList(params) {
  return request({
    url: '/sale/type/list',
    method: 'get',
    params
  })
}

export function DeleteData(params) {
  return request({
    url: '/policy/material/delete',
    method: 'psot',
    params
  })
}

export function addData(params) {
  return request({
    url: '/sale/type/add',
    method: 'post',
    data: params
  })
}

export function delTypeData(params) {
  return request({
    url: '/sale/type/delete',
    method: 'post',
    params
  })
}

export function getDetail(params) {
  return request({
    url: '/sale/type/detail',
    method: 'post',
    data: params
  })
}

export function updateType(params) {
  return request({
    url: '/sale/type/update',
    method: 'post',
    data: params
  })
}

// 返利钱包列表

export function getWalletList(params) {
  return request({
    url: '/wallet/rebate/list',
    method: 'get',
    params
  })
}

export function addWallet(params) {
  return request({
    url: '/wallet/add',
    method: 'post',
    data: params
  })
}

export function getWalletDetail(params) {
  return request({
    url: '/wallet/rebate/detail',
    method: 'get',
    params
  })
}

export function updateWallet(params) {
  return request({
    url: '/wallet/update',
    method: 'post',
    data: params
  })
}

// 销售品类
export function getDictList(params) {
  return request({
    url: '/common/dict/list',
    method: 'get',
    params
  })
}

// 产品类别
export function getProductList(params) {
  return request({
    url: '/product-category/list',
    method: 'get',
    params
  })
}

// 政策-作废
export function cancelPolicy(params) {
  return request({
    url: '/policy/cancel',
    method: 'post',
    params
  })
}

// 获取轮播图列表
export function getImgCarouseList(params) {
  return request({
    url: '/record/list',
    method: 'get',
    params
  })
}

// 轮播图显示与隐藏
export function handleImgIsShow(params) {
  return request({
    url: '/record/updateImgStatus',
    method: 'post',
    params
  })
}

// 增加轮播图
export function addImgCarousel(params) {
  return request({
    url: '/record/carousel/add',
    method: 'post',
    data: params
  })
}

// 修改轮播图
export function editImgCarousel(params) {
  return request({
    url: '/record/update',
    method: 'post',
    data: params
  })
}

// 批量删除轮播图
export function delImgData(params) {
  return request({
    url: '/record/delete',
    method: 'post',
    params
  })
}

// 添加公司信息
export function addCompany(params) {
  return request({
    url: '/record/company/add',
    method: 'post',
    data: params
  })
}

// 获取公司数据
export function getCompanyList(params) {
  return request({
    url: '/record/company/list',
    method: 'get',
    params
  })
}
// 返利钱包销售类型-列表
export function getWalletRebateSaletypelist(params) {
  return request({
    url: '/wallet/rebate_saletype/list',
    method: 'get',
    params
  })
}
// 返利钱包销售类型-新增
export function getWalletRebateSaletypeAdd(data) {
  return request({
    url: '/wallet/rebate_saletype/add',
    method: 'POST',
    data
  })
}
// 返利钱包销售类型-详情
export function getWalletRebateSaletypeDetail(params) {
  return request({
    url: '/wallet/rebate_saletype/detail',
    method: 'get',
    params
  })
}

// 返利钱包列表
export function getWalletRebateList(params) {
  return request({
    url: '/wallet/rebate/list',
    method: 'get',
    params
  })
}
// 返利钱包销售类型-删除
export function getWalletRebateSaletypeDelete(params) {
  return request({
    url: '/wallet/rebate_saletype/delete',
    method: 'post',
    params
  })
}
// 返利钱包销售类型-修改
export function getWalletRebateSaletypeUpdate(data) {
  return request({
    url: '/wallet/rebate_saletype/update',
    method: 'post',
    data
  })
}

// 经销商购买上限-列表
export function getPolicyList(params) {
  return request({
    url: '/policy/limit/list',
    method: 'get',
    params
  })
}
// 政策机型-启用/作废
export function setStauts(params) {
  return request({
    url: '/policy/material/status',
    method: 'post',
    params
  })
}
//友链-列表
export function dictAmityPage(data) {
  return request({
    url: `/record/amity/list?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function recordAmityList2(data) {
  return request({
    url: `/record/amity/list2`,
    method: 'post',
    data
  })
}

//友链-添加
export function dictAmityAdd(data) {
  return request({
    url: `/record/amity/add`,
    method: 'post',
    data
  })
}
//友链-删除
export function dictAmityDel(params) {
  return request({
    url: `/record/amity/delete`,
    method: 'post',
    params
  })
}
//友情链接-修改
export function dictAmityUpdate(data) {
  return request({
    url: `/record/amity/update`,
    method: 'post',
    data
  })
}
//友情链接-修改
export function dictAmityStatus(params) {
  return request({
    url: `/record/amity/status`,
    method: 'post',
    params
  })
}
