import request from '@/utils/request'

// 分页查询出入库单据列表
export function pageListCkbill(query) {
  return request({
    url: '/jxc/ckbill/pageList',
    method: 'get',
    params: query
  })
}
// 分页查询出入库单据列表（全部
export function stockPageListCkbill(query) {
  return request({
    url: '/jxc/ckbill/stockPageList',
    method: 'get',
    params: query
  })
}
export function mixtureList(query) {
  return request({
    url: '/jxc/ckbill/mixtureList',
    method: 'get',
    params: query
  })
}

export function recallTransfer(id) {
  return request({
    url: '/jxc/ckbill/recallTransfer/' + id,
    method: 'get'
  })
}

export function deleteBill(id) {
  return request({
    url: '/jxc/ckbill/deleteBill/' + id,
    method: 'get'
  })
}
export function recallMixture(id) {
  return request({
    url: '/jxc/ckbill/recallMixture/' + id,
    method: 'get'
  })
}

export function transferList(query) {
  return request({
    url: '/jxc/ckbill/transferList',
    method: 'get',
    params: query
  })
}
export function getMixtureInfo(id) {
  return request({
    url: '/jxc/ckbill/getMixtureInfo/' + id,
    method: 'get'
  })
}
export function getTransferInfo(id) {
  return request({
    url: '/jxc/ckbill/getTransferInfo/' + id,
    method: 'get'
  })
}

// 查询出入库单据列表
export function listCkbill(query) {
  return request({
    url: '/jxc/ckbill/list',
    method: 'get',
    params: query
  })
}

// 查询出入库单据详细
export function getCkbill(id) {
  return request({
    url: '/jxc/ckbill/' + id,
    method: 'get'
  })
}
// 查询出入库单据详细加明细
export function getCkbillInfo(id) {
  return request({
    url: '/jxc/ckbill/getBillInfo/' + id,
    method: 'get'
  })
}
export function addTransfer(data) {
  return request({
    url: '/jxc/ckbill/addTransfer',
    method: 'post',
    data: data
  })
}
// 新增出入库单据
export function addCkbill(data) {
  return request({
    url: '/jxc/ckbill',
    method: 'post',
    data: data
  })
}
export function addMixture(data) {
  return request({
    url: '/jxc/ckbill/addMixture',
    method: 'post',
    data: data
  })
}

export function outBill(data) {
  return request({
    url: '/jxc/ckbill/outBill',
    method: 'post',
    data: data
  })
}
export function putBill(data) {
  return request({
    url: '/jxc/ckbill/putBill',
    method: 'post',
    data: data
  })
}

// 修改出入库单据
export function updateCkbill(data) {
  return request({
    url: '/jxc/ckbill',
    method: 'put',
    data: data
  })
}

// 删除出入库单据
export function delCkbill(id) {
  return request({
    url: '/jxc/ckbill/' + id,
    method: 'delete'
  })
}

// 导出出入库单据
export function exportCkbill(query) {
  return request({
    url: '/jxc/ckbill/' + 'export',
    method: 'post',
    params: query
  })
}
