import request, { postBlob } from '@/utils/request'

export function getNewPurchaseApplySheetList(data) {
  return request({
    url: `/websit/purchase/apply/list?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

// 导出
export function exportNewPurchaseApplySheetList(data, name) {
  return postBlob({
    url: '/websit/purchase/apply/list/export',
    data,
    name
  })
}

// 提交采购申请单
export function submitPurchaseApplySheet(params) {
  return request({
    url: '/websit/purchase/apply/submit',
    method: 'post',
    params
  })
}

// 撤消采购申请单
export function revokePurchaseApplySheet(params) {
  return request({
    url: '/websit/purchase/apply/revoke',
    method: 'post',
    params
  })
}

// 删除采购申请单
export function delPurchaseApplySheet(data) {
  return request({
    url: '/websit/purchase/apply/batch/del',
    method: 'post',
    data
  })
}

// 获取采购申请单信息
export function getPurchaseApplySheet(params) {
  return request({
    url: '/websit/purchase/apply/detail',
    method: 'post',
    params
  })
}

// 新增采购申请单
export function addPurchaseApplySheet(params) {
  return request({
    url: '/websit/purchase/apply/add',
    method: 'post',
    data: params
  })
}

// 编辑采购申请单
export function editPurchaseApplySheet(params) {
  return request({
    url: '/websit/purchase/apply/edit',
    method: 'post',
    data: params
  })
}
