import axios from "@/utils/request";

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

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


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

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

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


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


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

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

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


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

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

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

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

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

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

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



