import request, { postBlob, handleImport, getBlob } from '@/utils/request'
export function getListStockToDayV2(params) {
  return request({
    url: `/stock/manager/listStockToDayV2?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}

export function exportListStockToDayV2(data, name) {
  return postBlob({
    url: '/stock/manager/listStockToDayV2/export',
    data,
    name
  })
}

export function getListStockToDayCustomerV2(params) {
  return request({
    url: `/stock/manager/listStockToDayCustomerV2?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}

export function exportListStockToDayCustomerV2(data, name) {
  return postBlob({
    url: '/stock/manager/listStockToDayCustomerV2/export',
    data,
    name
  })
}

export function getStockListV2(params) {
  return request({
    url: `/stock/manager/listV2?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}

export function exportStockListV2(data, name) {
  return postBlob({
    url: '/stock/manager/listV2/export',
    data,
    name
  })
}

export function getStockManagerListV2(params) {
  return request({
    url: `/stock/manager/listCustomerV2?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}

export function exportStockManagerListV2(data, name) {
  return postBlob({
    url: '/stock/manager/listCustomerV2/export',
    data,
    name
  })
}


// 获取库存列表
export function getStockList(params) {
  return request({
    url: '/stock/manager/list',
    method: 'get',
    params
  })
}

// 获取仓库列表
export function getWarehouseList(params) {
  return request({
    url: '/stock/listStock',
    method: 'get',
    params
  })
}

// 获取仓储费报表列表
export function getListStorageFee(params) {
  return request({
    url: '/sale/order/listStorageFee',
    method: 'get',
    params
  })
}

// 获取销售类型列表
export function getSalesTypeList(params) {
  return request({
    url: '/sale/type/list',
    method: 'get',
    params
  })
}

// 获取经销商仓库现存列表
export function getListStockToDayCustomer(params) {
  return request({
    url: '/stock/manager/listStockToDayCustomer',
    method: 'get',
    params
  })
}

// 获取预留库存列表
export function getReservedList(params) {
  return request({
    url: '/stock/manager/listCustomer',
    method: 'get',
    params
  })
}

// 获取仓库现存列表
export function getListStockToDay(params) {
  return request({
    url: '/stock/manager/listStockToDay',
    method: 'get',
    params
  })
}

// 库存到货访问通知-列表
export function getNoticeList(params) {
  return request({
    url: '/stock/visit/list',
    method: 'get',
    params
  })
}
// 库存到货访问通知-列表
export function getArrivalNotice(params) {
  return request({
    url: '/stock/visit/list',
    method: 'get',
    params
  })
}

// 库存到货访问通知-数量
export function getNoticeNum(params) {
  return request({
    url: '/stock/visit/count',
    method: 'get',
    params
  })
}

// 经销商仓库库存列表(前置)
export function getcustomerFrontList(params) {
  return request({
    url: `/customer/front/list?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}

// 经销商仓库库存导出（前置）
export function partsNewInExport(data, name) {
  return postBlob({
    url: '/customer/front/list/export',
    data,
    name
  })
}

// 经销商仓库库存列表(商家)
export function getFrontListCustomer(params) {
  return request({
    url: `/customer/front/listCustomer?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}

// 经销商仓库库存导出（商家）

export function exportCustomer(data, name) {
  return postBlob({
    url: '/customer/front/list/exportCustomer',
    data,
    name
  })
}

// 库存调整管理
export function getFrontListCustomerAcc(params) {
  console.log(params);
  return request({
    url: `/customer/front/listCustomerAcc?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}

// 经销商仓库库存导出（商家）
export function exportCustomerStockOrderBean(data, name) {
  return postBlob({
    url: '/customer/front/list/exportCustomerStockOrderBean',
    data,
    name
  })
}

// 库存调整管理三级帐
export function getFrontListStockAcc(params) {
  return request({
    url: `/customer/front/listStockAcc?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}

// 经销商三级帐
export function exportListStockAcc(data, name) {
  return postBlob({
    url: '/customer/front/listStockAcc/exportListStockAcc',
    data,
    name
  })
}

// 新增库存调整
export function addCustomerStockOrder(params) {
  return request({
    url: '/customer/front/addCustomerStockOrder',
    method: 'post',
    data: params
  })
}

// 审批库存调整
export function approvalCustomerStockOrder(params) {
  return request({
    url: '/customer/front/approvalCustomerStockOrder',
    method: 'post',
    data: params
  })
}

// 库存调整详情
export function getFrontDetail(params) {
  return request({
    url: '/customer/front/detail',
    method: 'get',
    params
  })
}

// 库存调整详情
export function deleteCustomerStockOrder(params) {
  return request({
    url: '/customer/front/deleteCustomerStockOrder',
    method: 'post',
    data: params
  })
}

// 导入
export function partsNewInImport(data) {
  return handleImport("/customer/front/importData", data.formdata, data.id || "");
}

// 下载模板
export function workerTemplateExcel(data, name) {
  return getBlob({
    url: "/customer/front/download",
    data,
    name
  });
}




// 出库条码管理列表
export function getSalseList(params) {
  return request({
    url: `/sale/code/list?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}

// 下载模板
export function salseCodeDownload(data, name) {
  return getBlob({
    url: "/sale/code/download",
    data,
    name
  });
}

// 导入
export function salseImport(data) {
  return handleImport("/sale/code/importData", data.formdata, data.id || "");
}


// 出库条码管理导出
export function salseExport(data, name) {
  return postBlob({
    url: '/sale/code/list/export',
    data,
    name
  })
}


// 导入库存初始化
export function kunCunImportData(data) {
  return handleImport("/customer/front/kunCunImportData", data.formdata, data.id || "");
}

// 导入库存调整
export function kunCunTiaoImportData(data) {
  return handleImport("/customer/front/kunCunTiaoImportData", data.formdata, data.id || "");
}

export function downloadkunCunDownload(data, name) {
  return getBlob({
    url: 'customer/front/kunCunDownload',
    data,
    name
  })
}

export function saleStorageFeeListStorageFee(params) {
  return request({
    url: '/sale/storageFee/listStorageFee',
    method: 'get',
    params
  })
}
