import request, { postBlob, handleImport, getBlob } from '@/utils/request'
export function getPlanCustomerListV2(params) {
  return request({
    url: `/plan/listCustomerV2?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}
export function exportPlanCustomerListV2(data, name) {
  return postBlob({
    url: '/plan/listCustomerV2/export',
    data,
    name
  })
}

export function getPurchaseOutListV2(params) {
  return request({
    url: `/stock/orderOutIn/listPurchaseOrderOutV2?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}
export function exportPurchaseOutListV2(data, name) {
  return postBlob({
    url: '/stock/orderOutIn/listPurchaseOrderOutV2/export',
    data,
    name
  })
}

export function getOtherStockInListV2(params) {
  return request({
    url: `/stock/orderOutIn/listOtherStockInV2?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}
export function exportOtherStockInListV2(data, name) {
  return postBlob({
    url: '/stock/orderOutIn/listOtherStockInV2/export',
    data,
    name
  })
}
export function getListOtherStockOutV2(params) {
  return request({
    url: `/stock/orderOutIn/listOtherStockOutV2?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}
export function exportListOtherStockOutV2(data, name) {
  return postBlob({
    url: '/stock/orderOutIn/listOtherStockOutV2/export',
    data,
    name
  })
}

export function getPlanListV2(params) {
  return request({
    url: `/plan/listCustomerV2?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}
export function exportPlanListV2(data, name) {
  return postBlob({
    url: '/plan/listCustomerV2/export/export',
    data,
    name
  })
}
export function getPurchaseOrderListV2(params) {
  return request({
    url: `/v2/purchaseOrder/list?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}
export function exportPurchaseOrderV2(data, name) {
  return postBlob({
    url: '/v2/purchaseOrder/list/export',
    data,
    name
  })
}

export function getPurchaseStockInListV2(params) {
  return request({
    url: `/v2/purchaseStockIn/list?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}
export function exportPurchaseStockInV2(data, name) {
  return postBlob({
    url: '/v2/purchaseStockIn/list/export',
    data,
    name
  })
}


// 获取采购单列表
export function getPurchaseList(params) {
  return request({
    url: '/purchaseOrder/list',
    method: 'get',
    params
  })
}

// 获取采购单列表
export function getPurchaseDetail(params) {
  return request({
    url: '/purchaseOrder/detail',
    method: 'get',
    params
  })
}

// 获取采购入库单列表
export function getEnterList(params) {
  return request({
    url: '/purchaseStockIn/list',
    method: 'get',
    params
  })
}

// 获取采购入库单列表
export function getEnterDetail(params) {
  return request({
    url: '/purchaseStockIn/detail',
    method: 'get',
    params
  })
}

// 获取采购计划单列表
export function getPlanList(params) {
  return request({
    url: '/plan/list',
    method: 'get',
    params
  })
}

// 获取经销商采购计划单汇总列表
export function getSumList(params) {
  return request({
    url: '/plan/listCustomer',
    method: 'get',
    params
  })
}

// 提交经销商采购计划单
export function submitPlan(params) {
  return request({
    url: '/plan/submitPlan',
    method: 'post',
    data: params
  })
}

// 采购退料列表
export function getPurchaseOutList(params) {
  return request({
    url: '/stock/orderOutIn/listPurchaseOrderOut',
    method: 'get',
    params
  })
}

// 其他入库列表
export function getOtherStockInList(params) {
  return request({
    url: '/stock/orderOutIn/listOtherStockIn',
    method: 'get',
    params
  })
}

// 其他出库列表
export function getOtherStockOutList(params) {
  return request({
    url: '/stock/orderOutIn/listOtherStockOut',
    method: 'get',
    params
  })
}

// 反审其他出库单
export function setApprovalOtherStockOut(params) {
  return request({
    url: '/stock/orderOutIn/trialApprovalOtherStockOut',
    method: 'post',
    params
  })
}
// 反审其他入库单
export function setApprovalPurchaseOrderIn(params) {
  return request({
    url: '/stock/orderOutIn/trialApprovalOtherStockIn',
    method: 'post',
    params
  })
}

// 反审采购退料单
export function setApprovalPurchaseOrderOut(params) {
  return request({
    url: '/stock/orderOutIn/trialApprovalPurchaseOrderOut',
    method: 'post',
    params
  })
}
