import request from '@/utils/request'

export default {
  //列表
  Search: function(operator) {
    return request({
      url: '/supplier/list',
      method: 'POST',
      data: operator
    })
  },

  //新增
  channelAdd: function(data){
    return request({
      url: '/supplier/add',
      method: 'post',
      data: data
    })
  },
  //编辑
  channelEdit: function(data){
    return request({
      url: '/supplier/update',
      method: 'post',
      data: data
    })
  },
  //删除
  supplierDelete: function(id){
    return request({
      // url: '/supplier/bankcard/' + supplierDelete + "/" + id,
      url: '/bankcard/delete/' + id,
      method: 'delete',
      // data:data
    })
  },
  //删除
  onsupplierDelete: function(supplierId){
    return request({
      // url: '/supplier/bankcard/' + supplierDelete + "/" + id,
      url: '/supplier/delete/' + supplierId,
      method: 'delete',
      // data:data
    })
  },
  //是否有效
  supplierValid(data){
    return request({
      url:"/supplier/setIsValid",
      method:"put",
      data: data
    })
  },

  // <!-- -->
  //编辑
  channelDelete: function(data){
    return request({
      url: '/supplier/delete',
      method: 'put',
      data: data
    })
  },


   //<!--通道 --->

  // 通道列表
  channel(operator){
    return request({
        url:"/channel/list",
        method:"POST",
        data:operator
    })
  },
  
  // 通道添加
  axiosAdd(operator){
    return request({
        url:"/channel/add",
        method:"POST",
        data:operator
    })
  },

  //通道编辑
  update(data){
    return request({
      url:"/channel/update",
      method:"put",
      data:data
    })
  },


  //通道删除
  channelDelete(ChannelId){
    return request({
      url:"/channel/delete/" + ChannelId ,
      method:"delete",
  })
  },

  //通道关联供应商
  supplierInfo(){
    return request({
      url:"/channel/supplierInfo",
      method:"get"
    })
  },

  //添加通道产品
  productAdd(operator){
    return request({
      url:"/channel/product/list/" + operator,
      method:"post"
    })
  },
  //添加通道产品
  productDelete(channelProductId){
    return request({
      url:"/channelProduct/delete/" + channelProductId,
      method:"delete"
    })
  },

}