import request from '@/utils/request'

// 查询订单列表
export function listStoreOrder(data) {
  return request({
    url: '/store/store/storeOrder/list',
    method: 'post',
    data: data
  })
}

// 查询订单明细总数
export function getOrderItemsNum(query) {
  return request({
    url: '/store/store/storeOrder/orderItemsNum',
    method: 'get',
    params: query
  })
}
// 查询尾款订单列表
export function listPayRemainOrder(query) {
  return request({
    url: '/store/store/storeOrder/payRemainList',
    method: 'get',
    params: query
  })
}
// 查询推广订单列表
export function listPromotionOrder(query) {
  return request({
    url: '/store/store/storeOrder/promotionList',
    method: 'get',
    params: query
  })
}
// 查询健康商城订单列表
export function listHealthStoreOrder(data) {
  return request({
    url: '/store/store/storeOrder/healthList',
    method: 'post',
    data: data
  })
}

export function getCustomerOrderList(query) {
  return request({
    url: '/store/store/storeOrder/getCustomerOrderList',
    method: 'get',
    params: query
  })
}





// 查询订单详细
export function getStoreOrder(id) {
  return request({
    url: '/store/store/storeOrder/' + id,
    method: 'get'
  })
}

// 查询订单详细
export function getStoreOrderAddress(id) {
  return request({
    url: '/store/store/storeOrder/queryAddress/' + id,
    method: 'get'
  })
}

// 查询订单详细
export function getStoreOrderPhone(id) {
  return request({
    url: '/store/store/storeOrder/queryPhone/' + id,
    method: 'get'
  })
}


export function getExpress(id) {
  return request({
    url: '/store/store/storeOrder/getExpress/' + id,
    method: 'get'
  })
}

// 新增订单
export function addStoreOrder(data) {
  return request({
    url: '/store/store/storeOrder',
    method: 'post',
    data: data
  })
}

// 修改订单
export function updateStoreOrder(data) {
  return request({
    url: '/store/store/storeOrder',
    method: 'put',
    data: data
  })
}
// 修改订单ItemJson
export function updateStoreOrderItemJson(id,backendEditProductType) {
  return request({
    url: '/store/store/storeOrder/updateStoreOrderItemJson/'+id + "/" + backendEditProductType,
    method: 'get'
  })
}
// 修改物流编号
export function updateDeliveryId(data) {
  return request({
    url: '/store/store/storeOrder/editDeliveryId',
    method: 'put',
    data: data
  })
}

// 删除订单
export function delStoreOrder(id) {
  return request({
    url: '/store/store/storeOrder/' + id,
    method: 'delete'
  })
}

// 导出订单
export function exportStoreOrder(data) {
  return request({
    url: '/store/store/storeOrder/export',
    method: 'post',
    data: data
  })
}

// 导出订单
export function exportStoreOrderDetails(data) {
  return request({
    url: '/store/store/storeOrder/exportDetails',
    method: 'post',
    data: data
  })
}


// 导出订单
export function exportHealthStoreOrder(data) {
  return request({
    url: '/store/store/storeOrder/healthExport',
    method: 'post',
    data: data
  })
}

// 导出订单
export function exportHealthStoreOrderDetails(data) {
  return request({
    url: '/store/store/storeOrder/healthExportDetails',
    method: 'post',
    data: data
  })
}

// 导出订单
export function exportPromotionOrder(query) {
  return request({
    url: '/store/store/storeOrder/promotionExport',
    method: 'get',
    params: query
  })
}

// 导出付尾款订单
export function exportStorePayRemainOrder(query) {
  return request({
    url: '/store/store/storeOrder/payRemainExport',
    method: 'get',
    params: query
  })
}

// 导出订单
export function exportStoreOrderItems(query) {
  return request({
    url: '/store/store/storeOrder/exportItems',
    method: 'get',
    params: query
  })
}

// 导出订单
export function exportStoreOrderItemsDetails(query) {
  return request({
    url: '/store/store/storeOrder/exportItemsDetails',
    method: 'get',
    params: query
  })
}

// 导出订单
export function exportHealthStoreOrderItems(query) {
  return request({
    url: '/store/store/storeOrder/healthExportItems',
    method: 'get',
    params: query
  })
}

