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

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

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

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

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


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

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

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


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

//发起报价
export function submitOffer(data) {
  return request({
    url:  "/purchase/purInquiry/submitOffer",
    method: 'post',
    data: data
  })
}
