import axios from "@/utils/request";

export function listOrder(query) {
  return axios({
    url: '/purchase/arrival/list',
    method: 'get',
    params: query
  })
}

export function auditListOrder(query) {
  return axios({
    url: '/purchase/arrival/auditList',
    method: 'get',
    params: query
  })
}


export function listOrderDetail(query) {
  return axios({
    url: '/purchase/arrival/list/detail',
    method: 'get',
    params: query
  })
}

export function getOrder(id) {
  return axios({
    url: '/purchase/arrival/' + id,
    method: 'get'
  })
}

export function addOrder(data) {
  return axios({
    url: '/purchase/arrival',
    method: 'post',
    data: data
  })
}


export function auditOrder(data) {
  return axios({
    url: '/purchase/arrival/auditOrder',
    method: 'post',
    data: data
  })
}


// 修改pur
export function updateOrder(data) {
  return axios({
    url: '/purchase/arrival',
    method: 'put',
    data: data
  })
}

// 删除pur
export function delOrder(id) {
  return axios({
    url: '/purchase/arrival/' + id,
    method: 'delete'
  })
}

export function inserThrOrderWeb(query) {
  return axios({
    url: "/purchase/arrival/postOrder",
    method: "post",
    data: query
  });
}


// 删除pur
export function delOrderDetail(id) {
  return axios({
    url: '/purchase/arrival/detail/' + id,
    method: 'delete'
  })
}

// 添加puan
export function addOrderId() {
  return axios({
    url: "/purchase/arrival/add",
    method: 'post'
  })
}

// 根据申购单添加详情表
export function addPlanDetailAndOrder(data) {
  return axios({
    url: "/purchase/arrival/addPlanDetailAndOrder",
    method: 'post',
    data: data
  })
}

// 添加详情表
export function addOrderDetail(data) {
  return axios({
    url: "/purchase/arrival/addOrderDetail",
    method: 'post',
    data: data
  })
}

// 查询详情表
export function selectOrderDetail(query) {
  return axios({
    url: "/purchase/arrival/list/detail",
    method: 'get',
    params: query
  })
}

//删除计划表和详情表
export function delOrderDetailAll(data) {
  return axios({
    url: "/purchase/arrival/delOrderDetailAll",
    method: 'post',
    data: data
  })
}

//更新pur
export function updateDetail(data) {
  return axios({
    url: "/purchase/arrival/updateDetail",
    method: 'post',
    data: data
  })
}



