import request, { postBlob, handleImport, getBlob } from '@/utils/request'

export function getSumListV2(data) {
  return request({
    url: `/invoice/listV2?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}


export function exportSumListV2(data, name) {
  return postBlob({
    url: '/invoice/listV2/export',
    method: 'post',
    data,
    name
  })
}

// 获取列表 - 零售发货单
export function getDeliverList(params) {
  return request({
    url: '/ship/list',
    method: 'get',
    params
  })
}

// 获取详情 - 零售发货单
export function getDeliverDetail(params) {
  return request({
    url: '/ship/detail',
    method: 'get',
    params
  })
}

// 获取密码
export function getPassword(params) {
  return request({
    url: '/ship/shipPassword',
    method: 'post',
    params
  })
}

// 获取密码记录
export function getPasswordRecord(params) {
  return request({
    url: '/ship/listShipPassword',
    method: 'get',
    params
  })
}

// 工程申请发货单-列表V2
export function invoiceListProjectV2(data) {
  return request({
    url: `/invoice/listProjectV2?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

//工程申请发货单-列表V2导出
export function invoiceListProjectV2Export(data, name) {
  return postBlob({
    url: '/invoice/listProjectV2/export',
    method: 'post',
    data,
    name
  })
}

// 获取列表 - 工程发货单
export function getEnginList(params) {
  return request({
    url: '/ship/listProject',
    method: 'get',
    params
  })
}

// 获取详情 - 工程发货单
export function getEnginDetail(params) {
  return request({
    url: '/ship/detailProject',
    method: 'get',
    params
  })
}

// 获取列表 - 汇总
export function getSumList(params) {
  return request({
    url: '/invoice/listInvoice',
    method: 'get',
    params
  })
}