// 导出订单
export function exportHealthStoreOrderItemsDetails(query) {
  return request({
    url: '/store/store/storeOrder/healthExportItemsDetails',
    method: 'get',
    params: query
  })
}

export function createUserOrder(data) {
  return request({
    url: '/store/store/storeOrder/createUserOrder',
    method: 'post',
    data: data
  })
}

export function finishOrder(data) {
  return request({
    url: '/store/store/storeOrder/finishOrder',
    method: 'post',
    data: data
  })
}
export function importTemplate() {
  return request({
    url: '/store/store/storeOrder/importTemplate',
    method: 'get'
  })
}

export function editTuiMoney(data) {
  return request({
    url: '/store/store/storeOrder/editTuiMoney',
    method: 'post',
    data: data
  })
}

export function refundOrderMoney(data) {
  return request({
    url: '/store/store/storeOrder/refundOrderMoney',
    method: 'post',
    data: data
  })
}

export function updateExpress(data) {
  return request({
    url: '/store/store/storeOrder/updateExpress',
    method: 'post',
    data: data
  })
}
export function syncExpress(data) {
  return request({
    url: '/store/store/storeOrder/syncExpress',
    method: 'post',
    data: data
  })
}

export function updateErp(data) {
  return request({
    url: '/store/store/storeOrder/updateErpOrder',
    method: 'post',
    data: data
  })
}
export function addTuiMoney(data) {
  return request({
    url: '/store/store/storeOrder/addTuiMoney',
    method: 'post',
    data: data
  })
}

export function getEroOrder(query) {
  return request({
    url: '/store/store/storeOrder/getEroOrder',
    method: 'get',
    params: query
  })
}

export function createErpOrder(query) {
  return request({
    url: '/store/store/storeOrder/createErpOrder',
    method: 'get',
    params: query
  })
}

//审核
export function auditPayRemain(data) {
  return request({
    url: '/store/store/storeOrder/auditPayRemain',
    method: 'post',
    data: data
  })
}

// 订单维度分页查询接口
export function orderDimensionStatisticsList(query) {
  return request({
    url: '/store/store/storeOrder/orderDimensionStatisticsList',
    method: 'get',
    params: query
  })
}

// 导出订单维度统计接口
export function orderDimensionStatisticsExport(query) {
  return request({
    url: '/store/store/storeOrder/orderDimensionStatisticsExport',
    method: 'get',
    params: query
  })
}

export function importDeliveryNoteExpressTemplate() {
  return request({
    url: '/store/store/storeOrder/importDeliveryNoteExpressTemplate',
    method: 'get'
  })
}

export function queryErpPhone(query) {
  return request({
    url: '/store/store/storeOrder/queryErpPhone',
    method: 'get',
    params: query
  })
}

export function saveErpPhone(data) {
  return request({
    url: '/store/store/storeOrder/saveErpPhone',
    method: 'post',
    data: data
  })
}

export function editErpPhone(data) {
  return request({
    url: '/store/store/storeOrder/editErpPhone',
    method: 'post',
    data: data
  })
}

export function batchCreateErpOrder(data) {
  return request({
    url: '/store/store/storeOrder/batchCreateErpOrder',
    method: 'post',
    data: data
  })
}

export function batchSetErpOrder(data) {
  return request({
    url: '/store/store/storeOrder/batchSetErpOrder',
    method: 'post',
    data: data
  })
}


export function getErpAccount() {
  return request({
    url: '/store/store/storeOrder/getErpAccount',
    method: 'get'
  })
}

// 导出发货单
export function healthExportShippingOrder(query) {
  return request({
    url: '/store/store/storeOrder/healthExportShippingOrder',
    method: 'get',
    params: query
  })
}

// 订单确认审核
export function auditStoreOrder(data) {
  return request({
    url: '/store/store/storeOrder/batchAudit',
    method: 'post',
    data: data
  })
}

// 订单备注
export function orderRemark(data) {
  return request({
    url: '/store/store/storeOrder/remark',
    method: 'post',
    data: data
  })
}

// 修改订单代收金额
export function editPayDelivery(data) {
  return request({
    url: '/store/store/storeOrder/editPayDelivery',
    method: 'put',
    data: data
  })
}

// 待支付订单修改运费
export function editPayPostage(data) {
  return request({
    url: '/store/store/storeOrder/editPayPostage',
    method: 'put',
    data: data
  })
}
