import request from '@/utils/request'

// 查询结算账单列表
export function listSettlementBill(data) {
  return request({
    url: '/mapi/settlement/bill/listSettlementBill',
    method: 'post',
    data: data
  })
}

// 新增结算账单
export function insertSettlementBill(data) {
  return request({
    url: '/mapi/settlement/bill/insertSettlementBill',
    method: 'post',
    data: data
  })
}

// 删除结算费率
export function delRate(id) {
  return request({
    url: '/mapi/settlement/bill/' + id,
    method: 'delete'
  })
}


// 查询工厂结算列表
export function listFactorySettlement(data) {
  return request({
    url: '/mapi/settlement/bill/listFactorySettlement',
    method: 'post',
    data: data
  })
}
// 查询门店结算列表
export function listStoreSettlement(data) {
  return request({
    url: '/mapi/settlement/bill/listStoreSettlement',
    method: 'post',
    data: data
  })
}

// 工厂确认清算
export function confirmSettlementByFactory(data) {
  return request({
    url: '/mapi/settlement/bill/confirmSettlementByFactory',
    method: 'get',
    params: data
  })
}


// 门店结算详情
export function getInfoByStore(id) {
  return request({
    url: '/mapi/settlement/bill/getInfoByStore',
    method: 'get',
    params: { id:id }
  })
}
// 提交门店结算
export function submitStoreSettlement(data) {
  return request({
    url: '/mapi/settlement/bill/submitStoreSettlement',
    method: 'post',
    data: data
  })
}

// 获取门店经营日报数据
export function getDailyStatistics(query) {
  return request({
    url: '/mapi/settlement/store/statistics/daily',
    method: 'get',
    params: query
  })
}

// 获取门店经营日报趋势数据
export function getDailyTrend(query) {
  return request({
    url: '/mapi/settlement/store/statistics/trend',
    method: 'get',
    params: query
  })
}
