import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
* 出库管理/装配记录表分页查询
* @param {查询条件} data
*/
export function listOutAssembleRecord(query) {
  return request({
    url: 'business/OutAssembleRecord/list',
    method: 'get',
    params: query,
  })
}

export function statOutAssembleRecord(query) {
  return request({
    url: 'business/OutAssembleRecord/stat',
    method: 'get',
    params: query,
  })
}
/**
* 新增出库管理/装配记录表
* @param data
*/
export function addOutAssembleRecord(data) {
  return request({
    url: 'business/OutAssembleRecord',
    method: 'post',
    data: data,
  })
}

/**
* 修改出库管理/装配记录表
* @param data
*/
export function updateOutAssembleRecord(data) {
  return request({
    url: 'business/OutAssembleRecord',
    method: 'PUT',
    data: data,
  })
}

/**
* 获取出库管理/装配记录表详情
* @param {Id}
*/
export function getOutAssembleRecord(id) {
  return request({
    url: 'business/OutAssembleRecord/' + id,
    method: 'get'
  })
}

/**
* 删除出库管理/装配记录表
* @param {主键} pid
*/
export function delOutAssembleRecord(pid) {
  return request({
    url: 'business/OutAssembleRecord/' + pid,
    method: 'delete'
  })
}

// 清空出库管理/装配记录表
export function clearOutAssembleRecord() {
  return request({
    url: 'business/OutAssembleRecord/clean',
    method: 'delete'
  })
}

// 导出出库管理/装配记录表
export async function exportOutAssembleRecord(query) {
  await downFile('business/OutAssembleRecord/export', { ...query })
}

