import request from '@/utils/request'

// 未合单列表
export function getDeliveryUnhandledList(params) {
  return request({
    url: '/sale/manage/deliver-unhandled/list',
    method: 'get',
    params
  })
}

//已合单列表
export function getDeliveryHandledList(params) {
  return request({
    url: '/sale/manage/deliver-handled/list',
    method: 'get',
    params
  })
}

//立即发货列表
export function getDeliverList(params) {
  return request({
    url: '/sale/manage/deliver/list',
    method: 'get',
    params
  })
}

// 立即发货修改单号数据
export function getUpdateCodeList(params) {
  return request({
    url: '/sale/manage/deliver/change-code-data/' + params.deliverId,
    method: 'get',

  })
}

//修改单号
export function changeDeliverCode(data) {
  return request({
    url: '/sale/manage/deliver/change-code',
    method: 'post',
    data
  })
}



//预售状态
export function getPresaleStatus() {
  return request({
    url: '/system/pub/enums/presale-status',
    method: 'get',
  })
}

//订单状态
export function getOrderStatus() {
  return request({
    url: '/system/pub/enums/order-status',
    method: 'get',
  })
}

//发货方式
export function getDeliveryWayList() {
  return request({
    url: '/system/pub/enums/delivery-list',
    method: 'get',
  })
}

//运输方式
export function getTransportType() {
  return request({
    url: '/system/pub/enums/transport-type',
    method: 'get',
  })
}

//支付方式
export function getOrderPayType() {
  return request({
    url: '/system/pub/enums/order-pay-type',
    method: 'get',
  })
}

//发货状态
export function getDeliveryStatus() {
  return request({
    url: '/system/pub/enums/delivery-status',
    method: 'get',
  })
}


//供应方式
export function getSupplyWay() {
  return request({
    url: '/system/pub/enums/supply-way',
    method: 'get',
  })
}

//产品分类
export function getClassifyAll() {
  return request({
    url: '/sale/manage/classify/find-all',
    method: 'get',
  })
}

//销售类型
export function getSaleTypeList() {
  return request({
    url: '/system/pub/enums/sale-type',
    method: 'get',
  })
}

//发货类型
export function getShippingChannelList() {
  return request({
    url: '/system/pub/enums/get-shipping-channel',
    method: 'get',
  })
}

//打印状态
export function getPrintStatus() {
  return request({
    url: '/system/pub/enums/print-status',
    method: 'get',
  })
}

//产品名称
export function getProductAll() {
  return request({
    url: '/sale/manage/product/all',
    method: 'get',
  })
}


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

//排除产品列表
export function getExcludeProduct(data) {
  return request({
    url: '/sale/manage/deliver-unhandled/exclude-product-new',
    method: 'post',
    data
  })
}

//生成发货单
export function deliverUnhandeldMerge(data) {
  return request({
    url: '/sale/manage/deliver-unhandled/merge',
    method: 'post',
    data
  })
}

//立即发货获取数据
export function getImmediateData(params) {
  return request({
    url: '/sale/manage/deliver/immediate-data',
    method: 'get',
    params
  })
}

//确认发货
export function deliverConfirm(data) {
  return request({
    url: '/sale/manage/deliver/confirm',
    method: 'PUT',
    data
  })
}

//生成打印
export function deliverHandledPrint(params) {
  return request({
    url: '/sale/manage/deliver-handled/print',
    method: 'get',
    params
  })
}

//获取绑定条码数据
export function getCodeBindData(params) {
  return request({
    url: '/sale/manage/deliver-handled/code-bind-data',
    method: 'get',
    params
  })
}

//获取解绑条码数据
export function getCodeUnbindData(params) {
  return request({
    url: '/sale/manage/deliver-handled/code-unbind-data',
    method: 'get',
    params
  })
}

//绑定条码
export function savCodeBind(data) {
  return request({
    url: '/sale/manage/deliver-handled/code-bind',
    method: 'post',
    data
  })
}

//绑定：重置-删除条码
export function codeReset(data) {
  return request({
    url: '/sale/manage/deliver-handled/code-reset',
    method: 'PUT',
    data
  })
}

//解绑：删除条码
export function codeUnbind(data) {
  return request({
    url: '/sale/manage/deliver-handled/code-unbind',
    method: 'PUT',
    data
  })
}

//已合单列表删除
export function deleteDeliver(params) {
  return request({
    url: '/sale/manage/deliver-handled/delete-deliver',
    method: 'delete',
    params
  })
}

//删除已合单订单状态行
export function deleteDeliverItems(params) {
  return request({
    url: '/sale/manage/deliver-handled/delete-deliver-items',
    method: 'delete',
    params
  })
}

//提货列表
export function getUnhandeldSelfData(params) {
  return request({
    url: '/sale/manage/deliver-unhandled/self-data',
    method: 'get',
    params
  })
}
//二次发货列表
export function deliverSecond(params) {
  return request({
    url: '/sale/manage/deliver-second/list',
    method: 'get',
    params
  })
}
//二次发货弹框数据
export function deliverPopData(params) {
  return request({
    url: '/sale/manage/deliver-second/data',
    method: 'get',
    params
  })
}

//国家奖金
export function bonusCountry(params) {
  return request({
    url: '/system/pub/enums/bonus-country',
    method: 'get',
    params
  })
}

//二次发货明细
export function deliverSecondDetails(params) {
  return request({
    url: '/sale/manage/deliver-second/detail',
    method: 'get',
    params
  })
}


//发货仓库下拉选
export function getStorehouseList(params) {
  return request({
    url: '/system/manage/storehouse/list-nopag',
    method: 'get',
    params
  })
}

// 未合单-订单抵扣-新订单抵扣数据查询
export function getNewDeductionData(params) {
  return request({
    url: '/sale/manage/deliver-unhandled/deduction-new-data/' + params.pkOrder,
    method: 'get',

  })
}

// 未合单-订单抵扣-旧订单抵扣数据查询
export function getOldDeductionData(params) {
  return request({
    url: '/sale/manage/deliver-unhandled/deduction-old-data/' + params.orderCode,
    method: 'get',

  })
}



