import axios from "@/utils/request";
import request from "@/utils/request";

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

export function listItem(query) {
  return axios({
    url:  '/purchase/purInquiryOffer/list/item',
    method: 'get',
    params: query
  })
}

// 添加详情表
export function addPurInquiryItem(data) {
  return request({
    url:  "/purchase/purInquiryOffer/addPurInquiryItem",
    method: 'post',
    data: data
  })
}

// 添加puan
export function addPurInquiryId() {
  return request({
    url:  "/purchase/addPurInquiryOfferItem/add",
    method: 'post'
  })
}


// 查询详情表
export function selectPurInquiryDetail(query) {
  return request({
    url:  "/purchase/purInquiryOffer/list/detail",
    method: 'get',
    params: query
  })
}
// 查询详情表
export function listItemDetail(query) {
  return request({
    url:  "/purchase/purInquiryOffer/list/itemDetail",
    method: 'get',
    params: query
  })
}

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

//更新明细
export function updateItem(data) {
  return request({
    url:  "/purchase/purInquiryOffer/updateItem",
    method: 'post',
    data: data
  })
}


export function delInquiryItem(id) {
  return axios({
    url:  '/purchase/purInquiryOffer/item/' + id,
    method: 'delete'
  })
}

export function submitApproval(data) {
  return request({
    url:  "/purchase/purInquiryOffer/submitApproval",
    method: 'post',
    data: data
  })
}

