import request from '@/utils/request'

const baseUrl = import.meta.env.VITE_APP_BASE_API
const p2Url = import.meta.env.VITE_APP_P2_API
// 查询辅料管理列表
export function listAccessories(query) {
  return request({
    url: baseUrl + '/business/accessories/list',
    method: 'get',
    params: query
  })
}

// 查询辅料管理详细
export function getAccessories(id) {
  return request({
    url: baseUrl + '/business/accessories/' + id,
    method: 'get'
  })
}

// 新增辅料管理
export function addAccessories(data) {
  return request({
    url: baseUrl + '/business/accessories',
    method: 'post',
    data: data
  })
}

// 修改辅料管理
export function updateAccessories(data) {
  return request({
    url: baseUrl + '/business/accessories',
    method: 'put',
    data: data
  })
}

// 删除辅料管理
export function delAccessories(id) {
  return request({
    url: baseUrl + '/business/accessories/' + id,
    method: 'delete'
  })
}

export function getP2Accessories() {
  return request({
    url: p2Url + '/business/inw10100/getP2Accessories',
    method: 'get'
  })
}
